From 1c19a5d7012fa71de8d80b3eaefcb69a4b302f67 Mon Sep 17 00:00:00 2001 From: neuromancer Date: Sun, 30 Oct 2022 20:47:13 +0100 Subject: [PATCH] FREESCAPE: removed redudant enum --- engines/freescape/gfx.h | 9 --------- engines/freescape/gfx_tinygl.cpp | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/engines/freescape/gfx.h b/engines/freescape/gfx.h index 8537cb12612..a9b7816402f 100644 --- a/engines/freescape/gfx.h +++ b/engines/freescape/gfx.h @@ -69,15 +69,6 @@ public: virtual void clear() = 0; virtual void setViewport(const Common::Rect &rect) = 0; - typedef enum { - EastPyramid = 4, - WestPyramid = 5, - UpPyramid = 6, - DownPyramid = 7, - NorthPyramid = 8, - SouthPyramid = 9, - } PyramidType; - /** * Swap the buffers, making the drawn screen visible */ diff --git a/engines/freescape/gfx_tinygl.cpp b/engines/freescape/gfx_tinygl.cpp index 26831a051b2..ab2aab3c0d2 100644 --- a/engines/freescape/gfx_tinygl.cpp +++ b/engines/freescape/gfx_tinygl.cpp @@ -28,8 +28,9 @@ #include "graphics/tinygl/tinygl.h" #include "math/glmath.h" -#include "engines/freescape/gfx_tinygl.h" -#include "engines/freescape/gfx_tinygl_texture.h" +#include "freescape/objects/object.h" +#include "freescape/gfx_tinygl.h" +#include "freescape/gfx_tinygl_texture.h" namespace Freescape { @@ -326,11 +327,10 @@ void TinyGLRenderer::renderRectangle(const Math::Vector3d &origin, const Math::V void TinyGLRenderer::renderPyramid(const Math::Vector3d &origin, const Math::Vector3d &size, const Common::Array *ordinates, Common::Array *colours, int type) { Math::Vector3d vertices[8] = { origin, origin, origin, origin, origin, origin, origin, origin }; - PyramidType pyramidType = (PyramidType)type; - switch (pyramidType) { + switch (type) { default: - break; - case EastPyramid: + error("Invalid pyramid type: %d", type); + case kEastPyramidType: vertices[0] += Math::Vector3d(0, 0, size.z()); vertices[1] += Math::Vector3d(0, size.y(), size.z()); vertices[2] += Math::Vector3d(0, size.y(), 0); @@ -340,7 +340,7 @@ void TinyGLRenderer::renderPyramid(const Math::Vector3d &origin, const Math::Vec vertices[6] += Math::Vector3d(size.x(), (*ordinates)[2], (*ordinates)[1]); vertices[7] += Math::Vector3d(size.x(), (*ordinates)[0], (*ordinates)[1]); break; - case WestPyramid: + case kWestPyramidType: vertices[0] += Math::Vector3d(size.x(), 0, 0); vertices[1] += Math::Vector3d(size.x(), size.y(), 0); @@ -353,7 +353,7 @@ void TinyGLRenderer::renderPyramid(const Math::Vector3d &origin, const Math::Vec vertices[7] += Math::Vector3d(0, (*ordinates)[0], (*ordinates)[3]); break; - case UpPyramid: + case kUpPyramidType: vertices[1] += Math::Vector3d(size.x(), 0, 0); vertices[2] += Math::Vector3d(size.x(), 0, size.z()); vertices[3] += Math::Vector3d(0, 0, size.z()); @@ -364,7 +364,7 @@ void TinyGLRenderer::renderPyramid(const Math::Vector3d &origin, const Math::Vec vertices[7] += Math::Vector3d((*ordinates)[0], size.y(), (*ordinates)[3]); break; - case DownPyramid: + case kDownPyramidType: vertices[0] += Math::Vector3d(size.x(), size.y(), 0); vertices[1] += Math::Vector3d(0, size.y(), 0); @@ -377,7 +377,7 @@ void TinyGLRenderer::renderPyramid(const Math::Vector3d &origin, const Math::Vec vertices[7] += Math::Vector3d((*ordinates)[2], 0, (*ordinates)[3]); break; - case NorthPyramid: + case kNorthPyramidType: vertices[0] += Math::Vector3d(0, size.y(), 0); vertices[1] += Math::Vector3d(size.x(), size.y(), 0); vertices[2] += Math::Vector3d(size.x(), 0, 0); @@ -387,7 +387,7 @@ void TinyGLRenderer::renderPyramid(const Math::Vector3d &origin, const Math::Vec vertices[6] += Math::Vector3d((*ordinates)[2], (*ordinates)[1], size.z()); vertices[7] += Math::Vector3d((*ordinates)[0], (*ordinates)[1], size.z()); break; - case SouthPyramid: + case kSouthPyramidType: vertices[0] += Math::Vector3d(0, 0, size.z()); vertices[1] += Math::Vector3d(size.x(), 0, size.z()); vertices[2] += Math::Vector3d(size.x(), size.y(), size.z());