rocksndiamonds-2.1.0
authorHolger Schemel <info@artsoft.org>
Mon, 5 Aug 2002 02:01:14 +0000 (04:01 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:38:02 +0000 (10:38 +0200)
CHANGES
src/Makefile
src/conftime.h
src/init.c
src/libgame/sdl.c
src/libgame/setup.c
src/libgame/setup.h

diff --git a/CHANGES b/CHANGES
index c5e1c905435ad709e8a05c53d6ea25d849c051ef..6112c0b02cec3bd4e935b69af2632bef23dd93e3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
-Release Version 2.1.0 [XX XXX XXXX]
+Release Version 2.1.0 [05 AUG 2002]
 -----------------------------------
+       - native Mac OS X port (finally!)
        - graphics, sounds and music now fully configurable
        - added support for TrueColor PCX graphics files
        - added support for 16 bit WAV sound files
@@ -16,6 +17,13 @@ Release Version 2.1.0 [XX XXX XXXX]
        - fixed memory leak in image loading code
        - fixed some "solid" elements that were accidentally destructible
        - fixed some tape stuff
+       - added new contributed levels from the following players:
+         + Conor Mancone
+         + Gavin Davidson
+         + Jerome Kunegis
+         + Rüdiger Schäfer
+         + Flyboy: level group "Cops and Robbers", with own graphics set
+       - added custom graphics set "Animal Kingdom" by Flyboy
 
 Release Version 2.0.1 [19 MAR 2002]
 -----------------------------------
index ad10d1fea9d186bbe6456f27d52b9dc0e07761d0..e935b51d4715fd8bc1c6fababb8cbf01e98f710a 100644 (file)
@@ -49,7 +49,6 @@ PLATFORM = unix
 endif
 
 ifeq ($(PLATFORM),macosx)
-# PROGNAME = ../Rocks\'n\'Diamonds.app/Contents/MacOS/$(PROGBASE)
 PLATFORM = unix
 TARGET=sdl
 endif
@@ -103,7 +102,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 6379b4f9e82c26fc5f15116f13362ea7e3cebded..28ed84b5ef205e14ceb3a1a2927a797a39127ff6 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-07-31 22:20]"
+#define COMPILE_DATE_STRING "[2002-08-05 02:26]"
index 41bdc3604a698e15300013591b71861fd74cabd9..0e1fc339e647669f08750afa9b4a67888a66e916 100644 (file)
@@ -1680,10 +1680,11 @@ void Execute_Debug_Command(char *command)
 {
   if (strcmp(command, "create graphicsinfo.conf") == 0)
   {
-    printf("# (Currently only the \"name\" directive is recognized.)\n");
+    printf("# (Currently only \"name\" and \"sort_priority\" recognized.)\n");
     printf("\n");
     printf("%s\n", getFormattedSetupEntry("name", "Classic Graphics"));
     printf("\n");
+    printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
   }
   else if (strcmp(command, "create soundsinfo.conf") == 0)
   {
@@ -1694,6 +1695,8 @@ void Execute_Debug_Command(char *command)
     printf("\n");
     printf("%s\n", getFormattedSetupEntry("name", "Classic Sounds"));
     printf("\n");
+    printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
+    printf("\n");
 
     for (i=0; i<NUM_SOUND_EFFECTS; i++)
       printf("# %s\n",
@@ -1702,10 +1705,11 @@ void Execute_Debug_Command(char *command)
   }
   else if (strcmp(command, "create musicinfo.conf") == 0)
   {
-    printf("# (Currently only the \"name\" directive is recognized.)\n");
+    printf("# (Currently only \"name\" and \"sort_priority\" recognized.)\n");
     printf("\n");
     printf("%s\n", getFormattedSetupEntry("name", "Classic Music"));
     printf("\n");
+    printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
   }
 }
 
index 14d4830b00587c9ef9ce43a0b132379b330b22df..212ce1b86c59493753cf8262050c547b9e3b1ae1 100644 (file)
@@ -872,7 +872,7 @@ inline void SDLOpenAudio(void)
     return;
   }
 
-  if (Mix_OpenAudio(DEFAULT_AUDIO_SAMPLE_RATE, AUDIO_S16,
+  if (Mix_OpenAudio(DEFAULT_AUDIO_SAMPLE_RATE, MIX_DEFAULT_FORMAT,
                    AUDIO_NUM_CHANNELS_STEREO,
                    DEFAULT_AUDIO_FRAGMENT_SIZE) < 0)
   {
index 2567ebb1de35e0e874557384db81d37eeefa04e4..c6450a664319e8b237c2b4bce0493aebc9d76cb3 100644 (file)
@@ -80,6 +80,18 @@ static char *levelclass_desc[NUM_LEVELCLASS_DESC] =
                         IS_LEVELCLASS_USER(n) ?                7 : \
                         9)
 
+#define ARTWORKCOLOR(n)        (IS_ARTWORKCLASS_CLASSICS(n) ?          FC_RED : \
+                        IS_ARTWORKCLASS_CONTRIBUTION(n) ?      FC_YELLOW : \
+                        IS_ARTWORKCLASS_LEVEL(n) ?             FC_GREEN : \
+                        IS_ARTWORKCLASS_USER(n) ?              FC_RED : \
+                        FC_BLUE)
+
+#define ARTWORKSORTING(n) (IS_ARTWORKCLASS_CLASSICS(n) ?       0 : \
+                        IS_ARTWORKCLASS_CONTRIBUTION(n) ?      1 : \
+                        IS_ARTWORKCLASS_LEVEL(n) ?             2 : \
+                        IS_ARTWORKCLASS_USER(n) ?              3 : \
+                        9)
+
 #define TOKEN_VALUE_POSITION           40
 #define TOKEN_COMMENT_POSITION         60
 
@@ -669,8 +681,8 @@ void dumpTreeInfo(TreeInfo *node, int depth)
     for (i=0; i<(depth + 1) * 3; i++)
       printf(" ");
 
-    printf("filename == '%s' (%s) [%s]\n",
-          node->filename, node->name, node->name_short);
+    printf("filename == '%s' (%s) [%s] (%d)\n",
+          node->filename, node->name, node->name_short, node->sort_priority);
 
     if (node->node_group != NULL)
       dumpTreeInfo(node->node_group, depth + 1);
@@ -1322,8 +1334,20 @@ static int compareTreeInfoEntries(const void *object1, const void *object2)
 {
   const TreeInfo *entry1 = *((TreeInfo **)object1);
   const TreeInfo *entry2 = *((TreeInfo **)object2);
+  int class_sorting1, class_sorting2;
   int compare_result;
 
+  if (entry1->type == TREE_TYPE_LEVEL_DIR)
+  {
+    class_sorting1 = LEVELSORTING(entry1);
+    class_sorting2 = LEVELSORTING(entry2);
+  }
+  else
+  {
+    class_sorting1 = ARTWORKSORTING(entry1);
+    class_sorting2 = ARTWORKSORTING(entry2);
+  }
+
   if (entry1->parent_link || entry2->parent_link)
     compare_result = (entry1->parent_link ? -1 : +1);
   else if (entry1->sort_priority == entry2->sort_priority)
@@ -1336,10 +1360,10 @@ static int compareTreeInfoEntries(const void *object1, const void *object2)
     free(name1);
     free(name2);
   }
-  else if (LEVELSORTING(entry1) == LEVELSORTING(entry2))
+  else if (class_sorting1 == class_sorting2)
     compare_result = entry1->sort_priority - entry2->sort_priority;
   else
-    compare_result = LEVELSORTING(entry1) - LEVELSORTING(entry2);
+    compare_result = class_sorting1 - class_sorting2;
 
   return compare_result;
 }
@@ -1660,7 +1684,7 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first,
     (artwork_new->basepath == OPTIONS_ARTWORK_DIRECTORY(type) ? FALSE : TRUE);
 
   /* (may use ".sort_priority" from "setup_file_list" above) */
-  artwork_new->color = LEVELCOLOR(artwork_new);
+  artwork_new->color = ARTWORKCOLOR(artwork_new);
   artwork_new->class_desc = getLevelClassDescription(artwork_new);
 
   if (setup_file_list == NULL) /* (after determining ".user_defined") */
@@ -1673,15 +1697,15 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first,
       if (artwork_new->user_defined)
       {
        artwork_new->name = getStringCopy("private");
-       artwork_new->sort_priority = LEVELCLASS_USER;
+       artwork_new->sort_priority = ARTWORKCLASS_USER;
       }
       else
       {
        artwork_new->name = getStringCopy("classic");
-       artwork_new->sort_priority = LEVELCLASS_CLASSICS;
+       artwork_new->sort_priority = ARTWORKCLASS_CLASSICS;
       }
 
-      artwork_new->color = LEVELCOLOR(artwork_new);
+      artwork_new->color = ARTWORKCOLOR(artwork_new);
       artwork_new->class_desc = getLevelClassDescription(artwork_new);
     }
     else
index 5096f2b7d0c504eea9cc07de0ffbcf0897ba17fd..f299f3d9ab5e514e3f3bef215b855f9b79eb6eec 100644 (file)
@@ -134,6 +134,42 @@ struct TokenInfo
                         IS_LEVELCLASS_DX(n) ? LEVELCLASS_DX : \
                         LEVELCLASS_UNDEFINED)
 
+/* sort priorities of artwork */
+#define ARTWORKCLASS_CLASSICS_START    100
+#define ARTWORKCLASS_CLASSICS_END      199
+#define ARTWORKCLASS_CONTRIBUTION_START        200
+#define ARTWORKCLASS_CONTRIBUTION_END  299
+#define ARTWORKCLASS_LEVEL_START       300
+#define ARTWORKCLASS_LEVEL_END         399
+#define ARTWORKCLASS_USER_START                400
+#define ARTWORKCLASS_USER_END          499
+
+#define ARTWORKCLASS_CLASSICS          ARTWORKCLASS_CLASSICS_START
+#define ARTWORKCLASS_CONTRIBUTION      ARTWORKCLASS_CONTRIBUTION_START
+#define ARTWORKCLASS_LEVEL             ARTWORKCLASS_LEVEL_START
+#define ARTWORKCLASS_USER              ARTWORKCLASS_USER_START
+
+#define ARTWORKCLASS_UNDEFINED         999
+
+#define IS_ARTWORKCLASS_CLASSICS(p) \
+       ((p)->sort_priority >= ARTWORKCLASS_CLASSICS_START && \
+        (p)->sort_priority <= ARTWORKCLASS_CLASSICS_END)
+#define IS_ARTWORKCLASS_CONTRIBUTION(p) \
+       ((p)->sort_priority >= ARTWORKCLASS_CONTRIBUTION_START && \
+        (p)->sort_priority <= ARTWORKCLASS_CONTRIBUTION_END)
+#define IS_ARTWORKCLASS_LEVEL(p) \
+       ((p)->sort_priority >= ARTWORKCLASS_LEVEL_START && \
+        (p)->sort_priority <= ARTWORKCLASS_LEVEL_END)
+#define IS_ARTWORKCLASS_USER(p) \
+       ((p)->sort_priority >= ARTWORKCLASS_USER_START && \
+        (p)->sort_priority <= ARTWORKCLASS_USER_END)
+
+#define ARTWORKCLASS(n)        (IS_ARTWORKCLASS_CLASSICS(n) ? ARTWORKCLASS_CLASSICS :\
+                        IS_ARTWORKCLASS_CONTRIBUTION(n) ? ARTWORKCLASS_CONTRIBUTION : \
+                        IS_ARTWORKCLASS_LEVEL(n) ? ARTWORKCLASS_LEVEL : \
+                        IS_ARTWORKCLASS_USER(n) ? ARTWORKCLASS_USER : \
+                        ARTWORKCLASS_UNDEFINED)
+
 
 char *getLevelFilename(int);
 char *getTapeFilename(int);