From: Holger Schemel Date: Tue, 16 Feb 2010 16:21:05 +0000 (+0100) Subject: rnd-20100216-2-src X-Git-Tag: 3.3.0.0^2~35 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=20a30378bfde4264628619380057730df6887972;p=rocksndiamonds.git rnd-20100216-2-src * done integrating R'n'D graphics engine into file "SnikSnaks.c" * done integrating R'n'D graphics engine into file "Electrons.c" --- diff --git a/ChangeLog b/ChangeLog index e5ba1ba1..c1f4a80d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2010-02-16 * fixed bug in native Supaplex engine that broke several demo solutions + * done integrating R'n'D graphics engine into file "SnikSnaks.c" + * done integrating R'n'D graphics engine into file "Electrons.c" 2010-02-14 * done integrating R'n'D graphics engine into file "Murphy.c" diff --git a/src/conftime.h b/src/conftime.h index 20908561..900d4568 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-02-16 15:40" +#define COMPILE_DATE_STRING "2010-02-16 17:12" diff --git a/src/game_sp/Electrons.c b/src/game_sp/Electrons.c index f678ab58..a910138d 100644 --- a/src/game_sp/Electrons.c +++ b/src/game_sp/Electrons.c @@ -103,7 +103,7 @@ int subElectronTurnLeft(int si, int bx) int subElectronTurnLeft; // int ax, ah, bl, dx, X, Y; - int ax, bl, X, Y; + int ax, bl; ax = (TimerVar & 3); if (ax != 0) @@ -114,11 +114,16 @@ int subElectronTurnLeft(int si, int bx) return subElectronTurnLeft; } // loc_g_7A9F: +#if 1 + subDrawElectronTurnLeft(si, bx); +#else // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif + bx = (bx + 1) & 0x7; MovHighByte(&PlayField16[si], bx); return subElectronTurnLeft; @@ -210,7 +215,7 @@ int subElectronTurnRight(int si, int bx) int subElectronTurnRight; // int ax, ah, bl, dx, X, Y; - int ax, bl, X, Y; + int ax, bl; ax = (TimerVar & 3); if (ax != 0) @@ -221,11 +226,16 @@ int subElectronTurnRight(int si, int bx) return subElectronTurnRight; } // loc_g_7B73: +#if 1 + subDrawElectronTurnRight(si, bx); +#else // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, aniFramesElectron[0x10 - bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif + bx = ((bx + 1) & 0x7) | 8; MovHighByte(&PlayField16[si], bx); return subElectronTurnRight; @@ -317,8 +327,12 @@ int subElectronFromBelow(int si, int bx) int subElectronFromBelow; // int ax, ah, bl, dx, X, Y; - int ax, bl, X, Y; + int ax, bl; +#if 1 + subDrawElectronFromBelow(si, bx); + bx = bx - 0xF; // get and increment sequence# +#else bx = bx - 0xF; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); @@ -326,6 +340,8 @@ int subElectronFromBelow(int si, int bx) StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif + bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si + FieldWidth]) != fiExplosion) { @@ -380,8 +396,12 @@ int subElectronFromRight(int si, int bx) int subElectronFromRight; // int ax, ah, bl, dx, X, Y; - int ax, bl, X, Y; + int ax, bl; +#if 1 + subDrawElectronFromRight(si, bx); + bx = bx - 0x17; // get and increment sequence# +#else bx = bx - 0x17; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si + 1); @@ -389,6 +409,8 @@ int subElectronFromRight(int si, int bx) StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif + bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si + 1]) != fiExplosion) { @@ -442,8 +464,12 @@ int subElectronFromAbove(int si, int bx) int subElectronFromAbove; // int ax, ah, bl, dx, X, Y; - int ax, bl, X, Y; + int ax, bl; +#if 1 + subDrawElectronFromAbove(si, bx); + bx = bx - 0x1F; // get and increment sequence# +#else bx = bx - 0x1F; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); @@ -451,6 +477,8 @@ int subElectronFromAbove(int si, int bx) StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif + bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si - FieldWidth]) != fiExplosion) { @@ -504,8 +532,12 @@ int subElectronFromLeft(int si, int bx) int subElectronFromLeft; // int ax, ah, bl, dx, X, Y; - int ax, bl, X, Y; + int ax, bl; +#if 1 + subDrawElectronFromLeft(si, bx); + bx = bx - 0x27; // get and increment sequence# +#else bx = bx - 0x27; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si - 1); @@ -513,6 +545,8 @@ int subElectronFromLeft(int si, int bx) StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif + bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si - 1]) != fiExplosion) { @@ -570,7 +604,11 @@ int subDrawElectronTurnLeft(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); +#if 1 + StretchedSprites.BltImg(X, Y, aniElectron, bx); +#else StretchedSprites.BltEx(X, Y, aniFramesElectron[bx]); +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronTurnLeft; @@ -585,7 +623,11 @@ int subDrawElectronTurnRight(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); +#if 1 + StretchedSprites.BltImg(X, Y, aniElectron, 0x10 - bx); +#else StretchedSprites.BltEx(X, Y, aniFramesElectron[0x10 - bx]); +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronTurnRight; @@ -601,8 +643,13 @@ int subDrawElectronFromBelow(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si + FieldWidth); +#if 1 + StretchedSprites.BltImg(X, Y, aniSpace, 0); + StretchedSprites.BltImg(X, Y - bx * TwoPixels, aniElectron, bx); +#else StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniFramesElectron[bx]); +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromBelow; @@ -618,8 +665,13 @@ int subDrawElectronFromRight(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si + 1); Y = GetStretchY(si); +#if 1 + StretchedSprites.BltImg(X, Y, aniSpace, 0); + StretchedSprites.BltImg(X - bx * TwoPixels, Y, aniElectron, bx); +#else StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniFramesElectron[bx]); +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromRight; @@ -635,8 +687,13 @@ int subDrawElectronFromAbove(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si - FieldWidth); +#if 1 + StretchedSprites.BltImg(X, Y, aniSpace, 0); + StretchedSprites.BltImg(X, Y + bx * TwoPixels, aniElectron, bx); +#else StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniFramesElectron[bx]); +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromAbove; @@ -652,8 +709,13 @@ int subDrawElectronFromLeft(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si - 1); Y = GetStretchY(si); +#if 1 + StretchedSprites.BltImg(X, Y, aniSpace, 0); + StretchedSprites.BltImg(X + bx * TwoPixels, Y, aniElectron, bx); +#else StretchedSprites.BltEx(X, Y, 0); StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniFramesElectron[bx]); +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromLeft; diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index 6cc66efd..8f4ff9dc 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -244,6 +244,23 @@ int fiGraphic[] = aniWallSpace }; +int aniSnikSnakTurningLeft[] = +{ + aniSnikSnakTurnUpToLeft, + aniSnikSnakTurnLeftToDown, + aniSnikSnakTurnDownToRight, + aniSnikSnakTurnRightToUp +}; + +int aniSnikSnakTurningRight[] = +{ + aniSnikSnakTurnUpToRight, + aniSnikSnakTurnRightToDown, + aniSnikSnakTurnDownToLeft, + aniSnikSnakTurnLeftToUp +}; + + int getSequenceLength(int sequence) { switch (sequence) diff --git a/src/game_sp/Globals.h b/src/game_sp/Globals.h index 27bbb04c..45a6ab8c 100644 --- a/src/game_sp/Globals.h +++ b/src/game_sp/Globals.h @@ -237,6 +237,15 @@ #define aniSnikSnakRight IMG_SP_SNIKSNAK_RIGHT #define aniSnikSnakUp IMG_SP_SNIKSNAK_UP +#define aniSnikSnakTurnLeftToUp IMG_SP_SNIKSNAK_TURNING_FROM_LEFT_UP +#define aniSnikSnakTurnLeftToDown IMG_SP_SNIKSNAK_TURNING_FROM_LEFT_DOWN +#define aniSnikSnakTurnRightToUp IMG_SP_SNIKSNAK_TURNING_FROM_RIGHT_UP +#define aniSnikSnakTurnRightToDown IMG_SP_SNIKSNAK_TURNING_FROM_RIGHT_DOWN +#define aniSnikSnakTurnUpToLeft IMG_SP_SNIKSNAK_TURNING_FROM_UP_LEFT +#define aniSnikSnakTurnUpToRight IMG_SP_SNIKSNAK_TURNING_FROM_UP_RIGHT +#define aniSnikSnakTurnDownToLeft IMG_SP_SNIKSNAK_TURNING_FROM_DOWN_LEFT +#define aniSnikSnakTurnDownToRight IMG_SP_SNIKSNAK_TURNING_FROM_DOWN_RIGHT + #define aniTerminalActive IMG_SP_TERMINAL_ACTIVE #define aniExplosionInfo (111) @@ -345,6 +354,8 @@ extern int getSequenceLength(int sequence); extern boolean isSnappingSequence(int sequence); extern int fiGraphic[]; +extern int aniSnikSnakTurningLeft[]; +extern int aniSnikSnakTurningRight[]; extern boolean Alignments; extern boolean BlockingSpeed; diff --git a/src/game_sp/SnikSnaks.c b/src/game_sp/SnikSnaks.c index d7b11e17..5053b363 100644 --- a/src/game_sp/SnikSnaks.c +++ b/src/game_sp/SnikSnaks.c @@ -655,6 +655,12 @@ static int subDrawSnikSnakTurnLeft(int si, int bx) { static int subDrawSnikSnakTurnLeft; +#if 1 + // int pos = bx / 2; + int pos = ((bx + 7) % 8) / 2; + + GfxGraphic[GetX(si)][GetY(si)] = aniSnikSnakTurningLeft[pos]; +#else int X, Y; // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -662,6 +668,7 @@ static int subDrawSnikSnakTurnLeft(int si, int bx) Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, aniFramesSnikSnak[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif return subDrawSnikSnakTurnLeft; } @@ -670,6 +677,12 @@ static int subDrawSnikSnakTurnRight(int si, int bx) { static int subDrawSnikSnakTurnRight; +#if 1 + // int pos = (bx - 8) / 2; + int pos = ((bx - 1) % 8) / 2; + + GfxGraphic[GetX(si)][GetY(si)] = aniSnikSnakTurningRight[pos]; +#else int X, Y; // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -677,6 +690,7 @@ static int subDrawSnikSnakTurnRight(int si, int bx) Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, aniFramesSnikSnak[0x10 - bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ +#endif return subDrawSnikSnakTurnRight; }