From 0f5b7f63f2d3d75ba646795a3c1ea9fc4cee4845 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 22 Jul 2009 12:31:38 +0200 Subject: [PATCH] rnd-20090722-2-src --- src/conftime.h | 2 +- src/game_sp/DDScrollBuffer.c | 6 ++++++ src/game_sp/Globals.c | 26 +++++++++++++++++++++++++- src/game_sp/MainForm.c | 7 +------ src/game_sp/init.c | 4 ++-- src/game_sp/vb_lib.c | 8 ++++---- 6 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index 720ed637..208d098e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-07-22 00:34" +#define COMPILE_DATE_STRING "2009-07-22 12:30" diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 83601282..028af542 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -180,9 +180,15 @@ 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, SR.left, SR.top, SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY); +#endif return; #endif diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index 4da9c45b..36034f5b 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -397,11 +397,35 @@ void ReadLevel() for (i = 0; i <= FieldMax; i++) { - PlayField16[i] = PlayField8[i]; + PlayField16[i] = PlayField8[i]; DisPlayField[i] = PlayField8[i]; PlayField8[i] = 0; } +#if 0 + { + int x, y; + + for (x = 0; x < 60; x++) + printf("%02d.", x); + printf("\n"); + + for (x = 0; x < 60; x++) + printf("..."); + printf("\n"); + + for (y = 0; y < 24; y++) + { + for (x = 0; x < 60; x++) + { + printf("%02d.", PlayField16[y * 60 + x]); + } + + printf("\n"); + } + } +#endif + AnimationPosTable = REDIM_1D(sizeof(int), 0, LevelMax - 2 *FieldWidth); AnimationSubTable = REDIM_1D(sizeof(byte), 0, LevelMax - 2 *FieldWidth); TerminalState = REDIM_1D(sizeof(byte), FieldWidth, LevelMax - FieldWidth); diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index baa31b5e..5c3b85fd 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -3065,13 +3065,8 @@ static void SetScrollEdges() ScrollMinX = (int)(DisplayMinX - 0.5) * Stretch * BaseWidth; ScrollMinY = (int)(DisplayMinY - 0.5) * Stretch * BaseWidth; -#if 1 - ScrollMaxX = (int)(DisplayMaxX + 1.5) * Stretch * BaseWidth; - ScrollMaxY = (int)(DisplayMaxY + 1.5) * Stretch * BaseWidth; -#else ScrollMaxX = (int)(DisplayMaxX + 1.5) * Stretch * BaseWidth - picPane.Width; ScrollMaxY = (int)(DisplayMaxY + 1.5) * Stretch * BaseWidth - picPane.Height; -#endif #if 1 printf("::: MainForm.c: SetScrollEdges() done [%d, %d, %d, %d]\n", @@ -3165,7 +3160,7 @@ void DrawFieldNoAnimated(int X, int Y) #if 0 printf("::: MainForm.c: DrawFieldNoAnimated(): %d, %d [%d]\n", - X, Y, StretchWidth); + X, Y, Tmp); #endif StretchedSprites.BltEx(StretchWidth * X, StretchWidth * Y, Tmp); diff --git a/src/game_sp/init.c b/src/game_sp/init.c index 1324d8e3..736211c8 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -35,8 +35,8 @@ static void init_global_values() menPanel.Checked = True; menAutoScroll.Checked = True; - MainForm.picPane.Width = picPane.Width = 1935; - MainForm.picPane.Height = picPane.Height = 1635; + MainForm.picPane.Width = picPane.Width = SCR_FIELDX * TILEX; + MainForm.picPane.Height = picPane.Height = SCR_FIELDY * TILEY; } void sp_open_all() diff --git a/src/game_sp/vb_lib.c b/src/game_sp/vb_lib.c index c4df2cf3..d32a62f8 100644 --- a/src/game_sp/vb_lib.c +++ b/src/game_sp/vb_lib.c @@ -59,12 +59,12 @@ boolean STRING_IS_LIKE(char *a, char *b) } -void FILE_GET(FILE *a, int b, void *c, int d) +void FILE_GET(FILE *file, int offset, void *buffer, int num_bytes) { - fseek(a, b, SEEK_SET); + fseek(file, offset - 1, SEEK_SET); - while (d--) - *(byte *)c++ = fgetc(a); + while (num_bytes--) + *(byte *)buffer++ = fgetc(file); } int FILE_PUT(FILE *a, int b, void *c, int d) -- 2.34.1