rnd-19981204-1
[rocksndiamonds.git] / src / tools.c
index e6b8d9a9cb5f81de40340ab318b64ce60935f2f1..d2645960674a93a8112d1c9b9db28fe0bf379cbe 100644 (file)
@@ -89,11 +89,13 @@ void BackToFront()
      this could mean that we have to wait for the graphics to complete,
      although we could go on doing calculations for the next frame */
 
-  XSync(display,FALSE);
+  XSync(display, FALSE);
 
+  /*
 #ifdef MSDOS
   wait_for_vsync = TRUE;
 #endif
+  */
 
   if (redraw_mask & REDRAW_ALL)
   {
@@ -115,13 +117,15 @@ void BackToFront()
 
       if (setup.soft_scrolling)
       {
-       fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
-       fy += (ScreenMovDir & (MV_UP|MV_DOWN)    ? ScreenGfxPos : 0);
+       fx += (ScreenMovDir & (MV_LEFT | MV_RIGHT) ? ScreenGfxPos : 0);
+       fy += (ScreenMovDir & (MV_UP | MV_DOWN)    ? ScreenGfxPos : 0);
       }
 
-      XCopyArea(display,buffer,window,gc,
-               fx,fy, SXSIZE,SYSIZE,
-               SX,SY);
+      if (setup.soft_scrolling ||
+         ABS(ScreenGfxPos) + ScrollStepSize == TILEX ||
+         ABS(ScreenGfxPos) == ScrollStepSize ||
+         redraw_tiles > REDRAWTILES_THRESHOLD)
+       XCopyArea(display, buffer, window, gc, fx, fy, SXSIZE, SYSIZE, SX, SY);
     }
     redraw_mask &= ~REDRAW_MAIN;
   }
@@ -827,6 +831,8 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic,
     src_x  = (graphic % HEROES_PER_LINE) * TILEX + cx;
     src_y  = (graphic / HEROES_PER_LINE) * TILEY + cy;
   }
+  else /* big font graphics currently not allowed (and not needed) */
+    return;
 
   dest_x = FX + x * TILEX + dx;
   dest_y = FY + y * TILEY + dy;
@@ -1338,11 +1344,13 @@ boolean Request(char *text, unsigned int req_state)
   int mx, my, ty, result = -1;
   unsigned int old_door_state;
 
+#ifndef MSDOS
   /* pause network game while waiting for request to answer */
   if (options.network &&
       game_status == PLAYING &&
       req_state & REQUEST_WAIT_FOR)
     SendToServer_PausePlaying();
+#endif
 
   old_door_state = GetDoorState();
 
@@ -1544,11 +1552,13 @@ boolean Request(char *text, unsigned int req_state)
     }
   }
 
+#ifndef MSDOS
   /* continue network game after request */
   if (options.network &&
       game_status == PLAYING &&
       req_state & REQUEST_WAIT_FOR)
     SendToServer_ContinuePlaying();
+#endif
 
   return(result);
 }
@@ -1591,11 +1601,11 @@ unsigned int GetDoorState()
 
 unsigned int MoveDoor(unsigned int door_state)
 {
-  static unsigned int door1 = DOOR_OPEN_1;
-  static unsigned int door2 = DOOR_CLOSE_2;
-  static long door_delay = 0;
+  static int door1 = DOOR_OPEN_1;
+  static int door2 = DOOR_CLOSE_2;
+  static unsigned long door_delay = 0;
   int x, start, stepsize = 2;
-  long door_delay_value = stepsize * 5;
+  unsigned long door_delay_value = stepsize * 5;
 
   if (door_state == DOOR_GET_STATE)
     return(door1 | door2);