[Scummvm-cvs-logs] SF.net SVN: scummvm: [21011] scummvm/trunk/engines/scumm
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Thu Mar 2 04:15:02 CET 2006
Revision: 21011
Author: kirben
Date: 2006-03-02 04:14:06 -0800 (Thu, 02 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm?rev=21011&view=rev
Log Message:
-----------
Fix using items in C64 maniac and cleanup
Modified Paths:
--------------
scummvm/trunk/engines/scumm/intern.h
scummvm/trunk/engines/scumm/room.cpp
scummvm/trunk/engines/scumm/script_c64.cpp
scummvm/trunk/engines/scumm/script_v2.cpp
scummvm/trunk/engines/scumm/scumm.cpp
scummvm/trunk/engines/scumm/scumm.h
scummvm/trunk/engines/scumm/verbs.cpp
Modified: scummvm/trunk/engines/scumm/intern.h
===================================================================
--- scummvm/trunk/engines/scumm/intern.h 2006-03-02 12:09:19 UTC (rev 21010)
+++ scummvm/trunk/engines/scumm/intern.h 2006-03-02 12:14:06 UTC (rev 21011)
@@ -293,7 +293,7 @@
virtual void setStateCommon(byte type);
virtual void clearStateCommon(byte type);
- void resetSentence();
+ virtual void resetSentence();
void setUserState(byte state);
virtual void handleMouseOver(bool updateInventory);
@@ -428,6 +428,8 @@
virtual void setStateCommon(byte type);
virtual void clearStateCommon(byte type);
+ virtual void resetSentence();
+
int getObjectFlag();
/* Version C64 script opcodes */
Modified: scummvm/trunk/engines/scumm/room.cpp
===================================================================
--- scummvm/trunk/engines/scumm/room.cpp 2006-03-02 12:09:19 UTC (rev 21010)
+++ scummvm/trunk/engines/scumm/room.cpp 2006-03-02 12:14:06 UTC (rev 21011)
@@ -120,7 +120,6 @@
res.increaseResourceCounter();
- _activeObject = 0;
_currentRoom = room;
VAR(VAR_ROOM) = room;
Modified: scummvm/trunk/engines/scumm/script_c64.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_c64.cpp 2006-03-02 12:09:19 UTC (rev 21010)
+++ scummvm/trunk/engines/scumm/script_c64.cpp 2006-03-02 12:14:06 UTC (rev 21011)
@@ -491,8 +491,6 @@
}
if (sentencePrep > 0 && sentencePrep <= 4) {
- printf("sentencePrep is %d\n", sentencePrep);
-
// The prepositions, like the fonts, were hard code in the engine. Thus
// we have to do that, too, and provde localized versions for all the
// languages MM/Zak are available in.
@@ -513,13 +511,13 @@
strcat(sentence, prepositions[lang][sentencePrep]);
}
- /* if (_activeObject2 > 0) {
- temp = getObjOrActorName(_activeObject2);
+ if (_activeInventory > 0) {
+ temp = getObjOrActorName(_activeInventory);
if (temp) {
strcat(sentence, " ");
strcat(sentence, (const char*)temp);
}
- } */
+ }
_string[2].charset = 1;
_string[2].ypos = virtscr[kVerbVirtScreen].topline;
@@ -586,13 +584,11 @@
void ScummEngine_c64::o_lockSound() {
int resid = fetchScriptByte();
res.lock(rtSound, resid);
- debug(0, "o_lockSound (%d)", resid);
}
void ScummEngine_c64::o_unlockSound() {
int resid = fetchScriptByte();
res.unlock(rtSound, resid);
- debug(0, "o_unlockSound (%d)", resid);
}
void ScummEngine_c64::o_loadActor() {
@@ -615,13 +611,11 @@
void ScummEngine_c64::o_lockScript() {
int resid = fetchScriptByte();
res.lock(rtScript, resid);
- debug(0, "o_lockScript (%d)", resid);
}
void ScummEngine_c64::o_unlockScript() {
int resid = fetchScriptByte();
res.unlock(rtScript, resid);
- debug(0, "o_unlockScript (%d)", resid);
}
void ScummEngine_c64::o_loadRoom() {
@@ -663,13 +657,11 @@
void ScummEngine_c64::o_lockRoom() {
int resid = fetchScriptByte();
res.lock(rtRoom, resid);
- debug(0, "o_lockRoom (%d)", resid);
}
void ScummEngine_c64::o_unlockRoom() {
int resid = fetchScriptByte();
res.unlock(rtRoom, resid);
- debug(0, "o_unlockRoom (%d)", resid);
}
void ScummEngine_c64::o_cursorCommand() {
@@ -843,21 +835,22 @@
}
void ScummEngine_c64::o_doSentence() {
- byte var1 = fetchScriptByte();
- byte var2 = fetchScriptByte();
- byte var3 = fetchScriptByte();
- warning("STUB: o_doSentence(%d, %d, %d)", var1, var2, var3);
+ byte entry = fetchScriptByte();
+ byte obj = fetchScriptByte();
+ fetchScriptByte();
+
+ runObjectScript(obj, entry, false, false, NULL);
}
void ScummEngine_c64::o_unknown2() {
byte var1 = fetchScriptByte();
- warning("STUB: o_unknown2(%d)", var1);
+ error("STUB: o_unknown2(%d)", var1);
}
void ScummEngine_c64::o_ifActiveObject() {
byte obj = fetchScriptByte();
- if (obj == _activeObject)
+ if (obj == _activeInventory)
ScummEngine::fetchScriptWord();
else
o_jumpRelative();
@@ -989,8 +982,12 @@
_scriptPointer += offset;
}
+void ScummEngine_c64::resetSentence() {
+ _activeVerb = 0;
+ _activeInventory = 0;
+ _activeObject = 0;
+}
-
#undef PARAM_1
#undef PARAM_2
#undef PARAM_3
Modified: scummvm/trunk/engines/scumm/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v2.cpp 2006-03-02 12:09:19 UTC (rev 21010)
+++ scummvm/trunk/engines/scumm/script_v2.cpp 2006-03-02 12:14:06 UTC (rev 21011)
@@ -1612,14 +1612,10 @@
}
void ScummEngine_v2::resetSentence() {
- if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformC64) {
- // TODO
- } else {
- VAR(VAR_SENTENCE_VERB) = VAR(VAR_BACKUP_VERB);
- VAR(VAR_SENTENCE_OBJECT1) = 0;
- VAR(VAR_SENTENCE_OBJECT2) = 0;
- VAR(VAR_SENTENCE_PREPOSITION) = 0;
- }
+ VAR(VAR_SENTENCE_VERB) = VAR(VAR_BACKUP_VERB);
+ VAR(VAR_SENTENCE_OBJECT1) = 0;
+ VAR(VAR_SENTENCE_OBJECT2) = 0;
+ VAR(VAR_SENTENCE_PREPOSITION) = 0;
}
void ScummEngine_v2::runInventoryScript(int i) {
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2006-03-02 12:09:19 UTC (rev 21010)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2006-03-02 12:14:06 UTC (rev 21011)
@@ -545,6 +545,7 @@
_numObjectsInRoom = 0;
_userPut = 0;
_userState = 0;
+ _activeInventory = 0;
_activeObject = 0;
_resourceHeaderSize = 8;
_saveLoadFlag = 0;
Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h 2006-03-02 12:09:19 UTC (rev 21010)
+++ scummvm/trunk/engines/scumm/scumm.h 2006-03-02 12:14:06 UTC (rev 21011)
@@ -881,6 +881,7 @@
int8 _userPut;
uint16 _userState;
+ int _activeInventory;
int _activeObject;
virtual void handleMouseOver(bool updateInventory);
Modified: scummvm/trunk/engines/scumm/verbs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/verbs.cpp 2006-03-02 12:09:19 UTC (rev 21010)
+++ scummvm/trunk/engines/scumm/verbs.cpp 2006-03-02 12:14:06 UTC (rev 21011)
@@ -309,11 +309,8 @@
object = findInventory(_scummVars[VAR_EGO], object + 1 + _inventoryOffset);
if (_game.platform == Common::kPlatformC64 && _game.id == GID_MANIAC) {
- // TODO
- return;
- }
-
- if (object > 0) {
+ _activeInventory = object;
+ } else if (object > 0) {
runInputScript(3, object, 0);
}
}
@@ -547,6 +544,7 @@
runScript(3, 0, 0, 0);
}
} else {
+ _activeInventory = 0;
_activeObject = 0;
_activeVerb = 13;
if (zone->number == kMainVirtScreen) {
More information about the Scummvm-git-logs
mailing list