From 4bc8fa481841a89bd2b6880f7570824478048ca1 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Thu, 24 Jul 2008 01:41:54 +0000 Subject: Moving more settings to the Tiles options file. Fixing a mouse-related crash that Johanna mentioned. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6657 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tiletex.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/tiletex.cc') diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc index 38c2aa729a..f289352656 100644 --- a/crawl-ref/source/tiletex.cc +++ b/crawl-ref/source/tiletex.cc @@ -1,5 +1,6 @@ #include "AppHdr.h" +#include "files.h" #include "tiles.h" #include "tiletex.h" @@ -29,14 +30,20 @@ bool GenericTexture::load_texture(const char *filename, tex_proc_func proc) { char acBuffer[512]; - // TODO enne - use Crawl's helper functions to find images... - strcpy(acBuffer, "dat/tiles/"); - strcat(acBuffer, filename); - SDL_Surface *img = IMG_Load(acBuffer); + + std::string tex_path = datafile_path(filename); + + if (tex_path.c_str()[0] == 0) + { + fprintf(stderr, "Couldn't find texture '%s'.\n", filename); + return false; + } + + SDL_Surface *img = IMG_Load(tex_path.c_str()); if (!img) { - printf("Warning: couldn't load file '%s'.\n", acBuffer); + fprintf(stderr, "Couldn't load texture '%s'.\n", tex_path.c_str()); return false; } -- cgit v1.2.3-54-g00ecf