fixed vehicles driving backwards

also fixed the bazooka for quad
This commit is contained in:
Matthias Mailänder
2012-05-22 22:17:48 +02:00
parent 66f82c6c2a
commit 4c667be946
5 changed files with 14 additions and 35 deletions

View File

@@ -123,14 +123,14 @@ namespace OpenRA.Utility
int x = 0; int x = 0;
if (args.Contains("--vehicle")) //complex resorting to RA/CnC compatible frame order if (args.Contains("--vehicle")) //resorting to RA/CnC compatible counter-clockwise frame order
{ {
endFrame = endFrame - (FrameCount / 2); frame = srcImage[startFrame];
endFrame--;
startFrame--; startFrame--;
for (int f = endFrame; f > startFrame; f--) for (int f = endFrame; f > startFrame; f--)
{ {
frame = srcImage[f];
OffsetX = frame.FrameWidth/2 - frame.OffsetX; OffsetX = frame.FrameWidth/2 - frame.OffsetX;
OffsetY = frame.FrameHeight/2 - frame.OffsetY; OffsetY = frame.FrameHeight/2 - frame.OffsetY;
@@ -147,29 +147,8 @@ namespace OpenRA.Utility
bitmap.UnlockBits(data); bitmap.UnlockBits(data);
x += frame.FrameWidth; x += frame.FrameWidth;
}
endFrame = endFrame + (FrameCount / 2) - 1;
startFrame = startFrame + (FrameCount / 2) + 1;
for (int f = endFrame; f > startFrame; f--)
{
frame = srcImage[f]; frame = srcImage[f];
OffsetX = frame.FrameWidth/2 - frame.OffsetX;
OffsetY = frame.FrameHeight/2 - frame.OffsetY;
Console.WriteLine("calculated OffsetX: {0}", OffsetX);
Console.WriteLine("calculated OffsetY: {0}", OffsetY);
var data = bitmap.LockBits(new Rectangle(x+OffsetX, 0+OffsetY, frame.Width, frame.Height), ImageLockMode.WriteOnly,
PixelFormat.Format8bppIndexed);
for (var i = 0; i < frame.Height; i++)
Marshal.Copy(frame.Image, i * frame.Width,
new IntPtr(data.Scan0.ToInt64() + i * data.Stride), frame.Width);
bitmap.UnlockBits(data);
x += frame.FrameWidth;
} }
} }
else else

Binary file not shown.

View File

@@ -45,8 +45,8 @@ PWRA:
Prerequisite: anypower Prerequisite: anypower
Building: Building:
Power: 100 Power: 100
Footprint: xx xx Footprint: xx xx xx
Dimensions: 2,2 Dimensions: 2,3
Health: Health:
HP: 400 HP: 400
Armor: Armor:
@@ -145,7 +145,7 @@ REFA:
Description: Harvesters unload spice here. Description: Harvesters unload spice here.
Building: Building:
Power: -30 Power: -30
Footprint: _x_ xxx x== Footprint: xxx xxx x==
Dimensions: 3,3 Dimensions: 3,3
Health: Health:
HP: 900 HP: 900
@@ -211,8 +211,8 @@ LIGHTA:
Description: light vehicles. Description: light vehicles.
Building: Building:
Power: -30 Power: -30
Footprint: xxx xxx Footprint: xxx xxx xxx
Dimensions: 3,2 Dimensions: 3,3
Health: Health:
HP: 1500 HP: 1500
Armor: Armor:
@@ -224,8 +224,8 @@ LIGHTA:
PlayerPalette: d2kplayer PlayerPalette: d2kplayer
RallyPoint: RallyPoint:
Exit@1: Exit@1:
SpawnOffset: 5,0 SpawnOffset: 10,0
ExitCell: 1,1 ExitCell: 1,3
Production: Production:
Produces: Vehicle Produces: Vehicle
PrimaryBuilding: PrimaryBuilding:

View File

@@ -93,7 +93,7 @@ QUAD:
RenderUnit: RenderUnit:
PlayerPalette: d2kplayer PlayerPalette: d2kplayer
AttackFrontal: AttackFrontal:
PrimaryWeapon: RedEye PrimaryWeapon: Dragon
PrimaryOffset: 0,0,0,-2 PrimaryOffset: 0,0,0,-2
PrimaryLocalOffset: -4,0,0,0,25, 4,0,0,0,-25 PrimaryLocalOffset: -4,0,0,0,25, 4,0,0,0,-25
AutoTarget: AutoTarget:

View File

@@ -38,7 +38,7 @@ mono OpenRA.Utility.exe --r8 $R8 $PAL 1859 1890 "combataturret" --vehicle
mono OpenRA.Utility.exe --shp combataturret.png 48 mono OpenRA.Utility.exe --shp combataturret.png 48
mono OpenRA.Utility.exe --r8 $R8 $PAL 1891 1922 "siegeturret" --vehicle mono OpenRA.Utility.exe --r8 $R8 $PAL 1891 1922 "siegeturret" --vehicle
mono OpenRA.Utility.exe --shp siegeturret.png 48 mono OpenRA.Utility.exe --shp siegeturret.png 48
mono OpenRA.Utility.exe --r8 $R8 $PAL 1923 1954 "carryall" --vehicle # requires some reordering (again) mono OpenRA.Utility.exe --r8 $R8 $PAL 1923 1954 "carryall" --vehicle
mono OpenRA.Utility.exe --shp carryall.png 64 mono OpenRA.Utility.exe --shp carryall.png 64
mono OpenRA.Utility.exe --r8 $R8 $PAL 1955 2050 "orni" --vehicle mono OpenRA.Utility.exe --r8 $R8 $PAL 1955 2050 "orni" --vehicle
mono OpenRA.Utility.exe --shp orni.png 48 mono OpenRA.Utility.exe --shp orni.png 48