mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-20 14:11:16 +00:00
Add ini option
This commit is contained in:
parent
b16414059c
commit
df681ea06e
@ -173,6 +173,7 @@ IsleApp::IsleApp()
|
|||||||
m_transitionType = MxTransitionManager::e_mosaic;
|
m_transitionType = MxTransitionManager::e_mosaic;
|
||||||
m_cursorSensitivity = 4;
|
m_cursorSensitivity = 4;
|
||||||
m_touchScheme = LegoInputManager::e_gamepad;
|
m_touchScheme = LegoInputManager::e_gamepad;
|
||||||
|
m_haptic = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: ISLE 0x4011a0
|
// FUNCTION: ISLE 0x4011a0
|
||||||
@ -791,7 +792,7 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
|
|||||||
SDL_Log("Game started");
|
SDL_Log("Game started");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event->user.type == g_legoSdlEvents.m_hitActor) {
|
else if (event->user.type == g_legoSdlEvents.m_hitActor && g_isle->GetHaptic()) {
|
||||||
if (InputManager()) {
|
if (InputManager()) {
|
||||||
InputManager()->HandleRumbleEvent();
|
InputManager()->HandleRumbleEvent();
|
||||||
}
|
}
|
||||||
@ -1047,6 +1048,7 @@ bool IsleApp::LoadConfig()
|
|||||||
iniparser_set(dict, "isle:Max Allowed Extras", SDL_itoa(m_maxAllowedExtras, buf, 10));
|
iniparser_set(dict, "isle:Max Allowed Extras", SDL_itoa(m_maxAllowedExtras, buf, 10));
|
||||||
iniparser_set(dict, "isle:Transition Type", SDL_itoa(m_transitionType, buf, 10));
|
iniparser_set(dict, "isle:Transition Type", SDL_itoa(m_transitionType, buf, 10));
|
||||||
iniparser_set(dict, "isle:Touch Scheme", SDL_itoa(m_touchScheme, buf, 10));
|
iniparser_set(dict, "isle:Touch Scheme", SDL_itoa(m_touchScheme, buf, 10));
|
||||||
|
iniparser_set(dict, "isle:Haptic", m_haptic ? "true" : "false");
|
||||||
|
|
||||||
#ifdef EXTENSIONS
|
#ifdef EXTENSIONS
|
||||||
iniparser_set(dict, "extensions", NULL);
|
iniparser_set(dict, "extensions", NULL);
|
||||||
@ -1118,6 +1120,7 @@ bool IsleApp::LoadConfig()
|
|||||||
m_transitionType =
|
m_transitionType =
|
||||||
(MxTransitionManager::TransitionType) iniparser_getint(dict, "isle:Transition Type", m_transitionType);
|
(MxTransitionManager::TransitionType) iniparser_getint(dict, "isle:Transition Type", m_transitionType);
|
||||||
m_touchScheme = (LegoInputManager::TouchScheme) iniparser_getint(dict, "isle:Touch Scheme", m_touchScheme);
|
m_touchScheme = (LegoInputManager::TouchScheme) iniparser_getint(dict, "isle:Touch Scheme", m_touchScheme);
|
||||||
|
m_haptic = iniparser_getboolean(dict, "isle:Haptic", m_haptic);
|
||||||
|
|
||||||
const char* deviceId = iniparser_getstring(dict, "isle:3D Device ID", NULL);
|
const char* deviceId = iniparser_getstring(dict, "isle:3D Device ID", NULL);
|
||||||
if (deviceId != NULL) {
|
if (deviceId != NULL) {
|
||||||
|
|||||||
@ -55,6 +55,7 @@ class IsleApp {
|
|||||||
MxS32 GetGameStarted() { return m_gameStarted; }
|
MxS32 GetGameStarted() { return m_gameStarted; }
|
||||||
MxFloat GetCursorSensitivity() { return m_cursorSensitivity; }
|
MxFloat GetCursorSensitivity() { return m_cursorSensitivity; }
|
||||||
LegoInputManager::TouchScheme GetTouchScheme() { return m_touchScheme; }
|
LegoInputManager::TouchScheme GetTouchScheme() { return m_touchScheme; }
|
||||||
|
MxBool GetHaptic() { return m_haptic; }
|
||||||
|
|
||||||
void SetWindowActive(MxS32 p_windowActive) { m_windowActive = p_windowActive; }
|
void SetWindowActive(MxS32 p_windowActive) { m_windowActive = p_windowActive; }
|
||||||
void SetGameStarted(MxS32 p_gameStarted) { m_gameStarted = p_gameStarted; }
|
void SetGameStarted(MxS32 p_gameStarted) { m_gameStarted = p_gameStarted; }
|
||||||
@ -105,6 +106,7 @@ class IsleApp {
|
|||||||
MxU32 m_maxAllowedExtras;
|
MxU32 m_maxAllowedExtras;
|
||||||
MxTransitionManager::TransitionType m_transitionType;
|
MxTransitionManager::TransitionType m_transitionType;
|
||||||
LegoInputManager::TouchScheme m_touchScheme;
|
LegoInputManager::TouchScheme m_touchScheme;
|
||||||
|
MxBool m_haptic;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern IsleApp* g_isle;
|
extern IsleApp* g_isle;
|
||||||
|
|||||||
@ -153,7 +153,7 @@ class LegoInputManager : public MxPresenter {
|
|||||||
MxResult GetNavigationKeyStates(MxU32& p_keyFlags);
|
MxResult GetNavigationKeyStates(MxU32& p_keyFlags);
|
||||||
MxResult GetNavigationTouchStates(MxU32& p_keyFlags);
|
MxResult GetNavigationTouchStates(MxU32& p_keyFlags);
|
||||||
LEGO1_EXPORT MxBool HandleTouchEvent(SDL_Event* p_event, TouchScheme p_touchScheme);
|
LEGO1_EXPORT MxBool HandleTouchEvent(SDL_Event* p_event, TouchScheme p_touchScheme);
|
||||||
LEGO1_EXPORT void HandleRumbleEvent();
|
LEGO1_EXPORT MxBool HandleRumbleEvent();
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1005b8d0
|
// SYNTHETIC: LEGO1 0x1005b8d0
|
||||||
// LegoInputManager::`scalar deleting destructor'
|
// LegoInputManager::`scalar deleting destructor'
|
||||||
|
|||||||
@ -627,13 +627,17 @@ MxBool LegoInputManager::HandleTouchEvent(SDL_Event* p_event, TouchScheme p_touc
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LegoInputManager::HandleRumbleEvent()
|
MxBool LegoInputManager::HandleRumbleEvent()
|
||||||
{
|
{
|
||||||
if (m_joystick != NULL && SDL_GamepadConnected(m_joystick) == TRUE) {
|
if (m_joystick != NULL && SDL_GamepadConnected(m_joystick) == TRUE) {
|
||||||
const Uint16 frequency = 65535 / 3;
|
const Uint16 frequency = 65535 / 2;
|
||||||
const Uint32 durationMs = 1000;
|
const Uint32 durationMs = 700;
|
||||||
SDL_RumbleGamepad(m_joystick, frequency, frequency, durationMs);
|
SDL_RumbleGamepad(m_joystick, frequency, frequency, durationMs);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// Add support for SDL Haptic API
|
// Add support for SDL Haptic API
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user