mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-17 22:12:43 -04:00
Merge remote-tracking branch 'origin/main' into tphd
This commit is contained in:
@@ -4556,6 +4556,7 @@ public:
|
||||
void handleWolfHowl();
|
||||
void handleQuickTransform();
|
||||
bool checkAimContext();
|
||||
bool checkAimInputContext();
|
||||
|
||||
void onIronBallChainInterpCallback();
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#include "JSystem/J3DGraphBase/J3DPacket.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/batch.hpp"
|
||||
#endif
|
||||
|
||||
class cCcD_Obj;
|
||||
class dCcMassS_HitInf;
|
||||
class fopAc_ac_c;
|
||||
@@ -107,6 +111,12 @@ public:
|
||||
#if TARGET_PC
|
||||
TGXTexObj mTexObj_l_J_Ohana00_64TEX;
|
||||
TGXTexObj mTexObj_l_J_Ohana01_64128_0419TEX;
|
||||
|
||||
dusk::batch::LeafTemplate mTplHana00; // l_J_hana00DL
|
||||
dusk::batch::LeafTemplate mTplHana00Cut; // l_J_hana00_cDL
|
||||
dusk::batch::LeafTemplate mTplHana01; // l_J_hana01DL
|
||||
dusk::batch::LeafTemplate mTplHana01Cut00; // l_J_hana01_c_00DL
|
||||
dusk::batch::LeafTemplate mTplHana01Cut; // l_J_hana01_c_01DL
|
||||
#endif
|
||||
}; // Size: 0x12A54
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#include "JSystem/J3DGraphBase/J3DPacket.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "../../../src/dusk/batch.hpp"
|
||||
#endif
|
||||
|
||||
class cCcD_Obj;
|
||||
class csXyz;
|
||||
class dCcMassS_HitInf;
|
||||
@@ -110,6 +114,10 @@ public:
|
||||
#if TARGET_PC
|
||||
TGXTexObj mTexObj_l_M_Hijiki00TEX;
|
||||
TGXTexObj mTexObj_l_M_kusa05_RGBATEX;
|
||||
|
||||
dusk::batch::LeafTemplate mTplKusa9q; // l_M_Kusa_9qDL
|
||||
dusk::batch::LeafTemplate mTplKusa9qCut; // l_M_Kusa_9q_cDL
|
||||
dusk::batch::LeafTemplate mTplTengusa; // l_M_TenGusaDL
|
||||
#endif
|
||||
}; // Size: 0x1D718
|
||||
|
||||
|
||||
@@ -1037,7 +1037,7 @@ public:
|
||||
bool test1Camera(s32);
|
||||
bool test2Camera(s32);
|
||||
#if TARGET_PC
|
||||
static bool canUseFreeCam();
|
||||
static bool isAimActive();
|
||||
bool freeCamera();
|
||||
bool executeDebugFlyCam();
|
||||
void deactivateDebugFlyCam();
|
||||
|
||||
@@ -287,6 +287,11 @@ public:
|
||||
MEMCARDCHECKPROC_ERR_YESNO_CURSOR_MOVE_ANM,
|
||||
MEMCARDCHECKPROC_SAVEDATA_CLEAR,
|
||||
|
||||
#if TARGET_PC
|
||||
MEMCARDCHECKPROC_AUTO_MAKE_GAMEFILE,
|
||||
MEMCARDCHECKPROC_AUTO_MAKE_GAMEFILE_ERR_WAIT,
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
MEMCARDCHECKPROC_NAND_STAT_CHECK,
|
||||
MEMCARDCHECKPROC_GAMEFILE_INIT_SEL,
|
||||
@@ -411,6 +416,10 @@ public:
|
||||
bool yesnoWakuAlpahAnm(u8);
|
||||
#if TARGET_PC
|
||||
void fileSelectWide();
|
||||
bool pointerDataSelect();
|
||||
bool pointerMenuSelect();
|
||||
bool pointerCopyDataToSelect();
|
||||
bool pointerYesNoSelect(bool errorSelect);
|
||||
#endif
|
||||
void _draw();
|
||||
void errorMoveAnmInitSet(int, int);
|
||||
@@ -445,6 +454,10 @@ public:
|
||||
void MemCardMakeGameFile();
|
||||
void MemCardMakeGameFileWait();
|
||||
void MemCardMakeGameFileCheck();
|
||||
#if TARGET_PC
|
||||
void MemCardAutoMakeGameFile();
|
||||
void MemCardAutoMakeGameFileErrWait();
|
||||
#endif
|
||||
void MemCardMsgWindowInitOpen();
|
||||
void MemCardMsgWindowOpen();
|
||||
void MemCardMsgWindowClose();
|
||||
|
||||
@@ -157,6 +157,9 @@ public:
|
||||
int getDispType() const;
|
||||
void _move(f32, f32, int, f32);
|
||||
void _draw();
|
||||
#if TARGET_PC
|
||||
bool refreshTextureSize();
|
||||
#endif
|
||||
|
||||
virtual ~dMap_c() {
|
||||
#if DEBUG
|
||||
|
||||
@@ -74,6 +74,8 @@ public:
|
||||
|
||||
#if TARGET_PC
|
||||
void menuCollectWide();
|
||||
bool pointerWait();
|
||||
void pointerActivateCurrent();
|
||||
#endif
|
||||
|
||||
void _create();
|
||||
|
||||
@@ -51,6 +51,10 @@ public:
|
||||
void setBButtonString(u16);
|
||||
void setHIO(bool);
|
||||
|
||||
#if TARGET_PC
|
||||
bool pointerWait();
|
||||
#endif
|
||||
|
||||
virtual void draw() { _draw(); }
|
||||
virtual ~dMenu_Insect_c();
|
||||
|
||||
|
||||
@@ -55,6 +55,10 @@ public:
|
||||
u8 getLetterNum();
|
||||
void setHIO(bool);
|
||||
|
||||
#if TARGET_PC
|
||||
bool pointerWait();
|
||||
#endif
|
||||
|
||||
virtual void draw() { _draw(); }
|
||||
virtual ~dMenu_Letter_c();
|
||||
|
||||
|
||||
@@ -80,6 +80,9 @@ public:
|
||||
void setBButtonString(u16);
|
||||
bool isRumbleSupported();
|
||||
bool dpdMenuMove();
|
||||
#if TARGET_PC
|
||||
bool pointerConfirmSelect();
|
||||
#endif
|
||||
void paneResize(u64);
|
||||
void initialize();
|
||||
void yesnoMenuMoveAnmInitSet(int, int);
|
||||
|
||||
@@ -74,6 +74,9 @@ public:
|
||||
void clacEllipsePlotAverage(int, f32, f32);
|
||||
bool dpdMove();
|
||||
u8 openExplain(u8);
|
||||
#if TARGET_PC
|
||||
bool pointerMove();
|
||||
#endif
|
||||
|
||||
virtual void draw() { _draw(); }
|
||||
virtual ~dMenu_Ring_c();
|
||||
|
||||
@@ -266,6 +266,8 @@ public:
|
||||
|
||||
#if TARGET_PC
|
||||
void menuSaveWide();
|
||||
bool pointerSaveSelect();
|
||||
bool pointerYesNoSelect(bool errorSelect, u8 errParam = 0, u8 soundParam = 0);
|
||||
#endif
|
||||
|
||||
void _draw2();
|
||||
|
||||
@@ -49,6 +49,10 @@ public:
|
||||
u8 getSkillNum();
|
||||
void setHIO(bool);
|
||||
|
||||
#if TARGET_PC
|
||||
bool pointerWait();
|
||||
#endif
|
||||
|
||||
virtual void draw() { _draw(); }
|
||||
virtual ~dMenu_Skill_c();
|
||||
|
||||
|
||||
@@ -49,6 +49,10 @@ public:
|
||||
void selectScale();
|
||||
void selectTrans();
|
||||
void selectAnimeTransform(int);
|
||||
#if TARGET_PC
|
||||
bool pointerMove();
|
||||
bool consumePointerClick();
|
||||
#endif
|
||||
|
||||
void setOffsetX(f32 i_offsetX) { mOffsetX = i_offsetX; }
|
||||
bool isAnimeUpdate(int param_0) { return (field_0x114 & (u8)(1 << param_0)) ? TRUE : FALSE; }
|
||||
|
||||
@@ -9,6 +9,8 @@ namespace dusk {
|
||||
enum class ActionBinds {
|
||||
FIRST_PERSON_CAMERA,
|
||||
CALL_MIDNA,
|
||||
OPEN_MAP_SCREEN,
|
||||
TOGGLE_MINIMAP,
|
||||
OPEN_DUSKLIGHT_MENU,
|
||||
TURBO_SPEED_BUTTON,
|
||||
COUNT,
|
||||
@@ -32,6 +34,12 @@ bool isActionBound(ActionBinds action, u32 port);
|
||||
|
||||
void updateActionBindings();
|
||||
|
||||
void setVirtualActionBind(ActionBinds action, u32 port, bool pressed, bool available = true);
|
||||
|
||||
void clearVirtualActionBind(ActionBinds action, u32 port);
|
||||
|
||||
void clearAllVirtualActionBinds();
|
||||
|
||||
bool getActionBindTrig(ActionBinds action, u32 port);
|
||||
|
||||
bool getActionBindHold(ActionBinds action, u32 port);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "dolphin/types.h"
|
||||
#include <type_traits>
|
||||
#include <cstdlib>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
@@ -139,11 +140,16 @@ concept ConfigValueInteger =
|
||||
|| std::is_same_v<T, s64>
|
||||
|| std::is_same_v<T, u64>;
|
||||
|
||||
template <typename T>
|
||||
struct ConfigValueTraits {
|
||||
static constexpr bool enabled = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Concept that defines the legal set of types that can be used for CVar values.
|
||||
*
|
||||
* Valid types cannot be cv-qualified and must be basic primitive types (int, float, bool),
|
||||
* strings, or enums of the basic primitives.
|
||||
* strings, enums of the basic primitives, or explicitly-enabled structured settings.
|
||||
*/
|
||||
template <typename T>
|
||||
concept ConfigValue =
|
||||
@@ -154,7 +160,8 @@ concept ConfigValue =
|
||||
|| std::is_same_v<T, f32>
|
||||
|| std::is_same_v<T, f64>
|
||||
|| std::is_same_v<T, std::string>
|
||||
|| (std::is_enum_v<T> && ConfigValueInteger<std::underlying_type_t<T>>));
|
||||
|| (std::is_enum_v<T> && ConfigValueInteger<std::underlying_type_t<T>>)
|
||||
|| ConfigValueTraits<T>::enabled);
|
||||
|
||||
template <ConfigValue T>
|
||||
const ConfigImplBase* GetConfigImpl();
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class CPaneMgr;
|
||||
|
||||
namespace dusk::menu_pointer {
|
||||
|
||||
enum class Context {
|
||||
None,
|
||||
FileSelect,
|
||||
Save,
|
||||
ItemWheel,
|
||||
Collection,
|
||||
Options,
|
||||
Dialog,
|
||||
};
|
||||
|
||||
enum class Phase {
|
||||
Move,
|
||||
Press,
|
||||
Release,
|
||||
Cancel,
|
||||
};
|
||||
|
||||
struct State {
|
||||
f32 x = 0.0f;
|
||||
f32 y = 0.0f;
|
||||
bool valid = false;
|
||||
bool down = false;
|
||||
bool pressed = false;
|
||||
bool released = false;
|
||||
bool clicked = false;
|
||||
bool touch = false;
|
||||
};
|
||||
|
||||
void begin_game_frame() noexcept;
|
||||
void end_game_frame() noexcept;
|
||||
void begin_context(Context context) noexcept;
|
||||
bool handle_fallthrough_pointer(f32 x, f32 y, Phase phase, bool touch, s32 mouseButton = -1) noexcept;
|
||||
|
||||
bool active() noexcept;
|
||||
bool enabled() noexcept;
|
||||
bool mouse_capture_active() noexcept;
|
||||
const State& state() noexcept;
|
||||
bool consume_click() noexcept;
|
||||
void set_dialog_choice(u8 choice, bool clicked) noexcept;
|
||||
bool get_dialog_choice(u8& choice) noexcept;
|
||||
bool consume_dialog_click(u8& choice) noexcept;
|
||||
void defer_activation(Context context, u8 target) noexcept;
|
||||
bool consume_deferred_activation(Context context, u8 target) noexcept;
|
||||
void clear_deferred_activation(Context context) noexcept;
|
||||
u32 suppressed_pad_buttons(u32 port) noexcept;
|
||||
void finish_pad_suppression_read(u32 port) noexcept;
|
||||
|
||||
bool hit_rect(f32 left, f32 top, f32 right, f32 bottom, f32 padding = 0.0f) noexcept;
|
||||
bool hit_pane(CPaneMgr* pane, f32 padding = 0.0f) noexcept;
|
||||
bool hit_pane(J2DPane* pane, f32 padding = 0.0f) noexcept;
|
||||
|
||||
} // namespace dusk::menu_pointer
|
||||
+18
-16
@@ -1,10 +1,10 @@
|
||||
#ifndef DUSK_CONFIG_H
|
||||
#define DUSK_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <filesystem>
|
||||
|
||||
#include "dusk/config_var.hpp"
|
||||
#include "dusk/ui/controls.hpp"
|
||||
|
||||
namespace dusk {
|
||||
|
||||
@@ -41,11 +41,6 @@ enum class DiscVerificationState : u8 {
|
||||
HashMismatch,
|
||||
};
|
||||
|
||||
enum class GyroMode : u8 {
|
||||
Sensor = 0,
|
||||
Mouse = 1,
|
||||
};
|
||||
|
||||
enum class FrameInterpMode : u8 {
|
||||
Off = 0,
|
||||
Capped = 1,
|
||||
@@ -97,12 +92,6 @@ struct ConfigEnumRange<DiscVerificationState> {
|
||||
static constexpr auto max = DiscVerificationState::HashMismatch;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ConfigEnumRange<GyroMode> {
|
||||
static constexpr auto min = GyroMode::Sensor;
|
||||
static constexpr auto max = GyroMode::Mouse;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ConfigEnumRange<FrameInterpMode> {
|
||||
static constexpr auto min = FrameInterpMode::Off;
|
||||
@@ -120,6 +109,11 @@ struct ConfigEnumRange<MagicArmorMode> {
|
||||
static constexpr auto min = MagicArmorMode::NORMAL;
|
||||
static constexpr auto max = MagicArmorMode::COSMETIC;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ConfigValueTraits<ui::ControlLayout> {
|
||||
static constexpr bool enabled = true;
|
||||
};
|
||||
} // namespace config
|
||||
|
||||
// Persistent user settings
|
||||
@@ -135,6 +129,9 @@ struct UserSettings {
|
||||
ConfigVar<bool> enableFpsOverlay;
|
||||
ConfigVar<int> fpsOverlayCorner;
|
||||
ConfigVar<int> maxFrameRate;
|
||||
ConfigVar<bool> rememberWindowSize;
|
||||
ConfigVar<int> lastWindowWidth;
|
||||
ConfigVar<int> lastWindowHeight;
|
||||
} video;
|
||||
|
||||
struct {
|
||||
@@ -219,6 +216,9 @@ struct UserSettings {
|
||||
ConfigVar<float> mouseCameraSensitivity;
|
||||
ConfigVar<bool> invertMouseY;
|
||||
ConfigVar<bool> freeCamera;
|
||||
ConfigVar<bool> enableTouchControls;
|
||||
ConfigVar<bool> enableMenuPointer;
|
||||
ConfigVar<ui::ControlLayout> touchControlsLayout;
|
||||
ConfigVar<bool> invertCameraXAxis;
|
||||
ConfigVar<bool> invertCameraYAxis;
|
||||
ConfigVar<bool> invertFirstPersonXAxis;
|
||||
@@ -227,6 +227,8 @@ struct UserSettings {
|
||||
ConfigVar<bool> invertAirSwimY;
|
||||
ConfigVar<float> freeCameraXSensitivity;
|
||||
ConfigVar<float> freeCameraYSensitivity;
|
||||
ConfigVar<float> touchCameraXSensitivity;
|
||||
ConfigVar<float> touchCameraYSensitivity;
|
||||
ConfigVar<bool> debugFlyCam;
|
||||
ConfigVar<bool> debugFlyCamLockEvents;
|
||||
ConfigVar<bool> allowBackgroundInput;
|
||||
@@ -288,6 +290,8 @@ struct UserSettings {
|
||||
struct {
|
||||
std::array<ActionBindConfigVar, 4> firstPersonCamera;
|
||||
std::array<ActionBindConfigVar, 4> callMidna;
|
||||
std::array<ActionBindConfigVar, 4> openMapScreen;
|
||||
std::array<ActionBindConfigVar, 4> toggleMinimap;
|
||||
std::array<ActionBindConfigVar, 4> openDusklightMenu;
|
||||
std::array<ActionBindConfigVar, 4> turboSpeedButton;
|
||||
} actionBindings;
|
||||
@@ -322,6 +326,4 @@ struct TransientSettings {
|
||||
|
||||
TransientSettings& getTransientSettings();
|
||||
|
||||
}
|
||||
|
||||
#endif // DUSK_CONFIG_H
|
||||
} // namespace dusk
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
namespace dusk::touch_camera {
|
||||
|
||||
constexpr float YAW_DEGREES_PER_DP = 0.34f;
|
||||
constexpr float PITCH_DEGREES_PER_DP = 0.22f;
|
||||
|
||||
void add_delta(float yaw_dp, float pitch_dp) noexcept;
|
||||
bool consume_delta(float& yaw_dp, float& pitch_dp) noexcept;
|
||||
void clear() noexcept;
|
||||
|
||||
} // namespace dusk::touch_camera
|
||||
Reference in New Issue
Block a user