Commit c850d38b authored by Fabian Greffrath's avatar Fabian Greffrath

Make the "commercial" variant recognize all supported multiplayer map files

and set 'gamestate.Product' accordingly.
This saves us from building the SUPERROTT and SITELICENSE variants
which had their multiplayer map file names hard-coded.

Adjust documentation and packaging accordingly.
parent 9d922709
......@@ -3,8 +3,8 @@ Rise of the Triad for Debian
* The rott package in Debian supports all four variants of the game:
Shareware Version, Commercial Version, CD Version and Site License CD
Version. The corresponding binaries are named 'rott-shareware',
'rott-commercial', 'rott-superrott' and 'rott-sitelicense', respectively.
Version. The corresponding binaries are named 'rott-shareware' and
'rott-commercial' for the latter three variants, respectively.
In order to select which variant is started by the 'rott' command and the
desktop and menu files, Debian's 'update-alternatives' mechanism is used:
.
......
rott (1.1.2-3) UNRELEASED; urgency=medium
* Make the "commercial" variant recognize all supported
multiplayer map files and set 'gamestate.Product' accordingly.
This saves us from building the SUPERROTT and SITELICENSE variants
which had their multiplayer map file names hard-coded.
Adjust documentation and packaging accordingly.
-- Fabian Greffrath <fabian+debian@greffrath.com> Thu, 15 Jan 2015 14:17:28 +0100
rott (1.1.2-2) unstable; urgency=low
* Team upload.
......
......@@ -2,9 +2,9 @@ Description: Document we support all variants of the game
Author: Fabian Greffrath <fabian+debian@greffrath.com>
Forwarded: not-needed
--- rott-1.1.1.obsolete.0.838742770793946.orig/doc/rott.6
+++ rott-1.1.1.obsolete.0.838742770793946/doc/rott.6
@@ -7,11 +7,41 @@ rott \- Rise of the Triad
--- a/doc/rott.6
+++ b/doc/rott.6
@@ -7,11 +7,35 @@ rott \- Rise of the Triad
.B rott
.RI [ options ]
......@@ -13,12 +13,6 @@ Forwarded: not-needed
+
+.B rott-commercial
+.RI [ options ]
+
+.B rott-superrott
+.RI [ options ]
+
+.B rott-sitelicense
+.RI [ options ]
+
.SH DESCRIPTION
.B ROTT
......@@ -26,18 +20,18 @@ Forwarded: not-needed
This port duplicates the functionality of the original game on modern operating systems, including Linux, Win32, and Mac OS X.
+The
+.B rott-shareware,
+.B rott-commercial,
+.B rott-superrott
+.B rott-shareware
+and
+.B rott-sitelicense
+.B rott-commercial
+binaries start the
+.B Shareware Version,
+.B Commercial Version,
+.B CD Version
+.B Shareware Version
+and
+.B Commercial Version
+(including the
+.B CD Version
+and the
+.B Site License CD Version
+of the game, respectively. The
+) of the game, respectively. The
+.B rott
+binary is a symbolic link to one of these and is handled via Debian's
+.B update-alternatives
......
Author: Fabian Greffrath <fabian+debian@greffrath.com>
Description: 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.
--- a/rott/Makefile
+++ b/rott/Makefile
@@ -2,13 +2,8 @@
# Make sure only one of the following is set to 1 at once
# Triple 0 will build the commercial/registered version
-SHAREWARE ?= 1
-SUPERROTT ?= 0
-SITELICENSE ?= 0
-
+SHAREWARE ?= 0
CPPFLAGS += -DSHAREWARE=$(SHAREWARE)
-CPPFLAGS += -DSUPERROTT=$(SUPERROTT)
-CPPFLAGS += -DSITELICENSE=$(SITELICENSE)
ROTT ?= rott
--- a/rott/_rt_ted.h
+++ b/rott/_rt_ted.h
@@ -84,19 +84,6 @@ typedef struct
#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
--- a/rott/develop.h
+++ b/rott/develop.h
@@ -40,10 +40,6 @@ Foundation, Inc., 59 Temple Place - Suit
#define LOWCOST 0
#define BNACRASHPREVENT 1 //bna added
-// Make sure only one of the following are on at one time
-//#define SHAREWARE 1
-//#define SUPERROTT 0
-//#define SITELICENSE 0
// cute little dopefish thing, only works with special patch?
#define DOPEFISH 0
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -179,6 +179,7 @@ extern void RecordDemoQuery ( void );
int main (int argc, char *argv[])
{
char *macwd;
+ extern char *BATTMAPS;
#ifndef DOS
_argc = argc;
_argv = argv;
@@ -214,13 +215,33 @@ int main (int argc, char *argv[])
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 ();
--- a/rott/rt_main.h
+++ b/rott/rt_main.h
@@ -31,6 +31,16 @@ Foundation, Inc., 59 Temple Place - Suit
#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,
--- a/rott/rt_ted.c
+++ b/rott/rt_ted.c
@@ -115,7 +115,7 @@ static cachetype * cachelist;
static word cacheindex;
static boolean CachingStarted=false;
static char * ROTTMAPS = STANDARDGAMELEVELS;
-static char * BATTMAPS = STANDARDBATTLELEVELS;
+char * BATTMAPS;
static char NormalWeaponTiles[ 10 ] =
{
--- a/rott/rt_actor.c
+++ b/rott/rt_actor.c
@@ -1621,11 +1621,8 @@ void SpawnStand (classtype which, int ti
#if 0
- #if (SUPERROTT == 1)
-
+ if (gamestate.Product == ROTT_SUPERCD)
ConsiderAlternateActor(new,which);
-
- #endif
#endif
StandardEnemyInit(new,dir);
@@ -1671,10 +1668,9 @@ void SpawnPatrol (classtype which, int t
{statetype *temp;
int path=PATH;
#if 0
-#if (SUPERROTT == 1)
+if (gamestate.Product == ROTT_SUPERCD)
char *altstartlabel;
#endif
-#endif
@@ -1711,10 +1707,9 @@ void SpawnPatrol (classtype which, int t
#if 0
- #if (SUPERROTT == 1)
+ if (gamestate.Product == ROTT_SUPERCD)
ConsiderAlternateActor(new,which);
#endif
- #endif
StandardEnemyInit(new,dir);
--- a/rott/rt_menu.c
+++ b/rott/rt_menu.c
@@ -7155,8 +7155,6 @@ void CP_TeamPlayErrorMessage
//
//****************************************************************************
-#if (SITELICENSE == 0)
-
#define SITELINES 8
char *sitemessage[] =
@@ -7171,8 +7169,6 @@ char *sitemessage[] =
"For more on site licenses, see ORDERING INFO."
};
-#endif
-
void CP_ModemGameMessage (int player )
{
@@ -7215,7 +7211,8 @@ void CP_ModemGameMessage (int player )
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 @@ void CP_ModemGameMessage (int player )
sitemessage[ i ] );
}
}
-#endif
+}
}
FlipMenuBuf();
......@@ -2,3 +2,4 @@
rott-r275.diff
rott-r276.diff
conflicting_types.patch
rott-merge-commercial.patch
usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-shareware.6.gz
usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-commercial.6.gz
usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-superrott.6.gz
usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-sitelicense.6.gz
#!/bin/sh
set -e
case "$1" in
abort-upgrade|configure)
update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-shareware 30
update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-commercial 20
update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-superrott 20
update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-sitelicense 20
;;
abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
if [ "$1" = "abort-upgrade" ] || [ "$1" = "configure" ]
then
update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-shareware 30
update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-commercial 20
fi
#DEBHELPER#
......
#!/bin/sh
set -e
if [ "$1" = "install" ] || [ "$1" = "upgrade" ]
then
if dpkg --compare-versions "$2" lt-nl "1.1.2-3~"
then
update-alternatives --quiet --remove rott /usr/games/rott-superrott
update-alternatives --quiet --remove rott /usr/games/rott-sitelicense
fi
fi
#DEBHELPER#
#!/bin/sh
set -e
case "$1" in
remove|deconfigure)
update-alternatives --quiet --remove-all rott
rm -f /usr/share/doc/rott/vendor.doc
if [ "`dpkg -l rott-data 2> /dev/null | grep ^ii`" ]
then
# rott-data is installed, delete all data files
# that are definitely not in rott-data
rm -f /usr/share/games/rott/1rott13.zip \
/usr/share/games/rott/FILE_ID.DIZ \
/usr/share/games/rott/INSTALL.EXE \
/usr/share/games/rott/ROTTSW13.SHR \
/usr/share/games/rott/MODEM.PCK \
/usr/share/games/rott/ORDER.FRM \
/usr/share/games/rott/README.EXE \
/usr/share/games/rott/ROTT.EXE \
/usr/share/games/rott/ROTTHELP.EXE \
/usr/share/games/rott/ROTTIPX.EXE \
/usr/share/games/rott/ROTTSER.EXE \
/usr/share/games/rott/SETUP.EXE \
/usr/share/games/rott/SNDSETUP.EXE
else
# rott-data is not (yet) installed, it is safe
# to delete the whole directory.
rm -rf /usr/share/games/rott
fi
;;
upgrade|failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]
then
update-alternatives --quiet --remove-all rott
fi
#DEBHELPER#
......
......@@ -16,13 +16,7 @@ debian/rott.png: debian/rott.svg
override_dh_auto_build:
# Shareware Version
$(MAKE) -C rott tidy
dh_auto_build -O--parallel -- ROTT=rott-shareware
dh_auto_build -O--parallel -- ROTT=rott-shareware SHAREWARE=1
# Commercial Version
$(MAKE) -C rott tidy
dh_auto_build -O--parallel -- ROTT=rott-commercial SHAREWARE=0
# CD Version
$(MAKE) -C rott tidy
dh_auto_build -O--parallel -- ROTT=rott-superrott SHAREWARE=0 SUPERROTT=1
# Site License CD Version
$(MAKE) -C rott tidy
dh_auto_build -O--parallel -- ROTT=rott-sitelicense SHAREWARE=0 SITELICENSE=1
dh_auto_build -O--parallel -- ROTT=rott-commercial SHAREWARE=0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment