Cleanup, could cause regressions.

svn-id: r27547
This commit is contained in:
Travis Howell 2007-06-19 11:50:22 +00:00
parent aeb9668d66
commit ab9b9a1bf3
9 changed files with 30 additions and 44 deletions

View file

@ -672,8 +672,8 @@ protected:
void setItemParent(Item *item, Item *parent); void setItemParent(Item *item, Item *parent);
void setItemState(Item *item, int value); void setItemState(Item *item, int value);
void stopAnimate(uint a); void stopAnimate(uint16 a);
void stopAnimateSimon2(uint a, uint b); void stopAnimateSimon2(uint16 a, uint16 b);
void enableBox(uint hitarea); void enableBox(uint hitarea);
void disableBox(uint hitarea); void disableBox(uint hitarea);
@ -1491,7 +1491,7 @@ protected:
virtual void addArrows(WindowBlock *window, uint8 num); virtual void addArrows(WindowBlock *window, uint8 num);
virtual uint setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr); virtual uint setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr);
virtual void playSpeech(uint speech_id, uint vga_sprite_id); virtual void playSpeech(uint16 speech_id, uint16 vga_sprite_id);
virtual void listSaveGames(char *dst); virtual void listSaveGames(char *dst);
virtual void userGame(bool load); virtual void userGame(bool load);

View file

@ -1008,11 +1008,7 @@ void AGOSEngine::animate(uint16 windowNum, uint16 zoneNum, uint16 vgaSpriteId, i
else else
vsp->palette = palette; vsp->palette = palette;
vsp->id = vgaSpriteId; vsp->id = vgaSpriteId;
vsp->zoneNum = zoneNum;
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP)
vsp->zoneNum = zoneNum;
else
vsp->zoneNum = zoneNum = vgaSpriteId / 100;
for (;;) { for (;;) {
vpe = &_vgaBufferPointers[zoneNum]; vpe = &_vgaBufferPointers[zoneNum];

View file

@ -274,28 +274,28 @@ void AGOSEngine::waitForInput() {
_verbHitArea = 236; _verbHitArea = 236;
if (ha->id == 98) { if (ha->id == 98) {
animate(2, 0, 110, 0, 0, 0); animate(2, 1, 110, 0, 0, 0);
waitForSync(34); waitForSync(34);
} else if (ha->id == 108) { } else if (ha->id == 108) {
animate(2, 0, 106, 0, 0, 0); animate(2, 1, 106, 0, 0, 0);
waitForSync(34); waitForSync(34);
} else if (ha->id == 109) { } else if (ha->id == 109) {
animate(2, 0, 107, 0, 0, 0); animate(2, 1, 107, 0, 0, 0);
waitForSync(34); waitForSync(34);
} else if (ha->id == 115) { } else if (ha->id == 115) {
animate(2, 0, 109, 0, 0, 0); animate(2, 1, 109, 0, 0, 0);
waitForSync(34); waitForSync(34);
} else if (ha->id == 116) { } else if (ha->id == 116) {
animate(2, 0, 113, 0, 0, 0); animate(2, 1, 113, 0, 0, 0);
waitForSync(34); waitForSync(34);
} else if (ha->id == 117) { } else if (ha->id == 117) {
animate(2, 0, 112, 0, 0, 0); animate(2, 1, 112, 0, 0, 0);
waitForSync(34); waitForSync(34);
} else if (ha->id == 118) { } else if (ha->id == 118) {
animate(2, 0, 108, 0, 0, 0); animate(2, 1, 108, 0, 0, 0);
waitForSync(34); waitForSync(34);
} else if (ha->id == 119) { } else if (ha->id == 119) {
animate(2, 0, 111, 0, 0, 0); animate(2, 1, 111, 0, 0, 0);
waitForSync(34); waitForSync(34);
} }
} }

View file

@ -41,7 +41,7 @@ using Common::File;
namespace AGOS { namespace AGOS {
void AGOSEngine_Simon1::playSpeech(uint speech_id, uint vgaSpriteId) { void AGOSEngine_Simon1::playSpeech(uint16 speech_id, uint16 vgaSpriteId) {
if (speech_id == 9999) { if (speech_id == 9999) {
if (_subtitles) if (_subtitles)
return; return;
@ -59,12 +59,12 @@ void AGOSEngine_Simon1::playSpeech(uint speech_id, uint vgaSpriteId) {
stopAnimate(204); stopAnimate(204);
} }
if (vgaSpriteId < 100) if (vgaSpriteId < 100)
stopAnimate(vgaSpriteId + 201); stopAnimate(201 + vgaSpriteId);
loadVoice(speech_id); loadVoice(speech_id);
if (vgaSpriteId < 100) if (vgaSpriteId < 100)
animate(4, 2, vgaSpriteId + 201, 0, 0, 0); animate(4, 2, 201 + vgaSpriteId, 0, 0, 0);
} }
} }

View file

@ -1000,7 +1000,7 @@ void AGOSEngine::sendSync(uint a) {
_lockWord &= ~0x8000; _lockWord &= ~0x8000;
} }
void AGOSEngine::stopAnimate(uint a) { void AGOSEngine::stopAnimate(uint16 a) {
uint16 b = to16Wrapper(a); uint16 b = to16Wrapper(a);
_lockWord |= 0x8000; _lockWord |= 0x8000;
_vcPtr = (byte *)&b; _vcPtr = (byte *)&b;

View file

@ -323,8 +323,8 @@ void AGOSEngine_Simon2::os2_animate() {
void AGOSEngine_Simon2::os2_stopAnimate() { void AGOSEngine_Simon2::os2_stopAnimate() {
// 99: kill sprite // 99: kill sprite
uint a = getVarOrWord(); uint16 a = getVarOrWord();
uint b = getVarOrWord(); uint16 b = getVarOrWord();
stopAnimateSimon2(a, b); stopAnimateSimon2(a, b);
} }
@ -469,7 +469,7 @@ void AGOSEngine_Simon2::os2_waitMark() {
waitForMark(i); waitForMark(i);
} }
void AGOSEngine::stopAnimateSimon2(uint a, uint b) { void AGOSEngine::stopAnimateSimon2(uint16 a, uint16 b) {
uint16 items[2]; uint16 items[2];
items[0] = to16Wrapper(a); items[0] = to16Wrapper(a);

View file

@ -364,16 +364,16 @@ void AGOSEngine::printScreenText(uint vgaSpriteId, uint color, const char *strin
renderString(vgaSpriteId, color, width, height, convertedString); renderString(vgaSpriteId, color, width, height, convertedString);
} }
int b = (!getBitFlag(133)) ? 3 : 4; uint16 windowNum = (!getBitFlag(133)) ? 3 : 4;
x /= 8; x /= 8;
if (y < 2) if (y < 2)
y = 2; y = 2;
if (getGameType() == GType_SIMON1) if (getGameType() == GType_SIMON1)
animate(b, 2, vgaSpriteId + 199, x, y, 12); animate(windowNum, 2, 199 + vgaSpriteId, x, y, 12);
else else
animate(b, 2, vgaSpriteId, x, y, 12); animate(windowNum, 2, vgaSpriteId, x, y, 12);
} }
// The Feeble Files specific // The Feeble Files specific

View file

@ -215,7 +215,7 @@ bool AGOSEngine::vc_maybe_skip_proc_1(uint16 a, int16 b) {
void AGOSEngine::dirtyBackGround() { void AGOSEngine::dirtyBackGround() {
AnimTable *animTable = _screenAnim1; AnimTable *animTable = _screenAnim1;
while (animTable->srcPtr) { while (animTable->srcPtr) {
if (animTable->id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || animTable->zoneNum == _vgaCurZoneNum)) { if (animTable->id == _vgaCurSpriteId && animTable->zoneNum == _vgaCurZoneNum) {
animTable->windowNum |= 0x8000; animTable->windowNum |= 0x8000;
break; break;
} }
@ -226,13 +226,8 @@ void AGOSEngine::dirtyBackGround() {
VgaSprite *AGOSEngine::findCurSprite() { VgaSprite *AGOSEngine::findCurSprite() {
VgaSprite *vsp = _vgaSprites; VgaSprite *vsp = _vgaSprites;
while (vsp->id) { while (vsp->id) {
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) { if (vsp->id == _vgaCurSpriteId && vsp->zoneNum == _vgaCurZoneNum)
if (vsp->id == _vgaCurSpriteId && vsp->zoneNum == _vgaCurZoneNum) break;
break;
} else {
if (vsp->id == _vgaCurSpriteId)
break;
}
vsp++; vsp++;
} }
return vsp; return vsp;
@ -241,13 +236,8 @@ VgaSprite *AGOSEngine::findCurSprite() {
bool AGOSEngine::isSpriteLoaded(uint16 id, uint16 zoneNum) { bool AGOSEngine::isSpriteLoaded(uint16 id, uint16 zoneNum) {
VgaSprite *vsp = _vgaSprites; VgaSprite *vsp = _vgaSprites;
while (vsp->id) { while (vsp->id) {
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) { if (vsp->id == id && vsp->zoneNum == zoneNum)
if (vsp->id == id && vsp->zoneNum == zoneNum) return true;
return true;
} else {
if (vsp->id == id)
return true;
}
vsp++; vsp++;
} }
return false; return false;

View file

@ -88,7 +88,7 @@ void AGOSEngine_Simon1::vcStopAnimation(uint zone, uint sprite) {
vfs = _waitSyncTable; vfs = _waitSyncTable;
while (vfs->ident != 0) { while (vfs->ident != 0) {
if (vfs->sprite_id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || vfs->cur_vga_file == _vgaCurZoneNum)) { if (vfs->sprite_id == _vgaCurSpriteId && vfs->cur_vga_file == _vgaCurZoneNum) {
while (vfs->ident != 0) { while (vfs->ident != 0) {
memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct)); memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct));
vfs++; vfs++;
@ -104,7 +104,7 @@ void AGOSEngine_Simon1::vcStopAnimation(uint zone, uint sprite) {
vte = _vgaTimerList; vte = _vgaTimerList;
while (vte->delay) { while (vte->delay) {
if (vte->sprite_id == _vgaCurSpriteId && (getGameType() == GType_SIMON1 || vte->cur_vga_file == _vgaCurZoneNum)) { if (vte->sprite_id == _vgaCurSpriteId && vte->cur_vga_file == _vgaCurZoneNum) {
deleteVgaEvent(vte); deleteVgaEvent(vte);
break; break;
} }
@ -127,8 +127,8 @@ void AGOSEngine::vc60_stopAnimation() {
zoneNum = vcReadNextWord(); zoneNum = vcReadNextWord();
sprite = vcReadNextWord(); sprite = vcReadNextWord();
} else { } else {
zoneNum = _vgaCurZoneNum;
sprite = vcReadNextWord(); sprite = vcReadNextWord();
zoneNum = sprite / 100;
} }
vcStopAnimation(zoneNum, sprite); vcStopAnimation(zoneNum, sprite);