mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-10-04 12:56:29 +00:00
Lamp flickering is much improved.
This commit is contained in:
parent
7b9522d6d6
commit
2b90f198a1
@ -23,8 +23,6 @@ const fontDataLen = $4FA // really only $474, but we need to fill all gaps
|
|||||||
const CHAR_WND_HEALTH_X = 112
|
const CHAR_WND_HEALTH_X = 112
|
||||||
|
|
||||||
const ANIM_PAUSE_MAX = 150
|
const ANIM_PAUSE_MAX = 150
|
||||||
const LAMP_PAUSE_MIN = 30
|
|
||||||
const LAMP_PAUSE_MAX = 100
|
|
||||||
|
|
||||||
const CLOCK_X = 119
|
const CLOCK_X = 119
|
||||||
const CLOCK_Y = 176
|
const CLOCK_Y = 176
|
||||||
@ -76,6 +74,7 @@ predef clearPortrait()#0
|
|||||||
predef showMapName(mapName)#0
|
predef showMapName(mapName)#0
|
||||||
predef doRender()#0
|
predef doRender()#0
|
||||||
predef pause(count)#1
|
predef pause(count)#1
|
||||||
|
predef printf2(str, arg1, arg2)#0
|
||||||
predef playerDeath()#0
|
predef playerDeath()#0
|
||||||
predef startGame(ask)#0
|
predef startGame(ask)#0
|
||||||
predef showAnimFrame()#0
|
predef showAnimFrame()#0
|
||||||
@ -144,9 +143,8 @@ byte animDirCt
|
|||||||
byte anyAnims = TRUE
|
byte anyAnims = TRUE
|
||||||
word animPauseCt
|
word animPauseCt
|
||||||
byte showingLamp = TRUE
|
byte showingLamp = TRUE
|
||||||
word lampPauseCt
|
|
||||||
byte lampFrame = 0
|
byte lampFrame = 0
|
||||||
byte lampDir = 1
|
word lampDir = 1
|
||||||
|
|
||||||
// Time and clock
|
// Time and clock
|
||||||
byte prevClockColor, prevClockHour, prevClockMinute
|
byte prevClockColor, prevClockHour, prevClockMinute
|
||||||
@ -184,7 +182,8 @@ export byte[] S_THEIR = "their"
|
|||||||
|
|
||||||
//byte[] macro = "lddddwwwwwwwwwwwwwwaaaaawwwwwdwwwwwwwwddwwwwwwwwaw",0
|
//byte[] macro = "lddddwwwwwwwwwwwwwwaaaaawwwwwdwwwwwwwwddwwwwwwwwaw",0
|
||||||
//word pMacro = NULL //@macro
|
//word pMacro = NULL //@macro
|
||||||
//word startTick = NULL
|
//word startTick = 0
|
||||||
|
word lastTick = 0
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Definitions used by assembly code
|
// Definitions used by assembly code
|
||||||
@ -1330,6 +1329,13 @@ def tickDiff(tStart, tEnd)
|
|||||||
return diff + 30000
|
return diff + 30000
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def prtick(str)#0
|
||||||
|
if lastTick
|
||||||
|
printf2("%s:%d ", str, tickDiff(lastTick, getTick()))
|
||||||
|
fin
|
||||||
|
lastTick = getTick()
|
||||||
|
end
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// General methods
|
// General methods
|
||||||
|
|
||||||
@ -1608,7 +1614,10 @@ def nextLampFrame()#0
|
|||||||
|
|
||||||
if showingLamp
|
if showingLamp
|
||||||
n = ((lampFrame + lampDir) % (LAMP_COUNT-1)) + LAMP_1
|
n = ((lampFrame + lampDir) % (LAMP_COUNT-1)) + LAMP_1
|
||||||
if (rand16() % 100) < 10; lampDir = -lampDir; fin
|
if (rand16() % 100) < 10
|
||||||
|
n = ((lampFrame + lampDir) % (LAMP_COUNT-1)) + LAMP_1
|
||||||
|
lampDir = -lampDir
|
||||||
|
fin
|
||||||
else
|
else
|
||||||
n = LAMP_0
|
n = LAMP_0
|
||||||
fin
|
fin
|
||||||
@ -1630,11 +1639,6 @@ export def pause(count)#1
|
|||||||
if anyAnims; nextAnimFrame(); fin
|
if anyAnims; nextAnimFrame(); fin
|
||||||
animPauseCt = ANIM_PAUSE_MAX
|
animPauseCt = ANIM_PAUSE_MAX
|
||||||
fin
|
fin
|
||||||
lampPauseCt--
|
|
||||||
if lampPauseCt < 0
|
|
||||||
if mapIs3D; nextLampFrame(); fin // handles show/hide as well
|
|
||||||
lampPauseCt = (rand16() % (LAMP_PAUSE_MAX-LAMP_PAUSE_MIN)) + LAMP_PAUSE_MIN
|
|
||||||
fin
|
|
||||||
next
|
next
|
||||||
return i
|
return i
|
||||||
end
|
end
|
||||||
@ -1808,7 +1812,6 @@ end
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
def resetAnimPause()#0
|
def resetAnimPause()#0
|
||||||
animPauseCt = ANIM_PAUSE_MAX
|
animPauseCt = ANIM_PAUSE_MAX
|
||||||
lampPauseCt = (rand16() % (LAMP_PAUSE_MAX-LAMP_PAUSE_MIN)) + LAMP_PAUSE_MIN
|
|
||||||
showingLamp = mapIs3D and (skyNum == 0 or skyNum == 8)
|
showingLamp = mapIs3D and (skyNum == 0 or skyNum == 8)
|
||||||
lampFrame = 0
|
lampFrame = 0
|
||||||
lampDir = 1
|
lampDir = 1
|
||||||
@ -2327,17 +2330,11 @@ def doRender()#0
|
|||||||
if mapIs3D
|
if mapIs3D
|
||||||
flipToPage1()
|
flipToPage1()
|
||||||
texControl(1)
|
texControl(1)
|
||||||
if lampPauseCt < 50
|
|
||||||
nextLampFrame
|
|
||||||
fin
|
|
||||||
fin
|
fin
|
||||||
texturesLoaded = TRUE
|
texturesLoaded = TRUE
|
||||||
fin
|
fin
|
||||||
|
if showingLamp; nextLampFrame; fin
|
||||||
render()
|
render()
|
||||||
if mapIs3D
|
|
||||||
nextLampFrame // handles hide and/or show
|
|
||||||
lampPauseCt = (rand16() % (LAMP_PAUSE_MAX-LAMP_PAUSE_MIN)) + LAMP_PAUSE_MIN
|
|
||||||
fin
|
|
||||||
needRender = FALSE
|
needRender = FALSE
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2759,11 +2756,14 @@ def showAnimFrame()#0
|
|||||||
fin
|
fin
|
||||||
blit(1, curPortrait + 2, getScreenLine(top)+2, 128, 18)
|
blit(1, curPortrait + 2, getScreenLine(top)+2, 128, 18)
|
||||||
needRender = FALSE // suppress display of map for this frame
|
needRender = FALSE // suppress display of map for this frame
|
||||||
|
if showingLamp; nextLampFrame(); fin
|
||||||
elsif curFullscreenImg
|
elsif curFullscreenImg
|
||||||
blit(1, curFullscreenImg + 2, getScreenLine(0), 192, 40) // the +2 is to skip anim hdr offset
|
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
|
needRender = FALSE // suppress display of map for this frame
|
||||||
elsif mapIs3D
|
elsif mapIs3D
|
||||||
|
if showingLamp; nextLampFrame(); fin
|
||||||
render()
|
render()
|
||||||
|
if showingLamp; nextLampFrame(); fin
|
||||||
fin
|
fin
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -3588,7 +3588,8 @@ export def setStat(player, statName, val)#0
|
|||||||
is streqi(statName, @S_CHARISMA); player->b_charisma = clampByte(val); break
|
is streqi(statName, @S_CHARISMA); player->b_charisma = clampByte(val); break
|
||||||
is streqi(statName, @S_SPIRIT); player->b_spirit = clampByte(val); break
|
is streqi(statName, @S_SPIRIT); player->b_spirit = clampByte(val); break
|
||||||
is streqi(statName, @S_LUCK); player->b_luck = clampByte(val); break
|
is streqi(statName, @S_LUCK); player->b_luck = clampByte(val); break
|
||||||
is streqi(statName, @S_HEALTH); player=>w_health = max(0, min(player=>w_maxHealth, val)); needShowParty = TRUE; break
|
is streqi(statName, @S_HEALTH); player=>w_health = max(0, min(player=>w_maxHealth, val))
|
||||||
|
needShowParty = TRUE; break
|
||||||
is streqi(statName, @S_MAX_HEALTH); player=>w_maxHealth = max(0, val); break
|
is streqi(statName, @S_MAX_HEALTH); player=>w_maxHealth = max(0, val); break
|
||||||
is streqi(statName, @S_AIMING); player->b_aiming = clampByte(val); break
|
is streqi(statName, @S_AIMING); player->b_aiming = clampByte(val); break
|
||||||
is streqi(statName, @S_HAND_TO_HAND); player->b_handToHand = clampByte(val); break
|
is streqi(statName, @S_HAND_TO_HAND); player->b_handToHand = clampByte(val); break
|
||||||
|
Loading…
Reference in New Issue
Block a user