Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Refactor|libheretic: Remodeled intermission to more closely follow li…
…bdoom
  • Loading branch information
danij-deng committed Aug 24, 2014
1 parent 4b3be6b commit 8f489e4
Show file tree
Hide file tree
Showing 5 changed files with 703 additions and 661 deletions.
12 changes: 7 additions & 5 deletions doomsday/plugins/common/src/d_netcl.cpp
Expand Up @@ -677,9 +677,9 @@ void NetCl_Intermission(reader_s *msg)
#if __JDOOM__ || __JDOOM64__
WI_Begin(wmInfo);
#elif __JHERETIC__
IN_Init(wmInfo);
IN_Begin(wmInfo);
#elif __JHEXEN__
IN_Init();
IN_Begin();
#endif
#if __JDOOM64__
S_StartMusic("dm2int", true);
Expand All @@ -698,7 +698,7 @@ void NetCl_Intermission(reader_s *msg)
#if __JDOOM__ || __JDOOM64__
WI_End();
#elif __JHERETIC__ || __JHEXEN__
IN_Stop();
IN_End();
#endif
}

Expand All @@ -707,13 +707,15 @@ void NetCl_Intermission(reader_s *msg)
#if __JDOOM__ || __JDOOM64__
WI_SetState(interludestate_t(Reader_ReadInt16(msg)));
#elif __JHERETIC__ || __JHEXEN__
interState = Reader_ReadInt16(msg);
IN_SetState(Reader_ReadInt16(msg));
#endif
}

#if __JHERETIC__
if(flags & IMF_TIME)
interTime = Reader_ReadUInt16(msg);
{
IN_SetTime(Reader_ReadUInt16(msg));
}
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -2316,9 +2316,9 @@ static int prepareIntermission(void * /*context*/)
#if __JDOOM__ || __JDOOM64__
WI_Begin(wmInfo);
#elif __JHERETIC__
IN_Init(wmInfo);
IN_Begin(wmInfo);
#else /* __JHEXEN__ */
IN_Init();
IN_Begin();
#endif
G_ChangeGameState(GS_INTERMISSION);

Expand Down
48 changes: 31 additions & 17 deletions doomsday/plugins/heretic/include/in_lude.h
Expand Up @@ -28,12 +28,8 @@
#include "h_player.h"
#include <doomsday/uri.h>

extern dd_bool intermission;
extern int interState;
extern int interTime;

/**
* Structure passed to IN_Init(), etc...
* Structure passed to IN_Begin(), etc...
*/
/*struct wbplayerstruct_t
{
Expand Down Expand Up @@ -63,8 +59,8 @@ struct wbstartstruct_t
*/
};

/// To be called to register the console commands and variables of this module.
void WI_ConsoleRegister();
void IN_Init();
void IN_Shutdown();

/**
* Begin the intermission using the given game session and player configuration.
Expand All @@ -74,21 +70,39 @@ void WI_ConsoleRegister();
* this structure is @em not modified while the intermission
* is in progress.
*/
void IN_Init(wbstartstruct_t const &wbstartstruct);
void IN_Begin(wbstartstruct_t const &wbstartstruct);

void IN_SkipToNext();
void IN_Stop();
/**
* End the current intermission.
*/
void IN_End();

/**
* Process game tic for the intermission.
*
* @note Handles user input due to timing issues in netgames.
*/
void IN_Ticker();

/**
* Draw the intermission.
*/
void IN_Drawer();

void IN_WaitStop();
void IN_LoadPics();
void IN_UnloadPics();
void IN_CheckForSkip();
void IN_InitStats();
void IN_InitDeathmatchStats();
void IN_InitNetgameStats();
/**
* Change the current intermission state.
*/
void IN_SetState(int stateNum /*interludestate_t st*/);

void IN_SetTime(int time);

/**
* Skip to the next state in the intermission.
*/
void IN_SkipToNext();

/// To be called to register the console commands and variables of this module.
void WI_ConsoleRegister();

#endif // __cplusplus
#endif // LIBHERETIC_IN_LUDE_H
4 changes: 2 additions & 2 deletions doomsday/plugins/heretic/src/h_main.cpp
Expand Up @@ -330,11 +330,10 @@ void H_PostInit()
/// @todo Do this properly!
::borderGraphics[0] = (::gameMode == heretic_shareware)? "Flats:FLOOR04" : "Flats:FLAT513";

// Common post init routine.
G_CommonPostInit();

// Initialize weapon info using definitions.
P_InitWeaponInfo();
IN_Init();

// Game parameters.
::monsterInfight = GetDefInt("AI|Infight", 0);
Expand Down Expand Up @@ -392,5 +391,6 @@ void H_PostInit()
void H_Shutdown()
{
P_ShutdownInventory();
IN_Shutdown();
G_CommonShutdown();
}

0 comments on commit 8f489e4

Please sign in to comment.