mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
gr_ -> gl_
This commit is contained in:
parent
a739cb0da9
commit
5c5d907251
19 changed files with 767 additions and 767 deletions
|
@ -620,7 +620,7 @@ static void COM_ExecuteString(char *ptext)
|
|||
|
||||
// check cvars
|
||||
// Hurdler: added at Ebola's request ;)
|
||||
// (don't flood the console in software mode with bad gr_xxx command)
|
||||
// (don't flood the console in software mode with bad gl_xxx command)
|
||||
if (!CV_Command() && con_destlines)
|
||||
CONS_Printf(M_GetText("Unknown command '%s'\n"), COM_Argv(0));
|
||||
}
|
||||
|
|
|
@ -599,7 +599,7 @@ static void D_Display(void)
|
|||
snprintf(s, sizeof s - 1, "SysMiss %.2f%%", lostpercent);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-10, V_YELLOWMAP, s);
|
||||
}
|
||||
|
||||
|
||||
if (cv_renderstats.value)
|
||||
{
|
||||
char s[50];
|
||||
|
@ -608,7 +608,7 @@ static void D_Display(void)
|
|||
rs_prevframetime = I_GetTimeMicros();
|
||||
|
||||
if (rs_rendercalltime > 10000) divisor = 1000;
|
||||
|
||||
|
||||
snprintf(s, sizeof s - 1, "ft %d", frametime / divisor);
|
||||
V_DrawThinString(30, 10, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "rtot %d", rs_rendercalltime / divisor);
|
||||
|
@ -635,7 +635,7 @@ static void D_Display(void)
|
|||
V_DrawThinString(30, 70, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "fin %d", rs_swaptime / divisor);
|
||||
V_DrawThinString(30, 80, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
if (cv_grbatching.value)
|
||||
if (cv_glbatching.value)
|
||||
{
|
||||
snprintf(s, sizeof s - 1, "bsrt %d", rs_hw_batchsorttime / divisor);
|
||||
V_DrawThinString(80, 55, V_MONOSPACE | V_REDMAP, s);
|
||||
|
|
|
@ -250,7 +250,7 @@ void HWR_RenderBatches(void)
|
|||
|
||||
// sort polygons
|
||||
rs_hw_batchsorttime = I_GetTimeMicros();
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
qsort(polygonIndexArray, polygonArraySize, sizeof(unsigned int), comparePolygons);
|
||||
else
|
||||
qsort(polygonIndexArray, polygonArraySize, sizeof(unsigned int), comparePolygonsNoShaders);
|
||||
|
@ -272,8 +272,8 @@ void HWR_RenderBatches(void)
|
|||
// and a color array could replace the color calls.
|
||||
|
||||
// set state for first batch
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(currentShader);
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ void HWR_RenderBatches(void)
|
|||
nextSurfaceInfo = polygonArray[nextIndex].surf;
|
||||
if (nextPolyFlags & PF_NoTexture)
|
||||
nextTexture = 0;
|
||||
if (currentShader != nextShader && cv_grshaders.value && gr_shadersavailable)
|
||||
if (currentShader != nextShader && cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
changeState = true;
|
||||
changeShader = true;
|
||||
|
@ -370,7 +370,7 @@ void HWR_RenderBatches(void)
|
|||
changeState = true;
|
||||
changePolyFlags = true;
|
||||
}
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||
|
|
|
@ -61,17 +61,17 @@ static INT32 totalsubsecpolys = 0;
|
|||
/// \todo check out how much is used
|
||||
static size_t POLYPOOLSIZE = 1024000;
|
||||
|
||||
static UINT8 *gr_polypool = NULL;
|
||||
static UINT8 *gr_ppcurrent;
|
||||
static size_t gr_ppfree;
|
||||
static UINT8 *gl_polypool = NULL;
|
||||
static UINT8 *gl_ppcurrent;
|
||||
static size_t gl_ppfree;
|
||||
#endif
|
||||
|
||||
// only between levels, clear poly pool
|
||||
static void HWR_ClearPolys(void)
|
||||
{
|
||||
#ifndef ZPLANALLOC
|
||||
gr_ppcurrent = gr_polypool;
|
||||
gr_ppfree = POLYPOOLSIZE;
|
||||
gl_ppcurrent = gl_polypool;
|
||||
gl_ppfree = POLYPOOLSIZE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -86,8 +86,8 @@ void HWR_InitPolyPool(void)
|
|||
POLYPOOLSIZE = atoi(myargv[pnum+1])*1024; // (in kb)
|
||||
|
||||
CONS_Debug(DBG_RENDER, "HWR_InitPolyPool(): allocating %d bytes\n", POLYPOOLSIZE);
|
||||
gr_polypool = malloc(POLYPOOLSIZE);
|
||||
if (!gr_polypool)
|
||||
gl_polypool = malloc(POLYPOOLSIZE);
|
||||
if (!gl_polypool)
|
||||
I_Error("HWR_InitPolyPool(): couldn't malloc polypool\n");
|
||||
HWR_ClearPolys();
|
||||
#endif
|
||||
|
@ -96,9 +96,9 @@ void HWR_InitPolyPool(void)
|
|||
void HWR_FreePolyPool(void)
|
||||
{
|
||||
#ifndef ZPLANALLOC
|
||||
if (gr_polypool)
|
||||
free(gr_polypool);
|
||||
gr_polypool = NULL;
|
||||
if (gl_polypool)
|
||||
free(gl_polypool);
|
||||
gl_polypool = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -110,19 +110,19 @@ static poly_t *HWR_AllocPoly(INT32 numpts)
|
|||
p = Z_Malloc(size, PU_HWRPLANE, NULL);
|
||||
#else
|
||||
#ifdef PARANOIA
|
||||
if (!gr_polypool)
|
||||
I_Error("Used gr_polypool without init!\n");
|
||||
if (!gr_ppcurrent)
|
||||
I_Error("gr_ppcurrent == NULL!\n");
|
||||
if (!gl_polypool)
|
||||
I_Error("Used gl_polypool without init!\n");
|
||||
if (!gl_ppcurrent)
|
||||
I_Error("gl_ppcurrent == NULL!\n");
|
||||
#endif
|
||||
|
||||
if (gr_ppfree < size)
|
||||
if (gl_ppfree < size)
|
||||
I_Error("HWR_AllocPoly(): no more memory %u bytes left, %u bytes needed\n\n%s\n",
|
||||
gr_ppfree, size, "You can try the param -polypoolsize 2048 (or higher if needed)");
|
||||
gl_ppfree, size, "You can try the param -polypoolsize 2048 (or higher if needed)");
|
||||
|
||||
p = (poly_t *)gr_ppcurrent;
|
||||
gr_ppcurrent += size;
|
||||
gr_ppfree -= size;
|
||||
p = (poly_t *)gl_ppcurrent;
|
||||
gl_ppcurrent += size;
|
||||
gl_ppfree -= size;
|
||||
#endif
|
||||
p->numpts = numpts;
|
||||
return p;
|
||||
|
@ -135,13 +135,13 @@ static polyvertex_t *HWR_AllocVertex(void)
|
|||
#ifdef ZPLANALLOC
|
||||
p = Z_Malloc(size, PU_HWRPLANE, NULL);
|
||||
#else
|
||||
if (gr_ppfree < size)
|
||||
if (gl_ppfree < size)
|
||||
I_Error("HWR_AllocVertex(): no more memory %u bytes left, %u bytes needed\n\n%s\n",
|
||||
gr_ppfree, size, "You can try the param -polypoolsize 2048 (or higher if needed)");
|
||||
gl_ppfree, size, "You can try the param -polypoolsize 2048 (or higher if needed)");
|
||||
|
||||
p = (polyvertex_t *)gr_ppcurrent;
|
||||
gr_ppcurrent += size;
|
||||
gr_ppfree -= size;
|
||||
p = (polyvertex_t *)gl_ppcurrent;
|
||||
gl_ppcurrent += size;
|
||||
gl_ppfree -= size;
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ static INT32 SolveTProblem(void)
|
|||
INT32 i;
|
||||
size_t l;
|
||||
|
||||
if (cv_grsolvetjoin.value == 0)
|
||||
if (cv_glsolvetjoin.value == 0)
|
||||
return 0;
|
||||
|
||||
CONS_Debug(DBG_RENDER, "Solving T-joins. This may take a while. Please wait...\n");
|
||||
|
@ -983,9 +983,9 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
|||
I_Error("couldn't malloc extrasubsectors totsubsectors %s\n", sizeu1(totsubsectors));
|
||||
|
||||
// allocate table for back to front drawing of subsectors
|
||||
/*gr_drawsubsectors = (INT16 *)malloc(sizeof (*gr_drawsubsectors) * totsubsectors);
|
||||
if (!gr_drawsubsectors)
|
||||
I_Error("couldn't malloc gr_drawsubsectors\n");*/
|
||||
/*gl_drawsubsectors = (INT16 *)malloc(sizeof (*gl_drawsubsectors) * totsubsectors);
|
||||
if (!gl_drawsubsectors)
|
||||
I_Error("couldn't malloc gl_drawsubsectors\n");*/
|
||||
|
||||
// number of the first new subsector that might be added
|
||||
addsubsector = numsubsectors;
|
||||
|
|
|
@ -598,14 +598,14 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
|
|||
// CACHING HANDLING
|
||||
// =================================================
|
||||
|
||||
static size_t gr_numtextures = 0; // Texture count
|
||||
static GLMapTexture_t *gr_textures; // For all textures
|
||||
static GLMapTexture_t *gr_flats; // For all (texture) flats, as normal flats don't need to be cached
|
||||
static size_t gl_numtextures = 0; // Texture count
|
||||
static GLMapTexture_t *gl_textures; // For all textures
|
||||
static GLMapTexture_t *gl_flats; // For all (texture) flats, as normal flats don't need to be cached
|
||||
|
||||
void HWR_InitTextureCache(void)
|
||||
{
|
||||
gr_textures = NULL;
|
||||
gr_flats = NULL;
|
||||
gl_textures = NULL;
|
||||
gl_flats = NULL;
|
||||
}
|
||||
|
||||
// Callback function for HWR_FreeTextureCache.
|
||||
|
@ -673,13 +673,13 @@ void HWR_FreeTextureCache(void)
|
|||
|
||||
// now the heap don't have any 'user' pointing to our
|
||||
// texturecache info, we can free it
|
||||
if (gr_textures)
|
||||
free(gr_textures);
|
||||
if (gr_flats)
|
||||
free(gr_flats);
|
||||
gr_textures = NULL;
|
||||
gr_flats = NULL;
|
||||
gr_numtextures = 0;
|
||||
if (gl_textures)
|
||||
free(gl_textures);
|
||||
if (gl_flats)
|
||||
free(gl_flats);
|
||||
gl_textures = NULL;
|
||||
gl_flats = NULL;
|
||||
gl_numtextures = 0;
|
||||
}
|
||||
|
||||
void HWR_LoadTextures(size_t pnumtextures)
|
||||
|
@ -688,13 +688,13 @@ void HWR_LoadTextures(size_t pnumtextures)
|
|||
HWR_FreeTextureCache();
|
||||
|
||||
// Why not Z_Malloc?
|
||||
gr_numtextures = pnumtextures;
|
||||
gr_textures = calloc(gr_numtextures, sizeof(*gr_textures));
|
||||
gr_flats = calloc(gr_numtextures, sizeof(*gr_flats));
|
||||
gl_numtextures = pnumtextures;
|
||||
gl_textures = calloc(gl_numtextures, sizeof(*gl_textures));
|
||||
gl_flats = calloc(gl_numtextures, sizeof(*gl_flats));
|
||||
|
||||
// Doesn't tell you which it _is_, but hopefully
|
||||
// should never ever happen (right?!)
|
||||
if ((gr_textures == NULL) || (gr_flats == NULL))
|
||||
if ((gl_textures == NULL) || (gl_flats == NULL))
|
||||
I_Error("HWR_LoadTextures: ran out of memory for OpenGL textures. Sad!");
|
||||
}
|
||||
|
||||
|
@ -718,13 +718,13 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex)
|
|||
{
|
||||
GLMapTexture_t *grtex;
|
||||
#ifdef PARANOIA
|
||||
if ((unsigned)tex >= gr_numtextures)
|
||||
if ((unsigned)tex >= gl_numtextures)
|
||||
I_Error("HWR_GetTexture: tex >= numtextures\n");
|
||||
#endif
|
||||
|
||||
// Every texture in memory, stored in the
|
||||
// hardware renderer's bit depth format. Wow!
|
||||
grtex = &gr_textures[tex];
|
||||
grtex = &gl_textures[tex];
|
||||
|
||||
// Generate texture if missing from the cache
|
||||
if (!grtex->mipmap.data && !grtex->mipmap.downloaded)
|
||||
|
@ -836,7 +836,7 @@ void HWR_GetLevelFlat(levelflat_t *levelflat)
|
|||
GLMapTexture_t *grtex;
|
||||
INT32 texturenum = levelflat->u.texture.num;
|
||||
#ifdef PARANOIA
|
||||
if ((unsigned)texturenum >= gr_numtextures)
|
||||
if ((unsigned)texturenum >= gl_numtextures)
|
||||
I_Error("HWR_GetLevelFlat: texturenum >= numtextures\n");
|
||||
#endif
|
||||
|
||||
|
@ -845,7 +845,7 @@ void HWR_GetLevelFlat(levelflat_t *levelflat)
|
|||
return;
|
||||
|
||||
// Every texture in memory, stored as a 8-bit flat. Wow!
|
||||
grtex = &gr_flats[texturenum];
|
||||
grtex = &gl_flats[texturenum];
|
||||
|
||||
// Generate flat if missing from the cache
|
||||
if (!grtex->mipmap.data && !grtex->mipmap.downloaded)
|
||||
|
|
|
@ -936,17 +936,17 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
|||
INT32 basewindowx, basewindowy;
|
||||
GLPatch_t *patch;
|
||||
|
||||
// if (gr_viewwidth == vid.width)
|
||||
// if (gl_viewwidth == vid.width)
|
||||
// return;
|
||||
|
||||
if (!clearlines)
|
||||
clearlines = BASEVIDHEIGHT; // refresh all
|
||||
|
||||
// calc view size based on original game resolution
|
||||
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
||||
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_viewheight), vid.fdupy));
|
||||
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_baseviewwindowy), vid.fdupy));
|
||||
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_viewwindowx), vid.fdupx));
|
||||
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
||||
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdupy));
|
||||
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdupy));
|
||||
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwindowx), vid.fdupx));
|
||||
|
||||
// top
|
||||
HWR_DrawFlatFill(0, 0,
|
||||
|
|
|
@ -59,7 +59,7 @@ typedef struct
|
|||
|
||||
// needed for sprite rendering
|
||||
// equivalent of the software renderer's vissprites
|
||||
typedef struct gr_vissprite_s
|
||||
typedef struct gl_vissprite_s
|
||||
{
|
||||
float x1, x2;
|
||||
float tz, ty;
|
||||
|
@ -74,7 +74,7 @@ typedef struct gr_vissprite_s
|
|||
UINT8 *colormap;
|
||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||
float z1, z2;
|
||||
} gr_vissprite_t;
|
||||
} gl_vissprite_t;
|
||||
|
||||
// --------
|
||||
// hw_bsp.c
|
||||
|
|
|
@ -821,7 +821,7 @@ void HWR_WallLighting(FOutVector *wlVerts)
|
|||
{
|
||||
int i, j;
|
||||
|
||||
// dynlights->nb == 0 if cv_grdynamiclighting.value is not set
|
||||
// dynlights->nb == 0 if cv_gldynamiclighting.value is not set
|
||||
for (j = 0; j < dynlights->nb; j++)
|
||||
{
|
||||
FVector inter;
|
||||
|
@ -970,7 +970,7 @@ static lumpnum_t coronalumpnum = LUMPERROR;
|
|||
// --------------------------------------------------------------------------
|
||||
// coronas lighting
|
||||
// --------------------------------------------------------------------------
|
||||
void HWR_DoCoronasLighting(FOutVector *outVerts, gr_vissprite_t *spr)
|
||||
void HWR_DoCoronasLighting(FOutVector *outVerts, gl_vissprite_t *spr)
|
||||
{
|
||||
light_t *p_lspr;
|
||||
|
||||
|
@ -985,7 +985,7 @@ void HWR_DoCoronasLighting(FOutVector *outVerts, gr_vissprite_t *spr)
|
|||
p_lspr = &lspr[ROCKETEXP_L];
|
||||
}
|
||||
|
||||
if (cv_grcoronas.value && (p_lspr->type & CORONA_SPR))
|
||||
if (cv_glcoronas.value && (p_lspr->type & CORONA_SPR))
|
||||
{ // it's an object which emits light
|
||||
FOutVector light[4];
|
||||
FSurfaceInfo Surf;
|
||||
|
@ -1010,7 +1010,7 @@ void HWR_DoCoronasLighting(FOutVector *outVerts, gr_vissprite_t *spr)
|
|||
}
|
||||
if (size > p_lspr->corona_radius)
|
||||
size = p_lspr->corona_radius;
|
||||
size *= FIXED_TO_FLOAT(cv_grcoronasize.value<<1);
|
||||
size *= FIXED_TO_FLOAT(cv_glcoronasize.value<<1);
|
||||
|
||||
// compute position doing average
|
||||
for (i = 0; i < 4; i++)
|
||||
|
@ -1067,7 +1067,7 @@ void HWR_DrawCoronas(void)
|
|||
{
|
||||
int j;
|
||||
|
||||
if (!cv_grcoronas.value || dynlights->nb <= 0 || coronalumpnum == LUMPERROR)
|
||||
if (!cv_glcoronas.value || dynlights->nb <= 0 || coronalumpnum == LUMPERROR)
|
||||
return;
|
||||
|
||||
HWR_GetPic(coronalumpnum); /// \todo use different coronas
|
||||
|
@ -1121,7 +1121,7 @@ void HWR_DrawCoronas(void)
|
|||
}
|
||||
if (size > p_lspr->corona_radius)
|
||||
size = p_lspr->corona_radius;
|
||||
size = (float)(FIXED_TO_FLOAT(cv_grcoronasize.value<<1)*size);
|
||||
size = (float)(FIXED_TO_FLOAT(cv_glcoronasize.value<<1)*size);
|
||||
|
||||
// put light little forward the sprite so there is no
|
||||
// z-buffer problem (coplanar polygons)
|
||||
|
@ -1170,13 +1170,13 @@ void HWR_SetLights(int viewnumber)
|
|||
// Add a light for dynamic lighting
|
||||
// The light position is already transformed execpt for mlook
|
||||
// --------------------------------------------------------------------------
|
||||
void HWR_DL_AddLight(gr_vissprite_t *spr, GLPatch_t *patch)
|
||||
void HWR_DL_AddLight(gl_vissprite_t *spr, GLPatch_t *patch)
|
||||
{
|
||||
light_t *p_lspr;
|
||||
|
||||
//Hurdler: moved here because it's better;-)
|
||||
(void)patch;
|
||||
if (!cv_grdynamiclighting.value)
|
||||
if (!cv_gldynamiclighting.value)
|
||||
return;
|
||||
|
||||
if (!spr->mobj)
|
||||
|
@ -1193,7 +1193,7 @@ void HWR_DL_AddLight(gr_vissprite_t *spr, GLPatch_t *patch)
|
|||
p_lspr = t_lspr[spr->mobj->sprite];
|
||||
if (!(p_lspr->type & DYNLIGHT_SPR))
|
||||
return;
|
||||
if ((p_lspr->type != LIGHT_SPR) || cv_grstaticlighting.value)
|
||||
if ((p_lspr->type != LIGHT_SPR) || cv_glstaticlighting.value)
|
||||
return;
|
||||
|
||||
LIGHT_POS(dynlights->nb).x = FIXED_TO_FLOAT(spr->mobj->x);
|
||||
|
@ -1265,8 +1265,8 @@ static void HWR_SetLight(void)
|
|||
|
||||
#ifdef STATICLIGHT
|
||||
// is this really necessary?
|
||||
static sector_t *lgr_backsector;
|
||||
static seg_t *lgr_curline;
|
||||
static sector_t *lgl_backsector;
|
||||
static seg_t *lgl_curline;
|
||||
#endif
|
||||
|
||||
// p1 et p2 c'est le deux bou du seg en float
|
||||
|
@ -1304,27 +1304,27 @@ static void HWR_AddLightMapForLine(int lightnum, seg_t *line)
|
|||
*/
|
||||
FVector p1,p2;
|
||||
|
||||
lgr_curline = line;
|
||||
lgr_backsector = line->backsector;
|
||||
lgl_curline = line;
|
||||
lgl_backsector = line->backsector;
|
||||
|
||||
// Reject empty lines used for triggers and special events.
|
||||
// Identical floor and ceiling on both sides,
|
||||
// identical light levels on both sides,
|
||||
// and no middle texture.
|
||||
/*
|
||||
if ( lgr_backsector->ceilingpic == gr_frontsector->ceilingpic
|
||||
&& lgr_backsector->floorpic == gr_frontsector->floorpic
|
||||
&& lgr_backsector->lightlevel == gr_frontsector->lightlevel
|
||||
&& lgr_curline->sidedef->midtexture == 0)
|
||||
if ( lgl_backsector->ceilingpic == gl_frontsector->ceilingpic
|
||||
&& lgl_backsector->floorpic == gl_frontsector->floorpic
|
||||
&& lgl_backsector->lightlevel == gl_frontsector->lightlevel
|
||||
&& lgl_curline->sidedef->midtexture == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
p1.y = FIXED_TO_FLOAT(lgr_curline->v1->y);
|
||||
p1.x = FIXED_TO_FLOAT(lgr_curline->v1->x);
|
||||
p2.y = FIXED_TO_FLOAT(lgr_curline->v2->y);
|
||||
p2.x = FIXED_TO_FLOAT(lgr_curline->v2->x);
|
||||
p1.y = FIXED_TO_FLOAT(lgl_curline->v1->y);
|
||||
p1.x = FIXED_TO_FLOAT(lgl_curline->v1->x);
|
||||
p2.y = FIXED_TO_FLOAT(lgl_curline->v2->y);
|
||||
p2.x = FIXED_TO_FLOAT(lgl_curline->v2->x);
|
||||
|
||||
// check bbox of the seg
|
||||
// if (CircleTouchBBox(&p1, &p2, &LIGHT_POS(lightnum), DL_RADIUS(lightnum))==false)
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#define DL_MAX_LIGHT 256 // maximum number of lights (extra lights are ignored)
|
||||
|
||||
void HWR_InitLight(void);
|
||||
void HWR_DL_AddLight(gr_vissprite_t *spr, GLPatch_t *patch);
|
||||
void HWR_DL_AddLight(gl_vissprite_t *spr, GLPatch_t *patch);
|
||||
void HWR_PlaneLighting(FOutVector *clVerts, int nrClipVerts);
|
||||
void HWR_WallLighting(FOutVector *wlVerts);
|
||||
void HWR_ResetLights(void);
|
||||
|
@ -33,7 +33,7 @@ void HWR_SetLights(int viewnumber);
|
|||
#ifdef NEWCORONAS
|
||||
void HWR_DrawCoronas(void);
|
||||
#else
|
||||
void HWR_DoCoronasLighting(FOutVector *outVerts, gr_vissprite_t *spr);
|
||||
void HWR_DoCoronasLighting(FOutVector *outVerts, gl_vissprite_t *spr);
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -75,32 +75,32 @@ boolean HWR_LoadShaders(void);
|
|||
extern CV_PossibleValue_t granisotropicmode_cons_t[];
|
||||
|
||||
#ifdef ALAM_LIGHTING
|
||||
extern consvar_t cv_grdynamiclighting;
|
||||
extern consvar_t cv_grstaticlighting;
|
||||
extern consvar_t cv_grcoronas;
|
||||
extern consvar_t cv_grcoronasize;
|
||||
extern consvar_t cv_gldynamiclighting;
|
||||
extern consvar_t cv_glstaticlighting;
|
||||
extern consvar_t cv_glcoronas;
|
||||
extern consvar_t cv_glcoronasize;
|
||||
#endif
|
||||
|
||||
extern consvar_t cv_grshaders;
|
||||
extern consvar_t cv_grmodels;
|
||||
extern consvar_t cv_grmodelinterpolation;
|
||||
extern consvar_t cv_grmodellighting;
|
||||
extern consvar_t cv_grfiltermode;
|
||||
extern consvar_t cv_granisotropicmode;
|
||||
extern consvar_t cv_grcorrecttricks;
|
||||
extern consvar_t cv_glshaders;
|
||||
extern consvar_t cv_glmodels;
|
||||
extern consvar_t cv_glmodelinterpolation;
|
||||
extern consvar_t cv_glmodellighting;
|
||||
extern consvar_t cv_glfiltermode;
|
||||
extern consvar_t cv_glanisotropicmode;
|
||||
extern consvar_t cv_glcorrecttricks;
|
||||
extern consvar_t cv_fovchange;
|
||||
extern consvar_t cv_grsolvetjoin;
|
||||
extern consvar_t cv_grshearing;
|
||||
extern consvar_t cv_grspritebillboarding;
|
||||
extern consvar_t cv_grskydome;
|
||||
extern consvar_t cv_grfakecontrast;
|
||||
extern consvar_t cv_grslopecontrast;
|
||||
extern consvar_t cv_glsolvetjoin;
|
||||
extern consvar_t cv_glshearing;
|
||||
extern consvar_t cv_glspritebillboarding;
|
||||
extern consvar_t cv_glskydome;
|
||||
extern consvar_t cv_glfakecontrast;
|
||||
extern consvar_t cv_glslopecontrast;
|
||||
|
||||
extern consvar_t cv_grbatching;
|
||||
extern consvar_t cv_glbatching;
|
||||
|
||||
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowy;
|
||||
extern float gl_viewwidth, gl_viewheight, gl_baseviewwindowy;
|
||||
|
||||
extern float gr_viewwindowx, gr_basewindowcentery;
|
||||
extern float gl_viewwindowx, gl_basewindowcentery;
|
||||
|
||||
// BP: big hack for a test in lighting ref : 1249753487AB
|
||||
extern fixed_t *hwbbox;
|
||||
|
@ -124,6 +124,6 @@ extern int rs_hw_numcolors;
|
|||
extern int rs_hw_batchsorttime;
|
||||
extern int rs_hw_batchdrawtime;
|
||||
|
||||
extern boolean gr_shadersavailable;
|
||||
extern boolean gl_shadersavailable;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1108,14 +1108,14 @@ static boolean HWR_AllowModel(mobj_t *mobj)
|
|||
|
||||
static boolean HWR_CanInterpolateModel(mobj_t *mobj, model_t *model)
|
||||
{
|
||||
if (cv_grmodelinterpolation.value == 2) // Always interpolate
|
||||
if (cv_glmodelinterpolation.value == 2) // Always interpolate
|
||||
return true;
|
||||
return model->interpolate[(mobj->frame & FF_FRAMEMASK)];
|
||||
}
|
||||
|
||||
static boolean HWR_CanInterpolateSprite2(modelspr2frames_t *spr2frame)
|
||||
{
|
||||
if (cv_grmodelinterpolation.value == 2) // Always interpolate
|
||||
if (cv_glmodelinterpolation.value == 2) // Always interpolate
|
||||
return true;
|
||||
return spr2frame->interpolate;
|
||||
}
|
||||
|
@ -1181,7 +1181,7 @@ static UINT8 HWR_GetModelSprite2(md2_t *md2, skin_t *skin, UINT8 spr2, player_t
|
|||
// HWR_DrawModel
|
||||
//
|
||||
|
||||
boolean HWR_DrawModel(gr_vissprite_t *spr)
|
||||
boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||
{
|
||||
md2_t *md2;
|
||||
|
||||
|
@ -1192,7 +1192,7 @@ boolean HWR_DrawModel(gr_vissprite_t *spr)
|
|||
FTransform p;
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
if (!cv_grmodels.value)
|
||||
if (!cv_glmodels.value)
|
||||
return false;
|
||||
|
||||
if (spr->precip)
|
||||
|
@ -1388,7 +1388,7 @@ boolean HWR_DrawModel(gr_vissprite_t *spr)
|
|||
|
||||
#ifdef USE_MODEL_NEXTFRAME
|
||||
#define INTERPOLERATION_LIMIT TICRATE/4
|
||||
if (cv_grmodelinterpolation.value && tics <= durs && tics <= INTERPOLERATION_LIMIT)
|
||||
if (cv_glmodelinterpolation.value && tics <= durs && tics <= INTERPOLERATION_LIMIT)
|
||||
{
|
||||
if (durs > INTERPOLERATION_LIMIT)
|
||||
durs = INTERPOLERATION_LIMIT;
|
||||
|
|
|
@ -42,7 +42,7 @@ extern md2_t md2_playermodels[MAXSKINS];
|
|||
void HWR_InitModels(void);
|
||||
void HWR_AddPlayerModel(INT32 skin);
|
||||
void HWR_AddSpriteModel(size_t spritenum);
|
||||
boolean HWR_DrawModel(gr_vissprite_t *spr);
|
||||
boolean HWR_DrawModel(gl_vissprite_t *spr);
|
||||
|
||||
#define PLAYERMODELPREFIX "PLAYER"
|
||||
|
||||
|
|
|
@ -739,7 +739,7 @@ void HWR_CorrectSWTricks(void)
|
|||
sector_t **sectorList;
|
||||
sector_t *outSector;
|
||||
|
||||
if ((0 == cv_grcorrecttricks.value))
|
||||
if ((0 == cv_glcorrecttricks.value))
|
||||
return;
|
||||
|
||||
// determine lines for sectors
|
||||
|
|
|
@ -58,8 +58,8 @@ static GLuint tex_downloaded = 0;
|
|||
static GLfloat fov = 90.0f;
|
||||
static FBITFIELD CurrentPolyFlags;
|
||||
|
||||
static FTextureInfo *gr_cachetail = NULL;
|
||||
static FTextureInfo *gr_cachehead = NULL;
|
||||
static FTextureInfo *gl_cachetail = NULL;
|
||||
static FTextureInfo *gl_cachehead = NULL;
|
||||
|
||||
RGBA_t myPaletteData[256];
|
||||
GLint screen_width = 0; // used by Draw2DLine()
|
||||
|
@ -1200,7 +1200,7 @@ void SetModelView(GLint w, GLint h)
|
|||
pglLoadIdentity();
|
||||
|
||||
GLPerspective(fov, ASPECT_RATIO);
|
||||
//pglScalef(1.0f, 320.0f/200.0f, 1.0f); // gr_scalefrustum (ORIGINAL_ASPECT)
|
||||
//pglScalef(1.0f, 320.0f/200.0f, 1.0f); // gl_scalefrustum (ORIGINAL_ASPECT)
|
||||
|
||||
// added for new coronas' code (without depth buffer)
|
||||
pglGetIntegerv(GL_VIEWPORT, viewport);
|
||||
|
@ -1277,14 +1277,14 @@ void Flush(void)
|
|||
{
|
||||
//GL_DBG_Printf ("HWR_Flush()\n");
|
||||
|
||||
while (gr_cachehead)
|
||||
while (gl_cachehead)
|
||||
{
|
||||
if (gr_cachehead->downloaded)
|
||||
pglDeleteTextures(1, (GLuint *)&gr_cachehead->downloaded);
|
||||
gr_cachehead->downloaded = 0;
|
||||
gr_cachehead = gr_cachehead->nextmipmap;
|
||||
if (gl_cachehead->downloaded)
|
||||
pglDeleteTextures(1, (GLuint *)&gl_cachehead->downloaded);
|
||||
gl_cachehead->downloaded = 0;
|
||||
gl_cachehead = gl_cachehead->nextmipmap;
|
||||
}
|
||||
gr_cachetail = gr_cachehead = NULL; //Hurdler: well, gr_cachehead is already NULL
|
||||
gl_cachetail = gl_cachehead = NULL; //Hurdler: well, gl_cachehead is already NULL
|
||||
|
||||
tex_downloaded = 0;
|
||||
}
|
||||
|
@ -1860,13 +1860,13 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
{
|
||||
UpdateTexture(pTexInfo);
|
||||
pTexInfo->nextmipmap = NULL;
|
||||
if (gr_cachetail)
|
||||
if (gl_cachetail)
|
||||
{ // insertion at the tail
|
||||
gr_cachetail->nextmipmap = pTexInfo;
|
||||
gr_cachetail = pTexInfo;
|
||||
gl_cachetail->nextmipmap = pTexInfo;
|
||||
gl_cachetail = pTexInfo;
|
||||
}
|
||||
else // initialization of the linked list
|
||||
gr_cachetail = gr_cachehead = pTexInfo;
|
||||
gl_cachetail = gl_cachehead = pTexInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2959,7 +2959,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
|
|||
|
||||
EXPORT INT32 HWRAPI(GetTextureUsed) (void)
|
||||
{
|
||||
FTextureInfo *tmp = gr_cachehead;
|
||||
FTextureInfo *tmp = gl_cachehead;
|
||||
INT32 res = 0;
|
||||
|
||||
while (tmp)
|
||||
|
|
|
@ -1880,7 +1880,7 @@ static inline void HU_DrawCrosshair(void)
|
|||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y = (INT32)gr_basewindowcentery;
|
||||
y = (INT32)gl_basewindowcentery;
|
||||
else
|
||||
#endif
|
||||
y = viewwindowy + (viewheight>>1);
|
||||
|
@ -1901,7 +1901,7 @@ static inline void HU_DrawCrosshair2(void)
|
|||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y = (INT32)gr_basewindowcentery;
|
||||
y = (INT32)gl_basewindowcentery;
|
||||
else
|
||||
#endif
|
||||
y = viewwindowy + (viewheight>>1);
|
||||
|
@ -1910,7 +1910,7 @@ static inline void HU_DrawCrosshair2(void)
|
|||
{
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y += (INT32)gr_viewheight;
|
||||
y += (INT32)gl_viewheight;
|
||||
else
|
||||
#endif
|
||||
y += viewheight;
|
||||
|
|
28
src/m_menu.c
28
src/m_menu.c
|
@ -1446,19 +1446,19 @@ static menuitem_t OP_ColorOptionsMenu[] =
|
|||
static menuitem_t OP_OpenGLOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "3D Models", NULL, 0},
|
||||
{IT_STRING|IT_CVAR, NULL, "Models", &cv_grmodels, 12},
|
||||
{IT_STRING|IT_CVAR, NULL, "Frame interpolation", &cv_grmodelinterpolation, 22},
|
||||
{IT_STRING|IT_CVAR, NULL, "Ambient lighting", &cv_grmodellighting, 32},
|
||||
{IT_STRING|IT_CVAR, NULL, "Models", &cv_glmodels, 12},
|
||||
{IT_STRING|IT_CVAR, NULL, "Frame interpolation", &cv_glmodelinterpolation, 22},
|
||||
{IT_STRING|IT_CVAR, NULL, "Ambient lighting", &cv_glmodellighting, 32},
|
||||
|
||||
{IT_HEADER, NULL, "General", NULL, 51},
|
||||
{IT_STRING|IT_CVAR, NULL, "Shaders", &cv_grshaders, 63},
|
||||
{IT_STRING|IT_CVAR, NULL, "Lack of perspective", &cv_grshearing, 73},
|
||||
{IT_STRING|IT_CVAR, NULL, "Shaders", &cv_glshaders, 63},
|
||||
{IT_STRING|IT_CVAR, NULL, "Lack of perspective", &cv_glshearing, 73},
|
||||
{IT_STRING|IT_CVAR, NULL, "Field of view", &cv_fov, 83},
|
||||
|
||||
{IT_HEADER, NULL, "Miscellaneous", NULL, 102},
|
||||
{IT_STRING|IT_CVAR, NULL, "Bit depth", &cv_scr_depth, 114},
|
||||
{IT_STRING|IT_CVAR, NULL, "Texture filter", &cv_grfiltermode, 124},
|
||||
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode, 134},
|
||||
{IT_STRING|IT_CVAR, NULL, "Texture filter", &cv_glfiltermode, 124},
|
||||
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_glanisotropicmode, 134},
|
||||
#ifdef ALAM_LIGHTING
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Lighting...", &OP_OpenGLLightingDef, 144},
|
||||
#endif
|
||||
|
@ -1470,10 +1470,10 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
|
|||
#ifdef ALAM_LIGHTING
|
||||
static menuitem_t OP_OpenGLLightingMenu[] =
|
||||
{
|
||||
{IT_STRING|IT_CVAR, NULL, "Coronas", &cv_grcoronas, 0},
|
||||
{IT_STRING|IT_CVAR, NULL, "Coronas size", &cv_grcoronasize, 10},
|
||||
{IT_STRING|IT_CVAR, NULL, "Dynamic lighting", &cv_grdynamiclighting, 20},
|
||||
{IT_STRING|IT_CVAR, NULL, "Static lighting", &cv_grstaticlighting, 30},
|
||||
{IT_STRING|IT_CVAR, NULL, "Coronas", &cv_glcoronas, 0},
|
||||
{IT_STRING|IT_CVAR, NULL, "Coronas size", &cv_glcoronasize, 10},
|
||||
{IT_STRING|IT_CVAR, NULL, "Dynamic lighting", &cv_gldynamiclighting, 20},
|
||||
{IT_STRING|IT_CVAR, NULL, "Static lighting", &cv_glstaticlighting, 30},
|
||||
};
|
||||
#endif // ALAM_LIGHTING
|
||||
|
||||
|
@ -2306,9 +2306,9 @@ void Nextmap_OnChange(void)
|
|||
// Check if file exists, if not, disable REPLAY option
|
||||
sprintf(tabase,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s",srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), skins[cv_chooseskin.value-1].name);
|
||||
|
||||
#ifdef OLDNREPLAYNAME
|
||||
#ifdef OLDNREPLAYNAME
|
||||
sprintf(tabaseold,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s",srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
SP_NightsReplayMenu[i].status = IT_DISABLED;
|
||||
|
@ -2336,7 +2336,7 @@ void Nextmap_OnChange(void)
|
|||
active = true;
|
||||
}
|
||||
|
||||
// Old style name compatibility
|
||||
// Old style name compatibility
|
||||
#ifdef OLDNREPLAYNAME
|
||||
if (FIL_FileExists(va("%s-score-best.lmp", tabaseold))) {
|
||||
SP_NightsReplayMenu[0].status = IT_WHITESTRING|IT_CALL;
|
||||
|
|
|
@ -10042,7 +10042,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
if (camorbit) //Sev here, I'm guessing this is where orbital cam lives
|
||||
{
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl && !cv_grshearing.value)
|
||||
if (rendermode == render_opengl && !cv_glshearing.value)
|
||||
distxy = FixedMul(dist, FINECOSINE((focusaiming>>ANGLETOFINESHIFT) & FINEMASK));
|
||||
else
|
||||
#endif
|
||||
|
|
|
@ -1064,7 +1064,7 @@ static void R_SetupFreelook(void)
|
|||
// (lmps, network and use F12...)
|
||||
if (rendermode == render_soft
|
||||
#ifdef HWRENDER
|
||||
|| cv_grshearing.value
|
||||
|| cv_glshearing.value
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue