diff options
| author | Lioncash <mathew1800@gmail.com> | 2017-08-06 18:14:51 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2017-08-06 18:15:05 -0400 |
| commit | 4d35a3105eccc752c2a930be7daa4cb7655553b3 (patch) | |
| tree | 7d9a6021870aaed7864d6bf3a6680975172fe830 /Source/Core/VideoBackends/Software/TransformUnit.cpp | |
| parent | bc11fad6eb8c048ab76833e16aa15ffd7925b938 (diff) | |
TransformUnit: Make LightColor()'s chan parameter const
Also marks references/pointers const where applicable
Diffstat (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/TransformUnit.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index 8fff7ded27..aa8e265584 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -265,7 +265,7 @@ static float CalculateLightAttn(const LightPointer* light, Vec3* _ldir, const Ve return attn; } -static void LightColor(const Vec3& pos, const Vec3& normal, u8 lightNum, LitChannel& chan, +static void LightColor(const Vec3& pos, const Vec3& normal, u8 lightNum, const LitChannel& chan, Vec3& lightCol) { const LightPointer* light = (const LightPointer*)&xfmem.lights[lightNum]; @@ -326,7 +326,7 @@ void TransformColor(const InputVertexData* src, OutputVertexData* dst) u8 chancolor[4]; // color - LitChannel& colorchan = xfmem.color[chan]; + const LitChannel& colorchan = xfmem.color[chan]; if (colorchan.matsource) *(u32*)matcolor = *(u32*)src->color[chan]; // vertex else @@ -344,7 +344,7 @@ void TransformColor(const InputVertexData* src, OutputVertexData* dst) } else { - u8* ambColor = (u8*)&xfmem.ambColor[chan]; + const u8* ambColor = reinterpret_cast<u8*>(&xfmem.ambColor[chan]); lightCol.x = ambColor[1]; lightCol.y = ambColor[2]; lightCol.z = ambColor[3]; @@ -370,7 +370,7 @@ void TransformColor(const InputVertexData* src, OutputVertexData* dst) } // alpha - LitChannel& alphachan = xfmem.alpha[chan]; + const LitChannel& alphachan = xfmem.alpha[chan]; if (alphachan.matsource) matcolor[0] = src->color[chan][0]; // vertex else |
