add ShaderPatch config UI, clean up some plugin dependencies
This commit is contained in:
@@ -43,13 +43,9 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);detours/include;miniaudio;bassasio</IncludePath>
|
|
||||||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;detours/lib;bassasio</LibraryPath>
|
|
||||||
<TargetExt>.dva</TargetExt>
|
<TargetExt>.dva</TargetExt>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);detours/include;miniaudio;bassasio</IncludePath>
|
|
||||||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;detours/lib;bassasio</LibraryPath>
|
|
||||||
<TargetExt>.dva</TargetExt>
|
<TargetExt>.dva</TargetExt>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
@@ -57,9 +53,11 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\detours\include;miniaudio;bassasio</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>detours.lib;syelog.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>detours.lib;syelog.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\dependencies\detours\lib;bassasio</AdditionalLibraryDirectories>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
@@ -70,11 +68,13 @@
|
|||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\detours\include;miniaudio;bassasio</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>detours.lib;syelog.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>detours.lib;syelog.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\dependencies\detours\lib;bassasio</AdditionalLibraryDirectories>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -82,7 +82,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="src\framework.h" />
|
<ClInclude Include="src\framework.h" />
|
||||||
<ClInclude Include="src\PluginConfigApi.h" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|||||||
@@ -23,8 +23,5 @@
|
|||||||
<ClInclude Include="src\framework.h">
|
<ClInclude Include="src\framework.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="src\PluginConfigApi.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Common version parameters.
|
|
||||||
//
|
|
||||||
// Microsoft Research Detours Package, Version 4.0.1
|
|
||||||
//
|
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#define _USING_V110_SDK71_ 1
|
|
||||||
#include "winver.h"
|
|
||||||
#if 0
|
|
||||||
#include <windows.h>
|
|
||||||
#include <detours.h>
|
|
||||||
#else
|
|
||||||
#ifndef DETOURS_STRINGIFY
|
|
||||||
#define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x)
|
|
||||||
#define DETOURS_STRINGIFY_(x) #x
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define VER_FILEFLAGSMASK 0x3fL
|
|
||||||
#define VER_FILEFLAGS 0x0L
|
|
||||||
#define VER_FILEOS 0x00040004L
|
|
||||||
#define VER_FILETYPE 0x00000002L
|
|
||||||
#define VER_FILESUBTYPE 0x00000000L
|
|
||||||
#endif
|
|
||||||
#define VER_DETOURS_BITS DETOUR_STRINGIFY(DETOURS_BITS)
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Detours Test Program (syelog.h of syelog.lib)
|
|
||||||
//
|
|
||||||
// Microsoft Research Detours Package
|
|
||||||
//
|
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
//
|
|
||||||
#pragma once
|
|
||||||
#ifndef _SYELOGD_H_
|
|
||||||
#define _SYELOGD_H_
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable: 4200)
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//
|
|
||||||
#define SYELOG_PIPE_NAMEA "\\\\.\\pipe\\syelog"
|
|
||||||
#define SYELOG_PIPE_NAMEW L"\\\\.\\pipe\\syelog"
|
|
||||||
#ifdef UNICODE
|
|
||||||
#define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEW
|
|
||||||
#else
|
|
||||||
#define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEA
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
#define SYELOG_MAXIMUM_MESSAGE 4086 // 4096 - sizeof(header stuff)
|
|
||||||
|
|
||||||
typedef struct _SYELOG_MESSAGE
|
|
||||||
{
|
|
||||||
USHORT nBytes;
|
|
||||||
BYTE nFacility;
|
|
||||||
BYTE nSeverity;
|
|
||||||
DWORD nProcessId;
|
|
||||||
FILETIME ftOccurance;
|
|
||||||
BOOL fTerminate;
|
|
||||||
CHAR szMessage[SYELOG_MAXIMUM_MESSAGE];
|
|
||||||
} SYELOG_MESSAGE, *PSYELOG_MESSAGE;
|
|
||||||
|
|
||||||
|
|
||||||
// Facility Codes.
|
|
||||||
//
|
|
||||||
#define SYELOG_FACILITY_KERNEL 0x10 // OS Kernel
|
|
||||||
#define SYELOG_FACILITY_SECURITY 0x20 // OS Security
|
|
||||||
#define SYELOG_FACILITY_LOGGING 0x30 // OS Logging-internal
|
|
||||||
#define SYELOG_FACILITY_SERVICE 0x40 // User-mode system daemon
|
|
||||||
#define SYELOG_FACILITY_APPLICATION 0x50 // User-mode application
|
|
||||||
#define SYELOG_FACILITY_USER 0x60 // User self-generated.
|
|
||||||
#define SYELOG_FACILITY_LOCAL0 0x70 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL1 0x71 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL2 0x72 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL3 0x73 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL4 0x74 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL5 0x75 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL6 0x76 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL7 0x77 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL8 0x78 // Locally defined.
|
|
||||||
#define SYELOG_FACILITY_LOCAL9 0x79 // Locally defined.
|
|
||||||
|
|
||||||
// Severity Codes.
|
|
||||||
//
|
|
||||||
#define SYELOG_SEVERITY_FATAL 0x00 // System is dead.
|
|
||||||
#define SYELOG_SEVERITY_ALERT 0x10 // Take action immediately.
|
|
||||||
#define SYELOG_SEVERITY_CRITICAL 0x20 // Critical condition.
|
|
||||||
#define SYELOG_SEVERITY_ERROR 0x30 // Error
|
|
||||||
#define SYELOG_SEVERITY_WARNING 0x40 // Warning
|
|
||||||
#define SYELOG_SEVERITY_NOTICE 0x50 // Significant condition.
|
|
||||||
#define SYELOG_SEVERITY_INFORMATION 0x60 // Informational
|
|
||||||
#define SYELOG_SEVERITY_AUDIT_FAIL 0x66 // Audit Failed
|
|
||||||
#define SYELOG_SEVERITY_AUDIT_PASS 0x67 // Audit Succeeeded
|
|
||||||
#define SYELOG_SEVERITY_DEBUG 0x70 // Debugging
|
|
||||||
|
|
||||||
// Logging Functions.
|
|
||||||
//
|
|
||||||
VOID SyelogOpen(PCSTR pszIdentifier, BYTE nFacility);
|
|
||||||
VOID Syelog(BYTE nSeverity, PCSTR pszMsgf, ...);
|
|
||||||
VOID SyelogV(BYTE nSeverity, PCSTR pszMsgf, va_list args);
|
|
||||||
VOID SyelogClose(BOOL fTerminate);
|
|
||||||
|
|
||||||
#pragma warning(pop)
|
|
||||||
#pragma pack(pop)
|
|
||||||
|
|
||||||
#endif // _SYELOGD_H_
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////// End of File.
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -111,7 +111,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
</PrecompiledHeaderFile>
|
</PrecompiledHeaderFile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -168,7 +168,6 @@
|
|||||||
<ClInclude Include="ConfigOption.h" />
|
<ClInclude Include="ConfigOption.h" />
|
||||||
<ClInclude Include="framework.h" />
|
<ClInclude Include="framework.h" />
|
||||||
<ClInclude Include="PluginConfig.h" />
|
<ClInclude Include="PluginConfig.h" />
|
||||||
<ClInclude Include="PluginConfigApi.h" />
|
|
||||||
<ClInclude Include="SkinnedMessageBox.h" />
|
<ClInclude Include="SkinnedMessageBox.h" />
|
||||||
<ClInclude Include="TabPadding.h" />
|
<ClInclude Include="TabPadding.h" />
|
||||||
<ClInclude Include="ui.h">
|
<ClInclude Include="ui.h">
|
||||||
|
|||||||
@@ -1,168 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
||||||
#include <windows.h>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
// resolution class to store and sort the width and height easily
|
|
||||||
class resolution
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
unsigned int width;
|
|
||||||
unsigned int height;
|
|
||||||
|
|
||||||
resolution()
|
|
||||||
{
|
|
||||||
width = 0;
|
|
||||||
height = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
resolution(unsigned int width, unsigned int height)
|
|
||||||
{
|
|
||||||
resolution::width = width;
|
|
||||||
resolution::height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator ==(const resolution &res2)
|
|
||||||
{
|
|
||||||
return width == res2.width && height == res2.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
// in comparisons width takes priority because it's usually displayed first
|
|
||||||
bool operator <(const resolution &res2)
|
|
||||||
{
|
|
||||||
if (width == res2.width)
|
|
||||||
return height < res2.height;
|
|
||||||
else
|
|
||||||
return width < res2.width;
|
|
||||||
}
|
|
||||||
bool operator >(const resolution &res2)
|
|
||||||
{
|
|
||||||
if (width == res2.width)
|
|
||||||
return height > res2.height;
|
|
||||||
else
|
|
||||||
return width > res2.width;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace PluginConfig
|
|
||||||
{
|
|
||||||
#pragma pack(push, 1)
|
|
||||||
enum ConfigType {
|
|
||||||
CONFIG_BOOLEAN,
|
|
||||||
CONFIG_NUMERIC,
|
|
||||||
CONFIG_STRING,
|
|
||||||
CONFIG_DROPDOWN_INDEX,
|
|
||||||
CONFIG_DROPDOWN_TEXT,
|
|
||||||
CONFIG_DROPDOWN_NUMBER,
|
|
||||||
CONFIG_RESOLUTION,
|
|
||||||
CONFIG_GROUP_START,
|
|
||||||
CONFIG_GROUP_END,
|
|
||||||
CONFIG_BUTTON,
|
|
||||||
CONFIG_SPACER
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigBooleanData {
|
|
||||||
LPCWSTR iniVarName;
|
|
||||||
LPCWSTR iniSectionName;
|
|
||||||
LPCWSTR iniFilePath;
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
bool defaultVal;
|
|
||||||
bool saveAsString;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigNumericData {
|
|
||||||
LPCWSTR iniVarName;
|
|
||||||
LPCWSTR iniSectionName;
|
|
||||||
LPCWSTR iniFilePath;
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
int defaultVal;
|
|
||||||
int minVal;
|
|
||||||
int maxVal;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigStringData {
|
|
||||||
LPCWSTR iniVarName;
|
|
||||||
LPCWSTR iniSectionName;
|
|
||||||
LPCWSTR iniFilePath;
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
LPCWSTR defaultVal;
|
|
||||||
bool useUtf8;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigDropdownIndexData {
|
|
||||||
LPCWSTR iniVarName;
|
|
||||||
LPCWSTR iniSectionName;
|
|
||||||
LPCWSTR iniFilePath;
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
int defaultVal;
|
|
||||||
std::vector<LPCWSTR> valueStrings;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigDropdownTextData {
|
|
||||||
LPCWSTR iniVarName;
|
|
||||||
LPCWSTR iniSectionName;
|
|
||||||
LPCWSTR iniFilePath;
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
LPCWSTR defaultVal;
|
|
||||||
std::vector<LPCWSTR> valueStrings;
|
|
||||||
bool editable;
|
|
||||||
bool useUtf8;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigDropdownNumberData {
|
|
||||||
LPCWSTR iniVarName;
|
|
||||||
LPCWSTR iniSectionName;
|
|
||||||
LPCWSTR iniFilePath;
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
int defaultVal;
|
|
||||||
std::vector<int> valueInts;
|
|
||||||
bool editable;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigResolutionData {
|
|
||||||
LPCWSTR iniVarName;
|
|
||||||
LPCWSTR iniVarName2;
|
|
||||||
LPCWSTR iniSectionName;
|
|
||||||
LPCWSTR iniFilePath;
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
resolution defaultVal;
|
|
||||||
std::vector<resolution> valueResolutions;
|
|
||||||
bool editable;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigGroupData
|
|
||||||
{
|
|
||||||
LPCWSTR name;
|
|
||||||
int height;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigButtonData {
|
|
||||||
LPCWSTR friendlyName;
|
|
||||||
LPCWSTR description;
|
|
||||||
void(*func)();
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigSpacerData {
|
|
||||||
int height;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigOption
|
|
||||||
{
|
|
||||||
ConfigType cfgType;
|
|
||||||
void* data;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PluginConfigArray
|
|
||||||
{
|
|
||||||
int len;
|
|
||||||
PluginConfigOption* options;
|
|
||||||
};
|
|
||||||
#pragma pack(pop)
|
|
||||||
}
|
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include;..\..\..\dependencies\PluginConfigApi</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalLibraryDirectories>..\..\..\dependencies\detours\lib</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\..\..\dependencies\detours\lib</AdditionalLibraryDirectories>
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include;..\..\..\dependencies\PluginConfigApi</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
//#include "PluginConfigApi.h"
|
#include "PluginConfigApi.h"
|
||||||
#include "detours.h"
|
#include "detours.h"
|
||||||
#pragma comment(lib, "detours.lib")
|
#pragma comment(lib, "detours.lib")
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ BOOL APIENTRY DllMain(HMODULE hModule,
|
|||||||
DetourTransactionCommit();
|
DetourTransactionCommit();
|
||||||
|
|
||||||
loadGpuName();
|
loadGpuName();
|
||||||
printf("[ShaderPatch] Detected GPU: %s\n", gpuName);
|
printf("[ShaderPatch] Detected GPU: %s\n", gpuName.c_str());
|
||||||
//Sleep(2000);
|
//Sleep(2000);
|
||||||
|
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
@@ -259,14 +259,66 @@ BOOL APIENTRY DllMain(HMODULE hModule,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//using namespace PluginConfig;
|
using namespace PluginConfig;
|
||||||
//
|
|
||||||
//extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void)
|
extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void)
|
||||||
//{
|
{
|
||||||
// return L"ShaderPatch";
|
return L"ShaderPatch";
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
//extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void)
|
extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void)
|
||||||
//{
|
{
|
||||||
// return L"Automatically patches shaders";
|
return L"Automatically patches shaders";
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
std::vector<PluginConfigOption> configVec;
|
||||||
|
extern "C" __declspec(dllexport) PluginConfigArray GetPluginOptions(void)
|
||||||
|
{
|
||||||
|
LoadConfig();
|
||||||
|
|
||||||
|
for (std::map<std::string, std::string>::iterator iter = configMap.begin(); iter != configMap.end(); ++iter)
|
||||||
|
{
|
||||||
|
std::string k = iter->first;
|
||||||
|
std::string v = iter->second;
|
||||||
|
|
||||||
|
if (k.size() < 6 || k.substr(k.size() - 5, 4) != "_val")
|
||||||
|
{
|
||||||
|
WCHAR utf16key[128];
|
||||||
|
WCHAR utf16val[128];
|
||||||
|
|
||||||
|
// count values to approximate the group size
|
||||||
|
int valNum = 0;
|
||||||
|
int valCount = 0;
|
||||||
|
std::string valKey;
|
||||||
|
while (valNum++, valKey = k + "_val" + std::to_string(valNum),
|
||||||
|
configMap.find(valKey) != configMap.end()) // loop until there's no more config values set
|
||||||
|
{
|
||||||
|
valCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, k.c_str(), -1, utf16key, 128);
|
||||||
|
|
||||||
|
configVec.push_back({ CONFIG_GROUP_START, new PluginConfigGroupData{ _wcsdup(utf16key), 45 + valCount * 25 } });
|
||||||
|
configVec.push_back({ CONFIG_BOOLEAN, new PluginConfigBooleanData{ _wcsdup(utf16key), L"config", CONFIG_FILE, L"Enable", L"", false, false } });
|
||||||
|
|
||||||
|
|
||||||
|
valNum = 0;
|
||||||
|
while (valNum++, valKey = k + "_val" + std::to_string(valNum),
|
||||||
|
configMap.find(valKey) != configMap.end()) // loop until there's no more config values set
|
||||||
|
{
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, valKey.c_str(), -1, utf16key, 128);
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, configMap[valKey].c_str(), -1, utf16val, 128);
|
||||||
|
|
||||||
|
std::wstring name = std::wstring(L"Value ") + std::to_wstring(valNum) + L":";
|
||||||
|
configVec.push_back({ CONFIG_STRING, new PluginConfigStringData{ _wcsdup(utf16key), L"config", CONFIG_FILE, _wcsdup(name.c_str()), L"", _wcsdup(utf16val), false } });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
configVec.push_back({ CONFIG_GROUP_END, NULL });
|
||||||
|
configVec.push_back({ CONFIG_SPACER, new PluginConfigSpacerData{ 10 } });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PluginConfigArray{ (int)configVec.size(), &configVec[0] };
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user