Merge remote-tracking branch 'origin/miami' into lcs

# Conflicts:
#	.github/workflows/reLCS_msvc_amd64.yml
#	.github/workflows/reLCS_msvc_x86.yml
#	README.md
#	gamefiles/TEXT/american.gxt
#	gamefiles/TEXT/french.gxt
#	gamefiles/TEXT/german.gxt
#	gamefiles/TEXT/italian.gxt
#	gamefiles/TEXT/spanish.gxt
#	premake5.lua
#	src/animation/AnimManager.cpp
#	src/animation/AnimationId.h
#	src/audio/MusicManager.cpp
#	src/audio/audio_enums.h
#	src/control/Script7.cpp
#	src/core/FileLoader.cpp
#	src/core/re3.cpp
#	src/extras/custompipes_d3d9.cpp
#	src/extras/custompipes_gl.cpp
#	src/extras/postfx.cpp
#	src/extras/shaders/colourfilterVC.frag
#	src/extras/shaders/colourfilterVC_PS.hlsl
#	src/extras/shaders/make_hlsl.cmd
#	src/extras/shaders/obj/colourfilterVC_PS.cso
#	src/extras/shaders/obj/colourfilterVC_PS.inc
#	src/extras/shaders/obj/colourfilterVC_frag.inc
#	src/peds/PedFight.cpp
#	src/render/Font.cpp
#	src/render/Hud.cpp
#	src/render/Particle.cpp
#	src/render/WaterCannon.cpp
#	src/skel/win/gtavc.ico
#	src/vehicles/Automobile.cpp
#	utils/gxt/american.txt
#	utils/gxt/french.txt
#	utils/gxt/german.txt
#	utils/gxt/italian.txt
#	utils/gxt/spanish.txt
This commit is contained in:
Sergeanur
2021-02-16 18:08:19 +02:00
114 changed files with 5143 additions and 2112 deletions

View File

@ -32,8 +32,8 @@ HANDLE FindFirstFile(const char* pathname, WIN32_FIND_DATA* firstfile) {
char *folder = strtok(pathCopy, "*");
char *extension = strtok(NULL, "*");
// because strtok doesn't return NULL for last delimiter
if (extension - folder == strlen(pathname))
// because I remember like strtok might not return NULL for last delimiter
if (extension && extension - folder == strlen(pathname))
extension = nil;
// Case-sensitivity and backslashes...
@ -187,7 +187,7 @@ char* casepath(char const* path, bool checkPathFirst)
rl = 1;
}
bool cantProceed = false; // just convert slashes in what's left in string, not case sensitivity
bool cantProceed = false; // just convert slashes in what's left in string, don't correct case of letters(because we can't)
bool mayBeTrailingSlash = false;
char* c;
while (c = strsep(&p, "/\\"))
@ -251,7 +251,7 @@ char* casepath(char const* path, bool checkPathFirst)
}
if (rl > l + 2) {
printf("\n\ncasepath: Corrected path length is longer then original+2:\n\tOriginal: %s (%d chars)\n\tCorrected: %s (%d chars)\n\n", path, l, out, rl);
printf("\n\ncasepath: Corrected path length is longer then original+2:\n\tOriginal: %s (%zu chars)\n\tCorrected: %s (%zu chars)\n\n", path, l, out, rl);
}
return out;
}

View File

@ -75,7 +75,7 @@ void CapturePad(RwInt32 padID);
void joysChangeCB(int jid, int event);
#endif
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
#ifdef DETECT_JOYSTICK_MENU
extern char gSelectedJoystickName[128];
#endif

View File

@ -52,6 +52,11 @@ long _dwOperatingSystemVersion;
#define MAX_SUBSYSTEMS (16)
#ifdef _WIN32
#define GLFW_EXPOSE_NATIVE_WIN32
#include <GLFW/glfw3native.h>
#endif
rw::EngineOpenParams openParams;
static RwBool ForegroundApp = TRUE;
@ -80,7 +85,7 @@ static psGlobalType PsGlobal;
size_t _dwMemAvailPhys;
RwUInt32 gGameState;
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
#ifdef DETECT_JOYSTICK_MENU
char gSelectedJoystickName[128] = "";
#endif
@ -207,6 +212,7 @@ psGrabScreen(RwCamera *pCamera)
}
#else
rw::Image *image = RwCameraGetRaster(pCamera)->toImage();
image->removeMask();
if(image)
return image;
#endif
@ -852,7 +858,7 @@ void joysChangeCB(int jid, int event);
bool IsThisJoystickBlacklisted(int i)
{
#ifndef DONT_TRUST_RECOGNIZED_JOYSTICKS
#ifndef DETECT_JOYSTICK_MENU
return false;
#else
if (glfwJoystickIsGamepad(i))
@ -917,7 +923,7 @@ void _InputInitialiseJoys()
if (PSGLOBAL(joy1id) != -1) {
int count;
glfwGetJoystickButtons(PSGLOBAL(joy1id), &count);
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
#ifdef DETECT_JOYSTICK_MENU
strcpy(gSelectedJoystickName, glfwGetJoystickName(PSGLOBAL(joy1id)));
#endif
ControlsManager.InitDefaultControlConfigJoyPad(count);
@ -1271,10 +1277,11 @@ void terminateHandler(int sig, siginfo_t *info, void *ucontext) {
RsGlobal.quit = TRUE;
}
#ifdef FLUSHABLE_STREAMING
void dummyHandler(int sig){
// Don't kill the app pls
}
#endif
#endif
void resizeCB(GLFWwindow* window, int width, int height) {
@ -1447,7 +1454,7 @@ bool rshiftStatus = false;
void
keypressCB(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key >= 0 && key <= GLFW_KEY_LAST) {
if (key >= 0 && key <= GLFW_KEY_LAST && action != GLFW_REPEAT) {
RsKeyCodes ks = (RsKeyCodes)keymap[key];
if (key == GLFW_KEY_LEFT_SHIFT)
@ -1458,7 +1465,6 @@ keypressCB(GLFWwindow* window, int key, int scancode, int action, int mods)
if (action == GLFW_RELEASE) RsKeyboardEventHandler(rsKEYUP, &ks);
else if (action == GLFW_PRESS) RsKeyboardEventHandler(rsKEYDOWN, &ks);
else if (action == GLFW_REPEAT) RsKeyboardEventHandler(rsKEYDOWN, &ks);
}
}
@ -1528,11 +1534,13 @@ main(int argc, char *argv[])
act.sa_sigaction = terminateHandler;
act.sa_flags = SA_SIGINFO;
sigaction(SIGTERM, &act, NULL);
#ifdef FLUSHABLE_STREAMING
struct sigaction sa;
sigemptyset(&sa.sa_mask);
sa.sa_handler = dummyHandler;
sa.sa_flags = 0;
sigaction(SIGUSR1, &sa, NULL); // Needed for CdStreamPosix
sigaction(SIGUSR1, &sa, NULL);
#endif
#endif
/*
@ -1589,6 +1597,15 @@ main(int argc, char *argv[])
return 0;
}
#ifdef _WIN32
HWND wnd = glfwGetWin32Window(PSGLOBAL(window));
HICON icon = LoadIcon(instance, MAKEINTRESOURCE(IDI_MAIN_ICON));
SendMessage(wnd, WM_SETICON, ICON_BIG, (LPARAM)icon);
SendMessage(wnd, WM_SETICON, ICON_SMALL, (LPARAM)icon);
#endif
psPostRWinit();
ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp());
@ -2180,7 +2197,7 @@ void joysChangeCB(int jid, int event)
if (event == GLFW_CONNECTED && !IsThisJoystickBlacklisted(jid)) {
if (PSGLOBAL(joy1id) == -1) {
PSGLOBAL(joy1id) = jid;
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
#ifdef DETECT_JOYSTICK_MENU
strcpy(gSelectedJoystickName, glfwGetJoystickName(jid));
#endif
// This is behind LOAD_INI_SETTINGS, because otherwise the Init call below will destroy/overwrite your bindings.

View File

@ -120,6 +120,10 @@ DWORD _dwOperatingSystemVersion;
RwUInt32 gGameState;
CJoySticks AllValidWinJoys;
#ifdef DETECT_JOYSTICK_MENU
char gSelectedJoystickName[128] = "";
#endif
// What is that for anyway?
#ifndef IMPROVED_VIDEOMODE
static RwBool defaultFullscreenRes = TRUE;
@ -258,6 +262,7 @@ psGrabScreen(RwCamera *pCamera)
}
#else
rw::Image *image = RwCameraGetRaster(pCamera)->toImage();
image->removeMask();
if(image)
return image;
#endif