X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FMainForm.c;h=85f7a12988e2efc6a13d945c175b845b2b68279d;hp=d2e401b049abaaf13977807ffa858ddbe97e288a;hb=115ce6f2da1914d68b0fe0e5f9082973190dacdd;hpb=1d3eff06cde10309320341fa92abec5b14f1c6f6 diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index d2e401b0..85f7a129 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -6,24 +6,22 @@ static void DrawFrame(int Delta); -static void ReStretch(); +static void ReStretch(void); void DrawField(int X, int Y); void DrawFieldAnimated(int X, int Y); void DrawFieldNoAnimated(int X, int Y); -void DrawFrameIfNeeded() +void DrawFrameIfNeeded(void) { DrawFrame(0); /* !!! CHECK THIS !!! */ -#if 1 if (! menBorder) DrawFrame(1); -#endif } -void DisplayLevel() +void DisplayLevel(void) { int X, Y; @@ -31,16 +29,9 @@ void DisplayLevel() return; ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); -#if 1 ClearRectangle(bitmap_db_field_sp, 0, 0, FXSIZE, FYSIZE); -#else - ClearRectangle(bitmap_db_field_sp, 0, 0, - MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY); -#endif -#if 1 SetDisplayRegion(); -#endif DrawFrameIfNeeded(); @@ -62,7 +53,7 @@ void DisplayLevel() } } -void Form_Load() +void Form_Load(void) { InitGlobals(); @@ -102,7 +93,7 @@ static void DrawFrame(int Delta) } } -static void RestoreFrame() +static void RestoreFrame(void) { int i, LX, tY, RX, BY; @@ -124,7 +115,7 @@ static void RestoreFrame() } } -void SetDisplayRegion() +void SetDisplayRegion(void) { if (! menBorder) { @@ -148,7 +139,7 @@ void SetDisplayRegion() } } -void menPlay_Click() +void menPlay_Click(void) { bPlaying = True; @@ -157,17 +148,9 @@ void menPlay_Click() ReStretch(); subMainGameLoop_Init(); - -#if 1 - return; -#endif - - bPlaying = False; - - subFetchAndInitLevel(); } -static void ReStretch() +static void ReStretch(void) { if (LevelLoaded) { @@ -185,25 +168,16 @@ static void ReStretch() ScrollTo(ScreenScrollXPos, ScreenScrollYPos); } -void SetScrollEdges() +void SetScrollEdges(void) { -#if NEW_TILESIZE - int pseudo_sxsize = SXSIZE * TILESIZE / TILESIZE_VAR; - int pseudo_sysize = SYSIZE * TILESIZE / TILESIZE_VAR; -#endif int border1_offset = (menBorder ? 1 : 2); int border2_offset = (menBorder ? 0 : TILESIZE / 2); /* scroll correction for border frame (1 tile) or border element (2 tiles) */ ScrollMinX = 0; ScrollMinY = 0; -#if NEW_TILESIZE - ScrollMaxX = (DisplayMaxX + border1_offset) * TILEX - pseudo_sxsize; - ScrollMaxY = (DisplayMaxY + border1_offset) * TILEY - pseudo_sysize; -#else - ScrollMaxX = (DisplayMaxX + border1_offset) * TILEX - SXSIZE; - ScrollMaxY = (DisplayMaxY + border1_offset) * TILEY - SYSIZE; -#endif + ScrollMaxX = (DisplayMaxX + border1_offset - SCR_FIELDX) * TILEX; + ScrollMaxY = (DisplayMaxY + border1_offset - SCR_FIELDY) * TILEY; /* scroll correction for border element (half tile on left and right side) */ ScrollMinX += border2_offset; @@ -216,12 +190,6 @@ void SetScrollEdges() ScrollMaxX -= game_sp.scroll_xoffset; ScrollMinY -= game_sp.scroll_yoffset; ScrollMaxY -= game_sp.scroll_yoffset; - -#if 0 - printf("::: (%ld, %ld), (%ld, %ld) -> (%d, %d), (%d, %d)\n", - DisplayMinX, DisplayMinY, DisplayMaxX, DisplayMaxY, - ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY); -#endif } void DrawField(int X, int Y) @@ -282,25 +250,7 @@ void DrawFieldNoAnimated(int X, int Y) break; default: -#if 1 DrawField(X, Y); -#else - if (Tmp < fiFirst || Tmp > fiLast) - Tmp = fiSpace; - - if (Tmp == fiRAM || - Tmp == fiHardWare || - Tmp == fiBug || - Tmp == fiWallSpace) - Tmp = DisPlayField[tsi]; - - subCopyImageToScreen(tsi, fiGraphic[Tmp]); - - if (Tmp != fiSpace && - Tmp != fiSnikSnak && - Tmp != fiElectron) - GfxGraphic[X][Y] = fiGraphic[Tmp]; -#endif break; } }