From: Holger Schemel Date: Sun, 19 Jul 2009 21:54:42 +0000 (+0200) Subject: rnd-20090719-2-src X-Git-Tag: 3.3.0.0^2~91 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=ac592f78bbedc4808c5e35fb22bc8fc9f0398c8d rnd-20090719-2-src --- diff --git a/src/conftime.h b/src/conftime.h index aecacc95..8e9f2fa5 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-07-19 19:01" +#define COMPILE_DATE_STRING "2009-07-19 23:53" diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 5ab338fb..3fee7248 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -106,14 +106,23 @@ boolean DDSpriteBuffer_CreateFromFile(char *Path, long xSprites, long ySprites) } // --- On Error GoTo CreateFromFileEH +#if 1 + SD.LWidth = 16 * TILEX; + SD.LHeight = 16 * TILEY; +#else Buffer = DDraw.CreateSurfaceFromFile(Path, SD); +#endif // --- On Error GoTo 0 +#if 0 Buffer.GetSurfaceDesc(SD); +#endif + mSpriteWidth = SD.LWidth / xSprites; mSpriteHeight = SD.LHeight / ySprites; mXSpriteCount = xSprites; mYSpriteCount = ySprites; + CreateFromFile = True; return CreateFromFile; @@ -164,7 +173,9 @@ void DDSpriteBuffer_Cls(int BackColor) static void Blt(int pX, int pY, int SpriteX, int SpriteY) { RECT DR, SR; +#if 0 long Tmp; +#endif if (NoDisplayFlag) return; @@ -181,7 +192,15 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY) SR.right = SR.left + mSpriteWidth; SR.bottom = SR.top + mSpriteHeight; } + +#if 1 + BlitBitmap(sp_objects, screenBitmap, + SR.left, SR.top, + mSpriteWidth, mSpriteHeight, + DR.left, DR.top); +#else Tmp = mDest.Blt(DR, &Buffer, SR, DDBLT_WAIT); +#endif } void DDSpriteBuffer_BltEx(int pX, int pY, int SpritePos) diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index a51d7be0..82d46356 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -139,6 +139,7 @@ int FreezeZonks; // --- const int keySpaceRight = 8; // --- const int keySpace = 9; +#if 0 int *aniBug, *aniZonkRollRight, *aniZonkRollLeft; int *aniInfotronRollRight, *aniInfotronRollLeft; int *aniSnikSnak, *aniElectron, *aniExplosion; @@ -163,9 +164,37 @@ int *aniEatInfotronLeft, *aniEatInfotronRight; // --- const int aniPushLeft = 45; // --- const int aniPushRight = 44; // --- const int aniPushUpDown = 79; +#endif + +#if 1 +int aniBug[] = { 74, 75, 76, 77, 78, 77, 76, 77, 78, 77, 76, 75, 74, 25 }; +int aniZonkRollRight[] = { 198, 197, 196, 195, 194, 193, 192, 1, -1 }; +int aniZonkRollLeft[] = { 192, 193, 194, 195, 196, 197, 198, 1, -1 }; +int aniInfotronRollRight[] = { 206, 205, 204, 203, 202, 201, 200, 4 }; +int aniInfotronRollLeft[] = { 200, 201, 202, 203, 204, 205, 206, 4 }; +int aniSnikSnak[] = { 121, 122, 123, 124, 125, 126, 127, 120, 121 }; +int aniElectron[] = { 144, 145, 146, 147, 148, 149, 150, 151, 144 }; +int aniExplosion[] = { 3, 103, 104, 105, 106, 107, 108, 109, 0 }; +int aniTouchBase[] = { 80, 81, 82, 83, 84, 85, 86, 0, -1 }; +int aniTouchInfotron[] = { 87, 88, 89, 91, 92, 93, 0, -1 }; // Only seven frames!!!! +int aniTouchRedDisk[] = { 96, 97, 98, 99, 100, 101, 102, 0, -1 }; +int aniMurphyExit[] = { 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 0, 0, 0, 0, -1 }; +int aniMurphyEatLeft[] = { 176, 177, 178, 179, 180, 181, 182, 183, -1 }; +int aniMurphyEatRight[] = { 184, 185, 186, 187, 188, 189, 190, 191, -1 }; +int aniMurphyEatUpLeft[] = { 183, 182, 181, 180, 179, 178, 177, 176, -1 }; +int aniMurphyEatUpRight[] = { 191, 190, 189, 188, 187, 186, 185, 184, -1 }; + // aniMurphyEatRightRedDisk = { 184, 184, 185, 186, 187, 188, 189, 190, 191, -1) '9 frames! +int aniEatInfotronLeft[] = { 209, 211, 213, 215, 217, 219, 221, 223, -1 }; +int aniEatInfotronRight[] = { 224, 226, 228, 230, 232, 234, 236, 238, -1 }; +int aniSplitUpDown[] = { 3, 3, 3, 3, 3, 3, 3, 3, -1 }; +int aniYellowDisk[] = { 18, 18, 18, 18, 18, 18, 18, 18, -1 }; +int aniOrangeDisk[] = { 8, 8, 8, 8, 8, 8, 8, 8, -1 }; +int aniRedDisk[] = { 20, -1 }; +#endif void InitGlobals() { +#if 0 aniBug = Array(74, 75, 76, 77, 78, 77, 76, 77, 78, 77, 76, 75, 74, 25); aniZonkRollRight = Array(198, 197, 196, 195, 194, 193, 192, 1, -1); aniZonkRollLeft = Array(192, 193, 194, 195, 196, 197, 198, 1, -1); @@ -189,6 +218,8 @@ void InitGlobals() aniYellowDisk = Array(18, 18, 18, 18, 18, 18, 18, 18, -1); aniOrangeDisk = Array(8, 8, 8, 8, 8, 8, 8, 8, -1); aniRedDisk = Array(20, -1); +#endif + InitPseudoCompileFlags(); UserDragFlag = False; AutoScrollFlag = True; diff --git a/src/game_sp/Globals.h b/src/game_sp/Globals.h index 64f3230c..641d979c 100644 --- a/src/game_sp/Globals.h +++ b/src/game_sp/Globals.h @@ -129,6 +129,18 @@ extern byte *PlayField8; extern char *CurPath, *OrigPath, *TmpPath; extern currency DeltaT; extern int *PlayField16; + +#if 1 +extern int aniBug[], aniZonkRollRight[], aniZonkRollLeft[]; +extern int aniEatInfotronLeft[], aniEatInfotronRight[]; +extern int aniInfotronRollRight[], aniInfotronRollLeft[]; +extern int aniMurphyEatLeft[], aniMurphyEatRight[]; +extern int aniMurphyEatUpLeft[], aniMurphyEatUpRight[], aniSplitUpDown[]; +extern int aniMurphyExit[]; +extern int aniSnikSnak[], aniElectron[], aniExplosion[]; +extern int aniTouchBase[], aniTouchInfotron[], aniTouchRedDisk[]; +extern int aniYellowDisk[], aniOrangeDisk[], aniRedDisk[]; +#else extern int *aniBug, *aniZonkRollRight, *aniZonkRollLeft; extern int *aniEatInfotronLeft, *aniEatInfotronRight; extern int *aniInfotronRollRight, *aniInfotronRollLeft; @@ -138,6 +150,8 @@ extern int *aniMurphyExit; extern int *aniSnikSnak, *aniElectron, *aniExplosion; extern int *aniTouchBase, *aniTouchInfotron, *aniTouchRedDisk; extern int *aniYellowDisk, *aniOrangeDisk, *aniRedDisk; +#endif + extern int FieldHeight; extern int FieldMax, LevelMax; extern int FieldWidth; diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index 9cb124e5..8022080a 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -818,6 +818,9 @@ static void Let_LastSaveFilter(long NewVal) static void CountDown(long HalfSeconds, int bDisplayBar) { + +#if 0 + long i; int k; long dT, Delta; @@ -857,6 +860,9 @@ static void CountDown(long HalfSeconds, int bDisplayBar) shpProgress.Visible = False; // lblFrameCount = 0 + +#endif + } #if 0 @@ -2404,7 +2410,9 @@ void menPlay_Click() #endif LastFrame = 0; - LastTick = T.TickNow; +#if 0 + LastTick = T.TickNow(); +#endif #if 0 diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index 2852dd06..6bc494ff 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -28,8 +28,10 @@ int subMainGameLoop() // int al, bx; int bx; +#if 0 TickCountObject Clock; currency LastFrame; +#endif if (DemoFlag != 0) { @@ -86,10 +88,16 @@ locRepeatMainGameLoop: // start repeating game loop { DoEvents(); // user may klick on menus or move the window here ... } +#if 1 + while (0); +#else while (Clock.TickDiffUS(LastFrame) < DeltaT); // wait till its time for the next frame +#endif // never any additional code between here! - LastFrame = Clock.TickNow; // store the frame time +#if 0 + LastFrame = Clock.TickNow(); // store the frame time +#endif // never any additional code between here! if (! NoDisplayFlag) // copy the BackBuffer(=Stage) to visible screen Stage.Blt(); @@ -189,7 +197,11 @@ locExitMainGameLoop: { DoEvents(); // user may klick on menus or move the window here ... } +#if 1 + while (0); +#else while (Clock.TickDiffUS(LastFrame) < DeltaT); // wait till its time for the next frame +#endif Stage.Blt(); // blit the last frame GameLoopRunning = 0; diff --git a/src/game_sp/Sound.c b/src/game_sp/Sound.c index 61c82b00..4bb52084 100644 --- a/src/game_sp/Sound.c +++ b/src/game_sp/Sound.c @@ -19,10 +19,11 @@ DirectSoundBuffer PushFX; DirectSoundBuffer ExitFX; DirectSoundBuffer BaseFX; -#if 0 - void LoadSoundFX() { + +#if 0 + DSBUFFERDESC bufferDesc; WAVEFORMATEX waveFormat; char *FName; @@ -48,10 +49,11 @@ void LoadSoundFX() ExitFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Exit.wav"), bufferDesc, waveFormat); PushFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Push.wav"), bufferDesc, waveFormat); // FXOnFlag = 0 -} #endif +} + void subSoundFXZonk() { int i; diff --git a/src/game_sp/init.c b/src/game_sp/init.c index 1c36d12b..0f380e58 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -8,12 +8,23 @@ Bitmap *sp_objects; Bitmap *screenBitmap; +static void BlitScreenToBitmap_SP__Stage_Blt() +{ + BlitScreenToBitmap_SP(window); +} + void sp_open_all() { SetBitmaps_SP(&sp_objects); screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, DEFAULT_DEPTH); + + StretchedSprites.BltEx = &DDSpriteBuffer_BltEx; + + DDSpriteBuffer_CreateFromFile("[NONE]", 16, 16); + + Stage.Blt = &BlitScreenToBitmap_SP__Stage_Blt; } void sp_close_all() diff --git a/src/game_sp/main.c b/src/game_sp/main.c index 74902a0c..306273d1 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -10,6 +10,8 @@ void InitGameEngine_SP() void BlitScreenToBitmap_SP(Bitmap *target_bitmap) { + BlitBitmap(screenBitmap, target_bitmap, 0, 0, + SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY); } void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode) diff --git a/src/game_sp/vb_types.h b/src/game_sp/vb_types.h index ae6ca089..39b23d0e 100644 --- a/src/game_sp/vb_types.h +++ b/src/game_sp/vb_types.h @@ -164,7 +164,7 @@ typedef struct { void (*DelayMS)(long, boolean); double (*TickDiffUS)(double); - double TickNow; + double (*TickNow)(); } TickCountObject; typedef struct