mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-02-20 21:29:13 +00:00
Took out some debugging code, and made next/prev portrait more efficient.
This commit is contained in:
parent
1ce5b2b0a0
commit
4cf10aba0a
@ -82,7 +82,7 @@ byte inScript = FALSE
|
||||
|
||||
export word skyNum = 9
|
||||
export word groundNum = 10
|
||||
export byte portraitNum = 46
|
||||
export byte portraitNum = 0
|
||||
|
||||
word triggerOriginX, triggerOriginY
|
||||
word triggerTbl
|
||||
@ -1381,8 +1381,7 @@ export def lookupResourcePart(sectionNum, resourceNum)#1
|
||||
if curMapPartition > 0; return curMapPartition; fin
|
||||
return 2
|
||||
fin
|
||||
printf1("n=%d\n", n)
|
||||
if n < 0 or n > 20; fatal("lkupFail2"); fin
|
||||
if n < 0 or n > 20; fatal("lkupFail2"); fin // allow zero (e.g. portrait not used so not packed)
|
||||
return n
|
||||
end
|
||||
|
||||
|
@ -77,27 +77,28 @@ def showPos()#1
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
def nextPortrait()#1
|
||||
def advPortrait(dir)#1
|
||||
while TRUE
|
||||
portraitNum = portraitNum + 1
|
||||
if portraitNum > PO_LAST; portraitNum = 1; fin
|
||||
printf1("portrait %d\n", portraitNum)
|
||||
portraitNum = portraitNum + dir
|
||||
if portraitNum > PO_LAST
|
||||
portraitNum = 1
|
||||
elsif portraitNum < 1
|
||||
portraitNum = PO_LAST
|
||||
fin
|
||||
if lookupResourcePart(3, portraitNum); break; fin
|
||||
loop
|
||||
setPortrait(portraitNum)
|
||||
return 0
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
def nextPortrait()#1
|
||||
return advPortrait(1)
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
def prevPortrait()#1
|
||||
while TRUE
|
||||
portraitNum = portraitNum - 1
|
||||
if portraitNum < 1; portraitNum = PO_LAST; fin
|
||||
printf1("portrait %d\n", portraitNum)
|
||||
if lookupResourcePart(3, portraitNum); break; fin
|
||||
loop
|
||||
setPortrait(portraitNum)
|
||||
return 0
|
||||
return advPortrait(-1)
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user