rnd-20031019-4-src
authorHolger Schemel <info@artsoft.org>
Sun, 19 Oct 2003 17:45:37 +0000 (19:45 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:44:21 +0000 (10:44 +0200)
* new boolean directive "latest_engine" for "levelinfo.conf": when set
  to "true", levels are always played with the latest game engine,
  which is desired for levels that are imported from other games; all
  other levels are played with the engine version stored in level file
  (which is normally the engine version the level was created with)

ChangeLog
Makefile
src/Makefile
src/conftime.h
src/files.c
src/libgame/Makefile
src/libgame/setup.c
src/libgame/setup.h
src/libgame/system.h

index f33feed453e099d2f955a2aacc8312497aa5dffb..a9e922ed4e8c1bbf53a8e501e4f423cdcd26dab4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-10-19
+       * new boolean directive "latest_engine" for "levelinfo.conf": when set
+         to "true", levels are always played with the latest game engine,
+         which is desired for levels that are imported from other games; all
+         other levels are played with the engine version stored in level file
+         (which is normally the engine version the level was created with)
+
 2003-10-18
        * fixed serious bug in code for delayed element pushing
        * fixed little bug in animation frame selection for pushed elements
index e0b9bcd9848ac9e039620ca2725494358564f75a..f047a8076d112e84c3d14e78602378e931ae8f71 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,48 +1,49 @@
-#=============================================================================#
-# Makefile for Rocks'n'Diamonds                                               #
-# (c) 1995-2002 Holger Schemel, info@artsoft.org                              #
-#=============================================================================#
+# =============================================================================
+# Rocks'n'Diamonds Makefile
+# -----------------------------------------------------------------------------
+# (c) 1995-2003 Holger Schemel <info@artsoft.org>
+# =============================================================================
 
-#-----------------------------------------------------------------------------#
-# configuration section                                                       #
-#-----------------------------------------------------------------------------#
+# -----------------------------------------------------------------------------
+# configuration
+# -----------------------------------------------------------------------------
 
-# specify command name of your favorite ANSI C compiler
+# command name of your favorite ANSI C compiler
 # (this must be set to "cc" for some systems)
 CC = gcc
 
-# specify command name of GNU make on your system
+# command name of GNU make on your system
 # (this must be set to "gmake" for some systems)
 MAKE = make
 
-# specify path to X11 on your system
+# path to X11 on your system
 X11_PATH = /usr/X11R6
 
-# specify directory for read-only game data (like graphics, sounds, levels)
-# default is '.', so you can play without installing game data somewhere
+# directory for read-only game data (like graphics, sounds, levels)
+# default is '.' to be able to run program without installation
 # RO_GAME_DIR = /usr/games
 
-# specify directory for writable game data (like highscore files)
-# default is '.', so you can play without installing game data somewhere
+# directory for writable game data (like highscore files)
+# default is '.' to be able to run program without installation
 # RW_GAME_DIR = /var/games
 
-# uncomment this if your system has no joystick include file
+# uncomment if system has no joystick include file
 # JOYSTICK = -DNO_JOYSTICK
 
-# choose if you want to allow many global score file entries for one player
-# default is 'MANY_PER_NAME'
-# when installing the game in a multi user environment, choose this
+# choose if more than one global score file entry for one player is allowed
+# (default: MANY_PER_NAME)
+# uncomment to install game in multi-user environment
 # SCORE_ENTRIES = ONE_PER_NAME
-# when installing the game in a single user environment, choose this
+# uncomment to install game in single-user environment (default)
 # SCORE_ENTRIES = MANY_PER_NAME
 
-# specify paths for cross-compiling (only needed for MS-DOS and Win32 build)
+# paths for cross-compiling (only needed for non-native MS-DOS and Win32 build)
 CROSS_PATH_MSDOS=/usr/local/cross-msdos/i386-msdosdjgpp
 CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc
 
-#-----------------------------------------------------------------------------#
-# you should not need to change anything below                                #
-#-----------------------------------------------------------------------------#
+# -----------------------------------------------------------------------------
+# there should be no need to change anything below
+# -----------------------------------------------------------------------------
 
 .EXPORT_ALL_VARIABLES:
 
@@ -52,6 +53,11 @@ MAKE_CMD = $(MAKE) -C $(SRC_DIR)
 DEFAULT_TARGET = x11
 # DEFAULT_TARGET = sdl
 
+
+# -----------------------------------------------------------------------------
+# build targets
+# -----------------------------------------------------------------------------
+
 all:
        @$(MAKE_CMD) TARGET=$(DEFAULT_TARGET)
 
@@ -83,9 +89,9 @@ clean:
        @$(MAKE_CMD) clean
 
 
-#-----------------------------------------------------------------------------#
-# development only stuff                                                      #
-#-----------------------------------------------------------------------------#
+# -----------------------------------------------------------------------------
+# development only
+# -----------------------------------------------------------------------------
 
 auto-conf:
        @$(MAKE_CMD) auto-conf
index d611cd933bd87dac7adc11da0dead917b71baf05..46a9ddd29df4b9bc7fbe225afb15fa1913ef2c5e 100644 (file)
@@ -1,11 +1,16 @@
-#=============================================================================#
-# Makefile for Rocks'n'Diamonds                                               #
-# (c) 1995-2002 Holger Schemel, info@artsoft.org                              #
-#=============================================================================#
+# =============================================================================
+# Rocks'n'Diamonds Makefile (src)
+# -----------------------------------------------------------------------------
+# (c) 1995-2003 Holger Schemel <info@artsoft.org>
+# =============================================================================
+
+# -----------------------------------------------------------------------------
+# configuration
+# -----------------------------------------------------------------------------
 
 .EXPORT_ALL_VARIABLES:
 
-ifndef PLATFORM                        # platform not specified -- try auto detection
+ifndef PLATFORM                        # no platform specified -- try auto detection
 ifdef COMSPEC
 PLATFORM = msdos
 else
@@ -184,6 +189,10 @@ ICON = $(ICONBASE).o
 endif
 
 
+# -----------------------------------------------------------------------------
+# build targets
+# -----------------------------------------------------------------------------
+
 all: libgame_dir $(PROGNAME)
 
 $(PROGNAME): $(LIBGAME) $(TIMESTAMP_FILE) $(OBJS) $(ICON)
@@ -234,9 +243,9 @@ clean-bin:
 clean: clean-obj clean-ico clean-bin
 
 
-#-----------------------------------------------------------------------------#
-# development only stuff                                                      #
-#-----------------------------------------------------------------------------#
+# -----------------------------------------------------------------------------
+# development only
+# -----------------------------------------------------------------------------
 
 dist-clean: clean-obj
 
index 7d2dff023dc0e3f33a6d4e2fb00a6a43819e7f94..3206d9251081b5d593d9c1499ab9c73aef0e2dd3 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-10-19 02:53]"
+#define COMPILE_DATE_STRING "[2003-10-19 18:46]"
index 61bd1af81bc931728934b5d0e0788ab1e611ac04..36751f4630437fb12df9e828268a5e960e02760a 100644 (file)
@@ -242,12 +242,12 @@ static void setLevelInfoToDefaults(struct LevelInfo *level)
        strcpy(level->author, PROGRAM_AUTHOR_STRING);
        break;
 
-      case LEVELCLASS_CONTRIBUTION:
-       strncpy(level->author, leveldir_current->name,MAX_LEVEL_AUTHOR_LEN);
+      case LEVELCLASS_CONTRIB:
+       strncpy(level->author, leveldir_current->name, MAX_LEVEL_AUTHOR_LEN);
        level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
        break;
 
-      case LEVELCLASS_USER:
+      case LEVELCLASS_PRIVATE:
        strncpy(level->author, getRealName(), MAX_LEVEL_AUTHOR_LEN);
        level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
        break;
@@ -930,16 +930,31 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename)
   if (leveldir_current == NULL)                /* only when dumping level */
     return;
 
+#if 0
+  printf("::: sort_priority: %d\n", leveldir_current->sort_priority);
+#endif
+
   /* determine correct game engine version of current level */
-  if (IS_LEVELCLASS_CONTRIBUTION(leveldir_current) ||
-      IS_LEVELCLASS_USER(leveldir_current))
+#if 1
+  if (!leveldir_current->latest_engine)
+#else
+  if (IS_LEVELCLASS_CONTRIB(leveldir_current) ||
+      IS_LEVELCLASS_PRIVATE(leveldir_current) ||
+      IS_LEVELCLASS_UNDEFINED(leveldir_current))
+#endif
   {
 #if 0
     printf("\n::: This level is private or contributed: '%s'\n", filename);
 #endif
 
-    /* For user contributed and private levels, use the version of
-       the game engine the levels were created for.
+#if 1
+    printf("\n::: Use the stored game engine version for this level\n");
+#endif
+
+    /* For all levels which are not forced to use the latest game engine
+       version (normally user contributed, private and undefined levels),
+       use the version of the game engine the levels were created for.
+
        Since 2.0.1, the game engine version is now directly stored
        in the level file (chunk "VERS"), so there is no need anymore
        to set the game version from the file version (except for old,
@@ -949,7 +964,7 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename)
     /* do some special adjustments to support older level versions */
     if (level->file_version == FILE_VERSION_1_0)
     {
-      Error(ERR_WARN, "level file '%s'has version number 1.0", filename);
+      Error(ERR_WARN, "level file '%s' has version number 1.0", filename);
       Error(ERR_WARN, "using high speed movement for player");
 
       /* player was faster than monsters in (pre-)1.0 levels */
@@ -967,12 +982,22 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename)
           leveldir_current->sort_priority, filename);
 #endif
 
-    /* Always use the latest version of the game engine for all but
-       user contributed and private levels; this allows for actual
-       corrections in the game engine to take effect for existing,
-       converted levels (from "classic" or other existing games) to
-       make the game emulation more accurate, while (hopefully) not
-       breaking existing levels created from other players. */
+#if 1
+    printf("\n::: Use latest game engine version for this level.\n");
+#endif
+
+    /* For all levels which are forced to use the latest game engine version
+       (normally all but user contributed, private and undefined levels), set
+       the game engine version to the actual version; this allows for actual
+       corrections in the game engine to take effect for existing, converted
+       levels (from "classic" or other existing games) to make the emulation
+       of the corresponding game more accurate, while (hopefully) not breaking
+       existing levels created from other players. */
+
+#if 0
+    printf("::: changing engine from %d to %d\n",
+          level->game_version, GAME_VERSION_ACTUAL);
+#endif
 
     level->game_version = GAME_VERSION_ACTUAL;
 
@@ -986,6 +1011,10 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename)
     if (level->file_version < FILE_VERSION_2_0)
       level->em_slippery_gems = TRUE;
   }
+
+#if 0
+  printf("::: => %d\n", level->game_version);
+#endif
 }
 
 static void LoadLevel_InitElements(struct LevelInfo *level, char *filename)
index 2eb6dda4bc8d7bdb732a1e01a12037de22b5ca4c..4d5b28c6b3eae4baadc7ddfe80b82ab7b7e874da 100644 (file)
@@ -1,7 +1,12 @@
-#=============================================================================#
-# Makefile for Artsoft Retro-Game Library                                     #
-# (c) 1994-2002 Holger Schemel, info@artsoft.org                              #
-#=============================================================================#
+# =============================================================================
+# Rocks'n'Diamonds Makefile (libgame)
+# -----------------------------------------------------------------------------
+# (c) 1995-2003 Holger Schemel <info@artsoft.org>
+# =============================================================================
+
+# -----------------------------------------------------------------------------
+# configuration
+# -----------------------------------------------------------------------------
 
 SRCS = system.c        \
        gadgets.c       \
@@ -38,6 +43,10 @@ OBJS =       system.o        \
 LIBGAME = libgame.a
 
 
+# -----------------------------------------------------------------------------
+# build targets
+# -----------------------------------------------------------------------------
+
 all: $(LIBGAME)
 
 $(LIBGAME): $(OBJS)
@@ -52,9 +61,9 @@ clean:
        $(RM) $(LIBGAME)
 
 
-#-----------------------------------------------------------------------------#
-# development only stuff                                                      #
-#-----------------------------------------------------------------------------#
+# -----------------------------------------------------------------------------
+# development only
+# -----------------------------------------------------------------------------
 
 depend:
        for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
index 119533755368e60bc41368cecbd369fbdf885261..2c7dcfd7c8742db7418d6da057c59b644dc1ba83 100644 (file)
@@ -45,30 +45,30 @@ static char *levelclass_desc[NUM_LEVELCLASS_DESC] =
                         IS_LEVELCLASS_EM(n) ?                  FC_YELLOW :  \
                         IS_LEVELCLASS_SP(n) ?                  FC_GREEN :   \
                         IS_LEVELCLASS_DX(n) ?                  FC_YELLOW :  \
-                        IS_LEVELCLASS_CONTRIBUTION(n) ?        FC_GREEN :   \
-                        IS_LEVELCLASS_USER(n) ?                FC_RED :     \
+                        IS_LEVELCLASS_CONTRIB(n) ?             FC_GREEN :   \
+                        IS_LEVELCLASS_PRIVATE(n) ?             FC_RED :     \
                         FC_BLUE)
 
-#define LEVELSORTING(n)        (IS_LEVELCLASS_TUTORIAL(n) ?            0 : \
-                        IS_LEVELCLASS_CLASSICS(n) ?            1 : \
-                        IS_LEVELCLASS_BD(n) ?                  2 : \
-                        IS_LEVELCLASS_EM(n) ?                  3 : \
-                        IS_LEVELCLASS_SP(n) ?                  4 : \
-                        IS_LEVELCLASS_DX(n) ?                  5 : \
-                        IS_LEVELCLASS_CONTRIBUTION(n) ?        6 : \
-                        IS_LEVELCLASS_USER(n) ?                7 : \
+#define LEVELSORTING(n)        (IS_LEVELCLASS_TUTORIAL(n) ?            0 :     \
+                        IS_LEVELCLASS_CLASSICS(n) ?            1 :     \
+                        IS_LEVELCLASS_BD(n) ?                  2 :     \
+                        IS_LEVELCLASS_EM(n) ?                  3 :     \
+                        IS_LEVELCLASS_SP(n) ?                  4 :     \
+                        IS_LEVELCLASS_DX(n) ?                  5 :     \
+                        IS_LEVELCLASS_CONTRIB(n) ?             6 :     \
+                        IS_LEVELCLASS_PRIVATE(n) ?             7 :     \
                         9)
 
 #define ARTWORKCOLOR(n)        (IS_ARTWORKCLASS_CLASSICS(n) ?          FC_RED :     \
-                        IS_ARTWORKCLASS_CONTRIBUTION(n) ?      FC_YELLOW :  \
+                        IS_ARTWORKCLASS_CONTRIB(n) ?           FC_YELLOW :  \
+                        IS_ARTWORKCLASS_PRIVATE(n) ?           FC_RED :     \
                         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 : \
+#define ARTWORKSORTING(n) (IS_ARTWORKCLASS_CLASSICS(n) ?       0 :     \
+                          IS_ARTWORKCLASS_LEVEL(n) ?           1 :     \
+                          IS_ARTWORKCLASS_CONTRIB(n) ?         2 :     \
+                          IS_ARTWORKCLASS_PRIVATE(n) ?         3 :     \
                           9)
 
 #define TOKEN_VALUE_POSITION           40
@@ -1405,13 +1405,14 @@ void checkSetupFileHashIdentifier(SetupFileHash *setup_file_hash,
 #define LEVELINFO_TOKEN_LEVELS         5
 #define LEVELINFO_TOKEN_FIRST_LEVEL    6
 #define LEVELINFO_TOKEN_SORT_PRIORITY  7
-#define LEVELINFO_TOKEN_LEVEL_GROUP    8
-#define LEVELINFO_TOKEN_READONLY       9
-#define LEVELINFO_TOKEN_GRAPHICS_SET   10
-#define LEVELINFO_TOKEN_SOUNDS_SET     11
-#define LEVELINFO_TOKEN_MUSIC_SET      12
+#define LEVELINFO_TOKEN_LATEST_ENGINE  8
+#define LEVELINFO_TOKEN_LEVEL_GROUP    9
+#define LEVELINFO_TOKEN_READONLY       10
+#define LEVELINFO_TOKEN_GRAPHICS_SET   11
+#define LEVELINFO_TOKEN_SOUNDS_SET     12
+#define LEVELINFO_TOKEN_MUSIC_SET      13
 
-#define NUM_LEVELINFO_TOKENS           13
+#define NUM_LEVELINFO_TOKENS           14
 
 static LevelDirTree ldi;
 
@@ -1426,6 +1427,7 @@ static struct TokenInfo levelinfo_tokens[] =
   { TYPE_INTEGER, &ldi.levels,         "levels"        },
   { TYPE_INTEGER, &ldi.first_level,    "first_level"   },
   { TYPE_INTEGER, &ldi.sort_priority,  "sort_priority" },
+  { TYPE_BOOLEAN, &ldi.latest_engine,  "latest_engine" },
   { TYPE_BOOLEAN, &ldi.level_group,    "level_group"   },
   { TYPE_BOOLEAN, &ldi.readonly,       "readonly"      },
   { TYPE_STRING,  &ldi.graphics_set,   "graphics_set"  },
@@ -1459,6 +1461,7 @@ static void setTreeInfoToDefaults(TreeInfo *ldi, int type)
   ldi->author = getStringCopy(ANONYMOUS_NAME);
 
   ldi->sort_priority = LEVELCLASS_UNDEFINED;   /* default: least priority */
+  ldi->latest_engine = FALSE;                  /* default: get from level */
   ldi->parent_link = FALSE;
   ldi->user_defined = FALSE;
   ldi->color = 0;
@@ -1517,6 +1520,7 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ldi, TreeInfo *parent)
   ldi->author = getStringCopy(parent->author);
 
   ldi->sort_priority = parent->sort_priority;
+  ldi->latest_engine = parent->latest_engine;
   ldi->parent_link = FALSE;
   ldi->user_defined = parent->user_defined;
   ldi->color = parent->color;
@@ -1722,6 +1726,7 @@ static void createParentTreeInfoNode(TreeInfo *node_parent)
   setString(&ti_new->fullpath, node_parent->fullpath);
 
   ti_new->sort_priority = node_parent->sort_priority;
+  ti_new->latest_engine = node_parent->latest_engine;
 
   setString(&ti_new->class_desc, getLevelClassDescription(ti_new));
 #else
@@ -1733,6 +1738,7 @@ static void createParentTreeInfoNode(TreeInfo *node_parent)
   ti_new->fullpath = getStringCopy(node_parent->fullpath);
 
   ti_new->sort_priority = node_parent->sort_priority;
+  ti_new->latest_engine = node_parent->latest_engine;
 
   ti_new->class_desc = getLevelClassDescription(ti_new);
 #endif
@@ -2088,7 +2094,7 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first,
 #else
        artwork_new->identifier = getStringCopy("private");
 #endif
-       artwork_new->sort_priority = ARTWORKCLASS_USER;
+       artwork_new->sort_priority = ARTWORKCLASS_PRIVATE;
       }
       else
       {
@@ -2431,7 +2437,7 @@ static void SaveUserLevelInfo()
   setString(&level_info->author, getRealName());
   level_info->levels = 100;
   level_info->first_level = 1;
-  level_info->sort_priority = LEVELCLASS_USER_START;
+  level_info->sort_priority = LEVELCLASS_PRIVATE_START;
   level_info->readonly = FALSE;
   setString(&level_info->graphics_set, GFX_CLASSIC_SUBDIR);
   setString(&level_info->sounds_set,   SND_CLASSIC_SUBDIR);
@@ -2441,7 +2447,7 @@ static void SaveUserLevelInfo()
   ldi.author = getStringCopy(getRealName());
   ldi.levels = 100;
   ldi.first_level = 1;
-  ldi.sort_priority = LEVELCLASS_USER_START;
+  ldi.sort_priority = LEVELCLASS_PRIVATE_START;
   ldi.readonly = FALSE;
   ldi.graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
   ldi.sounds_set = getStringCopy(SND_CLASSIC_SUBDIR);
index 954079151d136591a40740c3aba9c16bf56d8719..2498fe7d2345f5500484d05a99590454eaa74b5d 100644 (file)
@@ -89,10 +89,10 @@ typedef struct hashtable SetupFileHash;
 #define LEVELCLASS_TUTORIAL_END                99
 #define LEVELCLASS_CLASSICS_START      100
 #define LEVELCLASS_CLASSICS_END                199
-#define LEVELCLASS_CONTRIBUTION_START  200
-#define LEVELCLASS_CONTRIBUTION_END    299
-#define LEVELCLASS_USER_START          300
-#define LEVELCLASS_USER_END            399
+#define LEVELCLASS_CONTRIB_START       200
+#define LEVELCLASS_CONTRIB_END         299
+#define LEVELCLASS_PRIVATE_START       300
+#define LEVELCLASS_PRIVATE_END         399
 #define LEVELCLASS_BD_START            400
 #define LEVELCLASS_BD_END              499
 #define LEVELCLASS_EM_START            500
@@ -102,10 +102,13 @@ typedef struct hashtable SetupFileHash;
 #define LEVELCLASS_DX_START            700
 #define LEVELCLASS_DX_END              799
 
+#define LEVELCLASS_PREDEFINED_START    LEVELCLASS_TUTORIAL_START
+#define LEVELCLASS_PREDEFINED_END      LEVELCLASS_DX_END
+
 #define LEVELCLASS_TUTORIAL            LEVELCLASS_TUTORIAL_START
 #define LEVELCLASS_CLASSICS            LEVELCLASS_CLASSICS_START
-#define LEVELCLASS_CONTRIBUTION                LEVELCLASS_CONTRIBUTION_START
-#define LEVELCLASS_USER                        LEVELCLASS_USER_START
+#define LEVELCLASS_CONTRIB             LEVELCLASS_CONTRIB_START
+#define LEVELCLASS_PRIVATE             LEVELCLASS_PRIVATE_START
 #define LEVELCLASS_BD                  LEVELCLASS_BD_START
 #define LEVELCLASS_EM                  LEVELCLASS_EM_START
 #define LEVELCLASS_SP                  LEVELCLASS_SP_START
@@ -113,75 +116,78 @@ typedef struct hashtable SetupFileHash;
 
 #define LEVELCLASS_UNDEFINED           999
 
-#define IS_LEVELCLASS_TUTORIAL(p) \
-       ((p)->sort_priority >= LEVELCLASS_TUTORIAL_START && \
+#define IS_LEVELCLASS_TUTORIAL(p)                                      \
+       ((p)->sort_priority >= LEVELCLASS_TUTORIAL_START &&             \
         (p)->sort_priority <= LEVELCLASS_TUTORIAL_END)
-#define IS_LEVELCLASS_CLASSICS(p) \
-       ((p)->sort_priority >= LEVELCLASS_CLASSICS_START && \
+#define IS_LEVELCLASS_CLASSICS(p)                                      \
+       ((p)->sort_priority >= LEVELCLASS_CLASSICS_START &&             \
         (p)->sort_priority <= LEVELCLASS_CLASSICS_END)
-#define IS_LEVELCLASS_CONTRIBUTION(p) \
-       ((p)->sort_priority >= LEVELCLASS_CONTRIBUTION_START && \
-        (p)->sort_priority <= LEVELCLASS_CONTRIBUTION_END)
-#define IS_LEVELCLASS_USER(p) \
-       ((p)->sort_priority >= LEVELCLASS_USER_START && \
-        (p)->sort_priority <= LEVELCLASS_USER_END)
-#define IS_LEVELCLASS_BD(p) \
-       ((p)->sort_priority >= LEVELCLASS_BD_START && \
+#define IS_LEVELCLASS_CONTRIB(p)                                       \
+       ((p)->sort_priority >= LEVELCLASS_CONTRIB_START &&              \
+        (p)->sort_priority <= LEVELCLASS_CONTRIB_END)
+#define IS_LEVELCLASS_PRIVATE(p)                                       \
+       ((p)->sort_priority >= LEVELCLASS_PRIVATE_START &&              \
+        (p)->sort_priority <= LEVELCLASS_PRIVATE_END)
+#define IS_LEVELCLASS_BD(p)                                            \
+       ((p)->sort_priority >= LEVELCLASS_BD_START &&                   \
         (p)->sort_priority <= LEVELCLASS_BD_END)
-#define IS_LEVELCLASS_EM(p) \
-       ((p)->sort_priority >= LEVELCLASS_EM_START && \
+#define IS_LEVELCLASS_EM(p)                                            \
+       ((p)->sort_priority >= LEVELCLASS_EM_START &&                   \
         (p)->sort_priority <= LEVELCLASS_EM_END)
-#define IS_LEVELCLASS_SP(p) \
-       ((p)->sort_priority >= LEVELCLASS_SP_START && \
+#define IS_LEVELCLASS_SP(p)                                            \
+       ((p)->sort_priority >= LEVELCLASS_SP_START &&                   \
         (p)->sort_priority <= LEVELCLASS_SP_END)
-#define IS_LEVELCLASS_DX(p) \
-       ((p)->sort_priority >= LEVELCLASS_DX_START && \
+#define IS_LEVELCLASS_DX(p)                                            \
+       ((p)->sort_priority >= LEVELCLASS_DX_START &&                   \
         (p)->sort_priority <= LEVELCLASS_DX_END)
+#define IS_LEVELCLASS_UNDEFINED(p)                                     \
+       ((p)->sort_priority < LEVELCLASS_PREDEFINED_START ||            \
+        (p)->sort_priority > LEVELCLASS_PREDEFINED_END)
 
 #define LEVELCLASS(n)  (IS_LEVELCLASS_TUTORIAL(n) ? LEVELCLASS_TUTORIAL : \
                         IS_LEVELCLASS_CLASSICS(n) ? LEVELCLASS_CLASSICS : \
-                        IS_LEVELCLASS_CONTRIBUTION(n) ? LEVELCLASS_CONTRIBUTION : \
-                        IS_LEVELCLASS_USER(n) ? LEVELCLASS_USER : \
-                        IS_LEVELCLASS_BD(n) ? LEVELCLASS_BD : \
-                        IS_LEVELCLASS_EM(n) ? LEVELCLASS_EM : \
-                        IS_LEVELCLASS_SP(n) ? LEVELCLASS_SP : \
-                        IS_LEVELCLASS_DX(n) ? LEVELCLASS_DX : \
+                        IS_LEVELCLASS_CONTRIB(n) ? LEVELCLASS_CONTRIB :   \
+                        IS_LEVELCLASS_PRIVATE(n) ? LEVELCLASS_PRIVATE :   \
+                        IS_LEVELCLASS_BD(n) ? LEVELCLASS_BD :             \
+                        IS_LEVELCLASS_EM(n) ? LEVELCLASS_EM :             \
+                        IS_LEVELCLASS_SP(n) ? LEVELCLASS_SP :             \
+                        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_CONTRIB_START     200
+#define ARTWORKCLASS_CONTRIB_END       299
+#define ARTWORKCLASS_PRIVATE_START     300
+#define ARTWORKCLASS_PRIVATE_END       399
+#define ARTWORKCLASS_LEVEL_START       400
+#define ARTWORKCLASS_LEVEL_END         499
 
 #define ARTWORKCLASS_CLASSICS          ARTWORKCLASS_CLASSICS_START
-#define ARTWORKCLASS_CONTRIBUTION      ARTWORKCLASS_CONTRIBUTION_START
+#define ARTWORKCLASS_CONTRIB           ARTWORKCLASS_CONTRIB_START
+#define ARTWORKCLASS_PRIVATE           ARTWORKCLASS_PRIVATE_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 && \
+#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 && \
+#define IS_ARTWORKCLASS_CONTRIB(p)                                     \
+       ((p)->sort_priority >= ARTWORKCLASS_CONTRIB_START &&            \
+        (p)->sort_priority <= ARTWORKCLASS_CONTRIB_END)
+#define IS_ARTWORKCLASS_PRIVATE(p)                                     \
+       ((p)->sort_priority >= ARTWORKCLASS_PRIVATE_START &&            \
+        (p)->sort_priority <= ARTWORKCLASS_PRIVATE_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 : \
+                        IS_ARTWORKCLASS_CONTRIB(n) ? ARTWORKCLASS_CONTRIB :  \
+                        IS_ARTWORKCLASS_PRIVATE(n) ? ARTWORKCLASS_PRIVATE :  \
+                        IS_ARTWORKCLASS_LEVEL(n) ? ARTWORKCLASS_LEVEL :      \
                         ARTWORKCLASS_UNDEFINED)
 
 
index d1c41d2a91164a39378f07590767a0b548bf61c3..134d6c3ecf476560188ff9b88ed2dc21ab44b2d3 100644 (file)
@@ -628,6 +628,8 @@ struct TreeInfo
   int last_level;      /* last level number (automatically calculated) */
   int sort_priority;   /* sort levels by 'sort_priority' and then by name */
 
+  boolean latest_engine;/* force level set to use the latest game engine */
+
   boolean level_group; /* directory contains more level series directories */
   boolean parent_link; /* entry links back to parent directory */
   boolean user_defined;        /* user defined levels are stored in home directory */