-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now uses a Plugin class system wrapper around patcher_x86. Also updating H3API to 1.5.0
- Loading branch information
1 parent
4ff864a
commit 0af1e43
Showing
198 changed files
with
11,305 additions
and
8,552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>16.0</VCProjectVersion> | ||
<Keyword>Win32Proj</Keyword> | ||
<ProjectGuid>{b68120c1-a317-4518-9c80-6ac239d3b8f8}</ProjectGuid> | ||
<RootNamespace>AssetLoader</RootNamespace> | ||
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v141_xp</PlatformToolset> | ||
<CharacterSet>NotSet</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v141_xp</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>NotSet</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
<OutDir>$(SolutionDir)bin\$(Configuration)\</OutDir> | ||
<IntDir>$(SolutionDir)bin\intermediates\$(ProjectName)\$(Configuration)\</IntDir> | ||
<TargetName>H3.$(ProjectName)</TargetName> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<LinkIncremental>false</LinkIncremental> | ||
<OutDir>$(SolutionDir)bin\$(Configuration)\</OutDir> | ||
<IntDir>$(SolutionDir)bin\intermediates\$(ProjectName)\$(Configuration)\</IntDir> | ||
<TargetName>H3.$(ProjectName)</TargetName> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<VcpkgEnabled>false</VcpkgEnabled> | ||
<VcpkgManifestInstall>false</VcpkgManifestInstall> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<VcpkgEnabled>false</VcpkgEnabled> | ||
<VcpkgManifestInstall>false</VcpkgManifestInstall> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>_H3API_EXCEPTION_;_H3API_LIBRARY_;WIN32;_DEBUG;PLUGINTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>false</ConformanceMode> | ||
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)H3API\lib;$(ProjectDir)include</AdditionalIncludeDirectories> | ||
<ExceptionHandling>Async</ExceptionHandling> | ||
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableUAC>false</EnableUAC> | ||
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(ConfigurationName)\msvc $(VisualStudioVersion)</AdditionalLibraryDirectories> | ||
<AdditionalDependencies>H3API.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> | ||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>_H3API_EXCEPTION_;_H3API_LIBRARY_;WIN32;NDEBUG;PLUGINTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>false</ConformanceMode> | ||
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)H3API\lib;$(ProjectDir)include</AdditionalIncludeDirectories> | ||
<ExceptionHandling>Async</ExceptionHandling> | ||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions> | ||
<MinimalRebuild>true</MinimalRebuild> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableUAC>false</EnableUAC> | ||
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(ConfigurationName)\msvc $(VisualStudioVersion)</AdditionalLibraryDirectories> | ||
<AdditionalDependencies>H3API.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> | ||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClCompile Include="src\AssetLoaderMain.cpp" /> | ||
<ClCompile Include="src\AssetLoader.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="include\AssetLoader.hpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\H3API\H3API.vcxproj"> | ||
<Project>{405b8023-d064-492d-a0df-89b070b26923}</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
<Filter Include="src"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="include"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="src\"AssetLoaderMain.cpp"> | ||
<Filter>src</Filter> | ||
</ClCompile> | ||
<ClCompile Include="src\"AssetLoader.cpp"> | ||
<Filter>src</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="include\"AssetLoader.hpp"> | ||
<Filter>include</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#pragma once | ||
|
||
#define _H3API_PLUGINS_ | ||
#include <Plugin.hpp> | ||
#include <H3API.hpp> | ||
|
||
/** | ||
* Uncomment to show an error message when failing to link up with patcher_x86 | ||
*/ | ||
//#define SHOW_ERROR_MESSAGE_ON_FAIL | ||
|
||
/** | ||
* @brief A derived Plugin that constructs itself | ||
*/ | ||
class AssetLoaderPlugin : public Plugin | ||
{ | ||
public: | ||
AssetLoaderPlugin() : Plugin() | ||
{ | ||
Status status = Init("H3.AssetLoader"); | ||
if (status == Status::Success) | ||
Start(); | ||
#ifdef SHOW_ERROR_MESSAGE_ON_FAIL | ||
else | ||
ShowError("H3.AssetLoader", status); | ||
#endif | ||
} | ||
|
||
static AssetLoaderPlugin& GetPlugin(); | ||
|
||
private: | ||
void Start(); | ||
|
||
public: | ||
//====================================================================================== | ||
// | ||
// Data or methods can be added here which can be accessed from anywhere using the plugin. | ||
// | ||
//====================================================================================== | ||
|
||
h3::H3String m_errorMessage; | ||
|
||
h3::H3LoadedPcx* LoadPcxFromFile(LPCSTR const filepath, LPCSTR const h3name); | ||
h3::H3WavFile* LoadWavFromFile(LPCSTR const filepath, LPCSTR const h3name); | ||
h3::H3LoadedDef* LoadDefFromFile(LPCSTR const filePath, LPCSTR const h3name); | ||
int DefFromFile(HookContext& c); | ||
private: | ||
//====================================================================================== | ||
// | ||
// Data or methods can be added here which can only be accessed from within the plugin. | ||
// | ||
//====================================================================================== | ||
LPCSTR m_defPath; | ||
LoHook* m_defHook; | ||
|
||
bool ValidateParameters(LPCSTR const filepath, LPCSTR const h3name); | ||
PUINT8 GetFileBuffer(LPCSTR const filepath, DWORD& fileSize); | ||
|
||
static constexpr CHAR MissingPath[] = "Path not provided."; | ||
static constexpr CHAR MissingFileName[] = "File name not provided."; | ||
static constexpr CHAR ErrorReadingFile[] = "Could not read file at provided path."; | ||
static constexpr CHAR MemoryAllocation[] = "Could not allocate memory."; | ||
static constexpr CHAR AlreadyExists[] = "An asset already exists with the provided name."; | ||
}; |
Oops, something went wrong.