From 15b496b7924463dc8b688baf1fc045399b720ac3 Mon Sep 17 00:00:00 2001 From: smf- Date: Fri, 5 Jan 2018 23:24:57 +0000 Subject: really fixed MT06623 (don't use uninitialised gamma ramp) (nw) --- src/osd/modules/render/drawd3d.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index 998a54e42f3..b0427c5b55c 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -769,9 +769,6 @@ void renderer_d3d9::update_gamma_ramp() auto win = assert_window(); - // create a standard ramp - D3DGAMMARAMP ramp; - // set the gamma if we need to if (win->fullscreen()) { @@ -782,14 +779,16 @@ void renderer_d3d9::update_gamma_ramp() float gamma = options.full_screen_gamma(); if (brightness != 1.0f || contrast != 1.0f || gamma != 1.0f) { + D3DGAMMARAMP ramp; + for (int i = 0; i < 256; i++) { ramp.red[i] = ramp.green[i] = ramp.blue[i] = apply_brightness_contrast_gamma(i, brightness, contrast, gamma) << 8; } + + m_device->SetGammaRamp(0, 0, &ramp); } } - - m_device->SetGammaRamp(0, 0, &ramp); } -- cgit v1.2.3