[Scummvm-cvs-logs] SF.net SVN: scummvm:[33250] scummvm/trunk/engines/tinsel
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Jul 23 19:01:43 CEST 2008
Revision: 33250
http://scummvm.svn.sourceforge.net/scummvm/?rev=33250&view=rev
Author: fingolfin
Date: 2008-07-23 17:01:42 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
cleanup
Modified Paths:
--------------
scummvm/trunk/engines/tinsel/tinsel.cpp
scummvm/trunk/engines/tinsel/tinsel.h
Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp 2008-07-23 16:55:52 UTC (rev 33249)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp 2008-07-23 17:01:42 UTC (rev 33250)
@@ -288,7 +288,7 @@
_ctx->lastRWasDouble = false;
while (true) {
- // FIXME: I'm still keeping the ctrl/Alt handling in the KeyProcess method.
+ // FIXME: I'm still keeping the ctrl/Alt handling in the ProcessKeyEvent method.
// Need to make sure that this works correctly
//DragKeys();
@@ -829,11 +829,13 @@
bool TinselEngine::pollEvent() {
- if (!g_system->getEventManager()->pollEvent(_event))
+ Common::Event event;
+
+ if (!g_system->getEventManager()->pollEvent(event))
return false;
// Handle the various kind of events
- switch (_event.type) {
+ switch (event.type) {
case Common::EVENT_QUIT:
quitFlag = true;
break;
@@ -843,16 +845,16 @@
case Common::EVENT_RBUTTONDOWN:
case Common::EVENT_RBUTTONUP:
// Add button to queue for the mouse process
- mouseButtons.push_back(_event.type);
+ mouseButtons.push_back(event.type);
break;
case Common::EVENT_MOUSEMOVE:
- _mousePos = _event.mouse;
+ _mousePos = event.mouse;
break;
case Common::EVENT_KEYDOWN:
case Common::EVENT_KEYUP:
- KeyProcess();
+ ProcessKeyEvent(event);
break;
default:
@@ -952,12 +954,12 @@
* Process a keyboard event
*/
-void TinselEngine::KeyProcess(void) {
+void TinselEngine::ProcessKeyEvent(const Common::Event &event) {
// Handle any special keys immediately
- switch (_event.kbd.keycode) {
+ switch (event.kbd.keycode) {
case Common::KEYCODE_d:
- if ((_event.kbd.flags == Common::KBD_CTRL) && (_event.type == Common::EVENT_KEYDOWN)) {
+ if ((event.kbd.flags == Common::KBD_CTRL) && (event.type == Common::EVENT_KEYDOWN)) {
// Activate the debugger
assert(_console);
_console->attach();
@@ -970,7 +972,7 @@
// Check for movement keys
int idx = 0;
- switch (_event.kbd.keycode) {
+ switch (event.kbd.keycode) {
case Common::KEYCODE_UP:
case Common::KEYCODE_KP8:
idx = MSK_UP;
@@ -991,7 +993,7 @@
break;
}
if (idx != 0) {
- if (_event.type == Common::EVENT_KEYDOWN)
+ if (event.type == Common::EVENT_KEYDOWN)
_dosPlayerDir |= idx;
else
_dosPlayerDir &= ~idx;
@@ -999,7 +1001,7 @@
}
// All other keypresses add to the queue for processing in KeyboardProcess
- keypresses.push_back(_event);
+ keypresses.push_back(event);
}
} // End of namespace Tinsel
Modified: scummvm/trunk/engines/tinsel/tinsel.h
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.h 2008-07-23 16:55:52 UTC (rev 33249)
+++ scummvm/trunk/engines/tinsel/tinsel.h 2008-07-23 17:01:42 UTC (rev 33250)
@@ -76,7 +76,6 @@
Common::KeyState _keyPressed;
Common::RandomSource _random;
Surface _screenSurface;
- Common::Event _event;
Common::Point _mousePos;
uint8 _dosPlayerDir;
Console *_console;
@@ -113,7 +112,9 @@
void RestartGame(void);
void RestartDrivers(void);
void ChopDrivers(void);
- void KeyProcess(void);
+ void ProcessKeyEvent(const Common::Event &event);
+ bool pollEvent();
+
public:
const Common::String getTargetName() const { return _targetName; }
Common::String getSavegamePattern() const;
@@ -121,8 +122,6 @@
Common::SaveFileManager *getSaveFileMan() { return _saveFileMan; }
Surface &screen() { return _screenSurface; }
- bool pollEvent();
- Common::Event event() { return _event; }
Common::Point getMousePosition() const { return _mousePos; }
void setMousePosition(const Common::Point &pt) {
g_system->warpMouse(pt.x, pt.y);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list