diff --git a/src/v_framebuffer.cpp b/src/v_framebuffer.cpp index 43204c8be..722596c35 100644 --- a/src/v_framebuffer.cpp +++ b/src/v_framebuffer.cpp @@ -305,31 +305,6 @@ void DFrameBuffer::InitPalette() UpdatePalette(); } -//========================================================================== -// -// -// -//========================================================================== - -void DFrameBuffer::BuildGammaTable(uint16_t *gammaTable) -{ - float gamma = clamp(Gamma, 0.1f, 4.f); - float contrast = clamp(vid_contrast, 0.1f, 3.f); - float bright = clamp(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(val * 256, 0, 0xffff); - } -} - //========================================================================== // // DFrameBuffer :: GetCaps diff --git a/src/v_video.h b/src/v_video.h index 58b9e7fa8..2fd3f7e13 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -329,7 +329,6 @@ protected: template 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: