Skip to content

Commit

Permalink
Working on a functional "doomsday-server"
Browse files Browse the repository at this point in the history
__SERVER__ marks the code that is exclusive to the (dedicated) server.

__CLIENT__ marks the code that is exclusive to the client executable.
It is used currently in "engine.pro".

Some functionality in the server has been replaced with empty
dummy functions so that less changes are necessary.
  • Loading branch information
skyjake committed Dec 22, 2012
1 parent 7e0098f commit bf04ee1
Show file tree
Hide file tree
Showing 71 changed files with 764 additions and 165 deletions.
6 changes: 6 additions & 0 deletions doomsday/engine/include/de_base.h
Expand Up @@ -56,4 +56,10 @@
#include "ui/zonedebug.h"
#include "uri.hh"

#ifdef __SERVER__
// Many subsystems do not exist on the server. This is a temporary measure
// to allow compilation without pulling everything apart just yet.
# include "server_dummies.h"
#endif

#endif /* LIBDENG_BASE_H */
5 changes: 4 additions & 1 deletion doomsday/engine/include/de_edit.h
Expand Up @@ -29,7 +29,10 @@
#ifndef __DOOMSDAY_EDITOR__
#define __DOOMSDAY_EDITOR__

#include "edit_bias.h"
#ifdef __CLIENT__
# include "edit_bias.h"
#endif

#include "edit_map.h"

#endif
15 changes: 9 additions & 6 deletions doomsday/engine/include/de_graphics.h
Expand Up @@ -29,13 +29,16 @@
#ifndef LIBDENG_GRAPHICS
#define LIBDENG_GRAPHICS

#include "gl/gl_main.h"
#include "gl/gl_draw.h"
#ifdef __CLIENT__
# include "gl/gl_main.h"
# include "gl/gl_draw.h"
# include "gl/texturecontent.h"
# include "gl/gl_tex.h"
# include "gl/gl_model.h"
# include "gl/gl_defer.h"
#endif

#include "gl/gl_texmanager.h"
#include "gl/texturecontent.h"
#include "gl/gl_tex.h"
#include "gl/gl_model.h"
#include "gl/gl_defer.h"

#include "resource/pcx.h"
#include "resource/tga.h"
Expand Down
20 changes: 12 additions & 8 deletions doomsday/engine/include/de_network.h
Expand Up @@ -33,8 +33,10 @@
#include "network/net_event.h"
#include "network/net_msg.h"
#include "network/net_buf.h"
#include "network/net_demo.h"
#include "network/protocol.h"
#ifdef __CLIENT__
# include "network/net_demo.h"
#endif

#include "server/sv_def.h"
#include "server/sv_pool.h"
Expand All @@ -43,12 +45,14 @@
#include "server/sv_missile.h"
#include "server/sv_infine.h"

#include "client/cl_def.h"
#include "client/cl_player.h"
#include "client/cl_mobj.h"
#include "client/cl_frame.h"
#include "client/cl_sound.h"
#include "client/cl_world.h"
#include "client/cl_infine.h"
#ifdef __CLIENT__
# include "client/cl_def.h"
# include "client/cl_player.h"
# include "client/cl_mobj.h"
# include "client/cl_frame.h"
# include "client/cl_sound.h"
# include "client/cl_world.h"
# include "client/cl_infine.h"
#endif

#endif /* LIBDENG_NETWORK */
7 changes: 5 additions & 2 deletions doomsday/engine/include/de_render.h
Expand Up @@ -23,12 +23,14 @@
#define DOOMSDAY_CLIENT_RENDERER

#include "render/r_main.h"
#include "render/r_things.h"
#include "render/rend_main.h"

#ifdef __CLIENT__
#include "render/r_draw.h"
#include "render/r_lgrid.h"
#include "render/lumobj.h"
#include "render/r_shadow.h"
#include "render/r_things.h"
#include "render/rend_main.h"
#include "render/rend_clip.h"
#include "render/rend_halo.h"
#include "render/rend_list.h"
Expand All @@ -46,6 +48,7 @@
#include "render/sprite.h"
#include "render/vignette.h"
#include "render/vlight.h"
#endif

#include "map/r_world.h"
#include "r_util.h"
Expand Down
5 changes: 4 additions & 1 deletion doomsday/engine/include/de_resource.h
Expand Up @@ -22,7 +22,6 @@
#define LIBDENG_RESOURCE_SUBSYSTEM_H

#include "resource/animgroups.h"
#include "resource/bitmapfont.h"
#include "resource/colorpalettes.h"
#include "resource/font.h"
#include "resource/fonts.h"
Expand All @@ -34,6 +33,10 @@
#include "resource/rawtexture.h"
#include "resource/textures.h"

#ifdef __CLIENT__
# include "resource/bitmapfont.h"
#endif

#ifdef __cplusplus
# include "resource/patch.h"
# include "resource/texturemanifest.h"
Expand Down
4 changes: 3 additions & 1 deletion doomsday/engine/include/de_system.h
Expand Up @@ -33,7 +33,9 @@
#include "ui/sys_input.h"
#include "network/sys_network.h"
#include "network/masterserver.h"
#include "gl/sys_opengl.h"
#ifdef __CLIENT__
# include "gl/sys_opengl.h"
#endif

// Use SDL for window management under *nix
#ifdef UNIX
Expand Down
10 changes: 6 additions & 4 deletions doomsday/engine/include/de_ui.h
Expand Up @@ -29,10 +29,12 @@
#ifndef LIBDENG_USER_INTERFACE_H
#define LIBDENG_USER_INTERFACE_H

#include "ui/ui_main.h"
#include "ui/ui2_main.h"
#include "ui/ui_panel.h"
#ifdef __CLIENT__
# include "ui/ui_main.h"
# include "ui/ui2_main.h"
# include "ui/ui_panel.h"
# include "network/ui_mpi.h"
#endif

#include "network/ui_mpi.h"

#endif /* LIBDENG_USER_INTERFACE_H */
8 changes: 8 additions & 0 deletions doomsday/engine/include/def_data.h
Expand Up @@ -249,6 +249,14 @@ typedef struct ded_sky_s {
ded_skymodel_t models[NUM_SKY_MODELS];
} ded_sky_t;

/// @todo These values should be tweaked a bit.
#define DEFAULT_FOG_START 0
#define DEFAULT_FOG_END 2100
#define DEFAULT_FOG_DENSITY 0.0001f
#define DEFAULT_FOG_COLOR_RED 138.0f/255
#define DEFAULT_FOG_COLOR_GREEN 138.0f/255
#define DEFAULT_FOG_COLOR_BLUE 138.0f/255

typedef struct ded_mapinfo_s {
Uri* uri; // ID of the map (e.g. E2M3 or MAP21).
ded_string_t name; // Name of the map.
Expand Down
12 changes: 4 additions & 8 deletions doomsday/engine/include/gl/gl_main.h
Expand Up @@ -23,6 +23,10 @@
#ifndef LIBDENG_GRAPHICS_H
#define LIBDENG_GRAPHICS_H

#ifdef __SERVER__
# error "gl" not available in SERVER build
#endif

#include "render/r_main.h"

struct colorpalette_s;
Expand All @@ -32,14 +36,6 @@ struct ColorRawf_s;

#define MAX_TEX_UNITS 2 // More aren't currently used.

/// @todo These values should be tweaked a bit.
#define DEFAULT_FOG_START 0
#define DEFAULT_FOG_END 2100
#define DEFAULT_FOG_DENSITY 0.0001f
#define DEFAULT_FOG_COLOR_RED 138.0f/255
#define DEFAULT_FOG_COLOR_GREEN 138.0f/255
#define DEFAULT_FOG_COLOR_BLUE 138.0f/255

DENG_EXTERN_C int numTexUnits;
DENG_EXTERN_C boolean envModAdd;
DENG_EXTERN_C int defResX, defResY, defBPP, defFullscreen;
Expand Down
4 changes: 4 additions & 0 deletions doomsday/engine/include/gl/sys_opengl.h
Expand Up @@ -149,6 +149,8 @@ typedef enum arraytype_e {
extern "C" {
#endif

#ifdef __CLIENT__

extern gl_state_t GL_state;

#ifdef WIN32
Expand Down Expand Up @@ -203,6 +205,8 @@ boolean Sys_GLQueryExtension(const char* name, const GLubyte* extensions);

boolean Sys_GLCheckError(void);

#endif // __CLIENT__

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/include/map/p_mapdata.h
Expand Up @@ -26,7 +26,7 @@
#define LIBDENG_PLAY_MAPDATA_H

#if defined(__JDOOM__) || defined(__JHERETIC__) || defined(__JHEXEN__)
# error "Attempted to include internal Doomsday p_mapdata.h from a game"
# error Attempted to include internal Doomsday p_mapdata.h from a game
#endif

#include "dd_share.h"
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/include/map/p_object.h
Expand Up @@ -33,7 +33,7 @@
#include "p_mapdata.h"

#if defined(__JDOOM__) || defined(__JHERETIC__) || defined(__JHEXEN__)
# error "Attempted to include internal Doomsday p_object.h from a game"
# error Attempted to include internal Doomsday p_object.h from a game
#endif

#ifdef __cplusplus
Expand Down
4 changes: 4 additions & 0 deletions doomsday/engine/include/network/net_demo.h
Expand Up @@ -29,6 +29,10 @@
#ifndef LIBDENG_DEMO_H
#define LIBDENG_DEMO_H

#ifdef __SERVER__
# error Demos are not available in a SERVER build
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
1 change: 1 addition & 0 deletions doomsday/engine/include/render/r_main.h
Expand Up @@ -26,6 +26,7 @@
#define LIBDENG_REFRESH_MAIN_H

#include <de/rect.h>
#include "dd_share.h"

#ifdef __cplusplus
extern "C" {
Expand Down
5 changes: 4 additions & 1 deletion doomsday/engine/include/render/rend_list.h
Expand Up @@ -29,7 +29,10 @@
#ifndef LIBDENG_REND_LIST_H
#define LIBDENG_REND_LIST_H

//#include "resource/r_data.h"
#ifdef __SERVER__
# error "render" not available in a SERVER build
#endif

#include "render/rendpoly.h"

#ifdef __cplusplus
Expand Down
4 changes: 3 additions & 1 deletion doomsday/engine/include/render/rend_main.h
Expand Up @@ -30,7 +30,9 @@
#define LIBDENG_REND_MAIN_H

#include <math.h>
#include "rend_list.h"
#ifdef __CLIENT__
# include "rend_list.h"
#endif
#include "r_things.h"

struct materialvariantspecification_s;
Expand Down
5 changes: 5 additions & 0 deletions doomsday/engine/include/render/rendpoly.h
Expand Up @@ -23,6 +23,7 @@
#define LIBDENG_RENDER_RENDPOLY_H

#include "color.h"
#include <de/vector1.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -94,6 +95,8 @@ typedef struct rtexmapuint_s {
vec2f_t offset;
} rtexmapunit_t;

#ifdef __CLIENT__

extern byte rendInfoRPolys;

void R_PrintRendPoolInfo(void);
Expand Down Expand Up @@ -197,6 +200,8 @@ void R_DivVertColors(ColorRawf *dst, ColorRawf const *src,
struct walldivnode_s *rightDivFirst, uint rightDivCount,
float bL, float tL, float bR, float tR);

#endif // __CLIENT__

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
4 changes: 4 additions & 0 deletions doomsday/engine/include/render/sprite.h
Expand Up @@ -50,6 +50,8 @@ extern "C" {

void Rend_SpriteRegister(void);

#ifdef __CLIENT__

/**
* Render sprites, 3D models, masked wall segments and halos, ordered
* back to front. Halos are rendered with Z-buffer tests and writes
Expand All @@ -73,6 +75,8 @@ materialvariantspecification_t const* Sprite_MaterialSpec(int tclass, int tmap);

void Rend_RenderSprite(rendspriteparams_t const* params);

#endif // __CLIENT__

///@}

#ifdef __cplusplus
Expand Down
1 change: 0 additions & 1 deletion doomsday/engine/include/resource/materialvariant.h
Expand Up @@ -22,7 +22,6 @@
#ifndef LIBDENG_RESOURCE_MATERIALVARIANT_H
#define LIBDENG_RESOURCE_MATERIALVARIANT_H

//#include "r_data.h"
#include "render/rendpoly.h"
#include "materials.h"

Expand Down
8 changes: 8 additions & 0 deletions doomsday/engine/include/resource/models.h
Expand Up @@ -124,15 +124,21 @@ typedef struct modeldef_s
submodeldef_t sub[MAX_FRAME_MODELS];
} modeldef_t;

#ifdef __CLIENT__

DENG_EXTERN_C modeldef_t* modefs;
DENG_EXTERN_C int numModelDefs;
DENG_EXTERN_C byte useModels;
DENG_EXTERN_C float rModelAspectMod;

#endif // __CLIENT__

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __CLIENT__

/**
* @pre States must be initialized before this.
*/
Expand Down Expand Up @@ -170,6 +176,8 @@ int Models_CacheForMobj(thinker_t* th, void* context);

void Models_CacheForState(int stateIndex);

#endif // __CLIENT__

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
4 changes: 3 additions & 1 deletion doomsday/engine/include/resource/r_data.h
Expand Up @@ -22,7 +22,9 @@
#define LIBDENG_REFRESH_DATA_H

#include "dd_types.h"
#include "gl/gl_main.h"
#ifdef __CLIENT__
# include "gl/gl_main.h"
#endif
#include "dd_def.h"
#include "thinker.h"
#include "def_data.h"
Expand Down
4 changes: 4 additions & 0 deletions doomsday/engine/include/ui/busyvisual.h
Expand Up @@ -52,6 +52,8 @@ typedef enum {
LAST_TRANSITIONSTYLE = TS_DOOM
} transitionstyle_t;

#ifdef __CLIENT__

extern int rTransition;
extern int rTransitionTics;

Expand All @@ -66,6 +68,8 @@ boolean Con_TransitionInProgress(void);
void Con_TransitionTicker(timespan_t ticLength);
void Con_DrawTransition(void);

#endif // __CLIENT__

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
4 changes: 4 additions & 0 deletions doomsday/engine/include/ui/joystick.h
Expand Up @@ -26,6 +26,10 @@
#ifndef LIBDENG_SYSTEM_JOYSTICK_H
#define LIBDENG_SYSTEM_JOYSTICK_H

#ifdef __SERVER__
# error Joystick is not available in a SERVER build
#endif

#include "dd_types.h"

#ifdef __cplusplus
Expand Down

0 comments on commit bf04ee1

Please sign in to comment.