From: Holger Schemel Date: Sat, 24 Oct 2009 20:26:34 +0000 (+0200) Subject: rnd-20091024-2-src X-Git-Tag: 3.3.0.0^2~71 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=07d1e990ebdd1e5eca3d310f8e9b9a3a8411a4dd;p=rocksndiamonds.git rnd-20091024-2-src --- diff --git a/src/conftime.h b/src/conftime.h index 2f68db2d..7a9a4638 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-10-24 01:44" +#define COMPILE_DATE_STRING "2009-10-24 22:25" diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 09d03793..12344b80 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -131,7 +131,7 @@ void DDScrollBuffer_Cls(int BackColor) Buffer.BltColorFill(EmptyRect, BackColor); } -void DDScrollBuffer_Blt() +void DDScrollBuffer_Blt_Ext(Bitmap *target_bitmap) { RECT DR, SR; long tX, tY, L; @@ -181,12 +181,8 @@ void DDScrollBuffer_Blt() SR.left, SR.top, mScrollX, mScrollY, mDestXOff, mDestYOff); #endif -#if 0 - BlitBitmap(screenBitmap, window, - 1600, 320, - SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY); -#else - BlitBitmap(screenBitmap, window, +#if 1 + BlitBitmap(screenBitmap, target_bitmap, SR.left, SR.top, SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY); #endif @@ -305,6 +301,11 @@ void DDScrollBuffer_Blt() // BltEH: } +void DDScrollBuffer_Blt() +{ + DDScrollBuffer_Blt_Ext(window); +} + void DDScrollBuffer_ScrollTo(int X, int Y) { if (NoDisplayFlag) diff --git a/src/game_sp/DDScrollBuffer.h b/src/game_sp/DDScrollBuffer.h index cc77cf89..9f30e307 100644 --- a/src/game_sp/DDScrollBuffer.h +++ b/src/game_sp/DDScrollBuffer.h @@ -12,6 +12,7 @@ #include "global.h" +extern void DDScrollBuffer_Blt_Ext(Bitmap *); extern void DDScrollBuffer_Blt(); extern void DDScrollBuffer_Cls(int BackColor); extern long DDScrollBuffer_CreateAtSize(long Width, long Height, long hWndViewPort); diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index ca54d8bc..e7412265 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -201,6 +201,13 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY) printf("::: DDSpriteBuffer.c: Blt(): %d, %d\n", DR.left, DR.top); #endif +#if 0 + if (pX == 0 * StretchWidth && pY == 0 * StretchWidth) + printf("::: TEST: drawing topleft corner ...\n"); + if (pX == 59 * StretchWidth && pY == 23 * StretchWidth) + printf("::: TEST: drawing bottomright corner ...\n"); +#endif + #if 1 BlitBitmap(sp_objects, screenBitmap, SR.left, SR.top, diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index e73a7d53..4c4f7afe 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -632,8 +632,10 @@ void ReadLevel() LevelNumber = level_nr; +#if 0 if (!DemoFlag || !DemoAvailable) subRandomize(); +#endif LevelLoaded = True; } diff --git a/src/game_sp/Sound.h b/src/game_sp/Sound.h index ad337a3b..30baa6c4 100644 --- a/src/game_sp/Sound.h +++ b/src/game_sp/Sound.h @@ -2,8 +2,8 @@ // Sound.h // ---------------------------------------------------------------------------- -#ifndef SOUND_H -#define SOUND_H +#ifndef GAME_SP_SOUND_H +#define GAME_SP_SOUND_H #include "vb_types.h" #include "vb_defs.h" @@ -25,4 +25,4 @@ extern void subSoundFXZonk(); extern int FXOnFlag; extern int MusicOnFlag; -#endif /* SOUND_H */ +#endif /* GAME_SP_SOUND_H */ diff --git a/src/game_sp/file.c b/src/game_sp/file.c index 4e7b6bc0..7a0c2c87 100644 --- a/src/game_sp/file.c +++ b/src/game_sp/file.c @@ -101,8 +101,18 @@ void copyInternalEngineVars_SP() GravityFlag = LInfo.InitialGravity; FreezeZonks = LInfo.InitialFreezeZonks; +#if 1 + /* set by main game tape code directly */ +#else + +#if 1 + printf("::: file.c: copyInternalEngineVars_SP(): RandomSeed = LInfo.DemoRandomSeed\n"); +#endif + RandomSeed = LInfo.DemoRandomSeed; +#endif + LevelLoaded = True; } diff --git a/src/game_sp/global.h b/src/game_sp/global.h index cce27bbf..73a8282b 100644 --- a/src/game_sp/global.h +++ b/src/game_sp/global.h @@ -5,6 +5,8 @@ #ifndef GAME_SP_GLOBAL_H #define GAME_SP_GLOBAL_H +#include "main_sp.h" + #include "ASM.h" #include "BitMapObject.h" #include "BugsTerminals.h" @@ -44,8 +46,4 @@ #include "modGeneralTricks.h" #include "modMPX.h" - -#include "main_sp.h" - - #endif /* GAME_SP_GLOBAL_H */ diff --git a/src/game_sp/init.c b/src/game_sp/init.c index 953b9ec8..d8e73a1d 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -7,21 +7,9 @@ Bitmap *sp_objects; Bitmap *screenBitmap; -#if 0 -static void BlitScreenToBitmap_SP__Stage_Blt() -{ - BlitScreenToBitmap_SP(window); -} -#endif - static void init_struct_functions() { -#if 1 - Stage.Blt = &DDScrollBuffer_Blt; -#else - Stage.Blt = &BlitScreenToBitmap_SP__Stage_Blt; -#endif - + Stage.Blt = &DDScrollBuffer_Blt; Stage.ScrollTo = &DDScrollBuffer_ScrollTo; Stage.ScrollTowards = &DDScrollBuffer_ScrollTowards; Stage.SoftScrollTo = &DDScrollBuffer_SoftScrollTo; @@ -49,6 +37,9 @@ void sp_open_all() SetBitmaps_SP(&sp_objects); #if 1 + /* too small for oversized levels, but too big for graphics performance */ + /* (the whole playfield is drawn/updated, not only visible/scrolled area) */ + /* !!! FIX THIS !!! */ screenBitmap = CreateBitmap(60 * TILEX, 24 * TILEY, DEFAULT_DEPTH); #else @@ -67,6 +58,10 @@ unsigned int InitEngineRandom_SP(long seed) { if (seed == NEW_RANDOMIZE) { +#if 1 + printf("::: init.c: InitEngineRandom_SP(): subRandomize()\n"); +#endif + subRandomize(); seed = (long)RandomSeed; @@ -74,5 +69,9 @@ unsigned int InitEngineRandom_SP(long seed) RandomSeed = (short)seed; +#if 1 + printf("::: init.c: InitEngineRandom_SP(): RandomSeed == %d\n", RandomSeed); +#endif + return (unsigned int) seed; } diff --git a/src/game_sp/main.c b/src/game_sp/main.c index 9f343318..be2cb29f 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -11,7 +11,7 @@ void InitGameEngine_SP() game_sp_info.LevelSolved = FALSE; game_sp_info.GameOver = FALSE; -#if 0 +#if 1 menPlay_Click(); #else menPlayDemo_Click(); @@ -20,8 +20,7 @@ void InitGameEngine_SP() void BlitScreenToBitmap_SP(Bitmap *target_bitmap) { - BlitBitmap(screenBitmap, target_bitmap, 15 * 32, 7 * 32, - SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY); + DDScrollBuffer_Blt_Ext(target_bitmap); } void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode)