Merge branch 'next' into forceskin-by-name

This commit is contained in:
Steel Titanium 2019-04-11 21:01:14 -04:00
commit 588d3a8c6e
9 changed files with 93 additions and 58 deletions

View file

@ -3,7 +3,7 @@ jobs:
build: build:
working_directory: /root/SRB2 working_directory: /root/SRB2
docker: docker:
- image: debian:jessie - image: debian:stretch
environment: environment:
CC: ccache gcc -m32 CC: ccache gcc -m32
PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig
@ -36,17 +36,20 @@ jobs:
- v1-SRB2-APT - v1-SRB2-APT
- run: - run:
name: Install SDK name: Install SDK
command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx openssh-client command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
- save_cache: - save_cache:
key: v1-SRB2-APT key: v1-SRB2-APT
paths: paths:
- /var/cache/apt/archives - /var/cache/apt/archives
- checkout - checkout
- run: - run:
name: Compile without network support name: Compile without network support and BLUA
command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 NO_LUA=1
- run: - run:
name: Clean build name: wipe build
command: make -C src LINUX=1 cleandep
- run:
name: rebuild depend
command: make -C src LINUX=1 clean command: make -C src LINUX=1 clean
- restore_cache: - restore_cache:
keys: keys:

View file

@ -254,17 +254,21 @@ matrix:
# osx_image: xcode7.2 # osx_image: xcode7.2
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/ # if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #Apple LLVM version 7.0.2 (clang-700.1.81) # #Apple LLVM version 7.0.2 (clang-700.1.81)
# - os: osx
# osx_image: xcode7.3
# #Apple LLVM version 7.3.0 (clang-703.0.31)
# - os: osx
# osx_image: xcode7.3
# #Apple LLVM version 7.3.0 (clang-703.0.31)
- os: osx - os: osx
osx_image: xcode7.3
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/ if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#Apple LLVM version 7.3.0 (clang-703.0.31) #Default: macOS 10.13 and Xcode 9.4.1
################################ ################################
# Deployer Buildbots - OSX # Deployer Buildbots - OSX
################################ ################################
- os: osx - os: osx
osx_image: xcode7.3
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1" AND env(DPL_TERMINATE_MAIN) != "1"
@ -564,6 +568,16 @@ addons:
- libgme-dev - libgme-dev
- zlib1g-dev - zlib1g-dev
- p7zip-full - p7zip-full
homebrew:
taps:
- mazmazz/srb2
packages:
- sdl2_mixer
- game-music-emu
- p7zip
- cmake
update: true
before_install: before_install:
@ -596,18 +610,10 @@ install:
# * `sdl2_mixer` requires options from the formula tap https://github.com/mazmazz/homebrew-srb2 # * `sdl2_mixer` requires options from the formula tap https://github.com/mazmazz/homebrew-srb2
# * `brew postinstall` runs post-install scripts after building a bottle # * `brew postinstall` runs post-install scripts after building a bottle
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update; if [[ "$__DPL_ACTIVE" == "1" ]]; then
brew tap mazmazz/srb2; brew install --build-bottle sdl2 game-music-emu;
fi;
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$__DPL_ACTIVE" != "1" ]]; then
brew install sdl2 sdl2_mixer game-music-emu p7zip;
brew install cmake||true;
else
brew install --build-bottle sdl2 game-music-emu p7zip;
brew install --build-bottle mazmazz/srb2/sdl2_mixer --with-flac --with-mpg123; brew install --build-bottle mazmazz/srb2/sdl2_mixer --with-flac --with-mpg123;
brew postinstall sdl2 game-music-emu p7zip mazmazz/srb2/sdl2_mixer; brew postinstall sdl2 game-music-emu mazmazz/srb2/sdl2_mixer;
brew install cmake||true;
fi; fi;
fi fi
- mkdir -p $HOME/srb2_cache - mkdir -p $HOME/srb2_cache
@ -672,7 +678,6 @@ before_script:
-DCPACK_PACKAGE_VENDOR="${PROGRAM_VENDOR}" -DCPACK_PACKAGE_VENDOR="${PROGRAM_VENDOR}"
-DSRB2_SDL2_EXE_NAME="${PROGRAM_FILENAME}" -DSRB2_SDL2_EXE_NAME="${PROGRAM_FILENAME}"
script: script:
# Build our Makefile from Cmake! # Build our Makefile from Cmake!
- if [[ "$__DPL_ACTIVE" == "1" ]]; then - if [[ "$__DPL_ACTIVE" == "1" ]]; then

View file

@ -56,13 +56,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)

View file

@ -643,16 +643,34 @@ void F_CreditDrawer(void)
if (((y>>FRACBITS) * vid.dupy) > vid.height) if (((y>>FRACBITS) * vid.dupy) > vid.height)
break; break;
} }
}
void F_CreditTicker(void)
{
// "Simulate" the drawing of the credits so that dedicated mode doesn't get stuck
UINT16 i;
fixed_t y = (80<<FRACBITS) - 5*(animtimer<<FRACBITS)/8;
// Draw credits text on top
for (i = 0; credits[i]; i++)
{
switch(credits[i][0])
{
case 0: y += 80<<FRACBITS; break;
case 1: y += 30<<FRACBITS; break;
default: y += 12<<FRACBITS; break;
}
if (FixedMul(y,vid.dupy) > vid.height)
break;
}
// Do this here rather than in the drawer you doofus! (this is why dedicated mode broke at credits)
if (!credits[i] && y <= 120<<FRACBITS && !finalecount) if (!credits[i] && y <= 120<<FRACBITS && !finalecount)
{ {
timetonext = 5*TICRATE+1; timetonext = 5*TICRATE+1;
finalecount = 5*TICRATE; finalecount = 5*TICRATE;
} }
}
void F_CreditTicker(void)
{
if (timetonext) if (timetonext)
timetonext--; timetonext--;
else else

View file

@ -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
memcpy(&clientaddress[newnode], runp->ai_addr, runp->ai_addrlen); if (sendto(mysockets[0], NULL, 0, 0, runp->ai_addr, runp->ai_addrlen) == 0)
runp = NULL; {
memcpy(&clientaddress[newnode], runp->ai_addr, runp->ai_addrlen);
break;
}
runp = runp->ai_next;
} }
I_freeaddrinfo(ai); I_freeaddrinfo(ai);
return newnode; return newnode;

View file

@ -219,6 +219,7 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_SUNSET,10, // SKINCOLOR_MOONSLAM SKINCOLOR_SUNSET,10, // SKINCOLOR_MOONSLAM
SKINCOLOR_MAUVE,10, // SKINCOLOR_ULTRAVIOLET SKINCOLOR_MAUVE,10, // SKINCOLOR_ULTRAVIOLET
SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK
SKINCOLOR_POPCORN,12, // SKINCOLOR_BUBBLEGUM
SKINCOLOR_EMERALD,8, // SKINCOLOR_PURPLE SKINCOLOR_EMERALD,8, // SKINCOLOR_PURPLE
SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA
SKINCOLOR_MAROON,8, // SKINCOLOR_TOXIC SKINCOLOR_MAROON,8, // SKINCOLOR_TOXIC

View file

@ -2752,7 +2752,7 @@ static luaL_Reg lib[] = {
// k_kart // k_kart
{"K_PlayAttackTaunt", lib_kAttackSound}, {"K_PlayAttackTaunt", lib_kAttackSound},
{"K_PlayBoostTaunt", lib_kBoostSound}, {"K_PlayBoostTaunt", lib_kBoostSound},
{"K_PlayPowerGloatSund", lib_kGloatSound}, {"K_PlayPowerGloatSound", lib_kGloatSound},
{"K_PlayOvertakeSound", lib_kOvertakeSound}, {"K_PlayOvertakeSound", lib_kOvertakeSound},
{"K_PlayLossSound", lib_kLossSound}, {"K_PlayLossSound", lib_kLossSound},
{"K_PlayHitEmSound", lib_kHitEmSound}, {"K_PlayHitEmSound", lib_kHitEmSound},

View file

@ -870,16 +870,18 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
leftheight -= viewz; leftheight -= viewz;
rightheight -= viewz; rightheight -= viewz;
#define OVERFLOWTEST(height, scale) \ #define CLAMPMAX INT32_MAX
overflow_test = (INT64)centeryfrac - (((INT64)height*scale)>>FRACBITS); \ #define CLAMPMIN (-INT32_MAX) // This is not INT32_MIN on purpose! INT32_MIN makes the drawers freak out.
if (overflow_test < 0) overflow_test = -overflow_test; \ // Monster Iestyn (25/03/18): do not skip these lights if they fail overflow test, just clamp them instead so they behave.
if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) continue; overflow_test = (INT64)centeryfrac - (((INT64)leftheight*ds->scale1)>>FRACBITS);
if (overflow_test > (INT64)CLAMPMAX) rlight->height = CLAMPMAX;
else if (overflow_test > (INT64)CLAMPMIN) rlight->height = (fixed_t)overflow_test;
else rlight->height = CLAMPMIN;
OVERFLOWTEST(leftheight, ds->scale1) overflow_test = (INT64)centeryfrac - (((INT64)rightheight*ds->scale2)>>FRACBITS);
OVERFLOWTEST(rightheight, ds->scale2) if (overflow_test > (INT64)CLAMPMAX) rlight->heightstep = CLAMPMAX;
else if (overflow_test > (INT64)CLAMPMIN) rlight->heightstep = (fixed_t)overflow_test;
rlight->height = (centeryfrac) - FixedMul(leftheight, ds->scale1); else rlight->heightstep = CLAMPMIN;
rlight->heightstep = (centeryfrac) - FixedMul(rightheight, ds->scale2);
rlight->heightstep = (rlight->heightstep-rlight->height)/(range); rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
#else #else
if (light->height < *pfloor->bottomheight) if (light->height < *pfloor->bottomheight)
@ -901,12 +903,16 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
leftheight -= viewz; leftheight -= viewz;
rightheight -= viewz; rightheight -= viewz;
OVERFLOWTEST(leftheight, ds->scale1) // Monster Iestyn (25/03/18): do not skip these lights if they fail overflow test, just clamp them instead so they behave.
OVERFLOWTEST(rightheight, ds->scale2) overflow_test = (INT64)centeryfrac - (((INT64)leftheight*ds->scale1)>>FRACBITS);
#undef OVERFLOWTEST if (overflow_test > (INT64)CLAMPMAX) rlight->botheight = CLAMPMAX;
else if (overflow_test > (INT64)CLAMPMIN) rlight->botheight = (fixed_t)overflow_test;
else rlight->botheight = CLAMPMIN;
rlight->botheight = (centeryfrac) - FixedMul(leftheight, ds->scale1); overflow_test = (INT64)centeryfrac - (((INT64)rightheight*ds->scale2)>>FRACBITS);
rlight->botheightstep = (centeryfrac) - FixedMul(rightheight, ds->scale2); if (overflow_test > (INT64)CLAMPMAX) rlight->botheightstep = CLAMPMAX;
else if (overflow_test > (INT64)CLAMPMIN) rlight->botheightstep = (fixed_t)overflow_test;
else rlight->botheightstep = CLAMPMIN;
rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range); rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range);
#else #else
lheight = *light->caster->bottomheight;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : *light->caster->bottomheight; lheight = *light->caster->bottomheight;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : *light->caster->bottomheight;
@ -1079,9 +1085,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
} }
#endif #endif
#define CLAMPMAX INT32_MAX
#define CLAMPMIN (-INT32_MAX) // This is not INT32_MIN on purpose! INT32_MIN makes the drawers freak out.
// draw the columns // draw the columns
for (dc_x = x1; dc_x <= x2; dc_x++) for (dc_x = x1; dc_x <= x2; dc_x++)
{ {

View file

@ -1187,23 +1187,17 @@ void zerr(int ret)
#define NO_PNG_LUMPS #define NO_PNG_LUMPS
#ifdef NO_PNG_LUMPS #ifdef NO_PNG_LUMPS
static void ErrorIfPNG(void *d, size_t s, char *f, char *l) static void ErrorIfPNG(UINT8 *d, size_t s, char *f, char *l)
{ {
if (s < 67) // http://garethrees.org/2007/11/14/pngcrush/ if (s < 67) // http://garethrees.org/2007/11/14/pngcrush/
return; return;
#define sigcheck ((UINT8 *)d) // Check for PNG file signature using memcmp
if (sigcheck[0] == 0x89 // As it may be faster on CPUs with slow unaligned memory access
&& sigcheck[1] == 0x50 // Ref: http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-signature
&& sigcheck[2] == 0x4e if (memcmp(&d[0], "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a", 8) == 0)
&& sigcheck[3] == 0x47
&& sigcheck[4] == 0x0d
&& sigcheck[5] == 0x0a
&& sigcheck[6] == 0x1a
&& sigcheck[7] == 0x0a)
{ {
I_Error("W_Wad: Lump \"%s\" in file \"%s\" is a .PNG - please convert to either Doom or Flat (raw) image format.", l, f); I_Error("W_Wad: Lump \"%s\" in file \"%s\" is a .PNG - please convert to either Doom or Flat (raw) image format.", l, f);
} }
#undef sigcheck
} }
#endif #endif
@ -1297,6 +1291,7 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
//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.