From 1de9bbdbdb7358d7c7724487219110b87b66f460 Mon Sep 17 00:00:00 2001 From: XProger Date: Sat, 26 Nov 2022 01:28:52 +0300 Subject: [PATCH] minor fixes --- src/core.h | 2 +- src/platform/web/index.php | 7 +++++-- src/platform/win/OpenLara.vcxproj.user | 3 ++- src/platform/win/main.cpp | 1 - src/sound.h | 8 ++++---- src/utils.h | 16 ++++++++-------- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/core.h b/src/core.h index 5de961b..5bdb874 100644 --- a/src/core.h +++ b/src/core.h @@ -1371,7 +1371,7 @@ namespace Core { void endFrame() { if (active.target != defaultTarget) { - GAPI::setTarget(NULL, NULL, 0); + setTarget(NULL, NULL, 0); validateRenderState(); } GAPI::endFrame(); diff --git a/src/platform/web/index.php b/src/platform/web/index.php index 01d8939..da37606 100644 --- a/src/platform/web/index.php +++ b/src/platform/web/index.php @@ -10,6 +10,7 @@ body { margin: 0px; font-size: 1.0em; + touch-action: none; } .game_fs { position: fixed; @@ -32,7 +33,9 @@ - + + + @@ -221,7 +224,7 @@ // return "Really want to quit the game?"; //}; - var isMobile = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform); + var isMobile = !!navigator.platform && (/iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)); if (isMobile) { canvasElement.className = "game_fs"; diff --git a/src/platform/win/OpenLara.vcxproj.user b/src/platform/win/OpenLara.vcxproj.user index 96911a8..3552e3b 100644 --- a/src/platform/win/OpenLara.vcxproj.user +++ b/src/platform/win/OpenLara.vcxproj.user @@ -13,6 +13,7 @@ ..\..\..\bin\TR1_PSX WindowsLocalDebugger - PSXDATA/GYM.PSX + + \ No newline at end of file diff --git a/src/platform/win/main.cpp b/src/platform/win/main.cpp index faac780..36b341d 100644 --- a/src/platform/win/main.cpp +++ b/src/platform/win/main.cpp @@ -162,7 +162,6 @@ void joyInit() { for (int j = 0; j < INPUT_JOY_COUNT; j++) { if (_XInputGetState) { // XInput XINPUT_STATE state; - int res = _XInputGetState(j, &state); joyDevice[j].ready = (_XInputGetState(j, &state) == ERROR_SUCCESS); } else { // mmSystem (legacy) JOYINFOEX info; diff --git a/src/sound.h b/src/sound.h index db60d57..e8b5d28 100644 --- a/src/sound.h +++ b/src/sound.h @@ -510,10 +510,10 @@ namespace Sound { void resample(Frame *frames, short value) { predicate(value); - frames[0].L = frames[0].R = s2 + (s1 - s2) / 4; // 0.25 - frames[1].L = frames[1].R = s2 + (s1 - s2) / 2; // 0.50 - frames[2].L = frames[2].R = s2 + (s1 - s2) * 3 / 4; // 0.75 - frames[3].L = frames[3].R = s1; // 1.00 + frames[0].L = frames[0].R = s2 + (s1 - s2) / 4; // 0.25 + frames[1].L = frames[1].R = s2 + (s1 - s2) / 2; // 0.50 + frames[2].L = frames[2].R = s1 - (s1 - s2) / 4; // 0.75 + frames[3].L = frames[3].R = s1; // 1.00 } int processBlock() { diff --git a/src/utils.h b/src/utils.h index e3b83f7..79e5624 100644 --- a/src/utils.h +++ b/src/utils.h @@ -2405,17 +2405,17 @@ struct BitStream { BitStream(uint8 *data, int size) : data(data), end(data + size), index(0), value(0) {} inline uint32 readBit() { - uint32 bit; + uint32 bit; - if (!index--) { - value = *data++; - index = 7; - } + if (!index--) { + value = *data++; + index = 7; + } - bit = value & 1; - value >>= 1; + bit = value & 1; + value >>= 1; - return bit; + return bit; } uint32 read(int count) {