[Scummvm-cvs-logs] SF.net SVN: scummvm:[33188] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Tue Jul 22 11:00:39 CEST 2008
Revision: 33188
http://scummvm.svn.sourceforge.net/scummvm/?rev=33188&view=rev
Author: peres001
Date: 2008-07-22 09:00:39 +0000 (Tue, 22 Jul 2008)
Log Message:
-----------
Changed comment display code so that input polling is integrated into the main loop, instead of being performed in a blocking way from a separate routine.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/exec_ns.cpp
scummvm/trunk/engines/parallaction/input.cpp
scummvm/trunk/engines/parallaction/parallaction.cpp
scummvm/trunk/engines/parallaction/parallaction.h
Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp 2008-07-22 05:51:10 UTC (rev 33187)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp 2008-07-22 09:00:39 UTC (rev 33188)
@@ -481,7 +481,15 @@
// ZONE TYPE: EXAMINE
//
-void Parallaction::displayComment(ExamineData *data) {
+void Parallaction::enterCommentMode(ZonePtr z) {
+ if (z == nullZonePtr) {
+ return;
+ }
+
+ _commentZone = z;
+
+ ExamineData *data = _commentZone->u.examine;
+
if (!data->_description) {
return;
}
@@ -510,8 +518,27 @@
_input->_inputMode = Input::kInputModeComment;
}
+void Parallaction::exitCommentMode() {
+ _input->_inputMode = Input::kInputModeGame;
+ hideDialogueStuff();
+ _gfx->setHalfbriteMode(false);
+ _cmdExec->run(_commentZone->_commands, _commentZone);
+ _commentZone = nullZonePtr;
+}
+
+void Parallaction::runCommentFrame() {
+ if (_input->_inputMode != Input::kInputModeComment) {
+ return;
+ }
+
+ if (_input->getLastButtonEvent() == kMouseLeftUp) {
+ exitCommentMode();
+ }
+}
+
+
uint16 Parallaction::runZone(ZonePtr z) {
debugC(3, kDebugExec, "runZone (%s)", z->_name);
@@ -521,8 +548,8 @@
switch(subtype) {
case kZoneExamine:
- displayComment(z->u.examine);
- break;
+ enterCommentMode(z);
+ return 0;
case kZoneGet:
if (z->_flags & kFlagsFixed) break;
Modified: scummvm/trunk/engines/parallaction/input.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/input.cpp 2008-07-22 05:51:10 UTC (rev 33187)
+++ scummvm/trunk/engines/parallaction/input.cpp 2008-07-22 09:00:39 UTC (rev 33188)
@@ -179,13 +179,13 @@
}
void Input::updateCommentInput() {
- waitUntilLeftClick();
+/* waitUntilLeftClick();
_vm->hideDialogueStuff();
_vm->_gfx->setHalfbriteMode(false);
_inputMode = kInputModeGame;
-}
+*/}
InputData* Input::updateInput() {
@@ -193,7 +193,7 @@
switch (_inputMode) {
case kInputModeComment:
- updateCommentInput();
+ readInput();
break;
case kInputModeGame:
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2008-07-22 05:51:10 UTC (rev 33187)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2008-07-22 09:00:39 UTC (rev 33188)
@@ -360,9 +360,10 @@
if (_engineFlags & kEngineQuit)
return;
- if (_input->_inputMode == Input::kInputModeDialogue) {
- runDialogueFrame();
- } else {
+ runDialogueFrame();
+ runCommentFrame();
+
+ if (_input->_inputMode == Input::kInputModeGame) {
if (data->_event != kEvNone) {
processInput(data);
}
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2008-07-22 05:51:10 UTC (rev 33187)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2008-07-22 09:00:39 UTC (rev 33188)
@@ -422,6 +422,11 @@
void exitDialogueMode();
void runDialogueFrame();
+ ZonePtr _commentZone;
+ void enterCommentMode(ZonePtr z);
+ void exitCommentMode();
+ void runCommentFrame();
+
};
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