From ac779d46d7e664d00c05e556ce8e92c43db40c34 Mon Sep 17 00:00:00 2001 From: tobspr Date: Mon, 18 May 2015 17:54:28 +0200 Subject: [PATCH 1/7] Fix typos in interrogate --- dtool/src/interrogate/interrogate.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogate/interrogate.cxx b/dtool/src/interrogate/interrogate.cxx index 15abba6ac2..7e7e6e8280 100644 --- a/dtool/src/interrogate/interrogate.cxx +++ b/dtool/src/interrogate/interrogate.cxx @@ -550,7 +550,7 @@ main(int argc, char **argv) { output_include << "/*\n" - << " * This file generated by:\n" + << " * This file was generated by:\n" << " * " << command_line << "\n" << " *\n" << " */\n\n"; @@ -572,7 +572,7 @@ main(int argc, char **argv) { output_code << "/*\n" - << " * This file generated by:\n" + << " * This file was generated by:\n" << " * " << command_line << "\n" << " *\n" << " */\n\n"; From 32bfe0bafc51c014ce8d9fe4f510a6de5b937737 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Sat, 30 May 2015 21:56:50 -0500 Subject: [PATCH 2/7] Add a few missing keys to libRocket keymap libRocket calls some keys "OEM" which map to ASCII characters in non-predictable places. Since Panda3D is providing these values to libRocket from well-known sources, it seems a lesser evil to use the default US English mappings rather than losing the events entirely. --- panda/src/rocket/rocketInputHandler.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/panda/src/rocket/rocketInputHandler.cxx b/panda/src/rocket/rocketInputHandler.cxx index 58408ae08e..71ea099192 100644 --- a/panda/src/rocket/rocketInputHandler.cxx +++ b/panda/src/rocket/rocketInputHandler.cxx @@ -113,6 +113,22 @@ get_rocket_key(const ButtonHandle handle) { keymap[KeyboardButton::rshift().get_index()] = KI_RSHIFT; keymap[KeyboardButton::scroll_lock().get_index()] = KI_SCROLL; + // these "OEM" keys have standard mappings in Panda3D + keymap[KeyboardButton::ascii_key(';').get_index()] = KI_OEM_1; + keymap[KeyboardButton::ascii_key('=').get_index()] = KI_OEM_PLUS; + keymap[KeyboardButton::ascii_key(',').get_index()] = KI_OEM_COMMA; + keymap[KeyboardButton::ascii_key('-').get_index()] = KI_OEM_MINUS; + keymap[KeyboardButton::ascii_key('.').get_index()] = KI_OEM_PERIOD; + keymap[KeyboardButton::ascii_key('/').get_index()] = KI_OEM_2; + keymap[KeyboardButton::ascii_key('`').get_index()] = KI_OEM_3; + keymap[KeyboardButton::ascii_key('[').get_index()] = KI_OEM_4; + keymap[KeyboardButton::ascii_key('\\').get_index()] = KI_OEM_5; + keymap[KeyboardButton::ascii_key(']').get_index()] = KI_OEM_6; + + // comment says this may either be "<>" or "\|", but "\" (unshifted) is handled already, + // and "<" is only available "shifted" on 101-keyboards, so assume it's this one... + keymap[KeyboardButton::ascii_key('<').get_index()] = KI_OEM_102; + for (char c = 'a'; c <= 'z'; ++c) { keymap[KeyboardButton::ascii_key(c).get_index()] = (c - 'a') + KI_A; } From 4c5a540dc95c98878749943e9068915dac9e2ddf Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Sun, 31 May 2015 10:26:01 -0500 Subject: [PATCH 3/7] Add a color and config variable for the pstats "*" category --- panda/src/pstatclient/pStatProperties.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/pstatclient/pStatProperties.cxx b/panda/src/pstatclient/pStatProperties.cxx index ff8cfa0052..27356576f9 100644 --- a/panda/src/pstatclient/pStatProperties.cxx +++ b/panda/src/pstatclient/pStatProperties.cxx @@ -129,6 +129,7 @@ static TimeCollectorProperties time_properties[] = { { 1, "Cull", { 0.21, 0.68, 0.37 }, 1.0 / 30.0 }, { 1, "Cull:Setup", { 0.7, 0.4, 0.5 } }, { 1, "Cull:Sort", { 0.3, 0.3, 0.6 } }, + { 1, "*", { 0.1, 0.1, 0.5 } }, { 1, "*:Show fps", { 0.5, 0.8, 1.0 } }, { 0, "*:Munge", { 0.3, 0.3, 0.9 } }, { 1, "*:Munge:Geom", { 0.4, 0.2, 0.8 } }, From cc62e731b7e4541a7f39c1f58918db722a61a2a6 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 1 Jun 2015 00:21:32 +0200 Subject: [PATCH 4/7] Fix compilation with ppremake --- direct/src/http/baseincomingset.i | 2 +- dtool/src/cppparser/Sources.pp | 4 +-- dtool/src/dtoolbase/Sources.pp | 8 +++-- dtool/src/parser-inc/stdtypedefs.h | 2 -- panda/src/express/Sources.pp | 4 +++ panda/src/gobj/Sources.pp | 11 +++++-- panda/src/linmath/Sources.pp | 30 +++++-------------- panda/src/mathutil/Sources.pp | 12 ++++---- panda/src/pgraph/cullTraverserData.h | 1 + panda/src/pnmimage/Sources.pp | 4 +++ panda/src/putil/Sources.pp | 7 +++-- panda/src/tform/Sources.pp | 2 +- .../src/imageprogs/imageFixHiddenColor.cxx | 6 ++-- .../src/imageprogs/imageTransformColors.cxx | 14 ++++----- 14 files changed, 55 insertions(+), 52 deletions(-) diff --git a/direct/src/http/baseincomingset.i b/direct/src/http/baseincomingset.i index 32cdf8eaee..75d931f538 100644 --- a/direct/src/http/baseincomingset.i +++ b/direct/src/http/baseincomingset.i @@ -70,7 +70,7 @@ inline int BaseIncomingSet<_INCLASS1,_IN_LISTEN,MESSAGE_READER_BUF,MESSAGE_READE template inline void BaseIncomingSet<_INCLASS1,_IN_LISTEN,MESSAGE_READER_BUF,MESSAGE_READER_UPPASS>::AddAConection(_INCLASS1 * newt) { - push_back(newt); + this->push_back(newt); } //////////////////////////////////////////////////////////////////// // Function name : BaseIncomingSet<_INCLASS1,_IN_LISTEN,MESSAGE_READER_BUF,MESSAGE_READER_UPPASS>::BaseIncomingSet diff --git a/dtool/src/cppparser/Sources.pp b/dtool/src/cppparser/Sources.pp index c5ff050468..46aa8634e9 100644 --- a/dtool/src/cppparser/Sources.pp +++ b/dtool/src/cppparser/Sources.pp @@ -22,7 +22,7 @@ cppSimpleType.h cppStructType.h cppTBDType.h \ cppTemplateParameterList.h cppTemplateScope.h cppToken.h \ cppType.h cppTypeDeclaration.h cppTypeParser.h \ - cppTypeProxy.h cppTypedef.h cppUsing.h cppVisibility.h + cppTypeProxy.h cppTypedefType.h cppUsing.h cppVisibility.h #define INCLUDED_SOURCES \ cppArrayType.cxx cppClassTemplateParameter.cxx \ @@ -38,7 +38,7 @@ cppStructType.cxx cppTBDType.cxx \ cppTemplateParameterList.cxx cppTemplateScope.cxx \ cppToken.cxx cppType.cxx cppTypeDeclaration.cxx \ - cppTypeParser.cxx cppTypeProxy.cxx cppTypedef.cxx \ + cppTypeParser.cxx cppTypeProxy.cxx cppTypedefType.cxx \ cppUsing.cxx cppVisibility.cxx #end static_lib_target diff --git a/dtool/src/dtoolbase/Sources.pp b/dtool/src/dtoolbase/Sources.pp index e6387f27e7..c44e2d7de0 100644 --- a/dtool/src/dtoolbase/Sources.pp +++ b/dtool/src/dtoolbase/Sources.pp @@ -10,6 +10,7 @@ addHash.I addHash.h \ atomicAdjust.h \ atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I \ + atomicAdjustGccImpl.h atomicAdjustGccImpl.I \ atomicAdjustI386Impl.h atomicAdjustI386Impl.I \ atomicAdjustPosixImpl.h atomicAdjustPosixImpl.I \ atomicAdjustWin32Impl.h atomicAdjustWin32Impl.I \ @@ -30,7 +31,7 @@ nearly_zero.h \ neverFreeMemory.h neverFreeMemory.I \ numeric_types.h \ - pstrtod.h \ + pdtoa.h pstrtod.h \ register_type.I register_type.h \ selectThreadImpl.h \ stl_compares.I stl_compares.h \ @@ -47,6 +48,7 @@ #define INCLUDED_SOURCES \ addHash.cxx \ atomicAdjustDummyImpl.cxx \ + atomicAdjustGccImpl.cxx \ atomicAdjustI386Impl.cxx \ atomicAdjustPosixImpl.cxx \ atomicAdjustWin32Impl.cxx \ @@ -59,6 +61,7 @@ mutexWin32Impl.cxx \ mutexSpinlockImpl.cxx \ neverFreeMemory.cxx \ + pdtoa.cxx \ pstrtod.cxx \ register_type.cxx \ typeHandle.cxx \ @@ -69,6 +72,7 @@ addHash.I addHash.h \ atomicAdjust.h \ atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I \ + atomicAdjustGccImpl.h atomicAdjustGccImpl.I \ atomicAdjustI386Impl.h atomicAdjustI386Impl.I \ atomicAdjustPosixImpl.h atomicAdjustPosixImpl.I \ atomicAdjustWin32Impl.h atomicAdjustWin32Impl.I \ @@ -89,7 +93,7 @@ nearly_zero.h \ neverFreeMemory.h neverFreeMemory.I \ numeric_types.h \ - pstrtod.h \ + pdtoa.h pstrtod.h \ register_type.I register_type.h \ selectThreadImpl.h \ stl_compares.I stl_compares.h \ diff --git a/dtool/src/parser-inc/stdtypedefs.h b/dtool/src/parser-inc/stdtypedefs.h index 34b9b0b4c6..56d95508f7 100644 --- a/dtool/src/parser-inc/stdtypedefs.h +++ b/dtool/src/parser-inc/stdtypedefs.h @@ -44,7 +44,5 @@ typedef unsigned char uchar; #define NULL ((void *)0) #endif -typedef int fd_set; - #endif diff --git a/panda/src/express/Sources.pp b/panda/src/express/Sources.pp index dcec931471..150d0f421d 100644 --- a/panda/src/express/Sources.pp +++ b/panda/src/express/Sources.pp @@ -23,7 +23,9 @@ encrypt_string.h \ error_utils.h \ export_dtool.h \ + filename_ext.h \ fileReference.h fileReference.I \ + globPattern_ext.h \ hashGeneratorBase.I hashGeneratorBase.h \ hashVal.I hashVal.h \ indirectLess.I indirectLess.h \ @@ -45,6 +47,7 @@ patchfile.I patchfile.h \ pointerTo.I pointerTo.h \ pointerToArray.I pointerToArray.h \ + pointerToArray_ext.h \ pointerToArrayBase.I pointerToArrayBase.h \ pointerToBase.I pointerToBase.h \ pointerToVoid.I pointerToVoid.h \ @@ -61,6 +64,7 @@ threadSafePointerTo.I threadSafePointerTo.h \ threadSafePointerToBase.I threadSafePointerToBase.h \ trueClock.I trueClock.h \ + typeHandle_ext.h \ typedReferenceCount.I typedReferenceCount.h typedef.h \ vector_uchar.h vector_double.h vector_float.h \ vector_stdfloat.h \ diff --git a/panda/src/gobj/Sources.pp b/panda/src/gobj/Sources.pp index 7ac03ff431..5c74dac9d3 100644 --- a/panda/src/gobj/Sources.pp +++ b/panda/src/gobj/Sources.pp @@ -50,9 +50,11 @@ matrixLens.I matrixLens.h \ occlusionQueryContext.I occlusionQueryContext.h \ orthographicLens.I orthographicLens.h perspectiveLens.I \ + paramTexture.I paramTexture.h \ perspectiveLens.h \ preparedGraphicsObjects.I preparedGraphicsObjects.h \ queryContext.I queryContext.h \ + samplerState.I samplerState.h \ savedContext.I savedContext.h \ shader.I shader.h \ shaderContext.h shaderContext.I \ @@ -61,6 +63,7 @@ sliderTable.I sliderTable.h \ texture.I texture.h \ textureCollection.I textureCollection.h \ + textureCollection_ext.h \ textureContext.I textureContext.h \ texturePeeker.I texturePeeker.h \ texturePool.I texturePool.h \ @@ -123,9 +126,11 @@ materialPool.cxx matrixLens.cxx \ occlusionQueryContext.cxx \ orthographicLens.cxx \ + paramTexture.cxx \ perspectiveLens.cxx \ preparedGraphicsObjects.cxx \ queryContext.cxx \ + samplerState.cxx \ savedContext.cxx \ shader.cxx \ shaderContext.cxx \ @@ -196,10 +201,12 @@ material.I material.h \ materialPool.I materialPool.h matrixLens.I matrixLens.h \ occlusionQueryContext.I occlusionQueryContext.h \ - orthographicLens.I orthographicLens.h perspectiveLens.I \ - perspectiveLens.h \ + orthographicLens.I orthographicLens.h \ + paramTexture.I paramTexture.h \ + perspectiveLens.I perspectiveLens.h \ preparedGraphicsObjects.I preparedGraphicsObjects.h \ queryContext.I queryContext.h \ + samplerState.I samplerState.h \ savedContext.I savedContext.h \ shader.I shader.h \ shaderContext.h shaderContext.I \ diff --git a/panda/src/linmath/Sources.pp b/panda/src/linmath/Sources.pp index e4134e688e..286d812509 100644 --- a/panda/src/linmath/Sources.pp +++ b/panda/src/linmath/Sources.pp @@ -11,33 +11,19 @@ #define SOURCES \ aa_luse.h \ compose_matrix.h compose_matrix_src.I \ - compose_matrix_src.cxx compose_matrix_src.h config_linmath.h \ + config_linmath.h \ configVariableColor.h configVariableColor.I \ coordinateSystem.h dbl2fltnames.h dblnames.h \ deg_2_rad.h deg_2_rad.I \ - flt2dblnames.h fltnames.h intnames.h lcast_to.h lcast_to_src.h \ - lcast_to_src.I lmatrix.h lmatrix_ext.h lmatrix3_src.I \ - lmatrix3_src.cxx lmatrix3_src.h lmatrix4_src.I \ - lmatrix4_src.cxx lmatrix4_src.h lorientation.h \ - lorientation_src.I lorientation_src.cxx lorientation_src.h \ - lpoint2.h lpoint2_src.I lpoint2_src.cxx lpoint2_src.h \ - lpoint3.h lpoint3_src.I lpoint3_src.cxx lpoint3_src.h \ - lpoint4.h lpoint4_src.I lpoint4_src.cxx lpoint4_src.h \ - lquaternion.h lquaternion_src.I lquaternion_src.cxx \ - lquaternion_src.h lrotation.h lrotation_src.I \ - lrotation_src.cxx lrotation_src.h \ + flt2dblnames.h fltnames.h intnames.h lcast_to.h \ + lmatrix.h lmatrix_ext.h lorientation.h \ + lpoint2.h lpoint3.h lpoint4.h \ + lquaternion.h lrotation.h \ lsimpleMatrix.h lsimpleMatrix.I \ luse.I luse.N luse.h \ - lvec2_ops.h lvec2_ops_src.I lvec2_ops_src.h lvec3_ops.h \ - lvec3_ops_src.I lvec3_ops_src.h lvec4_ops.h lvec4_ops_src.I \ - lvec4_ops_src.h \ - lvecBase2.h lvecBase2_src.I lvecBase2_src.cxx lvecBase2_src.h \ - lvecBase3.h lvecBase3_src.I lvecBase3_src.cxx lvecBase3_src.h \ - lvecBase4.h lvecBase4_src.I lvecBase4_src.cxx lvecBase4_src.h \ - lvector2.h lvector2_src.I lvector2_src.cxx lvector2_src.h \ - lvector3.h lvector3_src.I lvector3_src.cxx lvector3_src.h \ - lvector4.h lvector4_src.I lvector4_src.cxx lvector4_src.h \ - lvector4.h lvector4_src.I lvector4_src.cxx lvector4_src.h \ + lvec2_ops.h lvec3_ops.h lvec4_ops.h \ + lvecBase2.h lvecBase3.h lvecBase4.h \ + lvector2.h lvector3.h lvector4.h \ lvecBase2_ext.h lvecBase3_ext.h lvecBase4_ext.h \ lpoint2_ext.h lpoint3_ext.h lpoint4_ext.h \ lvector2_ext.h lvector3_ext.h lvector4_ext.h \ diff --git a/panda/src/mathutil/Sources.pp b/panda/src/mathutil/Sources.pp index 2c9b169a00..4a1b4de454 100644 --- a/panda/src/mathutil/Sources.pp +++ b/panda/src/mathutil/Sources.pp @@ -18,25 +18,23 @@ boundingSphere.I boundingSphere.h \ boundingVolume.I boundingVolume.h config_mathutil.h \ fftCompressor.h finiteBoundingVolume.h frustum.h \ - frustum_src.I frustum_src.h geometricBoundingVolume.I \ - geometricBoundingVolume.h \ + geometricBoundingVolume.I geometricBoundingVolume.h \ intersectionBoundingVolume.h intersectionBoundingVolume.I \ linmath_events.h \ - look_at.h look_at_src.I \ - look_at_src.cxx look_at_src.h \ + look_at.h \ linmath_events.h \ mersenne.h \ omniBoundingVolume.I \ omniBoundingVolume.h \ - parabola.h parabola_src.I parabola_src.cxx parabola_src.h \ + parabola.h \ perlinNoise.h perlinNoise.I \ perlinNoise2.h perlinNoise2.I \ perlinNoise3.h perlinNoise3.I \ - plane.h plane_src.I plane_src.cxx plane_src.h \ + plane.h \ pta_LMatrix4.h pta_LMatrix3.h pta_LVecBase3.h \ pta_LVecBase4.h pta_LVecBase2.h \ randomizer.h randomizer.I \ - rotate_to.h rotate_to_src.cxx \ + rotate_to.h \ stackedPerlinNoise2.h stackedPerlinNoise2.I \ stackedPerlinNoise3.h stackedPerlinNoise3.I \ triangulator.h triangulator.I \ diff --git a/panda/src/pgraph/cullTraverserData.h b/panda/src/pgraph/cullTraverserData.h index 73c1b137c2..a8b3da130c 100644 --- a/panda/src/pgraph/cullTraverserData.h +++ b/panda/src/pgraph/cullTraverserData.h @@ -92,6 +92,7 @@ private: static CPT(RenderState) get_fake_view_frustum_cull_state(); }; +/* okcircular */ #include "cullTraverser.h" #include "cullTraverserData.I" diff --git a/panda/src/pnmimage/Sources.pp b/panda/src/pnmimage/Sources.pp index 8ab8efb55b..3b3863cb98 100644 --- a/panda/src/pnmimage/Sources.pp +++ b/panda/src/pnmimage/Sources.pp @@ -11,6 +11,8 @@ #define SOURCES \ config_pnmimage.h \ + convert_srgb.I convert_srgb.h \ + convert_srgb_sse2.cxx \ pfmFile.I pfmFile.h \ pfmFile_ext.cxx pfmFile_ext.h \ pnmbitio.h \ @@ -24,6 +26,7 @@ #define INCLUDED_SOURCES \ config_pnmimage.cxx \ + convert_srgb.cxx \ pfmFile.cxx \ pnm-image-filter.cxx \ pnmbitio.cxx \ @@ -36,6 +39,7 @@ #define INSTALL_HEADERS \ config_pnmimage.h \ + convert_srgb.I convert_srgb.h \ pfmFile.I pfmFile.h \ pfmFile_ext.cxx pfmFile_ext.h \ pnmBrush.h pnmBrush.I \ diff --git a/panda/src/putil/Sources.pp b/panda/src/putil/Sources.pp index 9092bb4292..aea7e90733 100644 --- a/panda/src/putil/Sources.pp +++ b/panda/src/putil/Sources.pp @@ -29,7 +29,7 @@ callbackObject.h callbackObject.I \ callbackObject_ext.h callbackObject_ext.I \ clockObject.h clockObject.I \ - collideMask.h \ + colorSpace.h collideMask.h \ copyOnWriteObject.h copyOnWriteObject.I \ copyOnWritePointer.h copyOnWritePointer.I \ compareTo.I compareTo.h \ @@ -91,9 +91,10 @@ callbackData.cxx \ callbackObject.cxx \ clockObject.cxx \ + colorSpace.cxx \ + config_util.cxx configurable.cxx \ copyOnWriteObject.cxx \ copyOnWritePointer.cxx \ - config_util.cxx configurable.cxx \ cPointerCallbackObject.cxx \ datagramInputFile.cxx datagramOutputFile.cxx \ doubleBitMask.cxx \ @@ -141,7 +142,7 @@ callbackObject.h callbackObject.I \ callbackObject_ext.h callbackObject_ext.I \ clockObject.h clockObject.I \ - collideMask.h \ + colorSpace.h collideMask.h \ copyOnWriteObject.h copyOnWriteObject.I \ copyOnWritePointer.h copyOnWritePointer.I \ compareTo.I compareTo.h \ diff --git a/panda/src/tform/Sources.pp b/panda/src/tform/Sources.pp index d57c054cc2..42894003fa 100644 --- a/panda/src/tform/Sources.pp +++ b/panda/src/tform/Sources.pp @@ -31,7 +31,7 @@ mouseWatcher.cxx \ mouseWatcherBase.cxx \ mouseWatcherGroup.cxx \ - mouseWatcherParameter.cxx + mouseWatcherParameter.cxx \ mouseWatcherRegion.cxx \ trackball.cxx \ transform2sg.cxx diff --git a/pandatool/src/imageprogs/imageFixHiddenColor.cxx b/pandatool/src/imageprogs/imageFixHiddenColor.cxx index 682cc8dd1b..bd291e9e57 100644 --- a/pandatool/src/imageprogs/imageFixHiddenColor.cxx +++ b/pandatool/src/imageprogs/imageFixHiddenColor.cxx @@ -111,7 +111,7 @@ run() { // First, get the average color of all the opaque pixels. int count = 0; - LRGBColord color(0.0, 0.0, 0.0); + LRGBColor color(0.0, 0.0, 0.0); int xi, yi; for (yi = 0; yi < _image.get_y_size(); ++yi) { for (xi = 0; xi < _image.get_x_size(); ++xi) { @@ -127,7 +127,7 @@ run() { } color /= (double)count; nout << " average color of " << count << " opaque pixels is " << color << "\n"; - + // Now, apply that wherever there are transparent pixels. count = 0; for (yi = 0; yi < _image.get_y_size(); ++yi) { @@ -143,7 +143,7 @@ run() { exit(1); } nout << " applied to " << count << " transparent pixels.\n"; - + write_image(_image); } diff --git a/pandatool/src/imageprogs/imageTransformColors.cxx b/pandatool/src/imageprogs/imageTransformColors.cxx index 118ef0f5c1..6ff358b9a6 100644 --- a/pandatool/src/imageprogs/imageTransformColors.cxx +++ b/pandatool/src/imageprogs/imageTransformColors.cxx @@ -477,19 +477,19 @@ process_image(PNMImage &image) { if (_hls) { for (int yi = 0; yi < image.get_y_size(); ++yi) { for (int xi = 0; xi < image.get_x_size(); ++xi) { - LRGBColord rgb = image.get_xel(xi, yi); + LRGBColord rgb = LCAST(double, image.get_xel(xi, yi)); rgb = hls2rgb(_mat.xform_point(rgb2hls(rgb))); - image.set_xel(xi, yi, rgb); + image.set_xel(xi, yi, LCAST(float, rgb)); } - } - } else { + } + } else { for (int yi = 0; yi < image.get_y_size(); ++yi) { for (int xi = 0; xi < image.get_x_size(); ++xi) { - LRGBColord rgb = image.get_xel(xi, yi); + LRGBColord rgb = LCAST(double, image.get_xel(xi, yi)); rgb = _mat.xform_point(rgb); - image.set_xel(xi, yi, rgb); + image.set_xel(xi, yi, LCAST(float, rgb)); } - } + } } } From 868b78f854cf4d3d58241ad4b992008c5f5ccbe0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 1 Jun 2015 00:32:51 +0200 Subject: [PATCH 5/7] Work around interrogate issue --- panda/src/nativenet/socket_fdset.h | 42 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/panda/src/nativenet/socket_fdset.h b/panda/src/nativenet/socket_fdset.h index 2c848ae582..33e688a207 100644 --- a/panda/src/nativenet/socket_fdset.h +++ b/panda/src/nativenet/socket_fdset.h @@ -1,5 +1,5 @@ #ifndef __SOCKET_FDSET_H__ -#define __SOCKET_FDSET_H__ +#define __SOCKET_FDSET_H__ //////////////////////////////////////////////////// // @@ -16,27 +16,29 @@ #include "time_base.h" #include "socket_ip.h" -class Socket_fdset -{ +class Socket_fdset { PUBLISHED: - - inline Socket_fdset(); - inline void setForSocket(const Socket_IP &incon); - inline bool IsSetFor(const Socket_IP & incon) const; - inline int WaitForRead(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); - inline int WaitForWrite(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); - inline int WaitForError(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); - - - inline int WaitForRead(bool zeroFds, const Time_Span & timeout); - inline void clear(); + inline Socket_fdset(); + inline void setForSocket(const Socket_IP &incon); + inline bool IsSetFor(const Socket_IP &incon) const; + inline int WaitForRead(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); + inline int WaitForWrite(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); + inline int WaitForError(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); + + inline int WaitForRead(bool zeroFds, const Time_Span & timeout); + inline void clear(); + private: - inline void setForSocketNative(const SOCKET inid); - inline bool isSetForNative(const SOCKET inid) const; - - friend struct Socket_Selector; - SOCKET _maxid; - mutable fd_set _the_set; + inline void setForSocketNative(const SOCKET inid); + inline bool isSetForNative(const SOCKET inid) const; + + friend struct Socket_Selector; + + SOCKET _maxid; + +#ifndef CPPPARSER + mutable fd_set _the_set; +#endif }; //////////////////////////////////////////////////////////////////// From dbcb389d7361f15a3b7912b4104538188d78edd9 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Sun, 31 May 2015 23:59:28 -0500 Subject: [PATCH 6/7] Add PNMImage premultiply/unpremultiply methods. --- panda/src/pnmimage/pnmImage.cxx | 57 +++++++++++++++++++++++++++++++++ panda/src/pnmimage/pnmImage.h | 3 ++ 2 files changed, 60 insertions(+) diff --git a/panda/src/pnmimage/pnmImage.cxx b/panda/src/pnmimage/pnmImage.cxx index 692e26b11d..83b02a82b2 100644 --- a/panda/src/pnmimage/pnmImage.cxx +++ b/panda/src/pnmimage/pnmImage.cxx @@ -622,6 +622,63 @@ make_grayscale(float rc, float gc, float bc) { setup_rc(); } +//////////////////////////////////////////////////////////////////// +// Function: PNMImage::premultiply_alpha +// Access: Published +// Description: Converts an image in-place to its "premultiplied" +// form, where, for every pixel in the image, the +// red, green, and blue components are multiplied by +// that pixel's alpha value. +// +// This does not modify any alpha values. +//////////////////////////////////////////////////////////////////// +void PNMImage:: +premultiply_alpha() { + if (!has_alpha()) { + return; + } + + for (int y = 0; y < get_y_size(); y++) { + for (int x = 0; x < get_x_size(); x++) { + float alpha = get_alpha(x, y); + float r = get_red(x, y) * alpha; + float g = get_green(x, y) * alpha; + float b = get_blue(x, y) * alpha; + set_xel(x, y, r, g, b); + } + } +} + +//////////////////////////////////////////////////////////////////// +// Function: PNMImage::unpremultiply_alpha +// Access: Published +// Description: Converts an image in-place to its "straight alpha" +// form (presumably from a "premultiplied" form), +// where, for every pixel in the image, the red, +// green, and blue components are divided by that +// pixel's alpha value. +// +// This does not modify any alpha values. +//////////////////////////////////////////////////////////////////// +void PNMImage:: +unpremultiply_alpha() { + if (!has_alpha()) { + return; + } + + for (int y = 0; y < get_y_size(); y++) { + for (int x = 0; x < get_x_size(); x++) { + float alpha = get_alpha(x, y); + if (alpha > 0) { + float r = get_red(x, y) / alpha; + float g = get_green(x, y) / alpha; + float b = get_blue(x, y) / alpha; + set_xel(x, y, r, g, b); + } + } + } +} + //////////////////////////////////////////////////////////////////// // Function: PNMImage::reverse_rows // Access: Published diff --git a/panda/src/pnmimage/pnmImage.h b/panda/src/pnmimage/pnmImage.h index b01d5ec974..c970411d27 100644 --- a/panda/src/pnmimage/pnmImage.h +++ b/panda/src/pnmimage/pnmImage.h @@ -133,6 +133,9 @@ PUBLISHED: void make_grayscale(float rc, float gc, float bc); INLINE void make_rgb(); + void premultiply_alpha(); + void unpremultiply_alpha(); + BLOCKING void reverse_rows(); BLOCKING void flip(bool flip_x, bool flip_y, bool transpose); From 912374cc51df9b0c044e24daf005c99f7d66b564 Mon Sep 17 00:00:00 2001 From: Sean Martin Date: Mon, 1 Jun 2015 20:39:20 +0100 Subject: [PATCH 7/7] Add support for Maya 2016 --- makepanda/makepandacore.py | 1 + pandatool/src/mayaprogs/mayapath.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 899434d677..3d45411016 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -79,6 +79,7 @@ MAYAVERSIONINFO = [("MAYA6", "6.0"), ("MAYA20135","2013.5"), ("MAYA2014","2014"), ("MAYA2015","2015"), + ("MAYA2016","2016"), ] MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"), diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index a7eba240b2..dfeb68fc5c 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -101,6 +101,7 @@ struct MayaVerInfo maya_versions[] = { { "MAYA20135", "2013.5"}, { "MAYA2014", "2014"}, { "MAYA2015", "2015"}, + { "MAYA2016", "2016"}, { 0, 0 }, };