Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / supertux / resources.cpp
1 //  SuperTux
2 //  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
3 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
4 //
5 //  This program is free software: you can redistribute it and/or modify
6 //  it under the terms of the GNU General Public License as published by
7 //  the Free Software Foundation, either version 3 of the License, or
8 //  (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 //#include <config.h>
18
19 //#include "supertux/resources.hpp"
20
21 #include "gui/mousecursor.hpp"
22 #include "sprite/sprite_manager.hpp"
23 #include "supertux/player_status.hpp"
24 #include "supertux/tile_manager.hpp"
25 #include "video/font.hpp"
26
27 MouseCursor* mouse_cursor = NULL;
28
29 Font* fixed_font = NULL;
30 Font* normal_font = NULL;
31 Font* small_font = NULL;
32 Font* big_font = NULL;
33
34 /* Load graphics/sounds shared between all levels: */
35 void load_shared()
36 {
37   /* Load the mouse-cursor */
38   mouse_cursor = new MouseCursor("images/engine/menu/mousecursor.png");
39   MouseCursor::set_current(mouse_cursor);
40
41   /* Load global images: */
42   fixed_font = new Font(Font::FIXED, "fonts/white.stf");
43   normal_font = new Font(Font::VARIABLE, "fonts/white.stf");
44   small_font = new Font(Font::VARIABLE, "fonts/white-small.stf", 1);
45   big_font = new Font(Font::VARIABLE, "fonts/white-big.stf", 3);
46
47   tile_manager   = new TileManager();
48   sprite_manager = new SpriteManager();
49
50   player_status = new PlayerStatus();
51 }
52
53 /* Free shared data: */
54 void unload_shared()
55 {
56   /* Free global images: */
57   delete normal_font;
58   delete small_font;
59   delete big_font;
60
61   delete sprite_manager;
62   sprite_manager = NULL;
63
64   /* Free mouse-cursor */
65   delete mouse_cursor;
66
67   delete player_status;
68   player_status = NULL;
69 }
70
71 /* EOF */