Fix portrait debug switching in god mode.

This commit is contained in:
Martin Haye 2019-06-20 08:41:47 -07:00
parent 706fec214b
commit 1efc0d3630
3 changed files with 7 additions and 6 deletions

View File

@ -1803,7 +1803,6 @@ export def lookupResourcePart(sectionNum, resourceNum)#1
for i = 0 to 7
if n & (1<<i); return i+1; fin
next
fatal("lkupFail2")
return 0
end
@ -2344,6 +2343,7 @@ def initMap(x, y, dir)#0
// Load the map
curMapPartition = lookupResourcePart(mapIs3D+1, mapNum)
if !curMapPartition; fatal("lkupFail2"); fin
mmgr(START_LOAD, curMapPartition)
pCurMap = mmgr(QUEUE_LOAD, mapNum<<8 | (RES_TYPE_2D_MAP+mapIs3D))
mmgr(FINISH_LOAD, 0)
@ -2942,6 +2942,7 @@ export def setPortrait(portraitNum)#0
// Load the portrait image and display it
part = lookupResourcePart(3, portraitNum)
if !part; fatal("lkupFail2"); fin
// Commented out below, because it prevents cycling thru all portraits (in god mode)
// NO: if part > 1; part = curMapPartition; fin // Look on disk 1 or current disk only
mmgr(START_LOAD, part)

View File

@ -128,11 +128,10 @@ end
///////////////////////////////////////////////////////////////////////////////////////////////////
def advPortrait(dir)#1
while TRUE
portraitNum = portraitNum + dir
if portraitNum > PO_LAST
portraitNum = 1
elsif portraitNum < 1
portraitNum = PO_LAST
if dir < 0
portraitNum = portraitNum <= 1 ?? PO_LAST :: portraitNum-1
else
portraitNum = portraitNum >= PO_LAST ?? 1 :: portraitNum+1
fin
if lookupResourcePart(3, portraitNum); break; fin
loop

View File

@ -86,6 +86,7 @@ def loadStory(storyNum)#0
byte storyPart
word pAuxText, pEnd, pSrc, pDst, len
storyPart = lookupResourcePart(4, 1) // special section just to record the partition
if !storyPart; fatal("lkupFail2"); fin
auxMmgr(START_LOAD, storyPart)
pAuxText = auxMmgr(QUEUE_LOAD, storyNum<<8 | RES_TYPE_STORY)
auxMmgr(FINISH_LOAD, 0)