[rott-commits] r279 - in trunk: . rott

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 11 04:16:55 EST 2015


Author: fabian
Date: 2015-02-11 04:16:55 -0500 (Wed, 11 Feb 2015)
New Revision: 279

Modified:
   trunk/README
   trunk/rott/Makefile
   trunk/rott/_rt_ted.h
   trunk/rott/develop.h
   trunk/rott/rt_actor.c
   trunk/rott/rt_main.c
   trunk/rott/rt_main.h
   trunk/rott/rt_menu.c
   trunk/rott/rt_ted.c
Log:
Make the "registered" variant recognize all supported
multiplayer map files and set 'gamestate.Product' accordingly.
This saves us from rebuilding the SUPERROTT and SITELICENSE variants
which had their multiplayer map file names hard-coded.



Modified: trunk/README
===================================================================
--- trunk/README	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/README	2015-02-11 09:16:55 UTC (rev 279)
@@ -76,16 +76,17 @@
   make clean
   make
 
-The build system is setup to use shareware binaries.  If you want to use the
-registered version of ROTT, compile with:
+The build system is setup to use shareware binaries.  If you want to use one
+of the commercial versions of ROTT, compile with:
 
   make SHAREWARE=0
 
-You may additionally append SUPERROTT=1 or SITELICENSE=1, if you want to use
-the CD version or the Site License CD version, respectively. However, make
-sure to only set one of them to 1 at once. You may want to edit rott/Makefile
-to make your changes persistent.
+This variant supports the Registered Version, the "Super ROTT" CD Version and
+the "Site License" CD Version of the game by automatically detecting and
+loading their corresponding multiplayer map files.
 
+You may want to edit rott/Makefile to make your changes persistent.
+
 It is generally recommended to build against the most recent version of 
 the Simple Direct Media Layer and SDL_mixer.
 

Modified: trunk/rott/Makefile
===================================================================
--- trunk/rott/Makefile	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/Makefile	2015-02-11 09:16:55 UTC (rev 279)
@@ -1,14 +1,8 @@
 # Determine which version to build
-# Make sure only one of the following is set to 1 at once
-# Triple 0 will build the commercial/registered version
+# Leave at 0 to build the commercial/superrott/sitelicense version
 
-SHAREWARE   ?= 1
-SUPERROTT   ?= 0
-SITELICENSE ?= 0
-
+SHAREWARE ?= 0
 CPPFLAGS += -DSHAREWARE=$(SHAREWARE)
-CPPFLAGS += -DSUPERROTT=$(SUPERROTT)
-CPPFLAGS += -DSITELICENSE=$(SITELICENSE)
 
 ROTT ?= rott
 

Modified: trunk/rott/_rt_ted.h
===================================================================
--- trunk/rott/_rt_ted.h	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/_rt_ted.h	2015-02-11 09:16:55 UTC (rev 279)
@@ -84,19 +84,6 @@
 
 #define  MAXSILLYSTRINGS 32
 
-#if (SHAREWARE==0)
-   #define  STANDARDGAMELEVELS   (DATADIR "DARKWAR.RTL")
-   #if (SUPERROTT==1)
-       #define  STANDARDBATTLELEVELS (DATADIR "ROTTCD.RTC")
-   #elif (SITELICENSE==1)
-       #define  STANDARDBATTLELEVELS (DATADIR "ROTTSITE.RTC")
-   #else
-       #define  STANDARDBATTLELEVELS (DATADIR "DARKWAR.RTC")
-   #endif
-#else
-   #define  STANDARDGAMELEVELS   (DATADIR "HUNTBGIN.RTL")
-   #define  STANDARDBATTLELEVELS (DATADIR "HUNTBGIN.RTC")
-#endif
 
 
 

Modified: trunk/rott/develop.h
===================================================================
--- trunk/rott/develop.h	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/develop.h	2015-02-11 09:16:55 UTC (rev 279)
@@ -41,6 +41,9 @@
 
 #define BNACRASHPREVENT  1 //bna added 
 // Flavor selection (shareware, registered, cd version, site license) has moved to the Makefile
+#ifndef SHAREWARE
+#define SHAREWARE 0
+#endif
 
 // cute little dopefish thing, only works with special patch?
 #define DOPEFISH 0

Modified: trunk/rott/rt_actor.c
===================================================================
--- trunk/rott/rt_actor.c	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/rt_actor.c	2015-02-11 09:16:55 UTC (rev 279)
@@ -1621,12 +1621,9 @@
 
 
  #if 0
- #if (SUPERROTT == 1)
-
+ if (gamestate.Product == ROTT_SUPERCD)
    ConsiderAlternateActor(new,which);
-
  #endif
- #endif
 
    StandardEnemyInit(new,dir);
 
@@ -1671,10 +1668,9 @@
 {statetype *temp;
  int path=PATH;
 #if 0
-#if (SUPERROTT == 1)
+if (gamestate.Product == ROTT_SUPERCD)
  char *altstartlabel;
 #endif
-#endif
 
 
 
@@ -1711,10 +1707,9 @@
 
 
    #if 0
-   #if (SUPERROTT == 1)
+   if (gamestate.Product == ROTT_SUPERCD)
    ConsiderAlternateActor(new,which);
    #endif
-   #endif
 
    StandardEnemyInit(new,dir);
 

Modified: trunk/rott/rt_main.c
===================================================================
--- trunk/rott/rt_main.c	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/rt_main.c	2015-02-11 09:16:55 UTC (rev 279)
@@ -179,6 +179,7 @@
 int main (int argc, char *argv[])
 {
     char *macwd;
+    extern char *BATTMAPS;
 #ifndef DOS
 	_argc = argc;
 	_argv = argv;
@@ -214,13 +215,33 @@
    gamestate.Version = ROTTVERSION;
 
 #if ( SHAREWARE == 1 )
+   BATTMAPS = strdup(STANDARDBATTLELEVELS);
+   FixFilePath(BATTMAPS);
    gamestate.Product = ROTT_SHAREWARE;
-#elif ( SUPERROTT == 1 )
-   gamestate.Product = ROTT_SUPERCD;
-#elif ( SITELICENSE == 1 )
-   gamestate.Product = ROTT_SITELICENSE;
 #else
-   gamestate.Product = ROTT_REGISTERED;
+   BATTMAPS = strdup(SITELICENSEBATTLELEVELS);
+   FixFilePath(BATTMAPS);
+   if (!access(BATTMAPS, R_OK))
+   {
+       gamestate.Product = ROTT_SITELICENSE;
+   }
+   else
+   {
+       free(BATTMAPS);
+       BATTMAPS = strdup(SUPERROTTBATTLELEVELS);
+       FixFilePath(BATTMAPS);
+       if (!access(BATTMAPS, R_OK))
+       {
+           gamestate.Product = ROTT_SUPERCD;
+       }
+       else
+       {
+           free(BATTMAPS);
+           BATTMAPS = strdup(STANDARDBATTLELEVELS);
+           FixFilePath(BATTMAPS);
+           gamestate.Product = ROTT_REGISTERED;
+       }
+   }
 #endif
 
    DrawRottTitle ();

Modified: trunk/rott/rt_main.h
===================================================================
--- trunk/rott/rt_main.h	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/rt_main.h	2015-02-11 09:16:55 UTC (rev 279)
@@ -31,6 +31,16 @@
 #include "rottnet.h"
 #include "rt_battl.h"
 
+#if (SHAREWARE==0)
+   #define  STANDARDGAMELEVELS   (DATADIR "DARKWAR.RTL")
+   #define  STANDARDBATTLELEVELS (DATADIR "DARKWAR.RTC")
+   #define  SUPERROTTBATTLELEVELS (DATADIR "ROTTCD.RTC")
+   #define  SITELICENSEBATTLELEVELS (DATADIR "ROTTSITE.RTC")
+#else
+   #define  STANDARDGAMELEVELS   (DATADIR "HUNTBGIN.RTL")
+   #define  STANDARDBATTLELEVELS (DATADIR "HUNTBGIN.RTC")
+#endif
+
 enum
 {vl_low,
  vl_medium,

Modified: trunk/rott/rt_menu.c
===================================================================
--- trunk/rott/rt_menu.c	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/rt_menu.c	2015-02-11 09:16:55 UTC (rev 279)
@@ -7155,8 +7155,6 @@
 //
 //****************************************************************************
 
-#if (SITELICENSE == 0)
-
 #define SITELINES 8
 
 char *sitemessage[] =
@@ -7171,8 +7169,6 @@
    "For more on site licenses, see ORDERING INFO."
    };
 
-#endif
-
 void CP_ModemGameMessage (int player  )
 
    {
@@ -7215,7 +7211,8 @@
          MenuBufCPrint ("Please wait while\nMaster selects\nCOMM-BAT options.");
          }
 
-#if (SITELICENSE == 0)
+if (gamestate.Product != ROTT_SITELICENSE)
+{
       if (networkgame==true)
          {
          for( i = 0; i < SITELINES; i++ )
@@ -7224,7 +7221,7 @@
                sitemessage[ i ] );
             }
          }
-#endif
+}
       }
 
    FlipMenuBuf();

Modified: trunk/rott/rt_ted.c
===================================================================
--- trunk/rott/rt_ted.c	2014-06-16 08:24:13 UTC (rev 278)
+++ trunk/rott/rt_ted.c	2015-02-11 09:16:55 UTC (rev 279)
@@ -115,7 +115,7 @@
 static word cacheindex;
 static boolean CachingStarted=false;
 static char * ROTTMAPS = STANDARDGAMELEVELS;
-static char * BATTMAPS = STANDARDBATTLELEVELS;
+char * BATTMAPS;
 
 static char NormalWeaponTiles[ 10 ] =
    {



More information about the rott-commits mailing list