Compare commits
2
Commits
54a04f9214
..
kbm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40d5709317 | ||
|
|
4110db8572 |
No files matched your search
@@ -239,9 +239,9 @@
|
|||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Full</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);$(ProjectDir)Windows64\vendor\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);$(ProjectDir)Windows64\vendor\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
@@ -249,7 +249,6 @@
|
|||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<CompileAs>CompileAsCpp</CompileAs>
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|||||||
@@ -293,6 +293,9 @@
|
|||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Windows64\4J_Input.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="Windows64\INP_ForceFeedback.cpp">
|
<ClCompile Include="Windows64\INP_ForceFeedback.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -311,8 +314,5 @@
|
|||||||
<ClCompile Include="stdafx.cpp">
|
<ClCompile Include="stdafx.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Windows64\4J_Input.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
+190
-11
@@ -32,6 +32,7 @@ CKeyboard InternalKeyboard;
|
|||||||
void C_4JInput::Initialise(int iInputStateC, unsigned char ucMapC, unsigned char ucActionC, unsigned char ucMenuActionC)
|
void C_4JInput::Initialise(int iInputStateC, unsigned char ucMapC, unsigned char ucActionC, unsigned char ucMenuActionC)
|
||||||
{
|
{
|
||||||
InternalInputManager.Initialise(iInputStateC, ucMapC, ucActionC, ucMenuActionC);
|
InternalInputManager.Initialise(iInputStateC, ucMapC, ucActionC, ucMenuActionC);
|
||||||
|
InternalKeyboard.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void C_4JInput::Tick(void)
|
void C_4JInput::Tick(void)
|
||||||
@@ -39,6 +40,10 @@ void C_4JInput::Tick(void)
|
|||||||
InternalInputManager.Tick();
|
InternalInputManager.Tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void C_4JInput::TickKBM(void)
|
||||||
|
{
|
||||||
|
InternalKeyboard.Tick();
|
||||||
|
}
|
||||||
void C_4JInput::SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax)
|
void C_4JInput::SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax)
|
||||||
{
|
{
|
||||||
InternalInputManager.SetDeadzoneAndMovementRange(uiDeadzone, uiMovementRangeMax);
|
InternalInputManager.SetDeadzoneAndMovementRange(uiDeadzone, uiMovementRangeMax);
|
||||||
@@ -74,6 +79,11 @@ unsigned int C_4JInput::GetValue(int iPad, unsigned char ucAction, bool bRepeat)
|
|||||||
return InternalInputManager.GetValue(iPad, ucAction, bRepeat);
|
return InternalInputManager.GetValue(iPad, ucAction, bRepeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void C_4JInput::MapTouchInput(int iPad, int button)
|
||||||
|
{
|
||||||
|
InternalInputManager.MapTouchInput(iPad, button);
|
||||||
|
}
|
||||||
|
|
||||||
bool C_4JInput::ButtonPressed(int iPad, unsigned char ucAction)
|
bool C_4JInput::ButtonPressed(int iPad, unsigned char ucAction)
|
||||||
{
|
{
|
||||||
return InternalInputManager.ButtonPressed(iPad, ucAction);
|
return InternalInputManager.ButtonPressed(iPad, ucAction);
|
||||||
@@ -119,14 +129,9 @@ bool C_4JInput::IsPadConnected(int iPad)
|
|||||||
return InternalInputManager.IsPadConnected(iPad);
|
return InternalInputManager.IsPadConnected(iPad);
|
||||||
}
|
}
|
||||||
|
|
||||||
void C_4JInput::SetSelectBackSwapped(bool swapped)
|
bool C_4JInput::IsPadActive(int iPad)
|
||||||
{
|
{
|
||||||
InternalInputManager.SetSelectBackSwapped(swapped);
|
return InternalInputManager.IsPadActive(iPad);
|
||||||
}
|
|
||||||
|
|
||||||
bool C_4JInput::IsSelectBackSwapped()
|
|
||||||
{
|
|
||||||
return InternalInputManager.IsSelectBackSwapped();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float C_4JInput::GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay)
|
float C_4JInput::GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay)
|
||||||
@@ -164,6 +169,171 @@ void C_4JInput::SetMenuDisplayed(int iPad, bool bVal)
|
|||||||
InternalInputManager.SetMenuDisplayed(iPad, bVal);
|
InternalInputManager.SetMenuDisplayed(iPad, bVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnKeyDown(int vkCode)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnKeyDown(vkCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnKeyUp(int vkCode)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnKeyUp(vkCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnChar(wchar_t ch)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnChar(ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsKeyDown(int vkCode) const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsKeyDown(vkCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsKeyPressed(int vkCode) const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsKeyPressed(vkCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsKeyReleased(int vkCode) const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsKeyReleased(vkCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
int C_4JInput::GetMouseX() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.GetMouseX();
|
||||||
|
}
|
||||||
|
|
||||||
|
int C_4JInput::GetMouseY() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.GetMouseY();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsMouseLDown() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsLButtonDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsLButtonPressed() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsLButtonPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsLButtonReleased() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsLButtonReleased();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsMouseRDown() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsRButtonDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsRButtonPressed() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsRButtonPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsRButtonReleased() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsRButtonReleased();
|
||||||
|
}
|
||||||
|
|
||||||
|
int C_4JInput::GetMouseWheelDelta() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.GetMouseWheelDelta();
|
||||||
|
}
|
||||||
|
|
||||||
|
wchar_t C_4JInput::GetLastChar() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.GetLastChar();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::HasChar() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.HasChar();
|
||||||
|
}
|
||||||
|
|
||||||
|
wchar_t C_4JInput::GetChar(int index) const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.GetChar(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnMouseMove(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnMouseMove(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnRawMouseDelta(int dx, int dy)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnRawMouseDelta(dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnLButtonDown(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnLButtonDown(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnLButtonUp(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnLButtonUp(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnRButtonDown(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnRButtonDown(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnRButtonUp(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnRButtonUp(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnMButtonDown(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnMButtonDown(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnMButtonUp(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnMButtonUp(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::OnMouseWheel(int delta, int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.OnMouseWheel(delta, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::SetMouseCaptured(bool captured)
|
||||||
|
{
|
||||||
|
InternalKeyboard.SetMouseCaptured(captured);
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::SetWindowFocused(bool focused)
|
||||||
|
{
|
||||||
|
InternalKeyboard.SetWindowFocused(focused);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool C_4JInput::IsMouseCaptured() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.IsMouseCaptured();
|
||||||
|
}
|
||||||
|
|
||||||
|
void C_4JInput::SetMousePos(int x, int y)
|
||||||
|
{
|
||||||
|
InternalKeyboard.SetMousePos(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int C_4JInput::GetRawMouseX() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.GetRawMouseX();
|
||||||
|
}
|
||||||
|
|
||||||
|
int C_4JInput::GetRawMouseY() const
|
||||||
|
{
|
||||||
|
return InternalKeyboard.GetRawMouseY();
|
||||||
|
}
|
||||||
|
|
||||||
EKeyboardResult C_4JInput::RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int (*Func)(LPVOID, const bool), LPVOID lpParam,
|
EKeyboardResult C_4JInput::RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int (*Func)(LPVOID, const bool), LPVOID lpParam,
|
||||||
C_4JInput::EKeyboardMode eMode)
|
C_4JInput::EKeyboardMode eMode)
|
||||||
{
|
{
|
||||||
@@ -175,12 +345,21 @@ void C_4JInput::GetText(uint16_t *UTF16String)
|
|||||||
InternalKeyboard.GetText(UTF16String);
|
InternalKeyboard.GetText(UTF16String);
|
||||||
}
|
}
|
||||||
|
|
||||||
EControllerType C_4JInput::GetControllerType(int iPad)
|
const char* C_4JInput::PollControllerType(int ipad) {
|
||||||
{
|
const char* GamepadType = InternalInputManager.GetGamepadType(ipad);
|
||||||
if(InternalInputManager.IsPadConnected(iPad))
|
|
||||||
|
if (!GamepadType)
|
||||||
|
return "UNKNOWN";
|
||||||
|
|
||||||
|
if (strcmp(GamepadType, "SWITCH_PRO") == 0 ||
|
||||||
|
strcmp(GamepadType, "JOYCON_PAIR") == 0 ||
|
||||||
|
strcmp(GamepadType, "JOYCON_L") == 0 ||
|
||||||
|
strcmp(GamepadType, "JOYCON_R") == 0)
|
||||||
{
|
{
|
||||||
return InternalInputManager.GetControllerType(iPad); //strk13r - mrow mrow mrow mrowwwwwwwwwww, i am silly kitty
|
return "SWITCH";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return GamepadType; // str1k3r - if not one of the switch types, return the type itself
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C_4JInput::VerifyStrings(WCHAR **pwStringA, int iStringC, int (*Func)(LPVOID, STRING_VERIFY_RESPONSE *), LPVOID lpParam)
|
bool C_4JInput::VerifyStrings(WCHAR **pwStringA, int iStringC, int (*Func)(LPVOID, STRING_VERIFY_RESPONSE *), LPVOID lpParam)
|
||||||
|
|||||||
@@ -24,7 +24,231 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "INP_Keyboard.h"
|
#include "INP_Keyboard.h"
|
||||||
|
|
||||||
void CKeyboard::Tick(void) {}
|
CKeyboard::CKeyboard()
|
||||||
|
{
|
||||||
|
m_lParam = nullptr;
|
||||||
|
m_onInput = nullptr;
|
||||||
|
ZeroMemory(m_chrText, sizeof(m_chrText));
|
||||||
|
|
||||||
|
memset(m_keysPrev, 0, sizeof(m_keysPrev));
|
||||||
|
memset(m_keysCurr, 0, sizeof(m_keysCurr));
|
||||||
|
m_mouseX = m_mouseY = 0;
|
||||||
|
m_lButtonPrev = m_lButtonCurr = false;
|
||||||
|
m_rButtonPrev = m_rButtonCurr = false;
|
||||||
|
m_mButtonPrev = m_mButtonCurr = false;
|
||||||
|
m_mouseWheel = 0;
|
||||||
|
memset(m_charBuffer, 0, sizeof(m_charBuffer));
|
||||||
|
m_charCount = 0;
|
||||||
|
m_mouseCaptured = false;
|
||||||
|
m_mouseDeltaX = m_mouseDeltaY = 0;
|
||||||
|
m_windowFocused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::Init()
|
||||||
|
{
|
||||||
|
RAWINPUTDEVICE rid;
|
||||||
|
rid.usUsagePage = 0x01; // HID_USAGE_PAGE_GENERIC
|
||||||
|
rid.usUsage = 0x02; // HID_USAGE_GENERIC_MOUSE
|
||||||
|
rid.dwFlags = 0;
|
||||||
|
rid.hwndTarget = g_hWnd;
|
||||||
|
RegisterRawInputDevices(&rid, 1, sizeof(rid));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::Tick(void)
|
||||||
|
{
|
||||||
|
memcpy(m_keysPrev, m_keysCurr, sizeof(m_keysCurr));
|
||||||
|
m_lButtonPrev = m_lButtonCurr;
|
||||||
|
m_rButtonPrev = m_rButtonCurr;
|
||||||
|
m_mButtonPrev = m_mButtonCurr;
|
||||||
|
m_mouseWheel = 0;
|
||||||
|
m_charCount = 0;
|
||||||
|
m_mouseDeltaX = m_mouseDeltaAccumX;
|
||||||
|
m_mouseDeltaY = m_mouseDeltaAccumY;
|
||||||
|
m_mouseDeltaAccumX = 0;
|
||||||
|
m_mouseDeltaAccumY = 0;
|
||||||
|
|
||||||
|
if (m_mouseCaptured && g_hWnd && m_windowFocused && g_hWnd)
|
||||||
|
{
|
||||||
|
RECT rc;
|
||||||
|
GetClientRect(g_hWnd, &rc);
|
||||||
|
POINT center;
|
||||||
|
center.x = (rc.right - rc.left) / 2;
|
||||||
|
center.y = (rc.bottom - rc.top) / 2;
|
||||||
|
ClientToScreen(g_hWnd, ¢er);
|
||||||
|
SetCursorPos(center.x, center.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnKeyDown(int vkCode)
|
||||||
|
{
|
||||||
|
if (vkCode >= 0 && vkCode < MAX_KEYS)
|
||||||
|
{
|
||||||
|
m_keysCurr[vkCode] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnKeyUp(int vkCode)
|
||||||
|
{
|
||||||
|
if (vkCode >= 0 && vkCode < MAX_KEYS)
|
||||||
|
{
|
||||||
|
m_keysCurr[vkCode] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnChar(wchar_t ch)
|
||||||
|
{
|
||||||
|
if (m_charCount < MAX_CHARS_PER_FRAME)
|
||||||
|
{
|
||||||
|
m_charBuffer[m_charCount++] = ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CKeyboard::IsKeyDown(int vkCode) const
|
||||||
|
{
|
||||||
|
if (vkCode >= 0 && vkCode < MAX_KEYS)
|
||||||
|
return m_keysCurr[vkCode];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CKeyboard::IsKeyPressed(int vkCode) const
|
||||||
|
{
|
||||||
|
if (vkCode >= 0 && vkCode < MAX_KEYS)
|
||||||
|
return m_keysCurr[vkCode] && !m_keysPrev[vkCode];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CKeyboard::IsKeyReleased(int vkCode) const
|
||||||
|
{
|
||||||
|
if (vkCode >= 0 && vkCode < MAX_KEYS)
|
||||||
|
return !m_keysCurr[vkCode] && m_keysPrev[vkCode];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnMouseMove(int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnRawMouseDelta(int dx, int dy)
|
||||||
|
{
|
||||||
|
m_mouseDeltaAccumX += dx;
|
||||||
|
m_mouseDeltaAccumY += dy;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnLButtonDown(int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
m_lButtonCurr = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnLButtonUp(int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
m_lButtonCurr = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnRButtonDown(int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
m_rButtonCurr = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnRButtonUp(int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
m_rButtonCurr = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnMButtonDown(int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
m_mButtonCurr = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnMButtonUp(int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
m_mButtonCurr = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::OnMouseWheel(int delta, int x, int y)
|
||||||
|
{
|
||||||
|
m_mouseX = x;
|
||||||
|
m_mouseY = y;
|
||||||
|
m_mouseWheel += delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::SetMouseCaptured(bool grabbed)
|
||||||
|
{
|
||||||
|
if (m_mouseCaptured == grabbed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_mouseCaptured = grabbed;
|
||||||
|
if (grabbed && g_hWnd)
|
||||||
|
{
|
||||||
|
while (ShowCursor(FALSE) >= 0) {}
|
||||||
|
RECT rc;
|
||||||
|
GetClientRect(g_hWnd, &rc);
|
||||||
|
POINT topLeft = { rc.left, rc.top };
|
||||||
|
POINT bottomRight = { rc.right, rc.bottom };
|
||||||
|
ClientToScreen(g_hWnd, &topLeft);
|
||||||
|
ClientToScreen(g_hWnd, &bottomRight);
|
||||||
|
RECT clipRect = { topLeft.x, topLeft.y, bottomRight.x, bottomRight.y };
|
||||||
|
ClipCursor(&clipRect);
|
||||||
|
|
||||||
|
GetClientRect(g_hWnd, &rc);
|
||||||
|
POINT center;
|
||||||
|
center.x = (rc.right - rc.left) / 2;
|
||||||
|
center.y = (rc.bottom - rc.top) / 2;
|
||||||
|
ClientToScreen(g_hWnd, ¢er);
|
||||||
|
SetCursorPos(center.x, center.y);
|
||||||
|
|
||||||
|
m_mouseDeltaAccumX = 0;
|
||||||
|
m_mouseDeltaAccumY = 0;
|
||||||
|
}
|
||||||
|
else if (!grabbed && g_hWnd)
|
||||||
|
{
|
||||||
|
while (ShowCursor(TRUE) < 0) {}
|
||||||
|
ClipCursor(nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CKeyboard::SetWindowFocused(bool focused)
|
||||||
|
{
|
||||||
|
m_windowFocused = focused;
|
||||||
|
if (focused)
|
||||||
|
{
|
||||||
|
if (m_mouseCaptured)
|
||||||
|
{
|
||||||
|
while (ShowCursor(FALSE) >= 0) {}
|
||||||
|
RECT rc;
|
||||||
|
GetClientRect(g_hWnd, &rc);
|
||||||
|
POINT center;
|
||||||
|
center.x = (rc.right - rc.left) / 2;
|
||||||
|
center.y = (rc.bottom - rc.top) / 2;
|
||||||
|
ClientToScreen(g_hWnd, ¢er);
|
||||||
|
SetCursorPos(center.x, center.y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (ShowCursor(TRUE) < 0) {}
|
||||||
|
ClipCursor(nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (ShowCursor(TRUE) < 0) {}
|
||||||
|
ClipCursor(nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
EKeyboardResult CKeyboard::RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int (*Func)(LPVOID, const bool), LPVOID lpParam,
|
EKeyboardResult CKeyboard::RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int (*Func)(LPVOID, const bool), LPVOID lpParam,
|
||||||
C_4JInput::EKeyboardMode eMode)
|
C_4JInput::EKeyboardMode eMode)
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ void SeedEditBox();
|
|||||||
class CKeyboard
|
class CKeyboard
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
CKeyboard();
|
||||||
|
|
||||||
enum EKeyboardProcessState
|
enum EKeyboardProcessState
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
@@ -40,11 +42,83 @@ public:
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
void Tick(void);
|
void Init();
|
||||||
|
void Tick();
|
||||||
|
|
||||||
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int (*Func)(LPVOID, const bool), LPVOID lpParam,
|
void OnKeyDown(int vkCode);
|
||||||
|
void OnKeyUp(int vkCode);
|
||||||
|
void OnChar(wchar_t ch);
|
||||||
|
|
||||||
|
void OnMouseMove(int x, int y);
|
||||||
|
void OnRawMouseDelta(int dx, int dy);
|
||||||
|
void OnLButtonDown(int x, int y);
|
||||||
|
void OnLButtonUp(int x, int y);
|
||||||
|
void OnRButtonDown(int x, int y);
|
||||||
|
void OnRButtonUp(int x, int y);
|
||||||
|
void OnMButtonDown(int x, int y);
|
||||||
|
void OnMButtonUp(int x, int y);
|
||||||
|
void OnMouseWheel(int delta, int x, int y);
|
||||||
|
|
||||||
|
bool IsKeyDown(int vkCode) const;
|
||||||
|
bool IsKeyPressed(int vkCode) const;
|
||||||
|
bool IsKeyReleased(int vkCode) const;
|
||||||
|
|
||||||
|
int GetMouseX() const { return m_mouseX; }
|
||||||
|
int GetMouseY() const { return m_mouseY; }
|
||||||
|
|
||||||
|
int GetRawMouseX() const { return m_mouseDeltaX; }
|
||||||
|
int GetRawMouseY() const { return m_mouseDeltaY; }
|
||||||
|
|
||||||
|
bool IsLButtonDown() const { return m_lButtonCurr; }
|
||||||
|
bool IsLButtonPressed() const { return m_lButtonCurr && !m_lButtonPrev; }
|
||||||
|
bool IsLButtonReleased() const { return !m_lButtonCurr && m_lButtonPrev; }
|
||||||
|
|
||||||
|
bool IsRButtonDown() const { return m_rButtonCurr; }
|
||||||
|
bool IsRButtonPressed() const { return m_rButtonCurr && !m_rButtonPrev; }
|
||||||
|
bool IsRButtonReleased() const { return !m_rButtonCurr && m_rButtonPrev; }
|
||||||
|
|
||||||
|
int GetMouseWheelDelta() const { return m_mouseWheel; }
|
||||||
|
|
||||||
|
wchar_t GetLastChar() const { return m_charCount > 0 ? m_charBuffer[0] : 0; }
|
||||||
|
bool HasChar() const { return m_charCount > 0; }
|
||||||
|
int GetCharCount() const { return m_charCount; }
|
||||||
|
wchar_t GetChar(int index) const { return (index >= 0 && index < m_charCount) ? m_charBuffer[index] : 0; }
|
||||||
|
|
||||||
|
void SetMouseCaptured(bool captured);
|
||||||
|
void SetWindowFocused(bool focused);
|
||||||
|
bool IsMouseCaptured() const { return m_mouseCaptured; }
|
||||||
|
|
||||||
|
void SetMousePos(int x, int y) { m_mouseX = x; m_mouseY = y; }
|
||||||
|
|
||||||
|
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int (*Func)(LPVOID, const bool), LPVOID lpParam,
|
||||||
C_4JInput::EKeyboardMode eMode);
|
C_4JInput::EKeyboardMode eMode);
|
||||||
void GetText(uint16_t *UTF16String);
|
void GetText(uint16_t *UTF16String);
|
||||||
|
|
||||||
|
|
||||||
BYTE gap0[0x68];
|
BYTE gap0[0x68];
|
||||||
|
private:
|
||||||
|
static const int MAX_KEYS = 256;
|
||||||
|
static const int MAX_CHARS_PER_FRAME = 32;
|
||||||
|
|
||||||
|
bool m_keysPrev[MAX_KEYS];
|
||||||
|
bool m_keysCurr[MAX_KEYS];
|
||||||
|
|
||||||
|
int m_mouseX, m_mouseY;
|
||||||
|
bool m_lButtonPrev, m_lButtonCurr;
|
||||||
|
bool m_rButtonPrev, m_rButtonCurr;
|
||||||
|
bool m_mButtonPrev, m_mButtonCurr;
|
||||||
|
int m_mouseWheel;
|
||||||
|
|
||||||
|
wchar_t m_charBuffer[MAX_CHARS_PER_FRAME];
|
||||||
|
int m_charCount;
|
||||||
|
|
||||||
|
bool m_windowFocused;
|
||||||
|
bool m_mouseCaptured;
|
||||||
|
int m_mouseDeltaX, m_mouseDeltaY;
|
||||||
|
int m_mouseDeltaAccumX, m_mouseDeltaAccumY;
|
||||||
|
|
||||||
|
wchar_t m_chrText[128];
|
||||||
|
LPVOID m_lParam;
|
||||||
|
int (*m_onInput)(LPVOID, LPCWSTR);
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -27,12 +27,8 @@ SOFTWARE.
|
|||||||
|
|
||||||
CInput InternalInputManager;
|
CInput InternalInputManager;
|
||||||
|
|
||||||
bool m_SelectBackSwapped = false;
|
|
||||||
|
|
||||||
CInput::CInput()
|
CInput::CInput()
|
||||||
{
|
{
|
||||||
m_Keyboard = CKeyboard();
|
|
||||||
|
|
||||||
m_uiSigninJoypadMask = 0;
|
m_uiSigninJoypadMask = 0;
|
||||||
for (int i = 0; i < 4; ++i)
|
for (int i = 0; i < 4; ++i)
|
||||||
m_bIsMenuDisplayed[i] = 0;
|
m_bIsMenuDisplayed[i] = 0;
|
||||||
@@ -79,6 +75,8 @@ void CInput::Initialise(int iInputStateC, unsigned char ucMapC, unsigned char uc
|
|||||||
m_Joypads[i].m_pucLeftTriggerAxisMap = &m_Joypads[i].m_ucLeftTriggerState;
|
m_Joypads[i].m_pucLeftTriggerAxisMap = &m_Joypads[i].m_ucLeftTriggerState;
|
||||||
m_Joypads[i].m_pucRightTriggerAxisMap = &m_Joypads[i].m_ucRightTriggerState;
|
m_Joypads[i].m_pucRightTriggerAxisMap = &m_Joypads[i].m_ucRightTriggerState;
|
||||||
m_Joypads[i].m_fSensitivity = 1.0f;
|
m_Joypads[i].m_fSensitivity = 1.0f;
|
||||||
|
|
||||||
|
m_iTouchInputButton[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_JoypadMap = (unsigned int **)operator new[](ucMapC * sizeof(int *));
|
m_JoypadMap = (unsigned int **)operator new[](ucMapC * sizeof(int *));
|
||||||
@@ -97,7 +95,6 @@ void CInput::Tick(void)
|
|||||||
{
|
{
|
||||||
HandleGamepadEvents();
|
HandleGamepadEvents();
|
||||||
UpdateJoypads();
|
UpdateJoypads();
|
||||||
m_Keyboard.Tick();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInput::SetJoypadValues(JOYPAD *pThisPad)
|
void CInput::SetJoypadValues(JOYPAD *pThisPad)
|
||||||
@@ -314,10 +311,14 @@ unsigned int CInput::GetGameJoypadMaps(unsigned char ucMap, unsigned char ucActi
|
|||||||
return m_JoypadMap[ucMap][ucAction];
|
return m_JoypadMap[ucMap][ucAction];
|
||||||
}
|
}
|
||||||
|
|
||||||
//str1k3r - renamed to match the Orbis Input lib, why did i rename it cause tism
|
const char* CInput::GetGamepadType(int iPad)
|
||||||
EControllerType CInput::GetControllerType(int iPad)
|
|
||||||
{
|
{
|
||||||
return GetControllerName(SDL_GetGamepadType(m_Joypads[iPad].m_pGamepad)); // str1k3r - magic we return it :shocked:
|
if (!m_Joypads[iPad].m_pGamepad)
|
||||||
|
{
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
|
||||||
|
return GamepadTypeName(SDL_GetGamepadType(m_Joypads[iPad].m_pGamepad));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInput::SetJoypadMapVal(int iPad, unsigned char ucMap)
|
void CInput::SetJoypadMapVal(int iPad, unsigned char ucMap)
|
||||||
@@ -331,6 +332,11 @@ unsigned char CInput::GetJoypadMapVal(int iPad)
|
|||||||
return m_Joypads[iPad].m_ucMappingValue;
|
return m_Joypads[iPad].m_ucMappingValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInput::MapTouchInput(int iPad, int button)
|
||||||
|
{
|
||||||
|
m_iTouchInputButton[iPad] |= button;
|
||||||
|
}
|
||||||
|
|
||||||
void CInput::SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo)
|
void CInput::SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo)
|
||||||
{
|
{
|
||||||
float *pfTo = nullptr;
|
float *pfTo = nullptr;
|
||||||
@@ -398,14 +404,9 @@ bool CInput::IsPadConnected(int iPad)
|
|||||||
return m_Joypads[iPad].m_bIsConnected;
|
return m_Joypads[iPad].m_bIsConnected;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInput::SetSelectBackSwapped(bool swapped)
|
bool CInput::IsPadActive(int iPad)
|
||||||
{
|
{
|
||||||
m_SelectBackSwapped = swapped;
|
return m_Joypads[iPad].m_bControllerActive;
|
||||||
}
|
|
||||||
|
|
||||||
bool CInput::IsSelectBackSwapped()
|
|
||||||
{
|
|
||||||
return m_SelectBackSwapped;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInput::SetSigninJoypadMask(unsigned int mask)
|
void CInput::SetSigninJoypadMask(unsigned int mask)
|
||||||
@@ -764,27 +765,39 @@ bool CInput::UpdateJoypads()
|
|||||||
if (pThisPad->m_bIsConnected)
|
if (pThisPad->m_bIsConnected)
|
||||||
{
|
{
|
||||||
SetJoypadValues(pThisPad);
|
SetJoypadValues(pThisPad);
|
||||||
|
|
||||||
pThisPad->m_uiButtonsPressed = ~pThisPad->m_uiOldButtons & pThisPad->m_uiButtons;
|
|
||||||
pThisPad->m_uiButtonsReleased = ~pThisPad->m_uiButtons & pThisPad->m_uiOldButtons;
|
|
||||||
|
|
||||||
for (int bit = 0; bit < 24; ++bit)
|
|
||||||
{
|
|
||||||
if ((pThisPad->m_uiButtonsPressed & (1 << bit)) != 0)
|
|
||||||
{
|
|
||||||
GetStartTime(i, bit);
|
|
||||||
}
|
|
||||||
else if ((pThisPad->m_uiButtons & (1 << bit)) != 0)
|
|
||||||
{
|
|
||||||
UpdateTime(i, bit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (pThisPad->m_bWasConnected)
|
else if (pThisPad->m_bWasConnected)
|
||||||
{
|
{
|
||||||
ClearJoypadValues(pThisPad);
|
ClearJoypadValues(pThisPad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_iTouchInputButton[i])
|
||||||
|
{
|
||||||
|
pThisPad->m_uiButtons |= m_iTouchInputButton[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
m_iTouchInputButton[i] = 0;
|
||||||
|
|
||||||
|
pThisPad->m_uiButtonsPressed = ~pThisPad->m_uiOldButtons & pThisPad->m_uiButtons;
|
||||||
|
pThisPad->m_uiButtonsReleased = ~pThisPad->m_uiButtons & pThisPad->m_uiOldButtons;
|
||||||
|
|
||||||
|
for (int bit = 0; bit < 24; ++bit)
|
||||||
|
{
|
||||||
|
if ((pThisPad->m_uiButtonsPressed & (1 << bit)) != 0)
|
||||||
|
{
|
||||||
|
GetStartTime(i, bit);
|
||||||
|
}
|
||||||
|
else if ((pThisPad->m_uiButtons & (1 << bit)) != 0)
|
||||||
|
{
|
||||||
|
UpdateTime(i, bit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pThisPad->m_uiButtonsPressed)
|
||||||
|
pThisPad->m_bControllerActive = true;
|
||||||
|
else
|
||||||
|
pThisPad->m_bControllerActive = false;
|
||||||
|
|
||||||
if (m_pDebugSequenceFn && (pThisPad->m_uiButtonsPressed & (_360_JOY_BUTTON_A | _360_JOY_BUTTON_B | _360_JOY_BUTTON_X | _360_JOY_BUTTON_Y |
|
if (m_pDebugSequenceFn && (pThisPad->m_uiButtonsPressed & (_360_JOY_BUTTON_A | _360_JOY_BUTTON_B | _360_JOY_BUTTON_X | _360_JOY_BUTTON_Y |
|
||||||
_360_JOY_BUTTON_RB | _360_JOY_BUTTON_LB)) != 0)
|
_360_JOY_BUTTON_RB | _360_JOY_BUTTON_LB)) != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,6 +31,26 @@ SOFTWARE.
|
|||||||
|
|
||||||
class CInput
|
class CInput
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
const char* GamepadTypeName(SDL_GamepadType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case SDL_GAMEPAD_TYPE_UNKNOWN: return "UNKNOWN";
|
||||||
|
case SDL_GAMEPAD_TYPE_GAMECUBE: return "GAMECUBE";
|
||||||
|
case SDL_GAMEPAD_TYPE_STANDARD: return "STANDARD";
|
||||||
|
case SDL_GAMEPAD_TYPE_XBOX360: return "XBOX360";
|
||||||
|
case SDL_GAMEPAD_TYPE_XBOXONE: return "XBOXONE";
|
||||||
|
case SDL_GAMEPAD_TYPE_PS3: return "PS3";
|
||||||
|
case SDL_GAMEPAD_TYPE_PS4: return "PS4";
|
||||||
|
case SDL_GAMEPAD_TYPE_PS5: return "PS5";
|
||||||
|
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO: return "SWITCH_PRO";
|
||||||
|
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT: return "JOYCON_L";
|
||||||
|
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT: return "JOYCON_R";
|
||||||
|
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR: return "JOYCON_PAIR";
|
||||||
|
default: return "UNKNOWN";
|
||||||
|
}
|
||||||
|
}
|
||||||
public:
|
public:
|
||||||
struct JOYPAD
|
struct JOYPAD
|
||||||
{
|
{
|
||||||
@@ -38,6 +58,7 @@ public:
|
|||||||
bool m_bIsConnected;
|
bool m_bIsConnected;
|
||||||
bool m_bWasConnected;
|
bool m_bWasConnected;
|
||||||
bool m_bHasConnected;
|
bool m_bHasConnected;
|
||||||
|
bool m_bControllerActive;
|
||||||
|
|
||||||
unsigned int m_uiButtons;
|
unsigned int m_uiButtons;
|
||||||
unsigned int m_uiOldButtons;
|
unsigned int m_uiOldButtons;
|
||||||
@@ -101,16 +122,16 @@ public:
|
|||||||
|
|
||||||
void SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction, unsigned int uiActionVal);
|
void SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction, unsigned int uiActionVal);
|
||||||
unsigned int GetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction);
|
unsigned int GetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction);
|
||||||
EControllerType GetControllerType(int iPad);
|
const char* GetGamepadType(int iPad);
|
||||||
void SetJoypadMapVal(int iPad, unsigned char ucMap);
|
void SetJoypadMapVal(int iPad, unsigned char ucMap);
|
||||||
unsigned char GetJoypadMapVal(int iPad);
|
unsigned char GetJoypadMapVal(int iPad);
|
||||||
|
|
||||||
|
void MapTouchInput(int iPad, int button);
|
||||||
void SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo);
|
void SetJoypadStickAxisMap(int iPad, unsigned int uiFrom, unsigned int uiTo);
|
||||||
void SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom, unsigned int uiTo);
|
void SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom, unsigned int uiTo);
|
||||||
|
|
||||||
bool IsPadConnected(int iPad);
|
bool IsPadConnected(int iPad);
|
||||||
void SetSelectBackSwapped(bool swapped);
|
bool IsPadActive(int iPad);
|
||||||
bool IsSelectBackSwapped();
|
|
||||||
void SetSigninJoypadMask(unsigned int mask);
|
void SetSigninJoypadMask(unsigned int mask);
|
||||||
unsigned int GetValue(int iPad, unsigned char ucAction, bool bRepeat = false);
|
unsigned int GetValue(int iPad, unsigned char ucAction, bool bRepeat = false);
|
||||||
bool IsSet(int iPad, unsigned char ucAction);
|
bool IsSet(int iPad, unsigned char ucAction);
|
||||||
@@ -185,26 +206,7 @@ public:
|
|||||||
int (*m_pDebugSequenceFn)(void *);
|
int (*m_pDebugSequenceFn)(void *);
|
||||||
LPVOID m_pDebugSequenceParam;
|
LPVOID m_pDebugSequenceParam;
|
||||||
|
|
||||||
private:
|
unsigned int m_iTouchInputButton[MAX_JOYPADS];
|
||||||
EControllerType GetControllerName(SDL_GamepadType type)
|
|
||||||
{
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case SDL_GAMEPAD_TYPE_XBOX360: return EControllerType_Xbox360;
|
|
||||||
case SDL_GAMEPAD_TYPE_XBOXONE: return EControllerType_XboxOne;
|
|
||||||
case SDL_GAMEPAD_TYPE_PS3: return EControllerType_PS3;
|
|
||||||
case SDL_GAMEPAD_TYPE_PS4: return EControllerType_PS4;
|
|
||||||
case SDL_GAMEPAD_TYPE_PS5: return EControllerType_PS5;
|
|
||||||
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO:
|
|
||||||
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT:
|
|
||||||
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT:
|
|
||||||
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR: return EControllerType_Switch;
|
|
||||||
case SDL_GAMEPAD_TYPE_GAMECUBE: return EControllerType_Gamecube;
|
|
||||||
case SDL_GAMEPAD_TYPE_STANDARD:
|
|
||||||
case SDL_GAMEPAD_TYPE_UNKNOWN:
|
|
||||||
default: return EControllerType_Default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Singleton
|
// Singleton
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
#ifndef PCH_H
|
#ifndef PCH_H
|
||||||
#define PCH_H
|
#define PCH_H
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <Xinput.h>
|
#include <Xinput.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _XBOX
|
|
||||||
#include "extraX64.h"
|
#include "extraX64.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //PCH_H
|
#endif //PCH_H
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -153,16 +153,15 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<Optimization>Full</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|||||||
@@ -1,77 +1,28 @@
|
|||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Patoke
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "4J_Profile.h"
|
#include "4J_Profile.h"
|
||||||
#include "PRO_Main.h"
|
|
||||||
|
|
||||||
void C_4JProfile::LoadSettings(void* gs, size_t gsSize)
|
C_4JProfile ProfileManager;
|
||||||
{
|
|
||||||
InternalProfileManager.m_ProfileData.LoadSettings(gs, gsSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_4JProfile::SaveSettings(void* gs, size_t gsSize)
|
|
||||||
{
|
|
||||||
InternalProfileManager.m_ProfileData.SaveSettings(gs, gsSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C_4JProfile::IsSignedIn(int iQuadrant)
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.IsSignedIn(iQuadrant);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C_4JProfile::IsSignedInLive(int iProf)
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.IsSignedInLive(iProf);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C_4JProfile::IsGuest(int iQuadrant)
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.IsGuest(iQuadrant);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C_4JProfile::AllowedToPlayMultiplayer(int iProf)
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.AllowedToPlayMultiplayer(iProf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_4JProfile::SetFakeGamerTag(char *name)
|
|
||||||
{
|
|
||||||
InternalProfileManager.m_Sys.SetFakeGamertag(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
char* C_4JProfile::GetGamertag(int iPad)
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.GetGamertag(iPad);
|
|
||||||
}
|
|
||||||
|
|
||||||
wstring C_4JProfile::GetDisplayName(int iPad)
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.GetDisplayName(iPad);
|
|
||||||
}
|
|
||||||
|
|
||||||
int C_4JProfile::GetPrimaryPad()
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.GetPrimaryPad();
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_4JProfile::SetPrimaryPad(int iPad)
|
|
||||||
{
|
|
||||||
InternalProfileManager.m_Sys.SetPrimaryPad(iPad);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C_4JProfile::IsFullVersion()
|
|
||||||
{
|
|
||||||
return InternalProfileManager.m_Sys.IsFullVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT C_4JProfile::GetLiveConnectionStatus()
|
|
||||||
{
|
|
||||||
return S_OK; //str1k3r - matches durango profile lib
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C_4JProfile::IsSystemUIDisplayed()
|
|
||||||
{
|
|
||||||
return 0; //str1k3r - matches durango profile lib
|
|
||||||
}
|
|
||||||
|
|
||||||
void C_4JProfile::SetDebugFullOverride(bool bVal)
|
|
||||||
{
|
|
||||||
InternalProfileManager.m_Sys.SetDebugFullOverride(bVal);
|
|
||||||
}
|
|
||||||
@@ -1,46 +1,23 @@
|
|||||||
#include "PRO_Data.h"
|
/*
|
||||||
#include "4J_Profile.h"
|
MIT License
|
||||||
|
|
||||||
//C_4JProfile::PROFILESETTINGS * CProfileData::GetDashboardProfileSettings(int iPad)
|
Copyright (c) 2026 Patoke
|
||||||
//{
|
|
||||||
// ; //str1k3r - stubbed out for now
|
|
||||||
//}
|
|
||||||
|
|
||||||
//str1k3r - GetSettings is basically snatched from smartCMD
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
void GetSettings(wchar_t *outPath, DWORD size)
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
{
|
in the Software without restriction, including without limitation the rights
|
||||||
GetModuleFileNameW(NULL, outPath, size); //str1k3r - unlike smartCMD we use wide so we can handle non english characters
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
wchar_t *lastSlash = wcsrchr(outPath, '\\');
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
if (lastSlash) *(lastSlash + 1) = '\0';
|
furnished to do so, subject to the following conditions:
|
||||||
wcsncat_s(outPath, size, L"settings.dat", _TRUNCATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CProfileData::LoadSettings(void* gs, size_t gsSize)
|
The above copyright notice and this permission notice shall be included in all
|
||||||
{
|
copies or substantial portions of the Software.
|
||||||
if (!gs || gsSize == 0) return;
|
|
||||||
|
|
||||||
wchar_t settingsPath[MAX_PATH] = {};
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
GetSettings(settingsPath, MAX_PATH);
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
FILE *file = NULL;
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
if (_wfopen_s(&file, settingsPath, L"rb") == 0 && file) //str1k3r - fun fact theres a version of fopen_s but for wide :3
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
{
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
fread(gs, 1, gsSize, file);
|
SOFTWARE.
|
||||||
fclose(file);
|
*/
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CProfileData::SaveSettings(void* gs, size_t gsSize)
|
|
||||||
{
|
|
||||||
if (!gs || gsSize == 0) return;
|
|
||||||
|
|
||||||
wchar_t settingsPath[MAX_PATH] = {};
|
|
||||||
GetSettings(settingsPath, MAX_PATH);
|
|
||||||
|
|
||||||
FILE *file = NULL;
|
|
||||||
if (_wfopen_s(&file, settingsPath, L"wb") == 0 && file)
|
|
||||||
{
|
|
||||||
fwrite(gs, 1, gsSize, file);
|
|
||||||
fclose(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,24 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
class CProfileData
|
Copyright (c) 2026 Patoke
|
||||||
{
|
|
||||||
public:
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
// SETTINGS
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
void LoadSettings(void* gs, size_t gsSize);
|
in the Software without restriction, including without limitation the rights
|
||||||
void SaveSettings(void* gs, size_t gsSize);
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
};
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
@@ -1,3 +1,23 @@
|
|||||||
#include "PRO_Main.h"
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
CProfile InternalProfileManager;
|
Copyright (c) 2026 Patoke
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
@@ -1,14 +1,24 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
#include "PRO_Sys.h"
|
Copyright (c) 2026 Patoke
|
||||||
#include "PRO_Data.h"
|
|
||||||
|
|
||||||
class CProfile
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
{
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
public:
|
in the Software without restriction, including without limitation the rights
|
||||||
CSys m_Sys;
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
CProfileData m_ProfileData;
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
};
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
// Singleton
|
The above copyright notice and this permission notice shall be included in all
|
||||||
extern CProfile InternalProfileManager;
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
@@ -1,88 +1,23 @@
|
|||||||
#include "PRO_Sys.h"
|
/*
|
||||||
#include "4J_Input.h"
|
MIT License
|
||||||
|
|
||||||
bool s_bProfileIsFullVersion = true;
|
Copyright (c) 2026 Patoke
|
||||||
char fakeGamerTag[16] = "PlayerName";
|
|
||||||
wchar_t fakeGamerTagW[16] = L"PlayerName";
|
|
||||||
|
|
||||||
bool CSys::IsSignedIn(int iQuadrant)
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
{
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
return InputManager.IsPadConnected(iQuadrant); //str1k3r - since we dont sign in like consoles just check if the pad is connected
|
in the Software without restriction, including without limitation the rights
|
||||||
}
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
bool CSys::IsSignedInLive(int iProf)
|
The above copyright notice and this permission notice shall be included in all
|
||||||
{
|
copies or substantial portions of the Software.
|
||||||
return InputManager.IsPadConnected(iProf);
|
|
||||||
}
|
|
||||||
|
|
||||||
//str1k3r - set every pad that isnt pad 0 as a guest
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
bool CSys::IsGuest(int iQuadrant)
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
{
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
if(iQuadrant == 0)
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
{
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
return false;
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
}
|
SOFTWARE.
|
||||||
|
*/
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSys::SetFakeGamertag(char *name)
|
|
||||||
{
|
|
||||||
size_t chars = 0;
|
|
||||||
|
|
||||||
strcpy_s(fakeGamerTag, name);
|
|
||||||
mbstowcs_s(&chars, fakeGamerTagW, 16, name, _TRUNCATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
char* CSys::GetGamertag(int iPad)
|
|
||||||
{
|
|
||||||
if(iPad == 0)
|
|
||||||
{
|
|
||||||
return fakeGamerTag;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char iPadGamertag[32];
|
|
||||||
|
|
||||||
_snprintf_s(iPadGamertag, sizeof(iPadGamertag), "%s (%d)", fakeGamerTag, iPad);
|
|
||||||
|
|
||||||
return iPadGamertag;
|
|
||||||
}
|
|
||||||
|
|
||||||
wstring CSys::GetDisplayName(int iPad)
|
|
||||||
{
|
|
||||||
if(iPad == 0)
|
|
||||||
{
|
|
||||||
return fakeGamerTagW;
|
|
||||||
}
|
|
||||||
|
|
||||||
wchar_t iPadGamertagW[16];
|
|
||||||
|
|
||||||
_snwprintf_s(iPadGamertagW, _countof(iPadGamertagW), L"%s (%d)", fakeGamerTagW, iPad);
|
|
||||||
|
|
||||||
return iPadGamertagW;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CSys::AllowedToPlayMultiplayer(int iProf)
|
|
||||||
{
|
|
||||||
return InputManager.IsPadConnected(iProf);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CSys::GetPrimaryPad()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSys::SetPrimaryPad(int iPad)
|
|
||||||
{
|
|
||||||
; //str1k3r - stubbed out
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CSys::IsFullVersion()
|
|
||||||
{
|
|
||||||
return s_bProfileIsFullVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSys::SetDebugFullOverride(bool bVal)
|
|
||||||
{
|
|
||||||
s_bProfileIsFullVersion = bVal;
|
|
||||||
}
|
|
||||||
@@ -1,29 +1,24 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
#include "4J_Profile.h"
|
Copyright (c) 2026 Patoke
|
||||||
|
|
||||||
class CSys
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
{
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
public:
|
in the Software without restriction, including without limitation the rights
|
||||||
// SIGNED IN
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
bool IsSignedIn(int iQuadrant);
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
bool IsSignedInLive(int iProf);
|
furnished to do so, subject to the following conditions:
|
||||||
bool IsGuest(int iQuadrant);
|
|
||||||
|
|
||||||
// GAMERTAG
|
The above copyright notice and this permission notice shall be included in all
|
||||||
void SetFakeGamertag(char *name);
|
copies or substantial portions of the Software.
|
||||||
char* GetGamertag(int iPad);
|
|
||||||
wstring GetDisplayName(int iPad);
|
|
||||||
|
|
||||||
// PRIMARY PAD
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
int GetPrimaryPad();
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
void SetPrimaryPad(int iPad);
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// MULTIPLAYER
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
bool AllowedToPlayMultiplayer(int iProf);
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
// VERSION
|
*/
|
||||||
bool IsFullVersion();
|
|
||||||
|
|
||||||
void SetDebugFullOverride(bool bVal);
|
|
||||||
};
|
|
||||||
@@ -1,17 +1,13 @@
|
|||||||
#ifndef PCH_H
|
#ifndef PCH_H
|
||||||
#define PCH_H
|
#define PCH_H
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <Xinput.h>
|
#include <Xinput.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _XBOX
|
|
||||||
#include "extraX64.h"
|
#include "extraX64.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //PCH_H
|
#endif //PCH_H
|
||||||
@@ -187,9 +187,9 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<Optimization>Full</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
@@ -197,7 +197,6 @@
|
|||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<CompileAs>CompileAsCpp</CompileAs>
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ SOFTWARE.
|
|||||||
|
|
||||||
C4JRender RenderManager;
|
C4JRender RenderManager;
|
||||||
|
|
||||||
//str1k3r - set VSync to true by default
|
|
||||||
bool C4JRender::m_VSyncState = true;
|
|
||||||
|
|
||||||
void C4JRender::Tick()
|
void C4JRender::Tick()
|
||||||
{
|
{
|
||||||
InternalRenderManager.CBuffTick();
|
InternalRenderManager.CBuffTick();
|
||||||
@@ -41,17 +38,6 @@ void C4JRender::UpdateGamma(unsigned short usGamma)
|
|||||||
InternalRenderManager.UpdateGamma(usGamma);
|
InternalRenderManager.UpdateGamma(usGamma);
|
||||||
}
|
}
|
||||||
|
|
||||||
void C4JRender::SetVSync(bool vs)
|
|
||||||
{
|
|
||||||
if(vs != m_VSyncState)
|
|
||||||
m_VSyncState = vs;
|
|
||||||
}
|
|
||||||
|
|
||||||
int C4JRender::GetVSync()
|
|
||||||
{
|
|
||||||
return m_VSyncState ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void C4JRender::MatrixMode(int type)
|
void C4JRender::MatrixMode(int type)
|
||||||
{
|
{
|
||||||
InternalRenderManager.MatrixMode(type);
|
InternalRenderManager.MatrixMode(type);
|
||||||
@@ -147,11 +133,6 @@ void C4JRender::SetClearColour(const float colourRGBA[4])
|
|||||||
InternalRenderManager.SetClearColour(colourRGBA);
|
InternalRenderManager.SetClearColour(colourRGBA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void C4JRender::setResolution(int ScreenWidth, int ScreenHeight)
|
|
||||||
{
|
|
||||||
InternalRenderManager.setResolution(ScreenWidth, ScreenHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C4JRender::IsWidescreen()
|
bool C4JRender::IsWidescreen()
|
||||||
{
|
{
|
||||||
return InternalRenderManager.IsWidescreen();
|
return InternalRenderManager.IsWidescreen();
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public:
|
|||||||
void Present();
|
void Present();
|
||||||
void Clear(int flags, D3D11_RECT *pRect);
|
void Clear(int flags, D3D11_RECT *pRect);
|
||||||
void SetClearColour(const float colourRGBA[4]);
|
void SetClearColour(const float colourRGBA[4]);
|
||||||
void setResolution(int ScreenWidth, int ScreenHeight);
|
|
||||||
bool IsWidescreen();
|
bool IsWidescreen();
|
||||||
bool IsHiDef();
|
bool IsHiDef();
|
||||||
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ D3D11_PRIMITIVE_TOPOLOGY Renderer::g_topologies[C4JRender::PRIMITIVE_TYPE_COUNT]
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned int kVertexBufferSize = 0x100000;
|
static const unsigned int kVertexBufferSize = 0x100000;
|
||||||
static unsigned int kScreenWidth = 1920;
|
static const unsigned int kScreenGrabWidth = 1920;
|
||||||
static unsigned int kScreenHeight = 1080;
|
static const unsigned int kScreenGrabHeight = 1080;
|
||||||
static const unsigned int kThumbnailSize = 64;
|
static const unsigned int kThumbnailSize = 64;
|
||||||
|
|
||||||
static const unsigned int g_vertexStrides[C4JRender::VERTEX_TYPE_COUNT] = { 32, 16, 32, 32 };
|
static const unsigned int g_vertexStrides[C4JRender::VERTEX_TYPE_COUNT] = { 32, 16, 32, 32 };
|
||||||
@@ -854,27 +854,14 @@ ID3D11DeviceContext *Renderer::InitialiseContext(bool fromPresent)
|
|||||||
return deviceContext;
|
return deviceContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
//str1k3r - yo fuck you 4J and your hardcoded ass game
|
|
||||||
void Renderer::setResolution(int ScreenWidth, int ScreenHeight)
|
|
||||||
{
|
|
||||||
if(kScreenHeight != ScreenHeight || kScreenWidth != ScreenWidth)
|
|
||||||
{
|
|
||||||
kScreenHeight = ScreenHeight;
|
|
||||||
kScreenWidth = ScreenWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Renderer::IsHiDef()
|
bool Renderer::IsHiDef()
|
||||||
{
|
{
|
||||||
return (kScreenHeight >= 720 && kScreenWidth >= 1280);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Renderer::IsWidescreen()
|
bool Renderer::IsWidescreen()
|
||||||
{
|
{
|
||||||
if (kScreenHeight == 0) return false;
|
return true;
|
||||||
|
|
||||||
float aspectRatio = static_cast<float>(kScreenWidth) / kScreenHeight;
|
|
||||||
return (aspectRatio >= 1.56f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::Present()
|
void Renderer::Present()
|
||||||
@@ -885,7 +872,7 @@ void Renderer::Present()
|
|||||||
{
|
{
|
||||||
PROFILER_SCOPE("Renderer::Present", "ScreenGrab", MP_MAGENTA);
|
PROFILER_SCOPE("Renderer::Present", "ScreenGrab", MP_MAGENTA);
|
||||||
|
|
||||||
unsigned char *linearData = new unsigned char[kScreenWidth * kScreenHeight * 4];
|
unsigned char *linearData = new unsigned char[kScreenGrabWidth * kScreenGrabHeight * 4];
|
||||||
|
|
||||||
ID3D11Resource *backBufferResource = NULL;
|
ID3D11Resource *backBufferResource = NULL;
|
||||||
ID3D11Texture2D *backBuffer = NULL;
|
ID3D11Texture2D *backBuffer = NULL;
|
||||||
@@ -911,13 +898,13 @@ void Renderer::Present()
|
|||||||
m_pDeviceContext->Map(stagingTexture, 0, D3D11_MAP_READ_WRITE, 0, &mapped);
|
m_pDeviceContext->Map(stagingTexture, 0, D3D11_MAP_READ_WRITE, 0, &mapped);
|
||||||
const unsigned char* src = reinterpret_cast<const unsigned char*>(mapped.pData);
|
const unsigned char* src = reinterpret_cast<const unsigned char*>(mapped.pData);
|
||||||
|
|
||||||
for (UINT y = 0; y < kScreenHeight; ++y)
|
for (UINT y = 0; y < kScreenGrabHeight; ++y)
|
||||||
{
|
{
|
||||||
unsigned char *dstRow = linearData + y * kScreenWidth * 4;
|
unsigned char *dstRow = linearData + y * kScreenGrabWidth * 4;
|
||||||
const unsigned char *srcRow = src + y * mapped.RowPitch;
|
const unsigned char *srcRow = src + y * mapped.RowPitch;
|
||||||
std::memcpy(dstRow, srcRow, kScreenWidth * 4);
|
std::memcpy(dstRow, srcRow, kScreenGrabWidth * 4);
|
||||||
|
|
||||||
for (UINT x = 0; x < kScreenWidth; ++x)
|
for (UINT x = 0; x < kScreenGrabWidth; ++x)
|
||||||
dstRow[x * 4 + 3] = 0xFF;
|
dstRow[x * 4 + 3] = 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -939,8 +926,8 @@ void Renderer::Present()
|
|||||||
UTCSysTime.wSecond);
|
UTCSysTime.wSecond);
|
||||||
|
|
||||||
D3DXIMAGE_INFO info;
|
D3DXIMAGE_INFO info;
|
||||||
info.Width = kScreenWidth;
|
info.Width = kScreenGrabWidth;
|
||||||
info.Height = kScreenHeight;
|
info.Height = kScreenGrabHeight;
|
||||||
SaveTextureData(fileName, &info, reinterpret_cast<int*>(linearData));
|
SaveTextureData(fileName, &info, reinterpret_cast<int*>(linearData));
|
||||||
|
|
||||||
delete[] linearData;
|
delete[] linearData;
|
||||||
@@ -948,7 +935,7 @@ void Renderer::Present()
|
|||||||
m_bShouldScreenGrabNextFrame = false;
|
m_bShouldScreenGrabNextFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pSwapChain->Present(C4JRender::GetVSync(), 0);
|
m_pSwapChain->Present(1, 0);
|
||||||
++presentCount;
|
++presentCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1059,3 +1046,4 @@ Renderer::Context &Renderer::getContext()
|
|||||||
{
|
{
|
||||||
return *reinterpret_cast<Renderer::Context*>(TlsGetValue(Renderer::tlsIdx));
|
return *reinterpret_cast<Renderer::Context*>(TlsGetValue(Renderer::tlsIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef PCH_H
|
#ifndef PCH_H
|
||||||
#define PCH_H
|
#define PCH_H
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
@@ -12,10 +11,7 @@
|
|||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#include <d3d11_1.h>
|
#include <d3d11_1.h>
|
||||||
#include <DirectXMath.h>
|
#include <DirectXMath.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _XBOX
|
|
||||||
#include "extraX64.h"
|
#include "extraX64.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //PCH_H
|
#endif //PCH_H
|
||||||
@@ -149,16 +149,15 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<Optimization>Full</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDOWS64;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../Headers/Windows64;../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ void C4JStorage::RegisterMarketplaceCountsCallback(int (*Func)(LPVOID lpParam, C
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
void C4JStorage::SetDLCPackageRoot(wchar_t *pszDLCRoot)
|
void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot)
|
||||||
{
|
{
|
||||||
InternalStorageManager.m_DLC.SetPackageRoot(pszDLCRoot);
|
InternalStorageManager.m_DLC.SetPackageRoot(pszDLCRoot);
|
||||||
}
|
}
|
||||||
@@ -268,22 +268,22 @@ XCONTENT_DATA &C4JStorage::GetDLC(DWORD dw)
|
|||||||
return InternalStorageManager.m_DLC.GetDLC(dw);
|
return InternalStorageManager.m_DLC.GetDLC(dw);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD C4JStorage::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCWSTR szMountDrive)
|
DWORD C4JStorage::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||||
{
|
{
|
||||||
return InternalStorageManager.m_DLC.MountInstalledDLC(iPad, dwDLC, Func, lpParam, szMountDrive);
|
return InternalStorageManager.m_DLC.MountInstalledDLC(iPad, dwDLC, Func, lpParam, szMountDrive);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD C4JStorage::UnmountInstalledDLC(LPCWSTR szMountDrive)
|
DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive)
|
||||||
{
|
{
|
||||||
return InternalStorageManager.m_DLC.UnmountInstalledDLC(szMountDrive);
|
return InternalStorageManager.m_DLC.UnmountInstalledDLC(szMountDrive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void C4JStorage::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::wstring> &fileList)
|
void C4JStorage::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList)
|
||||||
{
|
{
|
||||||
InternalStorageManager.m_DLC.GetMountedDLCFileList(szMountDrive, fileList);
|
InternalStorageManager.m_DLC.GetMountedDLCFileList(szMountDrive, fileList);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring C4JStorage::GetMountedPath(std::wstring szMount)
|
std::string C4JStorage::GetMountedPath(std::string szMount)
|
||||||
{
|
{
|
||||||
return InternalStorageManager.m_DLC.GetMountedPath(szMount);
|
return InternalStorageManager.m_DLC.GetMountedPath(szMount);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int (*Func)(LPVOID, int,
|
|||||||
m_iHasNewInstalledDLCs = true;
|
m_iHasNewInstalledDLCs = true;
|
||||||
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
DWORD atts = GetFileAttributesW(L"Windows64Media/DLC");
|
DWORD atts = GetFileAttributesA("Windows64Media/DLC");
|
||||||
if (atts == -1)
|
if (atts == -1)
|
||||||
{
|
{
|
||||||
atts = GetFileAttributesW(L"Windows64/DLC");
|
atts = GetFileAttributesA("Windows64/DLC");
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,38 +77,38 @@ C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int (*Func)(LPVOID, int,
|
|||||||
return C4JStorage::EDLC_Error;
|
return C4JStorage::EDLC_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
_WIN32_FIND_DATAW hFind;
|
_WIN32_FIND_DATAA hFind;
|
||||||
HANDLE hFindFile;
|
HANDLE hFindFile;
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
hFindFile = FindFirstFileW(L"Windows64/DLC/*", &hFind);
|
hFindFile = FindFirstFileA("Windows64/DLC/*", &hFind);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hFindFile = FindFirstFileW(L"Windows64Media/DLC/*", &hFind);
|
hFindFile = FindFirstFileA("Windows64Media/DLC/*", &hFind);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hFindFile != INVALID_HANDLE_VALUE)
|
if (hFindFile != (HANDLE)-1LL)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
atts = hFind.dwFileAttributes;
|
atts = hFind.dwFileAttributes;
|
||||||
|
|
||||||
bool isArt = hFind.dwFileAttributes != -1 && (hFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
bool isArt = hFind.dwFileAttributes != -1 && (hFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||||
if (isArt && hFind.cFileName[0] != L'.')
|
if (isArt && hFind.cFileName[0] != '.')
|
||||||
{
|
{
|
||||||
XCONTENT_DATA data;
|
XCONTENT_DATA data;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
swprintf_s(data.szFileName, _countof(data.szFileName), L"Windows64/DLC/%s", hFind.cFileName);
|
sprintf(data.szFileName, "Windows64/DLC/%s", hFind.cFileName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf_s(data.szFileName, _countof(data.szFileName), L"Windows64Media/DLC/%s", hFind.cFileName);
|
sprintf(data.szFileName, "Windows64Media/DLC/%s", hFind.cFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
swprintf_s(data.szDisplayName, 256, L"%s", hFind.cFileName);
|
swprintf(data.szDisplayName, 256, L"%S", hFind.cFileName);
|
||||||
int displayNameLen = wcslen(data.szDisplayName);
|
int displayNameLen = wcslen(data.szDisplayName);
|
||||||
|
|
||||||
data.DeviceID = 0;
|
data.DeviceID = 0;
|
||||||
@@ -116,14 +116,14 @@ C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int (*Func)(LPVOID, int,
|
|||||||
|
|
||||||
AddInstalled(&data);
|
AddInstalled(&data);
|
||||||
}
|
}
|
||||||
} while (FindNextFileW(hFindFile, &hFind));
|
} while (FindNextFileA(hFindFile, &hFind));
|
||||||
FindClose(hFindFile);
|
FindClose(hFindFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return C4JStorage::EDLC_Idle;
|
return C4JStorage::EDLC_Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCWSTR szMountDrive)
|
DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||||
{
|
{
|
||||||
this->m_pMountedDLCFunc = Func;
|
this->m_pMountedDLCFunc = Func;
|
||||||
this->m_pMountedDLCParam = lpParam;
|
this->m_pMountedDLCParam = lpParam;
|
||||||
@@ -139,7 +139,7 @@ DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DW
|
|||||||
|
|
||||||
this->m_uiCurrentMappedDLC = dwDLC;
|
this->m_uiCurrentMappedDLC = dwDLC;
|
||||||
|
|
||||||
wchar_t *dlcdirPath = m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName;
|
char *dlcdirPath = m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName;
|
||||||
m_vDLCDriveMappings.push_back(DriveMapping(dlcdirPath, m_szMountPath));
|
m_vDLCDriveMappings.push_back(DriveMapping(dlcdirPath, m_szMountPath));
|
||||||
|
|
||||||
m_iHasNewMountedDLCs = true;
|
m_iHasNewMountedDLCs = true;
|
||||||
@@ -147,9 +147,9 @@ DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DW
|
|||||||
return 997;
|
return 997;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CDLC::UnmountInstalledDLC(LPCWSTR szMountDrive)
|
DWORD CDLC::UnmountInstalledDLC(LPCSTR szMountDrive)
|
||||||
{
|
{
|
||||||
LPCWSTR szDrive = nullptr;
|
LPCSTR szDrive = nullptr;
|
||||||
|
|
||||||
if (szMountDrive)
|
if (szMountDrive)
|
||||||
{
|
{
|
||||||
@@ -172,48 +172,49 @@ DWORD CDLC::UnmountInstalledDLC(LPCWSTR szMountDrive)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLC::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::wstring> &fileList)
|
void CDLC::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList)
|
||||||
{
|
{
|
||||||
wchar_t dlcdirPath[256];
|
char *dlcdirPath = new char[256];
|
||||||
swprintf_s(dlcdirPath, 256, L"%s/*", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName);
|
sprintf(dlcdirPath, "%s/*", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName);
|
||||||
|
|
||||||
_WIN32_FIND_DATAW atts;
|
_WIN32_FIND_DATAA atts;
|
||||||
HANDLE hFind = FindFirstFileW(dlcdirPath, &atts);
|
HANDLE hFind = FindFirstFileA(dlcdirPath, &atts);
|
||||||
if (hFind != INVALID_HANDLE_VALUE)
|
if (hFind != (HANDLE)-1LL)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (atts.dwFileAttributes == -1 || (atts.dwFileAttributes & 0x10) != 0x10)
|
if (atts.dwFileAttributes == -1 || (atts.dwFileAttributes & 0x10) != 0x10)
|
||||||
{
|
{
|
||||||
wchar_t dir[256];
|
char dir[256];
|
||||||
swprintf_s(dir, _countof(dir), L"%s/%s", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName, atts.cFileName);
|
sprintf(dir, "%s/%s", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName, atts.cFileName);
|
||||||
|
|
||||||
fileList.push_back(dir);
|
fileList.push_back(dir);
|
||||||
}
|
}
|
||||||
} while (FindNextFileW(hFind, &atts));
|
} while (FindNextFileA(hFind, &atts));
|
||||||
FindClose(hFind);
|
FindClose(hFind);
|
||||||
}
|
}
|
||||||
|
delete[] dlcdirPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring CDLC::GetMountedPath(std::wstring szMount)
|
std::string CDLC::GetMountedPath(std::string szMount)
|
||||||
{
|
{
|
||||||
for (int ch = 0; ch < szMount.size(); ++ch)
|
for (int ch = 0; ch < szMount.size(); ++ch)
|
||||||
{
|
{
|
||||||
if (szMount[ch] == '/' || szMount[ch] == '\\')
|
if (szMount[ch] == '/' || szMount[ch] == '\\')
|
||||||
{
|
{
|
||||||
return L"";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (szMount[ch] == ':')
|
if (szMount[ch] == ':')
|
||||||
{
|
{
|
||||||
std::wstring driveName = szMount.substr(0, ch);
|
std::string driveName = szMount.substr(0, ch);
|
||||||
for (int i = 0; i < m_vDLCDriveMappings.size(); i++)
|
for (int i = 0; i < m_vDLCDriveMappings.size(); i++)
|
||||||
{
|
{
|
||||||
if (m_vDLCDriveMappings[i].m_szMountPath == driveName)
|
if (m_vDLCDriveMappings[i].m_szMountPath == driveName)
|
||||||
{
|
{
|
||||||
std::wstring newPath = m_vDLCDriveMappings[i].m_szDirectoryPath;
|
std::string newPath = m_vDLCDriveMappings[i].m_szDirectoryPath;
|
||||||
|
|
||||||
newPath.append(szMount.substr(ch + 1));
|
newPath.append(szMount.substr(ch + 1, -1));
|
||||||
|
|
||||||
return newPath;
|
return newPath;
|
||||||
}
|
}
|
||||||
@@ -222,7 +223,7 @@ std::wstring CDLC::GetMountedPath(std::wstring szMount)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return L"";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLC::SetDLCProductCode(const char *szProductCode)
|
void CDLC::SetDLCProductCode(const char *szProductCode)
|
||||||
@@ -240,9 +241,9 @@ int CDLC::GetAvailableDLCCount(int iPad)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLC::SetPackageRoot(wchar_t *pszDLCRoot)
|
void CDLC::SetPackageRoot(char *pszDLCRoot)
|
||||||
{
|
{
|
||||||
wcscpy(this->m_szPackageRoot, pszDLCRoot);
|
strcpy(this->m_szPackageRoot, pszDLCRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLC::Tick(void)
|
void CDLC::Tick(void)
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ class CDLC
|
|||||||
public:
|
public:
|
||||||
struct DriveMapping
|
struct DriveMapping
|
||||||
{
|
{
|
||||||
DriveMapping(std::wstring szDirectoryPath, std::wstring szMountPath) : m_szDirectoryPath(szDirectoryPath), m_szMountPath(szMountPath)
|
DriveMapping(std::string szDirectoryPath, std::string szMountPath) : m_szDirectoryPath(szDirectoryPath), m_szMountPath(szMountPath)
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring m_szMountPath;
|
std::string m_szMountPath;
|
||||||
std::wstring m_szDirectoryPath;
|
std::string m_szDirectoryPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
XCONTENT_DATA &GetDLC(DWORD dw);
|
XCONTENT_DATA &GetDLC(DWORD dw);
|
||||||
@@ -46,15 +46,15 @@ public:
|
|||||||
DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||||
void ClearOffers();
|
void ClearOffers();
|
||||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam);
|
C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam);
|
||||||
DWORD MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCWSTR szMountDrive = NULL);
|
DWORD MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive = NULL);
|
||||||
DWORD UnmountInstalledDLC(LPCWSTR szMountDrive = NULL);
|
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
|
||||||
void GetMountedDLCFileList(const char *szMountDrive, std::vector<std::wstring> &fileList);
|
void GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList);
|
||||||
std::wstring GetMountedPath(std::wstring szMount);
|
std::string GetMountedPath(std::string szMount);
|
||||||
|
|
||||||
void SetDLCProductCode(const char *szProductCode);
|
void SetDLCProductCode(const char *szProductCode);
|
||||||
void SetProductUpgradeKey(const char *szProductCode);
|
void SetProductUpgradeKey(const char *szProductCode);
|
||||||
int GetAvailableDLCCount(int iPad);
|
int GetAvailableDLCCount(int iPad);
|
||||||
void SetPackageRoot(wchar_t *pszDLCRoot);
|
void SetPackageRoot(char *pszDLCRoot);
|
||||||
|
|
||||||
void Tick(void);
|
void Tick(void);
|
||||||
void AddInstalled(XCONTENT_DATA *data);
|
void AddInstalled(XCONTENT_DATA *data);
|
||||||
@@ -70,10 +70,10 @@ public:
|
|||||||
DWORD m_iHasNewMountedDLCs;
|
DWORD m_iHasNewMountedDLCs;
|
||||||
int (*m_pMountedDLCFunc)(LPVOID, int, DWORD, DWORD);
|
int (*m_pMountedDLCFunc)(LPVOID, int, DWORD, DWORD);
|
||||||
LPVOID m_pMountedDLCParam;
|
LPVOID m_pMountedDLCParam;
|
||||||
std::wstring m_szMountPath;
|
std::string m_szMountPath;
|
||||||
DWORD m_uiCurrentMappedDLC;
|
DWORD m_uiCurrentMappedDLC;
|
||||||
DWORD m_dwLicenseMask;
|
DWORD m_dwLicenseMask;
|
||||||
wchar_t m_szPackageRoot[40];
|
char m_szPackageRoot[40];
|
||||||
DWORD dwordC0;
|
DWORD dwordC0;
|
||||||
std::vector<DriveMapping> m_vDLCDriveMappings;
|
std::vector<DriveMapping> m_vDLCDriveMappings;
|
||||||
char m_szDLCProductCode[16];
|
char m_szDLCProductCode[16];
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef PCH_H
|
#ifndef PCH_H
|
||||||
#define PCH_H
|
#define PCH_H
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
@@ -9,11 +8,6 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <Xinput.h>
|
#include <Xinput.h>
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _XBOX
|
|
||||||
#include "extraX64.h"
|
#include "extraX64.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //PCH_H
|
#endif //PCH_H
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -126,15 +126,14 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<Optimization>Full</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>_WINDOWS64;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDOWS64;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../Headers;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|||||||
@@ -82,18 +82,6 @@ enum EMSgBoxType
|
|||||||
EMSgBoxType_OK,
|
EMSgBoxType_OK,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EControllerType
|
|
||||||
{
|
|
||||||
EControllerType_Default,
|
|
||||||
EControllerType_Xbox360,
|
|
||||||
EControllerType_XboxOne,
|
|
||||||
EControllerType_PS3,
|
|
||||||
EControllerType_PS4,
|
|
||||||
EControllerType_PS5,
|
|
||||||
EControllerType_Switch,
|
|
||||||
EControllerType_Gamecube
|
|
||||||
};
|
|
||||||
|
|
||||||
class C_4JInput
|
class C_4JInput
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -113,6 +101,7 @@ public:
|
|||||||
|
|
||||||
void Initialise( int iInputStateC, unsigned char ucMapC,unsigned char ucActionC, unsigned char ucMenuActionC );
|
void Initialise( int iInputStateC, unsigned char ucMapC,unsigned char ucActionC, unsigned char ucMenuActionC );
|
||||||
void Tick(void);
|
void Tick(void);
|
||||||
|
void TickKBM(void);
|
||||||
void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax );
|
void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax );
|
||||||
void SetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction,unsigned int uiActionVal);
|
void SetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction,unsigned int uiActionVal);
|
||||||
unsigned int GetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction);
|
unsigned int GetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction);
|
||||||
@@ -120,6 +109,7 @@ public:
|
|||||||
unsigned char GetJoypadMapVal(int iPad);
|
unsigned char GetJoypadMapVal(int iPad);
|
||||||
void SetJoypadSensitivity(int iPad, float fSensitivity);
|
void SetJoypadSensitivity(int iPad, float fSensitivity);
|
||||||
unsigned int GetValue(int iPad,unsigned char ucAction, bool bRepeat=false);
|
unsigned int GetValue(int iPad,unsigned char ucAction, bool bRepeat=false);
|
||||||
|
void MapTouchInput(int iPad, int button);
|
||||||
bool ButtonPressed(int iPad,unsigned char ucAction=255); // toggled
|
bool ButtonPressed(int iPad,unsigned char ucAction=255); // toggled
|
||||||
bool ButtonReleased(int iPad,unsigned char ucAction); //toggled
|
bool ButtonReleased(int iPad,unsigned char ucAction); //toggled
|
||||||
bool ButtonDown(int iPad,unsigned char ucAction=255); // button held down
|
bool ButtonDown(int iPad,unsigned char ucAction=255); // button held down
|
||||||
@@ -130,9 +120,8 @@ public:
|
|||||||
void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam );
|
void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam );
|
||||||
FLOAT GetIdleSeconds(int iPad);
|
FLOAT GetIdleSeconds(int iPad);
|
||||||
bool IsPadConnected(int iPad);
|
bool IsPadConnected(int iPad);
|
||||||
void SetSelectBackSwapped(bool swapped);
|
bool IsPadActive(int iPad);
|
||||||
bool IsSelectBackSwapped();
|
bool IsCircleCrossSwapped();
|
||||||
|
|
||||||
// In-Game values which may have been remapped due to Southpaw, swap triggers, etc
|
// In-Game values which may have been remapped due to Southpaw, swap triggers, etc
|
||||||
float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true);
|
float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true);
|
||||||
float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true);
|
float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true);
|
||||||
@@ -143,12 +132,57 @@ public:
|
|||||||
|
|
||||||
void SetMenuDisplayed(int iPad, bool bVal);
|
void SetMenuDisplayed(int iPad, bool bVal);
|
||||||
|
|
||||||
|
void OnKeyDown(int vkCode);
|
||||||
|
void OnKeyUp(int vkCode);
|
||||||
|
void OnChar(wchar_t ch);
|
||||||
|
|
||||||
|
void OnMouseMove(int x, int y);
|
||||||
|
void OnRawMouseDelta(int dx, int dy);
|
||||||
|
void OnLButtonDown(int x, int y);
|
||||||
|
void OnLButtonUp(int x, int y);
|
||||||
|
void OnRButtonDown(int x, int y);
|
||||||
|
void OnRButtonUp(int x, int y);
|
||||||
|
void OnMButtonDown(int x, int y);
|
||||||
|
void OnMButtonUp(int x, int y);
|
||||||
|
void OnMouseWheel(int delta, int x, int y);
|
||||||
|
|
||||||
|
bool IsKeyDown(int vkCode) const;
|
||||||
|
bool IsKeyPressed(int vkCode) const;
|
||||||
|
bool IsKeyReleased(int vkCode) const;
|
||||||
|
|
||||||
|
int GetMouseX() const;
|
||||||
|
int GetMouseY() const;
|
||||||
|
|
||||||
|
// PIEBOT: Used to be IsLButtonDown, changed so it doesnt conflict with windowx.h
|
||||||
|
bool IsMouseLDown() const;
|
||||||
|
bool IsLButtonPressed() const;
|
||||||
|
bool IsLButtonReleased() const;
|
||||||
|
|
||||||
|
bool IsMouseRDown() const;
|
||||||
|
bool IsRButtonPressed() const;
|
||||||
|
bool IsRButtonReleased() const;
|
||||||
|
|
||||||
|
int GetMouseWheelDelta() const;
|
||||||
|
|
||||||
|
wchar_t GetLastChar() const;
|
||||||
|
bool HasChar() const;
|
||||||
|
int GetCharCount() const;
|
||||||
|
wchar_t GetChar(int index) const;
|
||||||
|
|
||||||
|
void SetMouseCaptured(bool captured);
|
||||||
|
void SetWindowFocused(bool focused);
|
||||||
|
bool IsMouseCaptured() const;
|
||||||
|
|
||||||
|
void SetMousePos(int x, int y);
|
||||||
|
|
||||||
|
int GetRawMouseX() const;
|
||||||
|
int GetRawMouseY() const;
|
||||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
||||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
||||||
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
|
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
|
||||||
void DestroyKeyboard();
|
void DestroyKeyboard();
|
||||||
void GetText(uint16_t *UTF16String);
|
void GetText(uint16_t *UTF16String);
|
||||||
EControllerType GetControllerType(int ipad);
|
const char* PollControllerType(int ipad);
|
||||||
|
|
||||||
void SetLostInputControlCallback(void( *Func)(LPVOID, bool),LPVOID lpParam);
|
void SetLostInputControlCallback(void( *Func)(LPVOID, bool),LPVOID lpParam);
|
||||||
|
|
||||||
@@ -180,3 +214,4 @@ public:
|
|||||||
|
|
||||||
// Singleton
|
// Singleton
|
||||||
extern C_4JInput InputManager;
|
extern C_4JInput InputManager;
|
||||||
|
extern HWND g_hWnd;
|
||||||
@@ -75,7 +75,6 @@ public:
|
|||||||
// SYS
|
// SYS
|
||||||
int GetPrimaryPad();
|
int GetPrimaryPad();
|
||||||
void SetPrimaryPad(int iPad);
|
void SetPrimaryPad(int iPad);
|
||||||
void SetFakeGamerTag(char *name);
|
|
||||||
char* GetGamertag(int iPad);
|
char* GetGamertag(int iPad);
|
||||||
wstring GetDisplayName(int iPad);
|
wstring GetDisplayName(int iPad);
|
||||||
bool IsFullVersion();
|
bool IsFullVersion();
|
||||||
@@ -98,10 +97,6 @@ public:
|
|||||||
void ResetProfileProcessState(); // after a sign out from the primary player, call this
|
void ResetProfileProcessState(); // after a sign out from the primary player, call this
|
||||||
void Tick( void );
|
void Tick( void );
|
||||||
|
|
||||||
// SETTINGS
|
|
||||||
void LoadSettings(void* gs, size_t gsSize);
|
|
||||||
void SaveSettings(void* gs, size_t gsSize);
|
|
||||||
|
|
||||||
// ACHIEVEMENTS & AWARDS
|
// ACHIEVEMENTS & AWARDS
|
||||||
|
|
||||||
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
|
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
|
||||||
|
|||||||
@@ -57,11 +57,6 @@ public:
|
|||||||
void Tick();
|
void Tick();
|
||||||
void UpdateGamma(unsigned short usGamma);
|
void UpdateGamma(unsigned short usGamma);
|
||||||
|
|
||||||
// VSync
|
|
||||||
static bool m_VSyncState;
|
|
||||||
static void SetVSync(bool vs);
|
|
||||||
static int GetVSync();
|
|
||||||
|
|
||||||
// Matrix stack
|
// Matrix stack
|
||||||
void MatrixMode(int type);
|
void MatrixMode(int type);
|
||||||
void MatrixSetIdentity();
|
void MatrixSetIdentity();
|
||||||
@@ -84,7 +79,6 @@ public:
|
|||||||
void Present();
|
void Present();
|
||||||
void Clear(int flags, D3D11_RECT *pRect = NULL);
|
void Clear(int flags, D3D11_RECT *pRect = NULL);
|
||||||
void SetClearColour(const float colourRGBA[4]);
|
void SetClearColour(const float colourRGBA[4]);
|
||||||
void setResolution(int ScreenWidth, int ScreenHeight);
|
|
||||||
bool IsWidescreen();
|
bool IsWidescreen();
|
||||||
bool IsHiDef();
|
bool IsHiDef();
|
||||||
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ public:
|
|||||||
|
|
||||||
// DLC
|
// DLC
|
||||||
void RegisterMarketplaceCountsCallback(int (*Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS*, int), LPVOID lpParam);
|
void RegisterMarketplaceCountsCallback(int (*Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS*, int), LPVOID lpParam);
|
||||||
void SetDLCPackageRoot(wchar_t* pszDLCRoot);
|
void SetDLCPackageRoot(char* pszDLCRoot);
|
||||||
C4JStorage::EDLCStatus GetDLCOffers(int iPad, int(*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
C4JStorage::EDLCStatus GetDLCOffers(int iPad, int(*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||||
DWORD CancelGetDLCOffers();
|
DWORD CancelGetDLCOffers();
|
||||||
void ClearDLCOffers();
|
void ClearDLCOffers();
|
||||||
@@ -296,10 +296,10 @@ public:
|
|||||||
|
|
||||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int(*Func)(LPVOID, int, int), LPVOID lpParam);
|
C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int(*Func)(LPVOID, int, int), LPVOID lpParam);
|
||||||
XCONTENT_DATA& GetDLC(DWORD dw);
|
XCONTENT_DATA& GetDLC(DWORD dw);
|
||||||
DWORD MountInstalledDLC(int iPad, DWORD dwDLC, int(*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCWSTR szMountDrive = NULL);
|
DWORD MountInstalledDLC(int iPad, DWORD dwDLC, int(*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive = NULL);
|
||||||
DWORD UnmountInstalledDLC(LPCWSTR szMountDrive = NULL);
|
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
|
||||||
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::wstring>& fileList);
|
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
|
||||||
std::wstring GetMountedPath(std::wstring szMount);
|
std::string GetMountedPath(std::string szMount);
|
||||||
|
|
||||||
// Global title storage
|
// Global title storage
|
||||||
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType,
|
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType,
|
||||||
|
|||||||
+1
-1
@@ -354,7 +354,7 @@ typedef struct _XCONTENT_DATA
|
|||||||
XCONTENTDEVICEID DeviceID;
|
XCONTENTDEVICEID DeviceID;
|
||||||
DWORD dwContentType;
|
DWORD dwContentType;
|
||||||
WCHAR szDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
|
WCHAR szDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
|
||||||
WCHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH];
|
CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH];
|
||||||
} XCONTENT_DATA, *PXCONTENT_DATA;
|
} XCONTENT_DATA, *PXCONTENT_DATA;
|
||||||
#endif //__PS3__
|
#endif //__PS3__
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
# 4JLibs-VS2012
|
# 4JLibs-VS2012
|
||||||
|
|
||||||
## WARNING
|
|
||||||
This needs the [Windows 10 SDK](https://learn.microsoft.com/en-us/windows/apps/windows-sdk/downloads#windows-10) to build `4J_Render`.
|
|
||||||
|
|
||||||
## Implementation
|
## Implementation
|
||||||
|
|
||||||
For implementation details, please look at the [IMPLEMENTATION_GUIDE.md](.gitea/IMPLEMENTATION_GUIDE.md) file
|
For implementation details, please look at the [IMPLEMENTATION_GUIDE.md](.gitea/IMPLEMENTATION_GUIDE.md) file
|
||||||
|
|||||||
Reference in new issue
Block a user