summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2005-10-02 04:16:47 +0000
committerSimon Howard2005-10-02 04:16:47 +0000
commit1df239e48379803dad2826fc0960574feab622c0 (patch)
tree365e2d3498633d43f362db95ab64377a86f123c1
parent2e2f520fbb35382f545f31ff12d6ece991b05527 (diff)
downloadchocolate-doom-1df239e48379803dad2826fc0960574feab622c0.tar.gz
chocolate-doom-1df239e48379803dad2826fc0960574feab622c0.tar.bz2
chocolate-doom-1df239e48379803dad2826fc0960574feab622c0.zip
Fixes for Final Doom
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 149
-rw-r--r--src/d_main.c11
-rw-r--r--src/f_finale.c171
2 files changed, 70 insertions, 112 deletions
diff --git a/src/d_main.c b/src/d_main.c
index 5e5d93b1..5953a991 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: d_main.c 120 2005-09-22 13:13:47Z fraggle $
+// $Id: d_main.c 149 2005-10-02 04:16:47Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.16 2005/10/02 04:16:47 fraggle
+// Fixes for Final Doom
+//
// Revision 1.15 2005/09/22 13:13:47 fraggle
// Remove external statistics driver support (-statcopy):
// nonfunctional on modern systems and never used.
@@ -87,7 +90,7 @@
//-----------------------------------------------------------------------------
-static const char rcsid[] = "$Id: d_main.c 120 2005-09-22 13:13:47Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 149 2005-10-02 04:16:47Z fraggle $";
#define BGCOLOR 7
#define FGCOLOR 8
@@ -682,6 +685,8 @@ static void IdentifyIWADByName(char *name)
{
int i;
+ gamemission = none;
+
for (i=0; i<sizeof(iwads) / sizeof(*iwads); ++i)
{
if (strlen(name) < strlen(iwads[i].name))
@@ -696,8 +701,6 @@ static void IdentifyIWADByName(char *name)
break;
}
}
-
- gamemission = none;
}
//
diff --git a/src/f_finale.c b/src/f_finale.c
index 803cef33..f72f6c5a 100644
--- a/src/f_finale.c
+++ b/src/f_finale.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: f_finale.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: f_finale.c 149 2005-10-02 04:16:47Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.3 2005/10/02 04:16:47 fraggle
+// Fixes for Final Doom
+//
// Revision 1.2 2005/07/23 16:44:55 fraggle
// Update copyright to GNU GPL
//
@@ -36,7 +39,7 @@
static const char
-rcsid[] = "$Id: f_finale.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: f_finale.c 149 2005-10-02 04:16:47Z fraggle $";
#include <ctype.h>
@@ -69,31 +72,42 @@ int finalecount;
#define TEXTSPEED 3
#define TEXTWAIT 250
-char* e1text = E1TEXT;
-char* e2text = E2TEXT;
-char* e3text = E3TEXT;
-char* e4text = E4TEXT;
-
-char* c1text = C1TEXT;
-char* c2text = C2TEXT;
-char* c3text = C3TEXT;
-char* c4text = C4TEXT;
-char* c5text = C5TEXT;
-char* c6text = C6TEXT;
-
-char* p1text = P1TEXT;
-char* p2text = P2TEXT;
-char* p3text = P3TEXT;
-char* p4text = P4TEXT;
-char* p5text = P5TEXT;
-char* p6text = P6TEXT;
-
-char* t1text = T1TEXT;
-char* t2text = T2TEXT;
-char* t3text = T3TEXT;
-char* t4text = T4TEXT;
-char* t5text = T5TEXT;
-char* t6text = T6TEXT;
+typedef struct
+{
+ GameMission_t mission;
+ int episode, level;
+ char *background;
+ char *text;
+} textscreen_t;
+
+static textscreen_t textscreens[] =
+{
+ { doom, 1, 8, "FLOOR4_8", E1TEXT},
+ { doom, 2, 8, "SFLR6_1", E2TEXT},
+ { doom, 3, 8, "MFLR8_4", E3TEXT},
+ { doom, 4, 8, "MFLR8_3", E4TEXT},
+
+ { doom2, 1, 6, "SLIME16", C1TEXT},
+ { doom2, 1, 11, "RROCK14", C2TEXT},
+ { doom2, 1, 20, "RROCK07", C3TEXT},
+ { doom2, 1, 30, "RROCK17", C4TEXT},
+ { doom2, 1, 15, "RROCK13", C5TEXT},
+ { doom2, 1, 31, "RROCK19", C6TEXT},
+
+ { pack_tnt, 1, 6, "SLIME16", T1TEXT},
+ { pack_tnt, 1, 11, "RROCK14", T2TEXT},
+ { pack_tnt, 1, 20, "RROCK07", T3TEXT},
+ { pack_tnt, 1, 30, "RROCK17", T4TEXT},
+ { pack_tnt, 1, 15, "RROCK13", T5TEXT},
+ { pack_tnt, 1, 31, "RROCK19", T6TEXT},
+
+ { pack_plut, 1, 6, "SLIME16", P1TEXT},
+ { pack_plut, 1, 11, "RROCK14", P2TEXT},
+ { pack_plut, 1, 20, "RROCK07", P3TEXT},
+ { pack_plut, 1, 30, "RROCK17", P4TEXT},
+ { pack_plut, 1, 15, "RROCK13", P5TEXT},
+ { pack_plut, 1, 31, "RROCK19", P6TEXT},
+};
char* finaletext;
char* finaleflat;
@@ -108,94 +122,35 @@ void F_CastDrawer (void);
//
void F_StartFinale (void)
{
+ int i;
+
gameaction = ga_nothing;
gamestate = GS_FINALE;
viewactive = false;
automapactive = false;
- // Okay - IWAD dependend stuff.
- // This has been changed severly, and
- // some stuff might have changed in the process.
- switch ( gamemode )
+ if (gamemission == doom)
{
+ S_ChangeMusic(mus_victor, true);
+ }
+ else
+ {
+ S_ChangeMusic(mus_read_m, true);
+ }
- // DOOM 1 - E1, E3 or E4, but each nine missions
- case shareware:
- case registered:
- case retail:
- {
- S_ChangeMusic(mus_victor, true);
-
- switch (gameepisode)
- {
- case 1:
- finaleflat = "FLOOR4_8";
- finaletext = e1text;
- break;
- case 2:
- finaleflat = "SFLR6_1";
- finaletext = e2text;
- break;
- case 3:
- finaleflat = "MFLR8_4";
- finaletext = e3text;
- break;
- case 4:
- finaleflat = "MFLR8_3";
- finaletext = e4text;
- break;
- default:
- // Ouch.
- break;
- }
- break;
- }
-
- // DOOM II and missions packs with E1, M34
- case commercial:
- {
- S_ChangeMusic(mus_read_m, true);
-
- switch (gamemap)
- {
- case 6:
- finaleflat = "SLIME16";
- finaletext = c1text;
- break;
- case 11:
- finaleflat = "RROCK14";
- finaletext = c2text;
- break;
- case 20:
- finaleflat = "RROCK07";
- finaletext = c3text;
- break;
- case 30:
- finaleflat = "RROCK17";
- finaletext = c4text;
- break;
- case 15:
- finaleflat = "RROCK13";
- finaletext = c5text;
- break;
- case 31:
- finaleflat = "RROCK19";
- finaletext = c6text;
- break;
- default:
- // Ouch.
- break;
- }
- break;
- }
-
-
- // Indeterminate.
- default:
- S_ChangeMusic(mus_read_m, true);
- finaleflat = "F_SKY1"; // Not used anywhere else.
- finaletext = c1text; // FIXME - other text, music?
- break;
+ // Find the right screen and set the text and background
+
+ for (i=0; i<sizeof(textscreens) / sizeof(textscreen_t); ++i)
+ {
+ textscreen_t *screen = &textscreens[i];
+
+ if (gamemission == screen->mission
+ && (gamemission != doom || gameepisode == screen->episode)
+ && gamemap == screen->level)
+ {
+ finaletext = screen->text;
+ finaleflat = screen->background;
+ }
}
finalestage = 0;