mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
dxgsg9: don't attempt to restore gamma if it wasn't modified
This commit is contained in:
parent
b656b0bbf9
commit
e13719132b
@ -5269,6 +5269,7 @@ calc_fb_properties(DWORD cformat, DWORD dformat,
|
||||
#define GAMMA_1 (255.0 * 256.0)
|
||||
|
||||
static bool _gamma_table_initialized = false;
|
||||
static bool _gamma_changed = false;
|
||||
static unsigned short _original_gamma_table [256 * 3];
|
||||
|
||||
void _create_gamma_table_dx9 (PN_stdfloat gamma, unsigned short *original_red_table, unsigned short *original_green_table, unsigned short *original_blue_table, unsigned short *red_table, unsigned short *green_table, unsigned short *blue_table) {
|
||||
@ -5366,6 +5367,7 @@ static_set_gamma(bool restore, PN_stdfloat gamma) {
|
||||
|
||||
if (SetDeviceGammaRamp (hdc, ramp)) {
|
||||
set = true;
|
||||
_gamma_changed = !restore;
|
||||
}
|
||||
|
||||
ReleaseDC (nullptr, hdc);
|
||||
@ -5403,7 +5405,9 @@ restore_gamma() {
|
||||
void DXGraphicsStateGuardian9::
|
||||
atexit_function(void) {
|
||||
set_cg_device(nullptr);
|
||||
if (_gamma_changed) {
|
||||
static_set_gamma(true, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user