Compare commits
41
Commits
shadercrap
...
retrySOCK
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0da78ae3d1 | ||
|
|
86976192f1 | ||
|
|
67bac0aa88 | ||
|
|
033e0cd416 | ||
|
|
18a72d617d | ||
|
|
f0667895eb | ||
|
|
b58bc02940 | ||
|
|
f029a2b7d8 | ||
|
|
32bd5a02ec | ||
|
|
9a100439df | ||
|
|
3b37f85024 | ||
|
|
27a65ef973 | ||
|
|
ffa9b2fa9a | ||
|
|
ab9e0f923e | ||
|
|
8bf3953b4a | ||
|
|
44ef42cf84 | ||
|
|
746035bfea | ||
|
|
70bc9879b3 | ||
|
|
0e6a794a84 | ||
|
|
4eccf40a0a | ||
|
|
e3fd46297a | ||
|
|
4c2e119385 | ||
|
|
229a6a161e | ||
|
|
1b2e4a1acc | ||
|
|
2e6d49fcd6 | ||
|
|
7a8c66781b | ||
|
|
c877226bfe | ||
|
|
ac3c8b1d25 | ||
|
|
feeba45b0d | ||
|
|
06f3d2c91b | ||
|
|
332fadc823 | ||
|
|
39dc1b85e3 | ||
|
|
5b2413444f | ||
|
|
7855b2ed95 | ||
|
|
caebe62ddb | ||
|
|
9de285caac | ||
|
|
9bb4420ad3 | ||
|
|
8dc3d870a1 | ||
|
|
158546bd73 | ||
|
|
b89a3f1017 | ||
|
|
f2e355a5a8 |
No files matched your search
@@ -61,7 +61,6 @@
|
|||||||
# NOPOSTPROCESSING=1 - ?
|
# NOPOSTPROCESSING=1 - ?
|
||||||
# MOBJCONSISTANCY=1 - ??
|
# MOBJCONSISTANCY=1 - ??
|
||||||
# PACKETDROP=1 - ??
|
# PACKETDROP=1 - ??
|
||||||
# NOEXECINFO=1 - Disable stack trace dump support
|
|
||||||
# DEBUGMODE=1 - Enable various debugging capabilities.
|
# DEBUGMODE=1 - Enable various debugging capabilities.
|
||||||
# Also disables optimizations.
|
# Also disables optimizations.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ DEDICATED?=0
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
NOEXECINFO=1
|
|
||||||
|
|
||||||
ifeq (${SDL},1)
|
ifeq (${SDL},1)
|
||||||
EXENAME?=srb2haiku
|
EXENAME?=srb2haiku
|
||||||
else ifeq (${DEDICATED},1)
|
else ifeq (${DEDICATED},1)
|
||||||
|
|||||||
+13
-12
@@ -64,10 +64,9 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
#include <time.h>
|
#if defined (__linux__) || defined (__HAIKU__)
|
||||||
#if defined (__linux__)
|
#include <sys/statvfs.h>
|
||||||
#include <sys/vfs.h>
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
@@ -75,6 +74,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#else
|
#else
|
||||||
|
#include <sys/statvfs.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
/*For meminfo*/
|
/*For meminfo*/
|
||||||
@@ -87,7 +87,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
#if defined (__linux__) || defined (UNIXCOMMON)
|
||||||
#ifndef NOTERMIOS
|
#ifndef NOTERMIOS
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <sys/ioctl.h> // ioctl
|
#include <sys/ioctl.h> // ioctl
|
||||||
@@ -99,8 +99,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#ifndef __HAIKU__ // haiku's crash dialog is just objectively better
|
||||||
#define NEWSIGNALHANDLER
|
#define NEWSIGNALHANDLER
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NOMUMBLE
|
#ifndef NOMUMBLE
|
||||||
#ifdef __linux__ // need -lrt
|
#ifdef __linux__ // need -lrt
|
||||||
@@ -131,7 +133,9 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Locations to directly check for srb2.srb in
|
/// Locations to directly check for srb2.srb in
|
||||||
const char *wadDefaultPaths[] = {
|
const char *wadDefaultPaths[] = {
|
||||||
@@ -1688,6 +1692,7 @@ void I_ShutdownSystem(void)
|
|||||||
for (c = MAX_QUIT_FUNCS-1; c >= 0; c--)
|
for (c = MAX_QUIT_FUNCS-1; c >= 0; c--)
|
||||||
if (quit_funcs[c])
|
if (quit_funcs[c])
|
||||||
(*quit_funcs[c])();
|
(*quit_funcs[c])();
|
||||||
|
|
||||||
#ifdef LOGMESSAGES
|
#ifdef LOGMESSAGES
|
||||||
if (logstream)
|
if (logstream)
|
||||||
{
|
{
|
||||||
@@ -1704,18 +1709,13 @@ void I_ShutdownSystem(void)
|
|||||||
void I_GetDiskFreeSpace(INT64 *freespace)
|
void I_GetDiskFreeSpace(INT64 *freespace)
|
||||||
{
|
{
|
||||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
#if defined (SOLARIS) || defined (__HAIKU__)
|
struct statvfs stfs;
|
||||||
*freespace = INT32_MAX;
|
if (statvfs(srb2home, &stfs) == -1)
|
||||||
return;
|
|
||||||
#else // Both Linux and BSD have this, apparently.
|
|
||||||
struct statfs stfs;
|
|
||||||
if (statfs(".", &stfs) == -1)
|
|
||||||
{
|
{
|
||||||
*freespace = INT32_MAX;
|
*freespace = INT32_MAX;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*freespace = stfs.f_bavail * stfs.f_bsize;
|
*freespace = stfs.f_bavail * stfs.f_bsize;
|
||||||
#endif
|
|
||||||
#elif defined (_WIN32)
|
#elif defined (_WIN32)
|
||||||
static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL;
|
static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL;
|
||||||
static boolean testwin95 = false;
|
static boolean testwin95 = false;
|
||||||
@@ -1726,6 +1726,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
|
|||||||
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
|
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
|
||||||
testwin95 = true;
|
testwin95 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pfnGetDiskFreeSpaceEx)
|
if (pfnGetDiskFreeSpaceEx)
|
||||||
{
|
{
|
||||||
if (pfnGetDiskFreeSpaceEx(NULL, &lfreespace, &usedbytes, NULL))
|
if (pfnGetDiskFreeSpaceEx(NULL, &lfreespace, &usedbytes, NULL))
|
||||||
|
|||||||
+27
-10
@@ -1027,20 +1027,22 @@ void G_ResetAllDeviceRumbles(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_PlayerDeviceRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration)
|
void G_PlayerDeviceRumble(INT32 playernum, UINT32 low_strength, UINT32 high_strength, UINT32 duration)
|
||||||
{
|
{
|
||||||
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
||||||
|
|
||||||
if (cv_rumble[playernum].value == 0 || (window_notinfocus && cv_rumbleifunfocused.value == 0))
|
if (cv_rumble[playernum].value == 0 || (window_notinfocus && cv_rumbleifunfocused.value == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
UINT16 lo, hi;
|
||||||
|
|
||||||
// doesent need to be super precise
|
// doesent need to be super precise
|
||||||
// but ensure this is within range (0-65535)
|
// but ensure this is within range (0-65535)
|
||||||
// placed here so it applies to lua aswell
|
// placed here so it applies to lua aswell
|
||||||
low_strength = (UINT16)min(FixedMul(low_strength, cv_rumble_strength[playernum].value), UINT16_MAX);
|
lo = (UINT16)min(FixedMul(low_strength, cv_rumble_strength[playernum].value), UINT16_MAX);
|
||||||
high_strength = (UINT16)min(FixedMul(high_strength, cv_rumble_strength[playernum].value), UINT16_MAX);
|
hi = (UINT16)min(FixedMul(high_strength, cv_rumble_strength[playernum].value), UINT16_MAX);
|
||||||
|
|
||||||
I_GamepadRumble(playernum, low_strength, high_strength, duration);
|
I_GamepadRumble(playernum, lo, hi, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// rumble strengths
|
// rumble strengths
|
||||||
@@ -1077,9 +1079,9 @@ void G_DeviceRumbleTick(void)
|
|||||||
|
|
||||||
// SDL rumble strength goes from a range or 0-65535 respectively
|
// SDL rumble strength goes from a range or 0-65535 respectively
|
||||||
// the higher, the stronger it is
|
// the higher, the stronger it is
|
||||||
UINT16 low = 0, high = 0;
|
UINT32 low = 0, high = 0;
|
||||||
// for how long the action should rumble, in ms
|
// for how long the action should rumble, in ms
|
||||||
UINT16 length = 57; // 57ms is a short pulse, matches super well with this updating once per tic
|
UINT32 length = 57; // 57ms is a short pulse, matches super well with this updating once per tic
|
||||||
|
|
||||||
const player_t *player = P_GetLocalPlayerForNum(i);
|
const player_t *player = P_GetLocalPlayerForNum(i);
|
||||||
|
|
||||||
@@ -1095,7 +1097,7 @@ void G_DeviceRumbleTick(void)
|
|||||||
player->playerstate == PST_DEAD ||
|
player->playerstate == PST_DEAD ||
|
||||||
player->kartstuff[k_respawn] > 1)
|
player->kartstuff[k_respawn] > 1)
|
||||||
{
|
{
|
||||||
G_PlayerDeviceRumble(i, low, high, 0);
|
G_PlayerDeviceRumble(i, 0, 0, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1150,27 +1152,42 @@ void G_DeviceRumbleTick(void)
|
|||||||
P_IsObjectOnGround(player->mo))
|
P_IsObjectOnGround(player->mo))
|
||||||
{
|
{
|
||||||
low = high = RUMBLE_VERYWEAK;
|
low = high = RUMBLE_VERYWEAK;
|
||||||
|
length = 43;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cv_rumble_brakedrift[i].value &&
|
if (cv_rumble_brakedrift[i].value &&
|
||||||
player->kartstuff[k_brakedrift])
|
player->kartstuff[k_brakedrift])
|
||||||
{
|
{
|
||||||
high = CLAMP((high + RUMBLE_VERYWEAK), 0, UINT16_MAX);
|
high += RUMBLE_VERYWEAK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pulse when gettin new driftlevel
|
// pulse when gettin new driftlevel
|
||||||
// let this come last
|
|
||||||
if (cv_rumble_driftcharge[i].value &&
|
if (cv_rumble_driftcharge[i].value &&
|
||||||
player->kartstuff[k_driftcharge] &&
|
player->kartstuff[k_driftcharge] &&
|
||||||
player->driftlevel)
|
player->driftlevel)
|
||||||
{
|
{
|
||||||
high = CLAMP((high + RUMBLE_VERYWEAK), 0, UINT16_MAX);
|
high += RUMBLE_VERYWEAK;
|
||||||
|
|
||||||
// make it rumble slightly longer the higher your driftlevel!
|
// make it rumble slightly longer the higher your driftlevel!
|
||||||
if (player->driftlevel == 2)
|
if (player->driftlevel == 2)
|
||||||
length = 114;
|
length = 114;
|
||||||
else if (player->driftlevel == 3)
|
else if (player->driftlevel == 3)
|
||||||
length = 174;
|
length = 174;
|
||||||
|
else
|
||||||
|
length = 71;
|
||||||
|
}
|
||||||
|
|
||||||
|
// grow makes rumble more intense >:3
|
||||||
|
if (player->kartstuff[k_growshrinktimer] > 0)
|
||||||
|
{
|
||||||
|
high *= 2;
|
||||||
|
low *= 2;
|
||||||
|
}
|
||||||
|
// shrink does the opposite uwu
|
||||||
|
else if (player->kartstuff[k_growshrinktimer] < 0)
|
||||||
|
{
|
||||||
|
high /= 2;
|
||||||
|
low /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack alert! i just dont want this thing constantly resetting the rumble lol
|
// hack alert! i just dont want this thing constantly resetting the rumble lol
|
||||||
|
|||||||
+1
-1
@@ -153,7 +153,7 @@ void G_DeviceLEDTick(void);
|
|||||||
void G_ResetDeviceLED(void);
|
void G_ResetDeviceLED(void);
|
||||||
|
|
||||||
void G_ResetAllDeviceRumbles(void);
|
void G_ResetAllDeviceRumbles(void);
|
||||||
void G_PlayerDeviceRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration);
|
void G_PlayerDeviceRumble(INT32 playernum, UINT32 low_strength, UINT32 high_strength, UINT32 duration);
|
||||||
void G_DeviceRumbleTick(void);
|
void G_DeviceRumbleTick(void);
|
||||||
|
|
||||||
// peace to my little coder fingers!
|
// peace to my little coder fingers!
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg, extracolormap_t *colo
|
|||||||
return (FUINT)finallight;
|
return (FUINT)finallight;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t *sector, const boolean fof)
|
static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t *sector, const boolean reverseLight)
|
||||||
{
|
{
|
||||||
INT16 finallight = lightnum;
|
INT16 finallight = lightnum;
|
||||||
|
|
||||||
@@ -539,7 +539,7 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t
|
|||||||
if (slope != NULL && sector != NULL && HWR_ApplyLightOffset(lightnum, sector))
|
if (slope != NULL && sector != NULL && HWR_ApplyLightOffset(lightnum, sector))
|
||||||
{
|
{
|
||||||
const INT16 offset = (cv_glfakecontrast.value == 2) ? slope->hwLightOffset : ((INT16)slope->lightOffset * 8);
|
const INT16 offset = (cv_glfakecontrast.value == 2) ? slope->hwLightOffset : ((INT16)slope->lightOffset * 8);
|
||||||
finallight += (fof ? -offset : offset);
|
finallight += ((reverseLight && maplighting.directional) ? -offset : offset);
|
||||||
finallight = CLAMP(finallight, 0, 255);
|
finallight = CLAMP(finallight, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
|||||||
SETUP3DVERT(v3d, pv->x, pv->y);
|
SETUP3DVERT(v3d, pv->x, pv->y);
|
||||||
|
|
||||||
if (slope)
|
if (slope)
|
||||||
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL));
|
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector && !isceiling) || (!FOFsector && isceiling));
|
||||||
|
|
||||||
HWR_Lighting(&Surf, lightlevel, planecolormap, P_SectorUsesDirectionalLighting(gl_frontsector));
|
HWR_Lighting(&Surf, lightlevel, planecolormap, P_SectorUsesDirectionalLighting(gl_frontsector));
|
||||||
|
|
||||||
@@ -1280,7 +1280,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
|||||||
// To avoid division by zero, which would result in a NaN, we check if the vertical difference
|
// To avoid division by zero, which would result in a NaN, we check if the vertical difference
|
||||||
// between the two vertices is not zero.
|
// between the two vertices is not zero.
|
||||||
if (std::fpclassify(diff) == FP_ZERO)
|
if (std::fpclassify(diff) == FP_ZERO)
|
||||||
pegmul = 0.0;
|
pegmul = 0.0f;
|
||||||
else
|
else
|
||||||
pegmul = (pegb - pegt) / diff;
|
pegmul = (pegb - pegt) / diff;
|
||||||
|
|
||||||
@@ -1292,7 +1292,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
|||||||
endpegb = wallVerts[1].t;
|
endpegb = wallVerts[1].t;
|
||||||
|
|
||||||
if (std::fpclassify(diff) == FP_ZERO)
|
if (std::fpclassify(diff) == FP_ZERO)
|
||||||
endpegmul = 0.0;
|
endpegmul = 0.0f;
|
||||||
else
|
else
|
||||||
endpegmul = (endpegb - endpegt) / diff;
|
endpegmul = (endpegb - endpegt) / diff;
|
||||||
|
|
||||||
@@ -3856,7 +3856,16 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
|||||||
realbot = bot = baseWallVerts[0].y;
|
realbot = bot = baseWallVerts[0].y;
|
||||||
towtop = baseWallVerts[3].t;
|
towtop = baseWallVerts[3].t;
|
||||||
towbot = baseWallVerts[0].t;
|
towbot = baseWallVerts[0].t;
|
||||||
towmult = (towbot - towtop) / (top - bot);
|
|
||||||
|
float diff = (top - bot);
|
||||||
|
|
||||||
|
// If both heights of a side lay on the same position, then this sprite is a triangle.
|
||||||
|
// To avoid division by zero, which would result in a NaN, we check if the vertical difference
|
||||||
|
// between the two vertices is not zero.
|
||||||
|
if (std::fpclassify(diff) == FP_ZERO)
|
||||||
|
towmult = 0.0f;
|
||||||
|
else
|
||||||
|
towmult = (towbot - towtop) / diff;
|
||||||
|
|
||||||
endrealtop = endtop = baseWallVerts[2].y;
|
endrealtop = endtop = baseWallVerts[2].y;
|
||||||
endrealbot = baseWallVerts[1].y;
|
endrealbot = baseWallVerts[1].y;
|
||||||
@@ -4027,7 +4036,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
|||||||
if ((endtop <= endrealbot) && (top <= realbot))
|
if ((endtop <= endrealbot) && (top <= realbot))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If we're ever down here, somehow the above loop hasn't draw all the light levels of sprite
|
// If we're ever down here, somehow the above loop hasn't drawn all the light levels of sprite
|
||||||
wallVerts[3].t = towtop + ((realtop - top) * towmult);
|
wallVerts[3].t = towtop + ((realtop - top) * towmult);
|
||||||
wallVerts[2].t = towtop + ((endrealtop - endtop) * towmult);
|
wallVerts[2].t = towtop + ((endrealtop - endtop) * towmult);
|
||||||
wallVerts[0].t = towtop + ((realtop - bot) * towmult);
|
wallVerts[0].t = towtop + ((realtop - bot) * towmult);
|
||||||
@@ -5383,6 +5392,11 @@ static void HWR_SkyDomeVertex(gl_sky_t *sky, gl_skyvertex_t *vbo, int r, int c,
|
|||||||
else
|
else
|
||||||
vbo->v = 1.0f + ((float)(sky->rows - r) / (float)sky->rows) + 0.5f;
|
vbo->v = 1.0f + ((float)(sky->rows - r) / (float)sky->rows) + 0.5f;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vbo->u = 0.5f / sky->width;
|
||||||
|
vbo->v = 0.5f / sky->height;
|
||||||
|
}
|
||||||
|
|
||||||
if (r != 4)
|
if (r != 4)
|
||||||
{
|
{
|
||||||
|
|||||||
+34
-4
@@ -752,9 +752,14 @@ static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr
|
|||||||
|
|
||||||
static void SOCK_Send(void)
|
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;
|
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])
|
if (doomcom->remotenode < 0 || !nodeconnected[doomcom->remotenode])
|
||||||
return;
|
return;
|
||||||
@@ -808,10 +813,35 @@ static void SOCK_Send(void)
|
|||||||
|
|
||||||
if (c == ERRSOCKET && e != 0) // 0 means no socket for the address family was found
|
if (c == ERRSOCKET && e != 0) // 0 means no socket for the address family was found
|
||||||
{
|
{
|
||||||
if (!ALLOWEDERROR(e))
|
if (ALLOWEDERROR(e))
|
||||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
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,
|
||||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
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
|
#undef ALLOWEDERROR
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -3080,8 +3080,8 @@ static int lib_gPlayerDeviceRumble(lua_State *L)
|
|||||||
{
|
{
|
||||||
INT32 pnum = -1;
|
INT32 pnum = -1;
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
|
||||||
UINT16 low_strength = (UINT16)luaL_checkinteger(L, 2); // low frequency rumble motor strenght
|
UINT32 low_strength = (UINT32)luaL_checkinteger(L, 2); // low frequency rumble motor strength
|
||||||
UINT16 high_strength = (UINT16)luaL_checkinteger(L, 3); // high frequency rumble motor strenght
|
UINT32 high_strength = (UINT32)luaL_checkinteger(L, 3); // high frequency rumble motor strength
|
||||||
UINT32 duration = (UINT32)luaL_optinteger(L, 4, 84); // duration of rumble in ms
|
UINT32 duration = (UINT32)luaL_optinteger(L, 4, 84); // duration of rumble in ms
|
||||||
|
|
||||||
if (!player)
|
if (!player)
|
||||||
|
|||||||
+11
-19
@@ -80,12 +80,9 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include "i_ttf.h"
|
#include "i_ttf.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "SDL_cpuinfo.h"
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
#define HAVE_SDLCPUINFO
|
#if defined (__linux__) || defined (__HAIKU__)
|
||||||
|
#include <sys/statvfs.h>
|
||||||
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
|
||||||
#if defined (__linux__)
|
|
||||||
#include <sys/vfs.h>
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
@@ -93,6 +90,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#else
|
#else
|
||||||
|
#include <sys/statvfs.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
/*For meminfo*/
|
/*For meminfo*/
|
||||||
@@ -105,7 +103,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
#if defined (__linux__) || defined (UNIXCOMMON)
|
||||||
#ifndef NOTERMIOS
|
#ifndef NOTERMIOS
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <sys/ioctl.h> // ioctl
|
#include <sys/ioctl.h> // ioctl
|
||||||
@@ -120,8 +118,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
|
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#ifndef __HAIKU__ // haiku's crash dialog is just objectively better
|
||||||
#define NEWSIGNALHANDLER
|
#define NEWSIGNALHANDLER
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NOMUMBLE
|
#ifndef NOMUMBLE
|
||||||
#ifdef __linux__ // need -lrt
|
#ifdef __linux__ // need -lrt
|
||||||
@@ -195,7 +195,6 @@ static char returnWadPath[256];
|
|||||||
#include "../i_sound.h"
|
#include "../i_sound.h"
|
||||||
#include "../i_system.h"
|
#include "../i_system.h"
|
||||||
#include "../i_threads.h"
|
#include "../i_threads.h"
|
||||||
#include "../screen.h" //vid.WndParent
|
|
||||||
#include "../d_net.h"
|
#include "../d_net.h"
|
||||||
#include "../g_game.h"
|
#include "../g_game.h"
|
||||||
#include "../g_demo.h"
|
#include "../g_demo.h"
|
||||||
@@ -208,9 +207,6 @@ static char returnWadPath[256];
|
|||||||
|
|
||||||
#include "../m_argv.h"
|
#include "../m_argv.h"
|
||||||
|
|
||||||
#include "../r_main.h" // Frame interpolation/uncapped
|
|
||||||
#include "../r_fps.h"
|
|
||||||
|
|
||||||
#include "../s_sound.h"
|
#include "../s_sound.h"
|
||||||
|
|
||||||
#include "../d_main.h"
|
#include "../d_main.h"
|
||||||
@@ -274,7 +270,7 @@ static void tty_Clear(void)
|
|||||||
write(STDOUT_FILENO, "\r", 1);
|
write(STDOUT_FILENO, "\r", 1);
|
||||||
if (tty_con.cursor>0)
|
if (tty_con.cursor>0)
|
||||||
{
|
{
|
||||||
for (i=0; i<tty_con.cursor; i++)
|
for (i = 0; i < tty_con.cursor; i++)
|
||||||
{
|
{
|
||||||
write(STDOUT_FILENO, " ", 1);
|
write(STDOUT_FILENO, " ", 1);
|
||||||
}
|
}
|
||||||
@@ -2291,18 +2287,13 @@ void I_ShutdownSystem(void)
|
|||||||
void I_GetDiskFreeSpace(INT64 *freespace)
|
void I_GetDiskFreeSpace(INT64 *freespace)
|
||||||
{
|
{
|
||||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
#if defined (SOLARIS) || defined (__HAIKU__)
|
struct statvfs stfs;
|
||||||
*freespace = INT32_MAX;
|
if (statvfs(srb2home, &stfs) == -1)
|
||||||
return;
|
|
||||||
#else // Both Linux and BSD have this, apparently.
|
|
||||||
struct statfs stfs;
|
|
||||||
if (statfs(".", &stfs) == -1)
|
|
||||||
{
|
{
|
||||||
*freespace = INT32_MAX;
|
*freespace = INT32_MAX;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*freespace = stfs.f_bavail * stfs.f_bsize;
|
*freespace = stfs.f_bavail * stfs.f_bsize;
|
||||||
#endif
|
|
||||||
#elif defined (_WIN32)
|
#elif defined (_WIN32)
|
||||||
static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL;
|
static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL;
|
||||||
static boolean testwin95 = false;
|
static boolean testwin95 = false;
|
||||||
@@ -2313,6 +2304,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
|
|||||||
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
|
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
|
||||||
testwin95 = true;
|
testwin95 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pfnGetDiskFreeSpaceEx)
|
if (pfnGetDiskFreeSpaceEx)
|
||||||
{
|
{
|
||||||
if (pfnGetDiskFreeSpaceEx(NULL, &lfreespace, &usedbytes, NULL))
|
if (pfnGetDiskFreeSpaceEx(NULL, &lfreespace, &usedbytes, NULL))
|
||||||
|
|||||||
+2
-2
@@ -1900,7 +1900,7 @@ void V_DrawVhsEffect(boolean rewind)
|
|||||||
|
|
||||||
pos = 0;
|
pos = 0;
|
||||||
|
|
||||||
for (y = 0; y < vid.height; y+=2)
|
for (y = 0; y < vid.height; y += 2)
|
||||||
{
|
{
|
||||||
thismapstart = normalmapstart;
|
thismapstart = normalmapstart;
|
||||||
offs = 0;
|
offs = 0;
|
||||||
@@ -1917,7 +1917,7 @@ void V_DrawVhsEffect(boolean rewind)
|
|||||||
offs -= downdistort * 2.0f * min(y-dby, dby+barsize-y) / barsize;
|
offs -= downdistort * 2.0f * min(y-dby, dby+barsize-y) / barsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
offs += M_RandomKey(vid.dup<<1);
|
offs += M_RandomKey(vid.udup<<1);
|
||||||
|
|
||||||
// lazy way to avoid crashes
|
// lazy way to avoid crashes
|
||||||
if ((y == 0 && offs < 0) || (y >= vid.height-2 && offs > 0))
|
if ((y == 0 && offs < 0) || (y >= vid.height-2 && offs > 0))
|
||||||
|
|||||||
Reference in new issue
Block a user