fixed compiler warnings (after adding "-Wstrict-prototypes")
[rocksndiamonds.git] / src / game_sp / MainForm.c
index c54bf63d21a3dbfd774b58b12ccd38dda746d2ce..85f7a12988e2efc6a13d945c175b845b2b68279d 100644 (file)
@@ -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,7 +168,7 @@ static void ReStretch()
   ScrollTo(ScreenScrollXPos, ScreenScrollYPos);
 }
 
-void SetScrollEdges()
+void SetScrollEdges(void)
 {
   int border1_offset = (menBorder ? 1 : 2);
   int border2_offset = (menBorder ? 0 : TILESIZE / 2);
@@ -193,8 +176,8 @@ void SetScrollEdges()
   /* scroll correction for border frame (1 tile) or border element (2 tiles) */
   ScrollMinX = 0;
   ScrollMinY = 0;
-  ScrollMaxX = (DisplayMaxX + border1_offset) * TILEX - SXSIZE;
-  ScrollMaxY = (DisplayMaxY + border1_offset) * TILEY - SYSIZE;
+  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;
@@ -207,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)
@@ -273,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;
   }
 }