summaryrefslogtreecommitdiff
path: root/src/render/mobileopenglgraphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/mobileopenglgraphics.cpp')
-rw-r--r--src/render/mobileopenglgraphics.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index 8150c4f66..34e5c334c 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -99,15 +99,12 @@ MobileOpenGLGraphics::MobileOpenGLGraphics():
MobileOpenGLGraphics::~MobileOpenGLGraphics()
{
- delete [] mFloatTexArray;
- delete [] mShortVertArray;
- delete [] mFloatTexArrayCached;
- delete [] mShortVertArrayCached;
+ deleteArraysInternal();
}
-void MobileOpenGLGraphics::initArrays()
+void MobileOpenGLGraphics::initArrays(const int vertCount)
{
- mMaxVertices = graphicsManager.getMaxVertices();
+ mMaxVertices = vertCount;
if (mMaxVertices < 500)
mMaxVertices = 500;
else if (mMaxVertices > 1024)
@@ -126,6 +123,23 @@ void MobileOpenGLGraphics::initArrays()
mShortVertArrayCached = new GLshort[sz];
}
+void MobileOpenGLGraphics::deleteArrays()
+{
+ deleteArraysInternal();
+}
+
+void MobileOpenGLGraphics::deleteArraysInternal()
+{
+ delete [] mFloatTexArray;
+ mFloatTexArray = nullptr;
+ delete [] mShortVertArray;
+ mShortVertArray = nullptr;
+ delete [] mFloatTexArrayCached;
+ mFloatTexArrayCached = nullptr;
+ delete [] mShortVertArrayCached;
+ mShortVertArrayCached = nullptr;
+}
+
bool MobileOpenGLGraphics::setVideoMode(const int w, const int h,
const int scale,
const int bpp,