summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tiletex.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-19 19:17:31 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-19 19:17:31 +0000
commit69dba83ab0a392a350bf35d782770bdb217c92ae (patch)
tree37442c65c32062e2ef24cc6fed156ed7f5ccaa81 /crawl-ref/source/tiletex.cc
parent6c343fd8e3a09865c8ee23ffeb5da6dc07379cfe (diff)
downloadcrawl-ref-69dba83ab0a392a350bf35d782770bdb217c92ae.tar.gz
crawl-ref-69dba83ab0a392a350bf35d782770bdb217c92ae.zip
[2774528] Tiles splash screen.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9658 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tiletex.cc')
-rw-r--r--crawl-ref/source/tiletex.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc
index 8a0c89dee7..29d3c4caa2 100644
--- a/crawl-ref/source/tiletex.cc
+++ b/crawl-ref/source/tiletex.cc
@@ -31,7 +31,8 @@ void GenericTexture::unload_texture()
bool GenericTexture::load_texture(const char *filename,
GenericTexture::MipMapOptions mip_opt,
- tex_proc_func proc)
+ tex_proc_func proc,
+ bool force_power_of_two)
{
char acBuffer[512];
@@ -56,13 +57,24 @@ bool GenericTexture::load_texture(const char *filename,
// Determine texture format
unsigned char *pixels = (unsigned char*)img->pixels;
- int new_width = 1;
- while (new_width < img->w)
- new_width *= 2;
- int new_height = 1;
- while (new_height < img->h)
- new_height *= 2;
+ int new_width;
+ int new_height;
+ if (force_power_of_two)
+ {
+ new_width = 1;
+ while (new_width < img->w)
+ new_width *= 2;
+
+ new_height = 1;
+ while (new_height < img->h)
+ new_height *= 2;
+ }
+ else
+ {
+ new_width = img->w;
+ new_height = img->h;
+ }
GLenum texture_format;
if (bpp == 4)