summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-08 23:05:26 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-08 23:05:26 +0200
commitd781db6c0f669eaccecee246260290aa20f70020 (patch)
treefc963b1e8f3c127a49095a127850bfc1cd09111e
parentMission audio cleanup + sound pause (diff)
parentUse CPad functions to check key states in script loader (diff)
downloadre3-d781db6c0f669eaccecee246260290aa20f70020.tar
re3-d781db6c0f669eaccecee246260290aa20f70020.tar.gz
re3-d781db6c0f669eaccecee246260290aa20f70020.tar.bz2
re3-d781db6c0f669eaccecee246260290aa20f70020.tar.lz
re3-d781db6c0f669eaccecee246260290aa20f70020.tar.xz
re3-d781db6c0f669eaccecee246260290aa20f70020.tar.zst
re3-d781db6c0f669eaccecee246260290aa20f70020.zip
-rw-r--r--.github/workflows/build-cmake-conan.yml9
-rw-r--r--README.md2
-rw-r--r--premake5.lua40
-rwxr-xr-xprintHash.sh24
-rw-r--r--src/audio/sampman_miles.cpp1
-rw-r--r--src/audio/sampman_null.cpp12
-rw-r--r--src/control/Script.cpp14
-rw-r--r--src/core/CdStreamPosix.cpp1
-rw-r--r--src/core/Frontend.cpp10
-rw-r--r--src/core/main.cpp2
-rw-r--r--src/skel/crossplatform.h1
m---------vendor/librw0
12 files changed, 68 insertions, 48 deletions
diff --git a/.github/workflows/build-cmake-conan.yml b/.github/workflows/build-cmake-conan.yml
index 609e9293..bf9b719f 100644
--- a/.github/workflows/build-cmake-conan.yml
+++ b/.github/workflows/build-cmake-conan.yml
@@ -27,7 +27,7 @@ jobs:
platform: 'gl3'
gl3_gfxlib: 'glfw'
audio: 'openal'
-# - os: 'ubuntu-latest'
+# - os: 'ubuntu-18.04'
# platform: 'gl3'
# gl3_gfxlib: 'sdl2'
# audio: 'openal'
@@ -63,8 +63,9 @@ jobs:
python -m pip install conan
conan config init
conan config set log.print_run_commands=True
- conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
- conan remote add madebr_ps2dev https://api.bintray.com/conan/madebr/ps2dev
+ conan config set general.revisions_enabled=1
+ conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan
+# conan remote add madebr_ps2dev https://api.bintray.com/conan/madebr/ps2dev
- name: "Add os=playstation2 + gcc.version=3.2 to .conan/settings.yml"
shell: python
run: |
@@ -85,7 +86,7 @@ jobs:
fi
- name: "Export Playstation 2 CMake toolchain conan recipe"
run: |
- conan export vendor/librw/cmake/ps2toolchain ps2dev-cmaketoolchain/master@
+ conan export vendor/librw/cmake/ps2/cmaketoolchain ps2dev-cmaketoolchain/master@
- name: "Export librw conan recipe"
run: |
conan export vendor/librw librw/master@
diff --git a/README.md b/README.md
index d7484fe5..b7caed99 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# reLCS
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dlcs&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=lcs)
-<a href="https://discord.gg/ERYg58ttcE"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>
+<a href="https://discord.gg/RFNbjsUMGg"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>
## Intro
diff --git a/premake5.lua b/premake5.lua
index 0da1b8a4..f8970b32 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -154,12 +154,18 @@ workspace "reLCS"
filter { "platforms:*arm*" }
architecture "ARM"
- filter { "platforms:macosx-arm64-*" }
+ filter { "platforms:macosx-arm64-*", "files:**.cpp"}
buildoptions { "-target", "arm64-apple-macos11", "-std=gnu++14" }
- filter { "platforms:macosx-amd64-*" }
+ filter { "platforms:macosx-arm64-*", "files:**.c"}
+ buildoptions { "-target", "arm64-apple-macos11" }
+
+ filter { "platforms:macosx-amd64-*", "files:**.cpp"}
buildoptions { "-target", "x86_64-apple-macos10.12", "-std=gnu++14" }
+ filter { "platforms:macosx-amd64-*", "files:**.c"}
+ buildoptions { "-target", "x86_64-apple-macos10.12" }
+
filter { "platforms:*librw_d3d9*" }
defines { "RW_D3D9" }
if(not _OPTIONS["with-librw"]) then
@@ -219,13 +225,19 @@ project "librw"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
- filter "platforms:macosx*"
- -- Support MacPorts and Homebrew
+ -- Support MacPorts and Homebrew
+ filter "platforms:macosx-arm64-*"
+ includedirs { "/opt/local/include" }
+ includedirs {"/opt/homebrew/include" }
+ libdirs { "/opt/local/lib" }
+ libdirs { "/opt/homebrew/lib" }
+
+ filter "platforms:macosx-amd64-*"
includedirs { "/opt/local/include" }
includedirs {"/usr/local/include" }
libdirs { "/opt/local/lib" }
libdirs { "/usr/local/lib" }
-
+
filter "platforms:*gl3_glfw*"
staticruntime "off"
@@ -386,6 +398,12 @@ project "reLCS"
filter "platforms:macosx*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
+
+ filter "platforms:macosx-arm64-*oal"
+ includedirs { "/opt/homebrew/opt/openal-soft/include" }
+ libdirs { "/opt/homebrew/opt/openal-soft/lib" }
+
+ filter "platforms:macosx-amd64-*oal"
includedirs { "/usr/local/opt/openal-soft/include" }
libdirs { "/usr/local/opt/openal-soft/lib" }
@@ -437,10 +455,18 @@ project "reLCS"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
- filter "platforms:macosx*gl3_glfw*"
+ filter "platforms:macosx-arm64-*gl3_glfw*"
links { "glfw" }
linkoptions { "-framework OpenGL" }
includedirs { "/opt/local/include" }
- includedirs { "/usr/local/include" }
+ includedirs {"/opt/homebrew/include" }
+ libdirs { "/opt/local/lib" }
+ libdirs { "/opt/homebrew/lib" }
+
+ filter "platforms:macosx-amd64-*gl3_glfw*"
+ links { "glfw" }
+ linkoptions { "-framework OpenGL" }
+ includedirs { "/opt/local/include" }
+ includedirs {"/usr/local/include" }
libdirs { "/opt/local/lib" }
libdirs { "/usr/local/lib" }
diff --git a/printHash.sh b/printHash.sh
index e7d6f018..213d9353 100755
--- a/printHash.sh
+++ b/printHash.sh
@@ -1,12 +1,14 @@
-#!/usr/bin/env bash
-
-> $1
-
-echo -n "#define GIT_SHA1 \"" > $1
-
-if (command -v "git" >/dev/null) then
-git rev-parse --short HEAD | tr -d '\n' >> $1
+#!/usr/bin/env sh
+if [ -z "${1}" ]
+ then
+ printf "%s\n" "Input the path to the file for writing the commit hash to."
+ else
+ printf "%s" "#define GIT_SHA1 \"" > $1
+
+ if (command -v "git" >/dev/null) then
+ git rev-parse --short HEAD | tr -d '\n' >> $1
+ fi
+
+ printf "%s\n" "\"" >> $1
+ printf "%s\n" "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1
fi
-
-echo "\"" >> $1
-echo "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1 \ No newline at end of file
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp
index 88eceecf..73d4406d 100644
--- a/src/audio/sampman_miles.cpp
+++ b/src/audio/sampman_miles.cpp
@@ -1,3 +1,4 @@
+#define WITHWINDOWS
#include "common.h"
#ifdef AUDIO_MSS
diff --git a/src/audio/sampman_null.cpp b/src/audio/sampman_null.cpp
index a5ed2889..af4c54ad 100644
--- a/src/audio/sampman_null.cpp
+++ b/src/audio/sampman_null.cpp
@@ -114,7 +114,7 @@ cSampleManager::SetMusicMasterVolume(uint8 nVolume)
}
void
-cSampleManager::SetMusicMasterVolume(uint8 nVolume)
+cSampleManager::SetMP3BoostVolume(uint8 nVolume)
{
}
@@ -231,35 +231,35 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
void
cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume)
{
- ASSERT( nChannel != CHANNEL2D );
+ ASSERT( nChannel < MAXCHANNELS );
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
}
void
cSampleManager::SetChannel3DPosition(uint32 nChannel, float fX, float fY, float fZ)
{
- ASSERT( nChannel != CHANNEL2D );
+ ASSERT( nChannel < MAXCHANNELS );
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
}
void
cSampleManager::SetChannel3DDistances(uint32 nChannel, float fMax, float fMin)
{
- ASSERT( nChannel != CHANNEL2D );
+ ASSERT( nChannel < MAXCHANNELS );
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
}
void
cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume)
{
- ASSERT( nChannel == CHANNEL2D );
+ ASSERT( nChannel >= MAXCHANNELS );
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
}
void
cSampleManager::SetChannelPan(uint32 nChannel, uint32 nPan)
{
- ASSERT(nChannel == CHANNEL2D);
+ ASSERT( nChannel >= MAXCHANNELS );
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
}
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 536055fa..224f9089 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -2573,20 +2573,16 @@ void CTheScripts::Shutdown()
int scriptToLoad = 0;
const char *scriptfile = "main.scm";
-#ifdef _WIN32
-#include <Windows.h>
-#endif
int open_script()
{
- // glfwGetKey doesn't work because of CGame::Initialise is blocking
-#ifdef _WIN32
- if (GetAsyncKeyState('G') & 0x8000)
+ // glfwGetKey doesn't work because of CGame::Initialise is blocking
+ CPad::UpdatePads();
+ if (CPad::GetPad(0)->GetChar('G'))
scriptToLoad = 0;
- if (GetAsyncKeyState('R') & 0x8000)
+ if (CPad::GetPad(0)->GetChar('R'))
scriptToLoad = 1;
- if (GetAsyncKeyState('D') & 0x8000)
+ if (CPad::GetPad(0)->GetChar('D'))
scriptToLoad = 2;
-#endif
switch (scriptToLoad) {
case 0: scriptfile = "main.scm"; break;
case 1: scriptfile = "freeroam_lcs.scm"; break;
diff --git a/src/core/CdStreamPosix.cpp b/src/core/CdStreamPosix.cpp
index 30fe06a0..bc9129eb 100644
--- a/src/core/CdStreamPosix.cpp
+++ b/src/core/CdStreamPosix.cpp
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include <sys/resource.h>
#include <stdarg.h>
+#include <limits.h>
#ifdef __linux__
#include <sys/syscall.h>
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index bbc79d4e..975cc7da 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -4575,19 +4575,11 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
#ifdef USE_DEBUG_SCRIPT_LOADER
if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) {
-#ifdef RW_GL3
- if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_R) == GLFW_PRESS) {
+ if (CPad::GetPad(0)->GetChar('R')) {
scriptToLoad = 1;
DoSettingsBeforeStartingAGame();
return;
}
-#elif defined _WIN32
- if (GetAsyncKeyState('R') & 0x8000) {
- scriptToLoad = 1;
- DoSettingsBeforeStartingAGame();
- return;
- }
-#endif
}
#endif
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 8e53901f..4a61267d 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -387,7 +387,7 @@ DoRWStuffEndOfFrame(void)
}
#else
if (CPad::GetPad(1)->GetLeftShockJustDown() || CPad::GetPad(0)->GetFJustDown(11)) {
- sprintf(s, "screen_0%11lld.png", time(nil));
+ sprintf(s, "screen_%011lld.png", time(nil));
RwGrabScreen(Scene.camera, s);
}
#endif
diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h
index 24c3fb4d..a073f854 100644
--- a/src/skel/crossplatform.h
+++ b/src/skel/crossplatform.h
@@ -1,4 +1,5 @@
#include <time.h>
+#include <limits.h>
// This is the common include for platform/renderer specific skeletons(glfw.cpp, win.cpp etc.) and using cross platform things (like Windows directories wrapper, platform specific global arrays etc.)
// Functions that's different on glfw and win but have same signature, should be located on platform.h.
diff --git a/vendor/librw b/vendor/librw
-Subproject af20de45226f5152a035866da32517466e81142
+Subproject a5bc97232293250ae1bbd6ef6642532a541034c