Scripted transitions between maps work now.

This commit is contained in:
Martin Haye 2014-07-20 07:01:21 -07:00
parent 1e04d813a8
commit c4e5e84461

View File

@ -101,6 +101,7 @@ word locTrig_func[MAX_LOC_TRIG]
word prevX word prevX
word prevY word prevY
word prevScript word prevScript
word prevMapNum
; Movement amounts when walking at each angle ; Movement amounts when walking at each angle
; Each entry consists of an X bump and a Y bump, in 8.8 fixed point ; Each entry consists of an X bump and a Y bump, in 8.8 fixed point
@ -425,7 +426,6 @@ def initMap()
if scriptModule if scriptModule
pScripts = loader(QUEUE_LOAD, MAIN_MEM, (scriptModule << 8) | RES_TYPE_MODULE) pScripts = loader(QUEUE_LOAD, MAIN_MEM, (scriptModule << 8) | RES_TYPE_MODULE)
loader(FINISH_LOAD, MAIN_MEM, 1) ; 1 = keep open loader(FINISH_LOAD, MAIN_MEM, 1) ; 1 = keep open
nLocTrig = 0
fin fin
; Start up the font engine ; Start up the font engine
@ -441,9 +441,12 @@ def initMap()
; Initialize the map scripts ; Initialize the map scripts
setWindow2() setWindow2()
clearWindow()
prevX = -1 prevX = -1
prevY = -1 prevY = -1
prevScript = -1 prevScript = -1
nLocTrig = 0
prevMapNum = mapNum
if pScripts if pScripts
*pScripts() *pScripts()
fin fin
@ -491,6 +494,12 @@ def initCmd(key, func)
cmdTbl[key-$20] = func cmdTbl[key-$20] = func
end end
def flipToFirstPage
if ^frontBuf == 1
renderFrame()
fin
end
def checkScript() def checkScript()
word x word x
word y word y
@ -513,6 +522,10 @@ def checkScript()
fin fin
next next
fin fin
if mapNum <> prevMapNum
flipToFirstPage()
initMap()
fin
fin fin
end end
@ -557,16 +570,8 @@ def strafeLeft()
adjustDir(4) adjustDir(4)
end end
def flipToFirstPage
if ^frontBuf == 1
renderFrame()
fin
end
def setMap(is3d, num) def setMap(is3d, num)
mapNum = num mapNum = num
flipToFirstPage()
initMap()
end end
def nextMap() def nextMap()