- removed now unused BuildGammaTable function

This commit is contained in:
Christoph Oelckers 2019-01-23 15:40:57 +01:00
parent dc27011370
commit 3f835cd124
2 changed files with 0 additions and 26 deletions

View File

@ -305,31 +305,6 @@ void DFrameBuffer::InitPalette()
UpdatePalette();
}
//==========================================================================
//
//
//
//==========================================================================
void DFrameBuffer::BuildGammaTable(uint16_t *gammaTable)
{
float gamma = clamp<float>(Gamma, 0.1f, 4.f);
float contrast = clamp<float>(vid_contrast, 0.1f, 3.f);
float bright = clamp<float>(vid_brightness, -0.8f, 0.8f);
double invgamma = 1 / gamma;
double norm = pow(255., invgamma - 1);
for (int i = 0; i < 256; i++)
{
double val = i * contrast - (contrast - 1) * 127;
val += bright * 128;
if (gamma != 1) val = pow(val, invgamma) / norm;
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (uint16_t)clamp<double>(val * 256, 0, 0xffff);
}
}
//==========================================================================
//
// DFrameBuffer :: GetCaps

View File

@ -329,7 +329,6 @@ protected:
template<class T>
bool ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, bool fortext) const;
void DrawTextCommon(FFont *font, int normalcolor, double x, double y, const char *string, DrawParms &parms);
void BuildGammaTable(uint16_t *gt);
F2DDrawer m2DDrawer;
private: