From bbea6e7e3ca2aab2cfbd6a4f0fa7309845ecfdf8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 Apr 2018 09:58:19 +0200 Subject: [PATCH] Begin2D doesn't need a return type anymore This was to tell the caller that software 2D was in use, but that doesn't exist anymore --- src/gl/scene/gl_wall.h | 2 ++ src/gl/scene/gl_walls_draw.cpp | 2 +- src/gl/system/gl_framebuffer.cpp | 4 +--- src/gl/system/gl_framebuffer.h | 2 +- src/hwrenderer/scene/hw_drawstructs.h | 2 ++ src/v_video.cpp | 3 +-- src/v_video.h | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/gl/scene/gl_wall.h b/src/gl/scene/gl_wall.h index 38ff975abf..504c6f21cf 100644 --- a/src/gl/scene/gl_wall.h +++ b/src/gl/scene/gl_wall.h @@ -11,7 +11,9 @@ #include "r_data/colormaps.h" #include "hwrenderer/scene/hw_drawstructs.h" +#ifdef _MSC_VER #pragma warning(disable:4244) +#endif struct GLHorizonInfo; struct F3DFloor; diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index 33d050805f..de2e9a6571 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -153,7 +153,7 @@ bool GLWall::SetupLights(FDynLightData &lightdata) void FDrawInfo::RenderWall(GLWall *wall, int textured) { - assert(vertcount > 0); + assert(wall->vertcount > 0); gl_RenderState.Apply(); gl_RenderState.ApplyLightIndex(wall->dynlightindex); GLRenderer->mVBO->RenderArray(GL_TRIANGLE_FAN, wall->vertindex, wall->vertcount); diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index a66f102914..e7844a2195 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -481,10 +481,9 @@ void OpenGLFrameBuffer::SetClearColor(int color) // // //========================================================================== -bool OpenGLFrameBuffer::Begin2D(bool copy3d) +void OpenGLFrameBuffer::Begin2D(bool copy3d) { Super::Begin2D(copy3d); - ClearClipRect(); gl_RenderState.mViewMatrix.loadIdentity(); gl_RenderState.mProjectionMatrix.ortho(0, GetWidth(), GetHeight(), 0, -1.0f, 1.0f); gl_RenderState.ApplyMatrices(); @@ -503,7 +502,6 @@ bool OpenGLFrameBuffer::Begin2D(bool copy3d) if (GLRenderer != NULL) GLRenderer->Begin2D(); - return true; } //=========================================================================== diff --git a/src/gl/system/gl_framebuffer.h b/src/gl/system/gl_framebuffer.h index 6410a3443e..0be4428f25 100644 --- a/src/gl/system/gl_framebuffer.h +++ b/src/gl/system/gl_framebuffer.h @@ -34,7 +34,7 @@ public: PalEntry *GetPalette () override; bool SetFlash(PalEntry rgb, int amount) override; void GetFlash(PalEntry &rgb, int &amount) override; - bool Begin2D(bool copy3d) override; + void Begin2D(bool copy3d) override; void GameRestart() override; void InitForLevel() override; void SetClearColor(int color) override; diff --git a/src/hwrenderer/scene/hw_drawstructs.h b/src/hwrenderer/scene/hw_drawstructs.h index 56f9d93892..262e5ed054 100644 --- a/src/hwrenderer/scene/hw_drawstructs.h +++ b/src/hwrenderer/scene/hw_drawstructs.h @@ -9,7 +9,9 @@ #include "textures/textures.h" #include "r_data/colormaps.h" +#ifdef _MSC_VER #pragma warning(disable:4244) +#endif struct GLHorizonInfo; struct GLSkyInfo; diff --git a/src/v_video.cpp b/src/v_video.cpp index b6d8a1213c..5c0395331a 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -859,11 +859,10 @@ void DFrameBuffer::SetBlendingRect (int x1, int y1, int x2, int y2) // //========================================================================== -bool DFrameBuffer::Begin2D (bool copy3d) +void DFrameBuffer::Begin2D (bool copy3d) { isIn2D = true; ClearClipRect(); - return false; } //========================================================================== diff --git a/src/v_video.h b/src/v_video.h index f2c8a711be..b976e54157 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -385,7 +385,7 @@ public: // Begin 2D drawing operations. // Returns true if hardware-accelerated 2D has been entered, false if not. - virtual bool Begin2D(bool copy3d); + virtual void Begin2D(bool copy3d); void End2D() { isIn2D = false; } // Returns true if Begin2D has been called and 2D drawing is now active