mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 16:51:08 +00:00
changes to get mingw32 sw clients to compile under cygwin
This commit is contained in:
parent
757a0f690c
commit
2f8efd7360
4 changed files with 42 additions and 130 deletions
|
@ -70,11 +70,10 @@ case "$host_os" in
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
mingw32*)
|
mingw32*)
|
||||||
mingw=yes
|
mingw=yes
|
||||||
CPPFLAGS="$CPPFLAGS -mno-cygwin -mwindows"
|
CPPFLAGS="$CPPFLAGS -mno-cygwin -mconsole"
|
||||||
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/include/win32"
|
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/include/win32"
|
||||||
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/include/win32/resources"
|
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/include/win32/resources"
|
||||||
LDFLAGS="$LDFLAGS -mno-cygwin -mwindows"
|
LDFLAGS="$LDFLAGS -mno-cygwin -mconsole" endian="little"
|
||||||
endian="little"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -34,6 +34,7 @@ static const char rcsid[] =
|
||||||
#define CINTERFACE
|
#define CINTERFACE
|
||||||
|
|
||||||
#include "winquake.h"
|
#include "winquake.h"
|
||||||
|
#include "QF/plugin.h"
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/sound.h"
|
#include "QF/sound.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
|
@ -99,6 +100,12 @@ static snd_output_data_t plugin_info_snd_output_data;
|
||||||
static snd_output_funcs_t plugin_info_snd_output_funcs;
|
static snd_output_funcs_t plugin_info_snd_output_funcs;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
SNDDMA_Init_Cvars (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SNDDMA_BlockSound (void)
|
SNDDMA_BlockSound (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -208,8 +208,11 @@ nq_wgl_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
|
||||||
$(client_LIB_DEPS)
|
$(client_LIB_DEPS)
|
||||||
|
|
||||||
# Dedicated Server
|
# Dedicated Server
|
||||||
ded_sources= sys_unixd.c sv_ded.c sv_model.c
|
if SYSTYPE_WIN32
|
||||||
|
ded_sources= sys_wind.c sv_ded.c sv_model.c
|
||||||
|
else
|
||||||
|
ded_sources= sys_unixd.c sv_ded.c sv_model.c
|
||||||
|
endif
|
||||||
nq_server_LDFLAGS= $(common_ldflags)
|
nq_server_LDFLAGS= $(common_ldflags)
|
||||||
nq_server_SOURCES= $(common_sources) $(server_sources) $(ded_sources)
|
nq_server_SOURCES= $(common_sources) $(server_sources) $(ded_sources)
|
||||||
nq_server_LDADD= $(server_LIBS)
|
nq_server_LDADD= $(server_LIBS)
|
||||||
|
|
|
@ -34,120 +34,24 @@ static const char rcsid[] =
|
||||||
#include <sys\types.h>
|
#include <sys\types.h>
|
||||||
#include <sys\timeb.h>
|
#include <sys\timeb.h>
|
||||||
|
|
||||||
|
#include "QF/cvar.h"
|
||||||
|
#include "QF/qargs.h"
|
||||||
|
#include "QF/sys.h"
|
||||||
|
// #include "client.h"
|
||||||
|
#include "game.h"
|
||||||
|
#include "host.h"
|
||||||
#include "winquake.h"
|
#include "winquake.h"
|
||||||
#include "errno.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
qboolean isDedicated = true;
|
||||||
|
|
||||||
|
#if 0
|
||||||
// FILE IO ====================================================================
|
// FILE IO ====================================================================
|
||||||
|
|
||||||
#define MAX_HANDLES 10
|
#define MAX_HANDLES 10
|
||||||
VFile *sys_handles[MAX_HANDLES];
|
VFile *sys_handles[MAX_HANDLES];
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
findhandle (void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 1; i < MAX_HANDLES; i++)
|
|
||||||
if (!sys_handles[i])
|
|
||||||
return i;
|
|
||||||
Sys_Error ("out of handles");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
filelength (VFile *f)
|
|
||||||
{
|
|
||||||
int pos;
|
|
||||||
int end;
|
|
||||||
|
|
||||||
pos = ftell (f);
|
|
||||||
fseek (f, 0, SEEK_END);
|
|
||||||
end = ftell (f);
|
|
||||||
fseek (f, pos, SEEK_SET);
|
|
||||||
|
|
||||||
return end;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
Sys_FileOpenRead (char *path, int *hndl)
|
|
||||||
{
|
|
||||||
VFile *f;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
i = findhandle ();
|
|
||||||
|
|
||||||
f = Qopen (path, "rb");
|
|
||||||
if (!f) {
|
|
||||||
*hndl = -1;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
sys_handles[i] = f;
|
|
||||||
*hndl = i;
|
|
||||||
|
|
||||||
return filelength (f);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
Sys_FileOpenWrite (char *path)
|
|
||||||
{
|
|
||||||
VFile *f;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
i = findhandle ();
|
|
||||||
|
|
||||||
f = Qopen (path, "wb");
|
|
||||||
if (!f)
|
|
||||||
Sys_Error ("Error opening %s: %s", path, strerror (errno));
|
|
||||||
sys_handles[i] = f;
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Sys_FileClose (int handle)
|
|
||||||
{
|
|
||||||
Qclose (sys_handles[handle]);
|
|
||||||
sys_handles[handle] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Sys_FileSeek (int handle, int position)
|
|
||||||
{
|
|
||||||
fseek (sys_handles[handle], position, SEEK_SET);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
Sys_FileRead (int handle, void *dest, int count)
|
|
||||||
{
|
|
||||||
return fread (dest, 1, count, sys_handles[handle]);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
Sys_FileWrite (int handle, void *data, int count)
|
|
||||||
{
|
|
||||||
return fwrite (data, 1, count, sys_handles[handle]);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
Sys_FileTime (char *path)
|
|
||||||
{
|
|
||||||
VFile *f;
|
|
||||||
|
|
||||||
f = Qopen (path, "rb");
|
|
||||||
if (f) {
|
|
||||||
Qclose (f);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Sys_mkdir (char *path)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// SYSTEM IO ==================================================================
|
// SYSTEM IO ==================================================================
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -155,16 +59,6 @@ Sys_DebugLog (char *file, char *fmt, ...)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Sys_Printf (char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list argptr;
|
|
||||||
|
|
||||||
va_start (argptr, fmt);
|
|
||||||
vprintf (fmt, argptr);
|
|
||||||
va_end (argptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IN_SendKeyEvents (void)
|
IN_SendKeyEvents (void)
|
||||||
{
|
{
|
||||||
|
@ -179,8 +73,9 @@ void
|
||||||
Sys_LowFPPrecision (void)
|
Sys_LowFPPrecision (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
Sys_ConsoleInput (void)
|
Sys_ConsoleInput (void)
|
||||||
{
|
{
|
||||||
static char text[256];
|
static char text[256];
|
||||||
|
@ -217,25 +112,33 @@ Sys_ConsoleInput (void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *newargv[256];
|
static void
|
||||||
|
shutdown (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
Sys_Init (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *newargv[256];
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, const char **argv)
|
||||||
{
|
{
|
||||||
MSG msg;
|
|
||||||
quakeparms_t parms;
|
quakeparms_t parms;
|
||||||
double time, oldtime;
|
double time, oldtime;
|
||||||
static char cwd[1024];
|
|
||||||
|
|
||||||
memset (&parms, 0, sizeof (parms));
|
memset (&parms, 0, sizeof (parms));
|
||||||
|
|
||||||
parms.memsize = 16384 * 1024;
|
parms.memsize = 16384 * 1024;
|
||||||
parms.membase = malloc (parms.memsize);
|
parms.membase = malloc (parms.memsize);
|
||||||
|
#if 0
|
||||||
_getcwd (cwd, sizeof (cwd));
|
_getcwd (cwd, sizeof (cwd));
|
||||||
if (cwd[Q_strlen (cwd) - 1] == '\\')
|
if (cwd[Q_strlen (cwd) - 1] == '\\')
|
||||||
cwd[Q_strlen (cwd) - 1] = 0;
|
cwd[Q_strlen (cwd) - 1] = 0;
|
||||||
|
#endif
|
||||||
COM_InitArgv (argc, argv);
|
COM_InitArgv (argc, argv);
|
||||||
|
|
||||||
// dedicated server ONLY!
|
// dedicated server ONLY!
|
||||||
|
@ -247,8 +150,8 @@ main (int argc, char **argv)
|
||||||
COM_InitArgv (argc, argv);
|
COM_InitArgv (argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
parms.argc = argc;
|
parms.argc = com_argc;
|
||||||
parms.argv = argv;
|
parms.argv = com_argv;
|
||||||
|
|
||||||
Sys_RegisterShutdown (Host_Shutdown);
|
Sys_RegisterShutdown (Host_Shutdown);
|
||||||
Sys_RegisterShutdown (shutdown);
|
Sys_RegisterShutdown (shutdown);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue