Arkadi's mach64 patch

This commit is contained in:
Bill Currie 2003-02-06 21:47:33 +00:00
parent c46b58f4b5
commit 3ab4eb6545
4 changed files with 17 additions and 5 deletions

View File

@ -43,6 +43,8 @@ extern GLenum gl_mtex_enum;
extern float gldepthmin, gldepthmax;
extern int texture_extension_number;
extern qboolean gl_feature_mach64;
void GL_EndRendering (void);
void GL_BeginRendering (int *x, int *y, int *width, int *height);

View File

@ -28,7 +28,7 @@
# include "config.h"
#endif
static __attribute__ ((unused)) const char rcsid[] =
static __attribute__ ((unused)) const char rcsid[] =
"$Id$";
#ifdef HAVE_STRING_H
@ -51,6 +51,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/GL/funcs.h"
#include "QF/GL/qf_explosions.h"
#include "QF/GL/qf_textures.h"
#include "QF/GL/qf_vid.h"
#include "compat.h"
#include "r_cvar.h"
@ -85,6 +86,8 @@ particle_new (ptype_t type, int texnum, const vec3_t org, float scale,
return NULL;
}
*/
if(gl_feature_mach64 && type == pt_smokecloud && texnum == part_tex_smoke )
return;
part = &particles[numparticles++];
@ -1057,7 +1060,7 @@ R_TeleportSplash_ID (const vec3_t org)
VectorCopy (dir, pdir);
VectorNormalize (pdir);
rnd = rand ();
porg[0] = org[0] + i + (rnd & 3);
porg[1] = org[1] + j + ((rnd >> 2) & 3);

View File

@ -54,6 +54,7 @@ int part_tex_spark;
*/
int part_tex;
GLint part_tex_internal_format = 2;
static void
@ -67,7 +68,7 @@ GDT_InitParticleTexture (void)
qfglBindTexture (GL_TEXTURE_2D, part_tex);
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
qfglTexImage2D (GL_TEXTURE_2D, 0, 2, 64, 64, 0, GL_LUMINANCE_ALPHA,
qfglTexImage2D (GL_TEXTURE_2D, 0, part_tex_internal_format, 64, 64, 0, GL_LUMINANCE_ALPHA,
GL_UNSIGNED_BYTE, data);
}
@ -133,8 +134,7 @@ GDT_InitSmokeParticleTexture (void)
noise_plasma (&noise1[0][0], 32);
noise_diamondsquare (&noise2[0][0], 32, 4);
for (y = 0; y < 32; y++)
{
for (y = 0; y < 32; y++) {
dy2 = y - 16;
dy2 *= dy2;
for (x = 0; x < 32; x++) {
@ -159,6 +159,8 @@ GDT_InitSmokeParticleTexture (void)
void
GDT_Init (void)
{
if (gl_feature_mach64)
part_tex_internal_format = 4;
GDT_InitParticleTexture ();
GDT_InitDotParticleTexture ();
GDT_InitSparkParticleTexture ();

View File

@ -86,6 +86,8 @@ GLenum gl_mtex_enum = GL_TEXTURE0_ARB;
QF_glColorTableEXT qglColorTableEXT = NULL;
qboolean is8bit = false;
qboolean gl_feature_mach64 = false;
cvar_t *gl_multitexture;
cvar_t *gl_vaelements_max;
cvar_t *gl_screenshot_byte_swap;
@ -297,6 +299,9 @@ GL_Init_Common (void)
CheckMultiTextureExtensions ();
CheckVertexArraySize ();
if (strstr(gl_renderer, "Mesa DRI Mach64"))
gl_feature_mach64 = true;
}
void