Fix using items in C64 maniac and cleanup

svn-id: r21011
This commit is contained in:
Travis Howell 2006-03-02 12:14:06 +00:00
parent f00809788b
commit 82a6f289de
7 changed files with 27 additions and 33 deletions

View File

@ -293,7 +293,7 @@ protected:
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 @@ protected:
virtual void setStateCommon(byte type);
virtual void clearStateCommon(byte type);
virtual void resetSentence();
int getObjectFlag();
/* Version C64 script opcodes */

View File

@ -120,7 +120,6 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
res.increaseResourceCounter();
_activeObject = 0;
_currentRoom = room;
VAR(VAR_ROOM) = room;

View File

@ -491,8 +491,6 @@ void ScummEngine_c64::drawSentence() {
}
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 @@ void ScummEngine_c64::drawSentence() {
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_loadSound() {
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_loadScript() {
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_loadRoomWithEgo() {
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_printEgo_c64() {
}
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,7 +982,11 @@ void ScummEngine_c64::o_jumpRelative() {
_scriptPointer += offset;
}
void ScummEngine_c64::resetSentence() {
_activeVerb = 0;
_activeInventory = 0;
_activeObject = 0;
}
#undef PARAM_1
#undef PARAM_2

View File

@ -1612,14 +1612,10 @@ void ScummEngine_v2::o2_switchCostumeSet() {
}
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) {

View File

@ -545,6 +545,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_numObjectsInRoom = 0;
_userPut = 0;
_userState = 0;
_activeInventory = 0;
_activeObject = 0;
_resourceHeaderSize = 8;
_saveLoadFlag = 0;

View File

@ -881,6 +881,7 @@ protected:
int8 _userPut;
uint16 _userState;
int _activeInventory;
int _activeObject;
virtual void handleMouseOver(bool updateInventory);

View File

@ -309,11 +309,8 @@ void ScummEngine_v2::checkV2Inventory(int x, int y) {
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 @@ void ScummEngine_c64::checkExecVerbs() {
runScript(3, 0, 0, 0);
}
} else {
_activeInventory = 0;
_activeObject = 0;
_activeVerb = 13;
if (zone->number == kMainVirtScreen) {