summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-30 21:21:40 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-30 21:21:40 +0300
commit9aa2b0ffb97f8a1b5ae5201983318d03615c11e1 (patch)
tree21df896ff8139745775d41c1c8f82a4c6431698e /src/render
parent96f7714510cba0a84cd749869f236188473c4553 (diff)
downloadmv-9aa2b0ffb97f8a1b5ae5201983318d03615c11e1.tar.gz
mv-9aa2b0ffb97f8a1b5ae5201983318d03615c11e1.tar.bz2
mv-9aa2b0ffb97f8a1b5ae5201983318d03615c11e1.tar.xz
mv-9aa2b0ffb97f8a1b5ae5201983318d03615c11e1.zip
add calcPatternInline into renders for internal usage.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/graphics_calcImageRect.hpp10
-rw-r--r--src/render/mobileopenglgraphics.cpp14
-rw-r--r--src/render/mobileopenglgraphics.h5
-rw-r--r--src/render/normalopenglgraphics.cpp14
-rw-r--r--src/render/normalopenglgraphics.h5
-rw-r--r--src/render/nullopenglgraphics.cpp14
-rw-r--r--src/render/nullopenglgraphics.h5
-rw-r--r--src/render/safeopenglgraphics.cpp13
-rw-r--r--src/render/safeopenglgraphics.h5
-rw-r--r--src/render/sdl2graphics.cpp14
-rw-r--r--src/render/sdl2graphics.h4
-rw-r--r--src/render/sdl2softwaregraphics.cpp12
-rw-r--r--src/render/sdl2softwaregraphics.h4
-rw-r--r--src/render/sdlgraphics.cpp14
-rw-r--r--src/render/sdlgraphics.h4
15 files changed, 113 insertions, 24 deletions
diff --git a/src/render/graphics_calcImageRect.hpp b/src/render/graphics_calcImageRect.hpp
index 403c85ba7..6da74fff0 100644
--- a/src/render/graphics_calcImageRect.hpp
+++ b/src/render/graphics_calcImageRect.hpp
@@ -50,7 +50,7 @@ if (center && drawMain)
{
const int tlw = topLeft->getWidth();
const int tlh = topLeft->getHeight();
- calcPattern(vert, center, tlw + x, tlh + y,
+ calcPatternInline(vert, center, tlw + x, tlh + y,
w - tlw - topRight->getWidth(),
h - tlh - bottomLeft->getHeight());
}
@@ -61,11 +61,11 @@ if (top && left && bottom && right)
const int rw = right->getWidth();
const int th = top->getHeight();
const int bh = bottom->getHeight();
- calcPattern(vert, top, x + lw, y, w - lw - rw, th);
- calcPattern(vert, bottom, x + lw, y + h - bh, w - lw - rw, bh);
- calcPattern(vert, left, x, y + th, lw, h - th - bh);
+ calcPatternInline(vert, top, x + lw, y, w - lw - rw, th);
+ calcPatternInline(vert, bottom, x + lw, y + h - bh, w - lw - rw, bh);
+ calcPatternInline(vert, left, x, y + th, lw, h - th - bh);
if (w > rw)
- calcPattern(vert, right, x + w - rw, y + th, rw, h - th - bh);
+ calcPatternInline(vert, right, x + w - rw, y + th, rw, h - th - bh);
}
calcTileVertexes(vert, topLeft, x, y);
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index 1b57f7160..52ed81add 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -584,6 +584,14 @@ void MobileOpenGLGraphics::calcPattern(ImageVertexes *const vert,
const int x, const int y,
const int w, const int h) const
{
+ calcPatternInline(vert, image, x, y, w, h);
+}
+
+void MobileOpenGLGraphics::calcPatternInline(ImageVertexes *const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const
+{
if (!image || !vert)
return;
@@ -700,7 +708,7 @@ void MobileOpenGLGraphics::calcPattern(ImageCollection* const vertCol,
vert = vertCol->currentVert;
}
- calcPattern(vert, image, x, y, w, h);
+ calcPatternInline(vert, image, x, y, w, h);
}
void MobileOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert,
@@ -1268,7 +1276,7 @@ void MobileOpenGLGraphics::drawImageRect(const int x, const int y,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_drawImageRect.hpp"
+ #include "render/graphics_drawImageRect.hpp"
}
void MobileOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
@@ -1276,7 +1284,7 @@ void MobileOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_calcImageRect.hpp"
+ #include "render/graphics_calcImageRect.hpp"
}
#ifdef DEBUG_BIND_TEXTURE
diff --git a/src/render/mobileopenglgraphics.h b/src/render/mobileopenglgraphics.h
index 3bc095cda..f4f1bf673 100644
--- a/src/render/mobileopenglgraphics.h
+++ b/src/render/mobileopenglgraphics.h
@@ -106,6 +106,11 @@ class MobileOpenGLGraphics final : public Graphics
int w, int h,
const ImageRect &imgRect);
+ void inline calcPatternInline(ImageVertexes *const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const;
+
GLfloat *mFloatTexArray;
GLshort *mShortVertArray;
GLfloat *mFloatTexArrayCached;
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index e3e0d7e19..c2b702fa8 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -790,6 +790,14 @@ void NormalOpenGLGraphics::calcPattern(ImageVertexes* const vert,
const int x, const int y,
const int w, const int h) const
{
+ calcPatternInline(vert, image, x, y, w, h);
+}
+
+void NormalOpenGLGraphics::calcPatternInline(ImageVertexes* const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const
+{
if (!image || !vert)
return;
@@ -934,7 +942,7 @@ void NormalOpenGLGraphics::calcPattern(ImageCollection* const vertCol,
vert = vertCol->currentVert;
}
- calcPattern(vert, image, x, y, w, h);
+ calcPatternInline(vert, image, x, y, w, h);
}
void NormalOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert,
@@ -1554,7 +1562,7 @@ void NormalOpenGLGraphics::drawImageRect(const int x, const int y,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_drawImageRect.hpp"
+ #include "render/graphics_drawImageRect.hpp"
}
void NormalOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
@@ -1562,7 +1570,7 @@ void NormalOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_calcImageRect.hpp"
+ #include "render/graphics_calcImageRect.hpp"
}
#ifdef DEBUG_BIND_TEXTURE
diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h
index b88a073c3..dd3e34208 100644
--- a/src/render/normalopenglgraphics.h
+++ b/src/render/normalopenglgraphics.h
@@ -120,6 +120,11 @@ class NormalOpenGLGraphics final : public Graphics
int w, int h,
const ImageRect &imgRect);
+ void inline calcPatternInline(ImageVertexes *const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const;
+
GLfloat *mFloatTexArray;
GLint *mIntTexArray;
GLint *mIntVertArray;
diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp
index 3a59f44bc..fa8e8e0e4 100644
--- a/src/render/nullopenglgraphics.cpp
+++ b/src/render/nullopenglgraphics.cpp
@@ -543,6 +543,14 @@ void NullOpenGLGraphics::calcPattern(ImageVertexes* const vert,
const int x, const int y,
const int w, const int h) const
{
+ calcPatternInline(vert, image, x, y, w, h);
+}
+
+void NullOpenGLGraphics::calcPatternInline(ImageVertexes* const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const
+{
if (!image || !vert)
return;
@@ -728,7 +736,7 @@ void NullOpenGLGraphics::calcPattern(ImageCollection* const vertCol,
vert = vertCol->currentVert;
}
- calcPattern(vert, image, x, y, w, h);
+ calcPatternInline(vert, image, x, y, w, h);
}
void NullOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert,
@@ -1143,7 +1151,7 @@ void NullOpenGLGraphics::drawImageRect(const int x, const int y,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_drawImageRect.hpp"
+ #include "render/graphics_drawImageRect.hpp"
}
void NullOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
@@ -1151,7 +1159,7 @@ void NullOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_calcImageRect.hpp"
+ #include "render/graphics_calcImageRect.hpp"
}
#ifdef DEBUG_BIND_TEXTURE
diff --git a/src/render/nullopenglgraphics.h b/src/render/nullopenglgraphics.h
index bb18da05b..26839bee3 100644
--- a/src/render/nullopenglgraphics.h
+++ b/src/render/nullopenglgraphics.h
@@ -112,6 +112,11 @@ class NullOpenGLGraphics final : public Graphics
int w, int h,
const ImageRect &imgRect);
+ void inline calcPatternInline(ImageVertexes* const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const;
+
GLfloat *mFloatTexArray;
GLint *mIntTexArray;
GLint *mIntVertArray;
diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp
index 90dfe2e5b..b5a82b1fd 100644
--- a/src/render/safeopenglgraphics.cpp
+++ b/src/render/safeopenglgraphics.cpp
@@ -365,6 +365,15 @@ void SafeOpenGLGraphics::calcPattern(ImageVertexes *const vert A_UNUSED,
{
}
+void SafeOpenGLGraphics::calcPatternInline(ImageVertexes *const vert A_UNUSED,
+ const Image *const image A_UNUSED,
+ const int x A_UNUSED,
+ const int y A_UNUSED,
+ const int w A_UNUSED,
+ const int h A_UNUSED) const
+{
+}
+
void SafeOpenGLGraphics::calcPattern(ImageCollection *const vert A_UNUSED,
const Image *const image A_UNUSED,
const int x A_UNUSED,
@@ -664,7 +673,7 @@ void SafeOpenGLGraphics::drawImageRect(const int x, const int y,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_drawImageRect.hpp"
+ #include "render/graphics_drawImageRect.hpp"
}
void SafeOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
@@ -672,7 +681,7 @@ void SafeOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_calcImageRect.hpp"
+ #include "render/graphics_calcImageRect.hpp"
}
#endif // USE_OPENGL
diff --git a/src/render/safeopenglgraphics.h b/src/render/safeopenglgraphics.h
index 5a8d7daa4..6de43109c 100644
--- a/src/render/safeopenglgraphics.h
+++ b/src/render/safeopenglgraphics.h
@@ -72,6 +72,11 @@ class SafeOpenGLGraphics final : public Graphics
int w, int h,
const ImageRect &imgRect);
+ void calcPatternInline(ImageVertexes *const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const;
+
bool mTexture;
bool mIsByteColor;
gcn::Color mByteColor;
diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp
index e1b8fecbc..81ace06d9 100644
--- a/src/render/sdl2graphics.cpp
+++ b/src/render/sdl2graphics.cpp
@@ -345,6 +345,14 @@ void SDLGraphics::calcPattern(ImageVertexes* const vert,
const int x, const int y,
const int w, const int h) const
{
+ calcPatternInline(vert, image, x, y, w, h);
+}
+
+void SDLGraphics::calcPatternInline(ImageVertexes* const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const
+{
// Check that preconditions for blitting are met.
if (!vert || !mWindow || !image || !image->mTexture)
return;
@@ -409,7 +417,7 @@ void SDLGraphics::calcPattern(ImageCollection* const vertCol,
vert = vertCol->currentVert;
}
- calcPattern(vert, image, x, y, w, h);
+ calcPatternInline(vert, image, x, y, w, h);
}
void SDLGraphics::calcTileVertexes(ImageVertexes *const vert,
@@ -725,7 +733,7 @@ void SDLGraphics::drawImageRect(const int x, const int y,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_drawImageRect.hpp"
+ #include "render/graphics_drawImageRect.hpp"
}
void SDLGraphics::calcImageRect(ImageVertexes *const vert,
@@ -733,7 +741,7 @@ void SDLGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_calcImageRect.hpp"
+ #include "render/graphics_calcImageRect.hpp"
}
#endif // USE_SDL2
diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h
index b7e430f16..2e40e932f 100644
--- a/src/render/sdl2graphics.h
+++ b/src/render/sdl2graphics.h
@@ -168,6 +168,10 @@ class SDLGraphics final : public Graphics
int w, int h,
const ImageRect &imgRect);
+ void inline calcPatternInline(ImageVertexes *const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const;
};
#endif // USE_SDL2
diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp
index 04be6b4fd..cf69312c8 100644
--- a/src/render/sdl2softwaregraphics.cpp
+++ b/src/render/sdl2softwaregraphics.cpp
@@ -585,6 +585,14 @@ void SDL2SoftwareGraphics::calcPattern(ImageVertexes* const vert,
const int x, const int y,
const int w, const int h) const
{
+ calcPatternInline(vert, image, x, y, w, h);
+}
+
+void SDL2SoftwareGraphics::calcPatternInline(ImageVertexes* const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const
+{
// Check that preconditions for blitting are met.
if (!vert || !mSurface || !image || !image->mSDLSurface)
return;
@@ -1488,7 +1496,7 @@ void SDL2SoftwareGraphics::drawImageRect(const int x, const int y,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_drawImageRect.hpp"
+ #include "render/graphics_drawImageRect.hpp"
}
void SDL2SoftwareGraphics::calcImageRect(ImageVertexes *const vert,
@@ -1496,7 +1504,7 @@ void SDL2SoftwareGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_calcImageRect.hpp"
+ #include "render/graphics_calcImageRect.hpp"
}
#endif // USE_SDL2
diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h
index eda4e9e34..dee69bfeb 100644
--- a/src/render/sdl2softwaregraphics.h
+++ b/src/render/sdl2softwaregraphics.h
@@ -180,6 +180,10 @@ class SDL2SoftwareGraphics final : public Graphics
const int w, const int h,
const ImageRect &imgRect);
+ void inline calcPatternInline(ImageVertexes *const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const;
};
#endif // USE_SDL2
diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp
index ed2f08c4d..9acee8bdf 100644
--- a/src/render/sdlgraphics.cpp
+++ b/src/render/sdlgraphics.cpp
@@ -578,6 +578,14 @@ void SDLGraphics::calcPattern(ImageVertexes* const vert,
const int x, const int y,
const int w, const int h) const
{
+ calcPatternInline(vert, image, x, y, w, h);
+}
+
+void SDLGraphics::calcPatternInline(ImageVertexes* const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const
+{
// Check that preconditions for blitting are met.
if (!vert || !mWindow || !image || !image->mSDLSurface)
return;
@@ -646,7 +654,7 @@ void SDLGraphics::calcPattern(ImageCollection* const vertCol,
vert = vertCol->currentVert;
}
- calcPattern(vert, image, x, y, w, h);
+ calcPatternInline(vert, image, x, y, w, h);
}
void SDLGraphics::calcTileVertexes(ImageVertexes *const vert,
@@ -1467,7 +1475,7 @@ void SDLGraphics::drawImageRect(const int x, const int y,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_drawImageRect.hpp"
+ #include "render/graphics_drawImageRect.hpp"
}
void SDLGraphics::calcImageRect(ImageVertexes *const vert,
@@ -1475,7 +1483,7 @@ void SDLGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
- #include "render/openglgraphics_calcImageRect.hpp"
+ #include "render/graphics_calcImageRect.hpp"
}
#endif // USE_SDL2
diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h
index b66242f79..80c6d1c79 100644
--- a/src/render/sdlgraphics.h
+++ b/src/render/sdlgraphics.h
@@ -173,6 +173,10 @@ class SDLGraphics final : public Graphics
int w, int h,
const ImageRect &imgRect);
+ void inline calcPatternInline(ImageVertexes *const vert,
+ const Image *const image,
+ const int x, const int y,
+ const int w, const int h) const;
};
#endif // USE_SDL2