add D2k crates, started fixing infantry

infantry directions are correct, but movement is still wrong
This commit is contained in:
Matthias Mailänder
2012-05-28 20:14:56 +02:00
parent ec7795fa99
commit 27fa99852b
6 changed files with 89 additions and 39 deletions

View File

@@ -123,13 +123,48 @@ namespace OpenRA.Utility
int x = 0;
if (args.Contains("--vehicle")) //resorting to RA/CnC compatible counter-clockwise frame order
frame = srcImage[startFrame];
//TODO: This is not enough as the run and shoot animation are next to each other for each sequence in RA/CnC.
if (args.Contains("--infantry")) //resorting to RA/CnC compatible counter-clockwise frame order
{
endFrame = startFrame-1;
for (int e = 8; e < FrameCount+1; e=e+8) //assuming 8 facings each animation set
{
for (int f = startFrame+e-1; f > endFrame; f--)
{
OffsetX = frame.FrameWidth/2 - frame.Width/2;
OffsetY = frame.FrameHeight/2 - frame.Height/2;
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;
frame = srcImage[f];
Console.WriteLine("f: {0}", f);
}
endFrame = startFrame+e-1;
frame = srcImage[startFrame+e];
Console.WriteLine("e: {0}", e);
Console.WriteLine("FrameCount: {0}", FrameCount);
}
}
else if (args.Contains("--vehicle")) //resorting to RA/CnC compatible counter-clockwise frame order
{
frame = srcImage[startFrame];
endFrame--;
startFrame--;
for (int f = endFrame; f > startFrame; f--)
for (int f = endFrame-1; f > startFrame-1; f--)
{
OffsetX = frame.FrameWidth/2 - frame.OffsetX;
OffsetY = frame.FrameHeight/2 - frame.OffsetY;
@@ -184,8 +219,7 @@ namespace OpenRA.Utility
for (int f = startFrame; f < endFrame; f++)
{
frame = srcImage[f];
if (args.Contains("--infantry"))
if (args.Contains("--infantrydeath"))
{
OffsetX = frame.FrameWidth/2 - frame.Width/2;
OffsetY = frame.FrameHeight/2 - frame.Height/2;

View File

@@ -82,11 +82,10 @@ namespace OpenRA.Utility
for (int i = 0; i < 256; i++)
reader.ReadUInt16();
}
else if (ID == 2 && PaletteHandle != 0)
else if (ID == 2 && PaletteHandle != 0) // image with custom palette
{
// ignore image with custom palette
for (int i = 0; i < Width*Height; i++)
reader.ReadByte();
Image[i] = reader.ReadByte();
}
else //standard palette or 16 Bpp
{

View File

@@ -38,3 +38,4 @@
# complete Arrakis tileset (blocked by issue #2178)
# allow frigate to deliver 5 units at once to starport
# starport prices should vary
# add shroud (Dune's 32x32 tiles differ completely from RA/CnC)

View File

@@ -52,8 +52,8 @@ Player:
InitialCash: 5000
ActorGroupProxy:
DeveloperMode:
HackyAI@EasyAI:
Name:Easy AI
HackyAI@Omnius:
Name:Omnius
RallypointTestBuilding: conyarda
HarvesterUnit: harvester
BaseBuildUnit: mcva,mcvh,mcvo

View File

@@ -100,41 +100,59 @@ frigate:
Start: 0
Facings: 1
#TODO: This is wrong.
rifle:
stand:
Start: 0
Facings: 8
stand2:
Start: 8
Length: 8
Start: 0
Facings: 8
stand3:
Start: 128
Length: 16
Start: 0
Facings: 8
run:
Start: 16
Start: 8
Length: 6
Facings: 8
shoot:
Start: 64
Length: 6
Start: 56
Length: 5
Facings: 8
prone-stand:
Start: 112
Length: 4
Start: 104
Length: 1
Facings: 8
prone-run:
Start: 144
Length: 4
Start: 112
Length: 3
Facings: 8
standup-0:
Start: 176
Length: 2
Start: 96
Length: 1
Facings: 8
prone-shoot:
Start: 192
Length: 6
Start: 136
Length: 5
Facings: 8
die1: rifledeath
Start: 0
Length: 5
die2: rifledeath
Start: 5
Length: 7
die3: rifledeath
Start: 12
Length: 7
die4: rifledeath
Start: 19
Length: 7
die5: rifledeath
Start: 26
Length: 7
die-crushed: rifledeath
Start: 33
Length: 7
Tick: 1600
conyarda:
idle:
@@ -791,13 +809,9 @@ litning:
Length: 4
crate:
idle: scrate
idle: crates
Start: 0
water: wwcrate
Start: 0
Length: *
Tick: 500
land: sh-crate
land: crates
Start: 0
crate-effects:

View File

@@ -5,8 +5,8 @@ PAL="mods/d2k/bits/d2k.pal"
mono OpenRA.Utility.exe --r8 $R8 $PAL 0 2 "overlay"
mono OpenRA.Utility.exe --shp overlay.png 32
mono OpenRA.Utility.exe --r8 $R8 $PAL 40 101 "shroud"
mono OpenRA.Utility.exe --shp shroud.png 32
#mono OpenRA.Utility.exe --r8 $R8 $PAL 40 101 "shadow"
#mono OpenRA.Utility.exe --shp shadow.png 32
mono OpenRA.Utility.exe --r8 $R8 $PAL 102 105 "crates"
mono OpenRA.Utility.exe --shp crates.png 32
mono OpenRA.Utility.exe --r8 $R8 $PAL 106 109 "spicebloom"
@@ -15,8 +15,10 @@ mono OpenRA.Utility.exe --shp spicebloom.png 32
mono OpenRA.Utility.exe --r8 $R8 $PAL 194 205 "spice"
mono OpenRA.Utility.exe --shp spice.png 48
mono OpenRA.Utility.exe --r8 $R8 $PAL 206 457 "rifle" --infantry
mono OpenRA.Utility.exe --r8 $R8 $PAL 206 381 "rifle" --infantry
mono OpenRA.Utility.exe --shp rifle.png 48
mono OpenRA.Utility.exe --r8 $R8 $PAL 382 457 "rifledeath" --infantrydeath
mono OpenRA.Utility.exe --shp rifledeath.png 48
mono OpenRA.Utility.exe --r8 $R8 $PAL 458 693 "rocket" --infantry
mono OpenRA.Utility.exe --shp rocket.png 48
mono OpenRA.Utility.exe --r8 $R8 $PAL 694 929 "fremen" --infantry