- separated the software-renderer-specific parts of colormap processing from the common parts.
- moved testcolor and test fades into SWRenderer files. These CCMDs work by hacking the default colormap and were never implemented for hardware rendering because they require many checks throughout the code.
This commit is contained in:
parent
cd015f9340
commit
921bc763fb
27 changed files with 695 additions and 572 deletions
|
|
@ -591,14 +591,6 @@ void GLSceneDrawer::DrawBlend(sector_t * viewsector)
|
|||
if (blendv.a == 0)
|
||||
{
|
||||
blendv = R_BlendForColormap(blendv);
|
||||
if (blendv.a == 255)
|
||||
{
|
||||
// The calculated average is too dark so brighten it according to the palettes's overall brightness
|
||||
int maxcol = MAX<int>(MAX<int>(GLRenderer->framebuffer->palette_brightness, blendv.r), MAX<int>(blendv.g, blendv.b));
|
||||
blendv.r = blendv.r * 255 / maxcol;
|
||||
blendv.g = blendv.g * 255 / maxcol;
|
||||
blendv.b = blendv.b * 255 / maxcol;
|
||||
}
|
||||
}
|
||||
|
||||
if (blendv.a == 255)
|
||||
|
|
@ -983,7 +975,6 @@ void GLSceneDrawer::WriteSavePic (player_t *player, FileWriter *file, int width,
|
|||
|
||||
struct FGLInterface : public FRenderer
|
||||
{
|
||||
bool UsesColormap() const override;
|
||||
void Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitlist) override;
|
||||
void RenderView(player_t *player) override;
|
||||
void WriteSavePic (player_t *player, FileWriter *file, int width, int height) override;
|
||||
|
|
@ -999,18 +990,6 @@ struct FGLInterface : public FRenderer
|
|||
void Init() override;
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// The GL renderer has no use for colormaps so let's
|
||||
// not create them and save us some time.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool FGLInterface::UsesColormap() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// DFrameBuffer :: Precache
|
||||
|
|
|
|||
|
|
@ -308,19 +308,6 @@ bool OpenGLFrameBuffer::SetContrast(float contrast)
|
|||
|
||||
void OpenGLFrameBuffer::UpdatePalette()
|
||||
{
|
||||
int rr=0,gg=0,bb=0;
|
||||
for(int x=0;x<256;x++)
|
||||
{
|
||||
rr+=GPalette.BaseColors[x].r;
|
||||
gg+=GPalette.BaseColors[x].g;
|
||||
bb+=GPalette.BaseColors[x].b;
|
||||
}
|
||||
rr>>=8;
|
||||
gg>>=8;
|
||||
bb>>=8;
|
||||
|
||||
palette_brightness = (rr*77 + gg*143 + bb*35)/255;
|
||||
|
||||
if (GLRenderer)
|
||||
GLRenderer->ClearTonemapPalette();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ public:
|
|||
|
||||
void SetVSync(bool vsync);
|
||||
|
||||
int palette_brightness; // brightness of the active palette - this is used for screen blends
|
||||
bool HWGammaActive = false; // Are we using hardware or software gamma?
|
||||
std::shared_ptr<FGLDebug> mDebug; // Debug API
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue