mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Merge branch 'next' into public_next
This commit is contained in:
commit
93b6550186
4 changed files with 42 additions and 20 deletions
|
@ -45,7 +45,7 @@
|
||||||
#include "hw_md2.h"
|
#include "hw_md2.h"
|
||||||
|
|
||||||
#define R_FAKEFLOORS
|
#define R_FAKEFLOORS
|
||||||
//#define HWPRECIP
|
#define HWPRECIP
|
||||||
#define SORTING
|
#define SORTING
|
||||||
//#define POLYSKY
|
//#define POLYSKY
|
||||||
|
|
||||||
|
@ -4401,7 +4401,6 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
||||||
FOutVector *wv;
|
FOutVector *wv;
|
||||||
GLPatch_t *gpatch; // sprite patch converted to hardware
|
GLPatch_t *gpatch; // sprite patch converted to hardware
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
sector_t *sector;
|
|
||||||
|
|
||||||
if (!spr->mobj)
|
if (!spr->mobj)
|
||||||
return;
|
return;
|
||||||
|
@ -4455,19 +4454,38 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
||||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||||
HWR_GetMappedPatch(gpatch, spr->colormap);
|
HWR_GetMappedPatch(gpatch, spr->colormap);
|
||||||
|
|
||||||
sector = spr->mobj->subsector->sector;
|
// colormap test
|
||||||
|
|
||||||
if (sector->ffloors)
|
|
||||||
{
|
{
|
||||||
ffloor_t *caster = sector->lightlist[R_GetPlaneLight(sector, spr->mobj->z, false)].caster;
|
sector_t *sector = spr->mobj->subsector->sector;
|
||||||
sector = caster ? §ors[caster->secnum] : sector;
|
UINT8 lightlevel = 255;
|
||||||
}
|
extracolormap_t *colormap = sector->extra_colormap;
|
||||||
|
|
||||||
// sprite lighting by modulating the RGB components
|
if (sector->numlights)
|
||||||
if (sector->extra_colormap)
|
{
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(spr->sectorlight,sector->extra_colormap->rgba,sector->extra_colormap->fadergba, false, false);
|
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
|
else
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(spr->sectorlight,NORMALFOG,FADEFOG, false, false);
|
{
|
||||||
|
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||||
|
lightlevel = sector->lightlevel;
|
||||||
|
|
||||||
|
if (sector->extra_colormap)
|
||||||
|
colormap = sector->extra_colormap;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colormap)
|
||||||
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
|
||||||
|
else
|
||||||
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||||
{
|
{
|
||||||
|
@ -5289,6 +5307,11 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||||
//
|
//
|
||||||
vis = HWR_NewVisSprite();
|
vis = HWR_NewVisSprite();
|
||||||
vis->x1 = x1;
|
vis->x1 = x1;
|
||||||
|
#if 0
|
||||||
|
vis->x2 = x2;
|
||||||
|
#else
|
||||||
|
(void)x2;
|
||||||
|
#endif
|
||||||
vis->x2 = tx;
|
vis->x2 = tx;
|
||||||
vis->tz = tz;
|
vis->tz = tz;
|
||||||
vis->dispoffset = 0; // Monster Iestyn: 23/11/15: HARDWARE SUPPORT AT LAST
|
vis->dispoffset = 0; // Monster Iestyn: 23/11/15: HARDWARE SUPPORT AT LAST
|
||||||
|
@ -5301,7 +5324,6 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||||
// set top/bottom coords
|
// set top/bottom coords
|
||||||
vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset) - gr_viewz;
|
vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset) - gr_viewz;
|
||||||
|
|
||||||
vis->sectorlight = 0xff;
|
|
||||||
vis->precip = true;
|
vis->precip = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -452,7 +452,7 @@ void Command_RTeleport_f(void)
|
||||||
else
|
else
|
||||||
inty = 0;
|
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)
|
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("Not a valid location.\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("Not a valid location.\n"));
|
||||||
|
|
|
@ -2280,14 +2280,13 @@ static void P_DoClimbing(player_t *player)
|
||||||
fixed_t platy;
|
fixed_t platy;
|
||||||
subsector_t *glidesector;
|
subsector_t *glidesector;
|
||||||
boolean climb = true;
|
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));
|
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));
|
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 floorclimb = false;
|
||||||
boolean thrust = false;
|
boolean thrust = false;
|
||||||
|
@ -2295,7 +2294,7 @@ static void P_DoClimbing(player_t *player)
|
||||||
boolean skyclimber = false;
|
boolean skyclimber = false;
|
||||||
fixed_t floorheight, ceilingheight; // ESLOPE
|
fixed_t floorheight, ceilingheight; // ESLOPE
|
||||||
|
|
||||||
if (onesided)
|
if (!glidesector)
|
||||||
floorclimb = true;
|
floorclimb = true;
|
||||||
else
|
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)
|
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];
|
ret = &subsectors[nodenum & ~NF_SUBSECTOR];
|
||||||
for (i = 0; i < ret->numlines; i++)
|
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 0;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue