mirror of
https://git.code.sf.net/p/quake/nuq
synced 2025-01-31 13:40:50 +00:00
port over gl_draw.c from newtree
This commit is contained in:
parent
c1e78e5021
commit
103918c7a4
19 changed files with 563 additions and 427 deletions
|
@ -34,7 +34,7 @@
|
|||
extern qpic_t *draw_disc; // also used on sbar
|
||||
|
||||
void Draw_Init (void);
|
||||
void Draw_Character (int x, int y, int num);
|
||||
void Draw_Character8 (int x, int y, int num);
|
||||
void Draw_DebugChar (char num);
|
||||
void Draw_Pic (int x, int y, qpic_t *pic);
|
||||
void Draw_TransPic (int x, int y, qpic_t *pic);
|
||||
|
@ -45,7 +45,7 @@ void Draw_EndDisc (void);
|
|||
void Draw_TileClear (int x, int y, int w, int h);
|
||||
void Draw_Fill (int x, int y, int w, int h, int c);
|
||||
void Draw_FadeScreen (void);
|
||||
void Draw_String (int x, int y, char *str);
|
||||
void Draw_String8 (int x, int y, char *str);
|
||||
qpic_t *Draw_PicFromWad (char *name);
|
||||
qpic_t *Draw_CachePic (char *path);
|
||||
|
||||
|
|
|
@ -70,12 +70,12 @@ extern TEXSUBIMAGEPTR TexSubImage2DFunc;
|
|||
|
||||
extern int texture_extension_number;
|
||||
extern int texture_mode;
|
||||
extern int gl_mtex_enum;
|
||||
|
||||
extern float gldepthmin, gldepthmax;
|
||||
|
||||
void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha, int bytesperpixel);
|
||||
int GL_FindTexture (char *identifier);
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -321,7 +321,6 @@ void R_PrintTimes (void);
|
|||
void R_PrintDSpeeds (void);
|
||||
void R_AnimateLight (void);
|
||||
int R_LightPoint (vec3_t p);
|
||||
void R_SetupFrame (void);
|
||||
void R_cshift_f (void);
|
||||
void R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1);
|
||||
void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip);
|
||||
|
|
|
@ -524,7 +524,7 @@ void Con_DrawInput (void)
|
|||
y = con_vislines-16;
|
||||
|
||||
for (i=0 ; i<con_linewidth ; i++)
|
||||
Draw_Character ( (i+1)<<3, con_vislines - 16, text[i]);
|
||||
Draw_Character8 ( (i+1)<<3, con_vislines - 16, text[i]);
|
||||
|
||||
// remove cursor
|
||||
key_lines[edit_line][key_linepos] = 0;
|
||||
|
@ -563,7 +563,7 @@ void Con_DrawNotify (void)
|
|||
scr_copytop = 1;
|
||||
|
||||
for (x = 0 ; x < con_linewidth ; x++)
|
||||
Draw_Character ( (x+1)<<3, v, text[x]);
|
||||
Draw_Character8 ( (x+1)<<3, v, text[x]);
|
||||
|
||||
v += 8;
|
||||
}
|
||||
|
@ -576,13 +576,13 @@ void Con_DrawNotify (void)
|
|||
|
||||
x = 0;
|
||||
|
||||
Draw_String (8, v, "say:");
|
||||
Draw_String8 (8, v, "say:");
|
||||
while(chat_buffer[x])
|
||||
{
|
||||
Draw_Character ( (x+5)<<3, v, chat_buffer[x]);
|
||||
Draw_Character8 ( (x+5)<<3, v, chat_buffer[x]);
|
||||
x++;
|
||||
}
|
||||
Draw_Character ( (x+5)<<3, v, 10+((int)(realtime*con_cursorspeed)&1));
|
||||
Draw_Character8 ( (x+5)<<3, v, 10+((int)(realtime*con_cursorspeed)&1));
|
||||
v += 8;
|
||||
}
|
||||
|
||||
|
@ -625,7 +625,7 @@ void Con_DrawConsole (int lines, qboolean drawinput)
|
|||
text = con_text + (j % con_totallines)*con_linewidth;
|
||||
|
||||
for (x=0 ; x<con_linewidth ; x++)
|
||||
Draw_Character ( (x+1)<<3, y, text[x]);
|
||||
Draw_Character8 ( (x+1)<<3, y, text[x]);
|
||||
}
|
||||
|
||||
// draw the input prompt, user text, and cursor if desired
|
||||
|
|
|
@ -138,14 +138,14 @@ void Draw_Init (void)
|
|||
|
||||
/*
|
||||
================
|
||||
Draw_Character
|
||||
Draw_Character8
|
||||
|
||||
Draws one 8*8 graphics character with 0 being transparent.
|
||||
It can be clipped to the top of the screen to allow the console to be
|
||||
smoothly scrolled off.
|
||||
================
|
||||
*/
|
||||
void Draw_Character (int x, int y, int num)
|
||||
void Draw_Character8 (int x, int y, int num)
|
||||
{
|
||||
byte *dest;
|
||||
byte *source;
|
||||
|
@ -238,14 +238,14 @@ void Draw_Character (int x, int y, int num)
|
|||
|
||||
/*
|
||||
================
|
||||
Draw_String
|
||||
Draw_String8
|
||||
================
|
||||
*/
|
||||
void Draw_String (int x, int y, char *str)
|
||||
void Draw_String8 (int x, int y, char *str)
|
||||
{
|
||||
while (*str)
|
||||
{
|
||||
Draw_Character (x, y, *str);
|
||||
Draw_Character8 (x, y, *str);
|
||||
str++;
|
||||
x += 8;
|
||||
}
|
||||
|
|
821
source/gl_draw.c
821
source/gl_draw.c
File diff suppressed because it is too large
Load diff
|
@ -403,7 +403,7 @@ void Mod_LoadTextures (lump_t *l)
|
|||
else
|
||||
{
|
||||
texture_mode = GL_LINEAR_MIPMAP_NEAREST; //_LINEAR;
|
||||
tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx+1), true, false);
|
||||
tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx+1), true, false, 1);
|
||||
texture_mode = GL_LINEAR;
|
||||
}
|
||||
}
|
||||
|
@ -1458,7 +1458,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
pheader->gl_texturenum[i][2] =
|
||||
pheader->gl_texturenum[i][3] =
|
||||
GL_LoadTexture (name, pheader->skinwidth,
|
||||
pheader->skinheight, (byte *)(pskintype + 1), true, false);
|
||||
pheader->skinheight, (byte *)(pskintype + 1), true, false, 1);
|
||||
pskintype = (daliasskintype_t *)((byte *)(pskintype+1) + s);
|
||||
} else {
|
||||
// animating skin group. yuck.
|
||||
|
@ -1480,7 +1480,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
sprintf (name, "%s_%i_%i", loadmodel->name, i,j);
|
||||
pheader->gl_texturenum[i][j&3] =
|
||||
GL_LoadTexture (name, pheader->skinwidth,
|
||||
pheader->skinheight, (byte *)(pskintype), true, false);
|
||||
pheader->skinheight, (byte *)(pskintype), true, false, 1);
|
||||
pskintype = (daliasskintype_t *)((byte *)(pskintype) + s);
|
||||
}
|
||||
k = j;
|
||||
|
@ -1696,7 +1696,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum)
|
|||
pspriteframe->right = width + origin[0];
|
||||
|
||||
sprintf (name, "%s_%i", loadmodel->name, framenum);
|
||||
pspriteframe->gl_texturenum = GL_LoadTexture (name, width, height, (byte *)(pinframe + 1), true, true);
|
||||
pspriteframe->gl_texturenum = GL_LoadTexture (name, width, height, (byte *)(pinframe + 1), true, true, 1);
|
||||
|
||||
return (void *)((byte *)pinframe + sizeof (dspriteframe_t) + size);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ void R_DrawParticles (void)
|
|||
vec3_t up, right;
|
||||
float scale;
|
||||
|
||||
GL_Bind(particletexture);
|
||||
glBindTexture (GL_TEXTURE_2D, particletexture);
|
||||
glEnable (GL_BLEND);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glBegin (GL_TRIANGLES);
|
||||
|
|
|
@ -240,7 +240,7 @@ void R_DrawSpriteModel (entity_t *e)
|
|||
|
||||
GL_DisableMultitexture();
|
||||
|
||||
GL_Bind(frame->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, frame->gl_texturenum);
|
||||
|
||||
glEnable (GL_ALPHA_TEST);
|
||||
glBegin (GL_QUADS);
|
||||
|
@ -552,7 +552,7 @@ void R_DrawAliasModel (entity_t *e)
|
|||
}
|
||||
|
||||
anim = (int)(cl.time*10) & 3;
|
||||
GL_Bind(paliashdr->gl_texturenum[currententity->skinnum][anim]);
|
||||
glBindTexture (GL_TEXTURE_2D, paliashdr->gl_texturenum[currententity->skinnum][anim]);
|
||||
|
||||
// we can't dynamically colormap textures, so they are cached
|
||||
// seperately for the players. Heads are just uncolored.
|
||||
|
@ -560,7 +560,7 @@ void R_DrawAliasModel (entity_t *e)
|
|||
{
|
||||
i = currententity - cl_entities;
|
||||
if (i >= 1 && i<=cl.maxclients /* && !strcmp (currententity->model->name, "progs/player.mdl") */)
|
||||
GL_Bind(playertextures - 1 + i);
|
||||
glBindTexture (GL_TEXTURE_2D, playertextures - 1 + i);
|
||||
}
|
||||
|
||||
if (gl_smoothmodels->value)
|
||||
|
|
|
@ -89,7 +89,7 @@ void R_InitParticleTexture (void)
|
|||
// particle texture
|
||||
//
|
||||
particletexture = texture_extension_number++;
|
||||
GL_Bind(particletexture);
|
||||
glBindTexture (GL_TEXTURE_2D, particletexture);
|
||||
|
||||
for (x=0 ; x<8 ; x++)
|
||||
{
|
||||
|
@ -303,7 +303,7 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
|
||||
// because this happens during gameplay, do it fast
|
||||
// instead of sending it through gl_upload 8
|
||||
GL_Bind(playertextures + playernum);
|
||||
glBindTexture (GL_TEXTURE_2D, playertextures + playernum);
|
||||
|
||||
#if 0
|
||||
byte translated[320*200];
|
||||
|
|
|
@ -344,7 +344,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
p = s->polys;
|
||||
|
||||
t = R_TextureAnimation (s->texinfo->texture);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
glBegin (GL_POLYGON);
|
||||
v = p->verts[0];
|
||||
for (i=0 ; i<p->numverts ; i++, v+= VERTEXSIZE)
|
||||
|
@ -354,7 +354,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
}
|
||||
glEnd ();
|
||||
|
||||
GL_Bind (lightmap_textures + s->lightmaptexturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures + s->lightmaptexturenum);
|
||||
glEnable (GL_BLEND);
|
||||
glBegin (GL_POLYGON);
|
||||
v = p->verts[0];
|
||||
|
@ -375,7 +375,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
//
|
||||
if (s->flags & SURF_DRAWTURB)
|
||||
{
|
||||
GL_Bind (s->texinfo->texture->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, s->texinfo->texture->gl_texturenum);
|
||||
EmitWaterPolys (s);
|
||||
return;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
//
|
||||
if (s->flags & SURF_DRAWSKY)
|
||||
{
|
||||
GL_Bind (solidskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, solidskytexture);
|
||||
speedscale = realtime*8;
|
||||
speedscale -= (int)speedscale;
|
||||
|
||||
|
@ -393,7 +393,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
|
||||
glEnable (GL_BLEND);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL_Bind (alphaskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
|
||||
speedscale = realtime*16;
|
||||
speedscale -= (int)speedscale;
|
||||
EmitSkyPolys (s);
|
||||
|
@ -409,10 +409,10 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
p = s->polys;
|
||||
|
||||
t = R_TextureAnimation (s->texinfo->texture);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
DrawGLWaterPoly (p);
|
||||
|
||||
GL_Bind (lightmap_textures + s->lightmaptexturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures + s->lightmaptexturenum);
|
||||
glEnable (GL_BLEND);
|
||||
DrawGLWaterPolyLightmap (p);
|
||||
glDisable (GL_BLEND);
|
||||
|
@ -448,11 +448,11 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
t = R_TextureAnimation (s->texinfo->texture);
|
||||
// Binds world to texture env 0
|
||||
GL_SelectTexture(TEXTURE0_SGIS);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
// Binds lightmap to texenv 1
|
||||
GL_EnableMultitexture(); // Same as SelectTexture (TEXTURE1)
|
||||
GL_Bind (lightmap_textures + s->lightmaptexturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures + s->lightmaptexturenum);
|
||||
i = s->lightmaptexturenum;
|
||||
if (lightmap_modified[i])
|
||||
{
|
||||
|
@ -481,7 +481,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
p = s->polys;
|
||||
|
||||
t = R_TextureAnimation (s->texinfo->texture);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
glBegin (GL_POLYGON);
|
||||
v = p->verts[0];
|
||||
for (i=0 ; i<p->numverts ; i++, v+= VERTEXSIZE)
|
||||
|
@ -491,7 +491,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
}
|
||||
glEnd ();
|
||||
|
||||
GL_Bind (lightmap_textures + s->lightmaptexturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures + s->lightmaptexturenum);
|
||||
glEnable (GL_BLEND);
|
||||
glBegin (GL_POLYGON);
|
||||
v = p->verts[0];
|
||||
|
@ -515,7 +515,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
if (s->flags & SURF_DRAWTURB)
|
||||
{
|
||||
GL_DisableMultitexture();
|
||||
GL_Bind (s->texinfo->texture->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, s->texinfo->texture->gl_texturenum);
|
||||
EmitWaterPolys (s);
|
||||
return;
|
||||
}
|
||||
|
@ -526,14 +526,14 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
if (s->flags & SURF_DRAWSKY)
|
||||
{
|
||||
GL_DisableMultitexture();
|
||||
GL_Bind (solidskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, solidskytexture);
|
||||
speedscale = realtime*8;
|
||||
speedscale -= (int)speedscale & ~127;
|
||||
|
||||
EmitSkyPolys (s);
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
GL_Bind (alphaskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
|
||||
speedscale = realtime*16;
|
||||
speedscale -= (int)speedscale & ~127;
|
||||
EmitSkyPolys (s);
|
||||
|
@ -551,10 +551,10 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
|
||||
t = R_TextureAnimation (s->texinfo->texture);
|
||||
GL_SelectTexture(TEXTURE0_SGIS);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
GL_EnableMultitexture();
|
||||
GL_Bind (lightmap_textures + s->lightmaptexturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures + s->lightmaptexturenum);
|
||||
i = s->lightmaptexturenum;
|
||||
if (lightmap_modified[i])
|
||||
{
|
||||
|
@ -588,10 +588,10 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
p = s->polys;
|
||||
|
||||
t = R_TextureAnimation (s->texinfo->texture);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
DrawGLWaterPoly (p);
|
||||
|
||||
GL_Bind (lightmap_textures + s->lightmaptexturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures + s->lightmaptexturenum);
|
||||
glEnable (GL_BLEND);
|
||||
DrawGLWaterPolyLightmap (p);
|
||||
glDisable (GL_BLEND);
|
||||
|
@ -712,7 +712,7 @@ void R_BlendLightmaps (void)
|
|||
p = lightmap_polys[i];
|
||||
if (!p)
|
||||
continue;
|
||||
GL_Bind(lightmap_textures+i);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures+i);
|
||||
if (lightmap_modified[i])
|
||||
{
|
||||
lightmap_modified[i] = false;
|
||||
|
@ -783,7 +783,7 @@ void R_RenderBrushPoly (msurface_t *fa)
|
|||
}
|
||||
|
||||
t = R_TextureAnimation (fa->texinfo->texture);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
|
||||
if (fa->flags & SURF_DRAWTURB)
|
||||
{ // warp texture, no lightmaps
|
||||
|
@ -946,7 +946,7 @@ void R_DrawWaterSurfaces (void)
|
|||
continue;
|
||||
|
||||
// set modulate mode explicitly
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
|
||||
for ( ; s ; s=s->texturechain)
|
||||
R_RenderBrushPoly (s);
|
||||
|
@ -991,7 +991,7 @@ void R_DrawWaterSurfaces (void)
|
|||
return;
|
||||
|
||||
for ( s = waterchain ; s ; s=s->texturechain) {
|
||||
GL_Bind (s->texinfo->texture->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, s->texinfo->texture->gl_texturenum);
|
||||
EmitWaterPolys (s);
|
||||
}
|
||||
|
||||
|
@ -1011,7 +1011,7 @@ void R_DrawWaterSurfaces (void)
|
|||
|
||||
// set modulate mode explicitly
|
||||
|
||||
GL_Bind (t->gl_texturenum);
|
||||
glBindTexture (GL_TEXTURE_2D, t->gl_texturenum);
|
||||
|
||||
for ( ; s ; s=s->texturechain)
|
||||
EmitWaterPolys (s);
|
||||
|
@ -1679,7 +1679,7 @@ void GL_BuildLightmaps (void)
|
|||
lightmap_rectchange[i].t = BLOCK_HEIGHT;
|
||||
lightmap_rectchange[i].w = 0;
|
||||
lightmap_rectchange[i].h = 0;
|
||||
GL_Bind(lightmap_textures + i);
|
||||
glBindTexture (GL_TEXTURE_2D, lightmap_textures + i);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes
|
||||
|
|
|
@ -215,7 +215,7 @@ void SCR_DrawCenterString (void)
|
|||
x = (vid.width - l*8)/2;
|
||||
for (j=0 ; j<l ; j++, x+=8)
|
||||
{
|
||||
Draw_Character (x, y, start[j]);
|
||||
Draw_Character8 (x, y, start[j]);
|
||||
if (!remaining--)
|
||||
return;
|
||||
}
|
||||
|
@ -738,7 +738,7 @@ void SCR_DrawNotifyString (void)
|
|||
break;
|
||||
x = (vid.width - l*8)/2;
|
||||
for (j=0 ; j<l ; j++, x+=8)
|
||||
Draw_Character (x, y, start[j]);
|
||||
Draw_Character8 (x, y, start[j]);
|
||||
|
||||
y += 8;
|
||||
|
||||
|
@ -927,7 +927,7 @@ void SCR_UpdateScreen (void)
|
|||
else
|
||||
{
|
||||
if (crosshair->value)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2, scr_vrect.y + scr_vrect.height/2, '+');
|
||||
Draw_Character8 (scr_vrect.x + scr_vrect.width/2, scr_vrect.y + scr_vrect.height/2, '+');
|
||||
|
||||
SCR_DrawRam ();
|
||||
SCR_DrawNet ();
|
||||
|
|
|
@ -285,14 +285,14 @@ void EmitBothSkyLayers (msurface_t *fa)
|
|||
{
|
||||
GL_DisableMultitexture();
|
||||
|
||||
GL_Bind (solidskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, solidskytexture);
|
||||
speedscale = realtime*8;
|
||||
speedscale -= (int)speedscale & ~127 ;
|
||||
|
||||
EmitSkyPolys (fa);
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
GL_Bind (alphaskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
|
||||
speedscale = realtime*16;
|
||||
speedscale -= (int)speedscale & ~127 ;
|
||||
|
||||
|
@ -314,7 +314,7 @@ void R_DrawSkyChain (msurface_t *s)
|
|||
GL_DisableMultitexture();
|
||||
|
||||
// used when gl_texsort is on
|
||||
GL_Bind(solidskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, solidskytexture);
|
||||
speedscale = realtime*8;
|
||||
speedscale -= (int)speedscale & ~127 ;
|
||||
|
||||
|
@ -322,7 +322,7 @@ void R_DrawSkyChain (msurface_t *s)
|
|||
EmitSkyPolys (fa);
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
GL_Bind (alphaskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
|
||||
speedscale = realtime*16;
|
||||
speedscale -= (int)speedscale & ~127 ;
|
||||
|
||||
|
@ -653,7 +653,7 @@ void R_LoadSkys (void)
|
|||
|
||||
for (i=0 ; i<6 ; i++)
|
||||
{
|
||||
GL_Bind (SKY_TEX + i);
|
||||
glBindTexture (GL_TEXTURE_2D, SKY_TEX + i);
|
||||
sprintf (name, "gfx/env/bkgtst%s.tga", suf[i]);
|
||||
COM_FOpenFile (name, &f);
|
||||
if (!f)
|
||||
|
@ -907,7 +907,7 @@ void R_DrawSkyChain (msurface_t *s)
|
|||
glpoly_t *p;
|
||||
|
||||
c_sky = 0;
|
||||
GL_Bind(solidskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, solidskytexture);
|
||||
|
||||
// calculate vertex values for sky box
|
||||
|
||||
|
@ -1003,7 +1003,7 @@ glDisable (GL_DEPTH_TEST);
|
|||
|| skymins[1][i] >= skymaxs[1][i])
|
||||
continue;
|
||||
|
||||
GL_Bind (SKY_TEX+skytexorder[i]);
|
||||
glBindTexture (GL_TEXTURE_2D, SKY_TEX+skytexorder[i]);
|
||||
#if 0
|
||||
skymins[0][i] = -1;
|
||||
skymins[1][i] = -1;
|
||||
|
@ -1071,7 +1071,7 @@ void R_InitSky (texture_t *mt)
|
|||
|
||||
if (!solidskytexture)
|
||||
solidskytexture = texture_extension_number++;
|
||||
GL_Bind (solidskytexture );
|
||||
glBindTexture (GL_TEXTURE_2D, solidskytexture );
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, trans);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
@ -1089,7 +1089,7 @@ void R_InitSky (texture_t *mt)
|
|||
|
||||
if (!alphaskytexture)
|
||||
alphaskytexture = texture_extension_number++;
|
||||
GL_Bind(alphaskytexture);
|
||||
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, trans);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
|
|
@ -137,7 +137,7 @@ Draws one solid graphics character
|
|||
*/
|
||||
void M_DrawCharacter (int cx, int line, int num)
|
||||
{
|
||||
Draw_Character ( cx + ((vid.width - 320)>>1), line, num);
|
||||
Draw_Character8 ( cx + ((vid.width - 320)>>1), line, num);
|
||||
}
|
||||
|
||||
void M_Print (int cx, int cy, char *str)
|
||||
|
|
|
@ -958,7 +958,7 @@ void R_EdgeDrawing (void)
|
|||
R_ScanEdges ();
|
||||
}
|
||||
|
||||
|
||||
void R_SetupFrame(void);
|
||||
/*
|
||||
================
|
||||
R_RenderView
|
||||
|
|
|
@ -76,6 +76,7 @@ cvar_t *v_ipitch_level;
|
|||
cvar_t *v_idlescale;
|
||||
|
||||
cvar_t *crosshair;
|
||||
cvar_t *crosshaircolor;
|
||||
cvar_t *cl_crossx;
|
||||
cvar_t *cl_crossy;
|
||||
|
||||
|
@ -825,6 +826,7 @@ void V_Init (void)
|
|||
|
||||
v_idlescale = Cvar_Get("v_idlescale", "0", CVAR_NONE, "None");
|
||||
crosshair = Cvar_Get("crosshair", "0", CVAR_ARCHIVE, "None");
|
||||
crosshaircolor = Cvar_Get("crosshaircolor", "79", CVAR_ARCHIVE, "None");
|
||||
cl_crossx = Cvar_Get("cl_crossx", "0", CVAR_NONE, "None");
|
||||
cl_crossy = Cvar_Get("cl_crossy", "0", CVAR_NONE, "None");
|
||||
gl_cshiftpercent = Cvar_Get("gl_cshiftpercent", "100", CVAR_NONE, "None");
|
||||
|
|
|
@ -306,9 +306,9 @@ Draws one solid graphics character
|
|||
void Sbar_DrawCharacter (int x, int y, int num)
|
||||
{
|
||||
if (cl.gametype == GAME_DEATHMATCH)
|
||||
Draw_Character ( x /*+ ((vid.width - 320)>>1) */ + 4 , y + vid.height-SBAR_HEIGHT, num);
|
||||
Draw_Character8 ( x /*+ ((vid.width - 320)>>1) */ + 4 , y + vid.height-SBAR_HEIGHT, num);
|
||||
else
|
||||
Draw_Character ( x + ((vid.width - 320)>>1) + 4 , y + vid.height-SBAR_HEIGHT, num);
|
||||
Draw_Character8 ( x + ((vid.width - 320)>>1) + 4 , y + vid.height-SBAR_HEIGHT, num);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -319,9 +319,9 @@ Sbar_DrawString
|
|||
void Sbar_DrawString (int x, int y, char *str)
|
||||
{
|
||||
if (cl.gametype == GAME_DEATHMATCH)
|
||||
Draw_String (x /*+ ((vid.width - 320)>>1)*/, y+ vid.height-SBAR_HEIGHT, str);
|
||||
Draw_String8 (x /*+ ((vid.width - 320)>>1)*/, y+ vid.height-SBAR_HEIGHT, str);
|
||||
else
|
||||
Draw_String (x + ((vid.width - 320)>>1), y+ vid.height-SBAR_HEIGHT, str);
|
||||
Draw_String8 (x + ((vid.width - 320)>>1), y+ vid.height-SBAR_HEIGHT, str);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1144,12 +1144,12 @@ void Sbar_DeathmatchOverlay (void)
|
|||
f = s->frags;
|
||||
sprintf (num, "%3i",f);
|
||||
|
||||
Draw_Character ( x+8 , y, num[0]);
|
||||
Draw_Character ( x+16 , y, num[1]);
|
||||
Draw_Character ( x+24 , y, num[2]);
|
||||
Draw_Character8 ( x+8 , y, num[0]);
|
||||
Draw_Character8 ( x+16 , y, num[1]);
|
||||
Draw_Character8 ( x+24 , y, num[2]);
|
||||
|
||||
if (k == cl.viewentity - 1)
|
||||
Draw_Character ( x - 8, y, 12);
|
||||
Draw_Character8 ( x - 8, y, 12);
|
||||
|
||||
#if 0
|
||||
{
|
||||
|
@ -1165,12 +1165,12 @@ void Sbar_DeathmatchOverlay (void)
|
|||
|
||||
sprintf (num, "%3i:%i%i", minutes, tens, units);
|
||||
|
||||
Draw_String ( x+48 , y, num);
|
||||
Draw_String8 ( x+48 , y, num);
|
||||
}
|
||||
#endif
|
||||
|
||||
// draw name
|
||||
Draw_String (x+64, y, s->name);
|
||||
Draw_String8 (x+64, y, s->name);
|
||||
|
||||
y += 10;
|
||||
}
|
||||
|
@ -1243,13 +1243,13 @@ void Sbar_MiniDeathmatchOverlay (void)
|
|||
f = s->frags;
|
||||
sprintf (num, "%3i",f);
|
||||
|
||||
Draw_Character ( x+8 , y, num[0]);
|
||||
Draw_Character ( x+16 , y, num[1]);
|
||||
Draw_Character ( x+24 , y, num[2]);
|
||||
Draw_Character8 ( x+8 , y, num[0]);
|
||||
Draw_Character8 ( x+16 , y, num[1]);
|
||||
Draw_Character8 ( x+24 , y, num[2]);
|
||||
|
||||
if (k == cl.viewentity - 1) {
|
||||
Draw_Character ( x, y, 16);
|
||||
Draw_Character ( x + 32, y, 17);
|
||||
Draw_Character8 ( x, y, 16);
|
||||
Draw_Character8 ( x + 32, y, 17);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -1266,12 +1266,12 @@ void Sbar_MiniDeathmatchOverlay (void)
|
|||
|
||||
sprintf (num, "%3i:%i%i", minutes, tens, units);
|
||||
|
||||
Draw_String ( x+48 , y, num);
|
||||
Draw_String8 ( x+48 , y, num);
|
||||
}
|
||||
#endif
|
||||
|
||||
// draw name
|
||||
Draw_String (x+48, y, s->name);
|
||||
Draw_String8 (x+48, y, s->name);
|
||||
|
||||
y += 8;
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ void SCR_DrawCenterString (void)
|
|||
x = (vid.width - l*8)/2;
|
||||
for (j=0 ; j<l ; j++, x+=8)
|
||||
{
|
||||
Draw_Character (x, y, start[j]);
|
||||
Draw_Character8 (x, y, start[j]);
|
||||
if (!remaining--)
|
||||
return;
|
||||
}
|
||||
|
@ -748,7 +748,7 @@ void SCR_DrawNotifyString (void)
|
|||
break;
|
||||
x = (vid.width - l*8)/2;
|
||||
for (j=0 ; j<l ; j++, x+=8)
|
||||
Draw_Character (x, y, start[j]);
|
||||
Draw_Character8 (x, y, start[j]);
|
||||
|
||||
y += 8;
|
||||
|
||||
|
|
|
@ -181,6 +181,6 @@ void V_RenderView (void)
|
|||
}
|
||||
|
||||
if (crosshair->value)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2 + cl_crossx->value,
|
||||
Draw_Character8 (scr_vrect.x + scr_vrect.width/2 + cl_crossx->value,
|
||||
scr_vrect.y + scr_vrect.height/2 + cl_crossy->value, '+');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue