From bf04ee16d3a45811f9ddb04964d8dc5ad9f5d806 Mon Sep 17 00:00:00 2001 From: skyjake Date: Sat, 22 Dec 2012 23:02:41 +0200 Subject: [PATCH] Working on a functional "doomsday-server" __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. --- doomsday/engine/include/de_base.h | 6 + doomsday/engine/include/de_edit.h | 5 +- doomsday/engine/include/de_graphics.h | 15 ++- doomsday/engine/include/de_network.h | 20 ++-- doomsday/engine/include/de_render.h | 7 +- doomsday/engine/include/de_resource.h | 5 +- doomsday/engine/include/de_system.h | 4 +- doomsday/engine/include/de_ui.h | 10 +- doomsday/engine/include/def_data.h | 8 ++ doomsday/engine/include/gl/gl_main.h | 12 +- doomsday/engine/include/gl/sys_opengl.h | 4 + doomsday/engine/include/map/p_mapdata.h | 2 +- doomsday/engine/include/map/p_object.h | 2 +- doomsday/engine/include/network/net_demo.h | 4 + doomsday/engine/include/render/r_main.h | 1 + doomsday/engine/include/render/rend_list.h | 5 +- doomsday/engine/include/render/rend_main.h | 4 +- doomsday/engine/include/render/rendpoly.h | 5 + doomsday/engine/include/render/sprite.h | 4 + .../engine/include/resource/materialvariant.h | 1 - doomsday/engine/include/resource/models.h | 8 ++ doomsday/engine/include/resource/r_data.h | 4 +- doomsday/engine/include/ui/busyvisual.h | 4 + doomsday/engine/include/ui/joystick.h | 4 + doomsday/engine/include/ui/sys_input.h | 4 +- doomsday/engine/src/audio/s_main.c | 2 + doomsday/engine/src/audio/s_sfx.c | 2 + doomsday/engine/src/busymode.cpp | 33 +++++- doomsday/engine/src/con_main.c | 14 +++ doomsday/engine/src/dd_init.cpp | 2 + doomsday/engine/src/dd_loop.c | 32 +++++- doomsday/engine/src/dd_main.cpp | 83 ++++++++++---- doomsday/engine/src/dd_pinit.c | 3 + doomsday/engine/src/def_main.cpp | 5 +- doomsday/engine/src/edit_bias.c | 4 + doomsday/engine/src/gl/gl_texmanager.cpp | 31 +++++- doomsday/engine/src/gridmap.c | 8 +- doomsday/engine/src/map/bsp/partitioner.cpp | 6 +- doomsday/engine/src/map/dam_main.cpp | 4 + doomsday/engine/src/map/gamemap.c | 1 + doomsday/engine/src/map/linedef.c | 2 + doomsday/engine/src/map/p_data.cpp | 13 ++- doomsday/engine/src/map/p_maputil.c | 2 + doomsday/engine/src/map/p_mobj.c | 13 ++- doomsday/engine/src/map/p_objlink.c | 8 ++ doomsday/engine/src/map/p_particle.c | 13 ++- doomsday/engine/src/map/p_sight.c | 2 + doomsday/engine/src/map/p_think.c | 6 + doomsday/engine/src/map/p_ticker.c | 2 + doomsday/engine/src/map/polyobj.c | 2 + doomsday/engine/src/map/r_world.c | 14 ++- doomsday/engine/src/network/net_main.c | 99 +++++++++++------ doomsday/engine/src/network/sys_network.c | 8 +- doomsday/engine/src/r_util.c | 2 + doomsday/engine/src/render/r_main.c | 20 ++++ doomsday/engine/src/render/r_things.cpp | 16 ++- doomsday/engine/src/render/rend_main.c | 30 +++-- doomsday/engine/src/render/rend_model.cpp | 2 +- doomsday/engine/src/resource/material.cpp | 1 + doomsday/engine/src/resource/materials.cpp | 20 +++- doomsday/engine/src/ui/canvas.cpp | 4 + doomsday/engine/src/ui/canvaswindow.cpp | 6 +- doomsday/engine/src/ui/dd_input.c | 14 ++- doomsday/engine/src/ui/finaleinterpreter.c | 6 +- doomsday/engine/src/ui/sys_input.c | 16 ++- doomsday/engine/src/ui/ui2_main.cpp | 2 + doomsday/engine/src/ui/window.cpp | 22 +++- doomsday/engine/src/unix/dd_uinit.c | 4 + doomsday/server/include/server_dummies.h | 62 +++++++++++ doomsday/server/server.pro | 35 +++--- doomsday/server/src/server_dummies.c | 105 ++++++++++++++++++ 71 files changed, 764 insertions(+), 165 deletions(-) create mode 100644 doomsday/server/include/server_dummies.h create mode 100644 doomsday/server/src/server_dummies.c diff --git a/doomsday/engine/include/de_base.h b/doomsday/engine/include/de_base.h index 98966f80ed..e1789c29a1 100644 --- a/doomsday/engine/include/de_base.h +++ b/doomsday/engine/include/de_base.h @@ -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 */ diff --git a/doomsday/engine/include/de_edit.h b/doomsday/engine/include/de_edit.h index 0e8ab8f46f..2f5e89aa2c 100644 --- a/doomsday/engine/include/de_edit.h +++ b/doomsday/engine/include/de_edit.h @@ -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 diff --git a/doomsday/engine/include/de_graphics.h b/doomsday/engine/include/de_graphics.h index 96d1c57390..76e5d07165 100644 --- a/doomsday/engine/include/de_graphics.h +++ b/doomsday/engine/include/de_graphics.h @@ -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" diff --git a/doomsday/engine/include/de_network.h b/doomsday/engine/include/de_network.h index 1cd25bf1bf..cac411b708 100644 --- a/doomsday/engine/include/de_network.h +++ b/doomsday/engine/include/de_network.h @@ -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" @@ -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 */ diff --git a/doomsday/engine/include/de_render.h b/doomsday/engine/include/de_render.h index 4d48ccaa20..c57df090a9 100644 --- a/doomsday/engine/include/de_render.h +++ b/doomsday/engine/include/de_render.h @@ -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" @@ -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" diff --git a/doomsday/engine/include/de_resource.h b/doomsday/engine/include/de_resource.h index b75f11e1ce..aa41f7a45c 100644 --- a/doomsday/engine/include/de_resource.h +++ b/doomsday/engine/include/de_resource.h @@ -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" @@ -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" diff --git a/doomsday/engine/include/de_system.h b/doomsday/engine/include/de_system.h index 8b78c97153..3c2c838a16 100644 --- a/doomsday/engine/include/de_system.h +++ b/doomsday/engine/include/de_system.h @@ -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 diff --git a/doomsday/engine/include/de_ui.h b/doomsday/engine/include/de_ui.h index c067914e7b..fd9d04cb5f 100644 --- a/doomsday/engine/include/de_ui.h +++ b/doomsday/engine/include/de_ui.h @@ -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 */ diff --git a/doomsday/engine/include/def_data.h b/doomsday/engine/include/def_data.h index 81e9c09d37..099cf6ca62 100644 --- a/doomsday/engine/include/def_data.h +++ b/doomsday/engine/include/def_data.h @@ -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. diff --git a/doomsday/engine/include/gl/gl_main.h b/doomsday/engine/include/gl/gl_main.h index 04a7fcb7ca..fb419416f8 100644 --- a/doomsday/engine/include/gl/gl_main.h +++ b/doomsday/engine/include/gl/gl_main.h @@ -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; @@ -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; diff --git a/doomsday/engine/include/gl/sys_opengl.h b/doomsday/engine/include/gl/sys_opengl.h index f4bd0d6806..cf1e901a7d 100644 --- a/doomsday/engine/include/gl/sys_opengl.h +++ b/doomsday/engine/include/gl/sys_opengl.h @@ -149,6 +149,8 @@ typedef enum arraytype_e { extern "C" { #endif +#ifdef __CLIENT__ + extern gl_state_t GL_state; #ifdef WIN32 @@ -203,6 +205,8 @@ boolean Sys_GLQueryExtension(const char* name, const GLubyte* extensions); boolean Sys_GLCheckError(void); +#endif // __CLIENT__ + #ifdef __cplusplus } // extern "C" #endif diff --git a/doomsday/engine/include/map/p_mapdata.h b/doomsday/engine/include/map/p_mapdata.h index 5e5246a96a..8b88fb6a57 100644 --- a/doomsday/engine/include/map/p_mapdata.h +++ b/doomsday/engine/include/map/p_mapdata.h @@ -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" diff --git a/doomsday/engine/include/map/p_object.h b/doomsday/engine/include/map/p_object.h index eb2ded6660..3b1f76f420 100644 --- a/doomsday/engine/include/map/p_object.h +++ b/doomsday/engine/include/map/p_object.h @@ -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 diff --git a/doomsday/engine/include/network/net_demo.h b/doomsday/engine/include/network/net_demo.h index 03ef3c4bdb..07a4f168f6 100644 --- a/doomsday/engine/include/network/net_demo.h +++ b/doomsday/engine/include/network/net_demo.h @@ -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 diff --git a/doomsday/engine/include/render/r_main.h b/doomsday/engine/include/render/r_main.h index 126d147392..0e3dcf0d91 100644 --- a/doomsday/engine/include/render/r_main.h +++ b/doomsday/engine/include/render/r_main.h @@ -26,6 +26,7 @@ #define LIBDENG_REFRESH_MAIN_H #include +#include "dd_share.h" #ifdef __cplusplus extern "C" { diff --git a/doomsday/engine/include/render/rend_list.h b/doomsday/engine/include/render/rend_list.h index 23cca36531..070b8afb15 100644 --- a/doomsday/engine/include/render/rend_list.h +++ b/doomsday/engine/include/render/rend_list.h @@ -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 diff --git a/doomsday/engine/include/render/rend_main.h b/doomsday/engine/include/render/rend_main.h index adcc2725a8..42af0ad351 100644 --- a/doomsday/engine/include/render/rend_main.h +++ b/doomsday/engine/include/render/rend_main.h @@ -30,7 +30,9 @@ #define LIBDENG_REND_MAIN_H #include -#include "rend_list.h" +#ifdef __CLIENT__ +# include "rend_list.h" +#endif #include "r_things.h" struct materialvariantspecification_s; diff --git a/doomsday/engine/include/render/rendpoly.h b/doomsday/engine/include/render/rendpoly.h index dcafaeae6b..5b7eaed1a4 100644 --- a/doomsday/engine/include/render/rendpoly.h +++ b/doomsday/engine/include/render/rendpoly.h @@ -23,6 +23,7 @@ #define LIBDENG_RENDER_RENDPOLY_H #include "color.h" +#include #ifdef __cplusplus extern "C" { @@ -94,6 +95,8 @@ typedef struct rtexmapuint_s { vec2f_t offset; } rtexmapunit_t; +#ifdef __CLIENT__ + extern byte rendInfoRPolys; void R_PrintRendPoolInfo(void); @@ -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 diff --git a/doomsday/engine/include/render/sprite.h b/doomsday/engine/include/render/sprite.h index 41d705352e..584762b716 100644 --- a/doomsday/engine/include/render/sprite.h +++ b/doomsday/engine/include/render/sprite.h @@ -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 @@ -73,6 +75,8 @@ materialvariantspecification_t const* Sprite_MaterialSpec(int tclass, int tmap); void Rend_RenderSprite(rendspriteparams_t const* params); +#endif // __CLIENT__ + ///@} #ifdef __cplusplus diff --git a/doomsday/engine/include/resource/materialvariant.h b/doomsday/engine/include/resource/materialvariant.h index 08035b070e..551bfd2873 100644 --- a/doomsday/engine/include/resource/materialvariant.h +++ b/doomsday/engine/include/resource/materialvariant.h @@ -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" diff --git a/doomsday/engine/include/resource/models.h b/doomsday/engine/include/resource/models.h index f0d09116a0..c43fc0ce96 100644 --- a/doomsday/engine/include/resource/models.h +++ b/doomsday/engine/include/resource/models.h @@ -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. */ @@ -170,6 +176,8 @@ int Models_CacheForMobj(thinker_t* th, void* context); void Models_CacheForState(int stateIndex); +#endif // __CLIENT__ + #ifdef __cplusplus } // extern "C" #endif diff --git a/doomsday/engine/include/resource/r_data.h b/doomsday/engine/include/resource/r_data.h index a65761a2e5..589ae0bf90 100644 --- a/doomsday/engine/include/resource/r_data.h +++ b/doomsday/engine/include/resource/r_data.h @@ -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" diff --git a/doomsday/engine/include/ui/busyvisual.h b/doomsday/engine/include/ui/busyvisual.h index e69b3bfed8..6304815a28 100644 --- a/doomsday/engine/include/ui/busyvisual.h +++ b/doomsday/engine/include/ui/busyvisual.h @@ -52,6 +52,8 @@ typedef enum { LAST_TRANSITIONSTYLE = TS_DOOM } transitionstyle_t; +#ifdef __CLIENT__ + extern int rTransition; extern int rTransitionTics; @@ -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 diff --git a/doomsday/engine/include/ui/joystick.h b/doomsday/engine/include/ui/joystick.h index 532aa75414..a7cb051428 100644 --- a/doomsday/engine/include/ui/joystick.h +++ b/doomsday/engine/include/ui/joystick.h @@ -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 diff --git a/doomsday/engine/include/ui/sys_input.h b/doomsday/engine/include/ui/sys_input.h index 5d94003cab..f608d7cc40 100644 --- a/doomsday/engine/include/ui/sys_input.h +++ b/doomsday/engine/include/ui/sys_input.h @@ -26,7 +26,9 @@ #ifndef LIBDENG_SYSTEM_INPUT_H #define LIBDENG_SYSTEM_INPUT_H -#include "joystick.h" +#ifdef __CLIENT__ +# include "joystick.h" +#endif #ifdef __cplusplus extern "C" { diff --git a/doomsday/engine/src/audio/s_main.c b/doomsday/engine/src/audio/s_main.c index d667258bb6..6b58b275b9 100644 --- a/doomsday/engine/src/audio/s_main.c +++ b/doomsday/engine/src/audio/s_main.c @@ -606,6 +606,7 @@ void S_PauseMusic(boolean paused) */ void S_Drawer(void) { +#ifdef __CLIENT__ if(!showSoundInfo) return; LIBDENG_ASSERT_IN_MAIN_THREAD(); @@ -622,6 +623,7 @@ void S_Drawer(void) // Back to the original. glMatrixMode(GL_PROJECTION); glPopMatrix(); +#endif // __CLIENT__ } /** diff --git a/doomsday/engine/src/audio/s_sfx.c b/doomsday/engine/src/audio/s_sfx.c index f5dc23fe40..ee4436a14f 100644 --- a/doomsday/engine/src/audio/s_sfx.c +++ b/doomsday/engine/src/audio/s_sfx.c @@ -1242,6 +1242,7 @@ void Sfx_MapChange(void) void Sfx_DebugInfo(void) { +#ifdef __CLIENT__ int i, lh; sfxchannel_t* ch; char buf[200]; @@ -1310,4 +1311,5 @@ void Sfx_DebugInfo(void) } glDisable(GL_TEXTURE_2D); +#endif } diff --git a/doomsday/engine/src/busymode.cpp b/doomsday/engine/src/busymode.cpp index 137ab98a79..5c99d94a04 100644 --- a/doomsday/engine/src/busymode.cpp +++ b/doomsday/engine/src/busymode.cpp @@ -34,31 +34,37 @@ #include #include -static QEventLoop* eventLoop; +#ifdef __CLIENT__ static void BusyMode_Loop(void); static void BusyMode_Exit(void); +static QEventLoop* eventLoop; +static volatile boolean busyDoneCopy; +static timespan_t busyTime; +static boolean busyWillAnimateTransition; + +#endif // __CLIENT__ + static boolean busyInited; static volatile boolean busyDone; -static volatile boolean busyDoneCopy; static mutex_t busy_Mutex; // To prevent Data races in the busy thread. static BusyTask* busyTask; // Current task. static thread_t busyThread; -static timespan_t busyTime; static timespan_t accumulatedBusyTime; // Never cleared. static boolean busyTaskEndedWithError; -static boolean busyWillAnimateTransition; static boolean busyWasIgnoringInput; static char busyError[256]; +#ifdef __CLIENT__ static boolean animatedTransitionActive(int busyMode) { return (!novideo && !isDedicated && !netGame && !(busyMode & BUSYF_STARTUP) && rTransitionTics > 0 && (busyMode & BUSYF_TRANSITION)); } +#endif boolean BusyMode_Active(void) { @@ -94,6 +100,8 @@ BusyTask* BusyMode_CurrentTask(void) return busyTask; } +#ifdef __CLIENT__ + /** * Callback that is called from the busy worker thread when it exists. * @param status Exit status. @@ -113,7 +121,7 @@ static void busyWorkerTerminated(systhreadexitstatus_t status) * loop is started. The loop will run until the worker thread exits. */ static void beginTask(BusyTask* task) -{ +{ DENG_ASSERT(task); if(!busyInited) @@ -185,6 +193,8 @@ static void endTask(BusyTask* task) busyInited = false; } +#endif // __CLIENT__ + /** * Runs the busy mode event loop. Execution blocks here until the worker thread exits. */ @@ -198,6 +208,8 @@ static int runTask(BusyTask* task) return task->worker(task->workerData); } +#ifdef __CLIENT__ + // Let's get busy! beginTask(task); @@ -215,16 +227,23 @@ static int runTask(BusyTask* task) endTask(task); return result; +#else + return 0; +#endif } static void preBusySetup(int initialMode) { +#ifdef __CLIENT__ // Are we doing a transition effect? busyWillAnimateTransition = animatedTransitionActive(initialMode); if(busyWillAnimateTransition) { Con_TransitionConfigure(); } +#else + DENG_UNUSED(initialMode); +#endif busyWasIgnoringInput = DD_IgnoreInput(true); @@ -374,6 +393,8 @@ int BusyMode_RunNewTask(int mode, busyworkerfunc_t worker, void* workerData) return BusyMode_RunNewTaskWithName(mode, worker, workerData, NULL/*no task name*/); } +#ifdef __CLIENT__ + /** * Ends the busy event loop and sets its return value. The loop callback, which * during busy mode points to the busy loop callback, is reset to NULL. @@ -462,6 +483,8 @@ static void BusyMode_Loop(void) BusyMode_Exit(); } +#endif // __CLIENT__ + void BusyMode_WorkerError(const char* message) { busyTaskEndedWithError = true; diff --git a/doomsday/engine/src/con_main.c b/doomsday/engine/src/con_main.c index d2fe1ca892..6b976c82a2 100644 --- a/doomsday/engine/src/con_main.c +++ b/doomsday/engine/src/con_main.c @@ -110,7 +110,9 @@ D_CMD(IncDec); D_CMD(Alias); D_CMD(Clear); D_CMD(Echo); +#ifdef __CLIENT__ D_CMD(Font); +#endif D_CMD(Help); D_CMD(If); D_CMD(OpenClose); @@ -198,7 +200,9 @@ void Con_Register(void) C_CMD("echo", "s*", Echo); C_CMD("print", "s*", Echo); C_CMD("exec", "s*", Parse); +#ifdef __CLIENT__ C_CMD("font", NULL, Font); +#endif C_CMD("help", "", Help); C_CMD("if", NULL, If); C_CMD("inc", NULL, IncDec); @@ -686,8 +690,12 @@ void Con_Ticker(timespan_t time) { Con_CheckExecBuffer(); if(tickFrame) + { Con_TransitionTicker(time); + } +#ifdef __CLIENT__ Rend_ConsoleTicker(time); +#endif if(!ConsoleActive) return; // We have nothing further to do here. @@ -774,6 +782,7 @@ static int executeSubCmd(const char *subCmd, byte src, boolean isNetCmd) } */ +#ifdef __CLIENT__ // If logged in, send command to server at this point. if(!isServer && netLoggedIn) { @@ -781,6 +790,7 @@ static int executeSubCmd(const char *subCmd, byte src, boolean isNetCmd) Con_Send(subCmd, src, ConsoleSilent); return true; } +#endif // Try to find a matching console command. ccmd = Con_FindCommandMatchArgs(&args); @@ -2528,6 +2538,8 @@ D_CMD(OpenClose) return true; } +#ifdef __CLIENT__ + D_CMD(Font) { if(argc == 1 || argc > 3) @@ -2636,6 +2648,8 @@ D_CMD(Font) return false; } +#endif // __CLIENT__ + D_CMD(DebugCrash) { int* ptr = (int*) 0x123; diff --git a/doomsday/engine/src/dd_init.cpp b/doomsday/engine/src/dd_init.cpp index d80d8208d3..5607ce3bc5 100644 --- a/doomsday/engine/src/dd_init.cpp +++ b/doomsday/engine/src/dd_init.cpp @@ -137,6 +137,8 @@ int main(int argc, char** argv) } } + novideo = !useGUI; + QMenuBar* menuBar = 0; // Application core. diff --git a/doomsday/engine/src/dd_loop.c b/doomsday/engine/src/dd_loop.c index f880a0a5e2..eac424ee8a 100644 --- a/doomsday/engine/src/dd_loop.c +++ b/doomsday/engine/src/dd_loop.c @@ -121,7 +121,7 @@ void DD_GameLoopCallback(void) Garbage_Recycle(); - if(isDedicated) +#ifdef __SERVER__ { // Adjust loop rate depending on whether players are in game. int i, count = 0; @@ -135,7 +135,9 @@ void DD_GameLoopCallback(void) // Update clients at regular intervals. Sv_TransmitFrame(); } - else +#endif + +#ifdef __CLIENT__ { // Normal client-side/singleplayer mode. //assert(!novideo); @@ -159,12 +161,15 @@ void DD_GameLoopCallback(void) // After the first frame, start timedemo. DD_CheckTimeDemo(); } +#endif } void DD_GameLoopDrawer(void) { if(novideo || Sys_IsShuttingDown()) return; +#ifdef __CLIENT__ + assert(!BusyMode_Active()); // Busy mode has its own drawer. LIBDENG_ASSERT_IN_MAIN_THREAD(); @@ -245,6 +250,8 @@ void DD_GameLoopDrawer(void) // Finish the refresh frame. endFrame(); + +#endif // __CLIENT__ } //static uint frameStartAt; @@ -305,7 +312,12 @@ boolean DD_IsSharpTick(void) boolean DD_IsFrameTimeAdvancing(void) { if(BusyMode_Active()) return false; - if(Con_TransitionInProgress()) return false; +#ifdef __CLIENT__ + if(Con_TransitionInProgress()) + { + return false; + } +#endif return tickFrame || netGame; } @@ -341,8 +353,10 @@ static void baseTicker(timespan_t time) { if(DD_IsFrameTimeAdvancing()) { +#ifdef __CLIENT__ // Demo ticker. Does stuff like smoothing of view angles. Demo_Ticker(time); +#endif P_Ticker(time); UI2_Ticker(time); @@ -355,13 +369,17 @@ static void baseTicker(timespan_t time) gx.Ticker(time); } +#ifdef __CLIENT__ // Windowing system ticks. R_Ticker(time); if(isClient) + { Cl_Ticker(time); - else - Sv_Ticker(time); + } +#elif __SERVER__ + Sv_Ticker(time); +#endif if(DD_IsSharpTick()) { @@ -391,8 +409,10 @@ static void baseTicker(timespan_t time) #endif } +#ifdef __CLIENT__ // While paused, don't modify frametime so things keep still. if(!clientPaused) +#endif { frameTimePos = realFrameTimePos; } @@ -449,7 +469,9 @@ static void advanceTime(timespan_t time) // Leveltic is reset to zero at every map change. // The map time only advances when the game is not paused. +#ifdef __CLIENT__ if(!clientPaused) +#endif { ddMapTime += time; } diff --git a/doomsday/engine/src/dd_main.cpp b/doomsday/engine/src/dd_main.cpp index bacd15857e..c848ec7fd6 100644 --- a/doomsday/engine/src/dd_main.cpp +++ b/doomsday/engine/src/dd_main.cpp @@ -56,6 +56,7 @@ #include "ui/displaymode.h" #include "updater.h" #include "m_misc.h" +#include "m_bams.h" extern int renderTextures; extern int monochrome; @@ -579,16 +580,18 @@ void DD_Register(void) DH_Register(); R_Register(); S_Register(); +#ifdef __CLIENT__ SBE_Register(); // for bias editor Rend_Register(); GL_Register(); + H_Register(); + UI_Register(); + Demo_Register(); +#endif Net_Register(); I_Register(); - H_Register(); DAM_Register(); BspBuilder_Register(); - UI_Register(); - Demo_Register(); P_ControlRegister(); FI_Register(); } @@ -662,8 +665,7 @@ void DD_DestroyGames(void) */ void DD_StartTitle(void) { - if(isDedicated) return; - +#ifdef __CLIENT ddfinale_t fin; if(!Def_Get(DD_DEF_FINALE, "background", &fin)) return; @@ -687,6 +689,7 @@ void DD_StartTitle(void) titleFinale = FI_Execute2(fin.script, FF_LOCAL, Str_Text(&setupCmds)); Str_Free(&setupCmds); +#endif } /** @@ -1357,11 +1360,14 @@ bool DD_ChangeGame(de::Game& game, bool allowReload = false) Con_Execute(CMDS_DDAY, isServer ? "net server close" : "net disconnect", true, false); S_Reset(); + +#ifdef __CLIENT__ Demo_StopPlayback(); GL_PurgeDeferredTasks(); GL_ResetTextureManager(); GL_SetFilter(false); +#endif // If a game is presently loaded; unload it. if(DD_GameLoaded()) @@ -1370,7 +1376,9 @@ bool DD_ChangeGame(de::Game& game, bool allowReload = false) gx.Shutdown(); Con_SaveDefaults(); +#ifdef __CLIENT__ LO_Clear(); +#endif R_DestroyObjlinkBlockmap(); R_ClearAnimGroups(); @@ -1551,8 +1559,10 @@ bool DD_ChangeGame(de::Game& game, bool allowReload = false) BusyMode_RunTasks(gameChangeTasks, sizeof(gameChangeTasks)/sizeof(gameChangeTasks[0])); +#ifdef __CLIENT__ // Process any GL-related tasks we couldn't while Busy. Rend_ParticleLoadExtraTextures(); +#endif if(DD_GameLoaded()) { @@ -1668,11 +1678,13 @@ void DD_FinishInitializationAfterWindowReady(void) DisplayMode_SaveOriginalColorTransfer(); #endif +#ifdef __CLIENT__ if(!Sys_GLInitialize()) { Con_Error("Error initializing OpenGL.\n"); } else +#endif { char buf[256]; DD_ComposeMainWindowTitle(buf); @@ -1732,28 +1744,13 @@ boolean DD_Init(void) } #endif +#ifdef __CLIENT__ if(!GL_EarlyInit()) { Sys_CriticalMessage("GL_EarlyInit() failed."); return false; } - - /* - DENG_ASSERT(!Sys_GLCheckError()); - if(!novideo) - { - // Render a few black frames before we continue. This will help to - // stabilize things before we begin drawing for real and to avoid any - // unwanted video artefacts. - i = 0; - while(i++ < 3) - { - glClear(GL_COLOR_BUFFER_BIT); - GL_DoUpdate(); - } - } - DENG_ASSERT(!Sys_GLCheckError()); -*/ +#endif // Initialize the subsystems needed prior to entering busy mode for the first time. Sys_Init(); @@ -1772,8 +1769,10 @@ boolean DD_Init(void) DD_StartupWorker, 0, "Starting up..."); // Engine initialization is complete. Now finish up with the GL. +#ifdef __CLIENT__ GL_Init(); GL_InitRefresh(); +#endif // Do deferred uploads. Con_InitProgress2(200, .25f, .25f); // Stop here for a while. @@ -2075,7 +2074,9 @@ static int DD_StartupWorker(void* parm) Con_SetProgress(165); Net_InitGame(); +#ifdef __CLIENT__ Demo_Init(); +#endif Con_Message("Initializing InFine subsystem...\n"); FI_Init(); @@ -2150,10 +2151,12 @@ static int DD_UpdateEngineStateWorker(void* parameters) DENG_ASSERT(parameters); ddupdateenginestateworker_paramaters_t* p = (ddupdateenginestateworker_paramaters_t*) parameters; +#ifdef __CLIENT__ if(!novideo) { GL_InitRefresh(); } +#endif if(p->initiatedBusyMode) Con_SetProgress(50); @@ -2176,7 +2179,9 @@ void DD_UpdateEngineState(void) // Stop playing sounds and music. GL_SetFilter(false); +#ifdef __CLIENT__ Demo_StopPlayback(); +#endif S_Reset(); //App_FileSystem()->resetFileIds(); @@ -2196,12 +2201,15 @@ void DD_UpdateEngineState(void) gx.UpdateState(DD_PRE); hadFog = usingFog; + +#ifdef __CLIENT__ GL_TotalReset(); GL_TotalRestore(); // Bring GL back online. // Make sure the fog is enabled, if necessary. if(hadFog) GL_UseFog(true); +#endif /** * The bulk of this we can do in busy mode unless we are already busy @@ -2239,29 +2247,54 @@ ddvalue_t ddValues[DD_LAST_VALUE - DD_FIRST_VALUE - 1] = { {&displayPlayer, 0 /*&displayPlayer*/}, // use R_SetViewPortPlayer() instead {&mipmapping, 0}, {&filterUI, 0}, +#ifdef __CLIENT__ {&defResX, &defResX}, {&defResY, &defResY}, +#else + {0, 0}, + {0, 0}, +#endif {0, 0}, {0, 0}, //{&mouseInverseY, &mouseInverseY}, {&levelFullBright, &levelFullBright}, {&CmdReturnValue, 0}, +#ifdef __CLIENT__ {&gameReady, &gameReady}, +#else + {0, 0}, +#endif {&isDedicated, 0}, {&novideo, 0}, {&defs.count.mobjs.num, 0}, {&gotFrame, 0}, +#ifdef __CLIENT__ {&playback, 0}, +#else + {0, 0}, +#endif {&defs.count.sounds.num, 0}, {&defs.count.music.num, 0}, {0, 0}, +#ifdef __CLIENT__ {&clientPaused, &clientPaused}, +#else + {0, 0}, +#endif {&weaponOffsetScaleY, &weaponOffsetScaleY}, {&monochrome, &monochrome}, {&gameDataFormat, &gameDataFormat}, +#ifdef __CLIENT__ {&gameDrawHUD, 0}, +#else + {0, 0}, +#endif {&upscaleAndSharpenPatches, &upscaleAndSharpenPatches}, {&symbolicEchoMode, &symbolicEchoMode}, +#ifdef __CLIENT__ {&numTexUnits, 0} +#else + {0, 0}, +#endif }; /* *INDENT-ON* */ @@ -2287,8 +2320,10 @@ int DD_GetInteger(int ddvalue) case DD_NUMLUMPS: return F_LumpCount(); +#ifdef __CLIENT__ case DD_CURRENT_CLIENT_FINALE_ID: return Cl_CurrentFinale(); +#endif case DD_MAP_MUSIC: { GameMap* map = theMap; @@ -2448,6 +2483,7 @@ void* DD_GetVariable(int ddvalue) valueD = theMap? GameMap_Gravity(theMap) : 0; return &valueD; +#ifdef __CLIENT__ case DD_TORCH_RED: return &torchColor[CR]; @@ -2459,6 +2495,7 @@ void* DD_GetVariable(int ddvalue) case DD_TORCH_ADDITIVE: return &torchAdditive; +#endif #ifdef WIN32 case DD_WINDOW_HANDLE: @@ -2536,6 +2573,7 @@ void DD_SetVariable(int ddvalue, void *parm) pspLightLevelMultiplier = *(float*) parm; return; +#ifdef __CLIENT__ case DD_TORCH_RED: torchColor[CR] = MINMAX_OF(0, *((float*) parm), 1); return; @@ -2551,6 +2589,7 @@ void DD_SetVariable(int ddvalue, void *parm) case DD_TORCH_ADDITIVE: torchAdditive = (*(int*) parm)? true : false; break; +#endif default: break; diff --git a/doomsday/engine/src/dd_pinit.c b/doomsday/engine/src/dd_pinit.c index 5f5f9e0676..0b35c1cd54 100644 --- a/doomsday/engine/src/dd_pinit.c +++ b/doomsday/engine/src/dd_pinit.c @@ -38,6 +38,7 @@ #include "de_filesys.h" #include "def_main.h" +#include "render/r_main.h" #include "updater.h" /* @@ -179,9 +180,11 @@ void DD_ShutdownAll(void) SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, FALSE, 0, 0); #endif +#ifdef __CLIENT__ // Stop all demo recording. for(i = 0; i < DDMAXPLAYERS; ++i) Demo_StopRecording(i); +#endif P_ControlShutdown(); Sv_Shutdown(); diff --git a/doomsday/engine/src/def_main.cpp b/doomsday/engine/src/def_main.cpp index cc286339d6..ed386ca866 100644 --- a/doomsday/engine/src/def_main.cpp +++ b/doomsday/engine/src/def_main.cpp @@ -1449,12 +1449,13 @@ static void defineLightmap(uri_s const *_resourceUri) void Def_PostInit(void) { - char name[40]; +#ifdef __CLIENT__ // Particle generators: model setup. ded_ptcgen_t *gen = defs.ptcGens; for(int i = 0; i < defs.count.ptcGens.num; ++i, gen++) { + char name[40]; ded_ptcstage_t *st = gen->stages; for(int k = 0; k < gen->stageCount.num; ++k, st++) { @@ -1486,6 +1487,8 @@ void Def_PostInit(void) } } +#endif // __CLIENT__ + // Detail textures. App_Textures()->scheme("Details").clear(); for(int i = 0; i < defs.count.details.num; ++i) diff --git a/doomsday/engine/src/edit_bias.c b/doomsday/engine/src/edit_bias.c index 88350f2f37..4c01eb1963 100644 --- a/doomsday/engine/src/edit_bias.c +++ b/doomsday/engine/src/edit_bias.c @@ -249,8 +249,10 @@ void SBE_EndFrame(void) static void SBE_Begin(void) { +#ifdef __CLIENT__ // Advise the game not to draw any HUD displays gameDrawHUD = false; +#endif editActive = true; editGrabbed = -1; @@ -259,8 +261,10 @@ static void SBE_Begin(void) static void SBE_End(void) { +#ifdef __CLIENT__ // Advise the game it can safely draw any HUD displays again gameDrawHUD = true; +#endif editActive = false; Con_Printf("Bias light editor: OFF\n"); diff --git a/doomsday/engine/src/gl/gl_texmanager.cpp b/doomsday/engine/src/gl/gl_texmanager.cpp index 15df42c083..4fcba0f057 100644 --- a/doomsday/engine/src/gl/gl_texmanager.cpp +++ b/doomsday/engine/src/gl/gl_texmanager.cpp @@ -51,6 +51,15 @@ using namespace de; +int monochrome = 0; // desaturate a patch (average colours) +int mipmapping = 5; +int filterUI = 1; +int texQuality = TEXQ_BEST; +int upscaleAndSharpenPatches = 0; +byte gammaTable[256]; + +#ifdef __CLIENT__ + enum uploadcontentmethod_t { METHOD_IMMEDIATE = 0, @@ -108,10 +117,7 @@ static TexSource loadPatchComposite(image_t &image, de::Texture &tex, int ratioLimit = 0; // Zero if none. boolean fillOutlines = true; -int monochrome = 0; // desaturate a patch (average colours) -int upscaleAndSharpenPatches = 0; int useSmartFilter = 0; // Smart filter mode (cvar: 1=hq2x) -int mipmapping = 5, filterUI = 1, texQuality = TEXQ_BEST; int filterSprites = true; int texMagMode = 1; // Linear. int texAniso = -1; // Use best. @@ -122,7 +128,6 @@ boolean highResWithPWAD = false; byte loadExtAlways = false; // Always check for extres (cvar) float texGamma = 0; -byte gammaTable[256]; int glmode[6] = // Indexed by 'mipmapping'. { @@ -160,6 +165,8 @@ static variantspecificationlist_t *detailVariantSpecs[DETAILVARIANT_CONTRAST_HAS void GL_TexRegister() { +#ifdef __CLIENT__ + C_VAR_INT ("rend-tex", &renderTextures, CVF_NO_ARCHIVE, 0, 2); C_VAR_INT ("rend-tex-detail", &r_detail, 0, 0, 1); C_VAR_INT ("rend-tex-detail-multitex", &useMultiTexDetails, 0, 0, 1); @@ -179,6 +186,8 @@ void GL_TexRegister() C_CMD_FLAGS ("mipmap", "i", MipMap, CMDF_NO_DEDICATED); C_CMD_FLAGS ("texreset", "", TexReset, CMDF_NO_DEDICATED); +#endif + Textures::consoleRegister(); } @@ -1511,6 +1520,8 @@ static inline bool isColorKeyed(String path) uint8_t *Image_LoadFromFile(image_t *img, filehandle_s *_file) { +#ifdef __CLIENT__ + DENG_ASSERT(img && _file); de::FileHandle &file = reinterpret_cast(*_file); LOG_AS("Image_LoadFromFile"); @@ -1553,6 +1564,12 @@ uint8_t *Image_LoadFromFile(image_t *img, filehandle_s *_file) << NativePath(filePath).pretty() << img->size.width << img->size.height; return img->pixels; + +#else + DENG_UNUSED(img); + DENG_UNUSED(_file); + return NULL; +#endif } uint8_t *GL_LoadImage(image_t *img, char const *filePath) @@ -1575,6 +1592,8 @@ uint8_t *GL_LoadImageStr(image_t *img, ddstring_t const *filePath) return GL_LoadImage(img, Str_Text(filePath)); } +#ifdef __CLIENT__ + static int BytesPerPixelFmt(dgltexformat_t format) { switch(format) @@ -2200,6 +2219,8 @@ TexSource GL_LoadExtTexture(image_t *image, char const *_searchPath, gfxmode_t m return source; } +#endif // __CLIENT__ + static boolean palettedIsMasked(const uint8_t* pixels, int width, int height) { int i; @@ -3476,3 +3497,5 @@ D_CMD(MipMap) GL_SetTextureParams(glmode[mipmapping], true, false); return true; } + +#endif // __CLIENT__ diff --git a/doomsday/engine/src/gridmap.c b/doomsday/engine/src/gridmap.c index d8b7edf3e9..4a55ff494e 100644 --- a/doomsday/engine/src/gridmap.c +++ b/doomsday/engine/src/gridmap.c @@ -480,8 +480,10 @@ void GridmapBlock_SetCoordsXY(GridmapCellBlock* block, GridmapCoord minX, Gridma GridmapBlock_SetCoords(block, min, max); } -#define UNIT_WIDTH 1 -#define UNIT_HEIGHT 1 +#ifdef __CLIENT__ + +#define UNIT_WIDTH 1 +#define UNIT_HEIGHT 1 static int drawCell(TreeCell* tree, void* parameters) { @@ -542,3 +544,5 @@ void Gridmap_DebugDrawer(const Gridmap* gm) #undef UNIT_HEIGHT #undef UNIT_WIDTH + +#endif // __CLIENT__ diff --git a/doomsday/engine/src/map/bsp/partitioner.cpp b/doomsday/engine/src/map/bsp/partitioner.cpp index 09042eced9..239134de30 100644 --- a/doomsday/engine/src/map/bsp/partitioner.cpp +++ b/doomsday/engine/src/map/bsp/partitioner.cpp @@ -38,12 +38,13 @@ #include #include "de_base.h" -#include "map/p_mapdata.h" +#include "map/p_mapdata.h" #include "map/bspleaf.h" #include "map/bspnode.h" #include "map/hedge.h" #include "map/vertex.h" + #include "map/bsp/hedgeinfo.h" #include "map/bsp/hedgeintercept.h" #include "map/bsp/hedgetip.h" @@ -52,9 +53,10 @@ #include "map/bsp/partitioncost.h" #include "map/bsp/superblockmap.h" #include "map/bsp/vertexinfo.h" - #include "map/bsp/partitioner.h" +#include "render/r_main.h" // validCount + using namespace de::bsp; // Misc utility routines (most don't belong here...): diff --git a/doomsday/engine/src/map/dam_main.cpp b/doomsday/engine/src/map/dam_main.cpp index a1f2fc518a..18e85e0b73 100644 --- a/doomsday/engine/src/map/dam_main.cpp +++ b/doomsday/engine/src/map/dam_main.cpp @@ -332,7 +332,9 @@ boolean DAM_AttemptMapLoad(Uri const* _uri) skyDef = &mapInfo->sky; } +#ifdef __CLIENT__ Sky_Configure(skyDef); +#endif // Setup accordingly. if(mapInfo) @@ -353,7 +355,9 @@ boolean DAM_AttemptMapLoad(Uri const* _uri) // theMap to be set first. P_SetCurrentMap(map); +#ifdef __CLIENT__ Rend_RadioInitForMap(); +#endif { uint startTime = Timer_RealMilliseconds(); GameMap_InitSkyFix(map); diff --git a/doomsday/engine/src/map/gamemap.c b/doomsday/engine/src/map/gamemap.c index 6c28ff7212..c1ce9f035e 100644 --- a/doomsday/engine/src/map/gamemap.c +++ b/doomsday/engine/src/map/gamemap.c @@ -30,6 +30,7 @@ #include "map/blockmap.h" #include "map/generators.h" #include "map/gamemap.h" +#include "render/r_main.h" // validCount #include "r_util.h" /// Size of Blockmap blocks in map units. Must be an integer power of two. diff --git a/doomsday/engine/src/map/linedef.c b/doomsday/engine/src/map/linedef.c index 077dfcd26a..77d77a51f1 100644 --- a/doomsday/engine/src/map/linedef.c +++ b/doomsday/engine/src/map/linedef.c @@ -32,6 +32,8 @@ #include "map/linedef.h" +#include + static void calcNormal(const LineDef* l, byte side, pvec2f_t normal) { V2f_Set(normal, (l->L_vorigin(side^1)[VY] - l->L_vorigin(side) [VY]) / l->length, diff --git a/doomsday/engine/src/map/p_data.cpp b/doomsday/engine/src/map/p_data.cpp index f0d1fe7d9e..4b0cd1657e 100644 --- a/doomsday/engine/src/map/p_data.cpp +++ b/doomsday/engine/src/map/p_data.cpp @@ -187,11 +187,13 @@ boolean P_LoadMap(char const* uriCString) GameMap_ClMobjReset(map); +#ifdef __CLIENT__ // Clear player data, too, since we just lost all clmobjs. Cl_InitPlayers(); RL_DeleteLists(); Rend_CalcLightModRange(); +#endif // Invalidate old cmds and init player values. for(uint i = 0; i < DDMAXPLAYERS; ++i) @@ -213,18 +215,19 @@ boolean P_LoadMap(char const* uriCString) Materials_ResetAnimGroups(); R_InitObjlinkBlockmapForMap(); + +#ifdef __CLIENT__ LO_InitForMap(); // Lumobj management. R_InitShadowProjectionListsForMap(); // Projected mobj shadows. VL_InitForMap(); // Converted vlights (from lumobjs) management. - // Init Particle Generator links. - P_PtcInitForMap(); - // Initialize the lighting grid. LG_InitForMap(); - if(!isDedicated) - R_InitRendPolyPools(); + R_InitRendPolyPools(); +#endif + // Init Particle Generator links. + P_PtcInitForMap(); return true; } diff --git a/doomsday/engine/src/map/p_maputil.c b/doomsday/engine/src/map/p_maputil.c index 90bffed5c8..4ec5e4112c 100644 --- a/doomsday/engine/src/map/p_maputil.c +++ b/doomsday/engine/src/map/p_maputil.c @@ -33,6 +33,8 @@ #include "de_play.h" #include "de_misc.h" +#include "render/r_main.h" // validCount + #define ORDER(x,y,a,b) ( (x)<(y)? ((a)=(x),(b)=(y)) : ((b)=(x),(a)=(y)) ) // Linkstore is list of pointers gathered when iterating stuff. diff --git a/doomsday/engine/src/map/p_mobj.c b/doomsday/engine/src/map/p_mobj.c index 847f8f9673..52c1edba1a 100644 --- a/doomsday/engine/src/map/p_mobj.c +++ b/doomsday/engine/src/map/p_mobj.c @@ -42,6 +42,7 @@ #include "de_audio.h" #include "def_main.h" +#include "render/r_main.h" // validCount, viewport #include "render/r_things.h" // useSRVO // MACROS ------------------------------------------------------------------ @@ -266,11 +267,13 @@ angle_t Mobj_AngleSmoothed(mobj_t* mo) } } +#ifdef __CLIENT__ // Apply a Short Range Visual Offset? if(useSRVOAngle && !netGame && !playback) { return mo->visAngle << 16; } +#endif return mo->angle; } @@ -287,7 +290,10 @@ D_CMD(InspectMobj) { mobj_t* mo = 0; thid_t id = 0; + char const *moType = "Mobj"; +#ifdef __CLIENT clmoinfo_t* info = 0; +#endif if(argc != 2) { @@ -306,9 +312,12 @@ D_CMD(InspectMobj) return false; } +#ifdef __CLIENT info = ClMobj_GetInfo(mo); + if(info) moType = "CLMOBJ"; +#endif - Con_Printf("%s %i [%p] State:%s (%i)\n", info? "CLMOBJ" : "Mobj", id, mo, Def_GetStateName(mo->state), (int)(mo->state - states)); + Con_Printf("%s %i [%p] State:%s (%i)\n", moType, id, mo, Def_GetStateName(mo->state), (int)(mo->state - states)); Con_Printf("Type:%s (%i) Info:[%p]", Def_GetMobjName(mo->type), mo->type, mo->info); if(mo->info) { @@ -319,10 +328,12 @@ D_CMD(InspectMobj) Con_Printf("\n"); } Con_Printf("Tics:%i ddFlags:%08x\n", mo->tics, mo->ddFlags); +#ifdef __CLIENT if(info) { Con_Printf("Cltime:%i (now:%i) Flags:%04x\n", info->time, Timer_RealMilliseconds(), info->flags); } +#endif Con_Printf("Flags:%08x Flags2:%08x Flags3:%08x\n", mo->flags, mo->flags2, mo->flags3); Con_Printf("Height:%f Radius:%f\n", mo->height, mo->radius); Con_Printf("Angle:%x Pos:(%f,%f,%f) Mom:(%f,%f,%f)\n", diff --git a/doomsday/engine/src/map/p_objlink.c b/doomsday/engine/src/map/p_objlink.c index 63786725b4..7018185d96 100644 --- a/doomsday/engine/src/map/p_objlink.c +++ b/doomsday/engine/src/map/p_objlink.c @@ -420,6 +420,7 @@ static void findContacts(objlink_t* link) switch(link->type) { +#ifdef __CLIENT__ case OT_LUMOBJ: { lumobj_t* lum = (lumobj_t*) link->obj; // Only omni lights spread. @@ -430,6 +431,7 @@ static void findContacts(objlink_t* link) ssecAdr = &lum->bspLeaf; break; } +#endif case OT_MOBJ: { mobj_t* mo = (mobj_t*) link->obj; @@ -505,10 +507,14 @@ void R_ObjlinkBlockmapSpreadInBspLeaf(objlinkblockmap_t* obm, const BspLeaf* bsp static __inline const float maxRadius(objtype_t type) { +#ifdef __CLIENT__ assert(VALID_OBJTYPE(type)); if(type == OT_MOBJ) return DDMOBJ_RADIUS_MAX; // Must be OT_LUMOBJ return loMaxRadius; +#else + return DDMOBJ_RADIUS_MAX; +#endif } void R_InitForBspLeaf(BspLeaf* bspLeaf) @@ -550,7 +556,9 @@ BEGIN_PROF( PROF_OBJLINK_LINK ); { switch(link->type) { +#ifdef __CLIENT__ case OT_LUMOBJ: origin = ((lumobj_t*)link->obj)->origin; break; +#endif case OT_MOBJ: origin = ((mobj_t*)link->obj)->origin; break; default: Con_Error("R_LinkObjs: Invalid objtype %i.", (int) link->type); diff --git a/doomsday/engine/src/map/p_particle.c b/doomsday/engine/src/map/p_particle.c index 1a7e8c23a6..18328a95c2 100644 --- a/doomsday/engine/src/map/p_particle.c +++ b/doomsday/engine/src/map/p_particle.c @@ -31,6 +31,7 @@ #include "de_misc.h" #include "map/generators.h" +#include "render/r_main.h" // validCount #include "resource/models.h" #define ORDER(x,y,a,b) ( (x)<(y)? ((a)=(x),(b)=(y)) : ((b)=(x),(a)=(y)) ) @@ -467,6 +468,9 @@ static void P_ParticleSound(fixed_t pos[3], ded_embsound_t* sound) */ static void P_NewParticle(ptcgen_t* gen) { +#ifdef __SERVER__ + DENG_UNUSED(gen); +#else const ded_ptcgen_t* def = gen->def; particle_t* pt; int i; @@ -704,8 +708,12 @@ static void P_NewParticle(ptcgen_t* gen) // Play a stage sound? P_ParticleSound(pt->origin, &def->stages[pt->stage].sound); + +#endif // !__SERVER__ } +#ifdef __CLIENT__ + /** * Callback for the client mobj iterator, called from P_PtcGenThinker. */ @@ -731,6 +739,8 @@ boolean PIT_ClientMobjParticles(mobj_t* cmo, void* context) return true; } +#endif + /** * Spawn multiple new particles using all applicable sources. */ @@ -1222,12 +1232,13 @@ void P_PtcGenThinker(ptcgen_t* gen) // Spawn a new particle. if(gen->type == DED_PTCGEN_ANY_MOBJ_TYPE || gen->type >= 0) // Type-triggered? { +#ifdef __CLIENT__ // Client's should also check the client mobjs. if(isClient) { GameMap_ClMobjIterator(theMap, PIT_ClientMobjParticles, gen); } - +#endif GameMap_IterateThinkers(theMap, gx.MobjThinker, 0x1 /*mobjs are public*/, manyNewParticles, gen); diff --git a/doomsday/engine/src/map/p_sight.c b/doomsday/engine/src/map/p_sight.c index 7d8763739a..85f02a99a3 100644 --- a/doomsday/engine/src/map/p_sight.c +++ b/doomsday/engine/src/map/p_sight.c @@ -32,6 +32,8 @@ #include "de_console.h" #include "de_play.h" +#include "render/r_main.h" // validCount + typedef struct losdata_s { int flags; // LS_* flags @ref lineSightFlags divline_t trace; diff --git a/doomsday/engine/src/map/p_think.c b/doomsday/engine/src/map/p_think.c index 7572a46e05..0baccaec6d 100644 --- a/doomsday/engine/src/map/p_think.c +++ b/doomsday/engine/src/map/p_think.c @@ -163,6 +163,7 @@ static int runThinker(thinker_t* th, void* context) if(th->id) { mobj_t* mo = (mobj_t*) th; +#ifdef __CLIENT__ if(!Cl_IsClientMobj(mo)) { // It's a regular mobj: recycle for reduced allocation overhead. @@ -173,6 +174,9 @@ static int runThinker(thinker_t* th, void* context) // Delete the client mobj. ClMobj_Destroy(mo); } +#else + P_MobjRecycle(mo); +#endif } else { @@ -231,7 +235,9 @@ void GameMap_ThinkerAdd(GameMap* map, thinker_t* th, boolean makePublic) { // It is a mobj, give it an ID (not for client mobjs, though, they // already have an id). +#ifdef __CLIENT__ if(!Cl_IsClientMobj((mobj_t*)th)) +#endif { th->id = newMobjID(map); } diff --git a/doomsday/engine/src/map/p_ticker.c b/doomsday/engine/src/map/p_ticker.c index b05413b9af..fa00bb6dc8 100644 --- a/doomsday/engine/src/map/p_ticker.c +++ b/doomsday/engine/src/map/p_ticker.c @@ -64,6 +64,7 @@ int P_MobjTicker(thinker_t* th, void* context) int f; byte* haloFactor = &mo->haloFactors[i]; +#ifdef __CLIENT__ // Set the high bit of halofactor if the light is clipped. This will // make P_Ticker diminish the factor to zero. Take the first step here // and now, though. @@ -107,6 +108,7 @@ int P_MobjTicker(thinker_t* th, void* context) *haloFactor &= ~0x7f; *haloFactor |= f; +#endif } return false; // Continue iteration. diff --git a/doomsday/engine/src/map/polyobj.c b/doomsday/engine/src/map/polyobj.c index cc9624f203..e2604b4e9a 100644 --- a/doomsday/engine/src/map/polyobj.c +++ b/doomsday/engine/src/map/polyobj.c @@ -25,6 +25,8 @@ #include "de_play.h" #include "de_misc.h" +#include "render/r_main.h" // validCount + static void rotatePoint(int an, coord_t* x, coord_t* y, coord_t startSpotX, coord_t startSpotY); static boolean checkMobjBlocking(LineDef* line, Polyobj* po); diff --git a/doomsday/engine/src/map/r_world.c b/doomsday/engine/src/map/r_world.c index f4aff87313..6b9447bea9 100644 --- a/doomsday/engine/src/map/r_world.c +++ b/doomsday/engine/src/map/r_world.c @@ -593,12 +593,12 @@ Plane* R_NewPlaneForSector(Sector* sec) Surface_SetBlendMode(suf, BM_NORMAL); Surface_UpdateBaseOrigin(suf); +#ifdef __CLIENT__ /** * Resize the biassurface lists for the BSP leaf planes. * If we are in map setup mode, don't create the biassurfaces now, * as planes are created before the bias system is available. */ - if(sec->bspLeafs && *sec->bspLeafs) { BspLeaf** ssecIter = sec->bspLeafs; @@ -609,6 +609,7 @@ Plane* R_NewPlaneForSector(Sector* sec) uint n = 0; newList = Z_Calloc(sec->planeCount * sizeof(biassurface_t*), PU_MAP, NULL); + // Copy the existing list? if(bspLeaf->bsuf) { @@ -639,6 +640,7 @@ Plane* R_NewPlaneForSector(Sector* sec) ssecIter++; } while(*ssecIter); } +#endif return plane; } @@ -1586,6 +1588,7 @@ void R_ClearSectorFlags(void) boolean R_IsGlowingPlane(const Plane* pln) { +#ifdef __CLIENT__ /// @todo We should not need to prepare to determine this. material_t* mat = pln->surface.material; if(mat) @@ -1597,10 +1600,14 @@ boolean R_IsGlowingPlane(const Plane* pln) if(!Material_IsDrawable(mat) || ms->glowing > 0) return true; } return Surface_IsSkyMasked(&pln->surface); +#else + return false; +#endif } float R_GlowStrength(const Plane* pln) { +#ifdef __CLIENT__ material_t* mat = pln->surface.material; if(mat) { @@ -1614,6 +1621,7 @@ float R_GlowStrength(const Plane* pln) return ms->glowing; } } +#endif return 0; } @@ -2023,6 +2031,8 @@ float R_CheckSectorLight(float lightlevel, float min, float max) return MINMAX_OF(0, (lightlevel - min) / (float) (max - min), 1); } +#ifdef __CLIENT__ + const float* R_GetSectorLightColor(const Sector* sector) { static vec3f_t skyLightColor, oldSkyAmbientColor = { -1, -1, -1 }; @@ -2053,6 +2063,8 @@ const float* R_GetSectorLightColor(const Sector* sector) return sector->rgb; // The sector's ambient light color. } +#endif // __CLIENT__ + coord_t R_SkyCapZ(BspLeaf* bspLeaf, int skyCap) { const planetype_t plane = (skyCap & SKYCAP_UPPER)? PLN_CEILING : PLN_FLOOR; diff --git a/doomsday/engine/src/network/net_main.c b/doomsday/engine/src/network/net_main.c index ef4af669a9..ced35f98bf 100644 --- a/doomsday/engine/src/network/net_main.c +++ b/doomsday/engine/src/network/net_main.c @@ -43,10 +43,12 @@ #include "de_misc.h" #include "de_ui.h" -#include "render/rend_bias.h" -#include "render/rend_console.h" -#include "render/r_lgrid.h" -#include "map/blockmapvisual.h" +#ifdef __CLIENT__ +# include "render/rend_bias.h" +# include "render/rend_console.h" +# include "render/r_lgrid.h" +# include "map/blockmapvisual.h" +#endif // MACROS ------------------------------------------------------------------ @@ -62,7 +64,9 @@ // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- +#ifdef __CLIENT__ D_CMD(Login); // in cl_main.c +#endif D_CMD(Logout); // in sv_main.c D_CMD(Ping); // in net_ping.c @@ -157,7 +161,9 @@ void Net_Register(void) C_CMD_FLAGS("conlocp", "i", MakeCamera, CMDF_NO_NULLGAME); C_CMD_FLAGS("connect", NULL, Connect, CMDF_NO_NULLGAME|CMDF_NO_DEDICATED); C_CMD_FLAGS("kick", "i", Kick, CMDF_NO_NULLGAME); +#ifdef __CLIENT__ C_CMD_FLAGS("login", NULL, Login, CMDF_NO_NULLGAME); +#endif C_CMD_FLAGS("logout", "", Logout, CMDF_NO_NULLGAME); C_CMD_FLAGS("net", NULL, Net, CMDF_NO_NULLGAME); C_CMD_FLAGS("ping", NULL, Ping, CMDF_NO_NULLGAME); @@ -215,9 +221,11 @@ void Net_SendBuffer(int toPlayer, int spFlags) { assert(!Msg_BeingWritten()); // Must finish writing before calling this. +#ifdef __CLIENT__ // Don't send anything during demo playback. if(playback) return; +#endif netBuffer.player = toPlayer; @@ -229,7 +237,9 @@ void Net_SendBuffer(int toPlayer, int spFlags) return; } +#ifdef __CLIENT__ Demo_WritePacket(toPlayer); +#endif // Can we send the packet? if(spFlags & SPF_DONT_SEND) @@ -253,10 +263,12 @@ boolean Net_GetPacket(void) return true; } +#ifdef __CLIENT__ if(playback) { // We're playing a demo. This overrides all other packets. return Demo_ReadPacket(); } +#endif if(!netGame) { // Packets cannot be received. @@ -266,12 +278,13 @@ boolean Net_GetPacket(void) if(!N_GetPacket()) return false; +#ifdef __CLIENT__ // Are we recording a demo? if(isClient && clients[consolePlayer].recording) + { Demo_WritePacket(consolePlayer); - - // Reset the cursor for Msg_* routines. - //netBuffer.cursor = netBuffer.msg.data; + } +#endif return true; } @@ -464,10 +477,11 @@ void Net_Update(void) N_ListenNodes(); // Check for received packets. - if(isClient) - Cl_GetPackets(); - else - Sv_GetPackets(); +#ifdef __CLIENT__ + Cl_GetPackets(); +#elif __SERVER__ + Sv_GetPackets(); +#endif } /** @@ -507,7 +521,9 @@ void Net_DestroyArrays(void) */ void Net_InitGame(void) { +#ifdef __CLIENT__ Cl_InitID(); +#endif // In single-player mode there is only player number zero. consolePlayer = displayPlayer = 0; @@ -520,7 +536,10 @@ void Net_InitGame(void) ddPlayers[0].shared.inGame = true; ddPlayers[0].shared.flags |= DDPF_LOCAL; + +#ifdef __CLIENT clients[0].id = clientID; +#endif clients[0].ready = true; clients[0].connected = true; clients[0].viewConsole = 0; @@ -535,32 +554,33 @@ void Net_StopGame(void) { int i; +#ifdef __SERVER__ if(isServer) - { // We are an open server. + { + // We are an open server. // This means we should inform all the connected clients that the // server is about to close. Msg_Begin(PSV_SERVER_CLOSE); Msg_End(); Net_SendBuffer(NSP_BROADCAST, 0); -#if 0 - N_FlushOutgoing(); -#endif } - else - { -#ifdef _DEBUG - Con_Message("Net_StopGame: Sending PCL_GOODBYE.\n"); #endif - // We are a connected client. - Msg_Begin(PCL_GOODBYE); - Msg_End(); - Net_SendBuffer(0, 0); - // Must stop recording, we're disconnecting. - Demo_StopRecording(consolePlayer); - Cl_CleanUp(); - isClient = false; - } +#ifdef __CLIENT__ +# ifdef _DEBUG + Con_Message("Net_StopGame: Sending PCL_GOODBYE.\n"); +# endif + // We are a connected client. + Msg_Begin(PCL_GOODBYE); + Msg_End(); + Net_SendBuffer(0, 0); + + // Must stop recording, we're disconnecting. + Demo_StopRecording(consolePlayer); + Cl_CleanUp(); + isClient = false; + netLoggedIn = false; +#endif // Netgame has ended. netGame = false; @@ -569,7 +589,6 @@ void Net_StopGame(void) // No more remote users. netRemoteUser = 0; - netLoggedIn = false; // All remote players are forgotten. for(i = 0; i < DDMAXPLAYERS; ++i) @@ -642,6 +661,8 @@ static boolean recordingDemo(void) return false; } +#ifdef __CLIENT__ + void Net_DrawDemoOverlay(void) { char buf[160], tmp[40]; @@ -689,11 +710,14 @@ void Net_DrawDemoOverlay(void) glPopMatrix(); } +#endif // __CLIENT__ + /** * Does drawing for the engine's HUD, not just the net. */ void Net_Drawer(void) { +#ifdef __CLIENT__ // Draw the Shadow Bias Editor HUD (if it is active). SBE_DrawHUD(); @@ -712,9 +736,10 @@ void Net_Drawer(void) // Draw the demo recording overlay. Net_DrawDemoOverlay(); -#ifdef _DEBUG +# ifdef _DEBUG Z_DebugDrawer(); -#endif +# endif +#endif // __CLIENT__ } /** @@ -1122,18 +1147,20 @@ D_CMD(MakeCamera) Smoother_Clear(clients[cp].smoother); Sv_InitPoolForClient(cp); +#ifdef __CLIENT__ R_SetupDefaultViewWindow(cp); + // Update the viewports. R_SetViewGrid(0, 0); +#endif return true; } D_CMD(SetConsole) { - int cp; - - cp = atoi(argv[1]); +#ifdef __CLIENT__ + int cp = atoi(argv[1]); if(ddPlayers[cp].shared.inGame) { consolePlayer = displayPlayer = cp; @@ -1141,7 +1168,7 @@ D_CMD(SetConsole) // Update the viewports. R_SetViewGrid(0, 0); - +#endif return true; } @@ -1426,12 +1453,14 @@ D_CMD(Net) else return false; } +#ifdef __CLIENT__ else if(!stricmp(argv[1], "setup")) { // Start network setup. DD_NetSetup(!stricmp(argv[2], "server")); CmdReturnValue = true; } +#endif } if(argc == 4) diff --git a/doomsday/engine/src/network/sys_network.c b/doomsday/engine/src/network/sys_network.c index 8839497919..b23580d4f7 100644 --- a/doomsday/engine/src/network/sys_network.c +++ b/doomsday/engine/src/network/sys_network.c @@ -485,6 +485,8 @@ boolean N_LookForHosts(const char *address, int port, expectedresponder_t respon return true; } +#ifdef __CLIENT__ + /** * Handles the server's response to a client's join request. */ @@ -510,8 +512,8 @@ void N_ClientHandleResponseToJoin(int nodeId, const byte* data, int size) // Clients are allowed to send packets to the server. svNode->hasJoined = true; - allowSending = true; handshakeReceived = false; + allowSending = true; netGame = true; // Allow sending/receiving of packets. isServer = false; isClient = true; @@ -599,6 +601,8 @@ boolean N_Disconnect(void) return true; } +#endif // __CLIENT__ + boolean N_ServerOpen(void) { if(!isDedicated) @@ -607,7 +611,9 @@ boolean N_ServerOpen(void) return false; } +#ifdef __CLIENT__ Demo_StopPlayback(); +#endif // Let's make sure the correct service provider is initialized // in server mode. diff --git a/doomsday/engine/src/r_util.c b/doomsday/engine/src/r_util.c index 61f54afed8..ee9e4628b0 100644 --- a/doomsday/engine/src/r_util.c +++ b/doomsday/engine/src/r_util.c @@ -33,6 +33,8 @@ #include "de_play.h" #include "de_misc.h" +#include "render/r_main.h" + int Partition_PointXYOnSide(const partition_t* par, coord_t x, coord_t y) { coord_t delta[2]; diff --git a/doomsday/engine/src/render/r_main.c b/doomsday/engine/src/render/r_main.c index f0275846a0..00a1943231 100644 --- a/doomsday/engine/src/render/r_main.c +++ b/doomsday/engine/src/render/r_main.c @@ -112,6 +112,7 @@ static viewport_t viewportOfLocalPlayer[DDMAXPLAYERS], *currentViewport; */ void R_Register(void) { +#ifdef __CLIENT__ C_VAR_INT("con-show-during-setup", &loadInStartupMode, 0, 0, 1); C_VAR_INT("rend-camera-smooth", &rendCameraSmooth, CVF_HIDE, 0, 1); @@ -123,6 +124,7 @@ void R_Register(void) C_VAR_INT("rend-info-tris", &rendInfoTris, 0, 0, 1); C_CMD("viewgrid", "ii", ViewGrid); +#endif Materials_Register(); } @@ -573,7 +575,9 @@ static void R_UpdateMap(void) skyDef = Def_GetSky(mapInfo->skyID); if(!skyDef) skyDef = &mapInfo->sky; } +#ifdef __CLIENT__ Sky_Configure(skyDef); +#endif if(mapInfo) { @@ -626,12 +630,14 @@ void R_Update(void) R_UpdateMap(); +#ifdef __CLIENT__ // The rendering lists have persistent data that has changed during // the re-initialization. RL_DeleteLists(); // Update the secondary title and the game status. Rend_ConsoleUpdateTitle(); +#endif #if _DEBUG Z_CheckHeap(); @@ -647,9 +653,11 @@ void R_Shutdown(void) R_ShutdownSprites(); Models_Shutdown(); R_ShutdownSvgs(); +#ifdef __CLIENT__ R_ShutdownViewWindow(); Fonts_Shutdown(); Rend_Shutdown(); +#endif } void R_Ticker(timespan_t time) @@ -844,6 +852,8 @@ END_PROF( PROF_MOBJ_INIT_ADD ); */ void R_BeginWorldFrame(void) { +#ifdef __CLIENT__ + R_ClearSectorFlags(); R_InterpolateTrackedPlanes(resetNextViewer); @@ -877,6 +887,8 @@ void R_BeginWorldFrame(void) // Link objs to all contacted surfaces. R_LinkObjs(); } + +#endif } /** @@ -1068,6 +1080,8 @@ void R_SetupFrame(player_t* player) #undef MINEXTRALIGHTFRAMES } +#ifdef __CLIENT__ + /** * Draw the border around the view window. */ @@ -1350,6 +1364,8 @@ void R_RenderViewPorts(void) R_UseViewPort(NULL); } +#endif // __CLIENT__ + static int findSpriteOwner(thinker_t* th, void* context) { mobj_t* mo = (mobj_t*) th; @@ -1393,6 +1409,8 @@ static void cacheSpritesForState(int stateIndex, materialvariantspecification_t } } +#ifdef __CLIENT__ + /// @note Part of the Doomsday public API. void Rend_CacheForMobjType(int num) { @@ -1495,6 +1513,8 @@ void Rend_CacheForMap() } } +#endif // __CLIENT__ + D_CMD(ViewGrid) { if(argc != 3) diff --git a/doomsday/engine/src/render/r_things.cpp b/doomsday/engine/src/render/r_things.cpp index 5f38c5d59e..0a7f4643d7 100644 --- a/doomsday/engine/src/render/r_things.cpp +++ b/doomsday/engine/src/render/r_things.cpp @@ -36,6 +36,8 @@ #include "de_misc.h" #include "de_resource.h" +#include "gl/sys_opengl.h" // TODO: get rid of this + #include "def_main.h" #include "m_stack.h" @@ -476,6 +478,7 @@ boolean R_GetSpriteInfo(int sprite, int frame, spriteinfo_t *info) return true; } +#ifdef __CLIENT__ static modeldef_t *currentModelDefForMobj(mobj_t *mo) { // If models are being used, use the model's radius. @@ -570,14 +573,15 @@ float R_ShadowStrength(mobj_t *mo) /// @note This equation is the same as that used for fakeradio. return (0.6f - ambientLightLevel * 0.4f) * strength; } +#endif // __CLIENT__ float R_Alpha(mobj_t *mo) { DENG_ASSERT(mo); float alpha = (mo->ddFlags & DDMF_BRIGHTSHADOW)? .80f : - (mo->ddFlags & DDMF_SHADOW)? .33f : - (mo->ddFlags & DDMF_ALTSHADOW)? .66f : 1; + (mo->ddFlags & DDMF_SHADOW )? .33f : + (mo->ddFlags & DDMF_ALTSHADOW )? .66f : 1; /** * The three highest bits of the selector are used for alpha. * 0 = opaque (alpha -1) @@ -621,6 +625,8 @@ vissprite_t *R_NewVisSprite() return spr; } +#ifdef __CLIENT__ + void R_ProjectPlayerSprites() { int i; @@ -733,6 +739,8 @@ void R_ProjectPlayerSprites() } } +#endif // __CLIENT__ + float R_MovementYaw(float const mom[]) { // Multiply by 100 to get some artificial accuracy in bamsAtan2. @@ -786,6 +794,8 @@ int RIT_VisMobjZ(Sector *sector, void *parameters) return false; // Continue iteration. } +#ifdef __CLIENT__ + static void setupSpriteParamsForVisSprite(rendspriteparams_t *params, float x, float y, float z, float distance, float visOffX, float visOffY, float visOffZ, float /*secFloor*/, float /*secCeil*/, float /*floorClip*/, float /*top*/, @@ -1354,6 +1364,8 @@ void R_ProjectSprite(mobj_t *mo) } } +#endif // __CLIENT__ + typedef struct { BspLeaf* bspLeaf; } addspriteparams_t; diff --git a/doomsday/engine/src/render/rend_main.c b/doomsday/engine/src/render/rend_main.c index 051df569ee..cb41af3de3 100644 --- a/doomsday/engine/src/render/rend_main.c +++ b/doomsday/engine/src/render/rend_main.c @@ -139,6 +139,8 @@ static boolean firstBspLeaf; // No range checking for the first one. void Rend_Register(void) { +#ifdef __CLIENT + C_VAR_FLOAT("rend-camera-fov", &fieldOfView, 0, 1, 179); C_VAR_FLOAT("rend-glow", &glowFactor, 0, 0, 2); @@ -195,6 +197,8 @@ void Rend_Register(void) Rend_SpriteRegister(); Rend_ConsoleRegister(); Vignette_Register(); + +#endif } /** @@ -205,6 +209,8 @@ coord_t Rend_PointDist3D(coord_t const point[3]) return M_ApproxDistance3(vOrigin[VX] - point[VX], vOrigin[VZ] - point[VY], 1.2 * (vOrigin[VY] - point[VZ])); } +#ifdef __CLIENT__ + void Rend_Init(void) { C_Init(); @@ -463,13 +469,6 @@ static void selectSurfaceColors(const float** topColor, } } -int RIT_FirstDynlightIterator(const dynlight_t* dyn, void* paramaters) -{ - const dynlight_t** ptr = (const dynlight_t**)paramaters; - *ptr = dyn; - return 1; // Stop iteration. -} - static __inline const materialvariantspecification_t* mapSurfaceMaterialSpec(int wrapS, int wrapT) { @@ -478,6 +477,15 @@ mapSurfaceMaterialSpec(int wrapS, int wrapT) true, true, false, false); } +#ifdef __CLIENT__ + +int RIT_FirstDynlightIterator(const dynlight_t* dyn, void* paramaters) +{ + const dynlight_t** ptr = (const dynlight_t**)paramaters; + *ptr = dyn; + return 1; // Stop iteration. +} + /** * This doesn't create a rendering primitive but a vissprite! The vissprite * represents the masked poly and will be rendered during the rendering @@ -586,6 +594,8 @@ void Rend_AddMaskedPoly(const rvertex_t* rvertices, const ColorRawf* rcolors, } } +#endif // __CLIENT__ + static void quadTexCoords(rtexcoord_t* tc, const rvertex_t* rverts, coord_t wallLength, coord_t const topLeft[3]) { @@ -730,6 +740,8 @@ static float getSnapshots(const materialsnapshot_t** msA, return interPos; } +#ifdef __CLIENT__ + typedef struct { boolean isWall; int flags; /// @see rendpolyFlags @@ -2092,6 +2104,8 @@ static void occludeFrontFacingSegsInBspLeaf(const BspLeaf* bspLeaf) } } +#endif // __CLIENT__ + static coord_t skyFixFloorZ(const Plane* frontFloor, const Plane* backFloor) { DENG_UNUSED(backFloor); @@ -4039,3 +4053,5 @@ static void Rend_RenderBoundingBoxes(void) glDisable(GL_TEXTURE_2D); glEnable(GL_DEPTH_TEST); } + +#endif // __CLIENT__ diff --git a/doomsday/engine/src/render/rend_model.cpp b/doomsday/engine/src/render/rend_model.cpp index 0fb94b6f5c..cf0275646f 100644 --- a/doomsday/engine/src/render/rend_model.cpp +++ b/doomsday/engine/src/render/rend_model.cpp @@ -91,7 +91,7 @@ static bool announcedVertexBufferMaxBreach; ///< @c true if an attempt has been #endif void Rend_ModelRegister() -{ +{ C_VAR_BYTE ("rend-model", &useModels, 0, 0, 1); C_VAR_INT ("rend-model-lights", &modelLight, 0, 0, 10); C_VAR_INT ("rend-model-inter", &frameInter, 0, 0, 1); diff --git a/doomsday/engine/src/resource/material.cpp b/doomsday/engine/src/resource/material.cpp index b9285a5ada..c979d91500 100644 --- a/doomsday/engine/src/resource/material.cpp +++ b/doomsday/engine/src/resource/material.cpp @@ -26,6 +26,7 @@ #include "m_misc.h" #include "audio/s_environ.h" +#include "gl/sys_opengl.h" // TODO: get rid of this #include diff --git a/doomsday/engine/src/resource/materials.cpp b/doomsday/engine/src/resource/materials.cpp index c60ea3f6ae..1d02e22029 100644 --- a/doomsday/engine/src/resource/materials.cpp +++ b/doomsday/engine/src/resource/materials.cpp @@ -32,6 +32,7 @@ #include "de_resource.h" #include "resource/materials.h" +#include "gl/sys_opengl.h" // TODO: get rid of this #include #include @@ -1011,6 +1012,10 @@ static void pushVariantCacheQueue(material_t* mat, materialvariantspecification_ void Materials_Precache2(material_t* mat, materialvariantspecification_t const* spec, boolean smooth, boolean cacheGroup) { +#ifdef __SERVER__ + return; +#endif + errorIfNotInited("Materials_Precache2"); if(!mat || ! spec) @@ -1019,8 +1024,10 @@ void Materials_Precache2(material_t* mat, materialvariantspecification_t const* return; } +#ifdef __CLIENT__ // Don't precache when playing demo. if(isDedicated || playback) return; +#endif // Already in the queue? for(VariantCacheQueueNode* node = variantCacheQueue; node; node = node->next) @@ -1050,8 +1057,11 @@ void Materials_Precache(material_t* mat, materialvariantspecification_t const* s void Materials_Ticker(timespan_t time) { +#ifdef __CLIENT__ // The animation will only progress when the game is not paused. - if(clientPaused || novideo) return; + if(clientPaused) return; +#endif + if(novideo) return; for(MaterialListNode* node = materials; node; node = node->next) { @@ -1138,11 +1148,15 @@ void Materials_InitSnapshot(materialsnapshot_t* ms) { DENG2_ASSERT(ms); +#ifdef __CLIENT__ for(int i = 0; i < NUM_MATERIAL_TEXTURE_UNITS; ++i) { Rtu_Init(&ms->units[i]); ms->textures[i] = NULL; } +#else + DENG_UNUSED(ms); +#endif ms->material = NULL; ms->size.width = ms->size.height = 0; @@ -1196,6 +1210,7 @@ materialsnapshot_t const* updateMaterialSnapshot(MaterialVariant* variant, } } +#ifdef __CLIENT__ // Do we need to prepare a DetailTexture? Texture* tex = Material_DetailTexture(mat); if(tex) @@ -1226,6 +1241,7 @@ materialsnapshot_t const* updateMaterialSnapshot(MaterialVariant* variant, texUnits[MTU_REFLECTION_MASK].tex = GL_PrepareTextureVariant(tex, texSpec); } } +#endif MaterialVariant_SetSnapshotPrepareFrame(variant, frameCount); @@ -1251,6 +1267,7 @@ materialsnapshot_t const* updateMaterialSnapshot(MaterialVariant* variant, MaterialVariant_Layer(variant, 0)->texOrigin[1], 1); } +#ifdef __CLIENT__ /** * If skymasked, we need only need to update the primary tex unit * (this is due to it being visible when skymask debug drawing is @@ -1302,6 +1319,7 @@ materialsnapshot_t const* updateMaterialSnapshot(MaterialVariant* variant, snapshot->shinyMinColor[CG] = minColor[CG]; snapshot->shinyMinColor[CB] = minColor[CB]; } +#endif return snapshot; } diff --git a/doomsday/engine/src/ui/canvas.cpp b/doomsday/engine/src/ui/canvas.cpp index 20c63b63b2..469ff3a9c7 100644 --- a/doomsday/engine/src/ui/canvas.cpp +++ b/doomsday/engine/src/ui/canvas.cpp @@ -168,8 +168,10 @@ Canvas::Canvas(QWidget* parent, QGLWidget* shared) : QGLWidget(parent, shared) LOG_DEBUG("swap interval: ") << format().swapInterval(); LOG_DEBUG("multisample: %b") << format().sampleBuffers(); +#ifdef __CLIENT__ // Update the capability flags. GL_state.features.multisample = format().sampleBuffers(); +#endif // We will be doing buffer swaps manually (for timing purposes). setAutoBufferSwap(false); @@ -282,7 +284,9 @@ void Canvas::forceImmediateRepaint() void Canvas::initializeGL() { +#ifdef __CLIENT__ Sys_GLConfigureDefaultState(); +#endif } void Canvas::resizeGL(int w, int h) diff --git a/doomsday/engine/src/ui/canvaswindow.cpp b/doomsday/engine/src/ui/canvaswindow.cpp index e72b60811a..0d3d1ad177 100644 --- a/doomsday/engine/src/ui/canvaswindow.cpp +++ b/doomsday/engine/src/ui/canvaswindow.cpp @@ -32,7 +32,9 @@ #include "de_platform.h" #include "con_main.h" -#include "gl/gl_main.h" +#ifdef __CLIENT__ +# include "gl/gl_main.h" +#endif #include "ui/canvaswindow.h" #include @@ -83,7 +85,9 @@ void CanvasWindow::initCanvasAfterRecreation(Canvas& canvas) // Set up the basic GL state for the new canvas. self->d->canvas->makeCurrent(); +#ifdef __CLIENT__ GL_Init2DState(); +#endif self->d->canvas->doneCurrent(); self->d->canvas->updateGL(); diff --git a/doomsday/engine/src/ui/dd_input.c b/doomsday/engine/src/ui/dd_input.c index 276a696ccb..6abe161893 100644 --- a/doomsday/engine/src/ui/dd_input.c +++ b/doomsday/engine/src/ui/dd_input.c @@ -103,7 +103,9 @@ static char defaultShiftTable[96] = // Contains characters 32 to 127. }; static repeater_t keyReps[MAX_DOWNKEYS]; +#ifdef __CLIENT__ static float oldPOV = IJOY_POV_CENTER; +#endif static char* eventStrings[MAXEVENTS]; static boolean uiMouseMode = false; // Can mouse data be modified? @@ -209,6 +211,8 @@ void I_InitVirtualInputDevices(void) strcpy(dev->name, "key"); I_DeviceAllocKeys(dev, 256); +#ifdef __CLIENT__ + // The mouse may not be active. dev = &inputDevices[IDEV_MOUSE]; strcpy(dev->niceName, "Mouse"); @@ -292,6 +296,8 @@ void I_InitVirtualInputDevices(void) // The joystick may not be active. if(Joystick_IsPresent()) dev->flags = ID_ACTIVE; + +#endif // __CLIENT__ } /** @@ -1359,6 +1365,8 @@ void I_SetUIMouseMode(boolean on) #endif } +#ifdef __CLIENT__ + /** * Checks the current mouse state (axis, buttons and wheel). * Generates events and mickeys and posts them. @@ -1542,7 +1550,8 @@ void DD_ReadJoystick(void) } } -#if _DEBUG +#ifdef _DEBUG + static void initDrawStateForVisual(const Point2Raw* origin) { FR_PushAttrib(); @@ -2217,7 +2226,8 @@ void Rend_AllInputDeviceStateVisuals(void) #undef NUMITEMS #undef SPACING } -#endif +#endif // _DEBUG +#endif // __CLIENT__ static void I_PrintAxisConfig(inputdev_t* device, inputdevaxis_t* axis) { diff --git a/doomsday/engine/src/ui/finaleinterpreter.c b/doomsday/engine/src/ui/finaleinterpreter.c index eb13158a09..28bb74a472 100644 --- a/doomsday/engine/src/ui/finaleinterpreter.c +++ b/doomsday/engine/src/ui/finaleinterpreter.c @@ -1293,18 +1293,22 @@ int FinaleInterpreter_Responder(finaleinterpreter_t* fi, const ddevent_t* ev) if(!IS_TOGGLE_DOWN(ev)) return false; +#ifdef __CLIENT__ if(isClient) { // Request skip from the server. Cl_RequestFinaleSkip(); return true; } - else +#endif +#ifdef __SERVER__ { // Tell clients to skip. Sv_Finale(fi->_id, FINF_SKIP, 0); return FinaleInterpreter_Skip(fi); } +#endif + return false; } DEFFC(Do) diff --git a/doomsday/engine/src/ui/sys_input.c b/doomsday/engine/src/ui/sys_input.c index 53bf05d2f6..6b6f2cb393 100644 --- a/doomsday/engine/src/ui/sys_input.c +++ b/doomsday/engine/src/ui/sys_input.c @@ -48,7 +48,9 @@ static int evHead, evTail; void I_Register(void) { +#ifdef __CLIENT__ Joystick_Register(); +#endif } static keyevent_t *newKeyEvent(void) @@ -143,6 +145,8 @@ boolean I_Init(void) if(initOk) return true; // Already initialized. +#ifdef __CLIENT__ + // Select drivers. iMouse = &qtMouse; #ifdef WIN32 @@ -153,6 +157,8 @@ boolean I_Init(void) Mouse_Init(); Joystick_Init(); +#endif // __CLIENT__ + initOk = true; return true; } @@ -162,15 +168,17 @@ void I_Shutdown(void) if(!initOk) return; // Not initialized. +#ifdef __CLIENT__ if(useMouse) iMouse->shutdown(); useMouse = false; - Joystick_Shutdown(); - initOk = false; - -#ifdef WIN32 + Joystick_Shutdown(); +# ifdef WIN32 DirectInput_Shutdown(); +# endif #endif + + initOk = false; } void Keyboard_Submit(int type, int ddKey, int native, const char* text) diff --git a/doomsday/engine/src/ui/ui2_main.cpp b/doomsday/engine/src/ui/ui2_main.cpp index c60b2689f5..74f2df13d2 100644 --- a/doomsday/engine/src/ui/ui2_main.cpp +++ b/doomsday/engine/src/ui/ui2_main.cpp @@ -316,8 +316,10 @@ void UI_Shutdown(void) void UI2_Ticker(timespan_t ticLength) { +#ifdef __CLIENT__ // Always tic. FR_Ticker(ticLength); +#endif if(!inited) return; diff --git a/doomsday/engine/src/ui/window.cpp b/doomsday/engine/src/ui/window.cpp index e94fc7748c..1201eb3444 100644 --- a/doomsday/engine/src/ui/window.cpp +++ b/doomsday/engine/src/ui/window.cpp @@ -79,7 +79,9 @@ #include "busymode.h" #include "dd_main.h" #include "con_main.h" -#include "gl/gl_main.h" +#ifdef __CLIENT__ +# include "gl/gl_main.h" +#endif #include "ui/ui_main.h" #include "filesys/fs_util.h" @@ -605,6 +607,7 @@ struct ddwindow_s DEBUG_Message(("Updating view geometry for fullscreen (%i x %i).\n", width(), height())); } +#ifdef __CLIENT__ // Update viewports. R_SetViewGrid(0, 0); if(BusyMode_Active() || UI_IsActive() || !DD_GameLoaded()) @@ -617,6 +620,7 @@ struct ddwindow_s { UI_UpdatePageLayout(); } +#endif } }; @@ -1360,6 +1364,8 @@ void Window_Draw(Window* win) { if(win->type == WT_CONSOLE) return; +#ifdef __CLIENT__ + assert(win); assert(win->widget); @@ -1387,6 +1393,8 @@ void Window_Draw(Window* win) // Request update at the earliest convenience. win->widget->canvas().update(); } + +#endif // __CLIENT__ } void Window_Show(Window *wnd, boolean show) @@ -1629,18 +1637,30 @@ void GL_AssertContextActive(void) void Window_GLActivate(Window* wnd) { +#ifdef __CLIENT__ + if(wnd->type == WT_CONSOLE) return; wnd->assertWindow(); wnd->widget->canvas().makeCurrent(); LIBDENG_ASSERT_GL_CONTEXT_ACTIVE(); + +#else + DENG_UNUSED(wnd); +#endif } void Window_GLDone(Window* wnd) { +#ifdef __CLIENT__ + if(wnd->type == WT_CONSOLE) return; wnd->assertWindow(); wnd->widget->canvas().doneCurrent(); + +#else + DENG_UNUSED(wnd); +#endif } QWidget* Window_Widget(Window* wnd) diff --git a/doomsday/engine/src/unix/dd_uinit.c b/doomsday/engine/src/unix/dd_uinit.c index fe0e417f95..09ae977e9f 100644 --- a/doomsday/engine/src/unix/dd_uinit.c +++ b/doomsday/engine/src/unix/dd_uinit.c @@ -75,10 +75,12 @@ application_t app; // CODE -------------------------------------------------------------------- +#ifdef __CLIENT__ static int initDGL(void) { return (int) Sys_GLPreInit(); } +#endif static void determineGlobalPaths(application_t* app) { @@ -181,10 +183,12 @@ boolean DD_Unix_Init(void) { Sys_MessageBox(MBT_ERROR, DOOMSDAY_NICENAME, "Error during early init.", 0); } +#ifdef __CLIENT__ else if(!initDGL()) { Sys_MessageBox(MBT_ERROR, DOOMSDAY_NICENAME, "Error initializing DGL.", 0); } +#endif else { // Everything okay so far. diff --git a/doomsday/server/include/server_dummies.h b/doomsday/server/include/server_dummies.h new file mode 100644 index 0000000000..40bbdb699c --- /dev/null +++ b/doomsday/server/include/server_dummies.h @@ -0,0 +1,62 @@ +/** @file server_dummies.h Dummy functions for the server. + * @ingroup server + * + * @authors Copyright © 2012 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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, see: + * http://www.gnu.org/licenses + */ + +#ifndef SERVER_DUMMIES_H +#define SERVER_DUMMIES_H + +#include +#include "map/sector.h" + +#ifndef __SERVER__ +# error Attempted to include server's header in a non-server build +#endif + +DENG_EXTERN_C void Con_TransitionRegister(); +DENG_EXTERN_C void Con_TransitionTicker(timespan_t t); + +DENG_EXTERN_C void GL_Shutdown(); +DENG_EXTERN_C void GL_EarlyInitTextureManager(); +DENG_EXTERN_C void GL_PruneTextureVariantSpecifications(); +DENG_EXTERN_C void GL_SetFilter(int f); + +DENG_EXTERN_C void R_InitViewWindow(void); + +DENG_EXTERN_C void FR_Init(void); + +DENG_EXTERN_C void Rend_DecorInit(); +DENG_EXTERN_C void Rend_ConsoleInit(); +DENG_EXTERN_C void Rend_ConsoleResize(int force); +DENG_EXTERN_C void Rend_ConsoleOpen(int yes); +DENG_EXTERN_C void Rend_ConsoleToggleFullscreen(); +DENG_EXTERN_C void Rend_ConsoleMove(int y); +DENG_EXTERN_C void Rend_ConsoleCursorResetBlink(); + +DENG_EXTERN_C void Models_Init(); +DENG_EXTERN_C void Models_Shutdown(); + +DENG_EXTERN_C void LG_SectorChanged(Sector* sector); + +DENG_EXTERN_C void Cl_InitPlayers(void); + +DENG_EXTERN_C void UI_Init(); +DENG_EXTERN_C void UI_Ticker(timespan_t t); +DENG_EXTERN_C void UI2_Ticker(timespan_t t); +DENG_EXTERN_C void UI_Shutdown(); + +#endif // SERVER_DUMMIES_H diff --git a/doomsday/server/server.pro b/doomsday/server/server.pro index caea719117..a9e489e578 100644 --- a/doomsday/server/server.pro +++ b/doomsday/server/server.pro @@ -107,6 +107,7 @@ DENG_HEADERS += \ # Private headers. DENG_HEADERS += \ + include/server_dummies.h \ $$SRC/include/audio/s_environ.h \ $$SRC/include/audio/s_logic.h \ $$SRC/include/audio/s_main.h \ @@ -147,7 +148,6 @@ DENG_HEADERS += \ $$SRC/include/def_data.h \ $$SRC/include/def_main.h \ $$SRC/include/dualstring.h \ - $$SRC/include/edit_bias.h \ $$SRC/include/edit_bsp.h \ $$SRC/include/edit_map.h \ $$SRC/include/filesys/file.h \ @@ -161,6 +161,7 @@ DENG_HEADERS += \ $$SRC/include/filesys/sys_direc.h \ $$SRC/include/filesys/sys_findfile.h \ $$SRC/include/game.h \ + $$SRC/include/gl/gl_texmanager.h \ $$SRC/include/gridmap.h \ $$SRC/include/kdtree.h \ $$SRC/include/library.h \ @@ -171,7 +172,6 @@ DENG_HEADERS += \ $$SRC/include/m_profiler.h \ $$SRC/include/m_stack.h \ $$SRC/include/map/blockmap.h \ - $$SRC/include/map/blockmapvisual.h \ $$SRC/include/map/bsp/bsptreenode.h \ $$SRC/include/map/bsp/hedgeinfo.h \ $$SRC/include/map/bsp/hedgeintercept.h \ @@ -214,28 +214,26 @@ DENG_HEADERS += \ $$SRC/include/network/masterserver.h \ $$SRC/include/network/monitor.h \ $$SRC/include/network/net_buf.h \ - $$SRC/include/network/net_demo.h \ $$SRC/include/network/net_event.h \ $$SRC/include/network/net_main.h \ $$SRC/include/network/net_msg.h \ $$SRC/include/network/protocol.h \ $$SRC/include/network/sys_network.h \ - $$SRC/include/network/ui_mpi.h \ $$SRC/include/r_util.h \ + $$SRC/include/render/r_main.h \ + $$SRC/include/render/r_things.h \ + $$SRC/include/render/rend_main.h \ $$SRC/include/resource/animgroups.h \ - $$SRC/include/resource/bitmapfont.h \ $$SRC/include/resource/colorpalette.h \ $$SRC/include/resource/colorpalettes.h \ $$SRC/include/resource/compositetexture.h \ $$SRC/include/resource/font.h \ - $$SRC/include/resource/fonts.h \ $$SRC/include/resource/hq2x.h \ $$SRC/include/resource/image.h \ $$SRC/include/resource/lumpcache.h \ $$SRC/include/resource/material.h \ $$SRC/include/resource/materials.h \ $$SRC/include/resource/materialvariant.h \ - $$SRC/include/resource/models.h \ $$SRC/include/resource/patch.h \ $$SRC/include/resource/patchname.h \ $$SRC/include/resource/pcx.h \ @@ -272,13 +270,9 @@ DENG_HEADERS += \ $$SRC/include/ui/displaymode.h \ $$SRC/include/ui/displaymode_native.h \ $$SRC/include/ui/fi_main.h \ - $$SRC/include/ui/finaleinterpreter.h \ $$SRC/include/ui/keycode.h \ $$SRC/include/ui/p_control.h \ $$SRC/include/ui/sys_input.h \ - $$SRC/include/ui/ui2_main.h \ - $$SRC/include/ui/ui_main.h \ - $$SRC/include/ui/ui_panel.h \ $$SRC/include/ui/window.h \ $$SRC/include/updater.h \ $$SRC/include/uri.hh \ @@ -291,6 +285,7 @@ DENG_HEADERS += \ $$SRC/src/updater/versioninfo.h INCLUDEPATH += \ + include \ $$DENG_INCLUDE_DIR \ $$DENG_API_DIR @@ -340,6 +335,7 @@ SOURCES += $$SRC/src/ui/displaymode_dummy.c # Platform-independent sources. SOURCES += \ + src/server_dummies.c \ $$SRC/src/audio/s_environ.cpp \ $$SRC/src/audio/s_logic.c \ $$SRC/src/audio/s_main.c \ @@ -365,7 +361,6 @@ SOURCES += \ $$SRC/src/def_main.cpp \ $$SRC/src/def_read.cpp \ $$SRC/src/dualstring.cpp \ - $$SRC/src/edit_bias.c \ $$SRC/src/edit_bsp.cpp \ $$SRC/src/edit_map.cpp \ $$SRC/src/filesys/file.cpp \ @@ -379,6 +374,7 @@ SOURCES += \ $$SRC/src/filesys/searchpath.cpp \ $$SRC/src/filesys/sys_direc.c \ $$SRC/src/game.cpp \ + $$SRC/src/gl/gl_texmanager.cpp \ $$SRC/src/gridmap.c \ $$SRC/src/kdtree.c \ $$SRC/src/library.cpp \ @@ -388,7 +384,6 @@ SOURCES += \ $$SRC/src/m_nodepile.c \ $$SRC/src/m_stack.c \ $$SRC/src/map/blockmap.c \ - $$SRC/src/map/blockmapvisual.c \ $$SRC/src/map/bsp/hplane.cpp \ $$SRC/src/map/bsp/partitioner.cpp \ $$SRC/src/map/bsp/superblockmap.cpp \ @@ -425,28 +420,26 @@ SOURCES += \ $$SRC/src/network/masterserver.cpp \ $$SRC/src/network/monitor.c \ $$SRC/src/network/net_buf.c \ - $$SRC/src/network/net_demo.c \ $$SRC/src/network/net_event.c \ $$SRC/src/network/net_main.c \ $$SRC/src/network/net_msg.c \ $$SRC/src/network/net_ping.c \ $$SRC/src/network/protocol.c \ $$SRC/src/network/sys_network.c \ - $$SRC/src/network/ui_mpi.c \ $$SRC/src/r_util.c \ + $$SRC/src/render/r_main.c \ + $$SRC/src/render/r_things.cpp \ + $$SRC/src/render/rend_main.c \ $$SRC/src/resource/animgroups.cpp \ - $$SRC/src/resource/bitmapfont.cpp \ $$SRC/src/resource/colorpalette.c \ $$SRC/src/resource/colorpalettes.cpp \ $$SRC/src/resource/compositetexture.cpp \ - $$SRC/src/resource/fonts.cpp \ $$SRC/src/resource/hq2x.c \ $$SRC/src/resource/image.cpp \ $$SRC/src/resource/material.cpp \ $$SRC/src/resource/materialarchive.c \ $$SRC/src/resource/materials.cpp \ $$SRC/src/resource/materialvariant.cpp \ - $$SRC/src/resource/models.cpp \ $$SRC/src/resource/patch.cpp \ $$SRC/src/resource/patchname.cpp \ $$SRC/src/resource/pcx.c \ @@ -473,16 +466,14 @@ SOURCES += \ $$SRC/src/ui/b_device.c \ $$SRC/src/ui/b_main.c \ $$SRC/src/ui/b_util.c \ + $$SRC/src/ui/canvas.cpp \ + $$SRC/src/ui/canvaswindow.cpp \ $$SRC/src/ui/dd_input.c \ $$SRC/src/ui/displaymode.cpp \ $$SRC/src/ui/fi_main.c \ - $$SRC/src/ui/finaleinterpreter.c \ $$SRC/src/ui/keycode.cpp \ $$SRC/src/ui/p_control.c \ $$SRC/src/ui/sys_input.c \ - $$SRC/src/ui/ui2_main.cpp \ - $$SRC/src/ui/ui_main.c \ - $$SRC/src/ui/ui_panel.c \ $$SRC/src/ui/window.cpp \ $$SRC/src/updater/downloaddialog.cpp \ $$SRC/src/updater/processcheckdialog.cpp \ diff --git a/doomsday/server/src/server_dummies.c b/doomsday/server/src/server_dummies.c new file mode 100644 index 0000000000..a6296b0750 --- /dev/null +++ b/doomsday/server/src/server_dummies.c @@ -0,0 +1,105 @@ +/** @file server_dummies.c Dummy functions for the server. + * @ingroup server + * + * @authors Copyright © 2012 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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, see: + * http://www.gnu.org/licenses + */ + +#include "server_dummies.h" + +void Con_TransitionRegister() +{} + +void Con_TransitionTicker(timespan_t t) +{ + DENG_UNUSED(t); +} + +void GL_Shutdown() +{} + +void GL_EarlyInitTextureManager() +{} + +void GL_PruneTextureVariantSpecifications() +{} + +void GL_SetFilter(int f) +{ + DENG_UNUSED(f); +} + +void FR_Init(void) +{} + +void R_InitViewWindow(void) +{} + +void Rend_DecorInit() +{} + +void Rend_ConsoleInit() +{} + +void Rend_ConsoleOpen(int yes) +{ + DENG_UNUSED(yes); +} + +void Rend_ConsoleMove(int y) +{ + DENG_UNUSED(y); +} + +void Rend_ConsoleResize(int force) +{ + DENG_UNUSED(force); +} + +void Rend_ConsoleToggleFullscreen() +{} + +void Rend_ConsoleCursorResetBlink() +{} + +void Models_Init() +{} + +void Models_Shutdown() +{} + +void LG_SectorChanged(Sector* sector) +{ + DENG_UNUSED(sector); +} + +void Cl_InitPlayers(void) +{} + +void UI_Ticker(timespan_t t) +{ + DENG_UNUSED(t); +} + +void UI2_Ticker(timespan_t t) +{ + DENG_UNUSED(t); +} + +void UI_Init() +{} + +void UI_Shutdown() +{}