From d79d5d49f41e83072050444355717e3be567630f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 22 Sep 2016 20:39:28 -0400 Subject: [PATCH] Rasterizer: const correctness --- Source/Core/VideoBackends/Software/Rasterizer.cpp | 3 ++- Source/Core/VideoBackends/Software/Rasterizer.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index e4ebdd1234..9db10f8ae0 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -264,7 +264,8 @@ static void BuildBlock(s32 blockX, s32 blockY) } } -void DrawTriangleFrontFace(OutputVertexData* v0, OutputVertexData* v1, OutputVertexData* v2) +void DrawTriangleFrontFace(const OutputVertexData* v0, const OutputVertexData* v1, + const OutputVertexData* v2) { INCSTAT(stats.thisFrame.numTrianglesDrawn); diff --git a/Source/Core/VideoBackends/Software/Rasterizer.h b/Source/Core/VideoBackends/Software/Rasterizer.h index 50308b7449..29fa6d6dee 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.h +++ b/Source/Core/VideoBackends/Software/Rasterizer.h @@ -12,7 +12,8 @@ namespace Rasterizer { void Init(); -void DrawTriangleFrontFace(OutputVertexData* v0, OutputVertexData* v1, OutputVertexData* v2); +void DrawTriangleFrontFace(const OutputVertexData* v0, const OutputVertexData* v1, + const OutputVertexData* v2); void SetTevReg(int reg, int comp, s16 color); @@ -22,7 +23,7 @@ struct Slope float dfdy; float f0; - float GetValue(float dx, float dy) { return f0 + (dfdx * dx) + (dfdy * dy); } + float GetValue(float dx, float dy) const { return f0 + (dfdx * dx) + (dfdy * dy); } }; struct RasterBlockPixel