summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-13 19:30:26 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-13 19:30:26 +0300
commit5f69585da6bd61cb1191ea33ae9d92ea7460c1bd (patch)
tree6e26a06b1ec2a68ef7d872188ca7b4a9e4d909c0
parentd607fc8b853adb02827c10cef32d15f5f152a09d (diff)
downloadmanaplus-5f69585da6bd61cb1191ea33ae9d92ea7460c1bd.tar.gz
manaplus-5f69585da6bd61cb1191ea33ae9d92ea7460c1bd.tar.bz2
manaplus-5f69585da6bd61cb1191ea33ae9d92ea7460c1bd.tar.xz
manaplus-5f69585da6bd61cb1191ea33ae9d92ea7460c1bd.zip
In modernopengl add calcimagerect.
This is last function for cached draw, now modernopengl can be used for all
-rw-r--r--src/render/modernopenglgraphics.cpp1
-rw-r--r--src/test/testlauncher.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp
index ea8447c33..12a07b191 100644
--- a/src/render/modernopenglgraphics.cpp
+++ b/src/render/modernopenglgraphics.cpp
@@ -1190,6 +1190,7 @@ void ModernOpenGLGraphics::calcImageRect(ImageVertexes *const vert,
const int w, const int h,
const ImageRect &imgRect)
{
+ #include "render/graphics_calcImageRect.hpp"
}
void ModernOpenGLGraphics::clearScreen() const
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index d3bb5d571..7072e292d 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -27,6 +27,7 @@
#include "settings.h"
#include "soundmanager.h"
+#include "gui/skin.h"
#include "gui/theme.h"
#include "gui/fonts/font.h"
@@ -375,8 +376,10 @@ int TestLauncher::testDraw()
img[1] = Theme::getImageFromTheme("graphics/sprites/arrow_right.png");
img[2] = Theme::getImageFromTheme("graphics/sprites/arrow_up.png");
ImageCollection *const col = new ImageCollection;
+ ImageCollection *const col2 = new ImageCollection;
ImageVertexes *const vert = new ImageVertexes;
vert->image = img[2];
+ Skin *skin = theme->load("button.xml", "button.xml");
mainGraphics->pushClipArea(Rect(10, 20, 790, 580));
mainGraphics->setColor(Color(0xFFU, 0xFFU, 0x00U, 0xFFU));
@@ -387,6 +390,12 @@ int TestLauncher::testDraw()
mainGraphics->drawImage(img[0], 190, 383);
img[0]->setAlpha(1.0f);
+ mainGraphics->calcWindow(col2,
+ 5, 40,
+ 500, 40,
+ skin->getBorder());
+ mainGraphics->finalize(col2);
+
mainGraphics->calcTileVertexes(vert, img[2], 10, 10);
mainGraphics->calcTileVertexes(vert, img[2], 40, 10);
mainGraphics->finalize(vert);
@@ -400,6 +409,8 @@ int TestLauncher::testDraw()
boldFont->drawString(mainGraphics,
"test test test test test test test test ", 300, 100);
+ mainGraphics->drawTileCollection(col2);
+
mainGraphics->drawPattern(img[0], 10, 400, 300, 180);
mainGraphics->calcPattern(col, img[1], 500, 400, 150, 100);