summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/Software/Clipper.cpp7
-rw-r--r--Source/Core/VideoBackends/Software/Clipper.h3
-rw-r--r--Source/Core/VideoBackends/Software/DebugUtil.cpp5
-rw-r--r--Source/Core/VideoBackends/Software/DebugUtil.h7
-rw-r--r--Source/Core/VideoBackends/Software/NativeVertexFormat.h2
-rw-r--r--Source/Core/VideoBackends/Software/Rasterizer.cpp3
-rw-r--r--Source/Core/VideoBackends/Software/Rasterizer.h5
-rw-r--r--Source/Core/VideoBackends/Software/TextureEncoder.cpp17
8 files changed, 28 insertions, 21 deletions
diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp
index c0c8021808..8917eeedb9 100644
--- a/Source/Core/VideoBackends/Software/Clipper.cpp
+++ b/Source/Core/VideoBackends/Software/Clipper.cpp
@@ -72,7 +72,7 @@ enum
CLIP_NEG_Z_BIT = 0x20
};
-static inline int CalcClipMask(OutputVertexData* v)
+static inline int CalcClipMask(const OutputVertexData* v)
{
int cmask = 0;
Vec4 pos = v->projectedPosition;
@@ -329,7 +329,7 @@ void ProcessTriangle(OutputVertexData* v0, OutputVertexData* v1, OutputVertexDat
}
}
-static void CopyVertex(OutputVertexData* dst, OutputVertexData* src, float dx, float dy,
+static void CopyVertex(OutputVertexData* dst, const OutputVertexData* src, float dx, float dy,
unsigned int sOffset)
{
dst->screenPosition.x = src->screenPosition.x + dx;
@@ -403,7 +403,8 @@ void ProcessLine(OutputVertexData* lineV0, OutputVertexData* lineV1)
}
}
-bool CullTest(OutputVertexData* v0, OutputVertexData* v1, OutputVertexData* v2, bool& backface)
+bool CullTest(const OutputVertexData* v0, const OutputVertexData* v1, const OutputVertexData* v2,
+ bool& backface)
{
int mask = CalcClipMask(v0);
mask &= CalcClipMask(v1);
diff --git a/Source/Core/VideoBackends/Software/Clipper.h b/Source/Core/VideoBackends/Software/Clipper.h
index 0b2d3440c9..319b88552d 100644
--- a/Source/Core/VideoBackends/Software/Clipper.h
+++ b/Source/Core/VideoBackends/Software/Clipper.h
@@ -14,7 +14,8 @@ void ProcessTriangle(OutputVertexData* v0, OutputVertexData* v1, OutputVertexDat
void ProcessLine(OutputVertexData* v0, OutputVertexData* v1);
-bool CullTest(OutputVertexData* v0, OutputVertexData* v1, OutputVertexData* v2, bool& backface);
+bool CullTest(const OutputVertexData* v0, const OutputVertexData* v1, const OutputVertexData* v2,
+ bool& backface);
void PerspectiveDivide(OutputVertexData* vertex);
}
diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp
index bb85ef4fd5..95627abc5a 100644
--- a/Source/Core/VideoBackends/Software/DebugUtil.cpp
+++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp
@@ -154,7 +154,8 @@ static void DumpEfb(const std::string& filename)
delete[] data;
}
-void DrawObjectBuffer(s16 x, s16 y, u8* color, int bufferBase, int subBuffer, const char* name)
+void DrawObjectBuffer(s16 x, s16 y, const u8* color, int bufferBase, int subBuffer,
+ const char* name)
{
int buffer = bufferBase + subBuffer;
@@ -170,7 +171,7 @@ void DrawObjectBuffer(s16 x, s16 y, u8* color, int bufferBase, int subBuffer, co
BufferBase[buffer] = bufferBase;
}
-void DrawTempBuffer(u8* color, int buffer)
+void DrawTempBuffer(const u8* color, int buffer)
{
u8* dst = (u8*)&TempBuffer[buffer];
*(dst++) = color[2];
diff --git a/Source/Core/VideoBackends/Software/DebugUtil.h b/Source/Core/VideoBackends/Software/DebugUtil.h
index c90e790496..1b95b2b222 100644
--- a/Source/Core/VideoBackends/Software/DebugUtil.h
+++ b/Source/Core/VideoBackends/Software/DebugUtil.h
@@ -4,7 +4,7 @@
#pragma once
-#include "Common/Common.h"
+#include "Common/CommonTypes.h"
namespace DebugUtil
{
@@ -18,8 +18,9 @@ void DumpActiveTextures();
void OnObjectBegin();
void OnObjectEnd();
-void DrawObjectBuffer(s16 x, s16 y, u8* color, int bufferBase, int subBuffer, const char* name);
+void DrawObjectBuffer(s16 x, s16 y, const u8* color, int bufferBase, int subBuffer,
+ const char* name);
-void DrawTempBuffer(u8* color, int buffer);
+void DrawTempBuffer(const u8* color, int buffer);
void CopyTempBuffer(s16 x, s16 y, int bufferBase, int subBuffer, const char* name);
}
diff --git a/Source/Core/VideoBackends/Software/NativeVertexFormat.h b/Source/Core/VideoBackends/Software/NativeVertexFormat.h
index a80ebc80bb..4da332b71b 100644
--- a/Source/Core/VideoBackends/Software/NativeVertexFormat.h
+++ b/Source/Core/VideoBackends/Software/NativeVertexFormat.h
@@ -44,7 +44,7 @@ struct OutputVertexData
u8 color[2][4] = {};
Vec3 texCoords[8] = {};
- void Lerp(float t, OutputVertexData* a, OutputVertexData* b)
+ void Lerp(float t, const OutputVertexData* a, const OutputVertexData* b)
{
#define LINTERP(T, OUT, IN) (OUT) + ((IN - OUT) * T)
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
diff --git a/Source/Core/VideoBackends/Software/TextureEncoder.cpp b/Source/Core/VideoBackends/Software/TextureEncoder.cpp
index c046d9e5a5..15e159b30f 100644
--- a/Source/Core/VideoBackends/Software/TextureEncoder.cpp
+++ b/Source/Core/VideoBackends/Software/TextureEncoder.cpp
@@ -157,7 +157,7 @@ static inline void BoxfilterRGB_to_RGB8(const u8* src, u8* r, u8* g, u8* b)
*b = b16 >> 2;
}
-static inline void BoxfilterRGB_to_x8(u8* src, u8* x8, int comp)
+static inline void BoxfilterRGB_to_x8(const u8* src, u8* x8, int comp)
{
u16 x16 = 0;
@@ -260,7 +260,7 @@ static void SetSpans(int sBlkSize, int tBlkSize, s32* tSpan, s32* sBlkSpan, s32*
dstBlockStart += writeStride; \
}
-static void EncodeRGBA6(u8* dst, u8* src, u32 format)
+static void EncodeRGBA6(u8* dst, const u8* src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@@ -499,7 +499,7 @@ static void EncodeRGBA6(u8* dst, u8* src, u32 format)
}
}
-static void EncodeRGBA6halfscale(u8* dst, u8* src, u32 format)
+static void EncodeRGBA6halfscale(u8* dst, const u8* src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@@ -734,7 +734,7 @@ static void EncodeRGBA6halfscale(u8* dst, u8* src, u32 format)
}
}
-static void EncodeRGB8(u8* dst, u8* src, u32 format)
+static void EncodeRGB8(u8* dst, const u8* src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@@ -946,7 +946,7 @@ static void EncodeRGB8(u8* dst, u8* src, u32 format)
}
}
-static void EncodeRGB8halfscale(u8* dst, u8* src, u32 format)
+static void EncodeRGB8halfscale(u8* dst, const u8* src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@@ -1174,7 +1174,7 @@ static void EncodeRGB8halfscale(u8* dst, u8* src, u32 format)
}
}
-static void EncodeZ24(u8* dst, u8* src, u32 format)
+static void EncodeZ24(u8* dst, const u8* src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@@ -1278,7 +1278,7 @@ static void EncodeZ24(u8* dst, u8* src, u32 format)
}
}
-static void EncodeZ24halfscale(u8* dst, u8* src, u32 format)
+static void EncodeZ24halfscale(u8* dst, const u8* src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@@ -1409,7 +1409,8 @@ void Encode(u8* dest_ptr)
else if (copyfmt > GX_TF_RGBA8 || (copyfmt < GX_TF_RGB565 && !bIsIntensityFmt))
format |= _GX_TF_CTF;
- u8* src = EfbInterface::GetPixelPointer(bpmem.copyTexSrcXY.x, bpmem.copyTexSrcXY.y, bFromZBuffer);
+ const u8* src =
+ EfbInterface::GetPixelPointer(bpmem.copyTexSrcXY.x, bpmem.copyTexSrcXY.y, bFromZBuffer);
if (bpmem.triggerEFBCopy.half_scale)
{