diff --git a/source/common/engine/palettecontainer.cpp b/source/common/engine/palettecontainer.cpp index 2e85bd688..ae4f4a829 100644 --- a/source/common/engine/palettecontainer.cpp +++ b/source/common/engine/palettecontainer.cpp @@ -32,6 +32,7 @@ ** */ +#include #include "palutil.h" #include "sc_man.h" #include "m_crc32.h" diff --git a/source/common/engine/serializer.cpp b/source/common/engine/serializer.cpp index 4e4364c96..261aa464c 100644 --- a/source/common/engine/serializer.cpp +++ b/source/common/engine/serializer.cpp @@ -55,6 +55,7 @@ #include "textures.h" #include "texturemanager.h" #include "base64.h" +#include "vm.h" #include "i_interface.h" using namespace FileSys; @@ -1591,6 +1592,35 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, Dictionary } } +template<> FSerializer& Serialize(FSerializer& arc, const char* key, VMFunction*& func, VMFunction**) +{ + if (arc.isWriting()) + { + arc.WriteKey(key); + if (func) arc.w->String(func->QualifiedName); + else arc.w->Null(); + } + else + { + func = nullptr; + + auto val = arc.r->FindKey(key); + if (val != nullptr && val->IsString()) + { + auto qname = val->GetString(); + size_t p = strcspn(qname, "."); + if (p != 0) + { + FName clsname(qname, p, true); + FName funcname(qname + p + 1, true); + func = PClass::FindFunction(clsname, funcname); + } + } + + } + return arc; +} + //========================================================================== // // Handler to retrieve a numeric value of any kind. diff --git a/source/common/engine/serializer.h b/source/common/engine/serializer.h index 047d43f54..29677237b 100644 --- a/source/common/engine/serializer.h +++ b/source/common/engine/serializer.h @@ -324,6 +324,7 @@ inline FSerializer& Serialize(FSerializer& arc, const char* key, BitArray& value template<> FSerializer& Serialize(FSerializer& arc, const char* key, PClass*& clst, PClass** def); template<> FSerializer& Serialize(FSerializer& arc, const char* key, FFont*& font, FFont** def); template<> FSerializer &Serialize(FSerializer &arc, const char *key, Dictionary *&dict, Dictionary **def); +template<> FSerializer& Serialize(FSerializer& arc, const char* key, VMFunction*& dict, VMFunction** def); inline FSerializer &Serialize(FSerializer &arc, const char *key, DVector3 &p, DVector3 *def) { diff --git a/source/common/objects/autosegs.cpp b/source/common/objects/autosegs.cpp index 11fce1005..e9b3f935f 100644 --- a/source/common/objects/autosegs.cpp +++ b/source/common/objects/autosegs.cpp @@ -42,6 +42,7 @@ ** compile with something other than Visual C++ or GCC. */ +#include #include "autosegs.h" #ifdef _WIN32 diff --git a/source/common/objects/autosegs.h b/source/common/objects/autosegs.h index 838553dd4..e015ea9f5 100644 --- a/source/common/objects/autosegs.h +++ b/source/common/objects/autosegs.h @@ -36,6 +36,7 @@ #define AUTOSEGS_H #include +#include #if defined(__clang__) #if defined(__has_feature) && __has_feature(address_sanitizer) diff --git a/source/common/platform/posix/sdl/i_joystick.cpp b/source/common/platform/posix/sdl/i_joystick.cpp index 3ff0cc169..a7eb59568 100644 --- a/source/common/platform/posix/sdl/i_joystick.cpp +++ b/source/common/platform/posix/sdl/i_joystick.cpp @@ -268,7 +268,9 @@ protected: friend class SDLInputJoystickManager; }; -const EJoyAxis SDLInputJoystick::DefaultAxes[5] = {JOYAXIS_Side, JOYAXIS_Forward, JOYAXIS_Pitch, JOYAXIS_Yaw, JOYAXIS_Up}; + +// [Nash 4 Feb 2024] seems like on Linux, the third axis is actually the Left Trigger, resulting in the player uncontrollably looking upwards. +const EJoyAxis SDLInputJoystick::DefaultAxes[5] = {JOYAXIS_Side, JOYAXIS_Forward, JOYAXIS_None, JOYAXIS_Yaw, JOYAXIS_Pitch}; class SDLInputJoystickManager { diff --git a/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp b/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp index 4534829ab..c51ce2ee9 100644 --- a/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp +++ b/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp @@ -146,27 +146,11 @@ float VREyeInfo::getShift() const return vr_swap_eyes ? -res : res; } -VSMatrix VREyeInfo::GetProjection(float fov, float aspectRatio, float fovRatio, bool iso_ortho) const +VSMatrix VREyeInfo::GetProjection(float fov, float aspectRatio, float fovRatio) const { VSMatrix result; - if (iso_ortho) // Orthographic projection for isometric viewpoint - { - double zNear = -1.0; // screen->GetZNear(); - double zFar = screen->GetZFar(); - - double fH = tan(DEG2RAD(fov) / 2) / fovRatio; - double fW = fH * aspectRatio * mScaleFactor; - double left = -fW; - double right = fW; - double bottom = -fH; - double top = fH; - - VSMatrix fmat(1); - fmat.ortho((float)left, (float)right, (float)bottom, (float)top, (float)zNear, (float)zFar); - return fmat; - } - else if (mShiftFactor == 0) + if (mShiftFactor == 0) { float fovy = (float)(2 * RAD2DEG(atan(tan(DEG2RAD(fov) / 2) / fovRatio))); result.perspective(fovy, aspectRatio, screen->GetZNear(), screen->GetZFar()); diff --git a/source/common/rendering/hwrenderer/data/hw_vrmodes.h b/source/common/rendering/hwrenderer/data/hw_vrmodes.h index 989281520..26c9fd211 100644 --- a/source/common/rendering/hwrenderer/data/hw_vrmodes.h +++ b/source/common/rendering/hwrenderer/data/hw_vrmodes.h @@ -27,7 +27,7 @@ struct VREyeInfo float mShiftFactor; float mScaleFactor; - VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio, bool iso_ortho) const; + VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio) const; DVector3 GetViewShift(float yaw) const; private: float getShift() const; diff --git a/source/common/textures/bitmap.h b/source/common/textures/bitmap.h index 2828be356..418f256c2 100644 --- a/source/common/textures/bitmap.h +++ b/source/common/textures/bitmap.h @@ -36,6 +36,7 @@ #ifndef __BITMAP_H__ #define __BITMAP_H__ +#include #include "palentry.h" struct FCopyInfo; diff --git a/source/common/thirdparty/md5.h b/source/common/thirdparty/md5.h index f3aab94d9..95ac9a50d 100644 --- a/source/common/thirdparty/md5.h +++ b/source/common/thirdparty/md5.h @@ -18,6 +18,8 @@ #ifndef MD5_H #define MD5_H +#include + struct MD5Context { MD5Context() { Init(); } diff --git a/source/common/utility/engineerrors.cpp b/source/common/utility/engineerrors.cpp index 41485778a..05897b786 100644 --- a/source/common/utility/engineerrors.cpp +++ b/source/common/utility/engineerrors.cpp @@ -35,8 +35,9 @@ bool gameisdead; -#ifdef _WIN32 #include + +#ifdef _WIN32 #include #include "zstring.h" void I_DebugPrint(const char *cp) diff --git a/source/common/utility/palette.cpp b/source/common/utility/palette.cpp index ea046a220..03517c1ba 100644 --- a/source/common/utility/palette.cpp +++ b/source/common/utility/palette.cpp @@ -33,6 +33,8 @@ */ #include +#include +#include #include "palutil.h" #include "palentry.h" #include "sc_man.h" diff --git a/source/common/utility/writezip.cpp b/source/common/utility/writezip.cpp index a6f6f9a27..2f3507e6f 100644 --- a/source/common/utility/writezip.cpp +++ b/source/common/utility/writezip.cpp @@ -39,6 +39,7 @@ #include "files.h" #include "m_swap.h" #include "w_zip.h" +#include "fs_decompress.h" using FileSys::FCompressedBuffer; diff --git a/source/common/widgets/netstartwindow.cpp b/source/common/widgets/netstartwindow.cpp index c45f30098..69c83e565 100644 --- a/source/common/widgets/netstartwindow.cpp +++ b/source/common/widgets/netstartwindow.cpp @@ -2,6 +2,7 @@ #include "netstartwindow.h" #include "version.h" #include "engineerrors.h" +#include "gstrings.h" #include #include #include