Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into staffghost-repair

This commit is contained in:
toaster 2023-02-06 22:29:24 +00:00
commit 4ebc42d438
13 changed files with 132 additions and 115 deletions

View file

@ -229,7 +229,7 @@ target_link_libraries(SRB2SDL2 PRIVATE glad::glad)
target_link_libraries(SRB2SDL2 PRIVATE fmt)
target_link_libraries(SRB2SDL2 PRIVATE imgui::imgui)
target_link_libraries(SRB2SDL2 PRIVATE acsvm::acsvm)
target_link_libraries(SRB2SDL2 PRIVATE acsvm)
set(SRB2_HAVE_THREADS ON)
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS)

View file

@ -730,7 +730,7 @@ static void COM_ExecuteString(char *ptext)
// check cvars
// Hurdler: added at Ebola's request ;)
// (don't flood the console in software mode with bad gl_xxx command)
if (!CV_Command() && con_destlines)
if (!CV_Command() && (con_destlines || dedicated))
CONS_Printf(M_GetText("Unknown command '%s'\n"), COM_Argv(0));
}

View file

@ -5362,21 +5362,24 @@ static void HWR_ProjectSprite(mobj_t *thing)
if (thing->renderflags & RF_SHADOWEFFECTS)
{
mobj_t *caster = thing->target;
interpmobjstate_t casterinterp = {0};
if (R_UsingFrameInterpolation() && !paused)
{
R_InterpolateMobjState(caster, rendertimefrac, &casterinterp);
}
else
{
R_InterpolateMobjState(caster, FRACUNIT, &casterinterp);
}
if (caster && !P_MobjWasRemoved(caster))
{
fixed_t groundz = R_GetShadowZ(thing, NULL);
fixed_t floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz);
interpmobjstate_t casterinterp = {0};
fixed_t groundz;
fixed_t floordiff;
if (R_UsingFrameInterpolation() && !paused)
{
R_InterpolateMobjState(caster, rendertimefrac, &casterinterp);
}
else
{
R_InterpolateMobjState(caster, FRACUNIT, &casterinterp);
}
groundz = R_GetShadowZ(thing, NULL);
floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz);
shadowheight = FIXED_TO_FLOAT(floordiff);
shadowscale = FIXED_TO_FLOAT(FixedMul(FRACUNIT - floordiff/640, casterinterp.scale));

View file

@ -1397,7 +1397,10 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
}
}
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
if (predict != NULL)
{
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
}
cmd->buttons &= ~(BT_ACCELERATE|BT_BRAKE);
cmd->forwardmove = 0;
trySpindash = true;
@ -1431,7 +1434,10 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
}
}
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
if (predict != NULL)
{
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
}
}
}
else
@ -1450,7 +1456,10 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
}
}
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
if (predict != NULL)
{
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
}
}
if (trySpindash == true)

View file

@ -251,7 +251,7 @@ boolean M_LevelListFromGametype(INT16 gt)
if (cupgrid.cappages == 0)
{
cupgrid.cappages = 2;
cupgrid.builtgrid = Z_Calloc(
cupgrid.builtgrid = Z_Malloc(
cupgrid.cappages * pagelen,
PU_STATIC,
NULL);
@ -288,7 +288,6 @@ boolean M_LevelListFromGametype(INT16 gt)
I_Error("M_LevelListFromGametype: Not enough memory to reallocate builtgrid");
}
memset(cupgrid.builtgrid + firstlen, 0, firstlen);
cupgrid.cappages *= 2;
}

View file

@ -591,7 +591,6 @@ void T_BounceCheese(bouncecheese_t *bouncer)
if (bouncer->sector->crumblestate == CRUMBLE_RESTORE || bouncer->sector->crumblestate == CRUMBLE_WAIT
|| bouncer->sector->crumblestate == CRUMBLE_ACTIVATED) // Oops! Crumbler says to remove yourself!
{
bouncer->sector->crumblestate = CRUMBLE_WAIT;
bouncer->sector->ceilingdata = NULL;
bouncer->sector->ceilspeed = 0;
bouncer->sector->floordata = NULL;
@ -2149,12 +2148,11 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
}
}
#undef controlsec
// soundorg z height never gets set normally, so MEH.
sec->soundorg.z = sec->floorheight;
sec->soundorg.z = (controlsec->floorheight + controlsec->ceilingheight)/2;
S_StartSound(&sec->soundorg, mobjinfo[type].activesound);
#undef controlsec
// Find the outermost vertexes in the subsector
for (i = 0; i < sec->linecount; i++)
{

View file

@ -2337,13 +2337,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
break;
}
if (type != DMG_STING && type != DMG_STUMBLE)
if (type != DMG_STUMBLE)
{
player->flashing = K_GetKartFlashing(player);
}
if (type != DMG_STING)
player->flashing = K_GetKartFlashing(player);
if (ringburst > 0)
{
P_PlayRinglossSound(target);
P_PlayerRingBurst(player, ringburst);
}
@ -2356,7 +2354,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
}
else
{
K_DropHnextList(player, false);
K_DropHnextList(player, (type != DMG_STUMBLE));
}
if (type != DMG_STUMBLE)

View file

@ -4589,7 +4589,7 @@ static void P_ConvertBinaryLinedefTypes(void)
//Flags
if (lines[i].flags & ML_BLOCKPLAYERS)
lines[i].args[6] |= TMFR_REVERSE;
if (lines[i].flags & ML_BLOCKPLAYERS)
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[6] |= TMFR_SPINDASH;
lines[i].special = 190;
@ -6018,7 +6018,9 @@ static void P_ConvertBinarySectorTypes(void)
case 8: //Instakill
sectors[i].damagetype = SD_INSTAKILL;
break;
case 9: // Stumble
//case 9: -- Ring Drainer (Floor Touch)
//case 10: -- Ring Drainer (No Floor Touch)
case 11: // Stumble
sectors[i].damagetype = SD_STUMBLE;
break;
case 12: //Wall sector

View file

@ -201,10 +201,14 @@ void P_ReconfigureViaVertexes (pslope_t *slope, const vector3_t v1, const vector
static void ReconfigureViaConstants (pslope_t *slope, const fixed_t a, const fixed_t b, const fixed_t c, const fixed_t d)
{
fixed_t m;
fixed_t o = 0;
vector3_t *normal = &slope->normal;
if (c)
o = abs(c) <= FRACUNIT ? -FixedMul(d, FixedDiv(FRACUNIT, c)) : -FixedDiv(d, c);
// Set origin.
FV3_Load(&slope->o, 0, 0, c ? -FixedDiv(d, c) : 0);
FV3_Load(&slope->o, 0, 0, o);
// Get slope's normal.
FV3_Load(normal, a, b, c);

View file

@ -1608,7 +1608,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
// "Trigger on X calls" linedefs reset if args[2] is set
if (specialtype == 321 && triggerline->args[2])
triggerline->callcount = triggerline->args[3];
triggerline->callcount = triggerline->args[1];
else
{
// These special types work only once

View file

@ -675,7 +675,13 @@ void SCR_ClosedCaptions(void)
y = basey-((i + 2)*10);
if (closedcaptions[i].b)
y -= (closedcaptions[i].b--)*vid.dupy;
{
y -= closedcaptions[i].b * vid.dupy;
if (renderisnewtic)
{
closedcaptions[i].b--;
}
}
if (closedcaptions[i].t < CAPTIONFADETICS)
flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS);

View file

@ -22,86 +22,7 @@ include("cpm-discordrpc.cmake")
include("cpm-xmp-lite.cmake")
include("cpm-fmt.cmake")
include("cpm-imgui.cmake")
if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
CPMAddPackage(
NAME acsvm
VERSION 0
URL "https://github.com/DavidPH/ACSVM/archive/7011af443dd03e8592d7810b0b91f46c49bdde59.zip"
EXCLUDE_FROM_ALL ON
DOWNLOAD_ONLY YES
)
if(acsvm_ADDED)
# Sal -- While ACSVM can be built as a shared library, a lot of its options are
# tied to directories existing, because the project suggests just copying it into
# your own project directly. I don't want us to do that, so I made our own target.
set(
acsvm_SOURCES
ACSVM/Action.cpp
ACSVM/Action.hpp
ACSVM/Array.cpp
ACSVM/Array.hpp
ACSVM/BinaryIO.cpp
ACSVM/BinaryIO.hpp
ACSVM/CallFunc.cpp
ACSVM/CallFunc.hpp
ACSVM/Code.hpp
ACSVM/CodeData.cpp
ACSVM/CodeData.hpp
ACSVM/CodeList.hpp
ACSVM/Environment.cpp
ACSVM/Environment.hpp
ACSVM/Error.cpp
ACSVM/Error.hpp
ACSVM/Function.cpp
ACSVM/Function.hpp
ACSVM/HashMap.hpp
ACSVM/HashMapFixed.hpp
ACSVM/ID.hpp
ACSVM/Init.cpp
ACSVM/Init.hpp
ACSVM/Jump.cpp
ACSVM/Jump.hpp
ACSVM/Module.cpp
ACSVM/Module.hpp
ACSVM/ModuleACS0.cpp
ACSVM/ModuleACSE.cpp
ACSVM/PrintBuf.cpp
ACSVM/PrintBuf.hpp
ACSVM/Scope.cpp
ACSVM/Scope.hpp
ACSVM/Script.cpp
ACSVM/Script.hpp
ACSVM/Serial.cpp
ACSVM/Serial.hpp
ACSVM/Stack.hpp
ACSVM/Store.hpp
ACSVM/String.cpp
ACSVM/String.hpp
ACSVM/Thread.cpp
ACSVM/Thread.hpp
ACSVM/ThreadExec.cpp
ACSVM/Tracer.cpp
ACSVM/Tracer.hpp
ACSVM/Types.hpp
ACSVM/Vector.hpp
Util/Floats.cpp
Util/Floats.hpp
)
list(TRANSFORM acsvm_SOURCES PREPEND "${acsvm_SOURCE_DIR}/")
add_library(acsvm "${SRB2_INTERNAL_LIBRARY_TYPE}" ${acsvm_SOURCES})
target_compile_features(acsvm PRIVATE cxx_std_11)
target_include_directories(acsvm INTERFACE "${acsvm_SOURCE_DIR}")
target_link_libraries(acsvm PRIVATE acsvm::acsvm)
add_library(acsvm::acsvm ALIAS acsvm)
endif()
endif()
include("cpm-acsvm.cmake")
add_subdirectory(tcbrindle_span)
add_subdirectory(stb_vorbis)

77
thirdparty/cpm-acsvm.cmake vendored Normal file
View file

@ -0,0 +1,77 @@
CPMAddPackage(
NAME acsvm
VERSION 0
URL "https://github.com/DavidPH/ACSVM/archive/7011af443dd03e8592d7810b0b91f46c49bdde59.zip"
EXCLUDE_FROM_ALL ON
DOWNLOAD_ONLY YES
)
if(acsvm_ADDED)
# Sal -- While ACSVM can be built as a shared library, a lot of its options are
# tied to directories existing, because the project suggests just copying it into
# your own project directly. I don't want us to do that, so I made our own target.
set(
acsvm_SOURCES
ACSVM/Action.cpp
ACSVM/Action.hpp
ACSVM/Array.cpp
ACSVM/Array.hpp
ACSVM/BinaryIO.cpp
ACSVM/BinaryIO.hpp
ACSVM/CallFunc.cpp
ACSVM/CallFunc.hpp
ACSVM/Code.hpp
ACSVM/CodeData.cpp
ACSVM/CodeData.hpp
ACSVM/CodeList.hpp
ACSVM/Environment.cpp
ACSVM/Environment.hpp
ACSVM/Error.cpp
ACSVM/Error.hpp
ACSVM/Function.cpp
ACSVM/Function.hpp
ACSVM/HashMap.hpp
ACSVM/HashMapFixed.hpp
ACSVM/ID.hpp
ACSVM/Init.cpp
ACSVM/Init.hpp
ACSVM/Jump.cpp
ACSVM/Jump.hpp
ACSVM/Module.cpp
ACSVM/Module.hpp
ACSVM/ModuleACS0.cpp
ACSVM/ModuleACSE.cpp
ACSVM/PrintBuf.cpp
ACSVM/PrintBuf.hpp
ACSVM/Scope.cpp
ACSVM/Scope.hpp
ACSVM/Script.cpp
ACSVM/Script.hpp
ACSVM/Serial.cpp
ACSVM/Serial.hpp
ACSVM/Stack.hpp
ACSVM/Store.hpp
ACSVM/String.cpp
ACSVM/String.hpp
ACSVM/Thread.cpp
ACSVM/Thread.hpp
ACSVM/ThreadExec.cpp
ACSVM/Tracer.cpp
ACSVM/Tracer.hpp
ACSVM/Types.hpp
ACSVM/Vector.hpp
Util/Floats.cpp
Util/Floats.hpp
)
list(TRANSFORM acsvm_SOURCES PREPEND "${acsvm_SOURCE_DIR}/")
add_library(acsvm "${SRB2_INTERNAL_LIBRARY_TYPE}" ${acsvm_SOURCES})
target_compile_features(acsvm PRIVATE cxx_std_11)
target_include_directories(acsvm INTERFACE "${acsvm_SOURCE_DIR}")
target_link_libraries(acsvm PRIVATE acsvm::acsvm)
add_library(acsvm::acsvm ALIAS acsvm)
endif()