diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-10 16:56:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-10 16:56:43 +0300 |
commit | 6ccc6e73a226c40c2f3538f6d6126bb2774edd52 (patch) | |
tree | b74983012893021f3fd33e286b90898b3c071a7d | |
parent | 6e2867b935af242ca96767732e37b85a01620f42 (diff) | |
download | plus-6ccc6e73a226c40c2f3538f6d6126bb2774edd52.tar.gz plus-6ccc6e73a226c40c2f3538f6d6126bb2774edd52.tar.bz2 plus-6ccc6e73a226c40c2f3538f6d6126bb2774edd52.tar.xz plus-6ccc6e73a226c40c2f3538f6d6126bb2774edd52.zip |
Remove unused buffers from modernopengl.
-rw-r--r-- | src/render/modernopenglgraphics.cpp | 31 | ||||
-rw-r--r-- | src/render/modernopenglgraphics.h | 6 |
2 files changed, 13 insertions, 24 deletions
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index ab8a9a787..22c9beea7 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -51,10 +51,8 @@ unsigned int ModernOpenGLGraphics::mLastDrawCalls = 0; #endif ModernOpenGLGraphics::ModernOpenGLGraphics() : - mFloatTexArray(nullptr), - mShortVertArray(nullptr), - mFloatTexArrayCached(nullptr), - mShortVertArrayCached(nullptr), + mFloatArray(nullptr), + mFloatArrayCached(nullptr), mSimpleProgram(nullptr), mTextureProgram(nullptr), mAlphaCached(1.0F), @@ -103,14 +101,10 @@ void ModernOpenGLGraphics::initArrays(const int vertCount) // need alocate small size, after if limit reached reallocate to double size const size_t sz = mMaxVertices * 4 + 30; vertexBufSize = mMaxVertices; - if (!mFloatTexArray) - mFloatTexArray = new GLfloat[sz]; - if (!mShortVertArray) - mShortVertArray = new GLshort[sz]; - if (!mFloatTexArrayCached) - mFloatTexArrayCached = new GLfloat[sz]; - if (!mShortVertArrayCached) - mShortVertArrayCached = new GLshort[sz]; + if (!mFloatArray) + mFloatArray = new GLfloat[sz]; + if (!mFloatArrayCached) + mFloatArrayCached = new GLfloat[sz]; } void ModernOpenGLGraphics::postInit() @@ -158,14 +152,10 @@ void ModernOpenGLGraphics::deleteArrays() void ModernOpenGLGraphics::deleteArraysInternal() { - delete [] mFloatTexArray; - mFloatTexArray = nullptr; - delete [] mShortVertArray; - mShortVertArray = nullptr; - delete [] mFloatTexArrayCached; - mFloatTexArrayCached = nullptr; - delete [] mShortVertArrayCached; - mShortVertArrayCached = nullptr; + delete [] mFloatArray; + mFloatArray = nullptr; + delete [] mFloatArrayCached; + mFloatArrayCached = nullptr; } bool ModernOpenGLGraphics::setVideoMode(const int w, const int h, @@ -340,6 +330,7 @@ void ModernOpenGLGraphics::drawPatternInline(const Image *const image, const int x, const int y, const int w, const int h) { + } void ModernOpenGLGraphics::drawRescaledPattern(const Image *const image, diff --git a/src/render/modernopenglgraphics.h b/src/render/modernopenglgraphics.h index 8e60c5b5f..3b3be8d85 100644 --- a/src/render/modernopenglgraphics.h +++ b/src/render/modernopenglgraphics.h @@ -78,10 +78,8 @@ class ModernOpenGLGraphics final : public Graphics const int dstX, const int dstY, const int width, const int height); - GLfloat *mFloatTexArray; - GLshort *mShortVertArray; - GLfloat *mFloatTexArrayCached; - GLshort *mShortVertArrayCached; + GLfloat *mFloatArray; + GLfloat *mFloatArrayCached; ShaderProgram *mSimpleProgram; ShaderProgram *mTextureProgram; float mAlphaCached; |