|
|
1.1 ! root 1: // disable data conversion warnings ! 2: ! 3: #pragma warning(disable : 4244) // MIPS ! 4: #pragma warning(disable : 4136) // X86 ! 5: #pragma warning(disable : 4051) // ALPHA ! 6: ! 7: #include <windows.h> ! 8: ! 9: #include <gl\gl.h> ! 10: #include <gl\glu.h> ! 11: ! 12: void GL_BeginRendering (int *x, int *y, int *width, int *height); ! 13: void GL_EndRendering (void); ! 14: ! 15: ! 16: // Function prototypes for the Texture Object Extension routines ! 17: typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *, ! 18: const GLboolean *); ! 19: typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint); ! 20: typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *); ! 21: typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *); ! 22: typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint); ! 23: typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *, ! 24: const GLclampf *); ! 25: typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *); ! 26: ! 27: extern BINDTEXFUNCPTR bindTexFunc; ! 28: extern DELTEXFUNCPTR delTexFunc; ! 29: extern TEXSUBIMAGEPTR TexSubImage2DFunc; ! 30: ! 31: extern int texture_extension_number; ! 32: extern int texture_mode; ! 33: ! 34: extern float gldepthmin, gldepthmax; ! 35: ! 36: void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha, qboolean modulate); ! 37: void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha, qboolean modulate); ! 38: int GL_LoadTexture (char *identifier, int width, int height, byte *data, int mipmap, int alpha, int modulate); ! 39: int GL_FindTexture (char *identifier); ! 40: ! 41: typedef struct ! 42: { ! 43: float x, y, z; ! 44: float s, t; ! 45: float r, g, b; ! 46: } glvert_t; ! 47: ! 48: extern glvert_t glv; ! 49: ! 50: extern int glx, gly, glwidth, glheight; ! 51: ! 52: extern PROC glArrayElementEXT; ! 53: extern PROC glColorPointerEXT; ! 54: extern PROC glTexturePointerEXT; ! 55: extern PROC glVertexPointerEXT; ! 56: ! 57: ! 58: // r_local.h -- private refresh defs ! 59: ! 60: #define MAXALIASVERTS 2000 // TODO: tune this ! 61: ! 62: #define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0) ! 63: // normalizing factor so player model works out to about ! 64: // 1 pixel per triangle ! 65: #define MAX_LBM_HEIGHT 480 ! 66: ! 67: #define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf ! 68: ! 69: #define SKYSHIFT 7 ! 70: #define SKYSIZE (1 << SKYSHIFT) ! 71: #define SKYMASK (SKYSIZE - 1) ! 72: ! 73: #define BACKFACE_EPSILON 0.01 ! 74: ! 75: ! 76: void R_TimeRefresh_f (void); ! 77: void R_ReadPointFile_f (void); ! 78: texture_t *R_TextureAnimation (texture_t *base); ! 79: ! 80: typedef struct surfcache_s ! 81: { ! 82: struct surfcache_s *next; ! 83: struct surfcache_s **owner; // NULL is an empty chunk of memory ! 84: int lightadj[MAXLIGHTMAPS]; // checked for strobe flush ! 85: int dlight; ! 86: int size; // including header ! 87: unsigned width; ! 88: unsigned height; // DEBUG only needed for debug ! 89: float mipscale; ! 90: struct texture_s *texture; // checked for animating textures ! 91: byte data[4]; // width*height elements ! 92: } surfcache_t; ! 93: ! 94: ! 95: typedef struct ! 96: { ! 97: pixel_t *surfdat; // destination for generated surface ! 98: int rowbytes; // destination logical width in bytes ! 99: msurface_t *surf; // description for surface to generate ! 100: fixed8_t lightadj[MAXLIGHTMAPS]; ! 101: // adjust for lightmap levels for dynamic lighting ! 102: texture_t *texture; // corrected for animating textures ! 103: int surfmip; // mipmapped ratio of surface texels / world pixels ! 104: int surfwidth; // in mipmapped texels ! 105: int surfheight; // in mipmapped texels ! 106: } drawsurf_t; ! 107: ! 108: ! 109: typedef enum { ! 110: pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2 ! 111: } ptype_t; ! 112: ! 113: // !!! if this is changed, it must be changed in d_ifacea.h too !!! ! 114: typedef struct particle_s ! 115: { ! 116: // driver-usable fields ! 117: vec3_t org; ! 118: float color; ! 119: // drivers never touch the following fields ! 120: struct particle_s *next; ! 121: vec3_t vel; ! 122: float ramp; ! 123: float die; ! 124: ptype_t type; ! 125: } particle_t; ! 126: ! 127: ! 128: //==================================================== ! 129: ! 130: ! 131: extern entity_t r_worldentity; ! 132: extern qboolean r_cache_thrash; // compatability ! 133: extern vec3_t modelorg, r_entorigin; ! 134: extern entity_t *currententity; ! 135: extern int r_visframecount; // ??? what difs? ! 136: extern int r_framecount; ! 137: extern mplane_t frustum[4]; ! 138: extern int c_brush_polys, c_alias_polys; ! 139: ! 140: ! 141: // ! 142: // view origin ! 143: // ! 144: extern vec3_t vup; ! 145: extern vec3_t vpn; ! 146: extern vec3_t vright; ! 147: extern vec3_t r_origin; ! 148: ! 149: // ! 150: // screen size info ! 151: // ! 152: extern refdef_t r_refdef; ! 153: extern mleaf_t *r_viewleaf, *r_oldviewleaf; ! 154: extern texture_t *r_notexture_mip; ! 155: extern int d_lightstylevalue[256]; // 8.8 fraction of base light value ! 156: ! 157: extern qboolean envmap; ! 158: extern int currenttexture; ! 159: extern int particletexture; ! 160: extern int playertextures; ! 161: ! 162: extern int skytexturenum; // index in cl.loadmodel, not gl texture object ! 163: ! 164: extern cvar_t r_drawentities; ! 165: extern cvar_t r_drawworld; ! 166: extern cvar_t r_drawviewmodel; ! 167: extern cvar_t r_speeds; ! 168: extern cvar_t r_waterwarp; ! 169: extern cvar_t r_fullbright; ! 170: extern cvar_t r_lightmap; ! 171: extern cvar_t r_shadows; ! 172: extern cvar_t r_dynamic; ! 173: ! 174: extern cvar_t gl_clear; ! 175: extern cvar_t gl_cull; ! 176: extern cvar_t gl_poly; ! 177: extern cvar_t gl_texsort; ! 178: extern cvar_t gl_smoothmodels; ! 179: extern cvar_t gl_affinemodels; ! 180: extern cvar_t gl_fogblend; ! 181: extern cvar_t gl_polyblend; ! 182: extern cvar_t gl_keeptjunctions; ! 183: extern cvar_t gl_reporttjunctions; ! 184: ! 185: extern int gl_lightmap_format; ! 186: extern int gl_solid_format; ! 187: extern int gl_alpha_format; ! 188: ! 189: void R_TranslatePlayerSkin (int playernum); ! 190: void GL_Bind (int texnum);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.