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/vertexes | |
parent | 34877e971c6229f9ee8047e8eaa97437ad774c65 (diff) | |
download | manaplus-17f34f00d37432dae207be3d55ec531a738eb065.tar.gz manaplus-17f34f00d37432dae207be3d55ec531a738eb065.tar.bz2 manaplus-17f34f00d37432dae207be3d55ec531a738eb065.tar.xz manaplus-17f34f00d37432dae207be3d55ec531a738eb065.zip |
Split graphicsvetexes into multiply files.
Diffstat (limited to 'src/render/vertexes')
-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 |
6 files changed, 217 insertions, 100 deletions
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 |