AGI: getflag/setflag/etc. cleanup
renamed getflag() to getFlag() renamed setflag() to setFlag() renamed flipflag() to flipFlag() preagi: renamed setFlag for this engine to setWinnieFlag
This commit is contained in:
parent
82b958f274
commit
4bc01ab7d5
22 changed files with 116 additions and 111 deletions
|
@ -685,9 +685,9 @@ public:
|
||||||
|
|
||||||
int _soundemu;
|
int _soundemu;
|
||||||
|
|
||||||
int getflag(int);
|
int getFlag(int16 flagNr);
|
||||||
void setflag(int, int);
|
void setFlag(int16 flagNr, bool newState);
|
||||||
void flipflag(int);
|
void flipFlag(int16 flagNr);
|
||||||
|
|
||||||
const AGIGameDescription *_gameDescription;
|
const AGIGameDescription *_gameDescription;
|
||||||
|
|
||||||
|
|
|
@ -163,8 +163,8 @@ bool AgiEngine::checkPriority(ScreenObjEntry *screenObj) {
|
||||||
|
|
||||||
// Check ego
|
// Check ego
|
||||||
if (screenObj->objectNr == 0) {
|
if (screenObj->objectNr == 0) {
|
||||||
setflag(VM_FLAG_EGO_TOUCHED_P2, touchedTrigger ? true : false);
|
setFlag(VM_FLAG_EGO_TOUCHED_P2, touchedTrigger ? true : false);
|
||||||
setflag(VM_FLAG_EGO_WATER, touchedWater ? true : false);
|
setFlag(VM_FLAG_EGO_WATER, touchedWater ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return touchedControl;
|
return touchedControl;
|
||||||
|
|
|
@ -75,7 +75,7 @@ bool Console::Cmd_SetFlag(int argc, const char **argv) {
|
||||||
}
|
}
|
||||||
int p1 = (int)atoi(argv[1]);
|
int p1 = (int)atoi(argv[1]);
|
||||||
int p2 = (int)atoi(argv[2]);
|
int p2 = (int)atoi(argv[2]);
|
||||||
_vm->setflag(p1, !!p2);
|
_vm->setFlag(p1, !!p2);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ bool Console::Cmd_Flags(int argc, const char **argv) {
|
||||||
for (i = 0; i < 255;) {
|
for (i = 0; i < 255;) {
|
||||||
debugPrintf("%3d ", i);
|
debugPrintf("%3d ", i);
|
||||||
for (j = 0; j < 10; j++, i++) {
|
for (j = 0; j < 10; j++, i++) {
|
||||||
debugPrintf("%c ", _vm->getflag(i) ? 'T' : 'F');
|
debugPrintf("%c ", _vm->getFlag(i) ? 'T' : 'F');
|
||||||
}
|
}
|
||||||
debugPrintf("\n");
|
debugPrintf("\n");
|
||||||
}
|
}
|
||||||
|
@ -542,7 +542,7 @@ bool Console::Cmd_VmFlags(int argc, const char **argv) {
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
// show contents
|
// show contents
|
||||||
if (_vm->getflag(flagNr)) {
|
if (_vm->getFlag(flagNr)) {
|
||||||
debugPrintf("flag %d == set\n", flagNr);
|
debugPrintf("flag %d == set\n", flagNr);
|
||||||
} else {
|
} else {
|
||||||
debugPrintf("flag %d == not set\n", flagNr);
|
debugPrintf("flag %d == not set\n", flagNr);
|
||||||
|
@ -557,10 +557,10 @@ bool Console::Cmd_VmFlags(int argc, const char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newFlagState) {
|
if (!newFlagState) {
|
||||||
_vm->setflag(flagNr, 0);
|
_vm->setFlag(flagNr, false);
|
||||||
debugPrintf("flag %d reset.\n", flagNr);
|
debugPrintf("flag %d reset.\n", flagNr);
|
||||||
} else {
|
} else {
|
||||||
_vm->setflag(flagNr, 1);
|
_vm->setFlag(flagNr, true);
|
||||||
debugPrintf("flag %d set.\n", flagNr);
|
debugPrintf("flag %d set.\n", flagNr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ void AgiEngine::newRoom(int16 newRoomNr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
setVar(VM_VAR_BORDER_TOUCH_EGO, 0);
|
setVar(VM_VAR_BORDER_TOUCH_EGO, 0);
|
||||||
setflag(VM_FLAG_NEW_ROOM_EXEC, true);
|
setFlag(VM_FLAG_NEW_ROOM_EXEC, true);
|
||||||
|
|
||||||
_game.exitAllLogics = true;
|
_game.exitAllLogics = true;
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ void AgiEngine::interpretCycle() {
|
||||||
checkAllMotions();
|
checkAllMotions();
|
||||||
|
|
||||||
oldScore = getVar(VM_VAR_SCORE);
|
oldScore = getVar(VM_VAR_SCORE);
|
||||||
oldSound = getflag(VM_FLAG_SOUND_ON);
|
oldSound = getFlag(VM_FLAG_SOUND_ON);
|
||||||
|
|
||||||
_game.exitAllLogics = false;
|
_game.exitAllLogics = false;
|
||||||
while (runLogic(0) == 0 && !(shouldQuit() || _restartGame)) {
|
while (runLogic(0) == 0 && !(shouldQuit() || _restartGame)) {
|
||||||
|
@ -146,7 +146,7 @@ void AgiEngine::interpretCycle() {
|
||||||
setVar(VM_VAR_BORDER_TOUCH_OBJECT, 0);
|
setVar(VM_VAR_BORDER_TOUCH_OBJECT, 0);
|
||||||
setVar(VM_VAR_BORDER_CODE, 0);
|
setVar(VM_VAR_BORDER_CODE, 0);
|
||||||
oldScore = getVar(VM_VAR_SCORE);
|
oldScore = getVar(VM_VAR_SCORE);
|
||||||
setflag(VM_FLAG_ENTERED_CLI, false);
|
setFlag(VM_FLAG_ENTERED_CLI, false);
|
||||||
_game.exitAllLogics = false;
|
_game.exitAllLogics = false;
|
||||||
nonBlockingText_CycleDone();
|
nonBlockingText_CycleDone();
|
||||||
resetControllers();
|
resetControllers();
|
||||||
|
@ -156,14 +156,14 @@ void AgiEngine::interpretCycle() {
|
||||||
|
|
||||||
screenObjEgo->direction = getVar(VM_VAR_EGO_DIRECTION);
|
screenObjEgo->direction = getVar(VM_VAR_EGO_DIRECTION);
|
||||||
|
|
||||||
if (getVar(VM_VAR_SCORE) != oldScore || getflag(VM_FLAG_SOUND_ON) != oldSound)
|
if (getVar(VM_VAR_SCORE) != oldScore || getFlag(VM_FLAG_SOUND_ON) != oldSound)
|
||||||
_game._vm->_text->statusDraw();
|
_game._vm->_text->statusDraw();
|
||||||
|
|
||||||
setVar(VM_VAR_BORDER_TOUCH_OBJECT, 0);
|
setVar(VM_VAR_BORDER_TOUCH_OBJECT, 0);
|
||||||
setVar(VM_VAR_BORDER_CODE, 0);
|
setVar(VM_VAR_BORDER_CODE, 0);
|
||||||
setflag(VM_FLAG_NEW_ROOM_EXEC, false);
|
setFlag(VM_FLAG_NEW_ROOM_EXEC, false);
|
||||||
setflag(VM_FLAG_RESTART_GAME, false);
|
setFlag(VM_FLAG_RESTART_GAME, false);
|
||||||
setflag(VM_FLAG_RESTORE_JUST_RAN, false);
|
setFlag(VM_FLAG_RESTORE_JUST_RAN, false);
|
||||||
|
|
||||||
if (_game.gfxMode) {
|
if (_game.gfxMode) {
|
||||||
updateScreenObjTable();
|
updateScreenObjTable();
|
||||||
|
@ -361,9 +361,9 @@ int AgiEngine::playGame() {
|
||||||
_game.horizon = 36;
|
_game.horizon = 36;
|
||||||
_game.playerControl = false;
|
_game.playerControl = false;
|
||||||
|
|
||||||
setflag(VM_FLAG_LOGIC_ZERO_FIRST_TIME, true); // not in 2.917
|
setFlag(VM_FLAG_LOGIC_ZERO_FIRST_TIME, true); // not in 2.917
|
||||||
setflag(VM_FLAG_NEW_ROOM_EXEC, true); // needed for MUMG and SQ2!
|
setFlag(VM_FLAG_NEW_ROOM_EXEC, true); // needed for MUMG and SQ2!
|
||||||
setflag(VM_FLAG_SOUND_ON, true); // enable sound
|
setFlag(VM_FLAG_SOUND_ON, true); // enable sound
|
||||||
setVar(VM_VAR_TIME_DELAY, 2); // "normal" speed
|
setVar(VM_VAR_TIME_DELAY, 2); // "normal" speed
|
||||||
|
|
||||||
_game.gfxMode = true;
|
_game.gfxMode = true;
|
||||||
|
@ -379,13 +379,13 @@ int AgiEngine::playGame() {
|
||||||
|
|
||||||
debug(0, "Running AGI script.\n");
|
debug(0, "Running AGI script.\n");
|
||||||
|
|
||||||
setflag(VM_FLAG_ENTERED_CLI, false);
|
setFlag(VM_FLAG_ENTERED_CLI, false);
|
||||||
setflag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
setFlag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
||||||
setVar(VM_VAR_WORD_NOT_FOUND, 0);
|
setVar(VM_VAR_WORD_NOT_FOUND, 0);
|
||||||
setVar(VM_VAR_KEY, 0);
|
setVar(VM_VAR_KEY, 0);
|
||||||
|
|
||||||
debugC(2, kDebugLevelMain, "Entering main loop");
|
debugC(2, kDebugLevelMain, "Entering main loop");
|
||||||
bool firstLoop = !getflag(VM_FLAG_RESTART_GAME); // Do not restore on game restart
|
bool firstLoop = !getFlag(VM_FLAG_RESTART_GAME); // Do not restore on game restart
|
||||||
|
|
||||||
if (firstLoop) {
|
if (firstLoop) {
|
||||||
if (ConfMan.hasKey("save_slot")) {
|
if (ConfMan.hasKey("save_slot")) {
|
||||||
|
@ -419,8 +419,8 @@ int AgiEngine::playGame() {
|
||||||
checkQuickLoad();
|
checkQuickLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
setflag(VM_FLAG_ENTERED_CLI, false);
|
setFlag(VM_FLAG_ENTERED_CLI, false);
|
||||||
setflag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
setFlag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
||||||
setVar(VM_VAR_WORD_NOT_FOUND, 0);
|
setVar(VM_VAR_WORD_NOT_FOUND, 0);
|
||||||
setVar(VM_VAR_KEY, 0);
|
setVar(VM_VAR_KEY, 0);
|
||||||
}
|
}
|
||||||
|
@ -465,7 +465,7 @@ int AgiEngine::runGame() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (_restartGame) {
|
if (_restartGame) {
|
||||||
setflag(VM_FLAG_RESTART_GAME, true);
|
setFlag(VM_FLAG_RESTART_GAME, true);
|
||||||
setVar(VM_VAR_TIME_DELAY, 2); // "normal" speed
|
setVar(VM_VAR_TIME_DELAY, 2); // "normal" speed
|
||||||
_restartGame = false;
|
_restartGame = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -571,7 +571,7 @@ namespace Agi {
|
||||||
|
|
||||||
bool AgiBase::canLoadGameStateCurrently() {
|
bool AgiBase::canLoadGameStateCurrently() {
|
||||||
if (!(getGameType() == GType_PreAGI)) {
|
if (!(getGameType() == GType_PreAGI)) {
|
||||||
if (getflag(VM_FLAG_MENUS_WORK)) {
|
if (getFlag(VM_FLAG_MENUS_WORK)) {
|
||||||
if (!_noSaveLoadAllowed) {
|
if (!_noSaveLoadAllowed) {
|
||||||
if (!cycleInnerLoopIsActive()) {
|
if (!cycleInnerLoopIsActive()) {
|
||||||
// We can't allow to restore a game, while inner loop is active
|
// We can't allow to restore a game, while inner loop is active
|
||||||
|
@ -592,7 +592,7 @@ bool AgiBase::canSaveGameStateCurrently() {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!(getGameType() == GType_PreAGI)) {
|
if (!(getGameType() == GType_PreAGI)) {
|
||||||
if (getflag(VM_FLAG_MENUS_WORK)) {
|
if (getFlag(VM_FLAG_MENUS_WORK)) {
|
||||||
if (!_noSaveLoadAllowed) {
|
if (!_noSaveLoadAllowed) {
|
||||||
if (!cycleInnerLoopIsActive()) {
|
if (!cycleInnerLoopIsActive()) {
|
||||||
if (promptIsEnabled()) {
|
if (promptIsEnabled()) {
|
||||||
|
|
|
@ -24,28 +24,28 @@
|
||||||
|
|
||||||
namespace Agi {
|
namespace Agi {
|
||||||
|
|
||||||
int AgiBase::getflag(int n) {
|
int AgiBase::getFlag(int16 flagNr) {
|
||||||
uint8 *set = (uint8 *)&_game.flags;
|
uint8 *flagPtr = _game.flags;
|
||||||
|
|
||||||
set += n >> 3;
|
flagPtr += flagNr >> 3;
|
||||||
return (*set & (1 << (n & 0x07))) != 0;
|
return (*flagPtr & (1 << (flagNr & 0x07))) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AgiBase::setflag(int n, int v) {
|
void AgiBase::setFlag(int16 flagNr, bool newState) {
|
||||||
uint8 *set = (uint8 *)&_game.flags;
|
uint8 *flagPtr = _game.flags;
|
||||||
|
|
||||||
set += n >> 3;
|
flagPtr += flagNr >> 3;
|
||||||
if (v)
|
if (newState)
|
||||||
*set |= 1 << (n & 0x07); // set bit
|
*flagPtr |= 1 << (flagNr & 0x07); // set bit
|
||||||
else
|
else
|
||||||
*set &= ~(1 << (n & 0x07)); // clear bit
|
*flagPtr &= ~(1 << (flagNr & 0x07)); // clear bit
|
||||||
}
|
}
|
||||||
|
|
||||||
void AgiBase::flipflag(int n) {
|
void AgiBase::flipFlag(int16 flagNr) {
|
||||||
uint8 *set = (uint8 *)&_game.flags;
|
uint8 *flagPtr = _game.flags;
|
||||||
|
|
||||||
set += n >> 3;
|
flagPtr += flagNr >> 3;
|
||||||
*set ^= 1 << (n & 0x07); // flip bit
|
*flagPtr ^= 1 << (flagNr & 0x07); // flip bit
|
||||||
}
|
}
|
||||||
|
|
||||||
void AgiEngine::setVar(int16 varNr, int val) {
|
void AgiEngine::setVar(int16 varNr, int val) {
|
||||||
|
|
|
@ -127,7 +127,7 @@ void InventoryMgr::show() {
|
||||||
// figure out current inventory of the player
|
// figure out current inventory of the player
|
||||||
getPlayerInventory();
|
getPlayerInventory();
|
||||||
|
|
||||||
if (_vm->getflag(VM_FLAG_STATUS_SELECTS_ITEMS)) {
|
if (_vm->getFlag(VM_FLAG_STATUS_SELECTS_ITEMS)) {
|
||||||
selectItems = true;
|
selectItems = true;
|
||||||
} else{
|
} else{
|
||||||
_activeItemNr = -1; // so that none is shown as active
|
_activeItemNr = -1; // so that none is shown as active
|
||||||
|
|
|
@ -540,7 +540,7 @@ int AgiEngine::waitKey() {
|
||||||
clearKeyQueue();
|
clearKeyQueue();
|
||||||
|
|
||||||
debugC(3, kDebugLevelInput, "waiting...");
|
debugC(3, kDebugLevelInput, "waiting...");
|
||||||
while (!(shouldQuit() || _restartGame || getflag(VM_FLAG_RESTORE_JUST_RAN))) {
|
while (!(shouldQuit() || _restartGame || getFlag(VM_FLAG_RESTORE_JUST_RAN))) {
|
||||||
pollTimer();
|
pollTimer();
|
||||||
key = doPollKeyboard();
|
key = doPollKeyboard();
|
||||||
if (key == AGI_KEY_ENTER || key == AGI_KEY_ESCAPE || key == AGI_MOUSE_BUTTON_LEFT)
|
if (key == AGI_KEY_ENTER || key == AGI_KEY_ESCAPE || key == AGI_MOUSE_BUTTON_LEFT)
|
||||||
|
|
|
@ -98,7 +98,7 @@ void AgiEngine::motionFollowEgo(ScreenObjEntry *screenObj) {
|
||||||
if (dir == 0) {
|
if (dir == 0) {
|
||||||
screenObj->direction = 0;
|
screenObj->direction = 0;
|
||||||
screenObj->motionType = kMotionNormal;
|
screenObj->motionType = kMotionNormal;
|
||||||
setflag(screenObj->follow_flag, true);
|
setFlag(screenObj->follow_flag, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ void AgiEngine::checkAllMotions() {
|
||||||
void AgiEngine::inDestination(ScreenObjEntry *screenObj) {
|
void AgiEngine::inDestination(ScreenObjEntry *screenObj) {
|
||||||
if (screenObj->motionType == kMotionMoveObj) {
|
if (screenObj->motionType == kMotionMoveObj) {
|
||||||
screenObj->stepSize = screenObj->move_stepSize;
|
screenObj->stepSize = screenObj->move_stepSize;
|
||||||
setflag(screenObj->move_flag, true);
|
setFlag(screenObj->move_flag, true);
|
||||||
}
|
}
|
||||||
screenObj->motionType = kMotionNormal;
|
screenObj->motionType = kMotionNormal;
|
||||||
if (isEgoView(screenObj))
|
if (isEgoView(screenObj))
|
||||||
|
@ -213,7 +213,7 @@ void AgiEngine::motionMoveObjStop(ScreenObjEntry *screenObj) {
|
||||||
// This check for motionType was only done in AGI3.
|
// This check for motionType was only done in AGI3.
|
||||||
// But we use this motion type for mouse movement, so we need to check in any case, otherwise it will cause glitches.
|
// But we use this motion type for mouse movement, so we need to check in any case, otherwise it will cause glitches.
|
||||||
if (screenObj->motionType != kMotionEgo) {
|
if (screenObj->motionType != kMotionEgo) {
|
||||||
setflag(screenObj->move_flag, true);
|
setFlag(screenObj->move_flag, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
screenObj->motionType = kMotionNormal;
|
screenObj->motionType = kMotionNormal;
|
||||||
|
|
|
@ -223,22 +223,22 @@ void cmdSet(AgiGame *state, uint8 *parameter) {
|
||||||
AgiEngine *vm = state->_vm;
|
AgiEngine *vm = state->_vm;
|
||||||
uint16 flagNr = parameter[0];
|
uint16 flagNr = parameter[0];
|
||||||
|
|
||||||
vm->setflag(flagNr, true);
|
vm->setFlag(flagNr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdReset(AgiGame *state, uint8 *parameter) {
|
void cmdReset(AgiGame *state, uint8 *parameter) {
|
||||||
AgiEngine *vm = state->_vm;
|
AgiEngine *vm = state->_vm;
|
||||||
uint16 flagNr = parameter[0];
|
uint16 flagNr = parameter[0];
|
||||||
|
|
||||||
vm->setflag(flagNr, false);
|
vm->setFlag(flagNr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdToggle(AgiGame *state, uint8 *parameter) {
|
void cmdToggle(AgiGame *state, uint8 *parameter) {
|
||||||
AgiEngine *vm = state->_vm;
|
AgiEngine *vm = state->_vm;
|
||||||
uint16 flagNr = parameter[0];
|
uint16 flagNr = parameter[0];
|
||||||
bool curFlagState = vm->getflag(flagNr);
|
bool curFlagState = vm->getFlag(flagNr);
|
||||||
|
|
||||||
vm->setflag(flagNr, !curFlagState);
|
vm->setFlag(flagNr, !curFlagState);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdSetV(AgiGame *state, uint8 *parameter) {
|
void cmdSetV(AgiGame *state, uint8 *parameter) {
|
||||||
|
@ -250,7 +250,7 @@ void cmdSetV(AgiGame *state, uint8 *parameter) {
|
||||||
} else {
|
} else {
|
||||||
flagNr = vm->getVar(flagNr);
|
flagNr = vm->getVar(flagNr);
|
||||||
|
|
||||||
vm->setflag(flagNr, true);
|
vm->setFlag(flagNr, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ void cmdResetV(AgiGame *state, uint8 *parameter) {
|
||||||
} else {
|
} else {
|
||||||
flagNr = vm->getVar(flagNr);
|
flagNr = vm->getVar(flagNr);
|
||||||
|
|
||||||
vm->setflag(flagNr, false);
|
vm->setFlag(flagNr, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,9 +276,9 @@ void cmdToggleV(AgiGame *state, uint8 *parameter) {
|
||||||
vm->setVar(flagNr, value ^ 1);
|
vm->setVar(flagNr, value ^ 1);
|
||||||
} else {
|
} else {
|
||||||
flagNr = vm->getVar(flagNr);
|
flagNr = vm->getVar(flagNr);
|
||||||
bool curFlagState = vm->getflag(flagNr);
|
bool curFlagState = vm->getFlag(flagNr);
|
||||||
|
|
||||||
vm->setflag(flagNr, !curFlagState);
|
vm->setFlag(flagNr, !curFlagState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -781,7 +781,7 @@ void cmdStopSound(AgiGame *state, uint8 *parameter) {
|
||||||
void cmdMenuInput(AgiGame *state, uint8 *parameter) {
|
void cmdMenuInput(AgiGame *state, uint8 *parameter) {
|
||||||
AgiEngine *vm = state->_vm;
|
AgiEngine *vm = state->_vm;
|
||||||
|
|
||||||
if (vm->getflag(VM_FLAG_MENUS_WORK)) {
|
if (vm->getFlag(VM_FLAG_MENUS_WORK)) {
|
||||||
vm->_menu->delayedExecute();
|
vm->_menu->delayedExecute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -964,21 +964,21 @@ void cmdSetSimple(AgiGame *state, uint8 *parameter) {
|
||||||
uint16 resourceNr = vm->getVar(varNr);
|
uint16 resourceNr = vm->getVar(varNr);
|
||||||
|
|
||||||
spritesMgr->eraseSprites();
|
spritesMgr->eraseSprites();
|
||||||
state->_vm->agiLoadResource(RESOURCETYPE_PICTURE, resourceNr);
|
vm->agiLoadResource(RESOURCETYPE_PICTURE, resourceNr);
|
||||||
|
|
||||||
// Draw the picture. Similar to void cmdDraw_pic(AgiGame *state, uint8 *p).
|
// Draw the picture. Similar to void cmdDraw_pic(AgiGame *state, uint8 *p).
|
||||||
state->_vm->_picture->decodePicture(resourceNr, false, true);
|
vm->_picture->decodePicture(resourceNr, false, true);
|
||||||
spritesMgr->drawAllSpriteLists();
|
spritesMgr->drawAllSpriteLists();
|
||||||
state->pictureShown = false;
|
state->pictureShown = false;
|
||||||
|
|
||||||
// Show the picture. Similar to void cmdShow_pic(AgiGame *state, uint8 *p).
|
// Show the picture. Similar to void cmdShow_pic(AgiGame *state, uint8 *p).
|
||||||
state->_vm->setflag(VM_FLAG_OUTPUT_MODE, false);
|
vm->setFlag(VM_FLAG_OUTPUT_MODE, false);
|
||||||
state->_vm->_text->closeWindow();
|
vm->_text->closeWindow();
|
||||||
state->_vm->_picture->showPic();
|
vm->_picture->showPic();
|
||||||
state->pictureShown = true;
|
state->pictureShown = true;
|
||||||
|
|
||||||
// Loading trigger
|
// Loading trigger
|
||||||
state->_vm->loadingTrigger_DrawPicture();
|
vm->loadingTrigger_DrawPicture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1093,8 +1093,8 @@ void cmdParse(AgiGame *state, uint8 *parameter) {
|
||||||
uint16 stringNr = parameter[0];
|
uint16 stringNr = parameter[0];
|
||||||
|
|
||||||
vm->setVar(VM_VAR_WORD_NOT_FOUND, 0);
|
vm->setVar(VM_VAR_WORD_NOT_FOUND, 0);
|
||||||
vm->setflag(VM_FLAG_ENTERED_CLI, false);
|
vm->setFlag(VM_FLAG_ENTERED_CLI, false);
|
||||||
vm->setflag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
vm->setFlag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
||||||
|
|
||||||
vm->_words->parseUsingDictionary(text->stringPrintf(state->strings[stringNr]));
|
vm->_words->parseUsingDictionary(text->stringPrintf(state->strings[stringNr]));
|
||||||
}
|
}
|
||||||
|
@ -1167,7 +1167,7 @@ void cmdDrawPic(AgiGame *state, uint8 *parameter) {
|
||||||
// that this is a script bug and occurs in the original interpreter as well.
|
// that this is a script bug and occurs in the original interpreter as well.
|
||||||
// Fixes bug #3056: AGI: SQ1 (2.2 DOS ENG) bizzare exploding roger
|
// Fixes bug #3056: AGI: SQ1 (2.2 DOS ENG) bizzare exploding roger
|
||||||
if (getGameID() == GID_SQ1 && resourceNr == 20)
|
if (getGameID() == GID_SQ1 && resourceNr == 20)
|
||||||
vm->setflag(103, false);
|
vm->setFlag(103, false);
|
||||||
|
|
||||||
// Loading trigger
|
// Loading trigger
|
||||||
vm->loadingTrigger_DrawPicture();
|
vm->loadingTrigger_DrawPicture();
|
||||||
|
@ -1177,7 +1177,7 @@ void cmdShowPic(AgiGame *state, uint8 *parameter) {
|
||||||
AgiEngine *vm = state->_vm;
|
AgiEngine *vm = state->_vm;
|
||||||
debugC(6, kDebugLevelScripts, "=== show pic ===");
|
debugC(6, kDebugLevelScripts, "=== show pic ===");
|
||||||
|
|
||||||
vm->setflag(VM_FLAG_OUTPUT_MODE, false);
|
vm->setFlag(VM_FLAG_OUTPUT_MODE, false);
|
||||||
vm->_text->closeWindow();
|
vm->_text->closeWindow();
|
||||||
vm->_picture->showPicWithTransition();
|
vm->_picture->showPicWithTransition();
|
||||||
state->pictureShown = true;
|
state->pictureShown = true;
|
||||||
|
@ -1506,7 +1506,7 @@ void cmdReverseLoop(AgiGame *state, uint8 *parameter) {
|
||||||
screenObj->cycle = kCycleRevLoop;
|
screenObj->cycle = kCycleRevLoop;
|
||||||
screenObj->flags |= (fDontupdate | fUpdate | fCycling);
|
screenObj->flags |= (fDontupdate | fUpdate | fCycling);
|
||||||
screenObj->loop_flag = loopFlag;
|
screenObj->loop_flag = loopFlag;
|
||||||
state->_vm->setflag(screenObj->loop_flag, false);
|
state->_vm->setFlag(screenObj->loop_flag, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdReverseLoopV1(AgiGame *state, uint8 *parameter) {
|
void cmdReverseLoopV1(AgiGame *state, uint8 *parameter) {
|
||||||
|
@ -1523,6 +1523,7 @@ void cmdReverseLoopV1(AgiGame *state, uint8 *parameter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdEndOfLoop(AgiGame *state, uint8 *parameter) {
|
void cmdEndOfLoop(AgiGame *state, uint8 *parameter) {
|
||||||
|
AgiEngine *vm = state->_vm;
|
||||||
uint16 objectNr = parameter[0];
|
uint16 objectNr = parameter[0];
|
||||||
uint16 loopFlag = parameter[1];
|
uint16 loopFlag = parameter[1];
|
||||||
ScreenObjEntry *screenObj = &state->screenObjTable[objectNr];
|
ScreenObjEntry *screenObj = &state->screenObjTable[objectNr];
|
||||||
|
@ -1531,7 +1532,7 @@ void cmdEndOfLoop(AgiGame *state, uint8 *parameter) {
|
||||||
screenObj->cycle = kCycleEndOfLoop;
|
screenObj->cycle = kCycleEndOfLoop;
|
||||||
screenObj->flags |= (fDontupdate | fUpdate | fCycling);
|
screenObj->flags |= (fDontupdate | fUpdate | fCycling);
|
||||||
screenObj->loop_flag = loopFlag;
|
screenObj->loop_flag = loopFlag;
|
||||||
state->_vm->setflag(screenObj->loop_flag, false);
|
vm->setFlag(screenObj->loop_flag, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdEndOfLoopV1(AgiGame *state, uint8 *parameter) {
|
void cmdEndOfLoopV1(AgiGame *state, uint8 *parameter) {
|
||||||
|
@ -1642,7 +1643,7 @@ void cmdFollowEgo(AgiGame *state, uint8 *parameter) {
|
||||||
vm->setVar(screenObj->follow_flag, 0);
|
vm->setVar(screenObj->follow_flag, 0);
|
||||||
screenObj->flags |= fUpdate | fAnimated;
|
screenObj->flags |= fUpdate | fAnimated;
|
||||||
} else {
|
} else {
|
||||||
state->_vm->setflag(screenObj->follow_flag, false);
|
vm->setFlag(screenObj->follow_flag, false);
|
||||||
screenObj->flags |= fUpdate;
|
screenObj->flags |= fUpdate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1670,7 +1671,7 @@ void cmdMoveObj(AgiGame *state, uint8 *parameter) {
|
||||||
vm->setVar(moveFlag, 0);
|
vm->setVar(moveFlag, 0);
|
||||||
screenObj->flags |= fUpdate | fAnimated;
|
screenObj->flags |= fUpdate | fAnimated;
|
||||||
} else {
|
} else {
|
||||||
vm->setflag(screenObj->move_flag, false);
|
vm->setFlag(screenObj->move_flag, false);
|
||||||
screenObj->flags |= fUpdate;
|
screenObj->flags |= fUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1700,7 +1701,7 @@ void cmdMoveObjF(AgiGame *state, uint8 *parameter) {
|
||||||
if (stepSize != 0)
|
if (stepSize != 0)
|
||||||
screenObj->stepSize = stepSize;
|
screenObj->stepSize = stepSize;
|
||||||
|
|
||||||
state->_vm->setflag(screenObj->move_flag, false);
|
vm->setFlag(screenObj->move_flag, false);
|
||||||
screenObj->flags |= fUpdate;
|
screenObj->flags |= fUpdate;
|
||||||
|
|
||||||
if (objectNr == 0)
|
if (objectNr == 0)
|
||||||
|
@ -1708,7 +1709,7 @@ void cmdMoveObjF(AgiGame *state, uint8 *parameter) {
|
||||||
|
|
||||||
// AGI 2.272 (ddp, xmas) doesn't call move_obj!
|
// AGI 2.272 (ddp, xmas) doesn't call move_obj!
|
||||||
if (getVersion() > 0x2272)
|
if (getVersion() > 0x2272)
|
||||||
state->_vm->moveObj(screenObj);
|
vm->moveObj(screenObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdWander(AgiGame *state, uint8 *parameter) {
|
void cmdWander(AgiGame *state, uint8 *parameter) {
|
||||||
|
@ -1899,20 +1900,21 @@ void cmdQuitV1(AgiGame *state, uint8 *parameter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdRestartGame(AgiGame *state, uint8 *parameter) {
|
void cmdRestartGame(AgiGame *state, uint8 *parameter) {
|
||||||
|
AgiEngine *vm = state->_vm;
|
||||||
bool doRestart = false;
|
bool doRestart = false;
|
||||||
|
|
||||||
state->_vm->_sound->stopSound();
|
state->_vm->_sound->stopSound();
|
||||||
|
|
||||||
if (state->_vm->getflag(VM_FLAG_AUTO_RESTART)) {
|
if (vm->getFlag(VM_FLAG_AUTO_RESTART)) {
|
||||||
doRestart = true;
|
doRestart = true;
|
||||||
} else {
|
} else {
|
||||||
doRestart = state->_vm->_systemUI->restartDialog();
|
doRestart = vm->_systemUI->restartDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doRestart) {
|
if (doRestart) {
|
||||||
state->_vm->_restartGame = true;
|
vm->_restartGame = true;
|
||||||
state->_vm->setflag(VM_FLAG_RESTART_GAME, true);
|
vm->setFlag(VM_FLAG_RESTART_GAME, true);
|
||||||
state->_vm->_menu->itemEnableAll();
|
vm->_menu->itemEnableAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,11 +78,11 @@ void condGreaterV(AgiGame *state, uint8 *p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void condIsSet(AgiGame *state, uint8 *p) {
|
void condIsSet(AgiGame *state, uint8 *p) {
|
||||||
state->testResult = state->_vm->getflag(p[0]);
|
state->testResult = state->_vm->getFlag(p[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void condIsSetV(AgiGame *state, uint8 *p) {
|
void condIsSetV(AgiGame *state, uint8 *p) {
|
||||||
state->testResult = state->_vm->getflag(getVar(p[0]));
|
state->testResult = state->_vm->getFlag(getVar(p[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
void condIsSetV1(AgiGame *state, uint8 *p) {
|
void condIsSetV1(AgiGame *state, uint8 *p) {
|
||||||
|
@ -121,7 +121,7 @@ void condSaid(AgiGame *state, uint8 *p) {
|
||||||
void condSaid1(AgiGame *state, uint8 *p) {
|
void condSaid1(AgiGame *state, uint8 *p) {
|
||||||
state->testResult = false;
|
state->testResult = false;
|
||||||
|
|
||||||
if (!state->_vm->getflag(VM_FLAG_ENTERED_CLI))
|
if (!state->_vm->getFlag(VM_FLAG_ENTERED_CLI))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int id0 = READ_LE_UINT16(p);
|
int id0 = READ_LE_UINT16(p);
|
||||||
|
@ -133,7 +133,7 @@ void condSaid1(AgiGame *state, uint8 *p) {
|
||||||
void condSaid2(AgiGame *state, uint8 *p) {
|
void condSaid2(AgiGame *state, uint8 *p) {
|
||||||
state->testResult = false;
|
state->testResult = false;
|
||||||
|
|
||||||
if (!state->_vm->getflag(VM_FLAG_ENTERED_CLI))
|
if (!state->_vm->getFlag(VM_FLAG_ENTERED_CLI))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int id0 = READ_LE_UINT16(p);
|
int id0 = READ_LE_UINT16(p);
|
||||||
|
@ -147,7 +147,7 @@ void condSaid2(AgiGame *state, uint8 *p) {
|
||||||
void condSaid3(AgiGame *state, uint8 *p) {
|
void condSaid3(AgiGame *state, uint8 *p) {
|
||||||
state->testResult = false;
|
state->testResult = false;
|
||||||
|
|
||||||
if (!state->_vm->getflag(VM_FLAG_ENTERED_CLI))
|
if (!state->_vm->getFlag(VM_FLAG_ENTERED_CLI))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int id0 = READ_LE_UINT16(p);
|
int id0 = READ_LE_UINT16(p);
|
||||||
|
@ -320,7 +320,7 @@ uint8 AgiEngine::testSaid(uint8 nwords, uint8 *cc) {
|
||||||
int c, n = words->getEgoWordCount();
|
int c, n = words->getEgoWordCount();
|
||||||
int z = 0;
|
int z = 0;
|
||||||
|
|
||||||
if (vm->getflag(VM_FLAG_SAID_ACCEPTED_INPUT) || !vm->getflag(VM_FLAG_ENTERED_CLI))
|
if (vm->getFlag(VM_FLAG_SAID_ACCEPTED_INPUT) || !vm->getFlag(VM_FLAG_ENTERED_CLI))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// FR:
|
// FR:
|
||||||
|
@ -366,7 +366,7 @@ uint8 AgiEngine::testSaid(uint8 nwords, uint8 *cc) {
|
||||||
if (nwords != 0 && READ_LE_UINT16(cc) != 9999)
|
if (nwords != 0 && READ_LE_UINT16(cc) != 9999)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
setflag(VM_FLAG_SAID_ACCEPTED_INPUT, true);
|
setFlag(VM_FLAG_SAID_ACCEPTED_INPUT, true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,7 +492,7 @@ bool MickeyEngine::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
case Common::KEYCODE_s:
|
case Common::KEYCODE_s:
|
||||||
flipflag(VM_FLAG_SOUND_ON);
|
flipFlag(VM_FLAG_SOUND_ON);
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_c:
|
case Common::KEYCODE_c:
|
||||||
inventory();
|
inventory();
|
||||||
|
@ -672,7 +672,7 @@ void MickeyEngine::playNote(MSA_SND_NOTE note) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MickeyEngine::playSound(ENUM_MSA_SOUND iSound) {
|
void MickeyEngine::playSound(ENUM_MSA_SOUND iSound) {
|
||||||
if (!getflag(VM_FLAG_SOUND_ON))
|
if (!getFlag(VM_FLAG_SOUND_ON))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Common::Event event;
|
Common::Event event;
|
||||||
|
@ -2297,7 +2297,7 @@ void MickeyEngine::init() {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setflag(VM_FLAG_SOUND_ON, true); // enable sound
|
setFlag(VM_FLAG_SOUND_ON, true); // enable sound
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::Error MickeyEngine::go() {
|
Common::Error MickeyEngine::go() {
|
||||||
|
|
|
@ -226,11 +226,11 @@ void WinnieEngine::setTakeDrop(int fCanSel[]) {
|
||||||
fCanSel[IDI_WTP_SEL_DROP] = _gameStateWinnie.iObjHave;
|
fCanSel[IDI_WTP_SEL_DROP] = _gameStateWinnie.iObjHave;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinnieEngine::setFlag(int iFlag) {
|
void WinnieEngine::setWinnieFlag(int iFlag) {
|
||||||
_gameStateWinnie.fGame[iFlag] = 1;
|
_gameStateWinnie.fGame[iFlag] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinnieEngine::clearFlag(int iFlag) {
|
void WinnieEngine::clearWinnieFlag(int iFlag) {
|
||||||
_gameStateWinnie.fGame[iFlag] = 0;
|
_gameStateWinnie.fGame[iFlag] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,11 +404,11 @@ int WinnieEngine::parser(int pc, int index, uint8 *buffer) {
|
||||||
break;
|
break;
|
||||||
case IDO_WTP_FLAG_CLEAR:
|
case IDO_WTP_FLAG_CLEAR:
|
||||||
opcode = *(buffer + pc++);
|
opcode = *(buffer + pc++);
|
||||||
clearFlag(opcode);
|
clearWinnieFlag(opcode);
|
||||||
break;
|
break;
|
||||||
case IDO_WTP_FLAG_SET:
|
case IDO_WTP_FLAG_SET:
|
||||||
opcode = *(buffer + pc++);
|
opcode = *(buffer + pc++);
|
||||||
setFlag(opcode);
|
setWinnieFlag(opcode);
|
||||||
break;
|
break;
|
||||||
case IDO_WTP_GAME_OVER:
|
case IDO_WTP_GAME_OVER:
|
||||||
gameOver();
|
gameOver();
|
||||||
|
@ -947,7 +947,7 @@ void WinnieEngine::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_s:
|
case Common::KEYCODE_s:
|
||||||
if (event.kbd.flags & Common::KBD_CTRL) {
|
if (event.kbd.flags & Common::KBD_CTRL) {
|
||||||
flipflag(VM_FLAG_SOUND_ON);
|
flipFlag(VM_FLAG_SOUND_ON);
|
||||||
} else {
|
} else {
|
||||||
*iSel = IDI_WTP_SEL_SOUTH;
|
*iSel = IDI_WTP_SEL_SOUTH;
|
||||||
makeSel(iSel, fCanSel);
|
makeSel(iSel, fCanSel);
|
||||||
|
@ -1342,7 +1342,7 @@ void WinnieEngine::init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_sound = new SoundMgr(this, _mixer);
|
_sound = new SoundMgr(this, _mixer);
|
||||||
setflag(VM_FLAG_SOUND_ON, true); // enable sound
|
setFlag(VM_FLAG_SOUND_ON, true); // enable sound
|
||||||
|
|
||||||
memset(&_gameStateWinnie, 0, sizeof(_gameStateWinnie));
|
memset(&_gameStateWinnie, 0, sizeof(_gameStateWinnie));
|
||||||
_gameStateWinnie.fSound = 1;
|
_gameStateWinnie.fSound = 1;
|
||||||
|
|
|
@ -336,8 +336,8 @@ private:
|
||||||
bool isRightObj(int, int, int*);
|
bool isRightObj(int, int, int*);
|
||||||
void drawObjPic(int, int, int);
|
void drawObjPic(int, int, int);
|
||||||
void getMenuMouseSel(int*, int[], int, int);
|
void getMenuMouseSel(int*, int[], int, int);
|
||||||
void setFlag(int);
|
void setWinnieFlag(int);
|
||||||
void clearFlag(int);
|
void clearWinnieFlag(int);
|
||||||
void gameOver();
|
void gameOver();
|
||||||
void saveGame();
|
void saveGame();
|
||||||
void loadGame();
|
void loadGame();
|
||||||
|
|
|
@ -134,6 +134,9 @@ int AgiEngine::saveGame(const Common::String &fileName, const Common::String &de
|
||||||
out->writeByte(_game.automaticSave);
|
out->writeByte(_game.automaticSave);
|
||||||
out->write(_game.automaticSaveDescription, 31);
|
out->write(_game.automaticSaveDescription, 31);
|
||||||
|
|
||||||
|
// touch VM_VAR_SECONDS, so that it gets updated
|
||||||
|
getVar(VM_VAR_SECONDS);
|
||||||
|
|
||||||
for (i = 0; i < MAX_FLAGS; i++)
|
for (i = 0; i < MAX_FLAGS; i++)
|
||||||
out->writeByte(_game.flags[i]);
|
out->writeByte(_game.flags[i]);
|
||||||
for (i = 0; i < MAX_VARS; i++)
|
for (i = 0; i < MAX_VARS; i++)
|
||||||
|
@ -666,7 +669,7 @@ int AgiEngine::loadGame(const Common::String &fileName, bool checkId) {
|
||||||
delete in;
|
delete in;
|
||||||
debugC(3, kDebugLevelMain | kDebugLevelSavegame, "Closed %s", fileName.c_str());
|
debugC(3, kDebugLevelMain | kDebugLevelSavegame, "Closed %s", fileName.c_str());
|
||||||
|
|
||||||
setflag(VM_FLAG_RESTORE_JUST_RAN, true);
|
setFlag(VM_FLAG_RESTORE_JUST_RAN, true);
|
||||||
|
|
||||||
_game.hasPrompt = 0; // force input line repaint if necessary
|
_game.hasPrompt = 0; // force input line repaint if necessary
|
||||||
_words->clearEgoWords();
|
_words->clearEgoWords();
|
||||||
|
|
|
@ -140,7 +140,7 @@ void SoundMgr::startSound(int resnum, int flag) {
|
||||||
if (_vm->getVersion() < 0x2000) {
|
if (_vm->getVersion() < 0x2000) {
|
||||||
_vm->_game.vars[_endflag] = 0;
|
_vm->_game.vars[_endflag] = 0;
|
||||||
} else {
|
} else {
|
||||||
_vm->setflag(_endflag, false);
|
_vm->setFlag(_endflag, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ void SoundMgr::stopSound() {
|
||||||
if (_vm->getVersion() < 0x2000) {
|
if (_vm->getVersion() < 0x2000) {
|
||||||
_vm->_game.vars[_endflag] = 1;
|
_vm->_game.vars[_endflag] = 1;
|
||||||
} else {
|
} else {
|
||||||
_vm->setflag(_endflag, true);
|
_vm->setFlag(_endflag, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ void SoundMgr::stopSound() {
|
||||||
|
|
||||||
void SoundMgr::soundIsFinished() {
|
void SoundMgr::soundIsFinished() {
|
||||||
if (_endflag != -1)
|
if (_endflag != -1)
|
||||||
_vm->setflag(_endflag, true);
|
_vm->setFlag(_endflag, true);
|
||||||
|
|
||||||
if (_playingSound != -1)
|
if (_playingSound != -1)
|
||||||
_vm->_game.sounds[_playingSound]->stop();
|
_vm->_game.sounds[_playingSound]->stop();
|
||||||
|
|
|
@ -236,7 +236,7 @@ int SoundGenPCJr::getNextNote_v2(int ch) {
|
||||||
|
|
||||||
assert(ch < CHAN_MAX);
|
assert(ch < CHAN_MAX);
|
||||||
|
|
||||||
if (!_vm->getflag(VM_FLAG_SOUND_ON))
|
if (!_vm->getFlag(VM_FLAG_SOUND_ON))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
tpcm = &_tchannel[ch];
|
tpcm = &_tchannel[ch];
|
||||||
|
|
|
@ -161,7 +161,7 @@ void SoundGenSarien::stopNote(int i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundGenSarien::playNote(int i, int freq, int vol) {
|
void SoundGenSarien::playNote(int i, int freq, int vol) {
|
||||||
if (!_vm->getflag(VM_FLAG_SOUND_ON))
|
if (!_vm->getFlag(VM_FLAG_SOUND_ON))
|
||||||
vol = 0;
|
vol = 0;
|
||||||
else if (vol && _vm->_soundemu == SOUND_EMU_PC)
|
else if (vol && _vm->_soundemu == SOUND_EMU_PC)
|
||||||
vol = 160;
|
vol = 160;
|
||||||
|
|
|
@ -254,7 +254,7 @@ void SpritesMgr::drawCel(ScreenObjEntry *screenObj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screenObj->objectNr == 0) { // if ego, update if ego is visible at the moment
|
if (screenObj->objectNr == 0) { // if ego, update if ego is visible at the moment
|
||||||
_vm->setflag(VM_FLAG_EGO_INVISIBLE, isViewHidden);
|
_vm->setFlag(VM_FLAG_EGO_INVISIBLE, isViewHidden);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,9 +328,9 @@ void TextMgr::printAt(int16 textNr, int16 textPos_Row, int16 textPos_Column, int
|
||||||
bool TextMgr::messageBox(const char *textPtr) {
|
bool TextMgr::messageBox(const char *textPtr) {
|
||||||
drawMessageBox(textPtr);
|
drawMessageBox(textPtr);
|
||||||
|
|
||||||
if (_vm->getflag(VM_FLAG_OUTPUT_MODE)) {
|
if (_vm->getFlag(VM_FLAG_OUTPUT_MODE)) {
|
||||||
// non-blocking window
|
// non-blocking window
|
||||||
_vm->setflag(VM_FLAG_OUTPUT_MODE, false);
|
_vm->setFlag(VM_FLAG_OUTPUT_MODE, false);
|
||||||
|
|
||||||
// Signal, that non-blocking text is shown at the moment
|
// Signal, that non-blocking text is shown at the moment
|
||||||
_vm->nonBlockingText_IsShown();
|
_vm->nonBlockingText_IsShown();
|
||||||
|
@ -359,7 +359,7 @@ bool TextMgr::messageBox(const char *textPtr) {
|
||||||
_vm->setVar(VM_VAR_KEY, 0);
|
_vm->setVar(VM_VAR_KEY, 0);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (_vm->getflag(VM_FLAG_RESTORE_JUST_RAN))
|
if (_vm->getFlag(VM_FLAG_RESTORE_JUST_RAN))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
_vm->mainCycle();
|
_vm->mainCycle();
|
||||||
|
@ -491,7 +491,7 @@ void TextMgr::statusDraw() {
|
||||||
displayText(statusTextPtr);
|
displayText(statusTextPtr);
|
||||||
|
|
||||||
charPos_Set(_statusRow, 30);
|
charPos_Set(_statusRow, 30);
|
||||||
if (_vm->getflag(VM_FLAG_SOUND_ON)) {
|
if (_vm->getFlag(VM_FLAG_SOUND_ON)) {
|
||||||
statusTextPtr = stringPrintf(_systemUI->getStatusTextSoundOn());
|
statusTextPtr = stringPrintf(_systemUI->getStatusTextSoundOn());
|
||||||
} else {
|
} else {
|
||||||
statusTextPtr = stringPrintf(_systemUI->getStatusTextSoundOff());
|
statusTextPtr = stringPrintf(_systemUI->getStatusTextSoundOff());
|
||||||
|
|
|
@ -49,7 +49,7 @@ void AgiEngine::updateView(ScreenObjEntry *screenObj) {
|
||||||
if (++celNr != lastCelNr)
|
if (++celNr != lastCelNr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setflag(screenObj->loop_flag, true);
|
setFlag(screenObj->loop_flag, true);
|
||||||
screenObj->flags &= ~fCycling;
|
screenObj->flags &= ~fCycling;
|
||||||
screenObj->direction = 0;
|
screenObj->direction = 0;
|
||||||
screenObj->cycle = kCycleNormal;
|
screenObj->cycle = kCycleNormal;
|
||||||
|
@ -60,7 +60,7 @@ void AgiEngine::updateView(ScreenObjEntry *screenObj) {
|
||||||
if (celNr)
|
if (celNr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setflag(screenObj->loop_flag, true);
|
setFlag(screenObj->loop_flag, true);
|
||||||
screenObj->flags &= ~fCycling;
|
screenObj->flags &= ~fCycling;
|
||||||
screenObj->direction = 0;
|
screenObj->direction = 0;
|
||||||
screenObj->cycle = kCycleNormal;
|
screenObj->cycle = kCycleNormal;
|
||||||
|
|
|
@ -354,11 +354,11 @@ void Words::parseUsingDictionary(char *rawUserInput) {
|
||||||
|
|
||||||
debugC(4, kDebugLevelScripts, "ego word count = %d", _egoWordCount);
|
debugC(4, kDebugLevelScripts, "ego word count = %d", _egoWordCount);
|
||||||
if (_egoWordCount > 0) {
|
if (_egoWordCount > 0) {
|
||||||
_vm->setflag(VM_FLAG_ENTERED_CLI, true);
|
_vm->setFlag(VM_FLAG_ENTERED_CLI, true);
|
||||||
} else {
|
} else {
|
||||||
_vm->setflag(VM_FLAG_ENTERED_CLI, false);
|
_vm->setFlag(VM_FLAG_ENTERED_CLI, false);
|
||||||
}
|
}
|
||||||
_vm->setflag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
_vm->setFlag(VM_FLAG_SAID_ACCEPTED_INPUT, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Words::getEgoWordCount() {
|
uint16 Words::getEgoWordCount() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue