rocksndiamonds-3.2.4
authorHolger Schemel <info@artsoft.org>
Thu, 13 Sep 2007 21:32:39 +0000 (23:32 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:56:16 +0000 (10:56 +0200)
ChangeLog
src/Makefile
src/cartoons.c
src/conftime.h
src/game_em/Makefile
src/init.c
src/libgame/toons.c
src/main.c
src/main.h

index d78b386a5416c1352d81b4a7fb1e476d1ee354b8..094f98477ef8a1d5263fdead502d719e5757931e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,8 @@
 2007-09-13
-       * version number set to 3.2.5
+       * version 3.2.4 released
 
 2007-09-13
-       * version 3.2.4 released
+       * fixed crash bug in toon drawing functions for large step offset values
 
 2007-09-12
        * fixed some problems with displaying game panel when quick-loading tape
index 8d8df9422341556b7b0d5c2ce7a059ed7a01bba2..9fb3a9a961770a329c13d3109410f84c5348b349 100644 (file)
@@ -126,7 +126,7 @@ CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
 
 
 CONFIG = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(JOYSTICK)
-DEBUG = -DDEBUG -g
+DEBUG = -DDEBUG -g
 # PROFILING = $(PROFILING_FLAGS)
 
 # OPTIONS = $(DEBUG) -Wall                     # only for debugging purposes
index ee56a8df3fe7fff10513604830261190f23f72f9..70d6d3d54ac6a8731eff3a45fd86483fa438b517 100644 (file)
@@ -80,7 +80,11 @@ void InitToons()
     toons[i].position = image->parameter[GFX_ARG_POSITION];
   }
 
+#if 1
+  InitToonScreen(bitmap_db_toons,
+#else
   InitToonScreen(bitmap_db_door,
+#endif
                 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
                 toons, num_toons,
                 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
index cfde0f5e346db14ce85791239f64f8c5d0a56e90..5926ae2cb526e780330bf9c780daf165a86646a9 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2007-09-13 00:56"
+#define COMPILE_DATE_STRING "2007-09-13 23:31"
index 4fc21cd0f12f70d64b654b99203430597c36e5e0..aec69d091a181b622e9c068441192bc77a5534d9 100644 (file)
@@ -1,7 +1,7 @@
 # =============================================================================
 # Rocks'n'Diamonds Makefile (game_em)
 # -----------------------------------------------------------------------------
-# (c) 1995-2006 Holger Schemel <info@artsoft.org>
+# (c) 1995-2005 Holger Schemel <info@artsoft.org>
 # -----------------------------------------------------------------------------
 # Emerald Mine for X11 © 2000,2001 David Tritscher
 # =============================================================================
index c41af9fb25ba1cdb4aeec37f96f9eea2226db704..512c2756d2bdb8478cc8d46a9ce99a7deaad5eca 100644 (file)
@@ -5413,6 +5413,7 @@ void InitGfx()
   bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
   bitmap_db_panel = CreateBitmap(DXSIZE, DYSIZE, DEFAULT_DEPTH);
   bitmap_db_door  = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH);
+  bitmap_db_toons = CreateBitmap(FULL_SXSIZE, FULL_SYSIZE, DEFAULT_DEPTH);
 
   /* initialize screen properties */
   InitGfxFieldInfo(SX, SY, SXSIZE, SYSIZE,
index d6d1c4cf95229fb1d7cabba3f3818e84de9771d1..2a233e4cbb847f1e3c101bfd7d78ad60c5f6cc4d 100644 (file)
@@ -125,21 +125,64 @@ void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc,
              int src_x, int src_y, int width, int height,
              int dest_x, int dest_y, int pad_x, int pad_y)
 {
-  int buf_x = DOOR_GFX_PAGEX3, buf_y = DOOR_GFX_PAGEY1;
+  int pad_dest_x = dest_x - pad_x;
+  int pad_dest_y = dest_y - pad_y;
+  int pad_width  = width  + 2 * pad_x;
+  int pad_height = height + 2 * pad_y;
+#if 1
+  int buffer_x = 0;
+  int buffer_y = 0;
+#else
+  int buffer_x = DOOR_GFX_PAGEX3;
+  int buffer_y = DOOR_GFX_PAGEY1;
+#endif
+
+#if 0
+  printf("::: (%d, %d), (%d, %d), (%d, %d), (%d, %d) -> (%d, %d), (%d, %d), (%d, %d)\n",
+        src_x, src_y,
+        width, height,
+        dest_x, dest_y,
+        pad_x, pad_y,
+
+        pad_dest_x, pad_dest_y,
+        pad_width, pad_height,
+        buffer_x, buffer_y);
+#endif
+
+  if (width == 0 || height == 0)
+    return;
+
+  /* correct values to avoid off-screen blitting (start position) */
+  if (pad_dest_x < screen_info.startx)
+  {
+    pad_width -= (screen_info.startx - pad_dest_x);
+    pad_dest_x = screen_info.startx;
+  }
+  if (pad_dest_y < screen_info.starty)
+  {
+    pad_height -= (screen_info.starty - pad_dest_y);
+    pad_dest_y = screen_info.starty;
+  }
+
+  /* correct values to avoid off-screen blitting (blit size) */
+  if (pad_width > screen_info.width)
+    pad_width = screen_info.width;
+  if (pad_height > screen_info.height)
+    pad_height = screen_info.height;
 
   /* special method to avoid flickering interference with BackToFront() */
-  BlitBitmap(backbuffer, screen_info.save_buffer, dest_x-pad_x, dest_y-pad_y,
-            width+2*pad_x, height+2*pad_y, buf_x, buf_y);
-  SetClipOrigin(toon_bitmap, toon_clip_gc, dest_x-src_x, dest_y-src_y);
-  BlitBitmapMasked(toon_bitmap, backbuffer,
-                  src_x, src_y, width, height, dest_x, dest_y);
-  BlitBitmap(backbuffer, window, dest_x-pad_x, dest_y-pad_y,
-            width+2*pad_x, height+2*pad_y, dest_x-pad_x, dest_y-pad_y);
+  BlitBitmap(backbuffer, screen_info.save_buffer, pad_dest_x, pad_dest_y,
+            pad_width, pad_height, buffer_x, buffer_y);
+  SetClipOrigin(toon_bitmap, toon_clip_gc, dest_x - src_x, dest_y - src_y);
+  BlitBitmapMasked(toon_bitmap, backbuffer, src_x, src_y, width, height,
+                  dest_x, dest_y);
+  BlitBitmap(backbuffer, window, pad_dest_x, pad_dest_y, pad_width, pad_height,
+            pad_dest_x, pad_dest_y);
 
   screen_info.update_function();
 
-  BlitBitmap(screen_info.save_buffer, backbuffer, buf_x, buf_y,
-           width+2*pad_x, height+2*pad_y, dest_x-pad_x, dest_y-pad_y);
+  BlitBitmap(screen_info.save_buffer, backbuffer, buffer_x, buffer_y,
+            pad_width, pad_height, pad_dest_x, pad_dest_y);
 
   FlushDisplay();
 }
@@ -220,7 +263,7 @@ boolean AnimateToon(int toon_nr, boolean restart)
       else
       {
        delta_y = -anim->step_offset;
-       pos_y = screen_info.width + delta_y;
+       pos_y = screen_info.height + delta_y;
       }
 
       delta_x = 0;
index 971ba9db160aea7d629599cede581215487335ee..a86ed44786697fa199b13b2a539126caa2ba3103 100644 (file)
@@ -24,6 +24,7 @@ Bitmap                       *bitmap_db_cross;
 Bitmap                *bitmap_db_field;
 Bitmap                *bitmap_db_panel;
 Bitmap                *bitmap_db_door;
+Bitmap                *bitmap_db_toons;
 DrawBuffer            *fieldbuffer;
 DrawBuffer            *drawto_field;
 
index 33b771ae3fab35293c398f3844299ba4df8d6bd4..69b9b501cdccf10d5ac49d4921d0978388a5d36b 100644 (file)
 /* program information and versioning definitions */
 #define PROGRAM_VERSION_MAJOR          3
 #define PROGRAM_VERSION_MINOR          2
-#define PROGRAM_VERSION_PATCH          5
-#define PROGRAM_VERSION_BUILD          0
+#define PROGRAM_VERSION_PATCH          4
+#define PROGRAM_VERSION_BUILD          3
 
 #define PROGRAM_TITLE_STRING           "Rocks'n'Diamonds"
 #define PROGRAM_AUTHOR_STRING          "Holger Schemel"
@@ -2686,6 +2686,7 @@ extern Bitmap                    *bitmap_db_cross;
 extern Bitmap                 *bitmap_db_field;
 extern Bitmap                 *bitmap_db_panel;
 extern Bitmap                 *bitmap_db_door;
+extern Bitmap                 *bitmap_db_toons;
 extern Pixmap                  tile_clipmask[];
 extern DrawBuffer             *fieldbuffer;
 extern DrawBuffer             *drawto_field;