rnd-20071004-1-src
authorHolger Schemel <info@artsoft.org>
Wed, 3 Oct 2007 22:39:38 +0000 (00:39 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:56:30 +0000 (10:56 +0200)
* version 3.2.5 released as special edition "R'n'D jue"
* changed build system to support special editions (like "R'n'D jue")
* added (hardcoded) loading graphics for "R'n'D jue" special edition

ChangeLog
Makefile
src/Makefile
src/conftime.h
src/init.c

index dc8abd1e3c6305395b19a2aa78c0017e189f1c8d..89bd8d79eb5f0609ade954c104a36291433d9c81 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-04
+       * version 3.2.5 released as special edition "R'n'D jue"
+
+2007-10-04
+       * changed build system to support special editions (like "R'n'D jue")
+       * added (hardcoded) loading graphics for "R'n'D jue" special edition
+
 2007-09-27
        * added "background.PLAYING" (only visible as two-pixel border in game)
        * added default level set for first start of special R'n'D version
index a2ceff1dcece4a670382bc03b409963e001423e9..8fb5f1d9b91725e60d5f596881bafb5ce99a2a72 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ CROSS_PATH_MSDOS = /usr/local/cross-msdos/i386-msdosdjgpp
 CROSS_PATH_WIN32 = /usr/local/cross-tools/i386-mingw32msvc
 
 # compile special edition of R'n'D instead of the normal (classic) version
-SPECIAL_EDITION = rnd_jue
+SPECIAL_EDITION = rnd_jue
 
 
 # -----------------------------------------------------------------------------
@@ -107,13 +107,13 @@ auto-conf:
        @$(MAKE_CMD) auto-conf
 
 run: all
-       @./rocksndiamonds --verbose
+       @$(MAKE_CMD) run
 
 gdb: all
-       @gdb -batch -x GDB_COMMANDS ./rocksndiamonds
+       @$(MAKE_CMD) gdb
 
 valgrind: all
-       @valgrind -v --leak-check=yes ./rocksndiamonds 2> valgrind.out
+       @$(MAKE_CMD) valgrind
 
 enginetest: all
        ./Scripts/make_enginetest.sh
index a7c587c2c5ce7b4ccd1e5ff9590cdfeb9b637fbc..19d54bb0ab92144f1c5062e215fbfde3dc3c9fe3 100644 (file)
@@ -306,6 +306,20 @@ clean-bin:
 clean: clean-obj clean-ico clean-bin
 
 
+# -----------------------------------------------------------------------------
+# run and test targets
+# -----------------------------------------------------------------------------
+
+run: all
+       $(PROGNAME) --verbose
+
+gdb: all
+       gdb -batch -x ../GDB_COMMANDS $(PROGNAME)
+
+valgrind: all
+       valgrind -v --leak-check=yes $(PROGNAME) 2> ../valgrind.out
+
+
 # -----------------------------------------------------------------------------
 # development only
 # -----------------------------------------------------------------------------
index f37b12c244e672000b7feef93d1d7056e8bb85af..33a791ff62da3605e8560ab1fb701fbab0a6462e 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2007-09-30 19:56"
+#define COMPILE_DATE_STRING "2007-10-03 23:58"
index 5d1867a2a1af1f37e1174e091fbaa706ae7ba82e..c0afcfff25956f44b715ee1ae9934ed64aa2af04 100644 (file)
@@ -201,24 +201,41 @@ void DrawInitAnim()
   y = WIN_YSIZE / 2 - TILESIZE / 2;
 #endif
 
+  graphic_info = &anim_initial;                /* graphic == 0 => anim_initial */
+
 #if 0
   {
     static boolean done = FALSE;
 
-    if (!done)
-      printf("::: %d, %d, %d, %d => %d, %d\n",
+    // if (!done)
+      printf("::: %d, %d, %d, %d => %d, %d [%d, %d] [%d, %d]\n",
             init.busy.x, init.busy.y,
             init.busy.align, init.busy.valign,
-            x, y);
+            x, y,
+            graphic_info[graphic].width,
+            graphic_info[graphic].height,
+            sync_frame, anim_initial.anim_delay);
 
     done = TRUE;
   }
 #endif
 
-  graphic_info = &anim_initial;                /* graphic == 0 => anim_initial */
-
   if (sync_frame % anim_initial.anim_delay == 0)
+  {
+#if 1
+    Bitmap *src_bitmap;
+    int src_x, src_y;
+    int width = graphic_info[graphic].width;
+    int height = graphic_info[graphic].height;
+    int frame = getGraphicAnimationFrame(graphic, sync_frame);
+
+    getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
+    BlitBitmap(src_bitmap, window, src_x, src_y, width, height, x, y);
+#else
+    /* !!! this can only draw TILEX/TILEY size animations !!! */
     DrawGraphicAnimationExt(window, x, y, graphic, sync_frame, NO_MASKING);
+#endif
+  }
 
   graphic_info = graphic_info_last;
 
@@ -1237,9 +1254,10 @@ static int get_scaled_graphic_height(int graphic)
   return original_height * scale_up_factor;
 }
 
-static void set_graphic_parameters_ext(int graphic, struct GraphicInfo *g,
-                                      int *parameter, Bitmap *src_bitmap)
+static void set_graphic_parameters_ext(int graphic, int *parameter,
+                                      Bitmap *src_bitmap)
 {
+  struct GraphicInfo *g = &graphic_info[graphic];
   int anim_frames_per_row = 1, anim_frames_per_col = 1;
   int anim_frames_per_line = 1;
 
@@ -1323,6 +1341,13 @@ static void set_graphic_parameters_ext(int graphic, struct GraphicInfo *g,
     int src_image_width  = get_scaled_graphic_width(graphic);
     int src_image_height = get_scaled_graphic_height(graphic);
 
+    if (src_image_width == 0 || src_image_height == 0)
+    {
+      /* only happens when loaded outside artwork system (like "global.busy") */
+      src_image_width  = src_bitmap->width;
+      src_image_height = src_bitmap->height;
+    }
+
     anim_frames_per_row = src_image_width  / g->width;
     anim_frames_per_col = src_image_height / g->height;
 
@@ -1485,8 +1510,7 @@ static void set_graphic_parameters(int graphic)
                                               image_config_suffix[i].token,
                                               image_config_suffix[i].type);
 
-  set_graphic_parameters_ext(graphic, &graphic_info[graphic],
-                            parameter, src_bitmap);
+  set_graphic_parameters_ext(graphic, parameter, src_bitmap);
 
 #else
 
@@ -5365,6 +5389,7 @@ static void InitMixer()
 
 void InitGfx()
 {
+  struct GraphicInfo *graphic_info_last = graphic_info;
   char *filename_font_initial = NULL;
   char *filename_anim_initial = NULL;
   Bitmap *bitmap_font_initial = NULL;
@@ -5498,13 +5523,38 @@ void InitGfx()
     }
   }
 
-  set_graphic_parameters_ext(0, &anim_initial, parameter, NULL);
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
+  filename_anim_initial = "loading.pcx";
+
+  parameter[GFX_ARG_X] = 0;
+  parameter[GFX_ARG_Y] = 0;
+  parameter[GFX_ARG_WIDTH] = 128;
+  parameter[GFX_ARG_HEIGHT] = 40;
+  parameter[GFX_ARG_FRAMES] = 32;
+  parameter[GFX_ARG_DELAY] = 4;
+  parameter[GFX_ARG_FRAMES_PER_LINE] = ARG_UNDEFINED_VALUE;
+#endif
 
   if (filename_anim_initial == NULL)   /* should not happen */
     Error(ERR_EXIT, "cannot get filename for '%s'", CONFIG_TOKEN_GLOBAL_BUSY);
 
   anim_initial.bitmap = LoadCustomImage(filename_anim_initial);
 
+  graphic_info = &anim_initial;                /* graphic == 0 => anim_initial */
+
+  set_graphic_parameters_ext(0, parameter, anim_initial.bitmap);
+
+#if 0
+  printf("::: INIT_GFX: anim_frames_per_line == %d [%d / %d] [%d, %d]\n",
+        graphic_info[0].anim_frames_per_line,
+        get_scaled_graphic_width(0),
+        graphic_info[0].width,
+        getOriginalImageWidthFromImageID(0),
+        graphic_info[0].scale_up_factor);
+#endif
+
+  graphic_info = graphic_info_last;
+
   init.busy.width  = anim_initial.width;
   init.busy.height = anim_initial.height;