Skip to content

Commit

Permalink
Fixed: "No intermission screen after map30" (see here: http://sourcef…
Browse files Browse the repository at this point in the history
…orge.net/tracker/?func=detail&aid=2831630&group_id=74815&atid=542099).

Changed: "After" InFine scripts are now executed after any intermission rather than before it.
Added: New Map Info flag mif_nointermission; upon leaving the map, if this flag is set the intermission will be skipped.
  • Loading branch information
danij committed Aug 29, 2009
1 parent 2aaf76b commit 627125d
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 43 deletions.
1 change: 1 addition & 0 deletions doomsday/engine/defs/flags.ded
Expand Up @@ -77,6 +77,7 @@ Flag { ID = "mif_fog"; Value = 0x1; }
Flag { # Draw the sky sphere even when models are in use.
ID = "mif_sphere"; Value = 0x2;
}
Flag { ID = "mif_nointermission"; Value = 0x4; }

# Sky Info
Flag { # Draw the sky sphere even when models are in use.
Expand Down
7 changes: 6 additions & 1 deletion doomsday/engine/portable/include/def_share.h
Expand Up @@ -97,11 +97,16 @@ typedef struct {
char* text; // Pointer to the text (don't modify).
} ddtext_t;

// Map Info flags.
#define MIF_FOG 0x1 // Fog is used in the map.
#define MIF_DRAW_SPHERE 0x2 // Always draw the sky sphere.
#define MIF_NO_INTERMISSION 0x4 // Skip any intermission between maps.

typedef struct {
char* name;
char* author;
int music;
int flags;
int flags; // MIF_* flags.
float ambient;
float gravity;
float parTime;
Expand Down
4 changes: 0 additions & 4 deletions doomsday/engine/portable/include/r_world.h
Expand Up @@ -50,10 +50,6 @@ extern int rendSkyLight; // cvar
extern boolean ddMapSetup;
extern skyfix_t skyFix[2]; // [floor, ceiling]

// Map Info flags.
#define MIF_FOG 0x1 // Fog is used in the map.
#define MIF_DRAW_SPHERE 0x2 // Always draw the sky sphere.

// Sky flags.
#define SIF_DRAW_SPHERE 0x1 // Always draw the sky sphere.

Expand Down
70 changes: 40 additions & 30 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -1106,12 +1106,17 @@ Con_Message("G_Ticker: Removing player %i's mobj.\n", i);
case GA_SINGLEREBORN:
G_DoSingleReborn();
break;
#endif

case GA_LEAVEMAP:
#if __JHEXEN__ || __JSTRIFE__
//Draw_TeleportIcon();
G_DoTeleportNewMap();
break;
#else
G_DoWorldDone();
#endif
break;

case GA_LOADMAP:
G_DoLoadMap();
break;
Expand All @@ -1136,10 +1141,6 @@ Con_Message("G_Ticker: Removing player %i's mobj.\n", i);
G_SetGameAction(GA_NONE);
break;

case GA_WORLDDONE:
G_DoWorldDone();
break;

case GA_SCREENSHOT:
G_DoScreenShot();
G_SetGameAction(GA_NONE);
Expand Down Expand Up @@ -1574,17 +1575,6 @@ void G_StartNewGame(skillmode_t skill)
G_InitNew(dSkill, 1, realMap);
}

/**
* Only called by the warp cheat code. Works just like normal map to map
* teleporting, but doesn't do any interlude stuff.
*/
void G_TeleportNewMap(int map, int position)
{
G_SetGameAction(GA_LEAVEMAP);
leaveMap = map;
leavePosition = position;
}

void G_DoTeleportNewMap(void)
{
// Clients trust the server in these things.
Expand Down Expand Up @@ -1681,22 +1671,12 @@ boolean G_IfVictory(void)

void G_DoCompleted(void)
{
int i;
int i;

#if __JHERETIC__
static int afterSecret[5] = { 7, 5, 5, 5, 4 };
#endif

// Clear the currently playing script, if any.
FI_Reset();

// Is there a debriefing for this map?
if(FI_Debriefing(gameEpisode, gameMap))
return;

// We have either just returned from a debriefing or there wasn't one.
briefDisabled = false;

G_SetGameAction(GA_NONE);

for(i = 0; i < MAXPLAYERS; ++i)
Expand All @@ -1713,6 +1693,23 @@ void G_DoCompleted(void)
}
}

// Go to an intermission?
#if __JDOOM__ || __JHERETIC__ || __JDOOM64__
{
ddmapinfo_t minfo;
char levid[8];

P_GetMapLumpName(gameEpisode, gameMap, levid);

// See if there is a par time definition.
if(Def_Get(DD_DEF_MAP_INFO, levid, &minfo) && (minfo.flags & MIF_NO_INTERMISSION))
{
G_WorldDone();
return;
}
}
#endif

// Has the player completed the game?
if(G_IfVictory())
return; // Victorious!
Expand Down Expand Up @@ -1903,12 +1900,25 @@ void G_PrepareWIData(void)

void G_WorldDone(void)
{
G_SetGameAction(GA_WORLDDONE);

#if __JDOOM__ || __JDOOM64__
#if !__JHEXEN__
#else
# if __JDOOM__ || __JDOOM64__
if(secretExit)
players[CONSOLEPLAYER].didSecret = true;
# endif
#endif

// Clear the currently playing script, if any.
FI_Reset();

// Is there a debriefing for this map?
if(FI_Debriefing(gameEpisode, gameMap))
return;

// We have either just returned from a debriefing or there wasn't one.
briefDisabled = false;

G_SetGameAction(GA_LEAVEMAP);
}

void G_DoWorldDone(void)
Expand Down
4 changes: 4 additions & 0 deletions doomsday/plugins/jdoom/defs/doom1maps.ded
Expand Up @@ -67,6 +67,7 @@ Copy Map Info {
ID = "E1M8";
Name = "HUSTR_E1M8";
Music = "e1m8";
Flags = nointermission;
Par time = 30;
}

Expand Down Expand Up @@ -134,6 +135,7 @@ Copy Map Info {
ID = "E2M8";
Name = "HUSTR_E2M8";
Music = "e2m8";
Flags = nointermission;
Par time = 30;
}

Expand Down Expand Up @@ -198,6 +200,7 @@ Copy Map Info {
ID = "E3M8";
Name = "HUSTR_E3M8";
Music = "e3m8";
Flags = nointermission;
Par time = 30;
}

Expand Down Expand Up @@ -265,6 +268,7 @@ Copy Map Info {
ID = "E4M8";
Name = "HUSTR_E4M8";
Music = "e2m5";
Flags = nointermission;
# Doesn't have a par time
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jdoom/include/d_event.h
Expand Up @@ -44,7 +44,7 @@ typedef enum {
GA_SAVEGAME,
GA_COMPLETED,
GA_VICTORY,
GA_WORLDDONE,
GA_LEAVEMAP,
GA_SCREENSHOT
} gameaction_t;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jdoom64/include/doomdef.h
Expand Up @@ -116,7 +116,7 @@ typedef enum {
GA_SAVEGAME,
GA_COMPLETED,
GA_VICTORY,
GA_WORLDDONE,
GA_LEAVEMAP,
GA_SCREENSHOT
} gameaction_t;

Expand Down
5 changes: 5 additions & 0 deletions doomsday/plugins/jheretic/defs/maps.ded
Expand Up @@ -62,6 +62,7 @@ Copy Map Info {
ID = "E1M8";
Name = "HUSTR_E1M8";
Music = "e1m8";
Flags = nointermission;
}

Copy Map Info {
Expand Down Expand Up @@ -120,6 +121,7 @@ Copy Map Info {
ID = "E2M8";
Name = "HUSTR_E2M8";
Music = "e2m8";
Flags = nointermission;
}

Copy Map Info {
Expand Down Expand Up @@ -175,6 +177,7 @@ Copy Map Info {
ID = "E3M8";
Name = "HUSTR_E3M8";
Music = "e1m9";
Flags = nointermission;
}

Copy Map Info {
Expand Down Expand Up @@ -233,6 +236,7 @@ Copy Map Info {
ID = "E4M8";
Name = "HUSTR_E4M8";
Music = "e1m8";
Flags = nointermission;
}

Copy Map Info {
Expand Down Expand Up @@ -288,6 +292,7 @@ Copy Map Info {
ID = "E5M8";
Name = "HUSTR_E5M8";
Music = "e2m8";
Flags = nointermission;
}

Copy Map Info {
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jheretic/include/h_event.h
Expand Up @@ -43,7 +43,7 @@ typedef enum {
GA_SAVEGAME,
GA_COMPLETED,
GA_VICTORY,
GA_WORLDDONE,
GA_LEAVEMAP,
GA_SCREENSHOT
} gameaction_t;

Expand Down
1 change: 0 additions & 1 deletion doomsday/plugins/jhexen/include/h2def.h
Expand Up @@ -365,7 +365,6 @@ void G_RecordDemo(skillmode_t skill, int numplayers, int episode,
int map, char* name);
void G_PlayDemo(char* name);
void G_TimeDemo(char* name);
void G_TeleportNewMap(int map, int position);
void G_LeaveMap(int map, int position, boolean secret);
void G_StartNewGame(skillmode_t skill);
void G_StartNewInit(void);
Expand Down
1 change: 0 additions & 1 deletion doomsday/plugins/jhexen/include/x_event.h
Expand Up @@ -45,7 +45,6 @@ typedef enum {
GA_LEAVEMAP,
GA_SINGLEREBORN,
GA_VICTORY,
GA_WORLDDONE,
GA_SCREENSHOT
} gameaction_t;

Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/jhexen/src/in_lude.c
Expand Up @@ -125,7 +125,7 @@ void IN_Start(void)
// InFine handles the text.
if(!deathmatch)
{
G_SetGameAction(GA_LEAVEMAP);
G_WorldDone();
return;
}

Expand All @@ -143,7 +143,7 @@ void WaitStop(void)
if(!--cnt)
{
IN_Stop();
G_SetGameAction(GA_LEAVEMAP);
G_WorldDone();
}
}

Expand Down
5 changes: 4 additions & 1 deletion doomsday/plugins/jhexen/src/m_cheat.c
Expand Up @@ -777,7 +777,10 @@ static void CheatWarpFunc(player_t* player, cheat_t* cheat)
P_SetMessage(player, TXT_CHEATWARP, false);

Hu_MenuCommand(MCMD_CLOSE);
G_TeleportNewMap(map, 0);

leaveMap = map;
leavePosition = 0;
G_WorldDone();
}

static void CheatPigFunc(player_t* player, cheat_t* cheat)
Expand Down

0 comments on commit 627125d

Please sign in to comment.