Skip to content

Commit

Permalink
Refactor|libhexen: Renamed intermission API functions to follow libdoom
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Aug 24, 2014
1 parent bd7a665 commit 7cf1c80
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 23 deletions.
37 changes: 31 additions & 6 deletions doomsday/plugins/hexen/include/in_lude.h
Expand Up @@ -27,17 +27,42 @@

#include "h2def.h"

extern dd_bool intermission;
extern int interState;
/**
* Begin the intermission.
*/
void IN_Begin();

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

void IN_Init();
void IN_Stop();
/**
* 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();

/**
* 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 // LIBHEXEN_IN_LUDE_H
36 changes: 19 additions & 17 deletions doomsday/plugins/hexen/src/in_lude.cpp
Expand Up @@ -82,12 +82,6 @@ static int hubCount;
static patchid_t dpTallyTop;
static patchid_t dpTallyLeft;

void WI_ConsoleRegister()
{
C_VAR_BYTE("inlude-stretch", &cfg.inludeScaleMode, 0, SCALEMODE_FIRST, SCALEMODE_LAST);
C_VAR_INT ("inlude-patch-replacement", &cfg.inludePatchReplaceMode, 0, 0, 1);
}

void WI_initVariables(/*wbstartstruct_t *wbstartstruct */)
{
/* wbs = wbstartstruct;
Expand Down Expand Up @@ -133,7 +127,7 @@ void WI_initVariables(/*wbstartstruct_t *wbstartstruct */)
interTime = 0;
}

void IN_Init()
void IN_Begin()
{
DENG2_ASSERT(G_Ruleset_Deathmatch());

Expand All @@ -146,12 +140,12 @@ void IN_WaitStop()
{
if(!--cnt)
{
IN_Stop();
IN_End();
G_IntermissionDone();
}
}

void IN_Stop()
void IN_End()
{
NetSv_Intermission(IMF_END, 0, 0);
unloadPics();
Expand Down Expand Up @@ -247,14 +241,6 @@ void IN_Ticker()
}
}

void IN_SkipToNext()
{
skipIntermission = 1;
}

/**
* Check to see if any player hit a key.
*/
static void CheckForSkip()
{
static bool triedToSkip;
Expand Down Expand Up @@ -463,3 +449,19 @@ static void drawNumberBold(int val, int x, int y, int wrapThresh)
FR_SetColorAndAlpha(1, 0.7f, 0.3f, 1);
FR_DrawTextXY3(buf, x, y, ALIGN_TOP, DTF_NO_EFFECTS);
}

void IN_SetState(int stateNum)
{
interState = stateNum;
}

void IN_SkipToNext()
{
skipIntermission = 1;
}

void WI_ConsoleRegister()
{
C_VAR_BYTE("inlude-stretch", &cfg.inludeScaleMode, 0, SCALEMODE_FIRST, SCALEMODE_LAST);
C_VAR_INT ("inlude-patch-replacement", &cfg.inludePatchReplaceMode, 0, 0, 1);
}

0 comments on commit 7cf1c80

Please sign in to comment.