From bd3dd63cbeb23dd7e137f8e085bdc12aa8fd92db Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jan 2020 08:40:50 +0100 Subject: [PATCH 1/3] actor: only remove control effects of given animations in unloadAnims The previous behavior was for unloadAnims() to remove the control effects from all animations, even when only one animation was passed in, which is unintuitive behavior. Fixes #853 --- direct/src/actor/Actor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 5b83df0d8c..6ebf01341c 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -2281,7 +2281,7 @@ class Actor(DirectObject, NodePath): # our handle on them go. This is especially # important if the anim control was blending # animations. - animDef.animControl.getPart().clearControlEffects() + animDef.animControl.getPart().setControlEffect(animDef.animControl, 0.0) animDef.animControl = None From 6f17a9e36a9db7a38a6702051c3972b2f2b1f010 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jan 2020 09:16:02 +0100 Subject: [PATCH 2/3] makepanda: disable plug-ins in Config.prc that weren't compiled This also disables the plug-ins if we are building them statically. --- makepanda/makepanda.py | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index a3a7ed35a3..58949531d3 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -3132,14 +3132,28 @@ else: # otherwise, disable it. confautoprc = confautoprc.replace('#st#', '#') -if PkgSkip("ASSIMP"): +confautoprc = confautoprc.replace('\r\n', '\n') + +if PkgSkip("ASSIMP") or GetLinkAllStatic(): confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp") +if PkgSkip("EGG") or GetLinkAllStatic(): + confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg") + +if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic(): + confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader") + +if PkgSkip("FFMPEG") or GetLinkAllStatic(): + confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg") + confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg") + if (os.path.isfile("makepanda/myconfig.in")): configprc = ReadFile("makepanda/myconfig.in") else: configprc = ReadFile("makepanda/config.in") +configprc = configprc.replace('\r\n', '\n') + if (GetTarget() == 'windows'): configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION) else: @@ -3149,7 +3163,23 @@ if (GetTarget() == 'darwin'): configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION) # OpenAL is not yet working well on OSX for us, so let's do this for now. - configprc = configprc.replace("p3openal_audio", "p3fmod_audio") + if not PkgSkip("FMODEX"): + configprc = configprc.replace("p3openal_audio", "p3fmod_audio") + +if PkgSkip("GL") or GetLinkAllStatic(): + configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl") + +if PkgSkip("GLES") or GetLinkAllStatic(): + configprc = configprc.replace("\n#load-display pandagles", "") + +if PkgSkip("DX9") or GetLinkAllStatic(): + configprc = configprc.replace("\n#load-display pandadx9", "") + +if PkgSkip("TINYDISPLAY") or GetLinkAllStatic(): + configprc = configprc.replace("\n#load-display p3tinydisplay", "") + +if PkgSkip("OPENAL") or GetLinkAllStatic(): + configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio") if GetTarget() == 'windows': # Convert to Windows newlines. From b573cc35870b6a0e082c7d69cbb17e997e9192d9 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jan 2020 09:43:21 +0100 Subject: [PATCH 3/3] cocoa: fix compilation issues with new NSCursor hotspot code See #849 --- panda/src/cocoadisplay/cocoaGraphicsWindow.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index e7d25c29d7..84a722e5c6 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -1421,17 +1421,17 @@ load_cursor(const Filename &filename) { CGFloat hotspot_x = 0.0f; CGFloat hotspot_y = 0.0f; - if (image_props[@"hotspotX"] != nil) { - hotspot_x = [(NSNumber *)image_props[@"hotspotX"] floatValue]; + if (NSNumber *number = [image_props objectForKey:@"hotspotX"]) { + hotspot_x = [number floatValue]; } - if (image_props[@"hotspotY"] != nil) { - hotspot_y = [(NSNumber *)image_props[@"hotspotY"] floatValue]; + if (NSNumber *number = [image_props objectForKey:@"hotspotY"]) { + hotspot_y = [number floatValue]; } [image_props release]; NSImage *image = [[NSImage alloc] initWithData:image_data]; - NSCursor *cursor; + NSCursor *cursor = nil; if (image != nil) { // Apple recognizes that hotspots are usually specified from a .cur // file, whose origin is in the top-left, so there's no need to flip