mirror of
https://github.com/holub/mame
synced 2025-10-08 01:28:00 +03:00
really fixed MT06623 (don't use uninitialised gamma ramp) (nw)
This commit is contained in:
parent
30c9c6fcd2
commit
15b496b792
@ -769,9 +769,6 @@ void renderer_d3d9::update_gamma_ramp()
|
|||||||
|
|
||||||
auto win = assert_window();
|
auto win = assert_window();
|
||||||
|
|
||||||
// create a standard ramp
|
|
||||||
D3DGAMMARAMP ramp;
|
|
||||||
|
|
||||||
// set the gamma if we need to
|
// set the gamma if we need to
|
||||||
if (win->fullscreen())
|
if (win->fullscreen())
|
||||||
{
|
{
|
||||||
@ -782,14 +779,16 @@ void renderer_d3d9::update_gamma_ramp()
|
|||||||
float gamma = options.full_screen_gamma();
|
float gamma = options.full_screen_gamma();
|
||||||
if (brightness != 1.0f || contrast != 1.0f || gamma != 1.0f)
|
if (brightness != 1.0f || contrast != 1.0f || gamma != 1.0f)
|
||||||
{
|
{
|
||||||
|
D3DGAMMARAMP ramp;
|
||||||
|
|
||||||
for (int i = 0; i < 256; i++)
|
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;
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user