- removed several unused variables from OpenGLFrameBuffer.

- removed the LastCamera logic in RenderView. This code predates the first GZDoom release and apparently was only added because back then R_SetupFrame was not fully compatible with the hardware renderer. Today it is not needed anymore.
This commit is contained in:
Christoph Oelckers 2017-03-11 21:10:21 +01:00
parent 9e70771da3
commit 8e2ebe15fe
3 changed files with 6 additions and 36 deletions

View file

@ -897,17 +897,8 @@ sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, flo
void FGLRenderer::RenderView (player_t* player) void FGLRenderer::RenderView (player_t* player)
{ {
OpenGLFrameBuffer* GLTarget = static_cast<OpenGLFrameBuffer*>(screen);
AActor *&LastCamera = GLTarget->LastCamera;
checkBenchActive(); checkBenchActive();
if (player->camera != LastCamera)
{
// If the camera changed don't interpolate
// Otherwise there will be some not so nice effects.
R_ResetViewInterpolation();
LastCamera=player->camera;
}
gl_RenderState.SetVertexBuffer(mVBO); gl_RenderState.SetVertexBuffer(mVBO);
GLRenderer->mVBO->Reset(); GLRenderer->mVBO->Reset();

View file

@ -93,7 +93,6 @@ OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256); memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
UpdatePalette (); UpdatePalette ();
ScreenshotBuffer = NULL; ScreenshotBuffer = NULL;
LastCamera = NULL;
InitializeState(); InitializeState();
mDebug = std::make_shared<FGLDebug>(); mDebug = std::make_shared<FGLDebug>();
@ -101,8 +100,6 @@ OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int
gl_SetupMenu(); gl_SetupMenu();
gl_GenerateGlobalBrightmapFromColormap(); gl_GenerateGlobalBrightmapFromColormap();
DoSetGamma(); DoSetGamma();
needsetgamma = true;
swapped = false;
Accel2D = true; Accel2D = true;
} }
@ -178,7 +175,6 @@ void OpenGLFrameBuffer::Update()
GLRenderer->Flush(); GLRenderer->Flush();
Swap(); Swap();
swapped = false;
Unlock(); Unlock();
CheckBench(); CheckBench();
@ -215,15 +211,9 @@ void OpenGLFrameBuffer::Swap()
Finish.Reset(); Finish.Reset();
Finish.Clock(); Finish.Clock();
if (swapbefore) glFinish(); if (swapbefore) glFinish();
if (needsetgamma)
{
//DoSetGamma();
needsetgamma = false;
}
SwapBuffers(); SwapBuffers();
if (!swapbefore) glFinish(); if (!swapbefore) glFinish();
Finish.Unclock(); Finish.Unclock();
swapped = true;
camtexcount = 0; camtexcount = 0;
FHardwareTexture::UnbindAll(); FHardwareTexture::UnbindAll();
mDebug->Update(); mDebug->Update();
@ -565,7 +555,6 @@ void OpenGLFrameBuffer::GameRestart()
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256); memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
UpdatePalette (); UpdatePalette ();
ScreenshotBuffer = NULL; ScreenshotBuffer = NULL;
LastCamera = NULL;
gl_GenerateGlobalBrightmapFromColormap(); gl_GenerateGlobalBrightmapFromColormap();
} }

View file

@ -85,18 +85,13 @@ public:
void SetVSync(bool vsync); 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: private:
PalEntry Flash; PalEntry Flash; // Only needed to support some cruft in the interface that only makes sense for the software renderer
PalEntry SourcePalette[256]; // This is where unpaletted textures get their palette from
// Texture creation info uint8_t *ScreenshotBuffer; // What the name says. This must be maintained because the software renderer can return a locked canvas surface which the caller cannot release.
int cm;
int translation;
bool iscomplex;
bool needsetgamma;
bool swapped;
PalEntry SourcePalette[256];
uint8_t *ScreenshotBuffer;
class Wiper class Wiper
{ {
@ -120,13 +115,8 @@ private:
FHardwareTexture *wipestartscreen; FHardwareTexture *wipestartscreen;
FHardwareTexture *wipeendscreen; FHardwareTexture *wipeendscreen;
bool HWGammaActive = false;
std::shared_ptr<FGLDebug> mDebug;
public: public:
AActor * LastCamera;
int palette_brightness;
}; };