Skip to content

Commit

Permalink
Adds kickstart function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Jan 4, 2017
1 parent 9fcb1fa commit d69d2fd
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 161 deletions.
2 changes: 1 addition & 1 deletion UnX/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define UNX_MAJOR 0
#define UNX_MINOR 8
#define UNX_BUILD 5
#define UNX_BUILD 6
#define UNX_REV 0


Expand Down
2 changes: 1 addition & 1 deletion UnX/cheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ UNX_SetSensor (bool state)
config.cheat.ffx.permanent_sensor = state;

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

void
Expand Down
16 changes: 8 additions & 8 deletions UnX/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,22 @@ interface SK_ICommandProcessor
{
}

virtual SK_ICommand* FindCommand (const char* szCommand) const;
virtual SK_ICommand* FindCommand (const char* szCommand) const = 0;

virtual const SK_ICommand* AddCommand ( const char* szCommand,
SK_ICommand* pCommand );
virtual bool RemoveCommand ( const char* szCommand );
SK_ICommand* pCommand ) = 0;
virtual bool RemoveCommand ( const char* szCommand ) = 0;


virtual const SK_IVariable* FindVariable (const char* szVariable) const;
virtual const SK_IVariable* FindVariable (const char* szVariable) const = 0;

virtual const SK_IVariable* AddVariable ( const char* szVariable,
SK_IVariable* pVariable );
virtual bool RemoveVariable ( const char* szVariable );
SK_IVariable* pVariable ) = 0;
virtual bool RemoveVariable ( const char* szVariable ) = 0;


virtual SK_ICommandResult ProcessCommandLine (const char* szCommandLine);
virtual SK_ICommandResult ProcessCommandFormatted (const char* szCommandFormat, ...);
virtual SK_ICommandResult ProcessCommandLine (const char* szCommandLine) = 0;
virtual SK_ICommandResult ProcessCommandFormatted (const char* szCommandFormat, ...) = 0;
};

typedef SK_ICommandProcessor* (__stdcall *SK_GetCommandProcessor_pfn)(void);
Expand Down
28 changes: 22 additions & 6 deletions UnX/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ struct {

unx::ParameterBool* fast_exit;
unx::ParameterBool* trap_alt_tab;

unx::ParameterBool* filter_ime;
} input;

struct {
Expand Down Expand Up @@ -466,6 +468,16 @@ UNX_LoadConfig (std::wstring name)
L"UnX.Input",
L"TrapAltTab" );

input.filter_ime =
static_cast <unx::ParameterBool *>
(g_ParameterFactory.create_parameter <bool> (
L"Disable IME Messages, which appear to be the cause of some crashes.")
);
input.filter_ime->register_to_ini (
dll_ini,
L"UnX.Input",
L"FilterIME" );


textures.resource_root =
static_cast <unx::ParameterStringW *>
Expand Down Expand Up @@ -672,6 +684,7 @@ UNX_LoadConfig (std::wstring name)

input.fast_exit->load (config.input.fast_exit);
input.trap_alt_tab->load (config.input.trap_alt_tab);
input.filter_ime->load (config.input.filter_ime);


#if 1
Expand Down Expand Up @@ -700,18 +713,20 @@ UNX_LoadConfig (std::wstring name)
}

sys.version->load (config.system.version);
sys.injector->load (config.system.injector);
//sys.injector->load (config.system.injector);

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

if (config.display.enable_fullscreen && UNX_SetupWindowMgmt ()) {
SKX_D3D11_EnableFullscreen (config.display.enable_fullscreen);
}

if (UNX_SetupLowLevelRender ()) {
render.bypass_intel->load (config.render.bypass_intel);
render.flip_mode->load (config.render.flip_mode);
render.bypass_intel->load (config.render.bypass_intel);
render.flip_mode->load (config.render.flip_mode);

if ( (config.render.bypass_intel || config.render.flip_mode) &&
UNX_SetupLowLevelRender () )
{
SK_DXGI_EnableFlipMode ( config.render.flip_mode &&
(! config.display.enable_fullscreen ) );

Expand Down Expand Up @@ -758,6 +773,7 @@ UNX_SaveConfig (std::wstring name, bool close_config) {
input.fix_bg_input->store (config.input.fix_bg_input);

input.trap_alt_tab->store (config.input.trap_alt_tab);
input.filter_ime->store (config.input.filter_ime);


((unx::iParameter *)language.sfx)->store ();
Expand Down
1 change: 1 addition & 0 deletions UnX/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ struct unx_config_s
bool trap_alt_tab = false;

bool fast_exit = true;
bool filter_ime = true;
} input;

struct {
Expand Down
16 changes: 7 additions & 9 deletions UnX/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ HMODULE hInjectorDLL = { 0 }; // Handle to Special K
typedef HRESULT (__stdcall *SK_UpdateSoftware_pfn)(const wchar_t* wszProduct);
typedef bool (__stdcall *SK_FetchVersionInfo_pfn)(const wchar_t* wszProduct);

typedef void (__stdcall *SK_SetPluginName_pfn)(std::wstring name);
SK_SetPluginName_pfn SK_SetPluginName = nullptr;
typedef void (__stdcall *SKX_SetPluginName_pfn)(const wchar_t* name);
SKX_SetPluginName_pfn SKX_SetPluginName = nullptr;

std::wstring injector_name;

Expand Down Expand Up @@ -80,9 +80,9 @@ DllThread (LPVOID user)

config.system.injector = injector_name;

SK_SetPluginName =
(SK_SetPluginName_pfn)
GetProcAddress (hInjectorDLL, "SK_SetPluginName");
SKX_SetPluginName =
(SKX_SetPluginName_pfn)
GetProcAddress (hInjectorDLL, "SKX_SetPluginName");

SK_GetCommandProcessor =
(SK_GetCommandProcessor_pfn)
Expand All @@ -91,8 +91,8 @@ DllThread (LPVOID user)
//
// If this is NULL, the injector system isn't working right!!!
//
if (SK_SetPluginName != nullptr)
SK_SetPluginName (plugin_name);
if (SKX_SetPluginName != nullptr)
SKX_SetPluginName (plugin_name.c_str ());

// Plugin State
if (UNX_Init_MinHook () == MH_OK) {
Expand All @@ -102,9 +102,7 @@ DllThread (LPVOID user)
unx::DisplayFix::Init ();
//unx::RenderFix::Init ();
unx::InputManager::Init ();

unx::TimingFix::Init ();

unx::WindowManager::Init ();

CreateThread (
Expand Down
Loading

0 comments on commit d69d2fd

Please sign in to comment.