summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader_Position.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-11-24 22:22:42 +0100
committerdegasus <wickmarkus@web.de>2014-12-09 18:56:27 +0100
commit27f984c02ee8293f2a1542968bdaff8cc8cedb73 (patch)
tree2ecb543f9ed699b3a8234f263139cb2d5d91a871 /Source/Core/VideoCommon/VertexLoader_Position.cpp
parent1ad8d4629c36caecacdba33a609b403c5b6cb68d (diff)
VideoCommon: rewrite DataReader
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader_Position.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp
index 6c50dd1560..4dacfd6042 100644
--- a/Source/Core/VideoCommon/VertexLoader_Position.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp
@@ -75,12 +75,14 @@ void LOADERDECL Pos_ReadDirect()
{
static_assert(N <= 3, "N > 3 is not sane!");
auto const scale = posScale[0];
- DataWriter dst;
- DataReader src;
+ DataReader dst(VertexManager::s_pCurBufferPointer, nullptr);
+ DataReader src(g_video_buffer_read_ptr, nullptr);
for (int i = 0; i < 3; ++i)
dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 0.f);
+ dst.WritePointer(&VertexManager::s_pCurBufferPointer);
+ src.WritePointer(&g_video_buffer_read_ptr);
LOG_VTX();
}
@@ -93,11 +95,12 @@ void LOADERDECL Pos_ReadIndex()
auto const index = DataRead<I>();
auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION]));
auto const scale = posScale[0];
- DataWriter dst;
+ DataReader dst(VertexManager::s_pCurBufferPointer, nullptr);
for (int i = 0; i < 3; ++i)
dst.Write(i<N ? PosScale(Common::FromBigEndian(data[i]), scale) : 0.f);
+ dst.WritePointer(&VertexManager::s_pCurBufferPointer);
LOG_VTX();
}