mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
Merge branch 'release/1.10.x'
This commit is contained in:
commit
9fb60b18e7
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user