summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/tilereg.cc6
-rw-r--r--crawl-ref/source/tiletex.cc7
-rw-r--r--crawl-ref/source/tiletex.h6
3 files changed, 15 insertions, 4 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 5239865c50..01518e0739 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -2836,14 +2836,14 @@ TitleRegion::TitleRegion(int width, int height) :
sx = sy = 0;
dx = dy = 1;
- if (!m_img.load_texture("title.png", GenericTexture::MIPMAP_NONE, NULL, true))
+ if (!m_img.load_texture("title.png", GenericTexture::MIPMAP_NONE))
return;
// Center
wx = width;
wy = height;
- ox = (wx - m_img.width()) / 2;
- oy = (wy - m_img.height()) / 2;
+ ox = (wx - m_img.orig_width()) / 2;
+ oy = (wy - m_img.orig_height()) / 2;
{
PTVert &v = m_buf.get_next();
diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc
index 29d3c4caa2..9f01a25456 100644
--- a/crawl-ref/source/tiletex.cc
+++ b/crawl-ref/source/tiletex.cc
@@ -12,7 +12,9 @@ REVISION("$Rev$");
GenericTexture::GenericTexture() :
m_handle(0),
m_width(0),
- m_height(0)
+ m_height(0),
+ m_orig_width(0),
+ m_orig_height(0)
{
}
@@ -204,6 +206,9 @@ bool GenericTexture::load_texture(const char *filename,
if (pixels != img->pixels)
delete pixels;
+ m_orig_width = img->w;
+ m_orig_height = img->h;
+
SDL_FreeSurface(img);
return (success);
diff --git a/crawl-ref/source/tiletex.h b/crawl-ref/source/tiletex.h
index 9c689dcbcd..f3e18ca07c 100644
--- a/crawl-ref/source/tiletex.h
+++ b/crawl-ref/source/tiletex.h
@@ -54,10 +54,16 @@ public:
unsigned int height() const { return m_height; }
void bind() const;
+ unsigned int orig_width() const { return m_orig_width; }
+ unsigned int orig_height() const { return m_orig_height; }
+
protected:
unsigned int m_handle;
unsigned int m_width;
unsigned int m_height;
+
+ unsigned int m_orig_width;
+ unsigned int m_orig_height;
};
class TilesTexture : public GenericTexture