diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2010-11-05 22:14:44 +0100 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2010-11-05 22:14:44 +0100 |
commit | 9d8bd352a1d3761df0dcd29e6fb6e46fb44e3fb5 (patch) | |
tree | 1591710876b90dd37ad7de397843b37604efff63 /crawl-ref/source/tilereg-title.cc | |
parent | 27f95f2227451d6306a7c01098fd1453d0f990b5 (diff) | |
download | crawl-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.cc | 6 |
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 |