diff --git a/yg/blitter.cpp b/yg/blitter.cpp index eeaec98711..0c80428546 100644 --- a/yg/blitter.cpp +++ b/yg/blitter.cpp @@ -145,8 +145,7 @@ namespace yg for (unsigned i = 0; i < s; ++i) base_t::drawGeometry(blitInfo[i].m_srcSurface, - storage.m_vertices, - storage.m_indices, + storage, 4, sizeof(unsigned short) * i * 4, GL_TRIANGLE_FAN); diff --git a/yg/geometry_batcher.cpp b/yg/geometry_batcher.cpp index 8a5efb873c..dd947c718c 100644 --- a/yg/geometry_batcher.cpp +++ b/yg/geometry_batcher.cpp @@ -384,8 +384,7 @@ namespace yg unlockPipeline(pipelineID); drawGeometry(skinPage->texture(), - pipeline.m_storage.m_vertices, - pipeline.m_storage.m_indices, + pipeline.m_storage, pipeline.m_currentIndex, 0, GL_TRIANGLES); diff --git a/yg/geometry_renderer.cpp b/yg/geometry_renderer.cpp index 1fb097669b..92bc8a61c9 100644 --- a/yg/geometry_renderer.cpp +++ b/yg/geometry_renderer.cpp @@ -99,10 +99,10 @@ namespace yg if (isDebugging()) LOG(LINFO, ("performing DrawGeometry command")); - m_vertices->makeCurrent(); + m_storage.m_vertices->makeCurrent(); /// it's crucial to setupLayout after vertices->makeCurrent - Vertex::setupLayout(m_vertices->glPtr()); - m_indices->makeCurrent(); + Vertex::setupLayout(m_storage.m_vertices->glPtr()); + m_storage.m_indices->makeCurrent(); if (isDebugging()) LOG(LINFO, ("using", m_texture->id(), "texture")); @@ -121,14 +121,13 @@ namespace yg m_primitiveType, m_indicesCount, GL_UNSIGNED_SHORT, - ((unsigned char*)m_indices->glPtr()) + m_indicesOffs)); + ((unsigned char*)m_storage.m_indices->glPtr()) + m_indicesOffs)); // OGLCHECK(glPolygonMode( GL_FRONT_AND_BACK, GL_FILL )); } void GeometryRenderer::drawGeometry(shared_ptr const & texture, - shared_ptr const & vertices, - shared_ptr const & indices, + Storage const & storage, size_t indicesCount, size_t indicesOffs, unsigned primType) @@ -136,8 +135,7 @@ namespace yg shared_ptr command(new DrawGeometry()); command->m_texture = texture; - command->m_indices = indices; - command->m_vertices = vertices; + command->m_storage = storage; command->m_indicesCount = indicesCount; command->m_indicesOffs = indicesOffs; command->m_primitiveType = primType; diff --git a/yg/geometry_renderer.hpp b/yg/geometry_renderer.hpp index 48ad34d499..dcebc9c728 100644 --- a/yg/geometry_renderer.hpp +++ b/yg/geometry_renderer.hpp @@ -46,8 +46,7 @@ namespace yg struct DrawGeometry : Command { shared_ptr m_texture; - shared_ptr m_vertices; - shared_ptr m_indices; + Storage m_storage; size_t m_indicesCount; size_t m_indicesOffs; unsigned m_primitiveType; @@ -107,8 +106,7 @@ namespace yg void applyStates(); void drawGeometry(shared_ptr const & texture, - shared_ptr const & vertices, - shared_ptr const & indices, + Storage const & storage, size_t indicesCount, size_t indicesOffs, unsigned primType); diff --git a/yg/render_state_updater.cpp b/yg/render_state_updater.cpp index d72e20b39a..c9f434c365 100644 --- a/yg/render_state_updater.cpp +++ b/yg/render_state_updater.cpp @@ -40,13 +40,12 @@ namespace yg } void RenderStateUpdater::drawGeometry(shared_ptr const & texture, - shared_ptr const & vertices, - shared_ptr const & indices, + Storage const & storage, size_t indicesCount, size_t indicesOffs, unsigned primType) { - base_t::drawGeometry(texture, vertices, indices, indicesCount, indicesOffs, primType); + base_t::drawGeometry(texture, storage, indicesCount, indicesOffs, primType); m_indicesCount += indicesCount; if (m_doPeriodicalUpdate && m_renderState diff --git a/yg/render_state_updater.hpp b/yg/render_state_updater.hpp index 0c6d6739a1..d958a372c7 100644 --- a/yg/render_state_updater.hpp +++ b/yg/render_state_updater.hpp @@ -61,8 +61,7 @@ namespace yg shared_ptr const & renderState() const; void drawGeometry(shared_ptr const & texture, - shared_ptr const & vertices, - shared_ptr const & indices, + Storage const & storage, size_t indicesCount, size_t indicesOffs, unsigned primType);