[Scummvm-cvs-logs] SF.net SVN: scummvm: [28965] scummvm/trunk/engines/agi
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Wed Sep 19 10:27:32 CEST 2007
Revision: 28965
http://scummvm.svn.sourceforge.net/scummvm/?rev=28965&view=rev
Author: thebluegr
Date: 2007-09-19 01:27:32 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
Moved some keyboard code from Winnie together with the other keyboard functions
Modified Paths:
--------------
scummvm/trunk/engines/agi/preagi.h
scummvm/trunk/engines/agi/preagi_common.cpp
scummvm/trunk/engines/agi/preagi_winnie.cpp
Modified: scummvm/trunk/engines/agi/preagi.h
===================================================================
--- scummvm/trunk/engines/agi/preagi.h 2007-09-19 08:21:42 UTC (rev 28964)
+++ scummvm/trunk/engines/agi/preagi.h 2007-09-19 08:27:32 UTC (rev 28965)
@@ -75,6 +75,8 @@
// Keyboard
int getSelection(SelectionTypes type);
bool waitAnyKeyChoice();
+ bool getSelOkBack();
+
int rnd(int hi) { return (_rnd->getRandomNumber(hi) + 1); }
// Text
Modified: scummvm/trunk/engines/agi/preagi_common.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_common.cpp 2007-09-19 08:21:42 UTC (rev 28964)
+++ scummvm/trunk/engines/agi/preagi_common.cpp 2007-09-19 08:27:32 UTC (rev 28965)
@@ -208,4 +208,31 @@
}
}
+bool PreAgiEngine::getSelOkBack() {
+ Common::Event event;
+
+ for (;;) {
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _system->quit();
+ break;
+ case Common::EVENT_LBUTTONUP:
+ return true;
+ case Common::EVENT_RBUTTONUP:
+ return false;
+ case Common::EVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_BACKSPACE:
+ return false;
+ default:
+ return true;
+ }
+ default:
+ break;
+ }
+ }
+ }
}
+
+}
Modified: scummvm/trunk/engines/agi/preagi_winnie.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_winnie.cpp 2007-09-19 08:21:42 UTC (rev 28964)
+++ scummvm/trunk/engines/agi/preagi_winnie.cpp 2007-09-19 08:27:32 UTC (rev 28965)
@@ -218,7 +218,7 @@
default:
// print description
_vm->printStrXOR((char *)(buffer + pc));
- if (getSelOkBack())
+ if (_vm->getSelOkBack())
return IDI_WTP_PAR_OK;
else
return IDI_WTP_PAR_BACK;
@@ -854,7 +854,7 @@
break;
case Common::KEYCODE_s:
if (event.kbd.flags & Common::KBD_CTRL) {
- //FlipSound();
+ _vm->flipflag(fSoundOn);
} else {
*iSel = IDI_WTP_SEL_SOUTH;
makeSel();
@@ -1018,32 +1018,6 @@
delete [] buffer;
}
-bool Winnie::getSelOkBack() {
- Common::Event event;
-
- for (;;) {
- while (_vm->_system->getEventManager()->pollEvent(event)) {
- switch (event.type) {
- case Common::EVENT_QUIT:
- _vm->_system->quit();
- break;
- case Common::EVENT_LBUTTONUP:
- return true;
- case Common::EVENT_RBUTTONUP:
- return false;
- case Common::EVENT_KEYDOWN:
- switch (event.kbd.keycode) {
- case Common::KEYCODE_BACKSPACE:
- return false;
- default:
- return true;
- }
- default:
- break;
- }
- }
- }
-}
void Winnie::clrMenuSel(int *iSel, int fCanSel[]) {
*iSel = IDI_WTP_SEL_OPT_1;
while (!fCanSel[*iSel]) {
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