dungeon_crawler

diff prototype/src/cmdcon.cc @ 63:7f52d6310317

fixed design issue with datafile_path
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 02 Oct 2012 04:52:59 +0300
parents 2fc004802739
children
line diff
     1.1 --- a/prototype/src/cmdcon.cc	Tue Sep 25 06:59:11 2012 +0300
     1.2 +++ b/prototype/src/cmdcon.cc	Tue Oct 02 04:52:59 2012 +0300
     1.3 @@ -19,15 +19,15 @@
     1.4  
     1.5  bool init_cmdcon()
     1.6  {
     1.7 -	const char *path = datafile_path(FONT_FILENAME);
     1.8 -	if(!path) {
     1.9 +	std::string path = datafile_path(FONT_FILENAME);
    1.10 +	if(path.empty()) {
    1.11  		fprintf(stderr, "failed to locate font file: %s\n", FONT_FILENAME);
    1.12  		return false;
    1.13  	}
    1.14  
    1.15 -	printf("loading font: %s\n", path);
    1.16 -	if(!(font = dtx_open_font(path, 14))) {
    1.17 -		fprintf(stderr, "failed to open font file: %s\n", path);
    1.18 +	printf("loading font: %s\n", path.c_str());
    1.19 +	if(!(font = dtx_open_font(path.c_str(), 14))) {
    1.20 +		fprintf(stderr, "failed to open font file: %s\n", path.c_str());
    1.21  		return false;
    1.22  	}
    1.23  	dtx_use_font(font, 14);