X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsupertux%2Fresources.cpp;h=7d2e1478487fc3821dc068193ec2efaa3086335c;hb=72e5edc7bbf5abc24e375c7465938cff48581f75;hp=9d573799c6b182383f92e87d5f47ec8efab53405;hpb=8d6b67e339af57fd54b2ed5891d4379b52332616;p=supertux.git diff --git a/src/supertux/resources.cpp b/src/supertux/resources.cpp index 9d573799c..7d2e14784 100644 --- a/src/supertux/resources.cpp +++ b/src/supertux/resources.cpp @@ -25,10 +25,10 @@ MouseCursor* Resources::mouse_cursor = NULL; -Font* Resources::fixed_font = NULL; -Font* Resources::normal_font = NULL; -Font* Resources::small_font = NULL; -Font* Resources::big_font = NULL; +FontPtr Resources::fixed_font; +FontPtr Resources::normal_font; +FontPtr Resources::small_font; +FontPtr Resources::big_font; /* Load graphics/sounds shared between all levels: */ void @@ -39,15 +39,13 @@ Resources::load_shared() MouseCursor::set_current(mouse_cursor); /* Load global images: */ - fixed_font = new Font(Font::FIXED, "fonts/white.stf"); - normal_font = new Font(Font::VARIABLE, "fonts/white.stf"); - small_font = new Font(Font::VARIABLE, "fonts/white-small.stf", 1); - big_font = new Font(Font::VARIABLE, "fonts/white-big.stf", 3); + fixed_font.reset(new Font(Font::FIXED, "fonts/white.stf")); + normal_font.reset(new Font(Font::VARIABLE, "fonts/white.stf")); + small_font.reset(new Font(Font::VARIABLE, "fonts/white-small.stf", 1)); + big_font.reset(new Font(Font::VARIABLE, "fonts/white-big.stf", 3)); tile_manager = new TileManager(); sprite_manager = new SpriteManager(); - - player_status = new PlayerStatus(); } /* Free shared data: */ @@ -55,18 +53,16 @@ void Resources::unload_shared() { /* Free global images: */ - delete normal_font; - delete small_font; - delete big_font; + fixed_font.reset(); + normal_font.reset(); + small_font.reset(); + big_font.reset(); delete sprite_manager; sprite_manager = NULL; /* Free mouse-cursor */ delete mouse_cursor; - - delete player_status; - player_status = NULL; } /* EOF */