SuperTuxKart
race_gui_overworld.hpp
1 //
2 // SuperTuxKart - a fun racing game with go-kart
3 // Copyright (C) 2004-2015 Steve Baker <sjbaker1@airmail.net>
4 // Copyright (C) 2006-2015 Joerg Henrichs, SuperTuxKart-Team, Steve Baker
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 3
9 // of the License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 
20 #ifndef HEADER_RACE_GUI_HPP
21 #define HEADER_RACE_GUI_HPP
22 
23 #include <string>
24 #include <vector>
25 #include <set>
26 
27 #include <irrString.h>
28 using namespace irr;
29 
30 #include "states_screens/race_gui_base.hpp"
31 
32 class AbstractKart;
33 class ChallengeData;
34 struct OverworldChallenge;
35 class InputMap;
36 class Material;
37 class RaceSetup;
38 
40 const int CHALLENGE_DISTANCE_SQUARED = 20;
41 
42 const int CHALLENGE_HEIGHT = 4;
43 
49 {
50 private:
51 
52  Material *m_speed_meter_icon;
53  Material *m_speed_bar_icon;
54 
55  bool m_close_to_a_challenge;
56 
57  // Minimap related variables
58  // -------------------------
59  video::ITexture* m_trophy[4];
60  video::ITexture *m_lock;
61  video::ITexture *m_open_challenge;
62  video::ITexture *m_locked_bonus;
63 
64 
65  video::ITexture* m_icons[7];
66 
70 
74 
77 
80 
83 
86 
89 
92 
95 
96  int m_trophy_points_width;
97 
100 
101  core::stringw m_challenge_description;
102 
105 
107  void drawGlobalMiniMap ();
108  void drawTrophyPoints ();
109 
110 public:
111 
113  ~RaceGUIOverworld();
114  virtual void renderGlobal(float dt);
115  virtual void renderPlayerView(const Camera *camera, float dt);
116 
117  // ------------------------------------------------------------------------
121  {
122  return m_current_challenge;
123  } // getCurrentChallenge
124 
125  // ------------------------------------------------------------------------
127  virtual const core::dimension2du getMiniMapSize() const
128  { return core::dimension2du(m_map_width, m_map_height); }
129  virtual void calculateMinimapSize();
130 
131 }; // RaceGUI
132 
133 #endif
Definition: track.hpp:63
An abstract base class for the two race guis (race_gui and race_result gui)
Definition: race_gui_base.hpp:49
int m_minimap_player_size
The size of a single marker on the screen or player karts, need not be a power of 2.
Definition: race_gui_overworld.hpp:73
int m_map_rendered_width
The width of the rendered mini map in pixels, must be a power of 2.
Definition: race_gui_overworld.hpp:76
Handles the in-race GUI (messages, mini-map, rankings, timer, etc...)
Definition: race_gui_overworld.hpp:48
int m_map_height
Height of the map in pixels on the screen, need not be a power of 2.
Definition: race_gui_overworld.hpp:85
const ChallengeData * m_active_challenge
The latest challenge approached by the kart.
Definition: race_gui_overworld.hpp:99
int m_map_bottom
Distance of map from bottom of screen.
Definition: race_gui_overworld.hpp:94
bool m_is_minimap_initialized
True if the minimap is initialized.
Definition: race_gui_overworld.hpp:91
int m_map_rendered_height
The height of the rendered mini map in pixels, must be a power of 2.
Definition: race_gui_overworld.hpp:79
int m_minimap_challenge_size
The size of a single marker on the screen for AI karts, need not be a power of 2.
Definition: race_gui_overworld.hpp:69
const OverworldChallenge * getCurrentChallenge() const
Returns the currently selected challenge data (or NULL if no is selected).
Definition: race_gui_overworld.hpp:120
virtual const core::dimension2du getMiniMapSize() const
Returns the size of the texture on which to render the minimap to.
Definition: race_gui_overworld.hpp:127
Definition: material.hpp:46
the description of one challenge
Definition: challenge_data.hpp:34
int m_map_width
Width of the map in pixels on the screen, need not be a power of 2.
Definition: race_gui_overworld.hpp:82
This is the base class for all cameras.
Definition: camera.hpp:48
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:61
int m_map_left
Distance of map from left side of screen.
Definition: race_gui_overworld.hpp:88
const OverworldChallenge * m_current_challenge
The current challenge over which the mouse is hovering.
Definition: race_gui_overworld.hpp:104