Merge branch 'master' into deploy-ng

This commit is contained in:
Mitchell Stokes 2018-12-18 20:44:16 -08:00
commit 88470106b6
3 changed files with 43 additions and 14 deletions

View File

@ -921,21 +921,38 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
if (_fb_properties.get_alpha_bits() == 0) { if (_fb_properties.get_alpha_bits() == 0) {
if (_fb_properties.get_srgb_color()) { if (_fb_properties.get_srgb_color()) {
gl_format = GL_SRGB8; gl_format = GL_SRGB8;
} else if (_fb_properties.get_float_color()) { } else if (_fb_properties.get_color_bits() > 16 * 3 ||
if (_fb_properties.get_color_bits() > 16 * 3) { _fb_properties.get_red_bits() > 16 ||
gl_format = GL_RGB32F_ARB; _fb_properties.get_green_bits() > 16 ||
_fb_properties.get_blue_bits() > 16) {
// 32-bit, which is always floating-point.
if (_fb_properties.get_blue_bits() > 0 ||
_fb_properties.get_color_bits() == 1 ||
_fb_properties.get_color_bits() > 32 * 2) {
gl_format = GL_RGB32F;
} else if (_fb_properties.get_green_bits() > 0 ||
_fb_properties.get_color_bits() > 32) {
gl_format = GL_RG32F;
} else { } else {
gl_format = GL_RGB16F_ARB; gl_format = GL_R32F;
} }
} else if (_fb_properties.get_float_color()) {
// 16-bit floating-point.
if (_fb_properties.get_blue_bits() > 0 ||
_fb_properties.get_color_bits() == 1 ||
_fb_properties.get_color_bits() > 16 * 2) {
gl_format = GL_RGB16F;
} else if (_fb_properties.get_green_bits() > 0 ||
_fb_properties.get_color_bits() > 16) {
gl_format = GL_RG16F;
} else { } else {
if (_fb_properties.get_color_bits() > 16 * 3) { gl_format = GL_R16F;
gl_format = GL_RGB32F_ARB; }
} else if (_fb_properties.get_color_bits() > 8 * 3) { } else if (_fb_properties.get_color_bits() > 8 * 3) {
gl_format = GL_RGB16_EXT; gl_format = GL_RGB16_EXT;
} else { } else {
gl_format = GL_RGB; gl_format = GL_RGB;
} }
}
} else { } else {
if (_fb_properties.get_srgb_color()) { if (_fb_properties.get_srgb_color()) {
gl_format = GL_SRGB8_ALPHA8; gl_format = GL_SRGB8_ALPHA8;

View File

@ -375,5 +375,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
if (manager->get_file_minor_ver() >= 43) { if (manager->get_file_minor_ver() >= 43) {
_look_at.fillin(scan, manager); _look_at.fillin(scan, manager);
_fixed_depth = scan.get_bool(); _fixed_depth = scan.get_bool();
} else {
_fixed_depth = false;
} }
} }

View File

@ -508,25 +508,35 @@ process_events() {
changed_properties = true; changed_properties = true;
} }
if (properties.has_foreground() && _properties.get_mouse_mode() == WindowProperties::M_confined) { if (properties.has_foreground() && (
_properties.get_mouse_mode() == WindowProperties::M_confined ||
_dga_mouse_enabled)) {
x11GraphicsPipe *x11_pipe;
DCAST_INTO_V(x11_pipe, _pipe);
// Focus has changed, let's let go of the pointer if we've grabbed or re-grab it if needed // Focus has changed, let's let go of the pointer if we've grabbed or re-grab it if needed
if (properties.get_foreground()) { if (properties.get_foreground()) {
// Window is going to the foreground, re-grab the pointer // Window is going to the foreground, re-grab the pointer
X11_Cursor cursor = None; X11_Cursor cursor = None;
if (_properties.get_cursor_hidden()) { if (_properties.get_cursor_hidden()) {
x11GraphicsPipe *x11_pipe;
DCAST_INTO_V(x11_pipe, _pipe);
cursor = x11_pipe->get_hidden_cursor(); cursor = x11_pipe->get_hidden_cursor();
} }
XGrabPointer(_display, _xwindow, True, 0, GrabModeAsync, GrabModeAsync, XGrabPointer(_display, _xwindow, True, 0, GrabModeAsync, GrabModeAsync,
_xwindow, cursor, CurrentTime); _xwindow, cursor, CurrentTime);
if (_dga_mouse_enabled) {
x11_pipe->enable_relative_mouse();
}
} }
else { else {
// window is leaving the foreground, ungrab the pointer // window is leaving the foreground, ungrab the pointer
if (_dga_mouse_enabled) {
x11_pipe->disable_relative_mouse();
} else if (_properties.get_mouse_mode() == WindowProperties::M_confined) {
XUngrabPointer(_display, CurrentTime); XUngrabPointer(_display, CurrentTime);
} }
} }
}
if (changed_properties) { if (changed_properties) {
system_changed_properties(properties); system_changed_properties(properties);