reorganize actions/constants for profile and input

This commit is contained in:
Tropical
2026-04-07 12:43:47 -05:00
parent 25e6f7159e
commit 0bdef577f5
75 changed files with 74 additions and 161 deletions
-2
View File
@@ -1,13 +1,11 @@
#include "PlatformServices.h"
#include "StdFileIO.h"
#include "sdl2/Profile.h"
#include "sdl2/Render.h"
#include "sdl2/Storage.h"
static StdFileIO s_stdFileIO;
IPlatformFileIO& PlatformFileIO = s_stdFileIO;
IPlatformProfile& PlatformProfile = PlatformProfile;
IPlatformRenderer& PlatformRender = RenderManager;
IPlatformStorage& PlatformStorage = StorageManager;
+1 -45
View File
@@ -3,51 +3,7 @@
#include <functional>
#include "PlatformTypes.h"
#define MAP_STYLE_0 0
#define MAP_STYLE_1 1
#define MAP_STYLE_2 2
#define _360_JOY_BUTTON_A 0x00000001
#define _360_JOY_BUTTON_B 0x00000002
#define _360_JOY_BUTTON_X 0x00000004
#define _360_JOY_BUTTON_Y 0x00000008
#define _360_JOY_BUTTON_START 0x00000010
#define _360_JOY_BUTTON_BACK 0x00000020
#define _360_JOY_BUTTON_RB 0x00000040
#define _360_JOY_BUTTON_LB 0x00000080
#define _360_JOY_BUTTON_RTHUMB 0x00000100
#define _360_JOY_BUTTON_LTHUMB 0x00000200
#define _360_JOY_BUTTON_DPAD_UP 0x00000400
#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800
#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000
#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000
// fake digital versions of analog values
#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000
#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000
#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000
#define _360_JOY_BUTTON_RSTICK_UP 0x00020000
#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000
#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000
#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000
#define _360_JOY_BUTTON_LSTICK_UP 0x00200000
#define _360_JOY_BUTTON_RT 0x00400000
#define _360_JOY_BUTTON_LT 0x00800000
// Stick axis maps - to allow changes for SouthPaw in-game axis mapping
#define AXIS_MAP_LX 0
#define AXIS_MAP_LY 1
#define AXIS_MAP_RX 2
#define AXIS_MAP_RY 3
// Trigger map - to allow for swap triggers in-game
#define TRIGGER_MAP_0 0
#define TRIGGER_MAP_1 1
#include "InputConstants.h"
class IPlatformInput {
public:
@@ -1,5 +1,50 @@
#pragma once
#define MAP_STYLE_0 0
#define MAP_STYLE_1 1
#define MAP_STYLE_2 2
#define _360_JOY_BUTTON_A 0x00000001
#define _360_JOY_BUTTON_B 0x00000002
#define _360_JOY_BUTTON_X 0x00000004
#define _360_JOY_BUTTON_Y 0x00000008
#define _360_JOY_BUTTON_START 0x00000010
#define _360_JOY_BUTTON_BACK 0x00000020
#define _360_JOY_BUTTON_RB 0x00000040
#define _360_JOY_BUTTON_LB 0x00000080
#define _360_JOY_BUTTON_RTHUMB 0x00000100
#define _360_JOY_BUTTON_LTHUMB 0x00000200
#define _360_JOY_BUTTON_DPAD_UP 0x00000400
#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800
#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000
#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000
// fake digital versions of analog values
#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000
#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000
#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000
#define _360_JOY_BUTTON_RSTICK_UP 0x00020000
#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000
#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000
#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000
#define _360_JOY_BUTTON_LSTICK_UP 0x00200000
#define _360_JOY_BUTTON_RT 0x00400000
#define _360_JOY_BUTTON_LT 0x00800000
// Stick axis maps - to allow changes for SouthPaw in-game axis mapping
#define AXIS_MAP_LX 0
#define AXIS_MAP_LY 1
#define AXIS_MAP_RX 2
#define AXIS_MAP_RY 3
// Trigger map - to allow for swap triggers in-game
#define TRIGGER_MAP_0 0
#define TRIGGER_MAP_1 1
enum EControllerActions {
ACTION_MENU_A,
ACTION_MENU_B,
+1 -1
View File
@@ -17,7 +17,7 @@
#include <functional>
#include <string>
#include "../InputActions.h"
#include "../InputConstants.h"
#include "../PlatformTypes.h"
SDL2Input sdl2_input_instance;
@@ -8,31 +8,6 @@
class CXuiStringTable;
#define TITLEID_MINECRAFT 0x584111F7
#define CONTEXT_GAME_STATE 0
#define CONTEXT_GAME_STATE_BLANK 0
#define CONTEXT_GAME_STATE_RIDING_PIG 1
#define CONTEXT_GAME_STATE_RIDING_MINECART 2
#define CONTEXT_GAME_STATE_BOATING 3
#define CONTEXT_GAME_STATE_FISHING 4
#define CONTEXT_GAME_STATE_CRAFTING 5
#define CONTEXT_GAME_STATE_FORGING 6
#define CONTEXT_GAME_STATE_NETHER 7
#define CONTEXT_GAME_STATE_CD 8
#define CONTEXT_GAME_STATE_MAP 9
#define CONTEXT_GAME_STATE_ENCHANTING 5
#define CONTEXT_GAME_STATE_BREWING 5
#define CONTEXT_GAME_STATE_ANVIL 6
#define CONTEXT_GAME_STATE_TRADING 0
#define CONTEXT_PRESENCE_IDLE 0
#define CONTEXT_PRESENCE_MENUS 1
#define CONTEXT_PRESENCE_MULTIPLAYER 2
#define CONTEXT_PRESENCE_MULTIPLAYEROFFLINE 3
#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4
#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5
class IPlatformProfile {
public:
struct PROFILESETTINGS {
+22 -22
View File
@@ -1,26 +1,26 @@
#pragma once
#include <cstdint>
#define TITLEID_MINECRAFT 0x584111F7
inline constexpr int TUTORIAL_PROFILE_STORAGE_BITS = 512;
inline constexpr int TUTORIAL_PROFILE_STORAGE_BYTES =
TUTORIAL_PROFILE_STORAGE_BITS / 8;
#define CONTEXT_GAME_STATE 0
#define CONTEXT_GAME_STATE_BLANK 0
#define CONTEXT_GAME_STATE_RIDING_PIG 1
#define CONTEXT_GAME_STATE_RIDING_MINECART 2
#define CONTEXT_GAME_STATE_BOATING 3
#define CONTEXT_GAME_STATE_FISHING 4
#define CONTEXT_GAME_STATE_CRAFTING 5
#define CONTEXT_GAME_STATE_FORGING 6
#define CONTEXT_GAME_STATE_NETHER 7
#define CONTEXT_GAME_STATE_CD 8
#define CONTEXT_GAME_STATE_MAP 9
#define CONTEXT_GAME_STATE_ENCHANTING 5
#define CONTEXT_GAME_STATE_BREWING 5
#define CONTEXT_GAME_STATE_ANVIL 6
#define CONTEXT_GAME_STATE_TRADING 0
inline constexpr int MAX_FAVORITE_SKINS = 10;
inline constexpr std::uint32_t GAMESETTING_CLOUDS = 0x00000001;
inline constexpr std::uint32_t GAMESETTING_ONLINE = 0x00000002;
inline constexpr std::uint32_t GAMESETTING_FRIENDSOFFRIENDS = 0x00000008;
inline constexpr std::uint32_t GAMESETTING_DISPLAYUPDATEMSG = 0x00000030;
inline constexpr std::uint32_t GAMESETTING_BEDROCKFOG = 0x00000040;
inline constexpr std::uint32_t GAMESETTING_DISPLAYHUD = 0x00000080;
inline constexpr std::uint32_t GAMESETTING_DISPLAYHAND = 0x00000100;
inline constexpr std::uint32_t GAMESETTING_CUSTOMSKINANIM = 0x00000200;
inline constexpr std::uint32_t GAMESETTING_DEATHMESSAGES = 0x00000400;
inline constexpr std::uint32_t GAMESETTING_UISIZE = 0x00001800;
inline constexpr std::uint32_t GAMESETTING_UISIZE_SPLITSCREEN = 0x00006000;
inline constexpr std::uint32_t GAMESETTING_ANIMATEDCHARACTER = 0x00008000;
inline constexpr std::uint32_t GAMESETTING_PS3EULAREAD = 0x00010000;
inline constexpr std::uint32_t GAMESETTING_PSVITANETWORKMODEADHOC = 0x00020000;
inline constexpr unsigned char MINECRAFT_LANGUAGE_DEFAULT = 0x00;
#define CONTEXT_PRESENCE_IDLE 0
#define CONTEXT_PRESENCE_MENUS 1
#define CONTEXT_PRESENCE_MULTIPLAYER 2
#define CONTEXT_PRESENCE_MULTIPLAYEROFFLINE 3
#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4
#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5
+1
View File
@@ -1,3 +1,4 @@
#include "IPlatformProfile.h"
#include "ProfileConstants.h"
extern IPlatformProfile& PlatformProfile;
@@ -6,6 +6,8 @@
#include "../ProfileConstants.h"
#include "input/input.h"
#include "../../../app/common/Tutorial/TutorialEnum.h" // 4jcraft TODO
#include "../../../app/common/App_Defines.h" // 4jcraft TODO
StubProfile stub_profile_instance;
IPlatformProfile& PlatformProfile = stub_profile_instance;