Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heretic umapinfo support #532

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion prboom2/src/dsda/mapinfo/u.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ extern int finalecount;
extern const char* finaletext;
extern const char* finaleflat;
extern const char* finalepatch;
extern const char* endpic;
extern int acceleratestage;
extern int midstage;

Expand Down Expand Up @@ -246,6 +247,8 @@ int dsda_UStartFinale(void) {

if (!finaleflat)
finaleflat = "FLOOR4_8"; // use a single fallback for all maps.

endpic = gamemapinfo->endpic;

return true;
}
Expand Down Expand Up @@ -499,7 +502,7 @@ int dsda_UPrepareFinale(int* result) {
void dsda_ULoadMapInfo(void) {
int p;

if (dsda_Flag(dsda_arg_nomapinfo) || dsda_UseMapinfo() || raven)
if (dsda_Flag(dsda_arg_nomapinfo) || dsda_UseMapinfo() || hexen)
return;

p = -1;
Expand Down
10 changes: 6 additions & 4 deletions prboom2/src/f_finale.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ int finalecount;
const char* finaletext;
const char* finaleflat;
const char* finalepatch;
const char* endpic;

// defines for the end mission display text // phares

Expand All @@ -88,6 +89,11 @@ void F_StartFinale (void)
int mnum;
int muslump;

finaletext = NULL;
finaleflat = NULL;
finalepatch = NULL;
endpic = NULL;

if (heretic) return Heretic_F_StartFinale();
if (hexen) return Hexen_F_StartFinale();

Expand All @@ -98,10 +104,6 @@ void F_StartFinale (void)
// killough 3/28/98: clear accelerative text flags
acceleratestage = midstage = 0;

finaletext = NULL;
finaleflat = NULL;
finalepatch = NULL;

dsda_InterMusic(&mnum, &muslump);

if (muslump >= 0)
Expand Down
49 changes: 41 additions & 8 deletions prboom2/src/heretic/f_finale.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@
#include "sounds.h"

#include "dsda/palette.h"
#include "dsda/mapinfo.h"

#include "heretic/def.h"
#include "heretic/dstrings.h"

#include "heretic/f_finale.h"

static int finalestage; // 0 = text, 1 = art screen
static int finalecount;

#define TEXTSPEED 3
#define TEXTWAIT 250

static const char *finaletext;
static const char *finaleflat;
extern int finalestage; // 0 = text, 1 = art screen
extern int finalecount;
extern const char *finaletext;
extern const char *finaleflat;
extern const char* finalepatch;
extern const char* endpic;
extern dboolean finalintermission;

static int FontABaseLump;

Expand Down Expand Up @@ -77,10 +80,23 @@ void Heretic_F_StartFinale(void)
break;
}

FontABaseLump = W_GetNumForName("FONTA_S") + 1;

int mnum, muslump;
dsda_InterMusic(&mnum, &muslump);
if (muslump >= 0)
{
S_ChangeMusInfoMusic(muslump, true);
}
else
{
S_ChangeMusic(heretic_mus_cptd, true);
}

dsda_StartFinale();

finalestage = 0;
finalecount = 0;
FontABaseLump = W_GetNumForName("FONTA_S") + 1;
S_ChangeMusic(heretic_mus_cptd, true);
}

dboolean F_BlockingInput(void)
Expand Down Expand Up @@ -148,7 +164,14 @@ void Heretic_F_TextWrite(void)
//
// erase the entire screen to a tiled background
//
V_DrawBackground(finaleflat, 0);
if (finalepatch)
{
V_DrawNamePatch(0, 0, 0, finalepatch, CR_DEFAULT, VPT_STRETCH);
}
else
{
V_DrawBackground(finaleflat, 0);
}

//
// draw some of the text onto the screen
Expand Down Expand Up @@ -258,6 +281,16 @@ void Heretic_F_Drawer(void)
Heretic_F_TextWrite();
else
{
if (!finalintermission)
{
gameaction = ga_worlddone;
return;
}
if (endpic)
{
V_DrawNamePatch(0, 0, 0, endpic, CR_DEFAULT, VPT_STRETCH);
return;
}
switch (gameepisode)
{
case 1:
Expand Down
Loading
Loading