diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f97c173c..4447614d3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,6 +18,7 @@ set(SRB2_CORE_SOURCES filesrch.c g_game.c g_input.c + g_splitscreen.c hu_stuff.c i_tcp.c info.c @@ -156,7 +157,13 @@ set(SRB2_CORE_GAME_SOURCES p_telept.c p_tick.c p_user.c + k_battle.c + k_bheap.c + k_collide.c k_kart.c + k_pathfind.c + k_pwrlv.c + k_waypoint.c p_local.h p_maputl.h @@ -168,7 +175,13 @@ set(SRB2_CORE_GAME_SOURCES p_slopes.h p_spec.h p_tick.h + k_battle.h + k_bheap.h + k_collide.h k_kart.h + k_pathfind.h + k_pwrlv.h + k_waypoint.h ) if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) diff --git a/src/p_slopes.c b/src/p_slopes.c index e623b6f19..03c1205f6 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -54,6 +54,13 @@ static void P_ReconfigureVertexSlope(pslope_t *slope) max(max(abs(vec1.x), abs(vec1.y)), abs(vec1.z)), max(max(abs(vec2.x), abs(vec2.y)), abs(vec2.z)) ) >> (FRACBITS+5); + + if (slope->extent == 0) + { + // Prevent divide by zero + slope->extent = 1; + } + vec1.x /= slope->extent; vec1.y /= slope->extent; vec1.z /= slope->extent; diff --git a/src/p_spec.c b/src/p_spec.c index 6debb5df2..95289b9a7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7164,9 +7164,15 @@ static void P_SpawnScrollers(void) { fixed_t dx = l->dx >> SCROLL_SHIFT; // direction and speed of scrolling fixed_t dy = l->dy >> SCROLL_SHIFT; + + fixed_t bx = 0;/* backside variants */ + fixed_t by = 0; + INT32 control = -1, accel = 0; // no control sector or acceleration INT32 special = l->special; + INT32 s; + // These types are same as the ones they get set to except that the // first side's sector's heights cause scrolling when they change, and // this linedef controls the direction and speed of the scrolling. The @@ -7195,10 +7201,24 @@ static void P_SpawnScrollers(void) control = (INT32)(sides[*l->sidenum].sector - sectors); } + if (special == 507) // front and back scrollers + { + s = l->sidenum[0]; + + dx = -(sides[s].textureoffset); + dy = sides[s].rowoffset; + + s = l->sidenum[1]; + + if (s != 0xffff) + { + bx = -(sides[s].textureoffset); + by = sides[s].rowoffset; + } + } + switch (special) { - register INT32 s; - case 513: // scroll effect ceiling case 533: // scroll and carry objects on ceiling for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;) @@ -7251,6 +7271,18 @@ static void P_SpawnScrollers(void) CONS_Debug(DBG_GAMELOGIC, "Line special 506 (line #%s) missing 2nd side!\n", sizeu1(i)); break; + case 507: // scroll front and backside of tagged lines + for (s = -1; (s = P_FindLineFromLineTag(l, s)) >= 0 ;) + { + if (s != (INT32)i) + { + Add_Scroller(sc_side, dx, dy, control, lines[s].sidenum[0], accel, 0); + if (lines[s].sidenum[1] != 0xffff) + Add_Scroller(sc_side, bx, by, control, lines[s].sidenum[1], accel, 0); + } + } + break; + case 500: // scroll first side Add_Scroller(sc_side, FRACUNIT, 0, -1, lines[i].sidenum[0], accel, 0); break;