mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-13 07:57:51 +00:00
- removed now unused BuildGammaTable function
This commit is contained in:
parent
dc27011370
commit
3f835cd124
2 changed files with 0 additions and 26 deletions
|
@ -305,31 +305,6 @@ void DFrameBuffer::InitPalette()
|
||||||
UpdatePalette();
|
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
|
// DFrameBuffer :: GetCaps
|
||||||
|
|
|
@ -329,7 +329,6 @@ protected:
|
||||||
template<class T>
|
template<class T>
|
||||||
bool ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, bool fortext) const;
|
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 DrawTextCommon(FFont *font, int normalcolor, double x, double y, const char *string, DrawParms &parms);
|
||||||
void BuildGammaTable(uint16_t *gt);
|
|
||||||
|
|
||||||
F2DDrawer m2DDrawer;
|
F2DDrawer m2DDrawer;
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue