45 _console(&console), _running(false), _exit(false), _newArea(-1) {
87 e.
add(
"Failed running module");
145 if ((event.key.keysym.sym == SDLK_d) && (event.key.keysym.mod & KMOD_CTRL)) {
155 _area->addEvent(event);
161 _area->processEventQueue();
166 float multiplier = 1.0f;
167 if (event.key.keysym.mod & KMOD_SHIFT)
170 if (event.key.keysym.sym == SDLK_UP)
171 CameraMan.move(0.0f, 0.0f, multiplier * -5.0f);
172 else if (event.key.keysym.sym == SDLK_DOWN)
173 CameraMan.move(0.0f, 0.0f, multiplier * 5.0f);
174 else if (event.key.keysym.sym == SDLK_LEFT)
175 CameraMan.move(multiplier * -5.0f, 0.0f, 0.0f);
176 else if (event.key.keysym.sym == SDLK_RIGHT)
177 CameraMan.move(multiplier * 5.0f, 0.0f, 0.0f);
178 else if (event.key.keysym.scancode == SDL_SCANCODE_W)
179 CameraMan.move(0.0f, 0.0f, multiplier * -5.0f);
180 else if (event.key.keysym.scancode == SDL_SCANCODE_S)
181 CameraMan.move(0.0f, 0.0f, multiplier * 5.0f);
182 else if (event.key.keysym.scancode == SDL_SCANCODE_A)
183 CameraMan.move(multiplier * -5.0f, 0.0f, 0.0f);
184 else if (event.key.keysym.scancode == SDL_SCANCODE_D)
185 CameraMan.move(multiplier * 5.0f, 0.0f, 0.0f);
189 if (event.motion.state & SDL_BUTTON(2))
190 CameraMan.move(1.0f * event.motion.xrel, 0.0f, 1.0f * event.motion.yrel);
::Engines::Console * _console
The context holding a Sonic Chronicles: The Dark Brotherhood area.
Common::ScopedPtr< Area > _area
The current area.
void add(const char *s,...) GCC_PRINTF(2
Module(::Engines::Console &console)
Utility functions for generating unique IDs.
Exception that provides a stack of explanations.
void run()
Run the module.
int32 _newArea
The new area to enter.
An object within a Sonic area.
Keyboard key was pressed.
Basic exceptions to throw.
The global events manager.
void clear()
Clear the whole context.
Generic Aurora engines (debug) console.
#define EventMan
Shortcut for accessing the events manager.
bool _exit
Should we exit the module?
The context needed to run a Sonic Chronicles: The Dark Brotherhood module.
void movePC(int32 area)
Move the player character to this area.
bool processEvent(const Events::Event &event)
#define CameraMan
Shortcut for accessing the camera manager.
void exit()
Exit the module.
bool handleCameraEvents(const Events::Event &event)
bool isRunning() const
Is the module currently running?
uint32 generateIDNumber()
bool _running
Are we currently running a module?
Area * getCurrentArea()
Return the area the PC is currently in.