SuperTuxKart
Loading...
Searching...
No Matches
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>
28using namespace irr;
29
30#include "states_screens/race_gui_base.hpp"
31
32class AbstractKart;
33class ChallengeData;
35class InputMap;
36class Material;
37class RaceSetup;
38
40const int CHALLENGE_DISTANCE_SQUARED = 20;
41
42const int CHALLENGE_HEIGHT = 4;
43
49{
50private:
51
52 bool m_close_to_a_challenge;
53
54 // Minimap related variables
55 // -------------------------
56 video::ITexture* m_trophy[4];
57 video::ITexture *m_lock;
58 video::ITexture *m_open_challenge;
59 video::ITexture *m_locked_bonus;
60
61
62 video::ITexture* m_icons[7];
63
65 irr::video::ITexture *m_speed_meter_icon;
66 irr::video::ITexture *m_speed_bar_icon;
67
71
75
78
81
84
87
90
93
96
97 int m_trophy_points_width;
98
101
102 core::stringw m_challenge_description;
103
106
108 void drawGlobalMiniMap ();
109
110public:
111
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 virtual void initSize();
131 void drawTrophyPoints();
132}; // RaceGUI
133
134#endif
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
This is the base class for all cameras.
Definition: camera.hpp:49
the description of one challenge
Definition: challenge_data.hpp:35
Definition: material.hpp:48
An abstract base class for the two race guis (race_gui and race_result gui)
Definition: race_gui_base.hpp:50
Handles the in-race GUI (messages, mini-map, rankings, timer, etc...)
Definition: race_gui_overworld.hpp:49
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:80
virtual void renderGlobal(float dt)
Render all global parts of the race gui, i.e.
Definition: race_gui_overworld.cpp:196
void drawGlobalMiniMap()
Display items that are shown once only (for all karts).
Definition: race_gui_overworld.cpp:357
int m_map_left
Distance of map from left side of screen.
Definition: race_gui_overworld.hpp:89
bool m_is_minimap_initialized
True if the minimap is initialized.
Definition: race_gui_overworld.hpp:92
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
virtual void renderPlayerView(const Camera *camera, float dt)
Render the details for a single player, i.e.
Definition: race_gui_overworld.cpp:224
int m_map_bottom
Distance of map from bottom of screen.
Definition: race_gui_overworld.hpp:95
void drawTrophyPoints()
Displays the number of challenge trophies.
Definition: race_gui_overworld.cpp:254
const OverworldChallenge * m_current_challenge
The current challenge over which the mouse is hovering.
Definition: race_gui_overworld.hpp:105
const ChallengeData * m_active_challenge
The latest challenge approached by the kart.
Definition: race_gui_overworld.hpp:100
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:83
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:77
RaceGUIOverworld()
The constructor is called before anything is attached to the scene node.
Definition: race_gui_overworld.cpp:76
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:70
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:86
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:74
irr::video::ITexture * m_speed_meter_icon
Texture for speedometer.
Definition: race_gui_overworld.hpp:65
virtual void initSize()
Called when loading the race gui or screen resized.
Definition: race_gui_overworld.cpp:126
Definition: track.hpp:81