From bbc83c30ca5d15e412ff089371e0d53c8fc06178 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 3 Oct 2001 19:52:03 +0000 Subject: [PATCH] hey, it segs, but who cares? so does nq-glx -dedicated :P --- configure.ac | 2 +- nq/source/Makefile.am | 31 +++-- nq/source/sv_ded.c | 261 +++++++++++++++++++++++++++++++++++------- nq/source/sv_model.c | 74 ++++++++++++ nq/source/sv_user.c | 1 - nq/source/sys_unixd.c | 9 +- qw/source/Makefile.am | 6 +- 7 files changed, 326 insertions(+), 58 deletions(-) create mode 100644 nq/source/sv_model.c diff --git a/configure.ac b/configure.ac index c6feb46c9..98a692e2c 100644 --- a/configure.ac +++ b/configure.ac @@ -1295,7 +1295,7 @@ AC_ARG_WITH(servers, servers=all ) if test "$servers" = "all"; then - ENABLE_NQ_SERVER=no # doesn't work yet + ENABLE_NQ_SERVER=yes ENABLE_QW_MASTER=yes ENABLE_QW_SERVER=yes else diff --git a/nq/source/Makefile.am b/nq/source/Makefile.am index 6de9b5e4f..1deb0f693 100644 --- a/nq/source/Makefile.am +++ b/nq/source/Makefile.am @@ -50,7 +50,7 @@ libasm_la_SOURCES= $(asm_src) noinst_LTLIBRARIES= libqfnet.la $(asm) -common_sources= game.c host_skin.c skin.c world.c com.c +common_sources= game.c world.c com.c common_ldflags= -export-dynamic @@ -63,19 +63,30 @@ EXTRA_libqfnet_la_SOURCES= \ net_wipx.c client_LIBFILES= \ + $(top_builddir)/libs/video/targets/libQFjs.la \ $(top_builddir)/libs/audio/libQFcd.la \ - $(top_builddir)/libs/audio/libQFsound.la \ - $(top_builddir)/libs/util/libQFutil.la \ + $(top_builddir)/libs/audio/libQFsound.la + +server_LIBFILES= \ + $(top_builddir)/libs/models/libQFmodels.la \ + $(top_builddir)/libs/console/libQFconsole.la + +common_LIBFILES= \ + $(asm) \ + libqfnet.la \ $(top_builddir)/libs/gamecode/engine/libQFgamecode.la \ $(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \ $(top_builddir)/libs/gib/libQFgib.la \ - $(top_builddir)/libs/video/targets/libQFjs.la + $(top_builddir)/libs/util/libQFutil.la -client_LIBS= $(client_LIBFILES) libasm.la libqfnet.la $(NET_LIBS) -client_LIB_DEPS=$(client_LIBFILES) libasm.la libqfnet.la +client_LIBS= $(client_LIBFILES) $(common_LIBFILES) $(NET_LIBS) +client_LIB_DEPS=$(client_LIBFILES) $(common_LIBFILES) + +server_LIBS= $(server_LIBFILES) $(common_LIBFILES) $(NET_LIBS) +server_LIB_DEPS=$(server_LIBFILES) $(common_LIBFILES) client_sources= cl_cam.c cl_cmd.c cl_demo.c cl_input.c cl_main.c cl_screen.c \ - cl_parse.c cl_tent.c cl_view.c \ + cl_parse.c cl_tent.c cl_view.c host_skin.c skin.c \ console.c locs.c sbar.c server_sources= host.c host_cmd.c pr_cmds.c sv_cvar.c sv_main.c \ @@ -199,11 +210,11 @@ nq_wgl_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \ $(client_LIB_DEPS) # Dedicated Server -ded_sources= sys_unixd.c sv_ded.c +ded_sources= sys_unixd.c sv_ded.c sv_model.c nq_server_SOURCES= $(common_sources) $(server_sources) $(ded_sources) -nq_server_LDADD= libqfnet.la libasm.la -nq_server_DEPENDENCIES= libqfnet.la libasm.la +nq_server_LDADD= $(server_LIBS) +nq_server_DEPENDENCIES= $(server_LIB_DEPSS) # Stuff that doesn't get linked into an executable NEEDS to be mentioned here, # or it won't be distributed with 'make dist' diff --git a/nq/source/sv_ded.c b/nq/source/sv_ded.c index 6bbfd88c2..b6c0a37f9 100644 --- a/nq/source/sv_ded.c +++ b/nq/source/sv_ded.c @@ -35,70 +35,251 @@ static const char rcsid[] = #include #include "QF/cvar.h" -#include "QF/host.h" #include "QF/keys.h" +#include "QF/sys.h" #include "client.h" +#include "host.h" -int m_return_state; -qboolean m_return_onerror; -char m_return_reason[32]; -enum { m_none, m_main, m_singleplayer, m_load, m_save, m_multiplayer, m_setup, - m_net, m_options, m_video, m_keys, m_help, m_quit, m_serialconfig, - m_modemconfig, m_lanconfig, m_gameoptions, m_search, m_slist -} m_state; - -keydest_t key_dest; -client_static_t cls; client_state_t cl; -vec3_t vright, vup, vleft, vpn; +client_static_t cls; + +keydest_t key_dest = key_game; + float scr_centertime_off; +cvar_t *cl_name; +cvar_t *cl_writecfg; +cvar_t *chase_active; + +int fps_count; + +qboolean scr_disabled_for_loading; + +byte *vid_colormap; + +vec3_t vpn, vright, vup; + +qboolean r_active; +qboolean r_force_fullscreen; +double r_frametime; +qboolean r_inhibit_viewmodel; +vec3_t r_origin; +qboolean r_paused; +entity_t *r_view_model; void -Con_Printf (char *fmt, ...) -{ - va_list args; - - va_start (args, fmt); - vprintf (fmt, args); - va_end (args); -} - -void -Con_DPrintf (char *fmt, ...) -{ - va_list args; - - if (!developer->int_val) - return; - - va_start (args, fmt); - vprintf (fmt, args); - va_end (args); -} - -void -SCR_UpdateScreen (double realtime) +CL_UpdateScreen (double realtime) { } void -SCR_BeginLoadingPlaque (void) +Cmd_ForwardToServer (void) { } void -SCR_EndLoadingPlaque (void) +CDAudio_Init (void) { } void -Draw_BeginDisc (void) +CDAudio_Shutdown (void) { } void -Draw_EndDisc (void) +CDAudio_Update (void) +{ +} + +void +CL_Disconnect (void) +{ +} + +void +CL_Disconnect_f (void) +{ +} + +void +CL_EstablishConnection (const char *host) +{ +} + +void +CL_Init (void) +{ +} + +void +CL_InitCvars (void) +{ +} + +void +CL_NextDemo (void) +{ +} + +int +CL_ReadFromServer (void) +{ + return 0; +} + +void +CL_SendCmd (void) +{ +} + +void +CL_SetState (cactive_t state) +{ +} + +void +CL_StopPlayback (void) +{ +} + +void +Chase_Init_Cvars (void) +{ +} + +void +D_FlushCaches (void) +{ +} + +void +Draw_Init (void) +{ +} + +void +Host_Skin_Init (void) +{ +} + +void +Host_Skin_Init_Cvars (void) +{ +} + +void +IN_Commands (void) +{ +} + +void +IN_Init (void) +{ +} + +void +IN_Init_Cvars (void) +{ +} + +void +IN_SendKeyEvents (void) +{ +} + +void +IN_Shutdown (void) +{ +} + +void +Key_Init (void) +{ +} + +void +Key_Init_Cvars (void) +{ +} + +void +Key_WriteBindings (VFile *f) +{ +} + +void +R_DecayLights (double frametime) +{ +} + +void +R_Init (void) +{ +} + +void +R_Init_Cvars (void) +{ +} + +void +R_Particles_Init_Cvars (void) +{ +} + +void +SCR_Init (void) +{ +} + +void +S_Init (void) +{ +} + +void +S_Init_Cvars (void) +{ +} + +void +S_Shutdown (void) +{ +} + +void +S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up) +{ +} + +void +Sbar_Init (void) +{ +} + +void +VID_Init (unsigned char *palette) +{ +} + +void +VID_Init_Cvars (void) +{ +} + +void +VID_Shutdown (void) +{ +} + +void +V_Init (void) +{ +} + +void +V_Init_Cvars (void) { } diff --git a/nq/source/sv_model.c b/nq/source/sv_model.c new file mode 100644 index 000000000..2f62c1d6c --- /dev/null +++ b/nq/source/sv_model.c @@ -0,0 +1,74 @@ +/* + sv_model.c + + (description) + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ +static const char rcsid[] = + "$Id$"; + + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "QF/cvar.h" +#include "QF/model.h" + +const int mod_lightmap_bytes = 1; +cvar_t *gl_sky_divide; // not used but needed for linking + +void Mod_LoadBrushModel (model_t *mod, void *buffer); + + +void +Mod_LoadLighting (lump_t *l) +{ +} + +void +Mod_LoadAliasModel (model_t *mod, void *buf) +{ + Mod_LoadBrushModel (mod, buf); +} + +void +Mod_LoadSpriteModel (model_t *mod, void *buf) +{ + Mod_LoadBrushModel (mod, buf); +} + +void +R_InitSky (struct texture_s *mt) +{ +} + +void +Mod_ProcessTexture (miptex_t *mx, texture_t *tx) +{ +} + +void +GL_SubdivideSurface (msurface_t *fa) +{ +} diff --git a/nq/source/sv_user.c b/nq/source/sv_user.c index b65096c9b..c5df67db1 100644 --- a/nq/source/sv_user.c +++ b/nq/source/sv_user.c @@ -1,4 +1,3 @@ - /* sv_user.c diff --git a/nq/source/sys_unixd.c b/nq/source/sys_unixd.c index 5a0ede711..e30af35a9 100644 --- a/nq/source/sys_unixd.c +++ b/nq/source/sys_unixd.c @@ -57,6 +57,7 @@ static const char rcsid[] = #include #include +#include "QF/cvar.h" #include "QF/qargs.h" #include "QF/qtypes.h" #include "QF/sys.h" @@ -125,7 +126,7 @@ Sys_FileRead (int handle, void *dest, int count) } void -Sys_DebugLog (char *file, char *fmt, ...) +Sys_DebugLog (const char *file, const char *fmt, ...) { va_list argptr; static char data[1024]; @@ -155,7 +156,7 @@ Sys_Init (void) #endif } -char * +const char * Sys_ConsoleInput (void) { static char text[256]; @@ -195,11 +196,11 @@ Sys_LowFPPrecision (void) #endif int -main (int argc, char *argv[]) +main (int argc, const char **argv) { double time, oldtime; quakeparms_t parms; - char *newargv[256]; + const char *newargv[256]; int j; signal (SIGFPE, SIG_IGN); diff --git a/qw/source/Makefile.am b/qw/source/Makefile.am index 2e4898d8c..a42e86d00 100644 --- a/qw/source/Makefile.am +++ b/qw/source/Makefile.am @@ -81,7 +81,8 @@ server_sources= crudefile.c sv_ccmds.c sv_cvar.c sv_ents.c \ sv_nchan.c sv_phys.c sv_pr_cmds.c sv_progs.c sv_send.c \ sv_user.c world.c $(syssv_SRC) -qf_server_LIBS= $(top_builddir)/libs/models/libQFmodels.la \ +qf_server_LIBS= \ + $(top_builddir)/libs/models/libQFmodels.la \ $(top_builddir)/libs/gamecode/engine/libQFgamecode.la \ $(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \ $(top_builddir)/libs/console/libQFconsole.la \ @@ -96,7 +97,8 @@ qw_master_SOURCES= master.c qw_master_LDADD= $(NET_LIBS) qw_master_LDFLAGS= $(common_ldflags) -qf_client_LIBS= $(top_builddir)/libs/video/targets/libQFjs.la \ +qf_client_LIBS= \ + $(top_builddir)/libs/video/targets/libQFjs.la \ $(top_builddir)/libs/gamecode/engine/libQFgamecode.la \ $(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \ $(top_builddir)/libs/audio/libQFcd.la \