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 
25 namespace irr
26 {
27  namespace video
28  {
29  class ITexture;
30  }
31 }
32 using namespace irr;
33 
34 class AbstractKart;
35 class MultitouchDevice;
36 class RaceGUIBase;
37 
39 {
40 private:
41  RaceGUIBase* m_race_gui;
42  MultitouchDevice* m_device;
43 
44  bool m_gui_action;
45  bool m_is_spectator_mode;
46  unsigned int m_height;
47 
48  video::ITexture* m_steering_wheel_tex;
49  video::ITexture* m_steering_wheel_tex_mask_up;
50  video::ITexture* m_steering_wheel_tex_mask_down;
51  video::ITexture* m_accelerator_tex;
52  video::ITexture* m_accelerator_handle_tex;
53  video::ITexture* m_pause_tex;
54  video::ITexture* m_nitro_tex;
55  video::ITexture* m_nitro_empty_tex;
56  video::ITexture* m_wing_mirror_tex;
57  video::ITexture* m_thunderbird_reset_tex;
58  video::ITexture* m_drift_tex;
59  video::ITexture* m_bg_button_tex;
60  video::ITexture* m_bg_button_focus_tex;
61  video::ITexture* m_gui_action_tex;
62  video::ITexture* m_up_tex;
63  video::ITexture* m_down_tex;
64  video::ITexture* m_screen_tex;
65 
66  void init();
67  void createRaceGUI();
68  void createSpectatorGUI();
69  void close();
70  static void onCustomButtonPress(unsigned int button_id, bool pressed);
71 
72 public:
73  RaceGUIMultitouch(RaceGUIBase* race_gui);
75 
76  void draw(const AbstractKart* kart, const core::recti &viewport,
77  const core::vector2df &scaling);
78 
79  unsigned int getHeight() {return m_height;}
80  bool isSpectatorMode() {return m_is_spectator_mode;}
81  void setGuiAction(bool enabled = true) {m_gui_action = enabled;}
82  void reset();
83  void recreate();
84 
85 }; // RaceGUIMultitouch
86 
87 #endif
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Definition: multitouch_device.hpp:76
An abstract base class for the two race guis (race_gui and race_result gui)
Definition: race_gui_base.hpp:50
Definition: race_gui_multitouch.hpp:39