From 0f2f2fa4ab454a01ff95afaf6b49885fa0e9e5c2 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Thu, 28 Apr 2016 08:20:28 -0700 Subject: [PATCH] Animations now run during combat pauses. --- Platform/Apple/virtual/src/plasma/combat.pla | 5 +---- Platform/Apple/virtual/src/plasma/gamelib.plh | 2 +- Platform/Apple/virtual/src/plasma/gameloop.pla | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Platform/Apple/virtual/src/plasma/combat.pla b/Platform/Apple/virtual/src/plasma/combat.pla index 682438dd..e56a3291 100644 --- a/Platform/Apple/virtual/src/plasma/combat.pla +++ b/Platform/Apple/virtual/src/plasma/combat.pla @@ -135,10 +135,7 @@ end /////////////////////////////////////////////////////////////////////////////////////////////////// def combatPause() - word n - for n = 1 to 3000 - - next + pause(800) end /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Platform/Apple/virtual/src/plasma/gamelib.plh b/Platform/Apple/virtual/src/plasma/gamelib.plh index 764f10fe..87c748af 100644 --- a/Platform/Apple/virtual/src/plasma/gamelib.plh +++ b/Platform/Apple/virtual/src/plasma/gamelib.plh @@ -106,7 +106,7 @@ const getStringResponse = gameLibVecs + 3*45 const strcmpi = gameLibVecs + 3*46 const addEncounterZone = gameLibVecs + 3*47 const fatal = gameLibVecs + 3*48 -const FUNCN49 = gameLibVecs + 3*49 +const pause = gameLibVecs + 3*49 const FUNCN50 = gameLibVecs + 3*50 const FUNCN51 = gameLibVecs + 3*51 const FUNCN52 = gameLibVecs + 3*52 diff --git a/Platform/Apple/virtual/src/plasma/gameloop.pla b/Platform/Apple/virtual/src/plasma/gameloop.pla index fbd130a8..e403740a 100644 --- a/Platform/Apple/virtual/src/plasma/gameloop.pla +++ b/Platform/Apple/virtual/src/plasma/gameloop.pla @@ -108,6 +108,7 @@ predef _countList, _countListFiltered, _randomFromListFiltered, _addToList, _bee predef _showParty, _mmgr, _setWindow1, _setWindow2, _setWindow3 predef _reboot, _brk, _encodeDice, _rollDice predef _setPlural, _makeEnemy, _getStringResponse, _strcmpi, _addEncounterZone, _fatal +predef _pause word gameLib_addrs = @_setScriptInfo, @_scriptDisplayStr, @_scriptDisplayStrNL, @_getYN word = @_queue_setMap, @_setSky, @_setGround, @_queue_teleport, @_setPortrait, @_clearPortrait @@ -121,6 +122,7 @@ word = @_countList, @_countListFiltered, @_randomFromListFiltered, @_addToList, word = @_showParty, @_mmgr, @_setWindow1, @_setWindow2, @_setWindow3 word = @_reboot, @_brk, @_encodeDice, @_rollDice word = @_setPlural, @_makeEnemy, @_getStringResponse, @_strcmpi, @_addEncounterZone, @_fatal +word = @_pause word = 0 // end of library functions @@ -972,6 +974,21 @@ def _getUpperKey() return charToUpper(key & $7F) end +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Pause for a specified count period, advancing the animation periodically. +def _pause(count) + while count >= 0 + animPauseCt = animPauseCt - 1 + if animPauseCt < 0 + if curPortrait and animNumFrames > 1 + nextAnimFrame() + fin + animPauseCt = ANIM_PAUSE_MAX + fin + count-- + loop +end + /////////////////////////////////////////////////////////////////////////////////////////////////// def _encodeDice(nDice, dieSize, add) // ndice=0..15, dieSize=0..15, add=0..255 return (nDice << 12) | (dieSize << 8) | add