Skip to content

Commit

Permalink
Cleanup|libcommon|All Games: Removed redundant common declarations
Browse files Browse the repository at this point in the history
The functions is r_defs.h are really defined in the libcommon
p_mapsetup.cpp, so they should have a common header, too.
  • Loading branch information
skyjake committed Dec 14, 2014
1 parent bd32948 commit 9b2f87a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 123 deletions.
1 change: 1 addition & 0 deletions doomsday/plugins/common/include/common.h
Expand Up @@ -47,6 +47,7 @@
#include "gamerules.h"
#include "g_defs.h"
#include "pause.h"
#include "p_mapsetup.h"
#ifdef __cplusplus
# include <doomsday/filesys/lumpindex.h>
#endif
Expand Down
26 changes: 25 additions & 1 deletion doomsday/plugins/common/include/p_mapsetup.h
Expand Up @@ -23,7 +23,10 @@
#ifndef LIBCOMMON_PLAYSIM_MAPSETUP_H
#define LIBCOMMON_PLAYSIM_MAPSETUP_H

#include "common.h"
#include <de/types.h>
#include <doomsday/uri.h>
#include "api_uri.h"
#include "api_map.h"

// If true we are in the process of setting up a map.
DENG_EXTERN_C dd_bool mapSetup;
Expand Down Expand Up @@ -61,6 +64,27 @@ void P_SpawnSideMaterialOriginScrollers(void);

void P_SpawnAllMaterialOriginScrollers(void);

/**
* Update line visibility in the specified player's automap.
*
* @param player Local player number whose map is to change.
* @param lineIdx Line to change.
* @param visible @c true= mark the line as visible.
*/
void P_SetLineAutomapVisibility(int player, int lineIdx, dd_bool visible);

struct xline_s *P_GetXLine(int idx);
struct xline_s *P_ToXLine(Line *line);

struct xsector_s *P_GetXSector(int index);

/**
* Converts a sector to an xsector.
*/
struct xsector_s *P_ToXSector(Sector *sector);

struct xsector_s const *P_ToXSector_const(Sector const *sector);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
5 changes: 5 additions & 0 deletions doomsday/plugins/common/src/p_mapsetup.cpp
Expand Up @@ -107,6 +107,11 @@ xsector_t *P_ToXSector(Sector *sector)
}
}

xsector_t const *P_ToXSector_const(Sector const *sector)
{
return P_ToXSector(const_cast<Sector *>(sector));
}

xsector_t *P_GetXSector(int index)
{
if(index < 0 || index >= numsectors) return 0;
Expand Down
30 changes: 0 additions & 30 deletions doomsday/plugins/doom/include/r_defs.h
Expand Up @@ -86,34 +86,4 @@ typedef struct xline_s {
DENG_EXTERN_C xsector_t* xsectors;
DENG_EXTERN_C xline_t* xlines;

#ifdef __cplusplus
extern "C" {
#endif

/**
* Converts a line to an xline.
*/
xline_t *P_ToXLine(Line *line);

/**
* Converts a sector to an xsector.
*/
xsector_t *P_ToXSector(Sector *sector);

/**
* Update the specified player's automap.
*
* @param player Local player number whose map is to change.
* @param lineIdx Line to change.
* @param visible @c true= mark the line as visible.
*/
void P_SetLineAutomapVisibility(int player, int lineIdx, dd_bool visible);

xline_t *P_GetXLine(int index);
xsector_t *P_GetXSector(int index);

#ifdef __cplusplus
} // extern "C"
#endif

#endif
30 changes: 0 additions & 30 deletions doomsday/plugins/doom64/include/r_defs.h
Expand Up @@ -127,34 +127,4 @@ DENG_EXTERN_C xline_t* xlines;
// If true we are in the process of setting up a map.
DENG_EXTERN_C dd_bool mapSetup;

#ifdef __cplusplus
extern "C" {
#endif

/**
* Converts a line to an xline.
*/
xline_t *P_ToXLine(Line *line);

/**
* Converts a sector to an xsector.
*/
xsector_t *P_ToXSector(Sector *sector);

/**
* Update the specified player's automap.
*
* @param player Local player number whose map is to change.
* @param lineIdx Line to change.
* @param visible @c true= mark the line as visible.
*/
void P_SetLineAutomapVisibility(int player, int lineIdx, dd_bool visible);

xline_t *P_GetXLine(int index);
xsector_t *P_GetXSector(int index);

#ifdef __cplusplus
} // extern "C"
#endif

#endif
31 changes: 0 additions & 31 deletions doomsday/plugins/heretic/include/r_defs.h
Expand Up @@ -89,35 +89,4 @@ typedef struct xline_s {
DENG_EXTERN_C xline_t *xlines;
DENG_EXTERN_C xsector_t *xsectors;

#ifdef __cplusplus
extern "C" {
#endif

/**
* Converts a line to an xline.
*/
xline_t *P_ToXLine(Line *line);

xline_t *P_GetXLine(int index);

/**
* Converts a sector to an xsector.
*/
xsector_t *P_ToXSector(Sector *sector);

xsector_t *P_GetXSector(int index);

/**
* Update the specified player's automap.
*
* @param player Local player number whose map is to change.
* @param lineIdx Line to change.
* @param visible @c true= mark the line as visible.
*/
void P_SetLineAutomapVisibility(int player, int lineIdx, dd_bool visible);

#ifdef __cplusplus
} // extern "C"
#endif

#endif
31 changes: 0 additions & 31 deletions doomsday/plugins/hexen/include/r_defs.h
Expand Up @@ -62,35 +62,4 @@ typedef struct xline_s {
DENG_EXTERN_C xline_t* xlines;
DENG_EXTERN_C xsector_t* xsectors;

#ifdef __cplusplus
extern "C" {
#endif

/**
* Converts a line to an xline.
*/
xline_t *P_ToXLine(Line *line);

xline_t *P_GetXLine(int index);

/**
* Converts a sector to an xsector.
*/
xsector_t *P_ToXSector(Sector *sector);

xsector_t *P_GetXSector(int index);

/**
* Update the specified player's automap.
*
* @param player Local player number whose map is to change.
* @param line Line to change.
* @param visible @c true= mark the line as visible.
*/
void P_SetLineAutomapVisibility(int player, int lineIdx, dd_bool visible);

#ifdef __cplusplus
} // extern "C"
#endif

#endif

0 comments on commit 9b2f87a

Please sign in to comment.