nq-{sdl,sgl,wgl} compile, but don't link

This commit is contained in:
Bill Currie 2001-04-10 23:17:47 +00:00
parent 34c9239ebf
commit 051f3ca96e
22 changed files with 126 additions and 196 deletions

View file

@ -88,10 +88,10 @@ extern glvert_t glv;
extern int glx, gly, glwidth, glheight;
#ifdef _WIN32
extern PROC glArrayElementEXT;
extern PROC glColorPointerEXT;
extern PROC glTexturePointerEXT;
extern PROC glVertexPointerEXT;
//extern PROC glArrayElementEXT;
//extern PROC glColorPointerEXT;
//extern PROC glTexturePointerEXT;
//extern PROC glVertexPointerEXT;
#endif
// r_local.h -- private refresh defs
@ -258,6 +258,7 @@ void GL_BuildLightmaps (void);
void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboolean alpha) ;
void GL_Set2D (void);
void GL_CheckGamma (unsigned char *pal);
void GL_CheckBrightness (unsigned char *pal);
void EmitWaterPolys (msurface_t *fa);
void EmitSkyPolys (msurface_t *fa);

View file

@ -38,6 +38,7 @@
#include "host.h"
#include "QF/msg.h"
#include "client.h"
#include "QF/compat.h"
#include "QF/sys.h"
#include "QF/console.h"
#include "QF/cmd.h"

View file

@ -32,6 +32,7 @@
#endif
#include "QF/msg.h"
#include "QF/compat.h"
#include "QF/cvar.h"
#include "client.h"
#include "chase.h"

View file

@ -5,6 +5,7 @@
#include <string.h>
#include <ctype.h>
#include "QF/cvar.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/qargs.h"
#include "QF/cmd.h"

View file

@ -6,6 +6,7 @@
#include <ctype.h>
#include <stdlib.h>
#include "QF/cvar.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/qargs.h"
#include "QF/cmd.h"

View file

@ -39,6 +39,7 @@
#include <stdio.h>
#include "QF/console.h"
#include "QF/compat.h"
#include "QF/mdfour.h"
#include "QF/model.h"
#include "QF/quakefs.h"

View file

@ -35,6 +35,7 @@
#include "r_local.h"
#include "QF/sys.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/qendian.h"
#include "QF/checksum.h"

View file

@ -35,6 +35,7 @@
#include "r_local.h"
#include "QF/sys.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/qendian.h"
#include "QF/checksum.h"

View file

@ -32,6 +32,7 @@
#include "r_local.h"
#include "QF/sys.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/qendian.h"
#include "QF/checksum.h"

View file

@ -39,6 +39,7 @@
#endif
#include "QF/qtypes.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/model.h"
#include "QF/quakefs.h"

View file

@ -37,6 +37,7 @@
#include "view.h"
#include "chase.h"
#include "QF/cdaudio.h"
#include "QF/compat.h"
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/keys.h"

View file

@ -34,6 +34,7 @@
#include "server.h"
#include "host.h"
#include "QF/cmd.h"
#include "QF/compat.h"
#include "world.h"
#include "QF/va.h"
#include "screen.h"

View file

@ -44,6 +44,7 @@
#include "client.h"
#include "QF/cmd.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/keys.h"

View file

@ -41,6 +41,7 @@
#include "r_local.h"
#include "QF/sys.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/qendian.h"
#include "QF/checksum.h"

View file

@ -31,12 +31,30 @@
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#ifdef HAVE_WINSOCK_H
# include <winsock.h>
#endif
#include <errno.h>
#include <string.h>
#include <stdlib.h>
@ -54,10 +72,30 @@
#endif
#include "net.h"
#include "QF/compat.h"
#include "QF/qargs.h"
#include "QF/sys.h"
#include "QF/console.h"
#ifdef _WIN32
# undef EWOULDBLOCK
# define EWOULDBLOCK WSAEWOULDBLOCK
# undef ECONNREFUSED
# define ECONNREFUSED WSAECONNREFUSED
#endif
#ifndef MAXHOSTNAMELEN
# define MAXHOSTNAMELEN 512
#endif
#ifndef HAVE_SOCKLEN_T
# ifdef HAVE_SIZE
typedef size_t socklen_t;
# else
typedef unsigned int socklen_t;
# endif
#endif
//extern int gethostname (char *, int);
extern int close (int);
@ -151,12 +189,17 @@ UDP_OpenSocket (int port)
{
int newsocket;
struct sockaddr_in address;
qboolean _true = true;
#ifdef _WIN32
#define ioctl ioctlsocket
unsigned long _true = true;
#else
int _true = true;
#endif
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
return -1;
if (ioctl (newsocket, FIONBIO, (char *) &_true) == -1)
if (ioctl (newsocket, FIONBIO, &_true) == -1)
goto ErrorReturn;
address.sin_family = AF_INET;

View file

@ -33,6 +33,7 @@
#include <string.h>
#include "QF/console.h"
#include "QF/compat.h"
#include "QF/sys.h"
#include "QF/cmd.h"
#include "QF/va.h"

View file

@ -33,6 +33,7 @@
#include "r_local.h"
#include "QF/qargs.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "server.h"
#include "QF/msg.h"

View file

@ -33,6 +33,7 @@
#include <time.h>
#include "r_local.h"
#include "QF/cmd.h"
#include "QF/compat.h"
#include "screen.h"
#include "sbar.h"
#include "QF/input.h"

View file

@ -33,6 +33,7 @@
#include "server.h"
#include "QF/msg.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/sys.h"
#include "QF/cmd.h"

View file

@ -31,9 +31,18 @@
#endif
#include "winquake.h"
#include "errno.h"
#include "resource.h"
#include "conproc.h"
#include "resource.h"
#include "QF/compat.h"
#include "QF/qargs.h"
#include "QF/quakeio.h"
#include "QF/sys.h"
#include "client.h"
#include "game.h"
#include "host.h"
#include "screen.h"
#define MINIMUM_WIN_MEMORY 0x0880000
#define MAXIMUM_WIN_MEMORY 0x1000000
@ -57,7 +66,7 @@ qboolean isDedicated;
static qboolean sc_return_on_enter = false;
HANDLE hinput, houtput;
static char *tracking_tag = "Clams & Mooses";
static const char tracking_tag[] = "Clams & Mooses";
static HANDLE tevent;
static HANDLE hFile;
@ -81,7 +90,7 @@ void
Sys_PageIn (void *ptr, int size)
{
byte *x;
int j, m, n;
int m, n;
// touch all the memory to make sure it's there. The 16-page skip is to
// keep Win 95 from thinking we're trying to page ourselves in (we are
@ -120,148 +129,6 @@ findhandle (void)
return -1;
}
/*
================
filelength
================
*/
int
filelength (QFile *f)
{
int pos;
int end;
int t;
t = VID_ForceUnlockedAndReturnState ();
pos = ftell (f);
fseek (f, 0, SEEK_END);
end = ftell (f);
fseek (f, pos, SEEK_SET);
VID_ForceLockState (t);
return end;
}
int
Sys_FileOpenRead (char *path, int *hndl)
{
QFile *f;
int i, retval;
int t;
t = VID_ForceUnlockedAndReturnState ();
i = findhandle ();
f = Qopen (path, "rb");
if (!f) {
*hndl = -1;
retval = -1;
} else {
sys_handles[i] = f;
*hndl = i;
retval = filelength (f);
}
VID_ForceLockState (t);
return retval;
}
int
Sys_FileOpenWrite (char *path)
{
QFile *f;
int i;
int t;
t = VID_ForceUnlockedAndReturnState ();
i = findhandle ();
f = Qopen (path, "wb");
if (!f)
Sys_Error ("Error opening %s: %s", path, strerror (errno));
sys_handles[i] = f;
VID_ForceLockState (t);
return i;
}
void
Sys_FileClose (int handle)
{
int t;
t = VID_ForceUnlockedAndReturnState ();
Qclose (sys_handles[handle]);
sys_handles[handle] = NULL;
VID_ForceLockState (t);
}
void
Sys_FileSeek (int handle, int position)
{
int t;
t = VID_ForceUnlockedAndReturnState ();
fseek (sys_handles[handle], position, SEEK_SET);
VID_ForceLockState (t);
}
int
Sys_FileRead (int handle, void *dest, int count)
{
int t, x;
t = VID_ForceUnlockedAndReturnState ();
x = fread (dest, 1, count, sys_handles[handle]);
VID_ForceLockState (t);
return x;
}
int
Sys_FileWrite (int handle, void *data, int count)
{
int t, x;
t = VID_ForceUnlockedAndReturnState ();
x = fwrite (data, 1, count, sys_handles[handle]);
VID_ForceLockState (t);
return x;
}
int
Sys_FileTime (char *path)
{
QFile *f;
int t, retval;
t = VID_ForceUnlockedAndReturnState ();
f = Qopen (path, "rb");
if (f) {
Qclose (f);
retval = 1;
} else {
retval = -1;
}
VID_ForceLockState (t);
return retval;
}
void
Sys_mkdir (char *path)
{
_mkdir (path);
}
/*
===============================================================================
@ -364,7 +231,7 @@ Sys_Init (void)
void
Sys_Error (char *error, ...)
Sys_Error (const char *error, ...)
{
va_list argptr;
char text[1024], text2[1024];
@ -433,9 +300,9 @@ Sys_Error (char *error, ...)
exit (1);
}
/*FIXME?
void
Sys_Printf (char *fmt, ...)
Sys_Printf (const char *fmt, ...)
{
va_list argptr;
char text[1024];
@ -449,7 +316,7 @@ Sys_Printf (char *fmt, ...)
WriteFile (houtput, text, strlen (text), &dummy, NULL);
}
}
*/
void
Sys_Quit (void)
{
@ -545,7 +412,7 @@ Sys_InitFloatTime (void)
j = COM_CheckParm ("-starttime");
if (j) {
curtime = (double) (Q_atof (com_argv[j + 1]));
curtime = (double) (atof (com_argv[j + 1]));
} else {
curtime = 0.0;
}
@ -560,9 +427,10 @@ Sys_ConsoleInput (void)
static char text[256];
static int len;
INPUT_RECORD recs[1024];
int count;
int i, dummy;
int ch, numread, numevents;
DWORD dummy;
int ch;
DWORD numread;
DWORD numevents;
if (!isDedicated)
return NULL;
@ -690,7 +558,6 @@ int WINAPI
WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
quakeparms_t parms;
double time, oldtime, newtime;
MEMORYSTATUS lpBuffer;
@ -711,8 +578,8 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
if (!GetCurrentDirectory (sizeof (cwd), cwd))
Sys_Error ("Couldn't determine current directory");
if (cwd[Q_strlen (cwd) - 1] == '/')
cwd[Q_strlen (cwd) - 1] = 0;
if (cwd[strlen (cwd) - 1] == '/')
cwd[strlen (cwd) - 1] = 0;
parms.basedir = cwd;
parms.cachedir = NULL;
@ -785,7 +652,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
t = COM_CheckParm ("-heapsize") + 1;
if (t < com_argc)
parms.memsize = Q_atoi (com_argv[t]) * 1024;
parms.memsize = atoi (com_argv[t]) * 1024;
}
parms.membase = malloc (parms.memsize);
@ -811,17 +678,17 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
// give QHOST a chance to hook into the console
if ((t = COM_CheckParm ("-HFILE")) > 0) {
if (t < com_argc)
hFile = (HANDLE) Q_atoi (com_argv[t + 1]);
hFile = (HANDLE) atoi (com_argv[t + 1]);
}
if ((t = COM_CheckParm ("-HPARENT")) > 0) {
if (t < com_argc)
heventParent = (HANDLE) Q_atoi (com_argv[t + 1]);
heventParent = (HANDLE) atoi (com_argv[t + 1]);
}
if ((t = COM_CheckParm ("-HCHILD")) > 0) {
if (t < com_argc)
heventChild = (HANDLE) Q_atoi (com_argv[t + 1]);
heventChild = (HANDLE) atoi (com_argv[t + 1]);
}
InitConProc (hFile, heventParent, heventChild);

View file

@ -51,6 +51,7 @@
#endif
#include "QF/console.h"
#include "QF/compat.h"
#include "glquake.h"
#include "QF/input.h"
#include "QF/qargs.h"

View file

@ -30,21 +30,24 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "quakedef.h"
#include "QF/va.h"
#include "winquake.h"
#include <commctrl.h>
#include "QF/va.h"
#include "QF/compat.h"
#include "QF/sys.h"
#include "client.h"
#include "resource.h"
#include "glquake.h"
#include "host.h"
#include "in_win.h"
#include <commctrl.h>
#include "screen.h"
#include "QF/keys.h"
#include "QF/qargs.h"
#include "QF/cmd.h"
#include "QF/qendian.h"
#include "draw.h"
#include "cdaudio.h"
#include "QF/cdaudio.h"
#include "QF/console.h"
#include "sbar.h"
@ -98,7 +101,6 @@ qboolean scr_skipupdate;
static vmode_t modelist[MAX_MODE_LIST];
static int nummodes;
static vmode_t *pcurrentmode;
static vmode_t badmode;
static DEVMODE gdevmode;
@ -149,10 +151,10 @@ void ClearAllStates (void);
void VID_UpdateWindowStatus (void);
void GL_Init (void);
PROC glArrayElementEXT;
PROC glColorPointerEXT;
PROC glTexCoordPointerEXT;
PROC glVertexPointerEXT;
//PROC glArrayElementEXT;
//PROC glColorPointerEXT;
//PROC glTexCoordPointerEXT;
//PROC glVertexPointerEXT;
typedef void (APIENTRY * lp3DFXFUNC) (int, int, int, int, int, const void *);
lp3DFXFUNC glColorTableEXT;
@ -388,7 +390,7 @@ int
VID_SetMode (int modenum, unsigned char *palette)
{
int original_mode, temp;
qboolean stat;
qboolean stat = false;
MSG msg;
if ((windowed && (modenum != 0)) ||
@ -497,8 +499,8 @@ VID_UpdateWindowStatus (void)
void
CheckArrayExtensions (void)
{
#if 0 // FIXME
char *tmp;
/* check for texture extension */
tmp = (unsigned char *) glGetString (GL_EXTENSIONS);
while (*tmp) {
@ -525,6 +527,7 @@ CheckArrayExtensions (void)
}
Sys_Error ("Vertex array extension not present");
#endif
}
//int texture_mode = GL_NEAREST;
@ -649,8 +652,6 @@ GL_BeginRendering
void
GL_BeginRendering (int *x, int *y, int *width, int *height)
{
extern cvar_t *gl_clear;
*x = *y = 0;
*width = WindowRect.right - WindowRect.left;
*height = WindowRect.bottom - WindowRect.top;
@ -772,8 +773,6 @@ BOOL gammaworks;
void
VID_ShiftPalette (unsigned char *palette)
{
extern byte ramps[3][256];
// VID_SetPalette (palette);
// gammaworks = SetDeviceGammaRamp (maindc, ramps);
@ -1051,12 +1050,12 @@ MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
Key_Event (MapKey (lParam), true);
Key_Event (MapKey (lParam), 0, true);
break;
case WM_KEYUP:
case WM_SYSKEYUP:
Key_Event (MapKey (lParam), false);
Key_Event (MapKey (lParam), 0, false);
break;
case WM_SYSCHAR:
@ -1094,11 +1093,11 @@ MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
// Event.
case WM_MOUSEWHEEL:
if ((short) HIWORD (wParam) > 0) {
Key_Event (K_MWHEELUP, true);
Key_Event (K_MWHEELUP, false);
Key_Event (K_MWHEELUP, 0, true);
Key_Event (K_MWHEELUP, 0, false);
} else {
Key_Event (K_MWHEELDOWN, true);
Key_Event (K_MWHEELDOWN, false);
Key_Event (K_MWHEELDOWN, 0, true);
Key_Event (K_MWHEELDOWN, 0, false);
}
break;
@ -1546,7 +1545,7 @@ void
VID_Init (unsigned char *palette)
{
int i, existingmode;
int basenummodes, width, height, bpp, findbpp, done;
int basenummodes, width, height=640, bpp, findbpp, done;
char gldir[MAX_OSPATH];
HDC hdc;
DEVMODE devmode;
@ -1724,7 +1723,9 @@ VID_Init (unsigned char *palette)
vid.colormap = host_colormap;
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap + 2048));
#ifdef SPLASH_SCREEN
DestroyWindow (hwnd_dialog);
#endif
GL_CheckBrightness (palette);
VID_SetPalette (palette);
@ -1779,7 +1780,7 @@ extern void M_DrawCharacter (int cx, int line, int num);
extern void M_DrawTransPic (int x, int y, qpic_t *pic);
extern void M_DrawPic (int x, int y, qpic_t *pic);
static int vid_line, vid_wmodes;
static int vid_wmodes;
typedef struct {
int modenum;