summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/text.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-19 22:53:06 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-19 22:53:06 +0200
commit7479f486b671acb2a6aea2c84a56b383aaba00ca (patch)
tree4043545a14234dfaa2d7d08d59c7ee9ee97f0de9 /src/graphics/engine/text.cpp
parent901f10b2bac18a2063cd21798f22b3917e8519b5 (diff)
parent57d33d79ea570773d84ad81d4a61f50e079979ef (diff)
downloadcolobot-7479f486b671acb2a6aea2c84a56b383aaba00ca.tar.gz
colobot-7479f486b671acb2a6aea2c84a56b383aaba00ca.tar.bz2
colobot-7479f486b671acb2a6aea2c84a56b383aaba00ca.zip
Forgotten fix in dev-graphics
Diffstat (limited to 'src/graphics/engine/text.cpp')
-rw-r--r--src/graphics/engine/text.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp
index 19ef57b..8fc8709 100644
--- a/src/graphics/engine/text.cpp
+++ b/src/graphics/engine/text.cpp
@@ -785,18 +785,20 @@ Gfx::CharTexture Gfx::CText::CreateCharTexture(Gfx::UTF8Char ch, Gfx::CachedFont
data.surface = nullptr;
- SDL_FreeSurface(textSurface);
- SDL_FreeSurface(textureSurface);
-
if (! tex.Valid())
{
m_error = "Texture create error";
return texture;
}
+ else
+ {
+ texture.id = tex.id;
+ texture.texSize = m_engine->WindowToInterfaceSize(Math::IntPoint(textureSurface->w, textureSurface->h));
+ texture.charSize = m_engine->WindowToInterfaceSize(Math::IntPoint(textSurface->w, textSurface->h));
+ }
- texture.id = tex.id;
- texture.texSize = m_engine->WindowToInterfaceSize(Math::IntPoint(textureSurface->w, textureSurface->h));
- texture.charSize = m_engine->WindowToInterfaceSize(Math::IntPoint(textSurface->w, textSurface->h));
+ SDL_FreeSurface(textSurface);
+ SDL_FreeSurface(textureSurface);
return texture;
}