summary refs log tree commit diff stats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/map_render.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/map_render.cpp b/src/components/map_render.cpp index 6fdfcc3..3b6b9c4 100644 --- a/src/components/map_render.cpp +++ b/src/components/map_render.cpp
@@ -23,9 +23,9 @@ MapRenderComponent::MapRenderComponent(const Map& map) : screen(GAME_WIDTH, GAME
23 } 23 }
24 24
25 Texture font("../res/font.bmp"); 25 Texture font("../res/font.bmp");
26 const char* map_name = map.getTitle(); 26 std::string map_name = map.getTitle();
27 int start_x = (40/2) - (strlen(map_name)/2); 27 int start_x = (40/2) - (map_name.length()/2);
28 for (size_t i=0; i<strlen(map_name); i++) 28 for (size_t i=0; i<map_name.length(); i++)
29 { 29 {
30 Rectangle srcRect {map_name[i] % 16 * 8, map_name[i] / 16 * 8, 8, 8}; 30 Rectangle srcRect {map_name[i] % 16 * 8, map_name[i] / 16 * 8, 8, 8};
31 Rectangle dstRect {(start_x + (int)i)*8, 24*8, 8, 8}; 31 Rectangle dstRect {(start_x + (int)i)*8, 24*8, 8, 8};