From 023723c3109aba4841ec91ca9495e6703804fd7f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 11 Sep 2012 00:49:11 +0300 Subject: Limit tile batches to 512 size only. --- src/normalopenglgraphics.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/normalopenglgraphics.cpp b/src/normalopenglgraphics.cpp index 0538d2da1..d2b7818dd 100644 --- a/src/normalopenglgraphics.cpp +++ b/src/normalopenglgraphics.cpp @@ -820,7 +820,7 @@ void NormalOpenGLGraphics::calcTile(ImageVertexes *const vert, const float tw = static_cast(image->mTexWidth); const float th = static_cast(image->mTexHeight); - const unsigned int vLimit = mMaxVertices * 4; + const unsigned int vLimit = 512 * 4; NormalOpenGLGraphicsVertexes *ogl = vert->ogl; @@ -833,9 +833,9 @@ void NormalOpenGLGraphics::calcTile(ImageVertexes *const vert, float texY1 = static_cast(srcY) / th; if (!ogl->mFloatTexArray) - ogl->mFloatTexArray = new GLfloat[mMaxVertices * 4 + 30]; + ogl->mFloatTexArray = new GLfloat[vLimit]; if (!ogl->mIntVertArray) - ogl->mIntVertArray = new GLint[mMaxVertices * 4 + 30]; + ogl->mIntVertArray = new GLint[vLimit]; GLfloat *floatTexArray = ogl->mFloatTexArray; GLint *intVertArray = ogl->mIntVertArray; @@ -878,9 +878,9 @@ void NormalOpenGLGraphics::calcTile(ImageVertexes *const vert, else { if (!ogl->mIntTexArray) - ogl->mIntTexArray = new GLint[mMaxVertices * 4 + 30]; + ogl->mIntTexArray = new GLint[vLimit]; if (!ogl->mIntVertArray) - ogl->mIntVertArray = new GLint[mMaxVertices * 4 + 30]; + ogl->mIntVertArray = new GLint[vLimit]; GLint *intTexArray = ogl->mIntTexArray; GLint *intVertArray = ogl->mIntVertArray; -- cgit v1.2.3-60-g2f50