summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-06-01 19:58:27 +0200
committerTillmann Karras <tilkax@gmail.com>2015-06-07 12:13:00 +0200
commit5ddd2cef6c5cc8e5414636d73365691de726b3d0 (patch)
tree0fc5652023050ddcccd41598983a233487de8256 /Source/Core/VideoCommon/VertexLoader.cpp
parent9e2f4dd7da306a011d3f34bad7c1808186a9bbd0 (diff)
zfreeze: cache vertex positions
Suggested by degasus.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp
index 72aad88d7f..b8c8fab4de 100644
--- a/Source/Core/VideoCommon/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/VertexLoader.cpp
@@ -14,6 +14,7 @@
#include "VideoCommon/VertexLoader_Normal.h"
#include "VideoCommon/VertexLoader_Position.h"
#include "VideoCommon/VertexLoader_TextCoord.h"
+#include "VideoCommon/VertexLoaderManager.h"
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/VideoConfig.h"
@@ -24,6 +25,8 @@ u8* g_vertex_manager_write_ptr;
static void LOADERDECL PosMtx_ReadDirect_UByte(VertexLoader* loader)
{
u32 posmtx = DataReadU8() & 0x3f;
+ if (loader->m_counter < 3)
+ VertexLoaderManager::position_matrix_index[loader->m_counter] = posmtx;
DataWrite<u32>(posmtx);
PRIM_LOG("posmtx: %d, ", posmtx);
}
@@ -316,7 +319,7 @@ int VertexLoader::RunVertices(DataReader src, DataReader dst, int count)
m_numLoadedVertices += count;
m_skippedVertices = 0;
- for (int s = 0; s < count; s++)
+ for (m_counter = count - 1; m_counter >= 0; m_counter--)
{
m_tcIndex = 0;
m_colIndex = 0;