Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47ca4f4a56 | ||
|
|
2dd82d8588 | ||
|
|
29acd89586 |
No files matched your search
@@ -504,6 +504,13 @@ static UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap) // Let's
|
||||
return surfcolor.s.alpha;
|
||||
}
|
||||
|
||||
static boolean HWR_ApplyLightOffset(UINT8 baselightnum, const sector_t *sector)
|
||||
{
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
return P_ApplyLightOffset(baselightnum >> LIGHTSEGSHIFT, sector);
|
||||
return P_ApplyLightOffsetFine(baselightnum, sector);
|
||||
}
|
||||
|
||||
static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg, extracolormap_t *colormap)
|
||||
{
|
||||
INT16 finallight = lightnum;
|
||||
@@ -511,7 +518,7 @@ static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg, extracolormap_t *colo
|
||||
if (cv_glfakecontrast.value == 0 || (colormap && HWR_ShouldUsePaletteRendering()))
|
||||
return (FUINT)finallight;
|
||||
|
||||
if (seg != NULL && P_ApplyLightOffsetFine(lightnum, seg->frontsector))
|
||||
if (seg != NULL && HWR_ApplyLightOffset(lightnum, seg->frontsector))
|
||||
{
|
||||
const INT16 offset = (cv_glfakecontrast.value == 2) ? seg->hwLightOffset : ((INT16)seg->lightOffset * 8);
|
||||
|
||||
@@ -529,10 +536,9 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t
|
||||
if (cv_glfakecontrast.value == 0 || cv_glslopecontrast.value == 0)
|
||||
return (FUINT)finallight;
|
||||
|
||||
if (slope != NULL && sector != NULL && P_ApplyLightOffsetFine(lightnum, sector))
|
||||
if (slope != NULL && sector != NULL && HWR_ApplyLightOffset(lightnum, sector))
|
||||
{
|
||||
const INT16 offset = (cv_glfakecontrast.value == 2) ? slope->hwLightOffset : ((INT16)slope->lightOffset * 8);
|
||||
|
||||
finallight += (fof ? -offset : offset);
|
||||
finallight = CLAMP(finallight, 0, 255);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,11 @@
|
||||
// hand tuned adjustments for light level calculation
|
||||
#define GLSL_FLOOR_FUDGES \
|
||||
"#define STARTMAP_FUDGE 1.06\n" \
|
||||
"#define SCALE_FUDGE 1.15\n"
|
||||
"#ifdef SRB2_PALETTE_RENDERING\n" \
|
||||
"#define SCALE_FUDGE 1.3\n" \
|
||||
"#else\n" \
|
||||
"#define SCALE_FUDGE 1.15\n" \
|
||||
"#endif\n"
|
||||
|
||||
#define GLSL_WALL_FUDGES \
|
||||
"#define STARTMAP_FUDGE 1.05\n" \
|
||||
|
||||
+4
-34
@@ -752,14 +752,9 @@ static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr
|
||||
|
||||
static void SOCK_Send(void)
|
||||
{
|
||||
ssize_t c = ERRSOCKET;
|
||||
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
|
||||
size_t i, j;
|
||||
int retrycount = 0;
|
||||
ssize_t c;
|
||||
int e; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
|
||||
|
||||
retry:
|
||||
c = ERRSOCKET;
|
||||
e = 0;
|
||||
|
||||
if (doomcom->remotenode < 0 || !nodeconnected[doomcom->remotenode])
|
||||
return;
|
||||
@@ -813,35 +808,10 @@ retry:
|
||||
|
||||
if (c == ERRSOCKET && e != 0) // 0 means no socket for the address family was found
|
||||
{
|
||||
if (ALLOWEDERROR(e))
|
||||
return;
|
||||
|
||||
//if (!ALLOWEDERROR(e))
|
||||
//I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
//SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
|
||||
// no need to spam this on retries
|
||||
if (retrycount == 0)
|
||||
CONS_Alert(CONS_ERROR, "SOCK_Send, error sending to node %d (%s) #%u, %s\n", doomcom->remotenode,
|
||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
|
||||
// retry sending it
|
||||
if (retrycount <= 3)
|
||||
{
|
||||
CONS_Printf("SOCK_Send: retrying... Attempt %d\n", retrycount+1);
|
||||
retrycount++;
|
||||
// wait quarter of a second or smth
|
||||
I_Sleep(250);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
// no recovery, guess we die
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
if (!ALLOWEDERROR(e))
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
}
|
||||
|
||||
if (retrycount > 0)
|
||||
CONS_Alert(CONS_NOTICE, "SOCK_Send: successfully reconnected on Attempt %d\n", retrycount);
|
||||
}
|
||||
#undef ALLOWEDERROR
|
||||
|
||||
|
||||
+10
-10
@@ -66,22 +66,22 @@ static void P_UpdateSlopeLightOffset(pslope_t *slope)
|
||||
nY = FixedDiv(nY, nLen);
|
||||
|
||||
/*
|
||||
* if (slope is ceiling)
|
||||
* {
|
||||
* // There is no good way to calculate this condition here.
|
||||
* // We reverse it in R_FindPlane now.
|
||||
* nX = -nX;
|
||||
* nY = -nY;
|
||||
* }
|
||||
*/
|
||||
if (slope is ceiling)
|
||||
{
|
||||
// There is no good way to calculate this condition here.
|
||||
// We reverse it in R_FindPlane now.
|
||||
nX = -nX;
|
||||
nY = -nY;
|
||||
}
|
||||
*/
|
||||
|
||||
light = FixedMul(nX, FINECOSINE(maplighting.angle >> ANGLETOFINESHIFT))
|
||||
+ FixedMul(nY, FINESINE(maplighting.angle >> ANGLETOFINESHIFT));
|
||||
light = (light + FRACUNIT) / 2;
|
||||
light = (light + FRACUNIT) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
light = FixedDiv(R_PointToAngle2(0, 0, abs(slope->d.x), abs(slope->d.y)), ANGLE_90);
|
||||
light = FixedDiv(R_PointToAngle2(0, 0, abs(slope->normal.y), abs(slope->normal.x)), ANGLE_90);
|
||||
}
|
||||
|
||||
const int delta = abs(slope->zdelta)*3/2; // *3/2, to make 60 degree slopes match walls.
|
||||
|
||||
+14
-14
@@ -350,8 +350,8 @@ void R_ClearPlanes(void)
|
||||
angle = (viewangle-ANGLE_90)>>ANGLETOFINESHIFT;
|
||||
|
||||
// scale will be unit scale at SCREENWIDTH/2 distance
|
||||
basexscale = FixedDiv (FINECOSINE(angle), centerxfrac);
|
||||
baseyscale = -FixedDiv (FINESINE(angle), centerxfrac);
|
||||
basexscale = FixedDiv(FINECOSINE(angle), centerxfrac);
|
||||
baseyscale = -FixedDiv(FINESINE(angle), centerxfrac);
|
||||
}
|
||||
|
||||
static visplane_t *new_visplane(unsigned hash)
|
||||
@@ -440,20 +440,20 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||
}
|
||||
}
|
||||
|
||||
if (slope != NULL && P_ApplyLightOffset(lightlevel >> LIGHTSEGSHIFT, lighting_sector))
|
||||
{
|
||||
if (reverseLight && maplighting.directional == true)
|
||||
{
|
||||
lightlevel -= slope->lightOffset * 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightlevel += slope->lightOffset * 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pfloor)
|
||||
{
|
||||
if (slope != NULL && P_ApplyLightOffset(lightlevel >> LIGHTSEGSHIFT, lighting_sector))
|
||||
{
|
||||
if (reverseLight)
|
||||
{
|
||||
lightlevel -= slope->lightOffset * 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightlevel += slope->lightOffset * 8;
|
||||
}
|
||||
}
|
||||
|
||||
hash = visplane_hash(picnum, lightlevel, height >> FRACBITS);
|
||||
|
||||
for (check = visplanes[hash]; check; check = check->next)
|
||||
|
||||
Reference in new issue
Block a user