summaryrefslogtreecommitdiff
path: root/src/core/Frontend_PS2.h
blob: 4bab7df9b974a0b17926dd488669405670407f25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
#pragma once
#include "Sprite2d.h"

enum
{
	PAGE_STATS,
	PAGE_LOAD,
	PAGE_BRIEFS,
	PAGE_CONTROLS,
	PAGE_AUDIO,
	PAGE_DISPLAY,
	PAGE_LANGUAGE,

	NUM_PAGES,
	PAGE_FIRST = PAGE_STATS,
	PAGE_LAST = PAGE_LANGUAGE,
};

enum 
{
	PAGESTATE_NORMAL = 0,
	PAGESTATE_HIGHLIGHTED,
	PAGESTATE_SELECTED
};


enum eFrontendSprites
{
	FE2_MAINPANEL_UL,
	FE2_MAINPANEL_UR,
	FE2_MAINPANEL_DL,
	FE2_MAINPANEL_DR,
	FE2_MAINPANEL_DR2,
	FE2_TABACTIVE,
	FE_ICONBRIEF,
	FE_ICONSTATS,
	FE_ICONCONTROLS,
	FE_ICONSAVE,
	FE_ICONAUDIO,
	FE_ICONDISPLAY,
	FE_ICONLANGUAGE,
	FE_CONTROLLER,
	FE_CONTROLLERSH,
	FE_ARROWS1,
	FE_ARROWS2,
	FE_ARROWS3,
	FE_ARROWS4,
	FE_RADIO1,
	FE_RADIO2,
	FE_RADIO3,
	FE_RADIO4,
	FE_RADIO5,
	FE_RADIO6,
	FE_RADIO7,
	FE_RADIO8,
	FE_RADIO9,

	NUM_FE_SPRITES
};


class CSprite2d;
class CVector2D;

#ifdef GTA_PC
enum eControlMethod
{
	CONTROL_STANDARD = 0,
	CONTROL_CLASSIC,
};
#endif

class CMenuManager
{
public:
	enum LANGUAGE
	{
		LANGUAGE_AMERICAN,
		LANGUAGE_FRENCH,
		LANGUAGE_GERMAN,
		LANGUAGE_ITALIAN,
		LANGUAGE_SPANISH,
#ifdef MORE_LANGUAGES
		LANGUAGE_POLISH,
		LANGUAGE_RUSSIAN,
		LANGUAGE_JAPANESE,
#endif
	};
	
	enum CONTRCONFIG
	{
		CONFIG_1 = 0,
		CONFIG_2,
		CONFIG_3,
		CONFIG_4,
	};

	enum
	{
		NUM_SPRIRES = 28,
	};
	
	enum
	{
		PAGESTATE_NORMAL = 0,
		PAGESTATE_HIGHLIGHTED = 1,
		PAGESTATE_SELELECTED = 2,
	};
	
	enum
	{
		SLIDE_TO_BOTTOM = 0,
		SLIDE_TO_RIGHT,
		SLIDE_TO_TOP,
		SLIDE_TO_LEFT,
		SLIDE_MAX
	};
	
	int32 m_currentPage;
	int32 m_newPage;
	int32 m_pageState;
	uint32 m_nPageLeftTimer;
	uint32 m_nPageRightTimer;
	uint32 m_nChangePageTimer;
	int field_18;
	uint8 m_fade;
	uint8 m_someAlpha;
	//char field_1E; // unused ?
	//char field_1F; // unused ?
	uint32 m_nStartPauseTimer;
	uint32 m_nEndPauseTimer;
	CVector2D m_position;
	uint8 m_nSlidingDir;
	//char field_31; // unused ?
	//char field_32; // unused ?
	//char field_33; // unused ?
	bool m_bInitialised;
	bool m_bWantToUpdateContent;
	bool m_bMenuActive;
	bool m_bWantToRestart;
	//char field_38; //unused ?
	bool m_bRenderGameInMenu;
	bool m_bSaveMenuActive;
	bool m_bInSaveZone;
	char field_3C;
	bool m_bTexturesLoaded;
	//char field_3E; //unused ?
	//char field_3F; //unused ?
	CSprite2d m_sprites[NUM_SPRIRES];
	
	static int32 m_PrefsSfxVolume;
	static int32 m_PrefsMusicVolume;
	static int32 m_PrefsBrightness;
	static bool m_PrefsShowTrails;
	static bool m_PrefsShowSubtitles;
	static bool m_PrefsAllowNastyGame;
	static int32 m_PrefsRadioStation;
	static int32 m_PrefsStereoMono;
	static int8 m_PrefsUseWideScreen;
	static int32 m_PrefsLanguage;
	static CONTRCONFIG m_PrefsControllerConfig;
	static bool m_PrefsUseVibration;

#define ISLAND_LOADING_IS(p)
#define ISLAND_LOADING_ISNT(p)
#ifdef GTA_PC
	bool m_bQuitGameNoCD;
	
	int32 m_nMouseTempPosX;
	int32 m_nMouseTempPosY;
	int32 m_nPrefsVideoMode;
	int32 m_nDisplayVideoMode;
	int8 m_nPrefsAudio3DProviderIndex;
	
	static int32 OS_Language;
	static int8 m_PrefsVsync;
	static int8 m_PrefsVsyncDisp;
	static int8 m_PrefsFrameLimiter;
	static int8 m_PrefsSpeakers;
	static int32 m_ControlMethod;
	static int8 m_PrefsDMA;
	static float m_PrefsLOD;
	static char m_PrefsSkinFile[256];

#ifndef MASTER
	static bool m_PrefsMarketing;
	static bool m_PrefsDisableTutorials;
#endif // !MASTER

#ifdef MENU_MAP
	static bool bMenuMapActive;
	static float fMapSize;
	static float fMapCenterY;
	static float fMapCenterX;
#endif

#ifdef IMPROVED_VIDEOMODE	
	int32 m_nPrefsWidth = 640;
	int32 m_nPrefsHeight = 480;
	int32 m_nPrefsDepth = 32;
	int32 m_nPrefsWindowed = 1;
	int32 m_nPrefsSubsystem;
	int32 m_nSelectedScreenMode;
#endif

	void WaitForUserCD() { }
#endif

	bool GetIsMenuActive() {return !!m_bMenuActive;}

	CMenuManager(void);
#ifdef FIX_BUGS
	~CMenuManager(void)
	{
		UnloadTextures();
	}
#endif
	
	void LoadAllTextures(void);
	void UnloadTextures(void);
	
	void InitialiseMenusOnce(void);
	void InitialiseChangedLanguageSettings(void);
	void InitialiseMenuContents(void);
	void AnaliseMenuContents(void);
	void InitialiseMenuContentsAfterLoadingGame(void);
	void DrawFrontEnd(void);
	void DrawFrontEndNormal(void);
	void DrawFrontEndSaveZone(void);
	void DrawMemoryCardStartUpMenus(void);
	void Process(void);
	void WorkOutMenuState(uint8 bExit);
	void ProcessControllerInput(void);
	void ProcessDPadLeftJustDown(void);
	void ProcessDPadRightJustDown(void);
	void ProcessDPadUpJustDown(void);
	void ProcessDPadDownJustDown(void);
	void ProcessDPadTriangleJustDown(void);
	void ProcessDPadCrossJustDown(void);
	void DoHackingMenusAtPageBrowse(void);
	void SetSoundLevelsForMusicMenu(void);
	void FilterOutColorMarkersFromString(wchar *string, CRGBA &color);
};

extern CMenuManager FrontEndMenuManager;