mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-16 09:42:57 +00:00
Merge branch 'public_next'
This commit is contained in:
commit
cd3895f676
4 changed files with 42 additions and 20 deletions
|
@ -45,7 +45,7 @@
|
|||
#include "hw_md2.h"
|
||||
|
||||
#define R_FAKEFLOORS
|
||||
//#define HWPRECIP
|
||||
#define HWPRECIP
|
||||
#define SORTING
|
||||
//#define POLYSKY
|
||||
|
||||
|
@ -4401,7 +4401,6 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
|||
FOutVector *wv;
|
||||
GLPatch_t *gpatch; // sprite patch converted to hardware
|
||||
FSurfaceInfo Surf;
|
||||
sector_t *sector;
|
||||
|
||||
if (!spr->mobj)
|
||||
return;
|
||||
|
@ -4455,19 +4454,38 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
|||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
HWR_GetMappedPatch(gpatch, spr->colormap);
|
||||
|
||||
sector = spr->mobj->subsector->sector;
|
||||
|
||||
if (sector->ffloors)
|
||||
// colormap test
|
||||
{
|
||||
ffloor_t *caster = sector->lightlist[R_GetPlaneLight(sector, spr->mobj->z, false)].caster;
|
||||
sector = caster ? §ors[caster->secnum] : sector;
|
||||
sector_t *sector = spr->mobj->subsector->sector;
|
||||
UINT8 lightlevel = 255;
|
||||
extracolormap_t *colormap = sector->extra_colormap;
|
||||
|
||||
if (sector->numlights)
|
||||
{
|
||||
INT32 light;
|
||||
|
||||
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
|
||||
|
||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||
lightlevel = *sector->lightlist[light].lightlevel;
|
||||
|
||||
if (sector->lightlist[light].extra_colormap)
|
||||
colormap = sector->lightlist[light].extra_colormap;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||
lightlevel = sector->lightlevel;
|
||||
|
||||
if (sector->extra_colormap)
|
||||
colormap = sector->extra_colormap;
|
||||
}
|
||||
|
||||
// sprite lighting by modulating the RGB components
|
||||
if (sector->extra_colormap)
|
||||
Surf.FlatColor.rgba = HWR_Lighting(spr->sectorlight,sector->extra_colormap->rgba,sector->extra_colormap->fadergba, false, false);
|
||||
if (colormap)
|
||||
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
|
||||
else
|
||||
Surf.FlatColor.rgba = HWR_Lighting(spr->sectorlight,NORMALFOG,FADEFOG, false, false);
|
||||
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
|
||||
}
|
||||
|
||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
{
|
||||
|
@ -5295,6 +5313,11 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
//
|
||||
vis = HWR_NewVisSprite();
|
||||
vis->x1 = x1;
|
||||
#if 0
|
||||
vis->x2 = x2;
|
||||
#else
|
||||
(void)x2;
|
||||
#endif
|
||||
vis->x2 = tx;
|
||||
vis->tz = tz;
|
||||
vis->dispoffset = 0; // Monster Iestyn: 23/11/15: HARDWARE SUPPORT AT LAST
|
||||
|
@ -5307,7 +5330,6 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
// set top/bottom coords
|
||||
vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset) - gr_viewz;
|
||||
|
||||
vis->sectorlight = 0xff;
|
||||
vis->precip = true;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -452,7 +452,7 @@ void Command_RTeleport_f(void)
|
|||
else
|
||||
inty = 0;
|
||||
|
||||
ss = R_PointInSubsector(p->mo->x + intx*FRACUNIT, p->mo->y + inty*FRACUNIT);
|
||||
ss = R_IsPointInSubsector(p->mo->x + intx*FRACUNIT, p->mo->y + inty*FRACUNIT);
|
||||
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Not a valid location.\n"));
|
||||
|
|
|
@ -2262,14 +2262,13 @@ static void P_DoClimbing(player_t *player)
|
|||
fixed_t platy;
|
||||
subsector_t *glidesector;
|
||||
boolean climb = true;
|
||||
boolean onesided = ((player->lastsidehit != -1 && player->lastlinehit != -1) && !(lines[player->lastlinehit].backsector));
|
||||
|
||||
platx = P_ReturnThrustX(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||
platy = P_ReturnThrustY(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||
|
||||
glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy);
|
||||
glidesector = R_IsPointInSubsector(player->mo->x + platx, player->mo->y + platy);
|
||||
|
||||
if (onesided || glidesector->sector != player->mo->subsector->sector)
|
||||
if (!glidesector || glidesector->sector != player->mo->subsector->sector)
|
||||
{
|
||||
boolean floorclimb = false;
|
||||
boolean thrust = false;
|
||||
|
@ -2277,7 +2276,7 @@ static void P_DoClimbing(player_t *player)
|
|||
boolean skyclimber = false;
|
||||
fixed_t floorheight, ceilingheight; // ESLOPE
|
||||
|
||||
if (onesided)
|
||||
if (!glidesector)
|
||||
floorclimb = true;
|
||||
else
|
||||
{
|
||||
|
|
|
@ -771,7 +771,7 @@ subsector_t *R_PointInSubsector(fixed_t x, fixed_t y)
|
|||
}
|
||||
|
||||
//
|
||||
// R_IsPointInSubsector, same as above but returns 0 if not in subsector - this does not work in opengl because of polyvertex_t
|
||||
// R_IsPointInSubsector, same as above but returns 0 if not in subsector
|
||||
//
|
||||
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
|
||||
{
|
||||
|
@ -795,7 +795,8 @@ subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
|
|||
|
||||
ret = &subsectors[nodenum & ~NF_SUBSECTOR];
|
||||
for (i = 0; i < ret->numlines; i++)
|
||||
if (R_PointOnSegSide(x, y, &segs[ret->firstline + i]))
|
||||
//if (R_PointOnSegSide(x, y, &segs[ret->firstline + i])) -- breaks in ogl because polyvertex_t cast over vertex pointers
|
||||
if (P_PointOnLineSide(x, y, segs[ret->firstline + i].linedef) != segs[ret->firstline + i].side)
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue