[Scummvm-cvs-logs] SF.net SVN: scummvm:[48298] scummvm/trunk/engines/m4
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Fri Mar 19 10:19:24 CET 2010
Revision: 48298
http://scummvm.svn.sourceforge.net/scummvm/?rev=48298&view=rev
Author: dreammaster
Date: 2010-03-19 09:19:23 +0000 (Fri, 19 Mar 2010)
Log Message:
-----------
Beginnings of hooking up the new logic for current action display
Modified Paths:
--------------
scummvm/trunk/engines/m4/console.cpp
scummvm/trunk/engines/m4/globals.cpp
scummvm/trunk/engines/m4/globals.h
scummvm/trunk/engines/m4/m4_scene.h
scummvm/trunk/engines/m4/mads_scene.h
scummvm/trunk/engines/m4/mads_views.cpp
scummvm/trunk/engines/m4/scene.h
Modified: scummvm/trunk/engines/m4/console.cpp
===================================================================
--- scummvm/trunk/engines/m4/console.cpp 2010-03-19 02:49:13 UTC (rev 48297)
+++ scummvm/trunk/engines/m4/console.cpp 2010-03-19 09:19:23 UTC (rev 48298)
@@ -330,8 +330,8 @@
DebugPrintf(" - ");
for (int i = 0; i < obj->vocabCount; ++i) {
if (i != 0) DebugPrintf(", ");
- DebugPrintf("%s (%d)/%d", _vm->globals()->getVocab(obj->vocabList[i].vocabId),
- obj->vocabList[i].vocabId, obj->vocabList[i].unk);
+ DebugPrintf("%s (%d)/%d,%d", _vm->globals()->getVocab(obj->vocabList[i].vocabId),
+ obj->vocabList[i].vocabId, obj->vocabList[i].flags1, obj->vocabList[i].flags2);
}
}
DebugPrintf("\n");
Modified: scummvm/trunk/engines/m4/globals.cpp
===================================================================
--- scummvm/trunk/engines/m4/globals.cpp 2010-03-19 02:49:13 UTC (rev 48297)
+++ scummvm/trunk/engines/m4/globals.cpp 2010-03-19 09:19:23 UTC (rev 48298)
@@ -527,7 +527,8 @@
assert(vocabCount <= 3);
for (int i = 0; i < vocabCount; ++i) {
- vocabList[i].unk = READ_LE_UINT16(&obj[6 + i * 4]);
+ vocabList[i].flags1 = obj[6 + i * 4];
+ vocabList[i].flags2 = obj[7 + i * 4];
vocabList[i].vocabId = READ_LE_UINT16(&obj[8 + i * 4]);
}
}
Modified: scummvm/trunk/engines/m4/globals.h
===================================================================
--- scummvm/trunk/engines/m4/globals.h 2010-03-19 02:49:13 UTC (rev 48297)
+++ scummvm/trunk/engines/m4/globals.h 2010-03-19 09:19:23 UTC (rev 48298)
@@ -166,7 +166,8 @@
};
struct VocabEntry {
- uint16 unk;
+ uint8 flags1;
+ uint8 flags2;
uint16 vocabId;
};
Modified: scummvm/trunk/engines/m4/m4_scene.h
===================================================================
--- scummvm/trunk/engines/m4/m4_scene.h 2010-03-19 02:49:13 UTC (rev 48297)
+++ scummvm/trunk/engines/m4/m4_scene.h 2010-03-19 09:19:23 UTC (rev 48298)
@@ -72,7 +72,6 @@
virtual void checkHotspotAtMousePos(int x, int y);
virtual void leftClick(int x, int y);
virtual void rightClick(int x, int y);
- virtual void setAction(int action, int objectId = -1);
virtual void update();
virtual void showHotSpots();
@@ -80,6 +79,7 @@
M4InterfaceView *getInterface() { return (M4InterfaceView *)_interfaceSurface; };
M4SceneResources &getSceneResources() { return _sceneResources; };
void setStatusText(const char *text);
+ void setAction(int action, int objectId = -1);
};
} // End of namespace M4
Modified: scummvm/trunk/engines/m4/mads_scene.h
===================================================================
--- scummvm/trunk/engines/m4/mads_scene.h 2010-03-19 02:49:13 UTC (rev 48297)
+++ scummvm/trunk/engines/m4/mads_scene.h 2010-03-19 09:19:23 UTC (rev 48298)
@@ -207,6 +207,7 @@
MadsInterfaceView *getInterface() { return (MadsInterfaceView *)_interfaceSurface; };
MadsSceneResources &getSceneResources() { return _sceneResources; };
+ MadsAction &getAction() { return _action; }
void setStatusText(const char *text) {};//***DEPRECATED***
};
Modified: scummvm/trunk/engines/m4/mads_views.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_views.cpp 2010-03-19 02:49:13 UTC (rev 48297)
+++ scummvm/trunk/engines/m4/mads_views.cpp 2010-03-19 09:19:23 UTC (rev 48298)
@@ -249,6 +249,8 @@
}
bool MadsInterfaceView::onEvent(M4EventType eventType, int32 param1, int x, int y, bool &captureEvents) {
+ MadsAction &act = _madsVm->scene()->getAction();
+
// If the mouse isn't being held down, then reset the repeated scroll timer
if (eventType != MEVENT_LEFT_HOLD)
_nextScrollerTicks = 0;
@@ -270,25 +272,35 @@
case MEVENT_LEFT_CLICK:
// Left mouse click
- // Check if an inventory object was selected
- if ((_highlightedElement >= INVLIST_START) && (_highlightedElement < (INVLIST_START + 5))) {
- // Ensure there is an inventory item listed in that cell
- uint idx = _highlightedElement - INVLIST_START;
- if ((_topIndex + idx) < _inventoryList.size()) {
- // Set the selected object
- setSelectedObject(_inventoryList[_topIndex + idx]);
+ {
+ // Check if an inventory object was selected
+ if ((_highlightedElement >= INVLIST_START) && (_highlightedElement < (INVLIST_START + 5))) {
+ // Ensure there is an inventory item listed in that cell
+ uint idx = _highlightedElement - INVLIST_START;
+ if ((_topIndex + idx) < _inventoryList.size()) {
+ // Set the selected object
+ setSelectedObject(_inventoryList[_topIndex + idx]);
+ }
+ } else if ((_highlightedElement >= ACTIONS_START) && (_highlightedElement < (ACTIONS_START + 10))) {
+ // A standard action was selected
+ int verbId = kVerbLook + (_highlightedElement - ACTIONS_START);
+ warning("Selected action #%d", verbId);
+
+ } else if ((_highlightedElement >= VOCAB_START) && (_highlightedElement < (VOCAB_START + 5))) {
+ // A vocab action was selected
+ MadsObject *obj = _madsVm->globals()->getObject(_selectedObject);
+ int vocabIndex = MIN(_highlightedElement - VOCAB_START, obj->vocabCount - 1);
+ if (vocabIndex >= 0) {
+ act._actionMode = ACTMODE_OBJECT;
+ act._actionMode2 = ACTMODE2_2;
+ act._flags1 = obj->vocabList[1].flags1;
+ act._flags2 = obj->vocabList[1].flags2;
+
+ act._currentHotspot = _selectedObject;
+ act._articleNumber = act._flags2;
+ }
}
- } else if ((_highlightedElement >= ACTIONS_START) && (_highlightedElement < (ACTIONS_START + 10))) {
- // A standard action was selected
- _vm->_scene->setAction(kVerbLook + (_highlightedElement - ACTIONS_START));
- } else if ((_highlightedElement >= VOCAB_START) && (_highlightedElement < (VOCAB_START + 5))) {
- // A vocab action was selected
- MadsObject *obj = _madsVm->globals()->getObject(_selectedObject);
- int vocabIndex = MIN(_highlightedElement - VOCAB_START, obj->vocabCount - 1);
- if (vocabIndex >= 0)
- _vm->_scene->setAction(obj->vocabList[vocabIndex].vocabId, _selectedObject);
}
-
return true;
case MEVENT_LEFT_HOLD:
Modified: scummvm/trunk/engines/m4/scene.h
===================================================================
--- scummvm/trunk/engines/m4/scene.h 2010-03-19 02:49:13 UTC (rev 48297)
+++ scummvm/trunk/engines/m4/scene.h 2010-03-19 09:19:23 UTC (rev 48298)
@@ -100,7 +100,6 @@
virtual void checkHotspotAtMousePos(int x, int y) = 0;
virtual void leftClick(int x, int y) = 0;
virtual void rightClick(int x, int y) = 0;
- virtual void setAction(int action, int objectId = -1) = 0;
virtual void update() = 0;
virtual void showHotSpots();
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