mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Windows Support rausoperiert
This commit is contained in:
parent
70c91952ae
commit
6b265935f9
8 changed files with 2 additions and 97 deletions
|
@ -78,12 +78,11 @@ qboolean CL_CheckOrDownloadFile (char *filename)
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
// fix backslashes
|
||||
while ((ptr=strchr(filename,'\\'))) {
|
||||
*ptr = '/';
|
||||
}
|
||||
#endif
|
||||
|
||||
if (FS_LoadFile (filename, NULL) != -1)
|
||||
{ // it exists, no need to download
|
||||
return true;
|
||||
|
|
|
@ -18,9 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
*/
|
||||
#include <ctype.h>
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include "../header/client.h"
|
||||
#include "qmenu.h"
|
||||
|
||||
|
@ -2518,13 +2515,9 @@ static void StartServer_MenuInit( void )
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef _WIN32
|
||||
length = filelength( fileno( fp ) );
|
||||
#else
|
||||
fseek(fp, 0, SEEK_END);
|
||||
length = ftell(fp);
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
#endif
|
||||
buffer = malloc( length );
|
||||
fread( buffer, length, 1, fp );
|
||||
}
|
||||
|
|
|
@ -484,7 +484,6 @@ Use ~/.quake2/dir as fs_gamedir
|
|||
*/
|
||||
void FS_AddHomeAsGameDirectory (char *dir)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
char gdir[MAX_OSPATH];
|
||||
char *homedir=getenv("HOME");
|
||||
if(homedir)
|
||||
|
@ -501,7 +500,6 @@ void FS_AddHomeAsGameDirectory (char *dir)
|
|||
|
||||
FS_AddGameDirectory (gdir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -692,9 +690,6 @@ char **FS_ListFiles( char *findname, int *numfiles, unsigned musthave, unsigned
|
|||
if ( s[strlen(s)-1] != '.' )
|
||||
{
|
||||
list[nfiles] = strdup( s );
|
||||
#ifdef _WIN32
|
||||
strlwr( list[nfiles] );
|
||||
#endif
|
||||
nfiles++;
|
||||
}
|
||||
s = Sys_FindNext( musthave, canthave );
|
||||
|
|
|
@ -25,9 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define VERSION 0.50
|
||||
#define BASEDIRNAME "baseq2"
|
||||
|
||||
#ifdef WIN32
|
||||
#define BUILDSTRING "Windows"
|
||||
#elif defined __linux__
|
||||
#if defined __linux__
|
||||
#define BUILDSTRING "Linux"
|
||||
#elif defined __FreeBSD__
|
||||
#define BUILDSTRING "FreeBSD"
|
||||
|
|
|
@ -1344,12 +1344,10 @@ image_t *GL_FindImage (char *name, imagetype_t type)
|
|||
if (len<5)
|
||||
return NULL; // ri.Sys_Error (ERR_DROP, "GL_FindImage: bad name: %s", name);
|
||||
|
||||
#ifndef _WIN32
|
||||
// fix backslashes
|
||||
while ((ptr=strchr(name,'\\'))) {
|
||||
*ptr = '/';
|
||||
}
|
||||
#endif
|
||||
|
||||
// look for it
|
||||
for (i=0, image=gltextures ; i<numgltextures ; i++,image++)
|
||||
|
|
|
@ -938,11 +938,7 @@ void R_Register( void )
|
|||
gl_flashblend = ri.Cvar_Get ("gl_flashblend", "0", 0);
|
||||
gl_playermip = ri.Cvar_Get ("gl_playermip", "0", 0);
|
||||
gl_monolightmap = ri.Cvar_Get( "gl_monolightmap", "0", 0 );
|
||||
#ifdef _WIN32
|
||||
gl_driver = ri.Cvar_Get( "gl_driver", "opengl32", CVAR_ARCHIVE );
|
||||
#else
|
||||
gl_driver = ri.Cvar_Get( "gl_driver", "libGL.so", CVAR_ARCHIVE );
|
||||
#endif
|
||||
gl_texturemode = ri.Cvar_Get( "gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
|
||||
gl_texturealphamode = ri.Cvar_Get( "gl_texturealphamode", "default", CVAR_ARCHIVE );
|
||||
gl_texturesolidmode = ri.Cvar_Get( "gl_texturesolidmode", "default", CVAR_ARCHIVE );
|
||||
|
@ -983,14 +979,6 @@ qboolean R_SetMode (void)
|
|||
rserr_t err;
|
||||
qboolean fullscreen;
|
||||
|
||||
#ifdef _WIN32
|
||||
if ( vid_fullscreen->modified && !gl_config.allow_cds )
|
||||
{
|
||||
ri.Con_Printf( PRINT_ALL, "R_SetMode() - CDS not allowed with this driver\n" );
|
||||
ri.Cvar_SetValue( "vid_fullscreen", !vid_fullscreen->value );
|
||||
vid_fullscreen->modified = false;
|
||||
}
|
||||
#endif
|
||||
fullscreen = vid_fullscreen->value;
|
||||
|
||||
vid_fullscreen->modified = false;
|
||||
|
@ -1169,12 +1157,6 @@ int R_Init( void *hinstance, void *hWnd )
|
|||
gl_config.allow_cds = true;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if ( gl_config.allow_cds )
|
||||
ri.Con_Printf( PRINT_ALL, "...allowing CDS\n" );
|
||||
else
|
||||
ri.Con_Printf( PRINT_ALL, "...disabling CDS\n" );
|
||||
#endif
|
||||
/*
|
||||
** grab extensions
|
||||
*/
|
||||
|
@ -1190,18 +1172,6 @@ int R_Init( void *hinstance, void *hWnd )
|
|||
ri.Con_Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if ( strstr( gl_config.extensions_string, "WGL_EXT_swap_control" ) )
|
||||
{
|
||||
qwglSwapIntervalEXT = ( BOOL (WINAPI *)(int)) qwglGetProcAddress( "wglSwapIntervalEXT" );
|
||||
ri.Con_Printf( PRINT_ALL, "...enabling WGL_EXT_swap_control\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.Con_Printf( PRINT_ALL, "...WGL_EXT_swap_control not found\n" );
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( strstr( gl_config.extensions_string, "GL_EXT_point_parameters" ) )
|
||||
{
|
||||
#ifndef BROKEN_GL
|
||||
|
|
|
@ -20,10 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -34,9 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
char *strlwr (char *s);
|
||||
#endif
|
||||
|
||||
#include "../../client/header/ref.h"
|
||||
|
||||
|
|
|
@ -25,10 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#ifndef __QGL_H__
|
||||
#define __QGL_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
qboolean QGL_Init( const char *dllname );
|
||||
|
@ -388,44 +384,6 @@ extern void ( APIENTRY * qglSelectTextureSGIS)( GLenum );
|
|||
extern void ( APIENTRY * qglActiveTextureARB)( GLenum );
|
||||
extern void ( APIENTRY * qglClientActiveTextureARB)( GLenum );
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
extern int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglGetPixelFormat)(HDC);
|
||||
extern BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern BOOL ( WINAPI * qwglSwapBuffers)(HDC);
|
||||
|
||||
extern BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT);
|
||||
extern HGLRC ( WINAPI * qwglCreateContext)(HDC);
|
||||
extern HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int);
|
||||
extern BOOL ( WINAPI * qwglDeleteContext)(HGLRC);
|
||||
extern HGLRC ( WINAPI * qwglGetCurrentContext)(VOID);
|
||||
extern HDC ( WINAPI * qwglGetCurrentDC)(VOID);
|
||||
extern PROC ( WINAPI * qwglGetProcAddress)(LPCSTR);
|
||||
extern BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD);
|
||||
|
||||
extern BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT,
|
||||
FLOAT, int, LPGLYPHMETRICSFLOAT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT,
|
||||
LPLAYERPLANEDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int,
|
||||
CONST COLORREF *);
|
||||
extern int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int,
|
||||
COLORREF *);
|
||||
extern BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL);
|
||||
extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval );
|
||||
|
||||
extern BOOL ( WINAPI * qwglGetDeviceGammaRampEXT ) ( unsigned char *pRed, unsigned char *pGreen, unsigned char *pBlue );
|
||||
extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, const unsigned char *pGreen, const unsigned char *pBlue );
|
||||
|
||||
#endif
|
||||
|
||||
#if defined __linux__ || defined __FreeBSD__
|
||||
// local function in dll
|
||||
extern void *qwglGetProcAddress(char *symbol);
|
||||
|
|
Loading…
Reference in a new issue