From 7762d68c4b93bf55061e2b8c1986c2f0f7b5e545 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 10 Oct 2015 16:43:31 -0400 Subject: [PATCH] Rasterizer: Mark some references as const --- Source/Core/VideoBackends/Software/Rasterizer.cpp | 10 +++++----- Source/Core/VideoCommon/BPMemory.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index 9583456277..79332b6cdb 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -210,13 +210,13 @@ static void InitSlope(Slope *slope, float f1, float f2, float f3, float DX31, fl static inline void CalculateLOD(s32* lodp, bool* linear, u32 texmap, u32 texcoord) { - FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1]; - u8 subTexmap = texmap & 3; + const FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1]; + const u8 subTexmap = texmap & 3; // LOD calculation requires data from the texture mode for bias, etc. // it does not seem to use the actual texture size - TexMode0& tm0 = texUnit.texMode0[subTexmap]; - TexMode1& tm1 = texUnit.texMode1[subTexmap]; + const TexMode0& tm0 = texUnit.texMode0[subTexmap]; + const TexMode1& tm1 = texUnit.texMode1[subTexmap]; float sDelta, tDelta; if (tm0.diag_lod) @@ -301,7 +301,7 @@ static void BuildBlock(s32 blockX, s32 blockY) for (unsigned int i = 0; i <= bpmem.genMode.numtevstages; i++) { int stageOdd = i&1; - TwoTevStageOrders &order = bpmem.tevorders[i >> 1]; + const TwoTevStageOrders& order = bpmem.tevorders[i >> 1]; if (order.getEnable(stageOdd)) { u32 texmap = order.getTexMap(stageOdd); diff --git a/Source/Core/VideoCommon/BPMemory.h b/Source/Core/VideoCommon/BPMemory.h index 14ac732edf..0dc2b44212 100644 --- a/Source/Core/VideoCommon/BPMemory.h +++ b/Source/Core/VideoCommon/BPMemory.h @@ -400,10 +400,10 @@ struct TevStageCombiner u32 rid : 8; }; u32 hex; - int getTexMap(int i){return i?texmap1:texmap0;} - int getTexCoord(int i){return i?texcoord1:texcoord0;} - int getEnable(int i){return i?enable1:enable0;} - int getColorChan(int i){return i?colorchan1:colorchan0;} + int getTexMap(int i) const { return i ? texmap1 : texmap0;} + int getTexCoord(int i) const { return i ? texcoord1 : texcoord0;} + int getEnable(int i) const { return i ? enable1 : enable0; } + int getColorChan(int i) const { return i ? colorchan1 : colorchan0; } }; union TEXSCALE