diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 8e88a40930..7c2d0f959a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -177,6 +177,7 @@ def parseopts(args): "static","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=", "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl", "target=", "arch=", "git-commit=", "no-copy-python", + "cggl-incdir=", "cggl-libdir=", ] + removedopts anything = 0 @@ -239,7 +240,7 @@ def parseopts(args): elif (option[2:] in removedopts): Warn("Ignoring removed option %s" % (option)) else: - for pkg in PkgListGet(): + for pkg in PkgListGet() + ['CGGL']: if option == "--use-" + pkg.lower(): PkgEnable(pkg) break diff --git a/panda/src/express/virtualFileSystem.cxx b/panda/src/express/virtualFileSystem.cxx index fe87f29645..cbd4344cc6 100644 --- a/panda/src/express/virtualFileSystem.cxx +++ b/panda/src/express/virtualFileSystem.cxx @@ -497,8 +497,7 @@ make_directory_full(const Filename &filename) { // Now make the last one, and check the return value. PT(VirtualFile) result = do_get_file(filename, OF_make_directory); _lock.unlock(); - nassertr_always(result != nullptr, false); - return result->is_directory(); + return (result != nullptr) ? result->is_directory() : false; } /** diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 5065a9c054..3edcdc4aa0 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -1241,12 +1241,23 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { const ShaderKey::TextureInfo &tex = key._textures[i]; if (tex._flags & ShaderKey::TF_map_normal) { if (is_first) { - text << "\t float3 tsnormal = normalize((tex" << i << ".xyz * 2) - 1);\n"; + if (tex._flags & ShaderKey::TF_has_texscale) { + text << "\t float3 tsnormal = normalize(((tex" << i << ".xyz * 2) - 1) * texscale_" << i << ");\n"; + } else if (tex._flags & ShaderKey::TF_has_texmat) { + text << "\t float3 tsnormal = normalize(mul(texmat_" << i << ", float4((tex" << i << ".xyz * 2) - 1, 0)).xyz);\n"; + } else { + text << "\t float3 tsnormal = normalize((tex" << i << ".xyz * 2) - 1);\n"; + } is_first = false; continue; } text << "\t tsnormal.z += 1;\n"; text << "\t float3 tmp" << i << " = tex" << i << ".xyz * float3(-2, -2, 2) + float3(1, 1, -1);\n"; + if (tex._flags & ShaderKey::TF_has_texscale) { + text << "\t tmp" << i << " *= texscale_" << i << ";\n"; + } else if (tex._flags & ShaderKey::TF_has_texmat) { + text << "\t tmp" << i << " = mul(texmat_" << i << ", float4(tmp" << i << ", 0)).xyz;\n"; + } text << "\t tsnormal = normalize(tsnormal * dot(tsnormal, tmp" << i << ") - tmp" << i << " * tsnormal.z);\n"; } } diff --git a/panda/src/putil/bamCache.cxx b/panda/src/putil/bamCache.cxx index b042dcfde2..de189bf4a1 100644 --- a/panda/src/putil/bamCache.cxx +++ b/panda/src/putil/bamCache.cxx @@ -133,10 +133,16 @@ set_root(const Filename &root) { delete _index; _index = new BamCacheIndex; _index_stale_since = 0; + + if (!vfs->is_directory(_root)) { + util_cat.error() + << "Unable to make directory " << _root << ", caching disabled.\n"; + _active = false; + return; + } + read_index(); check_cache_size(); - - nassertv(vfs->is_directory(_root)); } /** diff --git a/panda/src/tform/mouseWatcher.cxx b/panda/src/tform/mouseWatcher.cxx index 9344d51d7d..74cb7692d3 100644 --- a/panda/src/tform/mouseWatcher.cxx +++ b/panda/src/tform/mouseWatcher.cxx @@ -726,6 +726,9 @@ clear_current_regions() { MouseWatcherRegion *old_region = (*old_ri); old_region->exit_region(param); throw_event_pattern(_leave_pattern, old_region, ButtonHandle::none()); + if (_preferred_region == old_region) { + _preferred_region = nullptr; + } ++old_ri; } diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index eb233cd5cf..819b559f44 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -330,7 +330,7 @@ process_events() { // We thought about not generating the keypress event, but we need // that repeat for backspace. Rethink later. - handle_keypress(event.xkey); + handle_keyrepeat(event.xkey); continue; } else { @@ -1537,6 +1537,34 @@ handle_keypress(XKeyEvent &event) { } } +/** + * Generates a keyrepeat corresponding to the indicated X KeyPress event. + */ +void x11GraphicsWindow:: +handle_keyrepeat(XKeyEvent &event) { + if (_properties.get_mouse_mode() != WindowProperties::M_relative) { + _input->set_pointer_in_window(event.x, event.y); + } + + // Now get the raw unshifted button. + ButtonHandle button = get_button(event, false); + if (button != ButtonHandle::none()) { + if (button == KeyboardButton::lcontrol() || button == KeyboardButton::rcontrol()) { + _input->button_down(KeyboardButton::control()); + } + if (button == KeyboardButton::lshift() || button == KeyboardButton::rshift()) { + _input->button_down(KeyboardButton::shift()); + } + if (button == KeyboardButton::lalt() || button == KeyboardButton::ralt()) { + _input->button_down(KeyboardButton::alt()); + } + if (button == KeyboardButton::lmeta() || button == KeyboardButton::rmeta()) { + _input->button_down(KeyboardButton::meta()); + } + _input->button_down(button); + } +} + /** * Generates a keyrelease corresponding to the indicated X KeyRelease event. */ diff --git a/panda/src/x11display/x11GraphicsWindow.h b/panda/src/x11display/x11GraphicsWindow.h index e3d4a86382..2336fcccc8 100644 --- a/panda/src/x11display/x11GraphicsWindow.h +++ b/panda/src/x11display/x11GraphicsWindow.h @@ -59,6 +59,7 @@ protected: virtual void setup_colormap(XVisualInfo *visual); void handle_keystroke(XKeyEvent &event); void handle_keypress(XKeyEvent &event); + void handle_keyrepeat(XKeyEvent &event); void handle_keyrelease(XKeyEvent &event); ButtonHandle get_button(XKeyEvent &key_event, bool allow_shift);