Pac-Man Evolution
Loading...
Searching...
No Matches
ResourceManager.h
1/*----------------------------------------------------------------------
2Pac-Man Evolution - Roberto Prieto
3Copyright (C) 2018-2024 MegaStorm Systems
4contact@megastormsystems.com - http://www.megastormsystems.com
5
6This software is provided 'as-is', without any express or implied
7warranty. In no event will the authors be held liable for any damages
8arising from the use of this software.
9
10Permission is granted to anyone to use this software for any purpose,
11including commercial applications, and to alter it and redistribute it
12freely, subject to the following restrictions:
13
141. The origin of this software must not be misrepresented; you must not
15claim that you wrote the original software. If you use this software
16in a product, an acknowledgment in the product documentation would be
17appreciated but is not required.
182. Altered source versions must be plainly marked as such, and must not be
19misrepresented as being the original software.
203. This notice may not be removed or altered from any source distribution.
21
22------------------------------------------------------------------------
23
24Resource Manager
25
26------------------------------------------------------------------------ */
27
28#ifndef RMPME_H
29#define RMPME_H
30
31// Includes and defines and forward definitions
32#include "MemoryManager.h"
33#define PME_RESOURCES "game.cdc"
34
35// Resources offered by the RM
36#define RM_PANEL_MENU 0xAA000
37#define RM_PANEL_GAME 0xAA001
38
39#define RM_FONT_CONSOLE 0xAB000
40#define RM_FONT_INFO 0xAB001
41#define RM_FONT_SCORE 0xAB002
42
43#define RM_MUS_MENU 0xAC000
44#define RM_MUS_GAME 0xAC001
45
46#define RM_SND_THUNDER 0xAD001
47#define RM_SND_CLICKOK 0xAD002
48#define RM_SND_CLICKCANCEL 0xAD003
49#define RM_SND_CLICKCANCEL2 0xAD004
50#define RM_SND_EXIT 0xAD005
51#define RM_SND_GAMEABORT 0xAD006
52#define RM_SND_GAMEOVER 0xAD007
53#define RM_SND_GAMESTARTING 0xAD008
54#define RM_SND_GAMEPLAYERDEATH 0xAD009
55#define RM_SND_GAMEEATPELLET 0xAD010
56#define RM_SND_GAMEEATPELLETPOWER 0xAD011
57#define RM_SND_GAMEEATGHOST 0xAD012
58
59#define RM_IMG_ICON 0xAE000
60#define RM_IMG_MENU 0xAE001
61#define RM_IMG_HOF 0xAE002
62
63#define RM_SPR_PACMAN 0xBA000
64#define RM_SPR_GHOSTRED 0xBA002
65#define RM_SPR_GHOSTPINK 0xBA003
66#define RM_SPR_GHOSTBLUE 0xBA004
67#define RM_SPR_GHOSTORANGE 0xBA005
68#define RM_SPR_PELLET 0xBA006
69#define RM_SPR_PELLETPOWER 0xBA007
70#define RM_SPR_TARGETS 0xBA008
71
72// Widget IDs
73#define ID_EXIT 0xDF00
74#define ID_STANDARDGAME 0xDF01
75#define ID_EVOLUTIONGAME 0xDF02
76#define ID_WORKBENCHGAME 0xDF03
77#define ID_HALLOFFAME 0xDF05
78#define ID_GAME_LABEL 0xDF06
79#define ID_GAME_ENTERNAME 0xDF07
80#define ID_GAME_CLOSE 0xDF08
81
82// ResourceManager class implemented as a singleton
83class ResourceManager : public CMemPME
84{
85public:
86 static ResourceManager& Instance(); // Singleton accessor by object reference
87 static void Terminate(); // Explicit singleton destruction
88
89 Sint32 load();
90 Sint32 free();
91 Sint32 get(Sint32 iID) const;
92 Sint32 setPacManDeathAnim(Sint32);
93
94private:
95 ResourceManager(); // Heap-based and stack-based creation are forbidden.
96 ~ResourceManager(); // Inheritance is also forbidden.
97 static ResourceManager* mInstance;
98
99 // Flag for controlling the PacMan death animation
100 Sint32 bPacManDeathAnim;
101
102 // Panels
103 Sint32 guiMenu, guiGame;
104
105 // Fonts
106 Sint32 fntConsole, fntInfo, fntScore;
107
108 // Music
109 Sint32 musMenu[3];
110 Sint32 musGame[4];
111
112 // Sounds
113 Sint32 sndThunder, sndClickOK, sndClickCancel, sndClickCancel2, sndExit;
114 Sint32 sndGameAbort, sndGameOver, sndGameStarting, sndGamePlayerDeath, sndGameEatPellet, sndGameEatPelletPower, sndGameEatGhost;
115
116 // Images
117 Sint32 imgIcon, imgMenu, imgHallOfFame;
118
119 // Cursors
120 Sint32 curArrow;
121
122 // Sprites
123 Sint32 sprPacman, sprGhostRed, sprGhostPink, sprGhostBlue, sprGhostOrange, sprTargets;
124 Sint32 sprPellet, sprPelletPower;
125};
126
127#endif