Compare commits
9
Commits
bluaopti2
...
fixuphwbsp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90b4bce087 | ||
|
|
19a9c425ac | ||
|
|
81e502c21b | ||
|
|
11c6fc2cca | ||
|
|
dc2d1b4cd9 | ||
|
|
cfa0bb0405 | ||
|
|
b35a658249 | ||
|
|
ff41198bce | ||
|
|
0c58228c21 |
No files matched your search
+2664
-612
File diff suppressed because it is too large.
Load diff
@@ -119,7 +119,7 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
poly_t *planepoly; // the generated convex polygon
|
poly_t *planepoly; // the generated convex polygon
|
||||||
} extrasubsector_t;
|
} poly_subsector_t;
|
||||||
|
|
||||||
// Vanilla features
|
// Vanilla features
|
||||||
//#define USE_MODEL_NEXTFRAME
|
//#define USE_MODEL_NEXTFRAME
|
||||||
|
|||||||
@@ -52,10 +52,11 @@ void HWR_ObjectLightLevelPost(gl_vissprite_t *spr, const sector_t *sector, INT32
|
|||||||
// --------
|
// --------
|
||||||
// hw_bsp.c
|
// hw_bsp.c
|
||||||
// --------
|
// --------
|
||||||
extern extrasubsector_t *extrasubsectors;
|
extern poly_subsector_t *poly_subsectors;
|
||||||
extern size_t addsubsector;
|
extern size_t num_poly_subsector;
|
||||||
|
|
||||||
void HWR_FreeExtraSubsectors(void);
|
void HWR_Init_PolyPool(void);
|
||||||
|
void HWR_Free_PolyPool(void);
|
||||||
|
|
||||||
// --------
|
// --------
|
||||||
// hw_cache.c
|
// hw_cache.c
|
||||||
|
|||||||
+31
-16
@@ -128,7 +128,7 @@ ps_metric_t ps_hw_batchdrawtime = {};
|
|||||||
static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, boolean noencore, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags);
|
static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, boolean noencore, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags);
|
||||||
static void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
static void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||||
|
|
||||||
static void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap);
|
static void HWR_AddTransparentFloor(lumpnum_t lumpnum, poly_subsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap);
|
||||||
static void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, INT32 texnum, boolean noencore, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
static void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, INT32 texnum, boolean noencore, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||||
static void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
|
static void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
|
||||||
|
|
||||||
@@ -226,6 +226,17 @@ consvar_t cv_glanisotropicmode = {"gr_anisotropicmode", "1", CV_CALL|CV_SAVE, gl
|
|||||||
|
|
||||||
consvar_t cv_glsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_glsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
consvar_t cv_glpolytile = {"gr_polytile", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
CV_PossibleValue_t grpolyshape_cons_t[] = {
|
||||||
|
{0, "Subsector"},
|
||||||
|
{1, "Fat"},
|
||||||
|
{2, "Trim"},
|
||||||
|
{3, "NotConvex"},
|
||||||
|
{0, NULL}
|
||||||
|
};
|
||||||
|
consvar_t cv_glpolyshape = {"gr_polygon_shape", "Trim", CV_SAVE, grpolyshape_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_glbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_glbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_glwireframe = {"gr_wireframe", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_glwireframe = {"gr_wireframe", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
@@ -532,7 +543,7 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t
|
|||||||
|
|
||||||
// HWR_RenderPlane
|
// HWR_RenderPlane
|
||||||
// Render a floor or ceiling convex polygon
|
// Render a floor or ceiling convex polygon
|
||||||
static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, FBITFIELD PolyFlags, INT32 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap)
|
static void HWR_RenderPlane(subsector_t *subsector, poly_subsector_t *xsub, boolean isceiling, fixed_t fixedheight, FBITFIELD PolyFlags, INT32 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap)
|
||||||
{
|
{
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
FOutVector *v3d;
|
FOutVector *v3d;
|
||||||
@@ -2760,7 +2771,7 @@ static void HWR_AddPolyObjectPlanes(void)
|
|||||||
sector_t *polyobjsector;
|
sector_t *polyobjsector;
|
||||||
INT32 light = 0;
|
INT32 light = 0;
|
||||||
|
|
||||||
// Polyobject Planes need their own function for drawing because they don't have extrasubsectors by themselves
|
// Polyobject Planes need their own function for drawing because they don't have poly_subsectors by themselves
|
||||||
// It should be okay because polyobjects should always be convex anyway
|
// It should be okay because polyobjects should always be convex anyway
|
||||||
|
|
||||||
for (i = 0; i < numpolys; i++)
|
for (i = 0; i < numpolys; i++)
|
||||||
@@ -2890,9 +2901,9 @@ static void HWR_Subsector(size_t num)
|
|||||||
ffloor_t *rover;
|
ffloor_t *rover;
|
||||||
|
|
||||||
#ifdef PARANOIA //no risk while developing, enough debugging nights!
|
#ifdef PARANOIA //no risk while developing, enough debugging nights!
|
||||||
if (num >= addsubsector)
|
if (num >= num_poly_subsector)
|
||||||
I_Error("HWR_Subsector: ss %s with numss = %s, addss = %s\n",
|
I_Error("HWR_Subsector: ss %s with numss = %s, addss = %s\n",
|
||||||
sizeu1(num), sizeu2(numsubsectors), sizeu3(addsubsector));
|
sizeu1(num), sizeu2(numsubsectors), sizeu3(num_poly_subsector));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (num < numsubsectors)
|
if (num < numsubsectors)
|
||||||
@@ -2986,7 +2997,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
if (sub->validcount != validcount)
|
if (sub->validcount != validcount)
|
||||||
{
|
{
|
||||||
HWR_GetFlat(levelflats[gl_frontsector->floorpic].lumpnum, R_NoEncore(gl_frontsector, false));
|
HWR_GetFlat(levelflats[gl_frontsector->floorpic].lumpnum, R_NoEncore(gl_frontsector, false));
|
||||||
HWR_RenderPlane(sub, &extrasubsectors[num], false,
|
HWR_RenderPlane(sub, &poly_subsectors[num], false,
|
||||||
// Hack to make things continue to work around slopes.
|
// Hack to make things continue to work around slopes.
|
||||||
locFloorHeight == cullFloorHeight ? locFloorHeight : gl_frontsector->floorheight,
|
locFloorHeight == cullFloorHeight ? locFloorHeight : gl_frontsector->floorheight,
|
||||||
// We now return you to your regularly scheduled rendering.
|
// We now return you to your regularly scheduled rendering.
|
||||||
@@ -3002,7 +3013,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
if (sub->validcount != validcount)
|
if (sub->validcount != validcount)
|
||||||
{
|
{
|
||||||
HWR_GetFlat(levelflats[gl_frontsector->ceilingpic].lumpnum, R_NoEncore(gl_frontsector, true));
|
HWR_GetFlat(levelflats[gl_frontsector->ceilingpic].lumpnum, R_NoEncore(gl_frontsector, true));
|
||||||
HWR_RenderPlane(sub, &extrasubsectors[num], true,
|
HWR_RenderPlane(sub, &poly_subsectors[num], true,
|
||||||
// Hack to make things continue to work around slopes.
|
// Hack to make things continue to work around slopes.
|
||||||
locCeilingHeight == cullCeilingHeight ? locCeilingHeight : gl_frontsector->ceilingheight,
|
locCeilingHeight == cullCeilingHeight ? locCeilingHeight : gl_frontsector->ceilingheight,
|
||||||
// We now return you to your regularly scheduled rendering.
|
// We now return you to your regularly scheduled rendering.
|
||||||
@@ -3050,7 +3061,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
alpha = HWR_FogBlockAlpha(*gl_frontsector->lightlist[light].lightlevel, rover->master->frontsector->extra_colormap);
|
alpha = HWR_FogBlockAlpha(*gl_frontsector->lightlist[light].lightlevel, rover->master->frontsector->extra_colormap);
|
||||||
|
|
||||||
HWR_AddTransparentFloor(0,
|
HWR_AddTransparentFloor(0,
|
||||||
&extrasubsectors[num],
|
&poly_subsectors[num],
|
||||||
false,
|
false,
|
||||||
*rover->bottomheight,
|
*rover->bottomheight,
|
||||||
*gl_frontsector->lightlist[light].lightlevel,
|
*gl_frontsector->lightlist[light].lightlevel,
|
||||||
@@ -3062,7 +3073,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < bottomCullHeight));
|
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < bottomCullHeight));
|
||||||
|
|
||||||
HWR_AddTransparentFloor(levelflats[*rover->bottompic].lumpnum,
|
HWR_AddTransparentFloor(levelflats[*rover->bottompic].lumpnum,
|
||||||
&extrasubsectors[num],
|
&poly_subsectors[num],
|
||||||
false,
|
false,
|
||||||
*rover->bottomheight,
|
*rover->bottomheight,
|
||||||
*gl_frontsector->lightlist[light].lightlevel,
|
*gl_frontsector->lightlist[light].lightlevel,
|
||||||
@@ -3074,7 +3085,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
HWR_GetFlat(levelflats[*rover->bottompic].lumpnum, R_NoEncore(gl_frontsector, false));
|
HWR_GetFlat(levelflats[*rover->bottompic].lumpnum, R_NoEncore(gl_frontsector, false));
|
||||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < bottomCullHeight));
|
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < bottomCullHeight));
|
||||||
|
|
||||||
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, levelflats[*rover->bottompic].lumpnum,
|
HWR_RenderPlane(sub, &poly_subsectors[num], false, *rover->bottomheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, levelflats[*rover->bottompic].lumpnum,
|
||||||
rover->master->frontsector, 255, gl_frontsector->lightlist[light].extra_colormap);
|
rover->master->frontsector, 255, gl_frontsector->lightlist[light].extra_colormap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3096,7 +3107,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
alpha = HWR_FogBlockAlpha(*gl_frontsector->lightlist[light].lightlevel, rover->master->frontsector->extra_colormap);
|
alpha = HWR_FogBlockAlpha(*gl_frontsector->lightlist[light].lightlevel, rover->master->frontsector->extra_colormap);
|
||||||
|
|
||||||
HWR_AddTransparentFloor(0,
|
HWR_AddTransparentFloor(0,
|
||||||
&extrasubsectors[num],
|
&poly_subsectors[num],
|
||||||
true,
|
true,
|
||||||
*rover->topheight,
|
*rover->topheight,
|
||||||
*gl_frontsector->lightlist[light].lightlevel,
|
*gl_frontsector->lightlist[light].lightlevel,
|
||||||
@@ -3108,7 +3119,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < topCullHeight));
|
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < topCullHeight));
|
||||||
|
|
||||||
HWR_AddTransparentFloor(levelflats[*rover->toppic].lumpnum,
|
HWR_AddTransparentFloor(levelflats[*rover->toppic].lumpnum,
|
||||||
&extrasubsectors[num],
|
&poly_subsectors[num],
|
||||||
true,
|
true,
|
||||||
*rover->topheight,
|
*rover->topheight,
|
||||||
*gl_frontsector->lightlist[light].lightlevel,
|
*gl_frontsector->lightlist[light].lightlevel,
|
||||||
@@ -3120,7 +3131,7 @@ static void HWR_Subsector(size_t num)
|
|||||||
HWR_GetFlat(levelflats[*rover->toppic].lumpnum, R_NoEncore(gl_frontsector, true));
|
HWR_GetFlat(levelflats[*rover->toppic].lumpnum, R_NoEncore(gl_frontsector, true));
|
||||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < topCullHeight));
|
light = R_GetPlaneLight(gl_frontsector, centerHeight, (viewz < topCullHeight));
|
||||||
|
|
||||||
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, levelflats[*rover->toppic].lumpnum,
|
HWR_RenderPlane(sub, &poly_subsectors[num], true, *rover->topheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, levelflats[*rover->toppic].lumpnum,
|
||||||
rover->master->frontsector, 255, gl_frontsector->lightlist[light].extra_colormap);
|
rover->master->frontsector, 255, gl_frontsector->lightlist[light].extra_colormap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4200,7 +4211,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
extrasubsector_t *xsub;
|
poly_subsector_t *xsub;
|
||||||
boolean isceiling;
|
boolean isceiling;
|
||||||
fixed_t fixedheight;
|
fixed_t fixedheight;
|
||||||
INT32 lightlevel;
|
INT32 lightlevel;
|
||||||
@@ -4293,7 +4304,7 @@ static void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, I
|
|||||||
wallinfo->wallcolormap = wallcolormap;
|
wallinfo->wallcolormap = wallcolormap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap)
|
static void HWR_AddTransparentFloor(lumpnum_t lumpnum, poly_subsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap)
|
||||||
{
|
{
|
||||||
planeinfo_t *planeinfo = static_cast<planeinfo_t*>(HWR_CreateDrawNode(DRAWNODE_PLANE));
|
planeinfo_t *planeinfo = static_cast<planeinfo_t*>(HWR_CreateDrawNode(DRAWNODE_PLANE));
|
||||||
|
|
||||||
@@ -5850,6 +5861,8 @@ void HWR_AddCommands(void)
|
|||||||
CV_RegisterVar(&cv_glanisotropicmode);
|
CV_RegisterVar(&cv_glanisotropicmode);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_glsolvetjoin);
|
CV_RegisterVar(&cv_glsolvetjoin);
|
||||||
|
CV_RegisterVar(&cv_glpolytile);
|
||||||
|
CV_RegisterVar(&cv_glpolyshape);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_glbatching);
|
CV_RegisterVar(&cv_glbatching);
|
||||||
|
|
||||||
@@ -5878,6 +5891,8 @@ void HWR_Startup(void)
|
|||||||
CONS_Printf("HWR_Startup()...\n");
|
CONS_Printf("HWR_Startup()...\n");
|
||||||
textureformat = patchformat = GL_TEXFMT_RGBA;
|
textureformat = patchformat = GL_TEXFMT_RGBA;
|
||||||
|
|
||||||
|
HWR_Init_PolyPool();
|
||||||
|
|
||||||
HWR_InitMapTextures();
|
HWR_InitMapTextures();
|
||||||
HWR_InitMD2();
|
HWR_InitMD2();
|
||||||
|
|
||||||
@@ -5969,7 +5984,7 @@ static void COM_HWR_glinfo(void)
|
|||||||
void HWR_Shutdown(void)
|
void HWR_Shutdown(void)
|
||||||
{
|
{
|
||||||
CONS_Printf("HWR_Shutdown()\n");
|
CONS_Printf("HWR_Shutdown()\n");
|
||||||
HWR_FreeExtraSubsectors();
|
HWR_Free_PolyPool();
|
||||||
HWR_FreeMapTextures();
|
HWR_FreeMapTextures();
|
||||||
GL_FlushScreenTextures();
|
GL_FlushScreenTextures();
|
||||||
#ifdef USE_FBO_OGL
|
#ifdef USE_FBO_OGL
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ extern consvar_t cv_glsecbright;
|
|||||||
extern consvar_t cv_glfiltermode;
|
extern consvar_t cv_glfiltermode;
|
||||||
extern consvar_t cv_glanisotropicmode;
|
extern consvar_t cv_glanisotropicmode;
|
||||||
|
|
||||||
extern consvar_t cv_glsolvetjoin;
|
extern consvar_t cv_glsolvetjoin, cv_glpolytile, cv_glpolyshape;
|
||||||
|
|
||||||
extern consvar_t cv_glbatching;
|
extern consvar_t cv_glbatching;
|
||||||
|
|
||||||
|
|||||||
@@ -3008,7 +3008,6 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||||||
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
HWR_FreeExtraSubsectors();
|
|
||||||
// Create plane polygons.
|
// Create plane polygons.
|
||||||
HWR_LoadLevel(reloadinggamestate);
|
HWR_LoadLevel(reloadinggamestate);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user