From 627125dc1c0422d332e5dbac2c04f35b5d14dc55 Mon Sep 17 00:00:00 2001 From: danij Date: Sat, 29 Aug 2009 08:52:49 +0100 Subject: [PATCH] Fixed: "No intermission screen after map30" (see here: http://sourceforge.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. --- doomsday/engine/defs/flags.ded | 1 + doomsday/engine/portable/include/def_share.h | 7 +- doomsday/engine/portable/include/r_world.h | 4 -- doomsday/plugins/common/src/g_game.c | 70 +++++++++++--------- doomsday/plugins/jdoom/defs/doom1maps.ded | 4 ++ doomsday/plugins/jdoom/include/d_event.h | 2 +- doomsday/plugins/jdoom64/include/doomdef.h | 2 +- doomsday/plugins/jheretic/defs/maps.ded | 5 ++ doomsday/plugins/jheretic/include/h_event.h | 2 +- doomsday/plugins/jhexen/include/h2def.h | 1 - doomsday/plugins/jhexen/include/x_event.h | 1 - doomsday/plugins/jhexen/src/in_lude.c | 4 +- doomsday/plugins/jhexen/src/m_cheat.c | 5 +- 13 files changed, 65 insertions(+), 43 deletions(-) diff --git a/doomsday/engine/defs/flags.ded b/doomsday/engine/defs/flags.ded index 2550de9cc9..cab11729b0 100644 --- a/doomsday/engine/defs/flags.ded +++ b/doomsday/engine/defs/flags.ded @@ -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. diff --git a/doomsday/engine/portable/include/def_share.h b/doomsday/engine/portable/include/def_share.h index c9b296a01d..9dc5946526 100644 --- a/doomsday/engine/portable/include/def_share.h +++ b/doomsday/engine/portable/include/def_share.h @@ -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; diff --git a/doomsday/engine/portable/include/r_world.h b/doomsday/engine/portable/include/r_world.h index 68e8f03e98..e8591b77ac 100644 --- a/doomsday/engine/portable/include/r_world.h +++ b/doomsday/engine/portable/include/r_world.h @@ -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. diff --git a/doomsday/plugins/common/src/g_game.c b/doomsday/plugins/common/src/g_game.c index d57db1be51..d769e4e76d 100644 --- a/doomsday/plugins/common/src/g_game.c +++ b/doomsday/plugins/common/src/g_game.c @@ -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; @@ -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); @@ -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. @@ -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) @@ -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! @@ -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) diff --git a/doomsday/plugins/jdoom/defs/doom1maps.ded b/doomsday/plugins/jdoom/defs/doom1maps.ded index c24d1e74d0..7eecd973a9 100644 --- a/doomsday/plugins/jdoom/defs/doom1maps.ded +++ b/doomsday/plugins/jdoom/defs/doom1maps.ded @@ -67,6 +67,7 @@ Copy Map Info { ID = "E1M8"; Name = "HUSTR_E1M8"; Music = "e1m8"; + Flags = nointermission; Par time = 30; } @@ -134,6 +135,7 @@ Copy Map Info { ID = "E2M8"; Name = "HUSTR_E2M8"; Music = "e2m8"; + Flags = nointermission; Par time = 30; } @@ -198,6 +200,7 @@ Copy Map Info { ID = "E3M8"; Name = "HUSTR_E3M8"; Music = "e3m8"; + Flags = nointermission; Par time = 30; } @@ -265,6 +268,7 @@ Copy Map Info { ID = "E4M8"; Name = "HUSTR_E4M8"; Music = "e2m5"; + Flags = nointermission; # Doesn't have a par time } diff --git a/doomsday/plugins/jdoom/include/d_event.h b/doomsday/plugins/jdoom/include/d_event.h index bdf50c5cd7..c671e67430 100644 --- a/doomsday/plugins/jdoom/include/d_event.h +++ b/doomsday/plugins/jdoom/include/d_event.h @@ -44,7 +44,7 @@ typedef enum { GA_SAVEGAME, GA_COMPLETED, GA_VICTORY, - GA_WORLDDONE, + GA_LEAVEMAP, GA_SCREENSHOT } gameaction_t; diff --git a/doomsday/plugins/jdoom64/include/doomdef.h b/doomsday/plugins/jdoom64/include/doomdef.h index 6c47cd57ce..dabc5fa806 100644 --- a/doomsday/plugins/jdoom64/include/doomdef.h +++ b/doomsday/plugins/jdoom64/include/doomdef.h @@ -116,7 +116,7 @@ typedef enum { GA_SAVEGAME, GA_COMPLETED, GA_VICTORY, - GA_WORLDDONE, + GA_LEAVEMAP, GA_SCREENSHOT } gameaction_t; diff --git a/doomsday/plugins/jheretic/defs/maps.ded b/doomsday/plugins/jheretic/defs/maps.ded index efbb76b831..c76b852ec3 100644 --- a/doomsday/plugins/jheretic/defs/maps.ded +++ b/doomsday/plugins/jheretic/defs/maps.ded @@ -62,6 +62,7 @@ Copy Map Info { ID = "E1M8"; Name = "HUSTR_E1M8"; Music = "e1m8"; + Flags = nointermission; } Copy Map Info { @@ -120,6 +121,7 @@ Copy Map Info { ID = "E2M8"; Name = "HUSTR_E2M8"; Music = "e2m8"; + Flags = nointermission; } Copy Map Info { @@ -175,6 +177,7 @@ Copy Map Info { ID = "E3M8"; Name = "HUSTR_E3M8"; Music = "e1m9"; + Flags = nointermission; } Copy Map Info { @@ -233,6 +236,7 @@ Copy Map Info { ID = "E4M8"; Name = "HUSTR_E4M8"; Music = "e1m8"; + Flags = nointermission; } Copy Map Info { @@ -288,6 +292,7 @@ Copy Map Info { ID = "E5M8"; Name = "HUSTR_E5M8"; Music = "e2m8"; + Flags = nointermission; } Copy Map Info { diff --git a/doomsday/plugins/jheretic/include/h_event.h b/doomsday/plugins/jheretic/include/h_event.h index 3a679722b2..cea51feb38 100644 --- a/doomsday/plugins/jheretic/include/h_event.h +++ b/doomsday/plugins/jheretic/include/h_event.h @@ -43,7 +43,7 @@ typedef enum { GA_SAVEGAME, GA_COMPLETED, GA_VICTORY, - GA_WORLDDONE, + GA_LEAVEMAP, GA_SCREENSHOT } gameaction_t; diff --git a/doomsday/plugins/jhexen/include/h2def.h b/doomsday/plugins/jhexen/include/h2def.h index b9404635b0..f016b27f3a 100644 --- a/doomsday/plugins/jhexen/include/h2def.h +++ b/doomsday/plugins/jhexen/include/h2def.h @@ -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); diff --git a/doomsday/plugins/jhexen/include/x_event.h b/doomsday/plugins/jhexen/include/x_event.h index 90ddec9368..22e430cdfc 100644 --- a/doomsday/plugins/jhexen/include/x_event.h +++ b/doomsday/plugins/jhexen/include/x_event.h @@ -45,7 +45,6 @@ typedef enum { GA_LEAVEMAP, GA_SINGLEREBORN, GA_VICTORY, - GA_WORLDDONE, GA_SCREENSHOT } gameaction_t; diff --git a/doomsday/plugins/jhexen/src/in_lude.c b/doomsday/plugins/jhexen/src/in_lude.c index 263c35cf7b..62b87498c4 100644 --- a/doomsday/plugins/jhexen/src/in_lude.c +++ b/doomsday/plugins/jhexen/src/in_lude.c @@ -125,7 +125,7 @@ void IN_Start(void) // InFine handles the text. if(!deathmatch) { - G_SetGameAction(GA_LEAVEMAP); + G_WorldDone(); return; } @@ -143,7 +143,7 @@ void WaitStop(void) if(!--cnt) { IN_Stop(); - G_SetGameAction(GA_LEAVEMAP); + G_WorldDone(); } } diff --git a/doomsday/plugins/jhexen/src/m_cheat.c b/doomsday/plugins/jhexen/src/m_cheat.c index 17de334390..e0b5a74667 100644 --- a/doomsday/plugins/jhexen/src/m_cheat.c +++ b/doomsday/plugins/jhexen/src/m_cheat.c @@ -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)