From 8634e397fa8c2626abc3f183ba95ee1f3db49ff8 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 27 Jan 2023 21:55:19 +0000 Subject: [PATCH] Fix terrible headtracking in Blood --- android/Android_src.mk | 6 ------ source/core/rendering/hw_entrypoint.cpp | 9 ++++++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/android/Android_src.mk b/android/Android_src.mk index 08cecf0d7..c3f864e09 100644 --- a/android/Android_src.mk +++ b/android/Android_src.mk @@ -17,17 +17,11 @@ LOCAL_MODULE := raze LOCAL_CFLAGS := -D$(OPENXR_HMD) -funsigned-char -DHAVE_GLES2 -DUSE_OPENGL -DNO_CLOCK_GETTIME -DUSE_GL_HW_BUFFERS -fvisibility=hidden -frtti -D__MOBILE__ -DOPNMIDI_DISABLE_GX_EMULATOR -DGZDOOM -DGZDOOM_GL3 -D__STDINT_LIMITS -DENGINE_NAME=\"gzdoom_dev\" LOCAL_CPPFLAGS := -D$(OPENXR_HMD) -include g_pch.h -DHAVE_FLUIDSYNTH -DHAVE_MPG123 -DHAVE_SNDFILE -std=c++17 -Wno-inconsistent-missing-override -Werror=format-security -fexceptions -fpermissive -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D__forceinline=inline -DNO_GTK -DNO_SSE -LOCAL_CFLAGS += -DNO_SEND_STATS - LOCAL_CFLAGS += -DOPNMIDI_USE_LEGACY_EMULATOR LOCAL_CFLAGS += -DADLMIDI_DISABLE_MUS_SUPPORT -DADLMIDI_DISABLE_XMI_SUPPORT -DADLMIDI_DISABLE_MIDI_SEQUENCER LOCAL_CFLAGS += -DOPNMIDI_DISABLE_MUS_SUPPORT -DOPNMIDI_DISABLE_XMI_SUPPORT -DOPNMIDI_DISABLE_MIDI_SEQUENCER -ifeq ($(BUILD_SERIAL),1) -LOCAL_CPPFLAGS += -DANTI_HACK -endif - LOCAL_C_INCLUDES := \ $(TOP_DIR)/../../../../../3rdParty/khronos/openxr/OpenXR-SDK/include \ $(TOP_DIR)/../../../../../3rdParty/khronos/openxr/OpenXR-SDK/src/common \ diff --git a/source/core/rendering/hw_entrypoint.cpp b/source/core/rendering/hw_entrypoint.cpp index faace91a8..35cff4c71 100644 --- a/source/core/rendering/hw_entrypoint.cpp +++ b/source/core/rendering/hw_entrypoint.cpp @@ -208,8 +208,11 @@ FRenderViewpoint SetupViewpoint(DCoreActor* cam, const DVector3& position, int s float dummy, yaw, pitch, roll; VR_GetMove(&dummy, &dummy, &dummy, &dummy, &dummy, &yaw, &pitch, &roll); - //Don't do the following if rendering a camera tex - if (!cam || !(cam->spr.cstat & CSTAT_SPRITE_INVISIBLE)) + //Special handling for Duke's security cameras + bool renderingSecurityCamera = isDuke() && (cam && cam->spr.cstat & CSTAT_SPRITE_INVISIBLE); + + //Only do the following if not rendering a camera tex + if (!renderingSecurityCamera) { //Yaw float hmdYawDeltaDegrees; @@ -238,7 +241,7 @@ FRenderViewpoint SetupViewpoint(DCoreActor* cam, const DVector3& position, int s r_viewpoint.SectNums = nullptr; r_viewpoint.SectCount = sectnum; r_viewpoint.Pos = { position.X, -position.Y, -position.Z }; - if (cam && cam->spr.cstat & CSTAT_SPRITE_INVISIBLE) + if (renderingSecurityCamera) { r_viewpoint.HWAngles.Yaw = FAngle::fromDeg(-90.f + (float)angles.Yaw.Degrees()); }