diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-26 16:43:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-26 16:43:56 +0300 |
commit | 17f34f00d37432dae207be3d55ec531a738eb065 (patch) | |
tree | a04d12667d1a36480538fb939fb874c62980448d /src/render | |
parent | 34877e971c6229f9ee8047e8eaa97437ad774c65 (diff) | |
download | plus-17f34f00d37432dae207be3d55ec531a738eb065.tar.gz plus-17f34f00d37432dae207be3d55ec531a738eb065.tar.bz2 plus-17f34f00d37432dae207be3d55ec531a738eb065.tar.xz plus-17f34f00d37432dae207be3d55ec531a738eb065.zip |
Split graphicsvetexes into multiply files.
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/mobileopengl2graphics.cpp | 2 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 2 | ||||
-rw-r--r-- | src/render/modernopenglgraphics.cpp | 2 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 2 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 2 | ||||
-rw-r--r-- | src/render/sdl2graphics.cpp | 2 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.cpp | 2 | ||||
-rw-r--r-- | src/render/sdlgraphics.cpp | 2 | ||||
-rw-r--r-- | src/render/vertexes/imagecollection.cpp | 56 | ||||
-rw-r--r-- | src/render/vertexes/imagecollection.h | 55 | ||||
-rw-r--r-- | src/render/vertexes/imagevertexes.cpp | 41 | ||||
-rw-r--r-- | src/render/vertexes/imagevertexes.h | 56 | ||||
-rw-r--r-- | src/render/vertexes/openglgraphicsvertexes.cpp (renamed from src/render/vertexes/graphicsvertexes.cpp) | 50 | ||||
-rw-r--r-- | src/render/vertexes/openglgraphicsvertexes.h (renamed from src/render/vertexes/graphicsvertexes.h) | 59 |
14 files changed, 225 insertions, 108 deletions
diff --git a/src/render/mobileopengl2graphics.cpp b/src/render/mobileopengl2graphics.cpp index 7e40f4139..5feaa0d2e 100644 --- a/src/render/mobileopengl2graphics.cpp +++ b/src/render/mobileopengl2graphics.cpp @@ -35,7 +35,7 @@ #include "render/shaders/shaderprogram.h" #include "render/shaders/shadersmanager.h" -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index b3aca8ed8..c8d4a93d4 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -31,7 +31,7 @@ #include "render/opengl/naclglfunctions.h" #endif -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index 1cfb07690..afebaf1c5 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -35,7 +35,7 @@ #include "render/shaders/shaderprogram.h" #include "render/shaders/shadersmanager.h" -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index bd6aa2b38..751877bfe 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -28,7 +28,7 @@ #include "render/opengl/mgl.h" -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 7203468a6..d4e878479 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -30,7 +30,7 @@ #include "logger.h" #endif -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 6b798eaec..babeeb6fd 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -73,7 +73,7 @@ #include "graphicsmanager.h" #include "logger.h" -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagehelper.h" diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index a8f307124..8ba667faa 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -30,7 +30,7 @@ #include "graphicsmanager.h" #include "logger.h" -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagehelper.h" diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 421b2508b..6972b03da 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -32,7 +32,7 @@ #include "utils/sdlpixel.h" -#include "render/vertexes/graphicsvertexes.h" +#include "render/vertexes/imagecollection.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/vertexes/imagecollection.cpp b/src/render/vertexes/imagecollection.cpp new file mode 100644 index 000000000..787fe3426 --- /dev/null +++ b/src/render/vertexes/imagecollection.cpp @@ -0,0 +1,56 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "render/vertexes/imagecollection.h" + +#ifdef USE_OPENGL +#include "render/graphics.h" +#endif + +#include "utils/dtor.h" + +#include "debug.h" + +ImageCollection::ImageCollection() : +#ifdef USE_OPENGL + currentGLImage(0), +#endif + currentImage(nullptr), + currentVert(nullptr), + draws() +{ +} + +ImageCollection::~ImageCollection() +{ + clear(); +} + +void ImageCollection::clear() restrict2 +{ +#ifdef USE_OPENGL + currentGLImage = 0; +#endif + currentImage = nullptr; + currentVert = nullptr; + + delete_all(draws); + draws.clear(); +} diff --git a/src/render/vertexes/imagecollection.h b/src/render/vertexes/imagecollection.h new file mode 100644 index 000000000..e4567d85f --- /dev/null +++ b/src/render/vertexes/imagecollection.h @@ -0,0 +1,55 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef RENDER_VERTEXES_IMAGECOLLECTION_H +#define RENDER_VERTEXES_IMAGECOLLECTION_H + +#include "main.h" + +#include "resources/rect/doublerect.h" + +#include "render/vertexes/imagevertexes.h" + +#include "localconsts.h" + +class Image; + +class ImageCollection final +{ + public: + ImageCollection(); + + A_DELETE_COPY(ImageCollection) + + ~ImageCollection(); + + void clear() restrict2; + +#ifdef USE_OPENGL + GLuint currentGLImage; +#endif + const Image *restrict currentImage; + + ImageVertexes *restrict currentVert; + + ImageVertexesVector draws; +}; + +#endif // RENDER_VERTEXES_IMAGECOLLECTION_H diff --git a/src/render/vertexes/imagevertexes.cpp b/src/render/vertexes/imagevertexes.cpp new file mode 100644 index 000000000..675078faf --- /dev/null +++ b/src/render/vertexes/imagevertexes.cpp @@ -0,0 +1,41 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "render/vertexes/imagevertexes.h" + +#include "utils/dtor.h" + +#include "debug.h" + +ImageVertexes::ImageVertexes() : + image(nullptr), +#ifdef USE_OPENGL + ogl(), +#endif + sdl() +{ + sdl.reserve(30); +} + +ImageVertexes::~ImageVertexes() +{ + delete_all(sdl); + sdl.clear(); +} diff --git a/src/render/vertexes/imagevertexes.h b/src/render/vertexes/imagevertexes.h new file mode 100644 index 000000000..eb6205d98 --- /dev/null +++ b/src/render/vertexes/imagevertexes.h @@ -0,0 +1,56 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef RENDER_VERTEXES_IMAGEVERTEXES_H +#define RENDER_VERTEXES_IMAGEVERTEXES_H + +#include "resources/rect/doublerect.h" + +#include "render/vertexes/openglgraphicsvertexes.h" + +#include <vector> + +#include "localconsts.h" + +class Image; + +typedef std::vector<DoubleRect*> DoubleRects; + +class ImageVertexes final +{ + public: + ImageVertexes(); + + A_DELETE_COPY(ImageVertexes) + + ~ImageVertexes(); + + const Image *restrict image; +#ifdef USE_OPENGL + OpenGLGraphicsVertexes ogl; +#endif + DoubleRects sdl; +}; + +typedef std::vector<ImageVertexes*> ImageVertexesVector; +typedef ImageVertexesVector::iterator ImageCollectionIter; +typedef ImageVertexesVector::const_iterator ImageCollectionCIter; + +#endif // RENDER_VERTEXES_IMAGEVERTEXES_H diff --git a/src/render/vertexes/graphicsvertexes.cpp b/src/render/vertexes/openglgraphicsvertexes.cpp index d2cd830af..d111860d1 100644 --- a/src/render/vertexes/graphicsvertexes.cpp +++ b/src/render/vertexes/openglgraphicsvertexes.cpp @@ -18,17 +18,16 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "render/vertexes/graphicsvertexes.h" - #ifdef USE_OPENGL + +#include "render/vertexes/imagecollection.h" + #include "render/graphics.h" -#endif #include "utils/dtor.h" #include "debug.h" -#ifdef USE_OPENGL unsigned int vertexBufSize = 500; OpenGLGraphicsVertexes::OpenGLGraphicsVertexes() : @@ -226,46 +225,3 @@ GLint *OpenGLGraphicsVertexes::continueIntTexArray() restrict2 return mIntTexArray; } #endif - -ImageVertexes::ImageVertexes() : - image(nullptr), -#ifdef USE_OPENGL - ogl(), -#endif - sdl() -{ - sdl.reserve(30); -} - -ImageVertexes::~ImageVertexes() -{ - delete_all(sdl); - sdl.clear(); -} - -ImageCollection::ImageCollection() : -#ifdef USE_OPENGL - currentGLImage(0), -#endif - currentImage(nullptr), - currentVert(nullptr), - draws() -{ -} - -ImageCollection::~ImageCollection() -{ - clear(); -} - -void ImageCollection::clear() restrict2 -{ -#ifdef USE_OPENGL - currentGLImage = 0; -#endif - currentImage = nullptr; - currentVert = nullptr; - - delete_all(draws); - draws.clear(); -} diff --git a/src/render/vertexes/graphicsvertexes.h b/src/render/vertexes/openglgraphicsvertexes.h index d9e7e1694..b27ccb095 100644 --- a/src/render/vertexes/graphicsvertexes.h +++ b/src/render/vertexes/openglgraphicsvertexes.h @@ -18,15 +18,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef GRAPHICSVERTEXES_H -#define GRAPHICSVERTEXES_H - -#include "main.h" - -#include "resources/rect/doublerect.h" +#ifndef RENDER_VERTEXES_OPENGLGRAPHICSVERTEXES_H +#define RENDER_VERTEXES_OPENGLGRAPHICSVERTEXES_H #ifdef USE_OPENGL +#include "main.h" + #ifdef ANDROID #include <GLES/gl.h> #else @@ -108,53 +106,8 @@ class OpenGLGraphicsVertexes final std::vector<GLint*> mIntTexPool; std::vector<GLuint> mVbo; }; -#endif - -typedef std::vector<DoubleRect*> DoubleRects; - -class ImageVertexes final -{ - public: - ImageVertexes(); - - A_DELETE_COPY(ImageVertexes) - - ~ImageVertexes(); - - const Image *restrict image; -#ifdef USE_OPENGL - OpenGLGraphicsVertexes ogl; -#endif - DoubleRects sdl; -}; -typedef std::vector<ImageVertexes*> ImageVertexesVector; -typedef ImageVertexesVector::iterator ImageCollectionIter; -typedef ImageVertexesVector::const_iterator ImageCollectionCIter; - -class ImageCollection final -{ - public: - ImageCollection(); - - A_DELETE_COPY(ImageCollection) - - ~ImageCollection(); - - void clear() restrict2; - -#ifdef USE_OPENGL - GLuint currentGLImage; -#endif - const Image *restrict currentImage; - - ImageVertexes *restrict currentVert; - - ImageVertexesVector draws; -}; - -#ifdef USE_OPENGL extern unsigned int vertexBufSize; -#endif +#endif // USE_OPENGL -#endif // GRAPHICSVERTEXES_H +#endif // RENDER_VERTEXES_OPENGLGRAPHICSVERTEXES_H |