Skip to content

Commit 1d2106a

Browse files
author
MaximDude
committed
Fixed crash when setting frames to more than 7
Frame count setting fully functional
1 parent 7d2c68f commit 1d2106a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cccp-bender-main.bmx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ Type TAppOutput
5656
Global boneLength:Float[BONES]
5757
'Precalc for drawing
5858
Global TILESIZE:Int = 24
59-
Global angle:Int[BONES,FRAMES]
60-
Global xBone:Int[BONES,FRAMES]
61-
Global yBone:Int[BONES,FRAMES]
59+
Global angle:Int[BONES,20]
60+
Global xBone:Int[BONES,20]
61+
Global yBone:Int[BONES,20]
6262
'Variables
6363
Global angA:Float
6464
Global angB:Float
@@ -94,7 +94,7 @@ Type TAppOutput
9494
'Flip(1)
9595
doDraw = True
9696
EndFunction
97-
97+
9898
'Sprite rotation
9999
Function FLawOfCosines(ab:Float,bc:Float,ca:Float)
100100
angA = ACos((ca^2+ab^2-bc^2)/(2*ca*ab))
@@ -121,7 +121,7 @@ Type TAppOutput
121121
yBone[b,f] = y
122122
x:-Sin(angle[b,f])*upperLength 'Position of knee
123123
y:+Cos(angle[b,f])*upperLength 'Could just use another angle of the triangle though, but I (arne) didn't
124-
angle[b+1,f] = angC + angB + 180 'It looks correct on screen so I'm just gonna leave it at that!
124+
angle[b+1,f] = angC + angB + 180 'It looks correct on screen so i'm (arne) just gonna leave it at that!
125125
xBone[b+1,f] = x
126126
yBone[b+1,f] = y
127127
Next
@@ -397,8 +397,8 @@ While True
397397
Case TAppGUI.editSettingsFramesTextbox
398398
Local userInputValue:Int = GadgetText(TAppGUI.editSettingsFramesTextbox).ToInt()
399399
'Foolproofing
400-
If userInputValue > 7 Then
401-
TAppOutput.FRAMES = 7
400+
If userInputValue > 20 Then
401+
TAppOutput.FRAMES = 20
402402
ElseIf userInputValue <= 0 Then
403403
TAppOutput.FRAMES = 1
404404
Else

0 commit comments

Comments
 (0)