Skip to content

Commit

Permalink
libcommon: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 25, 2014
1 parent d8d0550 commit f367603
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 165 deletions.
12 changes: 6 additions & 6 deletions doomsday/plugins/common/src/p_sound.cpp
Expand Up @@ -48,18 +48,18 @@ void S_MapMusic(Uri const *mapUri)

if(S_StartMusic("currentmap", true))
{
// Set the game status cvar for the map music
gsvMapMusic = defIndex;
// Set the game status cvar for the map music.
Con_SetInteger2("map-music", defIndex, SVF_WRITE_OVERRIDE);
}
#else
AutoStr *mapPath = Uri_Compose(mapUri);
ddmapinfo_t mapInfo;
if(Def_Get(DD_DEF_MAP_INFO, Str_Text(mapPath), &mapInfo))
ddmapinfo_t ddMapInfo;
if(Def_Get(DD_DEF_MAP_INFO, Str_Text(mapPath), &ddMapInfo))
{
if(S_StartMusicNum(mapInfo.music, true))
if(S_StartMusicNum(ddMapInfo.music, true))
{
// Set the game status cvar for the map music.
gsvMapMusic = mapInfo.music;
Con_SetInteger2("map-music", ddMapInfo.music, SVF_WRITE_OVERRIDE);
}
}
#endif
Expand Down
29 changes: 0 additions & 29 deletions doomsday/plugins/doom/include/d_player.h
Expand Up @@ -122,33 +122,4 @@ typedef struct player_s {
#endif
} player_t;

//
// INTERMISSION
// Structure passed e.g. to WI_Init(wb)
//
typedef struct {
dd_bool inGame; // Whether the player is in game.

// Player stats, kills, collected items etc.
int kills;
int items;
int secret;
int time;
int frags[MAXPLAYERS];
int score; // Current score on entry, modified on return.
} wbplayerstruct_t;

typedef struct {
uint episode;
dd_bool didSecret; // If true, splash the secret level.
uint currentMap, nextMap; // This and next maps.
int maxKills;
int maxItems;
int maxSecret;
int maxFrags;
int parTime;
int pNum; // Index of this player in game.
wbplayerstruct_t plyr[MAXPLAYERS];
} wbstartstruct_t;

#endif
5 changes: 3 additions & 2 deletions doomsday/plugins/doom/include/g_game.h
Expand Up @@ -37,18 +37,19 @@
#include "doomdef.h"
#include "d_event.h"
#include "d_player.h"
#include "wi_stuff.h"
#include "gamerules.h"

DENG_EXTERN_C player_t players[MAXPLAYERS];

DENG_EXTERN_C uint nextMap; // If non zero this will be the next map.
DENG_EXTERN_C dd_bool secretExit;
DENG_EXTERN_C int totalKills, totalItems, totalSecret;
DENG_EXTERN_C wbstartstruct_t wmInfo;
DENG_EXTERN_C int bodyQueueSlot;
DENG_EXTERN_C dd_bool paused;
DENG_EXTERN_C dd_bool precache;
DENG_EXTERN_C dd_bool customPal;
DENG_EXTERN_C wbstartstruct_t wmInfo;
DENG_EXTERN_C int bodyQueueSlot;
DENG_EXTERN_C dd_bool briefDisabled;

DENG_EXTERN_C int gsvMapMusic;
Expand Down
75 changes: 48 additions & 27 deletions doomsday/plugins/doom/include/wi_stuff.h
@@ -1,32 +1,22 @@
/**\file wi_stuff.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
/** @file wi_stuff.h DOOM specific intermission screens.
*
*\author Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1993-1996 by id Software, Inc.
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 1993-1996 id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

/**
* Intermission screens - DOOM specific.
*
* \note WI_Ticker is used to detect keys because of timing issues in netgames.
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/

#ifndef LIBDOOM_WI_STUFF_H
Expand Down Expand Up @@ -81,6 +71,35 @@ typedef enum {
ILS_SHOW_NEXTMAP
} interludestate_t;

//
// INTERMISSION
// Structure passed e.g. to WI_Init(wb)
//
typedef struct {
dd_bool inGame; // Whether the player is in game.

// Player stats, kills, collected items etc.
int kills;
int items;
int secret;
int time;
int frags[MAXPLAYERS];
int score; // Current score on entry, modified on return.
} wbplayerstruct_t;

typedef struct {
uint episode;
dd_bool didSecret; // If true, splash the secret level.
uint currentMap, nextMap; // This and next maps.
int maxKills;
int maxItems;
int maxSecret;
int maxFrags;
int parTime;
int pNum; // Index of this player in game.
wbplayerstruct_t plyr[MAXPLAYERS];
} wbstartstruct_t;

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -91,12 +110,14 @@ void WI_Register(void);
/**
* Perform setup for an intermission.
*/
void WI_Init(wbstartstruct_t* wbstartstruct);
void WI_Init(wbstartstruct_t *wbstartstruct);

void WI_Shutdown(void);

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

Expand Down
29 changes: 0 additions & 29 deletions doomsday/plugins/doom64/include/d_player.h
Expand Up @@ -147,33 +147,4 @@ typedef struct player_s {
#endif
} player_t;

//
// INTERMISSION
// Structure passed e.g. to WI_Init(wb)
//
typedef struct {
dd_bool inGame; // Whether the player is in game.

// Player stats, kills, collected items etc.
int kills;
int items;
int secret;
int time;
int frags[MAXPLAYERS];
int score; // Current score on entry, modified on return.
} wbplayerstruct_t;

typedef struct {
uint episode;
dd_bool didSecret; // If true, splash the secret level.
uint currentMap, nextMap; // This and next maps.
int maxKills;
int maxItems;
int maxSecret;
int maxFrags;
int parTime;
int pNum; // Index of this player in game.
wbplayerstruct_t plyr[MAXPLAYERS];
} wbstartstruct_t;

#endif
4 changes: 0 additions & 4 deletions doomsday/plugins/doom64/include/g_game.h
Expand Up @@ -39,9 +39,6 @@
#include "gamerules.h"
#include "wi_stuff.h"

DENG_EXTERN_C int gaSaveGameSaveSlot;
DENG_EXTERN_C int gaLoadGameSaveSlot;

DENG_EXTERN_C player_t players[MAXPLAYERS];

DENG_EXTERN_C uint nextMap; // If non zero this will be the next map.
Expand All @@ -52,7 +49,6 @@ DENG_EXTERN_C int bodyQueueSlot;
DENG_EXTERN_C dd_bool paused;
DENG_EXTERN_C dd_bool precache;
DENG_EXTERN_C dd_bool customPal;
DENG_EXTERN_C int gsvMapMusic;
DENG_EXTERN_C dd_bool briefDisabled;

#ifdef __cplusplus
Expand Down
73 changes: 47 additions & 26 deletions doomsday/plugins/doom64/include/wi_stuff.h
@@ -1,32 +1,22 @@
/**\file wi_stuff.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
/** @file wi_stuff.h DOOM64 specific intermission screens.
*
*\author Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1993-1996 by id Software, Inc.
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 1993-1996 id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

/**
* Intermission screens - DOOM64 specific.
*
* \note WI_Ticker is used to detect keys because of timing issues in netgames.
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/

#ifndef LIBDOOM_WI_STUFF_H
Expand Down Expand Up @@ -83,6 +73,35 @@ typedef enum {
/// relevant state progressions.
} interludestate_t;

//
// INTERMISSION
// Structure passed e.g. to WI_Init(wb)
//
typedef struct {
dd_bool inGame; // Whether the player is in game.

// Player stats, kills, collected items etc.
int kills;
int items;
int secret;
int time;
int frags[MAXPLAYERS];
int score; // Current score on entry, modified on return.
} wbplayerstruct_t;

typedef struct {
uint episode;
dd_bool didSecret; // If true, splash the secret level.
uint currentMap, nextMap; // This and next maps.
int maxKills;
int maxItems;
int maxSecret;
int maxFrags;
int parTime;
int pNum; // Index of this player in game.
wbplayerstruct_t plyr[MAXPLAYERS];
} wbstartstruct_t;

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -97,6 +116,8 @@ void WI_Init(wbstartstruct_t* wbstartstruct);

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

Expand Down
8 changes: 2 additions & 6 deletions doomsday/plugins/heretic/include/g_game.h
Expand Up @@ -38,23 +38,19 @@
#include "gamerules.h"
#include "h_event.h"
#include "h_player.h"

DENG_EXTERN_C int gaSaveGameSaveSlot;
DENG_EXTERN_C int gaLoadGameSaveSlot;
#include "in_lude.h"

DENG_EXTERN_C player_t players[MAXPLAYERS];

DENG_EXTERN_C uint nextMap;
DENG_EXTERN_C dd_bool secretExit;
DENG_EXTERN_C int totalKills, totalItems, totalSecret;
DENG_EXTERN_C wbstartstruct_t wmInfo;
DENG_EXTERN_C dd_bool paused;
DENG_EXTERN_C dd_bool precache;
DENG_EXTERN_C wbstartstruct_t wmInfo;
DENG_EXTERN_C dd_bool customPal;
DENG_EXTERN_C dd_bool briefDisabled;

DENG_EXTERN_C int gsvMapMusic;

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
28 changes: 0 additions & 28 deletions doomsday/plugins/heretic/include/h_player.h
Expand Up @@ -166,32 +166,4 @@ typedef struct player_s {
#endif
} player_t;

//
// INTERMISSION
// Structure passed e.g. to IN_Init(wb)
//
/*typedef struct {
dd_bool inGame; // Whether the player is in game.
// Player stats, kills, collected items etc.
int kills;
int items;
int secret;
int time;
int frags[MAXPLAYERS];
int score; // Current score on entry, modified on return.
} wbplayerstruct_t;*/

typedef struct {
uint episode;
dd_bool didSecret; // If true, splash the secret level.
uint currentMap, nextMap; // This and next maps.
/* int maxKills;
int maxItems;
int maxSecret;
int maxFrags;
int parTime;
int pNum; // Index of this player in game.
wbplayerstruct_t plyr[MAXPLAYERS];*/
} wbstartstruct_t;
#endif

0 comments on commit f367603

Please sign in to comment.