mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
winlayer: Remove code that worked around a (wrongly) not set have_ATI variable.
This was fixed with the preceding change; software mode will now always use software gamma if an ATI/AMD card is detected. git-svn-id: https://svn.eduke32.com/eduke32@2634 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
dcd66dad62
commit
bbc020bace
1 changed files with 8 additions and 16 deletions
|
@ -41,7 +41,6 @@
|
|||
#define ANY_WINDOWED_SIZE
|
||||
|
||||
static mutex_t m_initprintf;
|
||||
static int32_t winlayer_uselastgamma = -1;
|
||||
static int32_t winlayer_have_ATI = 0;
|
||||
|
||||
int32_t _buildargc = 0;
|
||||
|
@ -2230,13 +2229,6 @@ int32_t setpalette(int32_t start, int32_t num)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (winlayer_have_ATI)
|
||||
{
|
||||
winlayer_uselastgamma = (winlayer_uselastgamma!=-1);
|
||||
setgamma();
|
||||
winlayer_uselastgamma = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2341,15 +2333,15 @@ int32_t setgamma(void)
|
|||
|
||||
// This formula is taken from Doomsday
|
||||
|
||||
if (winlayer_uselastgamma <= 0)
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
double val = i * contrast - (contrast - 1) * 127;
|
||||
if (gamma != 1) val = pow(val, invgamma) / norm;
|
||||
val += bright * 128;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
double val = i * contrast - (contrast - 1) * 127;
|
||||
if (gamma != 1) val = pow(val, invgamma) / norm;
|
||||
val += bright * 128;
|
||||
|
||||
gammaTable[0][i] = gammaTable[1][i] = gammaTable[2][i] = (WORD)max(0.f,(double)min(0xffff,val*256));
|
||||
}
|
||||
|
||||
gammaTable[0][i] = gammaTable[1][i] = gammaTable[2][i] = (WORD)max(0.f,(double)min(0xffff,val*256));
|
||||
}
|
||||
return setgammaramp(gammaTable);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue