mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 07:22:03 +00:00
Merge branch 'master' into next
This commit is contained in:
commit
7441dd7d9b
4 changed files with 62 additions and 8 deletions
|
@ -54,13 +54,19 @@ macro(copy_files_to_build_dir target dlllist_var)
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# 64-bit check
|
# bitness check
|
||||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
set(SRB2_SYSTEM_BITS 0)
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
message(STATUS "Target is 64-bit")
|
message(STATUS "Target is 64-bit")
|
||||||
set(SRB2_SYSTEM_BITS 64)
|
set(SRB2_SYSTEM_BITS 64)
|
||||||
else()
|
endif()
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
|
message(STATUS "Target is 32-bit")
|
||||||
set(SRB2_SYSTEM_BITS 32)
|
set(SRB2_SYSTEM_BITS 32)
|
||||||
endif()
|
endif()
|
||||||
|
if(${SRB2_SYSTEM_BITS} EQUAL 0)
|
||||||
|
message(STATUS "Target bitness is unknown")
|
||||||
|
endif()
|
||||||
|
|
||||||
# OS macros
|
# OS macros
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
|
|
|
@ -612,7 +612,7 @@ static boolean SOCK_Get(void)
|
||||||
if (c != ERRSOCKET)
|
if (c != ERRSOCKET)
|
||||||
{
|
{
|
||||||
// find remote node number
|
// find remote node number
|
||||||
for (j = 0; j <= MAXNETNODES; j++) //include LAN
|
for (j = 1; j <= MAXNETNODES; j++) //include LAN
|
||||||
{
|
{
|
||||||
if (SOCK_cmpaddr(&fromaddress, &clientaddress[j], 0))
|
if (SOCK_cmpaddr(&fromaddress, &clientaddress[j], 0))
|
||||||
{
|
{
|
||||||
|
@ -1340,8 +1340,12 @@ static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port)
|
||||||
while (runp != NULL)
|
while (runp != NULL)
|
||||||
{
|
{
|
||||||
// find ip of the server
|
// find ip of the server
|
||||||
|
if (sendto(mysockets[0], NULL, 0, 0, runp->ai_addr, runp->ai_addrlen) == 0)
|
||||||
|
{
|
||||||
memcpy(&clientaddress[newnode], runp->ai_addr, runp->ai_addrlen);
|
memcpy(&clientaddress[newnode], runp->ai_addr, runp->ai_addrlen);
|
||||||
runp = NULL;
|
break;
|
||||||
|
}
|
||||||
|
runp = runp->ai_next;
|
||||||
}
|
}
|
||||||
I_freeaddrinfo(ai);
|
I_freeaddrinfo(ai);
|
||||||
return newnode;
|
return newnode;
|
||||||
|
|
|
@ -1402,7 +1402,13 @@ static int joy_open2(const char *fname)
|
||||||
void I_InitJoystick(void)
|
void I_InitJoystick(void)
|
||||||
{
|
{
|
||||||
I_ShutdownJoystick();
|
I_ShutdownJoystick();
|
||||||
|
|
||||||
|
if (M_CheckParm("-noxinput"))
|
||||||
SDL_SetHintWithPriority("SDL_XINPUT_ENABLED", "0", SDL_HINT_OVERRIDE);
|
SDL_SetHintWithPriority("SDL_XINPUT_ENABLED", "0", SDL_HINT_OVERRIDE);
|
||||||
|
|
||||||
|
if (M_CheckParm("-nohidapi"))
|
||||||
|
SDL_SetHintWithPriority("SDL_JOYSTICK_HIDAPI", "0", SDL_HINT_OVERRIDE);
|
||||||
|
|
||||||
if (!strcmp(cv_usejoystick.string, "0") || M_CheckParm("-nojoy"))
|
if (!strcmp(cv_usejoystick.string, "0") || M_CheckParm("-nojoy"))
|
||||||
return;
|
return;
|
||||||
if (joy_open(cv_usejoystick.string) != -1)
|
if (joy_open(cv_usejoystick.string) != -1)
|
||||||
|
@ -1418,7 +1424,13 @@ void I_InitJoystick(void)
|
||||||
void I_InitJoystick2(void)
|
void I_InitJoystick2(void)
|
||||||
{
|
{
|
||||||
I_ShutdownJoystick2();
|
I_ShutdownJoystick2();
|
||||||
|
|
||||||
|
if (M_CheckParm("-noxinput"))
|
||||||
SDL_SetHintWithPriority("SDL_XINPUT_ENABLED", "0", SDL_HINT_OVERRIDE);
|
SDL_SetHintWithPriority("SDL_XINPUT_ENABLED", "0", SDL_HINT_OVERRIDE);
|
||||||
|
|
||||||
|
if (M_CheckParm("-nohidapi"))
|
||||||
|
SDL_SetHintWithPriority("SDL_JOYSTICK_HIDAPI", "0", SDL_HINT_OVERRIDE);
|
||||||
|
|
||||||
if (!strcmp(cv_usejoystick2.string, "0") || M_CheckParm("-nojoy"))
|
if (!strcmp(cv_usejoystick2.string, "0") || M_CheckParm("-nojoy"))
|
||||||
return;
|
return;
|
||||||
if (joy_open2(cv_usejoystick2.string) != -1)
|
if (joy_open2(cv_usejoystick2.string) != -1)
|
||||||
|
|
32
src/w_wad.c
32
src/w_wad.c
|
@ -1179,6 +1179,23 @@ void zerr(int ret)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define NO_PNG_LUMPS
|
||||||
|
|
||||||
|
#ifdef NO_PNG_LUMPS
|
||||||
|
static void ErrorIfPNG(UINT8 *d, size_t s, char *f, char *l)
|
||||||
|
{
|
||||||
|
if (s < 67) // http://garethrees.org/2007/11/14/pngcrush/
|
||||||
|
return;
|
||||||
|
// Check for PNG file signature using memcmp
|
||||||
|
// As it may be faster on CPUs with slow unaligned memory access
|
||||||
|
// Ref: http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-signature
|
||||||
|
if (memcmp(&d[0], "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a", 8) == 0)
|
||||||
|
{
|
||||||
|
I_Error("W_Wad: Lump \"%s\" in file \"%s\" is a .PNG - please convert to either Doom or Flat (raw) image format.", l, f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Reads bytes from the head of a lump.
|
/** Reads bytes from the head of a lump.
|
||||||
* Note: If the lump is compressed, the whole thing has to be read anyway.
|
* Note: If the lump is compressed, the whole thing has to be read anyway.
|
||||||
*
|
*
|
||||||
|
@ -1218,7 +1235,15 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
||||||
switch(wadfiles[wad]->lumpinfo[lump].compression)
|
switch(wadfiles[wad]->lumpinfo[lump].compression)
|
||||||
{
|
{
|
||||||
case CM_NOCOMPRESSION: // If it's uncompressed, we directly write the data into our destination, and return the bytes read.
|
case CM_NOCOMPRESSION: // If it's uncompressed, we directly write the data into our destination, and return the bytes read.
|
||||||
|
#ifdef NO_PNG_LUMPS
|
||||||
|
{
|
||||||
|
size_t bytesread = fread(dest, 1, size, handle);
|
||||||
|
ErrorIfPNG(dest, bytesread, wadfiles[wad]->filename, l->name2);
|
||||||
|
return bytesread;
|
||||||
|
}
|
||||||
|
#else
|
||||||
return fread(dest, 1, size, handle);
|
return fread(dest, 1, size, handle);
|
||||||
|
#endif
|
||||||
case CM_LZF: // Is it LZF compressed? Used by ZWADs.
|
case CM_LZF: // Is it LZF compressed? Used by ZWADs.
|
||||||
{
|
{
|
||||||
#ifdef ZWAD
|
#ifdef ZWAD
|
||||||
|
@ -1253,11 +1278,15 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
||||||
M_Memcpy(dest, decData + offset, size);
|
M_Memcpy(dest, decData + offset, size);
|
||||||
Z_Free(rawData);
|
Z_Free(rawData);
|
||||||
Z_Free(decData);
|
Z_Free(decData);
|
||||||
|
#ifdef NO_PNG_LUMPS
|
||||||
|
ErrorIfPNG(dest, size, wadfiles[wad]->filename, l->name2);
|
||||||
|
#endif
|
||||||
return size;
|
return size;
|
||||||
#else
|
#else
|
||||||
//I_Error("ZWAD files not supported on this platform.");
|
//I_Error("ZWAD files not supported on this platform.");
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
#ifdef HAVE_ZLIB
|
#ifdef HAVE_ZLIB
|
||||||
case CM_DEFLATE: // Is it compressed via DEFLATE? Very common in ZIPs/PK3s, also what most doom-related editors support.
|
case CM_DEFLATE: // Is it compressed via DEFLATE? Very common in ZIPs/PK3s, also what most doom-related editors support.
|
||||||
|
@ -1311,6 +1340,9 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
||||||
Z_Free(rawData);
|
Z_Free(rawData);
|
||||||
Z_Free(decData);
|
Z_Free(decData);
|
||||||
|
|
||||||
|
#ifdef NO_PNG_LUMPS
|
||||||
|
ErrorIfPNG(dest, size, wadfiles[wad]->filename, l->name2);
|
||||||
|
#endif
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue