diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-24 01:41:54 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-24 01:41:54 +0000 |
commit | 4bc8fa481841a89bd2b6880f7570824478048ca1 (patch) | |
tree | d939a75f96f3ae730f7f79ff226d6028d3045007 /crawl-ref/source/tiletex.cc | |
parent | 04fbe88386b9ebe9d655b0270c9453a885b05d1c (diff) | |
download | crawl-ref-4bc8fa481841a89bd2b6880f7570824478048ca1.tar.gz crawl-ref-4bc8fa481841a89bd2b6880f7570824478048ca1.zip |
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
Diffstat (limited to 'crawl-ref/source/tiletex.cc')
-rw-r--r-- | crawl-ref/source/tiletex.cc | 17 |
1 files changed, 12 insertions, 5 deletions
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; } |