summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg-title.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2010-11-05 22:14:44 +0100
committerRaphael Langella <raphael.langella@gmail.com>2010-11-05 22:14:44 +0100
commit9d8bd352a1d3761df0dcd29e6fb6e46fb44e3fb5 (patch)
tree1591710876b90dd37ad7de397843b37604efff63 /crawl-ref/source/tilereg-title.cc
parent27f95f2227451d6306a7c01098fd1453d0f990b5 (diff)
downloadcrawl-ref-9d8bd352a1d3761df0dcd29e6fb6e46fb44e3fb5.tar.gz
crawl-ref-9d8bd352a1d3761df0dcd29e6fb6e46fb44e3fb5.zip
Fix crash with gdb and the new random title screen code
Somehow, it worked perfectly when run normally, but it crashed when started from gdb. Not sure why. Anyway, this fix the problem.
Diffstat (limited to 'crawl-ref/source/tilereg-title.cc')
-rw-r--r--crawl-ref/source/tilereg-title.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/tilereg-title.cc b/crawl-ref/source/tilereg-title.cc
index d00dbefce1..f1af451251 100644
--- a/crawl-ref/source/tilereg-title.cc
+++ b/crawl-ref/source/tilereg-title.cc
@@ -14,7 +14,7 @@
#include "libutil.h"
#include "macro.h"
-static const char* _get_title_image()
+static const std::string _get_title_image()
{
std::vector<std::string> files;
for (int i = 0; i < 100; ++i)
@@ -23,7 +23,7 @@ static const char* _get_title_image()
if (datafile_path(f, false) != "")
files.push_back(f);
}
- return (files[random2(files.size())]).c_str();
+ return files[random2(files.size())];
}
TitleRegion::TitleRegion(int width, int height, FontWrapper* font) :
@@ -35,7 +35,7 @@ TitleRegion::TitleRegion(int width, int height, FontWrapper* font) :
sx = sy = 0;
dx = dy = 1;
- if (!m_img.load_texture(_get_title_image(), MIPMAP_NONE))
+ if (!m_img.load_texture(_get_title_image().c_str(), MIPMAP_NONE))
return;
// Center