From 43f4962561558cf0eb72992a89bdb200951fffc9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 Oct 2022 23:23:10 +0200 Subject: [PATCH] - got rid of the global compatibility modes and made 'precise' a parameter for clipmove. This better reflects how this stuff gets used. --- source/build/include/build.h | 28 ++------------------ source/build/src/clip.cpp | 13 ++++----- source/common/models/voxels.h | 1 + source/common/utility/vectors.h | 2 +- source/core/actorlist.cpp | 1 - source/core/automap.h | 1 + source/core/cheats.cpp | 2 +- source/core/coreactor.h | 6 ++--- source/core/gamecontrol.cpp | 2 +- source/core/gamecontrol.h | 2 +- source/core/gamefuncs.cpp | 8 +++--- source/core/gamefuncs.h | 6 ++++- source/core/gamehud.cpp | 2 +- source/core/mainloop.cpp | 2 +- source/core/maploader.cpp | 1 - source/core/models/modeldata.cpp | 2 -- source/core/music/s_advsound.cpp | 1 + source/core/precache.cpp | 2 +- source/core/rendering/hw_palmanager.cpp | 2 +- source/core/rendering/hw_sections.h | 3 ++- source/core/rendering/hw_voxels.cpp | 2 +- source/core/rendering/scene/hw_bunchdrawer.h | 1 + source/core/rendering/scene/hw_drawstructs.h | 2 +- source/core/sectorgeometry.cpp | 1 - source/core/sectorgeometry.h | 2 +- source/core/textures/buildtiles.h | 4 +-- source/core/thingdef_properties.cpp | 1 + source/games/blood/src/actor.cpp | 14 ++++------ source/games/blood/src/blood.cpp | 2 -- source/games/blood/src/gameutil.cpp | 4 +-- source/games/blood/src/gameutil.h | 2 +- source/games/duke/src/constants.h | 1 + source/games/duke/src/game.cpp | 1 - source/games/duke/src/gameexec.cpp | 2 +- source/games/exhumed/src/2d.cpp | 2 +- source/games/exhumed/src/exhumed.cpp | 2 -- source/games/sw/src/game.cpp | 1 - source/games/sw/src/game.h | 2 +- 38 files changed, 54 insertions(+), 79 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index 40f3d57ce..2cf24def8 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -10,36 +10,12 @@ #ifndef build_h_ #define build_h_ - -#define TRANSPARENT_INDEX 0 - -static_assert('\xff' == 255, "Char must be unsigned!"); - +/* #include "printf.h" #include "palette.h" #include "c_cvars.h" #include "cmdlib.h" - -typedef int64_t coord_t; - -#define POINT2(i) (wall[wall[i].point2]) - - #include "maptypes.h" - -enum { - ENGINECOMPATIBILITY_NONE = 0, - ENGINECOMPATIBILITY_19950829, // Powerslave/Exhumed - ENGINECOMPATIBILITY_19960925, // Blood v1.21 - ENGINECOMPATIBILITY_19961112, // Duke 3d v1.5, Redneck Rampage -}; - -inline int32_t enginecompatibility_mode; - - -inline int32_t ksqrt(uint64_t num) -{ - return int(sqrt(double(num))); -} +*/ #endif // build_h_ diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index deafd76e7..b1dce7fed 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -106,7 +106,7 @@ static inline void keepaway(MoveClipper& clip, int32_t *x, int32_t *y, int32_t w // clipmove // CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, int32_t yvect, - int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype, int clipmoveboxtracenum) + int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype, int clipmoveboxtracenum, bool precise) { if ((xvect|yvect) == 0 || *sectnum < 0) return {}; @@ -119,7 +119,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, //Extra walldist for sprites on sector lines vec2_t const diff = { goal.X - (pos->X), goal.Y - (pos->Y) }; - int32_t const rad = ksqrt((int64_t)diff.X * diff.X + (int64_t)diff.Y * diff.Y) + MAXCLIPDIST + walldist + 8; + int32_t const rad = (int)g_sqrt(diff.X * diff.X + diff.Y * diff.Y) + MAXCLIPDIST + walldist + 8; vec2_t const clipMin = { cent.X - rad, cent.Y - rad }; vec2_t const clipMax = { cent.X + rad, cent.Y + rad }; @@ -136,6 +136,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, clip.dest = { goal.X * inttoworld, goal.Y * inttoworld }; clip.center = (clip.pos.XY() + clip.dest) * 0.5; clip.movedist = clip.moveDelta.Length() + clip.walldist + 0.5 + MAXCLIPDIST * inttoworld; + clip.precise = precise; collectClipObjects(clip, (cliptype >> 16)); @@ -146,7 +147,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, do { - if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE && (xvect|yvect)) + if (clip.precise && (xvect|yvect)) { for (int i=clip.clipobjects.Size() - 1; i >= 0; --i) { @@ -192,7 +193,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, if ((tempint ^ tempint2) < 0) { - if (enginecompatibility_mode == ENGINECOMPATIBILITY_19961112) + if (!clip.precise) { auto sectp = §or[*sectnum]; updatesector(DVector2(pos->X * inttoworld, pos->Y * inttoworld), §p); @@ -211,7 +212,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, hitwalls[cnt] = hitwall; } - if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) + if (clip.precise) { DVector2 v(vec.X* inttoworld, vec.Y* inttoworld); sectortype* sect = §or[*sectnum]; @@ -224,7 +225,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, cnt--; } while ((xvect|yvect) != 0 && hitwall >= 0 && cnt > 0); - if (enginecompatibility_mode != ENGINECOMPATIBILITY_NONE) + if (!clip.precise) { DVector3 fpos(pos->X* inttoworld, pos->Y* inttoworld, pos->Z* zinttoworld); diff --git a/source/common/models/voxels.h b/source/common/models/voxels.h index 52299434a..2a172c8ea 100644 --- a/source/common/models/voxels.h +++ b/source/common/models/voxels.h @@ -2,6 +2,7 @@ #define __RES_VOXEL_H #include +#include "vectors.h" // [RH] Voxels from Build enum diff --git a/source/common/utility/vectors.h b/source/common/utility/vectors.h index c861ffdfa..517434341 100644 --- a/source/common/utility/vectors.h +++ b/source/common/utility/vectors.h @@ -1538,7 +1538,7 @@ TAngle TVector3::Pitch() const template constexpr inline TVector2 clamp(const TVector2 &vec, const TVector2 &min, const TVector2 &max) { - return TVector2(clamp(vec.X, min.X, max.X), clamp(vec.Y, min.Y, max.Y)); + return TVector2(std::clamp(vec.X, min.X, max.X), std::clamp(vec.Y, min.Y, max.Y)); } template diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index 5cf1fc10d..98ac5814d 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -32,7 +32,6 @@ ** */ -#include "build.h" #include "coreactor.h" #include "gamefuncs.h" #include "raze_sound.h" diff --git a/source/core/automap.h b/source/core/automap.h index c7e208d50..89bf09f37 100644 --- a/source/core/automap.h +++ b/source/core/automap.h @@ -4,6 +4,7 @@ #include "build.h" #include "c_cvars.h" #include "palentry.h" +#include "maptypes.h" class FSerializer; struct event_t; diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index 90123817f..8b337d163 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -33,7 +33,6 @@ ** */ -#include "build.h" #include "gamestruct.h" #include "printf.h" #include "c_cvars.h" @@ -46,6 +45,7 @@ #include "screenjob.h" #include "mapinfo.h" #include "statistics.h" +#include "filesystem.h" CVAR(Bool, sv_cheats, false, CVAR_ARCHIVE|CVAR_SERVERINFO) CVAR(Bool, cl_blockcheats, false, 0) diff --git a/source/core/coreactor.h b/source/core/coreactor.h index f50003909..e2885b606 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -483,14 +483,14 @@ void SetActorZ(DCoreActor* actor, const DVector3& newpos); void SetActor(DCoreActor* actor, const DVector3& newpos); CollisionBase clipmove_(vec3_t* const pos, int* const sectnum, int32_t xvect, int32_t yvect, int32_t const walldist, int32_t const ceildist, - int32_t const flordist, uint32_t const cliptype, int clipmoveboxtracenum = 3); + int32_t const flordist, uint32_t const cliptype, int clipmoveboxtracenum, bool precise); inline int clipmove(DVector3& pos, sectortype** const sect, const DVector2& mvec, - double const walldist, double const ceildist, double const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3) + double const walldist, double const ceildist, double const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3, bool precise = false) { auto vect = vec3_t(int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint)); int sectno = *sect ? sector.IndexOf(*sect) : -1; - result = clipmove_(&vect, §no, FloatToFixed<18>(mvec.X), FloatToFixed<18>(mvec.Y), int(walldist * worldtoint), int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, clipmoveboxtracenum); + result = clipmove_(&vect, §no, FloatToFixed<18>(mvec.X), FloatToFixed<18>(mvec.Y), int(walldist * worldtoint), int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, clipmoveboxtracenum, precise); pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld }; *sect = sectno == -1 ? nullptr : §or[sectno]; return result.type; diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index e7472ee03..a8e9f8a98 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "c_cvars.h" #include "gameconfigfile.h" #include "gamecvars.h" -#include "build.h" +#include "buildtiles.h" #include "inputstate.h" #include "m_argv.h" #include "rts.h" diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index aee8f4eed..904571da6 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -11,7 +11,7 @@ #include "stats.h" #include "i_time.h" #include "palentry.h" -#include "build.h" +#include "dobject.h" EXTERN_CVAR(Bool, hud_textfont) diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index c9940433a..0849a7b54 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -29,9 +29,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "hw_voxels.h" #include "texinfo.h" #include "buildtiles.h" +#include "c_cvars.h" IntRect viewport3d; constexpr double MAXCLIPDISTF = 64; +CVAR(Int, strict_compatibility, 0, 0) //--------------------------------------------------------------------------- // @@ -860,7 +862,7 @@ bool checkRangeOfWall(walltype* wal, EWallFlags flagmask, const DVector3& pos, d if (BoxOnLineSide(boxtl, boxbr, pos1, pos2 - pos1) != -1) return false; auto closest = pos.XY(); - if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) // todo: need to check if it makes sense to have this always on. + if (!strict_compatibility) SquareDistToSector(closest.X, closest.Y, nextsect, &closest); calcSlope(nextsect, closest.X, closest.Y, &theZs[0], &theZs[1]); @@ -953,7 +955,7 @@ void getzrange(const DVector3& pos, sectortype* sect, double* ceilz, CollisionBa const ESpriteFlags dasprclipmask = ESpriteFlags::FromInt(cliptype >> 16); auto closest = pos.XY(); - if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) + if (!strict_compatibility) SquareDistToSector(closest.X, closest.Y, sect, &closest); calcSlope(sect, closest, ceilz, florz); @@ -1314,7 +1316,7 @@ static void addWallToClipSet(MoveClipper& clip, walltype* wal) #if 0 // What EDuke32 added here, this doesn't seem to make much sense // because it leaves gaps in the path from the 5 line segments being added here - if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) + if (!strict_compatibility) { if (wal->delta().RotatedCCW().dot(pos - startpt - distv1) < 0) v *= 0.5; diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index adeee895a..488df012a 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -2,11 +2,14 @@ #include "gamecontrol.h" #include "gamestruct.h" -#include "build.h" +#include "palette.h" #include "coreactor.h" #include "intrect.h" #include "geometry.h" #include "c_cvars.h" +#include "cmdlib.h" + +static_assert('\xff' == 255, "Char must be unsigned!"); extern IntRect viewport3d; @@ -271,6 +274,7 @@ struct MoveClipper double movedist; TArray clipobjects; BFSSectorSearch search; + bool precise; MoveClipper(sectortype* start) : search(start) {} }; diff --git a/source/core/gamehud.cpp b/source/core/gamehud.cpp index 732d1c316..e755d6ee1 100644 --- a/source/core/gamehud.cpp +++ b/source/core/gamehud.cpp @@ -41,7 +41,7 @@ #include "gamecontrol.h" #include "v_2ddrawer.h" #include "v_video.h" -#include "build.h" +#include "buildtiles.h" #include "v_draw.h" #include "v_font.h" #include "gamestruct.h" diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index 8c2d6b95f..da4f4f6bf 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -78,7 +78,7 @@ #include "uiinput.h" #include "v_video.h" #include "palette.h" -#include "build.h" +#include "buildtiles.h" #include "mapinfo.h" #include "automap.h" #include "statusbar.h" diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index 6351e350d..55b33f53e 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -34,7 +34,6 @@ */ #include -#include "build.h" #include "files.h" #include "automap.h" #include "printf.h" diff --git a/source/core/models/modeldata.cpp b/source/core/models/modeldata.cpp index 173d63113..d0343aaee 100644 --- a/source/core/models/modeldata.cpp +++ b/source/core/models/modeldata.cpp @@ -7,8 +7,6 @@ #include "tiletexture.h" #include "buildtiles.h" -#include "build.h" - int ModelManager::LoadModel(const char* fn) { diff --git a/source/core/music/s_advsound.cpp b/source/core/music/s_advsound.cpp index d98f6e794..1ff91dafa 100644 --- a/source/core/music/s_advsound.cpp +++ b/source/core/music/s_advsound.cpp @@ -46,6 +46,7 @@ #include #include "raze_music.h" +#include "ns.h" #include "games/duke/src/sounds.h" // MACROS ------------------------------------------------------------------ diff --git a/source/core/precache.cpp b/source/core/precache.cpp index 89581d657..2ae7301ca 100644 --- a/source/core/precache.cpp +++ b/source/core/precache.cpp @@ -33,7 +33,7 @@ ** */ #include "ns.h" -#include "build.h" +#include "buildtiles.h" #include "palette.h" #include "v_video.h" #include "hw_material.h" diff --git a/source/core/rendering/hw_palmanager.cpp b/source/core/rendering/hw_palmanager.cpp index b7f6f50ca..4ea74459b 100644 --- a/source/core/rendering/hw_palmanager.cpp +++ b/source/core/rendering/hw_palmanager.cpp @@ -41,7 +41,7 @@ #include "imagehelpers.h" #include "v_font.h" #include "palette.h" -#include "build.h" +#include "printf.h" #include "v_video.h" static PaletteManager* palmanager; diff --git a/source/core/rendering/hw_sections.h b/source/core/rendering/hw_sections.h index dc66f302d..74df3a0f8 100644 --- a/source/core/rendering/hw_sections.h +++ b/source/core/rendering/hw_sections.h @@ -1,6 +1,7 @@ #pragma once -#include "build.h" +#include "vectors.h" +#include "maptypes.h" enum ESectionFlag { diff --git a/source/core/rendering/hw_voxels.cpp b/source/core/rendering/hw_voxels.cpp index 89c1d7467..a9dca878c 100644 --- a/source/core/rendering/hw_voxels.cpp +++ b/source/core/rendering/hw_voxels.cpp @@ -26,11 +26,11 @@ ** **/ -#include "build.h" #include "voxels.h" #include "hw_voxels.h" #include "tiletexture.h" #include "gamecontrol.h" +#include "filesystem.h" static int voxlumps[MAXVOXELS]; float voxscale[MAXVOXELS]; diff --git a/source/core/rendering/scene/hw_bunchdrawer.h b/source/core/rendering/scene/hw_bunchdrawer.h index 504bb8aae..92206dc34 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.h +++ b/source/core/rendering/scene/hw_bunchdrawer.h @@ -2,6 +2,7 @@ #include "tarray.h" #include "basics.h" +#include "maptypes.h" struct HWDrawInfo; class Clipper; diff --git a/source/core/rendering/scene/hw_drawstructs.h b/source/core/rendering/scene/hw_drawstructs.h index 3f4edb4c8..c5cecc50e 100644 --- a/source/core/rendering/scene/hw_drawstructs.h +++ b/source/core/rendering/scene/hw_drawstructs.h @@ -7,7 +7,7 @@ #include "renderstyle.h" #include "textures.h" #include "fcolormap.h" -#include "build.h" +#include "buildtiles.h" #include "gamefuncs.h" #include "render.h" #include "matrix.h" diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 5dbcdd9b6..8a095d273 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -35,7 +35,6 @@ */ #include "sectorgeometry.h" -#include "build.h" #include "buildtiles.h" #include "gamefuncs.h" #include "texturemanager.h" diff --git a/source/core/sectorgeometry.h b/source/core/sectorgeometry.h index 4fb8a4b98..134f58176 100644 --- a/source/core/sectorgeometry.h +++ b/source/core/sectorgeometry.h @@ -2,7 +2,7 @@ #include "tarray.h" #include "vectors.h" -#include "build.h" +#include "maptypes.h" struct Section; diff --git a/source/core/textures/buildtiles.h b/source/core/textures/buildtiles.h index d24a42560..bf6d022e8 100644 --- a/source/core/textures/buildtiles.h +++ b/source/core/textures/buildtiles.h @@ -11,9 +11,9 @@ #include "texinfo.h" #include "texturemanager.h" +constexpr int TRANSPARENT_INDEX = 0; + // all that's left here is the wrappers that need to go away. - - inline const FTextureID spritetypebase::spritetexture() const { return tileGetTextureID(picnum); diff --git a/source/core/thingdef_properties.cpp b/source/core/thingdef_properties.cpp index d7aefe7ea..93b450045 100644 --- a/source/core/thingdef_properties.cpp +++ b/source/core/thingdef_properties.cpp @@ -45,6 +45,7 @@ #include "texturemanager.h" #include "coreactor.h" #include "thingdef.h" +#include "buildtiles.h" //========================================================================== // diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index d13c572f2..590a714fe 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2652,16 +2652,13 @@ static Collision MoveThing(DBloodActor* actor) lhit.setNone(); GetActorExtents(actor, &top, &bottom); - const int bakCompat = enginecompatibility_mode; if (actor->vel.X != 0 || actor->vel.Y != 0) { auto bakCstat = actor->spr.cstat; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; - if ((actor->GetOwner()) && !cl_bloodvanillaexplosions && !VanillaMode()) - enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy - ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), actor->clipdist, (actor->spr.pos.Z - top) * 0.25, (bottom - actor->spr.pos.Z) * 0.25, CLIPMASK0, lhit); + bool precise = ((actor->GetOwner()) && !cl_bloodvanillaexplosions && !VanillaMode()); + ClipMove(actor->spr.pos, &pSector, actor->vel.XY(), actor->clipdist, (actor->spr.pos.Z - top) * 0.25, (bottom - actor->spr.pos.Z) * 0.25, CLIPMASK0, lhit, 3, precise); actor->hit.hit = lhit; - enginecompatibility_mode = bakCompat; // restore actor->spr.cstat = bakCstat; assert(pSector); if (actor->sector() != pSector) @@ -3355,21 +3352,20 @@ int MoveMissile(DBloodActor* actor) double top, bottom; GetActorExtents(actor, &top, &bottom); int i = 1; - const int bakCompat = enginecompatibility_mode; const bool isFlameSprite = (actor->GetType() == kMissileFlameSpray || actor->GetType() == kMissileFlameHound); // do not use accurate clipmove for flame based sprites (changes damage too much) while (1) { auto ppos = actor->spr.pos; auto pSector2 = actor->sector(); const auto bakSpriteCstat = actor->spr.cstat; + bool precise = false; if (Owner && !isFlameSprite && !cl_bloodvanillaexplosions && !VanillaMode()) { - enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy + precise = true; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; // remove self collisions for accurate clipmove } Collision clipmoveresult; - ClipMove(ppos, &pSector2, vel.XY(), actor->clipdist, (ppos.Z - top) / 4, (bottom - ppos.Z) / 4, CLIPMASK0, clipmoveresult, 1); - enginecompatibility_mode = bakCompat; // restore + ClipMove(ppos, &pSector2, vel.XY(), actor->clipdist, (ppos.Z - top) / 4, (bottom - ppos.Z) / 4, CLIPMASK0, clipmoveresult, 1, precise); actor->spr.cstat = bakSpriteCstat; auto pSector = pSector2; if (pSector2 == nullptr) diff --git a/source/games/blood/src/blood.cpp b/source/games/blood/src/blood.cpp index 12f49cd22..8706e4865 100644 --- a/source/games/blood/src/blood.cpp +++ b/source/games/blood/src/blood.cpp @@ -647,8 +647,6 @@ void GameInterface::app_init() gChoke.init(518, chokeCallback); UpdateDacs(0, true); - enginecompatibility_mode = ENGINECOMPATIBILITY_19960925; - gViewIndex = myconnectindex; } diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 5bf6417e5..611accdf2 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -513,7 +513,7 @@ void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Col // //--------------------------------------------------------------------------- -void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, double wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount) +void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, double wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount, bool precise) { auto opos = pos; sectortype* bakSect = *pSector; @@ -524,7 +524,7 @@ void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, double vel.X = (FloatToFixed(vect.X) >> 12) / 16.; vel.Y = (FloatToFixed(vect.Y) >> 12) / 16.; - clipmove(pos, &bakSect, vel, wd, cd, fd, nMask, hit, tracecount); + clipmove(pos, &bakSect, vel, wd, cd, fd, nMask, hit, tracecount, precise); if (bakSect == nullptr) { pos = opos; diff --git a/source/games/blood/src/gameutil.h b/source/games/blood/src/gameutil.h index 499ce1eb7..fc30d0fbe 100644 --- a/source/games/blood/src/gameutil.h +++ b/source/games/blood/src/gameutil.h @@ -39,7 +39,7 @@ int VectorScan(DBloodActor* pSprite, double nOffset, double nZOffset, const DVec void GetZRange(DBloodActor* pSprite, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, double nDist, unsigned int nMask, unsigned int nClipParallax = 0); void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, double nDist, unsigned int nMask, unsigned int nClipParallax = 0); -void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, double wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3); +void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, double wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3, bool precise = false); BitArray GetClosestSpriteSectors(sectortype* pSector, const DVector2& pos, int nDist, TArray* pWalls, bool newSectCheckMethod = false); END_BLD_NS diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index 9c6f5e825..4a0355e72 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -1,6 +1,7 @@ #pragma once #include "tflags.h" #include "coreactor.h" +#include "buildtiles.h" // all game constants got collected here. diff --git a/source/games/duke/src/game.cpp b/source/games/duke/src/game.cpp index e5c914a51..cf2f90e46 100644 --- a/source/games/duke/src/game.cpp +++ b/source/games/duke/src/game.cpp @@ -458,7 +458,6 @@ void GameInterface::app_init() } ud.last_level = -1; - enginecompatibility_mode = ENGINECOMPATIBILITY_19961112;//bVanilla; S_ParseDeveloperCommentary(); } diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 87a604494..72a7b605a 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -2369,7 +2369,7 @@ int ParseState::parse(void) lInVarID = *(insptr++); lOutVarID = *(insptr++); lIn = GetGameVarID(lInVarID, g_ac, g_p).safeValue(); - SetGameVarID(lOutVarID, ksqrt(lIn), g_ac, g_p); + SetGameVarID(lOutVarID, (int)g_sqrt(lIn), g_ac, g_p); break; } case concmd_findnearactor: diff --git a/source/games/exhumed/src/2d.cpp b/source/games/exhumed/src/2d.cpp index 62753c156..ee7c86847 100644 --- a/source/games/exhumed/src/2d.cpp +++ b/source/games/exhumed/src/2d.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #include "ns.h" -#include "build.h" +#include "buildtiles.h" #include "exhumed.h" #include "names.h" #include "engine.h" diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 6199177ed..3b78a58a0 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -453,8 +453,6 @@ void GameInterface::app_init() GrabPalette(); - enginecompatibility_mode = ENGINECOMPATIBILITY_19961112; - myconnectindex = connecthead = 0; numplayers = 1; connectpoint2[0] = -1; diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index 227efc4ed..7c179c52a 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -308,7 +308,6 @@ void GameInterface::app_init() INITLIST(getPlayer(i)->PanelSpriteList); DebugOperate = true; - enginecompatibility_mode = ENGINECOMPATIBILITY_19961112; if (SW_SHAREWARE) Printf("SHADOW WARRIOR(tm) Version 1.2 (Shareware Version)\n"); diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 42aa6e3dc..dfda74ec6 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -32,7 +32,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #pragma warning(disable:4101) // there's too many of these... :( #endif -#include "build.h" +#include "buildtiles.h" #include "d_net.h" #include "gamefuncs.h" #include "coreactor.h"