From: sapier Date: Tue, 22 Oct 2013 17:31:49 +0000 (+0200) Subject: Fix invalid usage of texture->getSize() where actually texture->getOriginalSize(... X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=68bbdf1b2c1bc70f48d52694411cd7859d09c728;p=zefram%2Fminetest%2Fminetest_engine.git Fix invalid usage of texture->getSize() where actually texture->getOriginalSize() was meant --- diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index ac19274c..a96a832c 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -390,7 +390,7 @@ void GUIEngine::drawBackground(video::IVideoDriver* driver) } /* Draw background texture */ - v2u32 sourcesize = texture->getSize(); + v2u32 sourcesize = texture->getOriginalSize(); driver->draw2DImage(texture, core::rect(0, 0, screensize.X, screensize.Y), core::rect(0, 0, sourcesize.X, sourcesize.Y), @@ -409,7 +409,7 @@ void GUIEngine::drawOverlay(video::IVideoDriver* driver) return; /* Draw background texture */ - v2u32 sourcesize = texture->getSize(); + v2u32 sourcesize = texture->getOriginalSize(); driver->draw2DImage(texture, core::rect(0, 0, screensize.X, screensize.Y), core::rect(0, 0, sourcesize.X, sourcesize.Y), @@ -427,7 +427,7 @@ void GUIEngine::drawHeader(video::IVideoDriver* driver) if(!texture) return; - f32 mult = (((f32)screensize.Width / 2)) / + f32 mult = (((f32)screensize.Width / 2.0)) / ((f32)texture->getOriginalSize().Width); v2s32 splashsize(((f32)texture->getOriginalSize().Width) * mult, @@ -445,7 +445,7 @@ void GUIEngine::drawHeader(video::IVideoDriver* driver) driver->draw2DImage(texture, splashrect, core::rect(core::position2d(0,0), - core::dimension2di(texture->getSize())), + core::dimension2di(texture->getOriginalSize())), NULL, NULL, true); } } @@ -477,7 +477,7 @@ void GUIEngine::drawFooter(video::IVideoDriver* driver) driver->draw2DImage(texture, rect, core::rect(core::position2d(0,0), - core::dimension2di(texture->getSize())), + core::dimension2di(texture->getOriginalSize())), NULL, NULL, true); } } diff --git a/src/mesh.cpp b/src/mesh.cpp index 5e5f9f86..3200d5fa 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -260,7 +260,7 @@ scene::IAnimatedMesh* createExtrudedMesh(video::ITexture *texture, video::IVideoDriver *driver, v3f scale) { scene::IAnimatedMesh *mesh = NULL; - core::dimension2d size = texture->getSize(); + core::dimension2d size = texture->getOriginalSize(); video::ECOLOR_FORMAT format = texture->getColorFormat(); if (format == video::ECF_A8R8G8B8) {