ScummVM API documentation
DeathMenu.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of Penumbra Overture.
26  */
27 
28 #ifndef GAME_DEATH_MENU_H
29 #define GAME_DEATH_MENU_H
30 
31 #include "hpl1/engine/engine.h"
32 
33 #include "hpl1/penumbra-overture/GameTypes.h"
34 
35 using namespace hpl;
36 
37 class cInit;
38 
39 //---------------------------
41 public:
42  cDeathMenuButton(cInit *apInit, cVector2f avPos, const tWString &asText);
43  virtual ~cDeathMenuButton();
44 
45  void OnUpdate(float afTimeStep);
46 
47  void OnDraw();
48 
49  virtual void OnMouseDown() = 0;
50  virtual void OnMouseUp() = 0;
51 
52  void OnMouseOver(bool abOver);
53 
54  const cRect2f &GetRect() { return mRect; }
55 
56 protected:
57  float mfAlpha;
58 
59  cInit *mpInit;
60  cGraphicsDrawer *mpDrawer;
61 
62  cVector3f mvPositon;
63  cRect2f mRect;
64 
65  FontData *mpFont;
66 
67  cVector2f mvFontSize;
68  tWString msText;
69 
70  bool mbOver;
71 };
72 
73 //---------------------------------------------
74 
76 public:
77  cDeathMenuButton_Continue(cInit *apInit, cVector2f avPos, const tWString &asText) : cDeathMenuButton(apInit, avPos, asText) {}
78 
79  void OnMouseDown();
80  void OnMouseUp();
81 };
82 
83 //---------------------------------------------
84 
86 public:
87  cDeathMenuButton_BackToMain(cInit *apInit, cVector2f avPos, const tWString &asText) : cDeathMenuButton(apInit, avPos, asText) {}
88 
89  void OnMouseDown();
90  void OnMouseUp();
91 };
92 
93 //---------------------------------------------
94 
97 
98 //---------------------------------------------
99 
100 class cDeathMenu : public iUpdateable {
101  friend class cDeathMenuButton;
102 
103 public:
104  cDeathMenu(cInit *apInit);
105  ~cDeathMenu();
106 
107  void Reset();
108 
109  void OnDraw();
110 
111  void Update(float afTimeStep);
112 
113  void SetMousePos(const cVector2f &avPos);
114  void AddMousePos(const cVector2f &avRel);
115  cVector2f GetMousePos() { return mvMousePos; }
116 
117  void OnMouseDown(eMButton aButton);
118  void OnMouseUp(eMButton aButton);
119 
120  void SetActive(bool abX);
121  bool IsActive() { return mbActive; }
122 
123  void OnExit();
124 
125 private:
126  cInit *mpInit;
127  cGraphicsDrawer *mpDrawer;
128 
129  cGfxObject *mpGfxBackground;
130 
131  bool mbMouseIsDown;
132 
133  bool mbActive;
134  float mfAlpha;
135 
136  FontData *mpFont;
137 
138  cVector2f mvMousePos;
139 
140  eCrossHairState mLastCrossHairState;
141 
142  tDeathMenuButtonList mlstButtons;
143 };
144 
145 //---------------------------------------------
146 
147 #endif // GAME_DEATH_MENU_H
Definition: AI.h:36
Definition: DeathMenu.h:75
Definition: DeathMenu.h:40
Definition: font_data.h:67
Definition: GraphicsDrawer.h:77
Definition: ustr.h:57
Definition: GfxObject.h:38
Definition: Updateable.h:35
Definition: DeathMenu.h:100
Definition: list_intern.h:51
Definition: DeathMenu.h:85
Definition: Init.h:70