Skip to content

Commit

Permalink
Fixes for flip mode and sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Jun 14, 2016
1 parent 94621db commit 6278b80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
16 changes: 14 additions & 2 deletions UnX/cheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <Windows.h>
#include <cstdint>

void UNX_SetSensor (bool state);

enum unx_gametype_t {
GAME_INVALID = 0x0,
GAME_FFX = 0x01,
Expand Down Expand Up @@ -634,6 +636,8 @@ unx::CheatManager::Init (void)
(LPVOID *)&FFX_LoadLevel_Original);
UNX_EnableHook ((LPVOID)((intptr_t)__UNX_base_img_addr + 0x241F60));

UNX_SetSensor (config.cheat.ffx.permanent_sensor);

SetTimer (unx::window.hwnd, CHEAT_TIMER_FFX, 33, nullptr);
}

Expand Down Expand Up @@ -674,6 +678,15 @@ UNX_ToggleFreeLook (void)
(! ffx.debug_flags->control.camera);
}

void
UNX_SetSensor (bool state)
{
config.cheat.ffx.permanent_sensor = state;

ffx.debug_flags->permanent_sensor =
config.cheat.ffx.permanent_sensor;
}

void
UNX_ToggleSensor (void)
{
Expand All @@ -683,8 +696,7 @@ UNX_ToggleSensor (void)
config.cheat.ffx.permanent_sensor =
(! config.cheat.ffx.permanent_sensor);

ffx.debug_flags->permanent_sensor =
config.cheat.ffx.permanent_sensor;
UNX_SetSensor (config.cheat.ffx.permanent_sensor);
}

void
Expand Down
14 changes: 6 additions & 8 deletions UnX/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static
unx::INI::File*
booster_ini = nullptr;

std::wstring UNX_VER_STR = L"0.5.6";
std::wstring UNX_VER_STR = L"0.5.6a";
unx_config_s config;

typedef bool (WINAPI *SK_DXGI_EnableFlipMode_pfn) (bool);
Expand Down Expand Up @@ -725,6 +725,11 @@ UNX_LoadConfig (std::wstring name) {
sys.version->load (config.system.version);
sys.injector->load (config.system.injector);

if (UNX_SetupWindowMgmt ()) {
display.enable_fullscreen->load (config.display.enable_fullscreen);

SKX_D3D11_EnableFullscreen (config.display.enable_fullscreen);
}

if (UNX_SetupLowLevelRender ()) {
render.bypass_intel->load (config.render.bypass_intel);
Expand Down Expand Up @@ -755,13 +760,6 @@ UNX_LoadConfig (std::wstring name) {
SK_D3D11_AddTexHash (L"Title.dds", 0xA4FFC068);
}

if (UNX_SetupWindowMgmt ()) {
display.enable_fullscreen->load (config.display.enable_fullscreen);

SKX_D3D11_EnableFullscreen (config.display.enable_fullscreen);
}


if (empty)
return false;

Expand Down

0 comments on commit 6278b80

Please sign in to comment.