SuperTuxKart
race_gui_multitouch.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2014-2015 SuperTuxKart-Team
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 #ifndef HEADER_RACE_GUI_MULTITOUCH_HPP
19 #define HEADER_RACE_GUI_MULTITOUCH_HPP
20 
21 #include <irrString.h>
22 #include <rect.h>
23 #include <vector2d.h>
24 #include <IVideoDriver.h>
25 
26 using namespace irr;
27 
28 class AbstractKart;
29 class MultitouchDevice;
30 class RaceGUIBase;
31 
33 {
34 private:
35  RaceGUIBase* m_race_gui;
36  MultitouchDevice* m_device;
37 
38  bool m_gui_action;
39  bool m_is_spectator_mode;
40  unsigned int m_height;
41 
42  video::ITexture* m_steering_wheel_tex;
43  video::ITexture* m_steering_wheel_tex_mask_up;
44  video::ITexture* m_steering_wheel_tex_mask_down;
45  video::ITexture* m_accelerator_tex;
46  video::ITexture* m_accelerator_handle_tex;
47  video::ITexture* m_pause_tex;
48  video::ITexture* m_nitro_tex;
49  video::ITexture* m_nitro_empty_tex;
50  video::ITexture* m_wing_mirror_tex;
51  video::ITexture* m_thunderbird_reset_tex;
52  video::ITexture* m_drift_tex;
53  video::ITexture* m_bg_button_tex;
54  video::ITexture* m_bg_button_focus_tex;
55  video::ITexture* m_gui_action_tex;
56  video::ITexture* m_up_tex;
57  video::ITexture* m_down_tex;
58  video::ITexture* m_screen_tex;
59 
60  void init();
61  void createRaceGUI();
62  void createSpectatorGUI();
63  void close();
64  static void onCustomButtonPress(unsigned int button_id, bool pressed);
65 
66 public:
67  RaceGUIMultitouch(RaceGUIBase* race_gui);
69 
70  void draw(const AbstractKart* kart, const core::recti &viewport,
71  const core::vector2df &scaling);
72 
73  unsigned int getHeight() {return m_height;}
74  bool isSpectatorMode() {return m_is_spectator_mode;}
75  void setGuiAction(bool enabled = true) {m_gui_action = enabled;}
76  void reset();
77  void recreate();
78 
79 }; // RaceGUIMultitouch
80 
81 #endif
Definition: multitouch_device.hpp:75
An abstract base class for the two race guis (race_gui and race_result gui)
Definition: race_gui_base.hpp:49
Definition: race_gui_multitouch.hpp:32
Definition: three_d_animation.hpp:32
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:61