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
35using namespace hpl;
36
37class cInit;
38
39//---------------------------
41public:
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
56protected:
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
76public:
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
86public:
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
100class cDeathMenu : public iUpdateable {
101 friend class cDeathMenuButton;
102
103public:
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
125private:
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: ustr.h:57
Definition: DeathMenu.h:85
Definition: DeathMenu.h:75
Definition: DeathMenu.h:40
Definition: DeathMenu.h:100
Definition: Init.h:70
Definition: font_data.h:67
Definition: GfxObject.h:38
Definition: GraphicsDrawer.h:77
Definition: Updateable.h:35
Definition: list_intern.h:54