#303: Typo fixes from mathnerd314
[supertux.git] / src / resources.cpp
1 //  $Id$
2 //
3 //  SuperTux
4 //  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
5 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; either version 2
10 //  of the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 //
17 //  You should have received a copy of the GNU General Public License
18 //  along with this program; if not, write to the Free Software
19 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 #include <config.h>
21
22 #include "sprite/sprite_manager.hpp"
23 #include "gui/menu.hpp"
24 #include "gui/button.hpp"
25 #include "resources.hpp"
26 #include "file_system.hpp"
27 #include "tile_manager.hpp"
28 #include "object/gameobjs.hpp"
29 #include "object/player.hpp"
30
31 MouseCursor* mouse_cursor = NULL;
32
33 Font* gold_text = NULL;
34 Font* gold_fixed_text = NULL;
35 Font* blue_text = NULL;
36 Font* gray_text = NULL;
37 Font* white_text = NULL;
38 Font* white_small_text = NULL;
39 Font* white_big_text = NULL;
40
41 /* Load graphics/sounds shared between all levels: */
42 void load_shared()
43 {
44   /* Load the mouse-cursor */
45   mouse_cursor = new MouseCursor("images/engine/menu/mousecursor.png");
46   MouseCursor::set_current(mouse_cursor);
47
48   /* Load global images: */
49   gold_text  = new Font(Font::VARIABLE,
50                         "images/engine/fonts/gold.png",
51                         "images/engine/fonts/shadow.png", 16, 18);
52   gold_fixed_text  = new Font(Font::FIXED,
53                         "images/engine/fonts/gold.png",
54                         "images/engine/fonts/shadow.png", 16, 18);
55   blue_text  = new Font(Font::VARIABLE,
56                         "images/engine/fonts/blue.png",
57                         "images/engine/fonts/shadow.png", 16, 18, 3);
58   white_text = new Font(Font::VARIABLE,
59                         "images/engine/fonts/white.png",
60                         "images/engine/fonts/shadow.png", 16, 18);
61   gray_text  = new Font(Font::VARIABLE,
62                         "images/engine/fonts/gray.png",
63                        "images/engine/fonts/shadow.png", 16, 18);
64   white_small_text = new Font(Font::VARIABLE,
65                               "images/engine/fonts/white-small.png",
66                               "images/engine/fonts/shadow-small.png", 8, 9, 1);
67   white_big_text = new Font(Font::VARIABLE,
68                             "images/engine/fonts/white-big.png",
69                             "images/engine/fonts/shadow-big.png", 20, 22, 3);
70
71   Menu::default_font  = white_text;
72   Menu::active_font   = blue_text;
73   Menu::inactive_font = gray_text;
74   Menu::label_font    = white_big_text;
75   Menu::field_font    = gold_text;
76
77   Button::info_font = white_small_text;
78
79   tile_manager   = new TileManager();
80   sprite_manager = new SpriteManager();
81
82   player_status = new PlayerStatus();
83 }
84
85 /* Free shared data: */
86 void unload_shared()
87 {
88   /* Free global images: */
89   delete gold_text;
90   delete gold_fixed_text;
91   delete white_text;
92   delete blue_text;
93   delete gray_text;
94   delete white_small_text;
95   delete white_big_text;
96
97   delete sprite_manager;
98   sprite_manager = NULL;
99
100   /* Free mouse-cursor */
101   delete mouse_cursor;
102
103   delete player_status;
104   player_status = NULL;
105 }