Skip to content

Commit 9567249

Browse files
committed
rename intermediate variable to permutations
1 parent e9bea7e commit 9567249

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

Dat/FileParsing/LocoBinaryReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public IEnumerable<BodySprite> ReadBodySprites(int count)
212212
_HeightPositive = ReadByte(),
213213
_FlatYawAccuracy = ReadByte(),
214214
_SlopedYawAccuracy = ReadByte(),
215-
_NumFramesPerRotation = ReadByte(),
215+
_NumPermutationsPerRotation = ReadByte(),
216216
};
217217

218218
SkipImageId(4);

Dat/FileParsing/LocoBinaryWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void Write(BodySprite[] bodies)
136136
Write(body._HeightPositive);
137137
Write(body._FlatYawAccuracy);
138138
Write(body._SlopedYawAccuracy);
139-
Write(body._NumFramesPerRotation);
139+
Write(body._NumPermutationsPerRotation);
140140

141141
WriteEmptyImageId(4); // image ids not part of object definition
142142
}

Definitions/ObjectModels/Graphics/ImageTableGrouper.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ private static IEnumerable<ImageTableGroup> CreateVehicleGroups(VehicleObject mo
195195
{
196196
var flatImageIdStart = offset;
197197
bodySprite._FlatYawAccuracy = GetYawAccuracyFlat(bodySprite.NumFlatRotationFrames);
198-
bodySprite._NumFramesPerRotation = (uint8_t)(bodySprite.NumAnimationFrames * bodySprite.NumCargoFrames * bodySprite.NumRollFrames + (bodySprite.Flags.HasFlag(BodySpriteFlags.HasBrakingLights) ? 1 : 0));
198+
bodySprite._NumPermutationsPerRotation = (uint8_t)(bodySprite.NumAnimationFrames * bodySprite.NumCargoFrames * bodySprite.NumRollFrames + (bodySprite.Flags.HasFlag(BodySpriteFlags.HasBrakingLights) ? 1 : 0));
199199

200-
var numFlatFrames = bodySprite._NumFramesPerRotation * bodySprite.NumFlatRotationFrames;
200+
var numFlatFrames = bodySprite._NumPermutationsPerRotation * bodySprite.NumFlatRotationFrames;
201201
offset += numFlatFrames / symmetryMultiplier;
202202

203203
yield return new($"[bodySprite {counter}] flat", imageList[flatImageIdStart..offset]);
@@ -206,7 +206,7 @@ private static IEnumerable<ImageTableGroup> CreateVehicleGroups(VehicleObject mo
206206
if (bodySprite.Flags.HasFlag(BodySpriteFlags.HasGentleSprites))
207207
{
208208
{
209-
var numGentleTransitionFrames = bodySprite._NumFramesPerRotation * 4; // transition frames up/down deg6
209+
var numGentleTransitionFrames = bodySprite._NumPermutationsPerRotation * 4; // transition frames up/down deg6
210210

211211
// gentle transition up
212212
{
@@ -225,7 +225,7 @@ private static IEnumerable<ImageTableGroup> CreateVehicleGroups(VehicleObject mo
225225

226226
{
227227
bodySprite._SlopedYawAccuracy = GetYawAccuracySloped(bodySprite.NumSlopedRotationFrames);
228-
var numGentleFrames = bodySprite._NumFramesPerRotation * bodySprite.NumSlopedRotationFrames; // up/down deg12
228+
var numGentleFrames = bodySprite._NumPermutationsPerRotation * bodySprite.NumSlopedRotationFrames; // up/down deg12
229229

230230
// gentle up
231231
{
@@ -245,7 +245,7 @@ private static IEnumerable<ImageTableGroup> CreateVehicleGroups(VehicleObject mo
245245
if (bodySprite.Flags.HasFlag(BodySpriteFlags.HasSteepSprites))
246246
{
247247
{
248-
var numSteepTransitionFrames = bodySprite._NumFramesPerRotation * 4; // transition frames up/down deg18
248+
var numSteepTransitionFrames = bodySprite._NumPermutationsPerRotation * 4; // transition frames up/down deg18
249249

250250
// steep transition up
251251
{
@@ -263,7 +263,7 @@ private static IEnumerable<ImageTableGroup> CreateVehicleGroups(VehicleObject mo
263263
}
264264

265265
{
266-
var numSteepFrames = bodySprite.NumSlopedRotationFrames * bodySprite._NumFramesPerRotation; // up/down deg25
266+
var numSteepFrames = bodySprite.NumSlopedRotationFrames * bodySprite._NumPermutationsPerRotation; // up/down deg25
267267

268268
// steep up
269269
{

Definitions/ObjectModels/Objects/Vehicle/BodySprite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class BodySprite : ILocoStruct
2222
[Browsable(false)] public uint8_t _HeightPositive { get; set; }
2323
[Browsable(false)] public uint8_t _FlatYawAccuracy { get; set; }
2424
[Browsable(false)] public uint8_t _SlopedYawAccuracy { get; set; }
25-
[Browsable(false)] public uint8_t _NumFramesPerRotation { get; set; }
25+
[Browsable(false)] public uint8_t _NumPermutationsPerRotation { get; set; }
2626

2727
//public Dictionary<BodySpriteSlopeType, List<int>> ImageIds { get; set; } = [];
2828
//public int NumImages { get; set; }

0 commit comments

Comments
 (0)