rnd-20030407-2-src
authorHolger Schemel <info@artsoft.org>
Mon, 7 Apr 2003 21:59:22 +0000 (23:59 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:41:02 +0000 (10:41 +0200)
CHANGES
src/conftime.h
src/editor.c
src/files.c
src/init.c
src/tools.c

diff --git a/CHANGES b/CHANGES
index 01355225fd8a58dc795da132c39dd77355fe6938..3692cfdc1d40fc7e37a4734b75d58823dcd7e7b8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,16 @@
-Pre-Release Version 2.2.0rc3 [?? ??? ????]
+Pre-Release Version 2.2.0rc4 [?? ??? ????]
 ------------------------------------------
+       - added generic selectbox gadget
+       - added special mouse cursor for playfield while playing
+       - font handling now more flexible (support for ISO-Latin-1 fonts)
+
+Pre-Release Version 2.2.0rc3 [11 FEB 2003]
+------------------------------------------
+       - first custom element properties
+       - animation configuration for dynamically defined element actions
+       - automatically downscaled graphics (small graphics not needed anymore)
+       - ".EDITOR" and ".PREVIEW" suffixes for special editor/preview graphics
+       - toon animations (and number of toons) now fully configurable
 
 Pre-Release Version 2.2.0rc2 [13 JAN 2003]
 ------------------------------------------
index de44c3ea49ad1306439bc305c39f5daf9bd152f1..2d881d3506d421652767614f8d329b4dc2f0c0bc 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-04-07 00:31]"
+#define COMPILE_DATE_STRING "[2003-04-07 23:42]"
index f04834c09f390c9d11e76f78f2466775958317a5..5d931bd10770b67e65ff01d9197b68c4ffeb3e0b 100644 (file)
 #define ED_COUNTER_YDISTANCE           (3 * MINI_TILEY)
 #define ED_COUNTER_YPOS(n)             (ED_COUNTER_YSTART + \
                                         n * ED_COUNTER_YDISTANCE)
+#define ED_COUNTER_YPOS2(n)            (ED_COUNTER_YSTART + \
+                                        n * ED_COUNTER_YDISTANCE / 2)
 #define ED_COUNTER2_YPOS(n)            (ED_COUNTER_YSTART + \
                                         n * ED_COUNTER_YDISTANCE - 2)
+
 /* standard distances */
 #define ED_BORDER_SIZE                 3
 #define ED_GADGET_DISTANCE             2
@@ -744,31 +747,31 @@ static struct
     "slip down from certain flat walls","use EM style slipping behaviour"
   },
   {
-    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS(4),
+    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS2(10),
     GADGET_ID_CUSTOM_INDESTRUCTIBLE,
     &custom_element_properties[0].indestructible,
     "indestructible",                  "element cannot be destroyed"
   },
   {
-    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS(5),
+    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS2(11),
     GADGET_ID_CUSTOM_CAN_FALL,
     &custom_element_properties[0].can_fall,
     "can fall",                                "element can fall down"
   },
   {
-    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS(6),
+    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS2(12),
     GADGET_ID_CUSTOM_CAN_SMASH,
     &custom_element_properties[0].can_smash,
     "can smash",                       "element can smash other elements"
   },
   {
-    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS(7),
+    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS2(13),
     GADGET_ID_CUSTOM_PUSHABLE,
     &custom_element_properties[0].pushable,
     "pushable",                                "element can be pushed"
   },
   {
-    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS(8),
+    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS2(14),
     GADGET_ID_CUSTOM_SLIPPERY,
     &custom_element_properties[0].slippery,
     "slippery",                                "other elements can fall down from it"
@@ -3227,7 +3230,8 @@ static void DrawPropertiesWindow()
     }
   }
 
-  if (HAS_CONTENT(properties_element))
+  if (HAS_CONTENT(properties_element) ||
+      IS_CUSTOM_ELEMENT(properties_element))
   {
     /* draw stickybutton gadget */
     i = ED_CHECKBUTTON_ID_STICK_ELEMENT;
@@ -3239,10 +3243,13 @@ static void DrawPropertiesWindow()
                 GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
     MapCheckbuttonGadget(i);
 
-    if (IS_AMOEBOID(properties_element))
-      DrawAmoebaContentArea();
-    else
-      DrawElementContentAreas();
+    if (HAS_CONTENT(properties_element))
+    {
+      if (IS_AMOEBOID(properties_element))
+       DrawAmoebaContentArea();
+      else
+       DrawElementContentAreas();
+    }
   }
 
   if (IS_GEM(properties_element))
@@ -4555,8 +4562,12 @@ static void HandleControlButtons(struct GadgetInfo *gi)
 
        PickDrawingElement(button, new_element);
 
+#if 1
+       if (!stick_element_properties_window)
+#else
        if (!HAS_CONTENT(properties_element) ||
            !stick_element_properties_window)
+#endif
        {
          properties_element = new_element;
          if (edit_mode == ED_MODE_PROPERTIES)
index 15264d2d4e3a6eeea4f12a875469f3496d01dc16..588d9404d6302887a630ac3107ed612c79ee93f4 100644 (file)
@@ -515,6 +515,32 @@ void LoadLevelFromFilename(char *filename)
       level.em_slippery_gems = TRUE;
   }
 
+  /* map some elements which have changed in newer versions */
+  if (level.game_version <= VERSION_IDENT(2,2,0))
+  {
+    int x, y;
+
+    /* map game font elements */
+    for(y=0; y<level.fieldy; y++)
+    {
+      for(x=0; x<level.fieldx; x++)
+      {
+       int element = Ur[x][y];
+
+       if (element == EL_CHAR('['))
+         element = EL_CHAR_AUMLAUT;
+       else if (element == EL_CHAR('\\'))
+         element = EL_CHAR_OUMLAUT;
+       else if (element == EL_CHAR(']'))
+         element = EL_CHAR_UUMLAUT;
+       else if (element == EL_CHAR('^'))
+         element = EL_CHAR_COPYRIGHT;
+
+       Feld[x][y] = Ur[x][y] = element;
+      }
+    }
+  }
+
   /* determine border element for this level */
   SetBorderElement();
 }
index 40ecc4d759b37b0a7d8767933e494e83741a4390..14e64084727721f1cd7d94703ecef55ac271dd41 100644 (file)
@@ -576,7 +576,8 @@ static void set_graphic_parameters(int graphic, char **parameter_raw)
 {
   Bitmap *src_bitmap = getBitmapFromImageID(graphic);
   int parameter[NUM_GFX_ARGS];
-  int num_xtiles = 1, num_ytiles = 1;
+  int anim_frames_per_row = 1, anim_frames_per_col = 1;
+  int anim_frames_per_line = 1;
   int i;
 
   /* get integer values from string parameters */
@@ -615,19 +616,25 @@ static void set_graphic_parameters(int graphic, char **parameter_raw)
 
   if (src_bitmap)
   {
-    num_xtiles = src_bitmap->width  / graphic_info[graphic].width;
-    num_ytiles = src_bitmap->height / graphic_info[graphic].height;
+    anim_frames_per_row = src_bitmap->width  / graphic_info[graphic].width;
+    anim_frames_per_col = src_bitmap->height / graphic_info[graphic].height;
   }
 
   /* correct x or y offset dependant of vertical or horizontal frame order */
   if (parameter[GFX_ARG_VERTICAL])     /* frames are ordered vertically */
+  {
     graphic_info[graphic].offset_y =
       (parameter[GFX_ARG_OFFSET] != ARG_UNDEFINED_VALUE ?
        parameter[GFX_ARG_OFFSET] : graphic_info[graphic].height);
+    anim_frames_per_line = anim_frames_per_col;
+  }
   else                                 /* frames are ordered horizontally */
+  {
     graphic_info[graphic].offset_x =
       (parameter[GFX_ARG_OFFSET] != ARG_UNDEFINED_VALUE ?
        parameter[GFX_ARG_OFFSET] : graphic_info[graphic].width);
+    anim_frames_per_line = anim_frames_per_row;
+  }
 
   /* optionally, the x and y offset of frames can be specified directly */
   if (parameter[GFX_ARG_XOFFSET] != ARG_UNDEFINED_VALUE)
@@ -639,15 +646,15 @@ static void set_graphic_parameters(int graphic, char **parameter_raw)
   if (parameter[GFX_ARG_FRAMES] != ARG_UNDEFINED_VALUE)
     graphic_info[graphic].anim_frames = parameter[GFX_ARG_FRAMES];
   else if (parameter[GFX_ARG_XPOS] == 0 && !parameter[GFX_ARG_VERTICAL])
-    graphic_info[graphic].anim_frames =        num_xtiles;
+    graphic_info[graphic].anim_frames =        anim_frames_per_row;
   else if (parameter[GFX_ARG_YPOS] == 0 && parameter[GFX_ARG_VERTICAL])
-    graphic_info[graphic].anim_frames =        num_ytiles;
+    graphic_info[graphic].anim_frames =        anim_frames_per_col;
   else
     graphic_info[graphic].anim_frames = 1;
 
   graphic_info[graphic].anim_frames_per_line =
     (parameter[GFX_ARG_FRAMES_PER_LINE] != ARG_UNDEFINED_VALUE ?
-     parameter[GFX_ARG_FRAMES_PER_LINE] : graphic_info[graphic].anim_frames);
+     parameter[GFX_ARG_FRAMES_PER_LINE] : anim_frames_per_line);
 
   graphic_info[graphic].anim_delay = parameter[GFX_ARG_DELAY];
   if (graphic_info[graphic].anim_delay == 0)   /* delay must be at least 1 */
index b29cb819122cbc032a244d5f96c1f78151120222..8582ac846da647c0845d04e6fe45ce27cbfdb786 100644 (file)
@@ -779,13 +779,17 @@ void getGraphicSource(int graphic, int frame, Bitmap **bitmap, int *x, int *y)
 
   if (g->offset_y == 0)                /* frames are ordered horizontally */
   {
-    *x = g->src_x + (frame % g->anim_frames_per_line) * g->offset_x;
-    *y = g->src_y + (frame / g->anim_frames_per_line) * g->height;
+    int max_width = g->anim_frames_per_line * g->width;
+
+    *x = (g->src_x + frame * g->offset_x) % max_width;
+    *y = g->src_y + (g->src_x + frame * g->offset_x) / max_width * g->height;
   }
   else if (g->offset_x == 0)   /* frames are ordered vertically */
   {
-    *x = g->src_x + (frame / g->anim_frames_per_line) * g->width;
-    *y = g->src_y + (frame % g->anim_frames_per_line) * g->offset_y;
+    int max_height = g->anim_frames_per_line * g->height;
+
+    *x = g->src_x + (g->src_y + frame * g->offset_y) / max_height * g->width;
+    *y = (g->src_y + frame * g->offset_y) % max_height;
   }
   else                         /* frames are ordered diagonally */
   {