From 74f81a89a50d75629c7534475dcf101aecf0ecfe Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Thu, 5 Mar 2020 07:22:22 -0800 Subject: [PATCH] Fix animation showing over inventory screen. Fix mini powder keg in combat. --- Platform/Apple/virtual/src/plasma/combat.pla | 5 +++ .../Apple/virtual/src/plasma/gameloop.pla | 43 ++++++++++--------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Platform/Apple/virtual/src/plasma/combat.pla b/Platform/Apple/virtual/src/plasma/combat.pla index e5027852..f7059846 100644 --- a/Platform/Apple/virtual/src/plasma/combat.pla +++ b/Platform/Apple/virtual/src/plasma/combat.pla @@ -537,6 +537,11 @@ end def chooseShotNumber(pl, pWeapon)#0 byte i, nChoices, k + // Treat single-use weapons as having infinite ammo + if pWeapon->b_flags & WEAPON_FLAG_SINGLE_USE + pWeapon->b_clipCurrent = 99 + fin + // Determine number of shot choices this weapon has nChoices = 0 pl->b_shotChoice = 0 diff --git a/Platform/Apple/virtual/src/plasma/gameloop.pla b/Platform/Apple/virtual/src/plasma/gameloop.pla index cd614aba..023f16a7 100644 --- a/Platform/Apple/virtual/src/plasma/gameloop.pla +++ b/Platform/Apple/virtual/src/plasma/gameloop.pla @@ -2132,20 +2132,21 @@ end /////////////////////////////////////////////////////////////////////////////////////////////////// export def textureControl(flg)#0 - if !renderLoaded or !mapIs3D; return; fin flipToPage1 - if flg and !texturesLoaded - _texControl(1) - loadUtil3d - showingLamp = (skyNum == 0 or skyNum == 8) - elsif !flg and texturesLoaded - _texControl(0) - if pModUtil3d - mmgr(FREE_MEMORY, pModUtil3d) - pModUtil3d = NULL - util3d = NULL + if flg <> texturesLoaded and renderLoaded and mapIs3D + if flg + _texControl(1) + loadUtil3d + showingLamp = (skyNum == 0 or skyNum == 8) + else + _texControl(0) + if pModUtil3d + mmgr(FREE_MEMORY, pModUtil3d) + pModUtil3d = NULL + util3d = NULL + fin + showingLamp = FALSE fin - showingLamp = FALSE fin texturesLoaded = flg end @@ -2573,12 +2574,14 @@ def showAnimFrame()#0 elsif curFullscreenImg blit(1, curFullscreenImg + 2, getScreenLine(0), 192, 40) // the +2 is to skip anim hdr offset needRender = FALSE // suppress display of map for this frame - elsif mapIs3D - if showingLamp and util3d; util3d=>util3d_nextLampFrame(); fin - render($FF) // it's only animation, so do interrupt if a key is pressed - if showingLamp and util3d; util3d=>util3d_nextLampFrame(); fin - else - render(0) // 2d map view + elsif texturesLoaded + if mapIs3D + if showingLamp and util3d; util3d=>util3d_nextLampFrame(); fin + render($FF) // it's only animation, so do interrupt if a key is pressed + if showingLamp and util3d; util3d=>util3d_nextLampFrame(); fin + else + render(0) // 2d map view + fin fin end @@ -2587,6 +2590,7 @@ end def nextAnimFrame()#0 word flags, param byte dir, randNum + if !anyAnims; return; fin // Choose a new direction based on the flags. Do this the first time, and once every 3-7 frames. @@ -2705,8 +2709,7 @@ def loadEngine(moduleNum)#1 if curEngine; fatal("dblEng"); fin preEnginePortraitNum = curPortraitNum clearPortrait() - textureControl(FALSE) - flipToPage1() + textureControl(FALSE) // also flips to page 1 mmgr(START_LOAD, 1) // code is in partition 1 curEngine = mmgr(QUEUE_LOAD, moduleNum<<8 | RES_TYPE_MODULE) mmgr(FINISH_LOAD, 0)