Skip to content

Commit d177675

Browse files
committed
Use For/Until instead of For/To where applicable
1 parent dd070a8 commit d177675

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

types/IndexedImageWriter.bmx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Type IndexedImageWriter
100100

101101
'Pixel Array
102102
For Local pixelY:Int = bmpHeight - 1 To 0 Step -1
103-
For Local pixelX:Int = 0 To bmpWidthM4 - 1
103+
For Local pixelX:Int = 0 Until bmpWidthM4
104104
If pixelX < bmpWidth Then
105105
WriteByte(outputStream, ConvertColorToClosestIndex(ReadPixel(sourcePixmap, pixelX, pixelY)))
106106
Else

types/LimbManager.bmx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ Type LimbManager
3232
m_TileSize = tileSize
3333

3434
'Clear all the arrays before recreating
35-
For Local part:Int = 0 To c_LimbPartCount - 1
35+
For Local part:Int = 0 Until c_LimbPartCount
3636
m_LimbPartTilePos[part] = Null
3737
m_LimbPartImage[part] = Null
3838
m_LimbPartLength[part] = Null
3939
Next
40-
For Local marker:Int = 0 To c_JointMarkerCount - 1
40+
For Local marker:Int = 0 Until c_JointMarkerCount
4141
m_JointMarkers[marker] = Null
4242
Next
4343

44-
For Local part:Int = 0 To c_LimbPartCount - 1
44+
For Local part:Int = 0 Until c_LimbPartCount
4545
m_LimbPartTilePos[part] = New SVec2I(part * m_TileSize, 0)
4646
m_LimbPartImage[part] = CreateImage(m_TileSize, m_TileSize, 1, DYNAMICIMAGE | MASKEDIMAGE)
4747
GrabImage(m_LimbPartImage[part], part * m_TileSize, 0)
@@ -70,7 +70,7 @@ Type LimbManager
7070
Local selectedPart:Int = -1
7171
Local selectedMarker:Int = -1
7272

73-
For Local part:Int = 0 To c_LimbPartCount - 1
73+
For Local part:Int = 0 Until c_LimbPartCount
7474
If Utility.PointIsWithinBox(mousePos, New SVec2I(part * (m_TileSize), 0), New SVec2I(m_TileSize, m_TileSize)) = True Then
7575
selectedPart = part
7676
Exit
@@ -107,8 +107,8 @@ Type LimbManager
107107

108108
Method BendLimbs(frameCount:Int)
109109
Local stepSize:Float = (c_MaxExtend - c_MinExtend) / (frameCount - 1) '-1 to make inclusive of last value (full range)
110-
For Local limb:Float = 0 To c_LimbCount - 1
111-
For Local frame:Int = 0 To frameCount - 1
110+
For Local limb:Float = 0 Until c_LimbCount
111+
For Local frame:Int = 0 Until frameCount
112112
Local limbPart:Int = limb * 2
113113
Local posX:Float = (frame * 32) 'Drawing position X
114114
Local posY:Float = ((limb * 32) * 1.5 ) 'Drawing position Y
@@ -164,7 +164,7 @@ Type LimbManager
164164

165165
Method DrawBentLimbs(drawPos:SVec2I, frameCount:Int)
166166
BendLimbs(frameCount)
167-
For Local frame:Int = 0 To frameCount - 1
167+
For Local frame:Int = 0 Until frameCount
168168
'These might be in a specific draw-order for joint overlapping purposes
169169
'Arm FG
170170
Local limbPart:Int = 0

0 commit comments

Comments
 (0)