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

@@ -122,14 +122,49 @@ namespace OpenRA.Utility
int OffsetY = 0; int OffsetY = 0;
int x = 0; 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]; frame = srcImage[startFrame];
endFrame--; for (int f = endFrame-1; f > startFrame-1; f--)
startFrame--;
for (int f = endFrame; f > startFrame; 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;
@@ -184,8 +219,7 @@ namespace OpenRA.Utility
for (int f = startFrame; f < endFrame; f++) for (int f = startFrame; f < endFrame; f++)
{ {
frame = srcImage[f]; frame = srcImage[f];
if (args.Contains("--infantrydeath"))
if (args.Contains("--infantry"))
{ {
OffsetX = frame.FrameWidth/2 - frame.Width/2; OffsetX = frame.FrameWidth/2 - frame.Width/2;
OffsetY = frame.FrameHeight/2 - frame.Height/2; OffsetY = frame.FrameHeight/2 - frame.Height/2;

View File

@@ -82,11 +82,10 @@ namespace OpenRA.Utility
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
reader.ReadUInt16(); 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++) for (int i = 0; i < Width*Height; i++)
reader.ReadByte(); Image[i] = reader.ReadByte();
} }
else //standard palette or 16 Bpp else //standard palette or 16 Bpp
{ {

View File

@@ -37,4 +37,5 @@
# replace RA mouse.shp, nopower.shp with Dune 2000 equivalent # replace RA mouse.shp, nopower.shp with Dune 2000 equivalent
# complete Arrakis tileset (blocked by issue #2178) # complete Arrakis tileset (blocked by issue #2178)
# allow frigate to deliver 5 units at once to starport # allow frigate to deliver 5 units at once to starport
# starport prices should vary # starport prices should vary
# add shroud (Dune's 32x32 tiles differ completely from RA/CnC)

View File

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

View File

@@ -100,41 +100,59 @@ frigate:
Start: 0 Start: 0
Facings: 1 Facings: 1
#TODO: This is wrong.
rifle: rifle:
stand: stand:
Start: 0 Start: 0
Facings: 8 Facings: 8
stand2: stand2:
Start: 8 Start: 0
Length: 8 Facings: 8
stand3: stand3:
Start: 128 Start: 0
Length: 16 Facings: 8
run: run:
Start: 16 Start: 8
Length: 6 Length: 6
Facings: 8 Facings: 8
shoot: shoot:
Start: 64 Start: 56
Length: 6 Length: 5
Facings: 8 Facings: 8
prone-stand: prone-stand:
Start: 112 Start: 104
Length: 4 Length: 1
Facings: 8 Facings: 8
prone-run: prone-run:
Start: 144 Start: 112
Length: 4 Length: 3
Facings: 8 Facings: 8
standup-0: standup-0:
Start: 176 Start: 96
Length: 2 Length: 1
Facings: 8 Facings: 8
prone-shoot: prone-shoot:
Start: 192 Start: 136
Length: 6 Length: 5
Facings: 8 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: conyarda:
idle: idle:
@@ -791,13 +809,9 @@ litning:
Length: 4 Length: 4
crate: crate:
idle: scrate idle: crates
Start: 0 Start: 0
water: wwcrate land: crates
Start: 0
Length: *
Tick: 500
land: sh-crate
Start: 0 Start: 0
crate-effects: 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 --r8 $R8 $PAL 0 2 "overlay"
mono OpenRA.Utility.exe --shp overlay.png 32 mono OpenRA.Utility.exe --shp overlay.png 32
mono OpenRA.Utility.exe --r8 $R8 $PAL 40 101 "shroud" #mono OpenRA.Utility.exe --r8 $R8 $PAL 40 101 "shadow"
mono OpenRA.Utility.exe --shp shroud.png 32 #mono OpenRA.Utility.exe --shp shadow.png 32
mono OpenRA.Utility.exe --r8 $R8 $PAL 102 105 "crates" mono OpenRA.Utility.exe --r8 $R8 $PAL 102 105 "crates"
mono OpenRA.Utility.exe --shp crates.png 32 mono OpenRA.Utility.exe --shp crates.png 32
mono OpenRA.Utility.exe --r8 $R8 $PAL 106 109 "spicebloom" 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 --r8 $R8 $PAL 194 205 "spice"
mono OpenRA.Utility.exe --shp spice.png 48 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 --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 --r8 $R8 $PAL 458 693 "rocket" --infantry
mono OpenRA.Utility.exe --shp rocket.png 48 mono OpenRA.Utility.exe --shp rocket.png 48
mono OpenRA.Utility.exe --r8 $R8 $PAL 694 929 "fremen" --infantry mono OpenRA.Utility.exe --r8 $R8 $PAL 694 929 "fremen" --infantry