summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp
index bcc6bd14fa..694f207ff7 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp
@@ -30,6 +30,7 @@
#include "VertexLoader.h"
#include "VertexManager.h"
#include "VertexShaderManager.h"
+#include "Statistics.h"
#include "BPStructs.h"
#include "Fifo.h"
@@ -44,14 +45,6 @@ extern u8* FAKE_GetFifoEndPtr();
void Decode();
-template <class T>
-void Xchg(T& a, T&b)
-{
- T c = a;
- a = b;
- b = c;
-}
-
void ExecuteDisplayList(u32 address, u32 size)
{
u8* old_pVideoData = g_pVideoData;
@@ -59,13 +52,10 @@ void ExecuteDisplayList(u32 address, u32 size)
u8* startAddress = Memory_GetPtr(address);
g_pVideoData = startAddress;
- // temporarily swap dl and non-dl(small "hack" for the stats)
- Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
- Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
- Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
- Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
-
- while((u32)(g_pVideoData - startAddress) < size)
+ // temporarily swap dl and non-dl (small "hack" for the stats)
+ Statistics::SwapDL();
+
+ while((u32)(g_pVideoData - startAddress) < size)
{
Decode();
}
@@ -73,10 +63,7 @@ void ExecuteDisplayList(u32 address, u32 size)
INCSTAT(stats.thisFrame.numDListsCalled);
// un-swap
- Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
- Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
- Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
- Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
+ Statistics::SwapDL();
// reset to the old pointer
g_pVideoData = old_pVideoData;