diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 660f32a993..4d8ca09b00 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -122,14 +122,49 @@ namespace OpenRA.Utility int OffsetY = 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]; - - 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; diff --git a/OpenRA.Utility/R8Reader.cs b/OpenRA.Utility/R8Reader.cs index 4901d9cc5e..f71f9aa76c 100644 --- a/OpenRA.Utility/R8Reader.cs +++ b/OpenRA.Utility/R8Reader.cs @@ -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 { diff --git a/mods/d2k/TODO b/mods/d2k/TODO index e8b997cea2..da7961d321 100644 --- a/mods/d2k/TODO +++ b/mods/d2k/TODO @@ -37,4 +37,5 @@ # replace RA mouse.shp, nopower.shp with Dune 2000 equivalent # complete Arrakis tileset (blocked by issue #2178) # allow frigate to deliver 5 units at once to starport -# starport prices should vary \ No newline at end of file +# starport prices should vary +# add shroud (Dune's 32x32 tiles differ completely from RA/CnC) \ No newline at end of file diff --git a/mods/d2k/rules/system.yaml b/mods/d2k/rules/system.yaml index d4e180193e..2c22feae51 100644 --- a/mods/d2k/rules/system.yaml +++ b/mods/d2k/rules/system.yaml @@ -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 diff --git a/mods/d2k/sequences.yaml b/mods/d2k/sequences.yaml index 70cb4251e3..adfc80b937 100644 --- a/mods/d2k/sequences.yaml +++ b/mods/d2k/sequences.yaml @@ -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: diff --git a/ripD2kGameFiles.sh b/ripD2kGameFiles.sh index 5a46b494c6..7d362d6212 100755 --- a/ripD2kGameFiles.sh +++ b/ripD2kGameFiles.sh @@ -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