mirror of
https://github.com/halpz/re3.git
synced 2025-08-02 13:20:30 +00:00
Replace GTA_SWITCH macro and use GAMEPAD_MENU
* Replace GTA_SWITCH macro with __SWITCH__ for platform specific stuff and GTA_HANDHELD for the rest (which could be used by other ports) * Use GAMEPAD_MENU on GTA_HANDHELD, which will replace the usual controller setup (which contains some useless features for handhelds) * Fix some identation inconsistencies * Disable PC_PLAYER_CONTROLS on GTA_HANDHELD builds
This commit is contained in:
@ -200,7 +200,7 @@ char* casepath(char const* path, bool checkPathFirst)
|
||||
DIR* d;
|
||||
char* c;
|
||||
|
||||
#if defined(GTA_SWITCH) || defined(GTA_VITA)
|
||||
#if defined(__SWITCH__) || defined(PSP2)
|
||||
if( (c = strstr(p, ":/")) != NULL) // scheme used by some environments, eg. switch, vita
|
||||
{
|
||||
size_t deviceNameOffset = c - p + 3;
|
||||
@ -294,7 +294,7 @@ char* casepath(char const* path, bool checkPathFirst)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef GTA_SWITCH
|
||||
#ifdef __SWITCH__
|
||||
/* Taken from glibc */
|
||||
char *realpath(const char *name, char *resolved)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ DWORD _dwOperatingSystemVersion;
|
||||
#include "resource.h"
|
||||
#else
|
||||
long _dwOperatingSystemVersion;
|
||||
#ifndef GTA_SWITCH
|
||||
#ifndef __SWITCH__
|
||||
#ifndef __APPLE__
|
||||
#include <sys/sysinfo.h>
|
||||
#else
|
||||
@ -53,7 +53,7 @@ long _dwOperatingSystemVersion;
|
||||
#include "MemoryMgr.h"
|
||||
|
||||
// We found out that GLFW's keyboard input handling is still pretty delayed/not stable, so now we fetch input from X11 directly on Linux.
|
||||
#if !defined _WIN32 && !defined __APPLE__ && !defined GTA_SWITCH // && !defined WAYLAND
|
||||
#if !defined _WIN32 && !defined __APPLE__ && !defined GTA_HANDHELD // && !defined WAYLAND
|
||||
#define GET_KEYBOARD_INPUT_FROM_X11
|
||||
#endif
|
||||
|
||||
@ -330,7 +330,7 @@ psNativeTextureSupport(void)
|
||||
*****************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef GTA_SWITCH
|
||||
#ifdef __SWITCH__
|
||||
|
||||
static HidVibrationValue SwitchVibrationValues[2];
|
||||
static HidVibrationDeviceHandle SwitchVibrationDeviceHandles[2][2];
|
||||
@ -338,10 +338,10 @@ static HidVibrationDeviceHandle SwitchVibrationDeviceGC;
|
||||
|
||||
static PadState SwitchPad;
|
||||
|
||||
Result HidInitializationResult[2];
|
||||
Result HidInitializationGCResult;
|
||||
static Result HidInitializationResult[2];
|
||||
static Result HidInitializationGCResult;
|
||||
|
||||
void _psInitializeVibration()
|
||||
static void _psInitializeVibration()
|
||||
{
|
||||
HidInitializationResult[0] = hidInitializeVibrationDevices(SwitchVibrationDeviceHandles[0], 2, HidNpadIdType_Handheld, HidNpadStyleTag_NpadHandheld);
|
||||
if(R_FAILED(HidInitializationResult[0])) {
|
||||
@ -360,10 +360,10 @@ void _psInitializeVibration()
|
||||
SwitchVibrationValues[0].freq_high = 320.0f;
|
||||
|
||||
padConfigureInput(1, HidNpadStyleSet_NpadFullCtrl);
|
||||
padInitializeDefault(&SwitchPad);
|
||||
padInitializeDefault(&SwitchPad);
|
||||
}
|
||||
|
||||
void _psHandleVibration()
|
||||
static void _psHandleVibration()
|
||||
{
|
||||
padUpdate(&SwitchPad);
|
||||
|
||||
@ -394,8 +394,8 @@ void _psHandleVibration()
|
||||
}
|
||||
}
|
||||
#else
|
||||
void _psInitializeVibration() {}
|
||||
void _psHandleVibration() {}
|
||||
static void _psInitializeVibration() {}
|
||||
static void _psHandleVibration() {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -561,7 +561,7 @@ psInitialize(void)
|
||||
debug("Physical memory size %llu\n", _dwMemAvailPhys);
|
||||
debug("Available physical memory %llu\n", size);
|
||||
#else
|
||||
#ifndef GTA_SWITCH
|
||||
#ifndef __SWITCH__
|
||||
struct sysinfo systemInfo;
|
||||
sysinfo(&systemInfo);
|
||||
_dwMemAvailPhys = systemInfo.freeram;
|
||||
@ -1871,7 +1871,7 @@ main(int argc, char *argv[])
|
||||
InitMemoryMgr();
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(GTA_SWITCH)
|
||||
#if !defined(_WIN32) && !defined(__SWITCH__)
|
||||
struct sigaction act;
|
||||
act.sa_sigaction = terminateHandler;
|
||||
act.sa_flags = SA_SIGINFO;
|
||||
|
Reference in New Issue
Block a user