Überarbeite local.h und reiße noch mehr Graka-Müll der 90er raus

This commit is contained in:
Yamagi Burmeister 2010-10-22 08:34:01 +00:00
parent cc67d82cfa
commit 9fbebbe35c
3 changed files with 222 additions and 370 deletions

View file

@ -140,11 +140,6 @@ Draw_StretchPic ( int x, int y, int w, int h, char *pic )
Scrap_Upload(); Scrap_Upload();
} }
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha )
{
qglDisable( GL_ALPHA_TEST );
}
GL_Bind( gl->texnum ); GL_Bind( gl->texnum );
qglBegin( GL_QUADS ); qglBegin( GL_QUADS );
qglTexCoord2f( gl->sl, gl->tl ); qglTexCoord2f( gl->sl, gl->tl );
@ -156,11 +151,6 @@ Draw_StretchPic ( int x, int y, int w, int h, char *pic )
qglTexCoord2f( gl->sl, gl->th ); qglTexCoord2f( gl->sl, gl->th );
qglVertex2f( x, y + h ); qglVertex2f( x, y + h );
qglEnd(); qglEnd();
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha )
{
qglEnable( GL_ALPHA_TEST );
}
} }
void void
@ -181,11 +171,6 @@ Draw_Pic ( int x, int y, char *pic )
Scrap_Upload(); Scrap_Upload();
} }
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha )
{
qglDisable( GL_ALPHA_TEST );
}
GL_Bind( gl->texnum ); GL_Bind( gl->texnum );
qglBegin( GL_QUADS ); qglBegin( GL_QUADS );
qglTexCoord2f( gl->sl, gl->tl ); qglTexCoord2f( gl->sl, gl->tl );
@ -197,11 +182,6 @@ Draw_Pic ( int x, int y, char *pic )
qglTexCoord2f( gl->sl, gl->th ); qglTexCoord2f( gl->sl, gl->th );
qglVertex2f( x, y + gl->height ); qglVertex2f( x, y + gl->height );
qglEnd(); qglEnd();
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha )
{
qglEnable( GL_ALPHA_TEST );
}
} }
/* /*
@ -222,11 +202,6 @@ Draw_TileClear ( int x, int y, int w, int h, char *pic )
return; return;
} }
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !image->has_alpha )
{
qglDisable( GL_ALPHA_TEST );
}
GL_Bind( image->texnum ); GL_Bind( image->texnum );
qglBegin( GL_QUADS ); qglBegin( GL_QUADS );
qglTexCoord2f( x / 64.0, y / 64.0 ); qglTexCoord2f( x / 64.0, y / 64.0 );
@ -238,11 +213,6 @@ Draw_TileClear ( int x, int y, int w, int h, char *pic )
qglTexCoord2f( x / 64.0, ( y + h ) / 64.0 ); qglTexCoord2f( x / 64.0, ( y + h ) / 64.0 );
qglVertex2f( x, y + h ); qglVertex2f( x, y + h );
qglEnd(); qglEnd();
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !image->has_alpha )
{
qglEnable( GL_ALPHA_TEST );
}
} }
/* /*
@ -393,11 +363,6 @@ Draw_StretchRaw ( int x, int y, int w, int h, int cols, int rows, byte *data )
qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) )
{
qglDisable( GL_ALPHA_TEST );
}
qglBegin( GL_QUADS ); qglBegin( GL_QUADS );
qglTexCoord2f( 1.0 / 512.0, 1.0 / 512.0 ); qglTexCoord2f( 1.0 / 512.0, 1.0 / 512.0 );
qglVertex2f( x, y ); qglVertex2f( x, y );
@ -408,10 +373,5 @@ Draw_StretchRaw ( int x, int y, int w, int h, int cols, int rows, byte *data )
qglTexCoord2f( 1.0 / 512.0, t ); qglTexCoord2f( 1.0 / 512.0, t );
qglVertex2f( x, y + h ); qglVertex2f( x, y + h );
qglEnd(); qglEnd();
if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) )
{
qglEnable( GL_ALPHA_TEST );
}
} }

View file

@ -1035,11 +1035,6 @@ GL_InitImages ( void )
} }
} }
if ( gl_config.renderer & ( GL_RENDERER_VOODOO | GL_RENDERER_VOODOO2 ) )
{
g = 1.0F;
}
for ( i = 0; i < 256; i++ ) for ( i = 0; i < 256; i++ )
{ {
if ( ( g == 1 ) || gl_state.hwgamma ) if ( ( g == 1 ) || gl_state.hwgamma )

View file

@ -1,76 +1,61 @@
#ifndef __GL_LOCAL__ #ifndef __GL_LOCAL__
#define __GL_LOCAL__ #define __GL_LOCAL__
/*
Copyright (C) 1997-2001 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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <math.h>
#include <GL/gl.h> #include <GL/gl.h>
#include "../../client/header/ref.h"
#include "qgl.h"
#ifndef GL_COLOR_INDEX8_EXT #ifndef GL_COLOR_INDEX8_EXT
#define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX #define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX
#endif #endif
#include <math.h> #define TEXNUM_LIGHTMAPS 1024
#define TEXNUM_SCRAPS 1152
#define TEXNUM_IMAGES 1153
#define MAX_GLTEXTURES 1024
#define MAX_SCRAPS 1
#define BLOCK_WIDTH 128
#define BLOCK_HEIGHT 128
#define REF_VERSION "Yamagi Quake II OpenGL Refresher"
#define MAX_LBM_HEIGHT 480
#define BACKFACE_EPSILON 0.01
char *strlwr (char *s); /* up / down */
#include "../../client/header/ref.h"
#include "qgl.h"
#define REF_VERSION "OpenGL 1.4"
// up / down
#define PITCH 0 #define PITCH 0
// left / right /* left / right */
#define YAW 1 #define YAW 1
// fall over /* fall over */
#define ROLL 2 #define ROLL 2
#ifndef __VIDDEF_T #ifndef __VIDDEF_T
#define __VIDDEF_T #define __VIDDEF_T
typedef struct typedef struct
{ {
int width, height; // coordinates from main game int width, height; /* coordinates from main game */
} viddef_t; } viddef_t;
#endif #endif
char *strlwr ( char *s );
extern viddef_t vid; extern viddef_t vid;
/* /*
* skins will be outline flood filled and mip mapped
skins will be outline flood filled and mip mapped * pics and sprites with alpha will be outline flood filled
pics and sprites with alpha will be outline flood filled * pic won't be mip mapped
pic won't be mip mapped *
* model skin
model skin * sprite frame
sprite frame * wall texture
wall texture * pic
pic
*/ */
typedef enum typedef enum
{ {
it_skin, it_skin,
@ -82,32 +67,20 @@ typedef enum
typedef struct image_s typedef struct image_s
{ {
char name[MAX_QPATH]; // game path, including extension char name [ MAX_QPATH ]; /* game path, including extension */
imagetype_t type; imagetype_t type;
int width, height; // source image int width, height; /* source image */
int upload_width, upload_height; // after power of two and picmip int upload_width, upload_height; /* after power of two and picmip */
int registration_sequence; // 0 = free int registration_sequence; /* 0 = free */
struct msurface_s *texturechain; // for sort-by-texture world drawing struct msurface_s *texturechain; /* for sort-by-texture world drawing */
int texnum; // gl texture binding int texnum; /* gl texture binding */
float sl, tl, sh, th; // 0,0 - 1,1 unless part of the scrap float sl, tl, sh, th; /* 0,0 - 1,1 unless part of the scrap */
qboolean scrap; qboolean scrap;
qboolean has_alpha; qboolean has_alpha;
qboolean paletted; qboolean paletted;
} image_t; } image_t;
#define TEXNUM_LIGHTMAPS 1024
#define TEXNUM_SCRAPS 1152
#define TEXNUM_IMAGES 1153
#define MAX_GLTEXTURES 1024
#define MAX_SCRAPS 1
#define BLOCK_WIDTH 128
#define BLOCK_HEIGHT 128
//===================================================================
typedef enum typedef enum
{ {
rserr_ok, rserr_ok,
@ -135,15 +108,9 @@ typedef struct
float r, g, b; float r, g, b;
} glvert_t; } glvert_t;
#define MAX_LBM_HEIGHT 480
#define BACKFACE_EPSILON 0.01
//====================================================
extern image_t gltextures [ MAX_GLTEXTURES ]; extern image_t gltextures [ MAX_GLTEXTURES ];
extern int numgltextures; extern int numgltextures;
extern image_t *r_notexture; extern image_t *r_notexture;
extern image_t *r_particletexture; extern image_t *r_particletexture;
extern entity_t *currententity; extern entity_t *currententity;
@ -152,21 +119,15 @@ extern int r_visframecount;
extern int r_framecount; extern int r_framecount;
extern cplane_t frustum [ 4 ]; extern cplane_t frustum [ 4 ];
extern int c_brush_polys, c_alias_polys; extern int c_brush_polys, c_alias_polys;
extern int gl_filter_min, gl_filter_max; extern int gl_filter_min, gl_filter_max;
// /* view origin */
// view origin
//
extern vec3_t vup; extern vec3_t vup;
extern vec3_t vpn; extern vec3_t vpn;
extern vec3_t vright; extern vec3_t vright;
extern vec3_t r_origin; extern vec3_t r_origin;
// /* screen size info */
// screen size info
//
extern refdef_t r_newrefdef; extern refdef_t r_newrefdef;
extern int r_viewcluster, r_viewcluster2, r_oldviewcluster, r_oldviewcluster2; extern int r_viewcluster, r_viewcluster2, r_oldviewcluster, r_oldviewcluster2;
@ -180,7 +141,7 @@ extern cvar_t *r_novis;
extern cvar_t *r_nocull; extern cvar_t *r_nocull;
extern cvar_t *r_lerpmodels; extern cvar_t *r_lerpmodels;
extern cvar_t *r_lightlevel; // FIXME: This is a HACK to get the client's light level extern cvar_t *r_lightlevel;
extern cvar_t *gl_vertex_arrays; extern cvar_t *gl_vertex_arrays;
@ -258,17 +219,11 @@ void GL_TexEnv( GLenum value );
void R_LightPoint ( vec3_t p, vec3_t color ); void R_LightPoint ( vec3_t p, vec3_t color );
void R_PushDlights ( void ); void R_PushDlights ( void );
//====================================================================
extern model_t *r_worldmodel; extern model_t *r_worldmodel;
extern unsigned d_8to24table [ 256 ]; extern unsigned d_8to24table [ 256 ];
extern int registration_sequence; extern int registration_sequence;
void V_AddBlend ( float r, float g, float b, float a, float *v_blend ); void V_AddBlend ( float r, float g, float b, float a, float *v_blend );
int R_Init ( void *hinstance, void *hWnd ); int R_Init ( void *hinstance, void *hWnd );
void R_Shutdown ( void ); void R_Shutdown ( void );
@ -332,53 +287,12 @@ void GL_TextureAlphaMode( char *string );
void GL_TextureSolidMode ( char *string ); void GL_TextureSolidMode ( char *string );
int Scrap_AllocBlock ( int w, int h, int *x, int *y ); int Scrap_AllocBlock ( int w, int h, int *x, int *y );
/* /* GL extension emulation functions */
** GL extension emulation functions
*/
void GL_DrawParticles ( int n, const particle_t particles[], const unsigned colortable [ 768 ] ); void GL_DrawParticles ( int n, const particle_t particles[], const unsigned colortable [ 768 ] );
/* /*
** GL config stuff ** GL config stuff
*/ */
#define GL_RENDERER_VOODOO 0x00000001
#define GL_RENDERER_VOODOO2 0x00000002
#define GL_RENDERER_VOODOO_RUSH 0x00000004
#define GL_RENDERER_BANSHEE 0x00000008
#define GL_RENDERER_3DFX 0x0000000F
#define GL_RENDERER_PCX1 0x00000010
#define GL_RENDERER_PCX2 0x00000020
#define GL_RENDERER_PMX 0x00000040
#define GL_RENDERER_POWERVR 0x00000070
#define GL_RENDERER_PERMEDIA2 0x00000100
#define GL_RENDERER_GLINT_MX 0x00000200
#define GL_RENDERER_GLINT_TX 0x00000400
#define GL_RENDERER_3DLABS_MISC 0x00000800
#define GL_RENDERER_3DLABS 0x00000F00
#define GL_RENDERER_REALIZM 0x00001000
#define GL_RENDERER_REALIZM2 0x00002000
#define GL_RENDERER_INTERGRAPH 0x00003000
#define GL_RENDERER_3DPRO 0x00004000
#define GL_RENDERER_REAL3D 0x00008000
#define GL_RENDERER_RIVA128 0x00010000
#define GL_RENDERER_DYPIC 0x00020000
#define GL_RENDERER_V1000 0x00040000
#define GL_RENDERER_V2100 0x00080000
#define GL_RENDERER_V2200 0x00100000
#define GL_RENDERER_RENDITION 0x001C0000
#define GL_RENDERER_O2 0x00100000
#define GL_RENDERER_IMPACT 0x00200000
#define GL_RENDERER_RE 0x00400000
#define GL_RENDERER_IR 0x00800000
#define GL_RENDERER_SGI 0x00F00000
#define GL_RENDERER_MCD 0x01000000
#define GL_RENDERER_OTHER 0x80000000
typedef struct typedef struct
{ {
@ -417,25 +331,8 @@ typedef struct
extern glconfig_t gl_config; extern glconfig_t gl_config;
extern glstate_t gl_state; extern glstate_t gl_state;
/*
====================================================================
IMPORTED FUNCTIONS
====================================================================
*/
extern refimport_t ri; extern refimport_t ri;
/*
====================================================================
IMPLEMENTATION SPECIFIC FUNCTIONS
====================================================================
*/
void GLimp_BeginFrame ( float camera_separation ); void GLimp_BeginFrame ( float camera_separation );
void GLimp_EndFrame ( void ); void GLimp_EndFrame ( void );
int GLimp_Init ( void ); int GLimp_Init ( void );