eliminate need for .mn2 files for oem and demo

This commit is contained in:
Bradley Bell 2002-08-23 01:52:11 +00:00
parent b994fb2115
commit 636e5ec368
4 changed files with 163 additions and 136 deletions

View file

@ -1,6 +0,0 @@
name = Descent 2 Demo
type = normal
num_levels = 3
d2leva-1.sl2
d2leva-2.sl2
d2leva-3.sl2

View file

@ -3,15 +3,16 @@ files need to go into a shared data directory
(/usr/local/share/games/d2x by default). On Windows or DOS, they go
in the same directory as the d2x binary.
To Play the Descent 2 demo:
Place these files into your shared data dir:
d2demo.ham
d2demo.hog
d2demo.pig
d2demo.mn2 (distributed with d2x)
Base Installation
-----------------
To Play Descent 2 registered:
The base install depends on which version of the datafiles you have.
d2x currently supports the full version, the OEM version (Destination:
Quartzon), and the PC shareware version (Mac shareware version coming
soon)
Place these files into your shared data dir:
Full Version:
alien1.pig
alien2.pig
descent2.ham
@ -23,14 +24,58 @@ groupa.pig
ice.pig
water.pig
To play Descent 1 registered:
All the files from Descent 2 registered, plus:
Place these files into the missions subdir of your shared data dir:
OEM Version:
descent2.ham
descent2.hog
descent2.s11
descent2.s22
fire.pig
groupa.pig
ice.pig
water.pig
PC Shareware:
d2demo.ham
d2demo.hog
d2demo.pig
Mac Shareware:
d2demo.ham
d2demo.hog
d2demo.pig
descent2.s11
exit.ham
d2.mn2
Mission Installation
--------------------
d2x should be able to play any missions for Descent 1 or Descent 2,
including the original Descent 1 mission (Descent: First Strike)
To install an additional mission, just place the .hog and the .msn or
.mn2 file into your missions directory. The missions directory can be
inside the system-wide data dir, or your $HOME/.d2x dir. d2x will
look in both places.
To install the mission from Descent 1:
Place these files into your missions directory:
descent.hog
descent.msn (distributed with d2x)
Note the filenames must be in _lower case_. It's important.
Note also that you don't have to run the D2 setup program to extract
the files, just unarj descent2.sow from the cd.
Vertigo Installation
--------------------
Vertigo consists of both game enhancements (codenamed HOARD) and an
additional mission. To install HOARD, place hoard.ham in your data
dir. To play the vertigo mission, place d2x.hog and d2x.mn2 in your
mission dir.
Notes
-----
In unix, the filenames must be in _lower case_. It's important.
Also, you don't have to run the D2 setup program to extract the files,
just unarj descent2.sow from the cd.

View file

@ -1,3 +1,4 @@
/* $Id: gameseq.h,v 1.2 2002-08-23 01:52:11 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -7,45 +8,33 @@ IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
#ifndef _GAMESEQ_H
#define _GAMESEQ_H
#include "player.h"
#include "mission.h"
#define SUPER_MISSILE 0
#define SUPER_SEEKER 1
#define SUPER_SMARTBOMB 2
#define SUPER_SHOCKWAVE 3
#define SUPER_MISSILE 0
#define SUPER_SEEKER 1
#define SUPER_SMARTBOMB 2
#define SUPER_SHOCKWAVE 3
#if defined(SHAREWARE)
#define Last_level 3 //the number of the very last level for shareware
#define Last_secret_level 0 // No secret levels!
#else
#if defined(D2_OEM)
#define Last_level 8 // 8 levels for Diamond/S3 version
#define Last_secret_level -2 // 2 secret levels
#else
extern int Last_level,Last_secret_level; //set by mission code
#endif
#endif
extern int Last_level,Last_secret_level; //set by mission code
extern int Secret_level_table[MAX_SECRET_LEVELS_PER_MISSION];
#define LEVEL_NAME_LEN 36 //make sure this is multiple of 4!
#define LEVEL_NAME_LEN 36 //make sure this is multiple of 4!
//Current_level_num starts at 1 for the first level
//-1,-2,-3 are secret levels
//0 means not a real level loaded
extern int Current_level_num,Next_level_num;
extern char Current_level_name[LEVEL_NAME_LEN];
extern obj_position Player_init[MAX_PLAYERS];
extern obj_position Player_init[MAX_PLAYERS];
//This is the highest level the player has ever reached
@ -71,8 +60,8 @@ void StartLevel(int random_flag);
// Actually does the work to start new level
void StartNewLevelSub(int level_num, int page_in_textures, int secret_flag);
void InitPlayerObject(); //make sure player's object set up
void init_player_stats_game(); //clear all stats
void InitPlayerObject(); //make sure player's object set up
void init_player_stats_game(); //clear all stats
//starts a resumed game loaded from disk
void ResumeSavedGame(int start_level);
@ -84,7 +73,7 @@ void PlayerFinishedLevel(int secret_flag);
//called when the player has died
void DoPlayerDead(void);
//load a level off disk. level numbers start at 1.
//load a level off disk. level numbers start at 1.
//Secret levels are -1,-2,-3
void LoadLevel(int level_num,int page_in_textures);

View file

@ -1,4 +1,4 @@
/* $Id: mission.c,v 1.7 2002-08-15 18:31:06 btb Exp $ */
/* $Id: mission.c,v 1.8 2002-08-23 01:52:11 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -60,95 +60,69 @@ char Secret_level_names[MAX_SECRET_LEVELS_PER_MISSION][FILENAME_LEN];
#define MISSION_DIR "./"
#endif
#ifdef SHAREWARE
#define SHAREWARE_MISSION_FILENAME "d2demo"
#define SHAREWARE_MISSION_NAME "Descent 2 Demo"
#define SHAREWARE_MISSION_HOGSIZE 2292566
#define MAC_SHARE_MISSION_HOGSIZE 4292746
#define OEM_MISSION_FILENAME "d2"
#define OEM_MISSION_NAME "D2 Destination:Quartzon"
#define OEM_MISSION_HOGSIZE 6132957
#define FULL_MISSION_FILENAME "d2.mn2"
#define FULL_MISSION_HOGSIZE 7595079
char *builtin_mission;
int builtin_mission_hogsize;
//
// Special versions of mission routines for shareware
//
#define SHAREWARE_MISSION_FILENAME "d2demo"
#define SHAREWARE_MISSION_NAME "Descent 2 Demo"
int build_mission_list(int anarchy_mode)
int load_mission_shareware(int mission_num)
{
anarchy_mode++; //kill warning
strcpy(Mission_list[0].filename,SHAREWARE_MISSION_FILENAME);
strcpy(Mission_list[0].mission_name,SHAREWARE_MISSION_NAME);
Mission_list[0].anarchy_only_flag = 0;
return load_mission(0);
}
int load_mission(int mission_num)
{
Assert(mission_num == 0);
Current_mission_num = 0;
Current_mission_filename = Mission_list[0].filename;
Current_mission_longname = Mission_list[0].mission_name;
Current_mission_num = mission_num;
Current_mission_filename = Mission_list[mission_num].filename;
Current_mission_longname = Mission_list[mission_num].mission_name;
N_secret_levels = 0;
Assert(Last_level == 3);
Last_level = 3;
Last_secret_level = 0;
#ifdef MACINTOSH // mac demo is using the regular hog and rl2 files
strcpy(Level_names[0],"d2leva-1.rl2");
strcpy(Level_names[1],"d2leva-2.rl2");
strcpy(Level_names[2],"d2leva-3.rl2");
#else
strcpy(Level_names[0],"d2leva-1.sl2");
strcpy(Level_names[1],"d2leva-2.sl2");
strcpy(Level_names[2],"d2leva-3.sl2");
#endif // end of ifdef macintosh
switch (builtin_mission_hogsize) {
case MAC_SHARE_MISSION_HOGSIZE:
// mac demo is using the regular hog and rl2 files
strcpy(Level_names[0],"d2leva-1.rl2");
strcpy(Level_names[1],"d2leva-2.rl2");
strcpy(Level_names[2],"d2leva-3.rl2");
break;
default:
Int3(); // fall through
case SHAREWARE_MISSION_HOGSIZE:
strcpy(Level_names[0],"d2leva-1.sl2");
strcpy(Level_names[1],"d2leva-2.sl2");
strcpy(Level_names[2],"d2leva-3.sl2");
}
return 1;
}
int load_mission_by_name(char *mission_name)
{
if (strcmp(mission_name,SHAREWARE_MISSION_FILENAME))
return 0; //cannot load requested mission
else
return load_mission(0);
}
#else // else of ifdef SHAREWARE
#if defined(D2_OEM)
//
// Special versions of mission routines for Diamond/S3 version
//
#define OEM_MISSION_FILENAME "d2"
#define OEM_MISSION_NAME "D2 Destination:Quartzon"
int build_mission_list(int anarchy_mode)
int load_mission_oem(int mission_num)
{
anarchy_mode++; //kill warning
strcpy(Mission_list[0].filename,OEM_MISSION_FILENAME);
strcpy(Mission_list[0].mission_name,OEM_MISSION_NAME);
Mission_list[0].anarchy_only_flag = 0;
return load_mission(0);
}
int load_mission(int mission_num)
{
Assert(mission_num == 0);
Current_mission_num = 0;
Current_mission_filename = Mission_list[0].filename;
Current_mission_longname = Mission_list[0].mission_name;
Current_mission_num = mission_num;
Current_mission_filename = Mission_list[mission_num].filename;
Current_mission_longname = Mission_list[mission_num].mission_name;
N_secret_levels = 2;
Assert(Last_level == 8);
Last_level = 8;
Last_secret_level = -2;
strcpy(Level_names[0],"d2leva-1.rl2");
strcpy(Level_names[1],"d2leva-2.rl2");
@ -170,16 +144,6 @@ int load_mission(int mission_num)
return 1;
}
int load_mission_by_name(char *mission_name)
{
if (strcmp(mission_name,OEM_MISSION_FILENAME))
return 0; //cannot load requested mission
else
return load_mission(0);
}
#else // else of ifdef D2_OEM, ifdef SHAREWARE
//strips damn newline from end of line
char *mfgets(char *s,int n,CFILE *f)
@ -249,14 +213,14 @@ int ml_sort_func(mle *e0,mle *e1)
extern char CDROM_dir[];
extern int HoardEquipped();
#define BUILTIN_MISSION (cfexist("d2.mn2")?"d2.mn2":"d2demo.mn2")
//returns 1 if file read ok, else 0
int read_mission_file(char *filename,int count,int location)
{
char filename2[100];
CFILE *mfile;
printf("reading: %s\n", filename);
switch (location) {
case ML_MISSIONDIR:
strcpy(filename2,MISSION_DIR);
@ -325,7 +289,7 @@ int read_mission_file(char *filename,int count,int location)
p = get_parm_value("type",mfile);
//get mission type
//get mission type
if (p)
Mission_list[count].anarchy_only_flag = istok(p,"anarchy");
@ -337,8 +301,39 @@ int read_mission_file(char *filename,int count,int location)
return 0;
}
void add_builtin_mission_to_list(int *count)
{
builtin_mission_hogsize = cfile_size("descent2.hog");
if (builtin_mission_hogsize == -1)
builtin_mission_hogsize = cfile_size("d2demo.hog");
void add_missions_to_list(char * search_name, int * count, int anarchy_mode) {
switch (builtin_mission_hogsize) {
case SHAREWARE_MISSION_HOGSIZE:
case MAC_SHARE_MISSION_HOGSIZE:
strcpy(Mission_list[*count].filename,SHAREWARE_MISSION_FILENAME);
strcpy(Mission_list[*count].mission_name,SHAREWARE_MISSION_NAME);
Mission_list[*count].anarchy_only_flag = 0;
break;
case OEM_MISSION_HOGSIZE:
strcpy(Mission_list[*count].filename,OEM_MISSION_FILENAME);
strcpy(Mission_list[*count].mission_name,OEM_MISSION_NAME);
Mission_list[*count].anarchy_only_flag = 0;
break;
default:
Warning("Unknown hogsize %d, trying %s\n", builtin_mission_hogsize, FULL_MISSION_FILENAME);
Int3(); //fall through
case FULL_MISSION_HOGSIZE:
if (!read_mission_file(FULL_MISSION_FILENAME,0,ML_CURDIR))
Error("Could not find required mission file <%s>", FULL_MISSION_FILENAME);
}
builtin_mission = strdup(Mission_list[*count].filename);
++(*count);
}
void add_missions_to_list(char *search_name, int *count, int anarchy_mode)
{
FILEFINDSTRUCT find;
if( !FileFindFirst( search_name, &find ) ) {
do {
@ -362,7 +357,7 @@ void promote (char * mission_name, int * top_place, int num_missions) {
strcpy(name, mission_name);
if ((t = strchr(name,'.')) != NULL)
*t = 0; //kill extension
printf("mission_name:%s\n", name);
printf("promoting: %s\n", name);
for (i = *top_place; i < num_missions; i++)
if (!stricmp(Mission_list[i].filename, name)) {
//swap mission positions
@ -404,11 +399,7 @@ int build_mission_list(int anarchy_mode)
//@@ return num_missions;
//@@ }
if (!read_mission_file(BUILTIN_MISSION,0,ML_CURDIR)) //read built-in first
Error("Could not find required mission file <%s>",BUILTIN_MISSION);
count = 1;
add_builtin_mission_to_list(&count); //read built-in first
add_missions_to_list(MISSION_DIR "*.mn2", &count, anarchy_mode);
add_missions_to_list(MISSION_DIR "*.msn", &count, anarchy_mode);
@ -426,7 +417,7 @@ int build_mission_list(int anarchy_mode)
// to top of mission list
top_place = 0;
promote("descent", &top_place, count); // original descent 1 mission
promote(BUILTIN_MISSION, &top_place, count); // descent 2 (demo?)
promote(builtin_mission, &top_place, count); // descent 2
promote("d2x", &top_place, count); // vertigo
if (count > top_place)
@ -463,11 +454,23 @@ int load_mission(int mission_num)
int found_hogfile;
int enhanced_mission = 0;
if (!strcmp(Mission_list[mission_num].filename, builtin_mission)) {
switch (builtin_mission_hogsize) {
case SHAREWARE_MISSION_HOGSIZE:
case MAC_SHARE_MISSION_HOGSIZE:
return load_mission_shareware(mission_num);
break;
case OEM_MISSION_HOGSIZE:
return load_mission_oem(mission_num);
break;
}
}
Current_mission_num = mission_num;
mprintf(( 0, "Loading mission %d\n", mission_num ));
//read mission from file
//read mission from file
switch (Mission_list[mission_num].location) {
case ML_MISSIONDIR:
@ -495,7 +498,7 @@ int load_mission(int mission_num)
}
//for non-builtin missions, load HOG
if (strcmp(Mission_list[mission_num].filename, BUILTIN_MISSION)) {
if (strcmp(Mission_list[mission_num].filename, builtin_mission)) {
strcpy(buf+strlen(buf)-4,".hog"); //change extension
@ -631,7 +634,3 @@ int load_mission_by_name(char *mission_name)
return 0; //couldn't find mission
}
#endif // ifdef, else D2_OEM
#endif // ifdef, else SHAREWARE