diff --git a/nq/source/Makefile.am b/nq/source/Makefile.am index 83052d258..0f206074b 100644 --- a/nq/source/Makefile.am +++ b/nq/source/Makefile.am @@ -52,13 +52,6 @@ common_SOURCES= game.c host_skin.c skin.c world.c com.c common_ldflags= -export-dynamic -# ... System type -if SYSTYPE_WIN32 -qfsys_SRC= sys_win.c -else -qfsys_SRC= sys_unix.c -endif - # ... Networking libqfnet_la_SOURCES= net_bsd.c net_dgrm.c net_loop.c \ net_main.c net_udp.c net_vcr.c @@ -83,37 +76,36 @@ client_SOURCES= cl_cam.c cl_cmd.c cl_demo.c cl_input.c cl_main.c cl_screen.c \ server_SOURCES= host.c host_cmd.c pr_cmds.c sv_cvar.c sv_main.c \ sv_move.c sv_phys.c sv_progs.c sv_user.c -combined_SOURCES= $(common_SOURCES) $(client_SOURCES) $(server_SOURCES) \ - $(qfsys_SRC) +combined_SOURCES= $(common_SOURCES) $(client_SOURCES) $(server_SOURCES) # Software-rendering targets # ... Linux FBDev -nq_fbdev_SOURCES= $(combined_SOURCES) +nq_fbdev_SOURCES= $(combined_SOURCES) sys_unix.c nq_fbdev_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFfbdev.la $(client_LIBS) nq_fbdev_LDFLAGS= $(common_ldflags) nq_fbdev_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFfbdev.la $(client_LIB_DEPS) # ... SciTech MGL -nq_mgl_SOURCES= $(combined_SOURCES) +nq_mgl_SOURCES= $(combined_SOURCES) sys_win.c nq_mgl_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFmgl.la $(client_LIBS) $(MGL_LIBS) nq_mgl_LDFLAGS= $(common_ldflags) nq_mgl_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFmgl.la $(client_LIB_DEPS) # ... Sam Lantinga's Simple DirectMedia Layer, version 1.0 and higher -nq_sdl_SOURCES= $(combined_SOURCES) +nq_sdl_SOURCES= $(combined_SOURCES) sys_sdl.c nq_sdl_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsdl.la $(client_LIBS) $(SDL_LIBS) nq_sgl_LDFLAGS= $(common_ldflags) nq_sdl_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsdl.la $(client_LIB_DEPS) # ... Linux SVGAlib -nq_svga_SOURCES= $(combined_SOURCES) +nq_svga_SOURCES= $(combined_SOURCES) sys_unix.c nq_svga_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsvga.la $(client_LIBS) $(SVGA_LIBS) nq_svga_LDFLAGS= $(common_ldflags) nq_svga_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsvga.la $(client_LIB_DEPS) # ... X11 -nq_x11_SOURCES= $(combined_SOURCES) +nq_x11_SOURCES= $(combined_SOURCES) sys_unix.c nq_x11_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFx11.la $(client_LIBS) $(X_PRE_LIBS) $(VIDMODE_LIBS) $(DGA_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB) nq_x11_LDFLAGS= $(common_ldflags) nq_x11_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFx11.la $(client_LIB_DEPS) @@ -122,25 +114,25 @@ nq_x11_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../lib # OpenGL-using targets # ... 3Dfx Voodoo 1 and 2 SVGAlib-based console GL -nq_3dfx_SOURCES= $(combined_SOURCES) +nq_3dfx_SOURCES= $(combined_SOURCES) sys_unix.c nq_3dfx_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFtdfx.la $(client_LIBS) $(GLIDE_LIBS) $(SVGA_LIBS) $(DL_LIBS) nq_3dfx_LDFLAGS= $(common_ldflags) nq_3dfx_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFtdfx.la $(client_LIB_DEPS) # ... OpenGL in X Window -nq_glx_SOURCES= $(combined_SOURCES) +nq_glx_SOURCES= $(combined_SOURCES) sys_unix.c nq_glx_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFglx.la $(client_LIBS) $(X_PRE_LIBS) $(VIDMODE_LIBS) $(DGA_LIBS) $(X_LIBS) -lX11 -lXext $(X_EXTRA_LIBS) $(DL_LIBS) nq_glx_LDFLAGS= $(common_ldflags) nq_glx_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFglx.la $(client_LIB_DEPS) # ... Simple Directmedia Layer, version 1.1 and higher, in GL mode -nq_sgl_SOURCES= $(combined_SOURCES) +nq_sgl_SOURCES= $(combined_SOURCES) sys_sdl.c nq_sgl_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFsgl.la $(client_LIBS) $(X_LIBS) $(SDL_LIBS) $(DL_LIBS) nq_sgl_LDFLAGS= $(common_ldflags) nq_sgl_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFsgl.la $(client_LIB_DEPS) # ... SGI/Microsoft WGL (Windows OpenGL) -nq_wgl_SOURCES= $(combined_SOURCES) conproc.c +nq_wgl_SOURCES= $(combined_SOURCES) conproc.c sys_win.c nq_wgl_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFwgl.la $(client_LIBS) -lgdi32 -lcomctl32 -lwinmm nq_wgl_LDFLAGS= $(common_ldflags) nq_wgl_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFwgl.la $(client_LIB_DEPS) @@ -158,3 +150,12 @@ EXTRA_DIST= sys_win.c sys_unix.c #nq.dsp # Kill the temp files, hopefully. CLEANFILES = *.i *.s $(YACCLEX_CLEANFILES) + +sys_sdl.o: sys_sdl.c + @echo '$(COMPILE) $(SDL_CFLAGS) -c $<'; \ + $(COMPILE) $(SDL_CFLAGS) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp diff --git a/nq/source/sys_sdl.c b/nq/source/sys_sdl.c new file mode 100644 index 000000000..8d7e54430 --- /dev/null +++ b/nq/source/sys_sdl.c @@ -0,0 +1,233 @@ +/* + cl_sys_sdl.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 + + $Id$ +*/ + + + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include + +#ifndef _WIN32 +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + +#include +#include + +#include "QF/cvar.h" +#include "QF/sys.h" +#include "QF/qargs.h" +#include "QF/qargs.h" + +#include "client.h" +#include "compat.h" +#include "host.h" + +qboolean isDedicated = false; +char *svs_info; + +int starttime; + +#ifdef _WIN32 +# include "winquake.h" + // FIXME: minimized is not currently supported under + // SDL +qboolean Minimized = false; +void MaskExceptions (void); +#endif + + +void +Sys_DebugLog (const char *file, const char *fmt, ...) +{ + int fd; + static char data[1024]; // why static ? + va_list argptr; + + va_start (argptr, fmt); + vsnprintf (data, sizeof (data), fmt, argptr); + va_end (argptr); + fd = open (file, O_WRONLY | O_CREAT | O_APPEND, 0666); + write (fd, data, strlen (data)); + close (fd); +}; + + +/* + SYSTEM IO +*/ + + +void +Sys_Init (void) +{ +#ifdef WIN32 + OSVERSIONINFO vinfo; +#endif +#ifdef USE_INTEL_ASM +#ifdef _WIN32 + MaskExceptions (); +#endif + Sys_SetFPCW (); +#endif + +#ifdef _WIN32 + // make sure the timer is high precision, otherwise + // NT gets 18ms resolution + timeBeginPeriod (1); + + vinfo.dwOSVersionInfoSize = sizeof (vinfo); + + if (!GetVersionEx (&vinfo)) + Sys_Error ("Couldn't get OS info"); + + if ((vinfo.dwMajorVersion < 4) + || (vinfo.dwPlatformId == VER_PLATFORM_WIN32s)) { + Sys_Error ("This version of " PROGRAM + " requires at least Win95 or NT 4.0"); + } +#endif +} + + +void +Sys_Error (const char *error, ...) +{ + va_list argptr; + char text[1024]; + +#ifndef _WIN32 + fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK); +#endif + va_start (argptr, error); + vsnprintf (text, sizeof (text), error, argptr); + va_end (argptr); + +#ifdef WIN32 + MessageBox (NULL, text, "Error", 0 /* MB_OK */ ); +#endif + fprintf (stderr, "Error: %s\n", text); + + Host_Shutdown (); + exit (1); +} + + +void +Sys_Quit (void) +{ + Host_Shutdown (); + exit (0); +} + + +const char * +Sys_ConsoleInput (void) +{ + return NULL; +} + + +void +Sys_Sleep (void) +{ +} + + +void +Sys_Init_Cvars (void) +{ + sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, + "Set to disable std out"); + if (COM_CheckParm ("-nostdout")) + Cvar_Set (sys_nostdout, "1"); +} + + +C_LINKAGE int +SDL_main (int c, char **v) +{ + double time, oldtime, newtime; + int j; + +#ifndef WIN32 + signal (SIGFPE, SIG_IGN); +#endif + + memset (&host_parms, 0, sizeof (host_parms)); + + COM_InitArgv (c, (const char **)v); + host_parms.argc = com_argc; + host_parms.argv = com_argv; + + host_parms.memsize = 16 * 1024 * 1024; + + j = COM_CheckParm ("-mem"); + if (j) + host_parms.memsize = (int) (atof (com_argv[j + 1]) * 1024 * 1024); + host_parms.membase = malloc (host_parms.memsize); + + if (!host_parms.membase) { + printf ("Can't allocate memory for zone.\n"); + return 1; + } +#ifndef WIN32 + noconinput = COM_CheckParm ("-noconinput"); + if (!noconinput) + fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NONBLOCK); +#endif + + Host_Init (&host_parms); + + oldtime = Sys_DoubleTime (); + while (1) { +// find time spent rendering last frame + newtime = Sys_DoubleTime (); + time = newtime - oldtime; + + Host_Frame (time); + oldtime = newtime; + } +} diff --git a/qw/source/Makefile.am b/qw/source/Makefile.am index a09d19989..03459f66a 100644 --- a/qw/source/Makefile.am +++ b/qw/source/Makefile.am @@ -87,15 +87,6 @@ qw_server_SOURCES= $(common_SOURCES) $(server_SOURCES) qw_server_LDADD= libqfnet.la $(ASM) $(qf_server_LIBS) $(NET_LIBS) $(DL_LIBS) $(CURSES_LIBS) qw_server_DEPENDENCIES= libqfnet.la $(ASM) $(qf_server_LIBS) -# Client builds -# -# ... System type -if SYSTYPE_WIN32 -syscl_SRC= cl_sys_win.c -else -syscl_SRC= cl_sys_unix.c -endif - qf_client_LIBS= $(top_builddir)/libs/video/targets/libQFjs.la \ $(top_builddir)/libs/gamecode/libQFgamecode.la \ $(top_builddir)/libs/audio/libQFcd.la \ @@ -109,37 +100,36 @@ client_LIB_DEPS= libqfnet.la $(ASM) $(qf_client_LIBS) client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \ cl_main.c cl_misc.c cl_ngraph.c cl_parse.c cl_pred.c \ cl_screen.c cl_skin.c cl_slist.c cl_tent.c cl_view.c \ - console.c keys.c locs.c sbar.c skin.c teamplay.c \ - $(syscl_SRC) + console.c keys.c locs.c sbar.c skin.c teamplay.c # Software-rendering clients # ... Linux FBDev -qw_client_fbdev_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_fbdev_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_unix.c qw_client_fbdev_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFfbdev.la $(client_LIBS) qw_client_fbdev_LDFLAGS= $(common_ldflags) qw_client_fbdev_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFfbdev.la $(client_LIB_DEPS) # ... SciTech MGL -qw_client_mgl_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_mgl_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_win.c qw_client_mgl_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFmgl.la $(client_LIBS) $(MGL_LIBS) qw_client_mgl_LDFLAGS= $(common_ldflags) qw_client_mgl_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFmgl.la $(client_LIB_DEPS) # ... Simple DirectMedia Layer, version 1.0 and higher -qw_client_sdl_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_sdl_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_sdl.c qw_client_sdl_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsdl.la $(client_LIBS) $(SDL_LIBS) qw_client_sdl_LDFLAGS= $(common_ldflags) qw_client_sdl_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsdl.la $(client_LIB_DEPS) # ... Linux SVGAlib -qw_client_svga_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_svga_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_unix.c qw_client_svga_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsvga.la $(client_LIBS) $(SVGA_LIBS) qw_client_svga_LDFAGS= $(common_ldflags) qw_client_svga_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFsvga.la $(client_LIB_DEPS) # ... X11 -qw_client_x11_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_x11_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_unix.c qw_client_x11_LDADD= ../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFx11.la $(client_LIBS) $(X_PRE_LIBS) $(VIDMODE_LIBS) $(DGA_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB) qw_client_x11_LDFLAGS= $(common_ldflags) qw_client_x11_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a ../../libs/models/libQFmodels_sw.la ../../libs/video/targets/libQFx11.la $(client_LIB_DEPS) @@ -148,25 +138,25 @@ qw_client_x11_DEPENDENCIES=../../libs/video/renderer/.libs/libQFrenderer_sw.a .. # OpenGL-using clients # ... 3Dfx Voodoo 1 and 2 SVGAlib-based console GL -qw_client_3dfx_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_3dfx_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_unix.c qw_client_3dfx_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFtdfx.la $(client_LIBS) $(GLIDE_LIBS) $(SVGA_LIBS) $(DL_LIBS) qw_client_3dfx_LDFLAGS= $(common_ldflags) qw_client_3dfx_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFtdfx.la $(client_LIB_DEPS) # ... OpenGL in X Window -qw_client_glx_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_glx_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_unix.c qw_client_glx_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFglx.la $(client_LIBS) $(X_PRE_LIBS) $(VIDMODE_LIBS) $(DGA_LIBS) $(X_LIBS) -lX11 -lXext $(X_EXTRA_LIBS) $(DL_LIBS) qw_client_glx_LDFLAGS= $(common_ldflags) qw_client_glx_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFglx.la $(client_LIB_DEPS) # ... Simple DirectMedia Layer, version 1.1 and higher, in GL mode -qw_client_sgl_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_sgl_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_sdl.c qw_client_sgl_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFsgl.la $(client_LIBS) $(SDL_LIBS) $(X_LIBS) $(DL_LIBS) qw_client_sgl_LDFLAGS= $(common_ldflags) qw_client_sgl_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFsgl.la $(client_LIB_DEPS) # ... SGI/Microsoft WGL (Windows OpenGL) -qw_client_wgl_SOURCES= $(common_SOURCES) $(client_SOURCES) +qw_client_wgl_SOURCES= $(common_SOURCES) $(client_SOURCES) cl_sys_win.c qw_client_wgl_LDADD= ../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFwgl.la $(client_LIBS) -lgdi32 -lwinmm qw_client_wgl_LDFLAGS= $(common_ldflags) qw_client_wgl_DEPENDENCIES=../../libs/video/renderer/libQFrenderer_gl.la ../../libs/models/libQFmodels_gl.la ../../libs/video/targets/libQFwgl.la $(client_LIB_DEPS) @@ -181,3 +171,12 @@ EXTRA_DIST= makefile.mgw makefile.win \ # Kill the temp files, hopefully. CLEANFILES = *.i *.s $(YACCLEX_CLEANFILES) + +cl_sys_sdl.o: cl_sys_sdl.c + @echo '$(COMPILE) $(SDL_CFLAGS) -c $<'; \ + $(COMPILE) $(SDL_CFLAGS) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp diff --git a/qw/source/cl_sys_sdl.c b/qw/source/cl_sys_sdl.c index 7a96806d5..f8d151bc4 100644 --- a/qw/source/cl_sys_sdl.c +++ b/qw/source/cl_sys_sdl.c @@ -53,13 +53,16 @@ # include #endif -#include -#include +#include +#include +#include "QF/cvar.h" #include "QF/sys.h" #include "QF/qargs.h" #include "QF/qargs.h" + #include "client.h" +#include "compat.h" #include "host.h" qboolean is_server = false; @@ -77,7 +80,7 @@ void MaskExceptions (void); void -Sys_DebugLog (char *file, char *fmt, ...) +Sys_DebugLog (const char *file, const char *fmt, ...) { int fd; static char data[1024]; // why static ? @@ -130,7 +133,7 @@ Sys_Init (void) void -Sys_Error (char *error, ...) +Sys_Error (const char *error, ...) { va_list argptr; char text[1024]; @@ -160,7 +163,7 @@ Sys_Quit (void) } -char * +const char * Sys_ConsoleInput (void) { return NULL; @@ -187,8 +190,7 @@ C_LINKAGE int SDL_main (int c, char **v) { double time, oldtime, newtime; - int j, t; - static char cwd[1024]; + int j; #ifndef WIN32 signal (SIGFPE, SIG_IGN); @@ -196,7 +198,7 @@ SDL_main (int c, char **v) memset (&host_parms, 0, sizeof (host_parms)); - COM_InitArgv (c, v); + COM_InitArgv (c, (const char **)v); host_parms.argc = com_argc; host_parms.argv = com_argv;