mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2026-10-10 04:43:03 +08:00
Compare commits
140 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 190d4232bd | |||
| 642d0f17e2 | |||
| 405cdcef1f | |||
| 7993931f88 | |||
| c163301344 | |||
| 8b4e3c4b75 | |||
| 0ee417db70 | |||
| 3280768125 | |||
| df039e495e | |||
| 4803e3b5ce | |||
| 4961177ef7 | |||
| d907cf0b0d | |||
| f6848f37c7 | |||
| 2d9c4bcd45 | |||
| 67a98a8130 | |||
| 4766d630ac | |||
| 71b67d0e46 | |||
| 2cadab18ae | |||
| 3c31878ef8 | |||
| 263db930a4 | |||
| 099fd311e3 | |||
| d3f36c047e | |||
| 96fa5c0a0f | |||
| 598c88bbd6 | |||
| 3d546cc198 | |||
| 38acd3ebe0 | |||
| 4043de504b | |||
| f50c883efc | |||
| dae6072423 | |||
| 61922760a3 | |||
| ce56c7e71e | |||
| 7c79bc18e3 | |||
| bb21fb7446 | |||
| ef4e179600 | |||
| b17ce3e9a9 | |||
| 55e4712990 | |||
| 870a625728 | |||
| 1bd10e06d6 | |||
| ba09473499 | |||
| 7876a52b39 | |||
| a7435e3088 | |||
| 725b0bff41 | |||
| 7dc2fd4de1 | |||
| da99802546 | |||
| bd19d3f45a | |||
| 05fcf607f1 | |||
| fa6a9e0fb8 | |||
| f692641c28 | |||
| 0b6c04f107 | |||
| e3a90c6d58 | |||
| 7d048316e9 | |||
| a580147272 | |||
| 3a51834d4b | |||
| 1dcd0b884e | |||
| e2be96af15 | |||
| f4699cdd30 | |||
| 65e2dc3d44 | |||
| 0ec06592c4 | |||
| 0f3cd3546e | |||
| 0755d8523f | |||
| ba953c90be | |||
| 9a980ca48c | |||
| 4879e68867 | |||
| 4ca2ddf7b2 | |||
| e22e64af32 | |||
| df811ca134 | |||
| ebc2ca4aaf | |||
| ab6d4f6ae9 | |||
| 7c36849cc5 | |||
| 0f5435fa09 | |||
| 4308c7b21a | |||
| b7c81b5e2b | |||
| 565d37b409 | |||
| c43a9ccf02 | |||
| 53efd04ae6 | |||
| c6451da13a | |||
| e0a15ee70d | |||
| 48c5afc66f | |||
| 1163d3bed0 | |||
| 4a10cf0179 | |||
| 8b0e947ef7 | |||
| 262f10f86e | |||
| b55224d1ab | |||
| 6f2665cb28 | |||
| 1da0a83433 | |||
| 20f94eeb21 | |||
| 978bb1034b | |||
| 52dc7b65b7 | |||
| 8d46c28837 | |||
| 3239a9890f | |||
| 3357975309 | |||
| 03777c454f | |||
| 0031a30532 | |||
| b997f81950 | |||
| d7774e56ec | |||
| 7343c9eba3 | |||
| de8c641122 | |||
| 3d85e480e1 | |||
| 6accb5f43d | |||
| b76c961373 | |||
| 34c9a1b13a | |||
| f32b950c01 | |||
| 6aa3cc5870 | |||
| 240c80fb77 | |||
| d883c54843 | |||
| 463273b8e9 | |||
| 59941315a2 | |||
| 94676926d5 | |||
| 695fe35e64 | |||
| c2aa9d6375 | |||
| ddf8d12f6b | |||
| 68e3ddaa29 | |||
| 2def30b18a | |||
| 9dce3455a4 | |||
| 251a153f18 | |||
| 488c735fa2 | |||
| 2eb1e7d25d | |||
| a94c16747b | |||
| b7e000176a | |||
| 9459ddd9c7 | |||
| 9c705ef652 | |||
| e32f647357 | |||
| 8289506ec0 | |||
| f00fc5cfa0 | |||
| 2d804f624c | |||
| 9bd867bc9f | |||
| 675eb58988 | |||
| 7376ae8f13 | |||
| cc019c049e | |||
| 4aca1bae87 | |||
| d20fdf5d5d | |||
| ca4f9d8e2b | |||
| d3dda548b1 | |||
| e9e20d3019 | |||
| fb9ca32ca9 | |||
| dae94182f1 | |||
| 18057ac289 | |||
| 3048ce5bd6 | |||
| fd8f20f6de | |||
| 20a294ebaa |
+5
-4
@@ -2,12 +2,13 @@
|
||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||
################################################################################
|
||||
|
||||
/.vs/DL2GameOverhaulScript
|
||||
/.vs/EGameTools
|
||||
/x64
|
||||
/DL2GameOverhaulScript/x64
|
||||
/DL2GameOverhaulScript/DL2GameOverhaulScript.vcxproj.user
|
||||
/EGameTools/x64
|
||||
/EGameTools/EGameTools.vcxproj.user
|
||||
/Tools/ExtractPlayerVarsFromDecompiledFunc/bin
|
||||
/Tools/ExtractPlayerVarsFromDecompiledFunc/.vs
|
||||
/Tools/ExtractPlayerVarsFromDecompiledFunc/ExtractPlayerVarsFromDecompiledFunc/bin
|
||||
/Tools/ExtractPlayerVarsFromDecompiledFunc/ExtractPlayerVarsFromDecompiledFunc/obj
|
||||
/Tools/ExtractPlayerVarsFromDecompiledFunc/ExtractPlayerVarsFromDecompiledFunc/ExtractPlayerVarsFromDecompiledFunc.csproj.user
|
||||
/Tools/ExtractPlayerVarsFromDecompiledFunc/ExtractPlayerVarsFromDecompiledFunc/ExtractPlayerVarsFromDecompiledFunc.csproj.user
|
||||
/enc_temp_folder
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="source\config\config.cpp" />
|
||||
<ClCompile Include="source\core.cpp" />
|
||||
<ClCompile Include="source\dllmain.cpp" />
|
||||
<ClCompile Include="source\game_classes.cpp" />
|
||||
<ClCompile Include="source\hook.cpp" />
|
||||
<ClCompile Include="source\ImGuiEx\ImGuiEx.cpp" />
|
||||
<ClCompile Include="source\ImGuiFileDialog\ImGuiFileDialog.cpp" />
|
||||
<ClCompile Include="source\ImGuiHotkeys\Hotkey.cpp" />
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx11.cpp" />
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx12.cpp" />
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_win32.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_draw.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_tables.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_widgets.cpp" />
|
||||
<ClCompile Include="source\ImGui\impl\d3d11_impl.cpp" />
|
||||
<ClCompile Include="source\ImGui\impl\d3d12_impl.cpp" />
|
||||
<ClCompile Include="source\ImGui\impl\win32_impl.cpp" />
|
||||
<ClCompile Include="source\kiero.cpp" />
|
||||
<ClCompile Include="source\memory.cpp" />
|
||||
<ClCompile Include="source\menu\camera.cpp" />
|
||||
<ClCompile Include="source\menu\menu.cpp" />
|
||||
<ClCompile Include="source\menu\misc.cpp" />
|
||||
<ClCompile Include="source\menu\player.cpp" />
|
||||
<ClCompile Include="source\menu\world.cpp" />
|
||||
<ClCompile Include="source\sigscan\sigscan.cpp" />
|
||||
<ClCompile Include="source\utils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="source\config\config.h" />
|
||||
<ClInclude Include="source\config\ini.h" />
|
||||
<ClInclude Include="source\config\time_tools.h" />
|
||||
<ClInclude Include="source\core.h" />
|
||||
<ClInclude Include="source\game_classes.h" />
|
||||
<ClInclude Include="source\hook.h" />
|
||||
<ClInclude Include="source\ImGuiEx\ImGuiEx.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\dirent\dirent.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\ImGuiFileDialog.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\ImGuiFileDialogConfig.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\stb\stb_image.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\stb\stb_image_resize.h" />
|
||||
<ClInclude Include="source\ImGuiHotkeys\Hotkey.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx11.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx12.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_win32.h" />
|
||||
<ClInclude Include="source\ImGui\imconfig.h" />
|
||||
<ClInclude Include="source\ImGui\imgui.h" />
|
||||
<ClInclude Include="source\ImGui\imgui_internal.h" />
|
||||
<ClInclude Include="source\ImGui\impl\d3d11_impl.h" />
|
||||
<ClInclude Include="source\ImGui\impl\d3d12_impl.h" />
|
||||
<ClInclude Include="source\ImGui\impl\win32_impl.h" />
|
||||
<ClInclude Include="source\ImGui\imstb_rectpack.h" />
|
||||
<ClInclude Include="source\ImGui\imstb_textedit.h" />
|
||||
<ClInclude Include="source\ImGui\imstb_truetype.h" />
|
||||
<ClInclude Include="source\kiero.h" />
|
||||
<ClInclude Include="source\memory.h" />
|
||||
<ClInclude Include="source\menu\camera.h" />
|
||||
<ClInclude Include="source\menu\menu.h" />
|
||||
<ClInclude Include="source\menu\misc.h" />
|
||||
<ClInclude Include="source\menu\player.h" />
|
||||
<ClInclude Include="source\menu\world.h" />
|
||||
<ClInclude Include="source\MinHook\include\MinHook.h" />
|
||||
<ClInclude Include="source\print.h" />
|
||||
<ClInclude Include="source\sigscan\offsets.h" />
|
||||
<ClInclude Include="source\sigscan\sigscan.h" />
|
||||
<ClInclude Include="source\utils.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{6399cafa-d04a-44fb-8c1d-1fc3a3b59c00}</ProjectGuid>
|
||||
<RootNamespace>DL2GameOverhaulScript</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>DL2GameOverhaulScript</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<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|x64'">
|
||||
<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)'=='Release|x64'">
|
||||
<TargetExt>.asi</TargetExt>
|
||||
<TargetName>EGameTools</TargetName>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
|
||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TargetName>EGameTools</TargetName>
|
||||
<TargetExt>.asi</TargetExt>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<VcpkgUseStatic>true</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x64-windows</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<VcpkgUseStatic>true</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x64-windows</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgEnabled>false</VcpkgEnabled>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;DL2GameOverhaulScript_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<Optimization>
|
||||
</Optimization>
|
||||
<IntrinsicFunctions>
|
||||
</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>source\ImGuiEx;source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>libMinHook-x64-v141-mtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OptimizeReferences>
|
||||
</OptimizeReferences>
|
||||
<EnableCOMDATFolding>
|
||||
</EnableCOMDATFolding>
|
||||
<AdditionalLibraryDirectories>source\MinHook\lib;</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y "$(SolutionDir)Extra Files\Default Config\EGameTools.ini" "$(SolutionDir)$(PlatformShortName)\$(Configuration)\EGameTools.ini"</Command>
|
||||
<Message>Copying the default config file to the debug build directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>source\ImGuiEx;source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalLibraryDirectories>source\MinHook\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libMinHook-x64-v141-mtd.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ImportLibrary />
|
||||
<AdditionalOptions>/NOIMPLIB /NOEXP %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y "$(SolutionDir)Extra Files\Default Config\EGameTools.ini" "$(SolutionDir)$(PlatformShortName)\$(Configuration)\EGameTools.ini"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying the default config file to the release build directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
</Project>
|
||||
@@ -1,212 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="source\memory.cpp" />
|
||||
<ClCompile Include="source\core.cpp" />
|
||||
<ClCompile Include="source\dllmain.cpp" />
|
||||
<ClCompile Include="source\kiero.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_draw.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_tables.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_widgets.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx11.cpp">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx12.cpp">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_win32.cpp">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\impl\d3d11_impl.cpp">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\impl\win32_impl.cpp">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\camera.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\menu.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game_classes.cpp" />
|
||||
<ClCompile Include="source\hook.cpp" />
|
||||
<ClCompile Include="source\utils.cpp" />
|
||||
<ClCompile Include="source\sigscan\sigscan.cpp">
|
||||
<Filter>sigscan</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGuiFileDialog\ImGuiFileDialog.cpp">
|
||||
<Filter>ImGuiFileDialog</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\impl\d3d12_impl.cpp">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\config\config.cpp">
|
||||
<Filter>config</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\player.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\world.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGuiHotkeys\Hotkey.cpp">
|
||||
<Filter>ImGuiHotkeys</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGuiEx\ImGuiEx.cpp">
|
||||
<Filter>ImGuiEx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\misc.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="source\memory.h" />
|
||||
<ClInclude Include="source\game_classes.h" />
|
||||
<ClInclude Include="source\print.h" />
|
||||
<ClInclude Include="source\kiero.h" />
|
||||
<ClInclude Include="source\MinHook\include\MinHook.h">
|
||||
<Filter>MinHook\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imconfig.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imgui.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imgui_internal.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imstb_rectpack.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imstb_textedit.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imstb_truetype.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx11.h">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx12.h">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_win32.h">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\impl\d3d11_impl.h">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\impl\win32_impl.h">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\camera.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\menu.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\hook.h" />
|
||||
<ClInclude Include="source\utils.h" />
|
||||
<ClInclude Include="source\sigscan\sigscan.h">
|
||||
<Filter>sigscan</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\sigscan\offsets.h">
|
||||
<Filter>sigscan</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\core.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\ImGuiFileDialog.h">
|
||||
<Filter>ImGuiFileDialog</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGuiFileDialog\ImGuiFileDialogConfig.h">
|
||||
<Filter>ImGuiFileDialog</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGuiFileDialog\dirent\dirent.h">
|
||||
<Filter>ImGuiFileDialog\dirent</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGuiFileDialog\stb\stb_image.h">
|
||||
<Filter>ImGuiFileDialog\stb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGuiFileDialog\stb\stb_image_resize.h">
|
||||
<Filter>ImGuiFileDialog\stb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\impl\d3d12_impl.h">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\config\ini.h">
|
||||
<Filter>config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\config\time_tools.h">
|
||||
<Filter>config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\config\config.h">
|
||||
<Filter>config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\player.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\world.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGuiHotkeys\Hotkey.h">
|
||||
<Filter>ImGuiHotkeys</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGuiEx\ImGuiEx.h">
|
||||
<Filter>ImGuiEx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\misc.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="MinHook">
|
||||
<UniqueIdentifier>{794284a1-160f-4b62-bfd0-d160dbb38e40}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="MinHook\include">
|
||||
<UniqueIdentifier>{e697e380-6df5-4cfc-861e-e2b77ce03d39}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui">
|
||||
<UniqueIdentifier>{8b35dc3d-fbec-4ae6-af90-4b9cc2b758e3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui\backends">
|
||||
<UniqueIdentifier>{70e27b28-a2be-49e4-a4a1-5ed696079ee0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui\impl">
|
||||
<UniqueIdentifier>{28cd5a16-84b1-4a9e-96a4-79fc75982912}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="menu">
|
||||
<UniqueIdentifier>{775559c7-e9f6-49d5-a2d4-6458b99e8cd9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="sigscan">
|
||||
<UniqueIdentifier>{525740fe-17a7-431f-b020-720a1dc32e07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGuiFileDialog">
|
||||
<UniqueIdentifier>{de465f41-9f72-477f-b27f-b2e79be85aee}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGuiFileDialog\dirent">
|
||||
<UniqueIdentifier>{3200ad89-3545-4059-8b77-8dde207ba3a4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGuiFileDialog\stb">
|
||||
<UniqueIdentifier>{fc7f7021-7f6b-46f0-af79-efe792ae05a8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="config">
|
||||
<UniqueIdentifier>{50f832bc-5ff2-45db-8d20-e8f458c78596}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGuiHotkeys">
|
||||
<UniqueIdentifier>{1bf47e0a-f304-4b69-9662-60e65c2c3655}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGuiEx">
|
||||
<UniqueIdentifier>{c4339f5a-8efb-4f84-bb49-bd25a24d04d9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,53 +0,0 @@
|
||||
#include <d3d11.h>
|
||||
#include <assert.h>
|
||||
#include <imgui.h>
|
||||
#include <backends\imgui_impl_win32.h>
|
||||
#include <backends\imgui_impl_dx11.h>
|
||||
#include "..\..\menu\menu.h"
|
||||
#include "..\..\kiero.h"
|
||||
#include "d3d11_impl.h"
|
||||
#include "win32_impl.h"
|
||||
|
||||
HRESULT(__stdcall* oPresent)(IDXGISwapChain*, UINT, UINT);
|
||||
HRESULT __stdcall hkPresent11(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags) {
|
||||
static bool init = false;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
DXGI_SWAP_CHAIN_DESC desc{};
|
||||
pSwapChain->GetDesc(&desc);
|
||||
|
||||
ID3D11Device* device = nullptr;
|
||||
pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)&device);
|
||||
|
||||
ID3D11DeviceContext* context = nullptr;
|
||||
device->GetImmediateContext(&context);
|
||||
|
||||
impl::win32::init(desc.OutputWindow);
|
||||
|
||||
ImGui::CreateContext();
|
||||
ImGui::GetIO().IniFilename = nullptr;
|
||||
|
||||
ImGui_ImplWin32_Init(desc.OutputWindow);
|
||||
ImGui_ImplDX11_Init(device, context);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
ImGui_ImplDX11_NewFrame();
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
if (Menu::menuToggle.GetValue())
|
||||
Menu::Render();
|
||||
|
||||
ImGui::EndFrame();
|
||||
ImGui::Render();
|
||||
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
||||
|
||||
return oPresent(pSwapChain, SyncInterval, Flags);
|
||||
}
|
||||
|
||||
void impl::d3d11::init() {
|
||||
assert(kiero::bind(8, (LPVOID*)&oPresent, hkPresent11) == kiero::Status::Success);
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
#include <d3d12.h>
|
||||
#include <dxgi1_4.h>
|
||||
#include <assert.h>
|
||||
#include <imgui.h>
|
||||
#include <backends\imgui_impl_win32.h>
|
||||
#include <backends\imgui_impl_dx12.h>
|
||||
#include "..\..\menu\menu.h"
|
||||
#include "..\..\kiero.h"
|
||||
#include "d3d12_impl.h"
|
||||
#include "win32_impl.h"
|
||||
|
||||
struct FrameContext {
|
||||
ID3D12CommandAllocator* commandAllocator = nullptr;
|
||||
ID3D12Resource* main_render_target_resource = nullptr;
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE main_render_target_descriptor{};
|
||||
};
|
||||
|
||||
static UINT buffersCounts = -1;
|
||||
static FrameContext* frameContext = nullptr;
|
||||
|
||||
static ID3D12Device* device = nullptr;
|
||||
static ID3D12DescriptorHeap* d3d12DescriptorHeapBackBuffers = nullptr;
|
||||
static ID3D12DescriptorHeap* d3d12DescriptorHeapImGuiRender = nullptr;
|
||||
static ID3D12GraphicsCommandList* d3d12CommandList = nullptr;
|
||||
static ID3D12CommandQueue* d3d12CommandQueue = nullptr;
|
||||
|
||||
static void CreateRenderTarget(IDXGISwapChain* pSwapChain) {
|
||||
for (UINT i = 0; i < buffersCounts; i++) {
|
||||
ID3D12Resource* pBackBuffer = nullptr;
|
||||
pSwapChain->GetBuffer(i, IID_PPV_ARGS(&pBackBuffer));
|
||||
if (pBackBuffer) {
|
||||
D3D12_RENDER_TARGET_VIEW_DESC descTarget{};
|
||||
descTarget.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
descTarget.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
|
||||
|
||||
device->CreateRenderTargetView(pBackBuffer, &descTarget, frameContext[i].main_render_target_descriptor);
|
||||
frameContext[i].main_render_target_resource = pBackBuffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void RenderImGui_DX12(IDXGISwapChain3* pSwapChain) {
|
||||
static bool init = false;
|
||||
|
||||
if (!init) {
|
||||
DXGI_SWAP_CHAIN_DESC desc{};
|
||||
pSwapChain->GetDesc(&desc);
|
||||
pSwapChain->GetDevice(__uuidof(ID3D12Device), (void**)&device);
|
||||
|
||||
buffersCounts = desc.BufferCount;
|
||||
frameContext = new FrameContext[buffersCounts];
|
||||
|
||||
D3D12_DESCRIPTOR_HEAP_DESC descriptorBackBuffers{};
|
||||
descriptorBackBuffers.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
|
||||
descriptorBackBuffers.NumDescriptors = buffersCounts;
|
||||
descriptorBackBuffers.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
|
||||
descriptorBackBuffers.NodeMask = 1;
|
||||
if (device->CreateDescriptorHeap(&descriptorBackBuffers, IID_PPV_ARGS(&d3d12DescriptorHeapBackBuffers)) != S_OK)
|
||||
return;
|
||||
|
||||
SIZE_T rtvDescriptorSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtvHandle = d3d12DescriptorHeapBackBuffers->GetCPUDescriptorHandleForHeapStart();
|
||||
for (UINT i = 0; i < buffersCounts; ++i) {
|
||||
frameContext[i].main_render_target_descriptor = rtvHandle;
|
||||
rtvHandle.ptr += rtvDescriptorSize;
|
||||
}
|
||||
|
||||
D3D12_DESCRIPTOR_HEAP_DESC descriptorImGuiRender{};
|
||||
descriptorImGuiRender.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
|
||||
descriptorImGuiRender.NumDescriptors = 1;
|
||||
descriptorImGuiRender.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
|
||||
if (device->CreateDescriptorHeap(&descriptorImGuiRender, IID_PPV_ARGS(&d3d12DescriptorHeapImGuiRender)) != S_OK)
|
||||
return;
|
||||
|
||||
for (size_t i = 0; i < buffersCounts; i++) {
|
||||
ID3D12CommandAllocator* allocator = nullptr;
|
||||
if (device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&allocator)) != S_OK)
|
||||
return;
|
||||
|
||||
frameContext[i].commandAllocator = allocator;
|
||||
}
|
||||
|
||||
if (device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, frameContext[0].commandAllocator, NULL, IID_PPV_ARGS(&d3d12CommandList)) != S_OK || d3d12CommandList->Close() != S_OK)
|
||||
return;
|
||||
|
||||
impl::win32::init(desc.OutputWindow);
|
||||
|
||||
ImGui::CreateContext();
|
||||
ImGui::GetIO().IniFilename = nullptr;
|
||||
|
||||
ImGui_ImplWin32_Init(desc.OutputWindow);
|
||||
ImGui_ImplDX12_Init(device, buffersCounts, DXGI_FORMAT_R8G8B8A8_UNORM, d3d12DescriptorHeapImGuiRender, d3d12DescriptorHeapImGuiRender->GetCPUDescriptorHandleForHeapStart(), d3d12DescriptorHeapImGuiRender->GetGPUDescriptorHandleForHeapStart());
|
||||
ImGui_ImplDX12_CreateDeviceObjects();
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
if (!frameContext[0].main_render_target_resource)
|
||||
CreateRenderTarget(pSwapChain);
|
||||
if (!d3d12CommandQueue || !frameContext[0].main_render_target_resource)
|
||||
return;
|
||||
|
||||
ImGui_ImplDX12_NewFrame();
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
if (Menu::menuToggle.GetValue())
|
||||
Menu::Render();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
UINT backBufferIdx = pSwapChain->GetCurrentBackBufferIndex();
|
||||
ID3D12CommandAllocator* commandAllocator = frameContext[backBufferIdx].commandAllocator;
|
||||
commandAllocator->Reset();
|
||||
|
||||
D3D12_RESOURCE_BARRIER barrier{};
|
||||
barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
|
||||
barrier.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE;
|
||||
barrier.Transition.pResource = frameContext[backBufferIdx].main_render_target_resource;
|
||||
barrier.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
|
||||
barrier.Transition.StateBefore = D3D12_RESOURCE_STATE_PRESENT;
|
||||
barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_RENDER_TARGET;
|
||||
d3d12CommandList->Reset(commandAllocator, NULL);
|
||||
d3d12CommandList->ResourceBarrier(1, &barrier);
|
||||
|
||||
d3d12CommandList->OMSetRenderTargets(1, &frameContext[backBufferIdx].main_render_target_descriptor, FALSE, NULL);
|
||||
d3d12CommandList->SetDescriptorHeaps(1, &d3d12DescriptorHeapImGuiRender);
|
||||
|
||||
ImGui_ImplDX12_RenderDrawData(ImGui::GetDrawData(), d3d12CommandList);
|
||||
|
||||
barrier.Transition.StateBefore = D3D12_RESOURCE_STATE_RENDER_TARGET;
|
||||
barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_PRESENT;
|
||||
|
||||
d3d12CommandList->ResourceBarrier(1, &barrier);
|
||||
d3d12CommandList->Close();
|
||||
|
||||
d3d12CommandQueue->ExecuteCommandLists(1, reinterpret_cast<ID3D12CommandList* const*>(&d3d12CommandList));
|
||||
}
|
||||
|
||||
HRESULT(__stdcall* oPresent)(IDXGISwapChain3*, UINT, UINT);
|
||||
HRESULT __stdcall hkPresent12(IDXGISwapChain3* pSwapChain, UINT SyncInterval, UINT Flags) {
|
||||
RenderImGui_DX12(pSwapChain);
|
||||
|
||||
return oPresent(pSwapChain, SyncInterval, Flags);
|
||||
}
|
||||
|
||||
HRESULT(__stdcall* oPresent1)(IDXGISwapChain3*, UINT, UINT, const DXGI_PRESENT_PARAMETERS* pPresentParameters);
|
||||
HRESULT __stdcall hkPresent112(IDXGISwapChain3* pSwapChain, UINT SyncInterval, UINT PresentFlags, const DXGI_PRESENT_PARAMETERS* pPresentParameters) {
|
||||
RenderImGui_DX12(pSwapChain);
|
||||
|
||||
return oPresent1(pSwapChain, SyncInterval, PresentFlags, pPresentParameters);
|
||||
}
|
||||
|
||||
static void CleanupRenderTarget() {
|
||||
for (UINT i = 0; i < buffersCounts; ++i) {
|
||||
if (frameContext[i].main_render_target_resource) {
|
||||
frameContext[i].main_render_target_resource->Release();
|
||||
frameContext[i].main_render_target_resource = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT(__stdcall* oResizeBuffers)(IDXGISwapChain*, UINT, UINT, UINT, DXGI_FORMAT, UINT);
|
||||
HRESULT hookResizeBuffers12(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags) {
|
||||
CleanupRenderTarget();
|
||||
|
||||
return oResizeBuffers(pSwapChain, BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
}
|
||||
|
||||
HRESULT(__stdcall* oResizeBuffers1)(IDXGISwapChain3*, UINT, UINT, UINT, DXGI_FORMAT, UINT, const UINT*, IUnknown* const*);
|
||||
HRESULT hookResizeBuffers112(IDXGISwapChain3* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags, const UINT* pCreationNodeMask, IUnknown* const* ppPresentQueue) {
|
||||
CleanupRenderTarget();
|
||||
|
||||
return oResizeBuffers1(pSwapChain, BufferCount, Width, Height, NewFormat, SwapChainFlags, pCreationNodeMask, ppPresentQueue);
|
||||
}
|
||||
|
||||
void(__stdcall* oExecuteCommandLists)(ID3D12CommandQueue*, UINT, ID3D12CommandList* const*);
|
||||
void hookExecuteCommandLists12(ID3D12CommandQueue* queue, UINT NumCommandLists, ID3D12CommandList* const *ppCommandLists) {
|
||||
if (!d3d12CommandQueue)
|
||||
d3d12CommandQueue = queue;
|
||||
|
||||
oExecuteCommandLists(queue, NumCommandLists, ppCommandLists);
|
||||
}
|
||||
|
||||
void impl::d3d12::init() {
|
||||
assert(kiero::bind(140, (LPVOID*)&oPresent, hkPresent12) == kiero::Status::Success);
|
||||
assert(kiero::bind(154, (LPVOID*)&oPresent1, hkPresent112) == kiero::Status::Success);
|
||||
|
||||
assert(kiero::bind(145, (LPVOID*)&oResizeBuffers, hookResizeBuffers12) == kiero::Status::Success);
|
||||
assert(kiero::bind(171, (LPVOID*)&oResizeBuffers1, hookResizeBuffers112) == kiero::Status::Success);
|
||||
|
||||
assert(kiero::bind(54, (LPVOID*)&oExecuteCommandLists, hookExecuteCommandLists12) == kiero::Status::Success);
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
#include <Hotkey.h>
|
||||
#include <Windows.h>
|
||||
#include <backends\imgui_impl_win32.h>
|
||||
#include <imgui.h>
|
||||
#include "..\..\core.h"
|
||||
#include "..\..\game_classes.h"
|
||||
#include "..\..\kiero.h"
|
||||
#include "..\..\menu\menu.h"
|
||||
#include "..\..\sigscan\offsets.h"
|
||||
#include "..\config\config.h"
|
||||
#include "win32_impl.h"
|
||||
|
||||
static WNDPROC oWndProc = NULL;
|
||||
static bool toggledMenu = false;
|
||||
|
||||
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam) {
|
||||
switch (uMsg) {
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
if (ImGui::isAnyHotkeyBtnPressed || !ImGui::timeSinceHotkeyBtnPressed.GetTimePassed() || KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : *KeyBindOption::GetInstances()) {
|
||||
if (option->GetImGuiDisabled())
|
||||
continue;
|
||||
if (wParam == option->GetKeyBind()) {
|
||||
KeyBindOption::wasAnyKeyPressed = true;
|
||||
option->Toggle();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
if (!KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : *KeyBindOption::GetInstances()) {
|
||||
if (wParam == option->GetKeyBind())
|
||||
KeyBindOption::wasAnyKeyPressed = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Engine::CInput* pCInput = Engine::CInput::Get();
|
||||
if (!pCInput)
|
||||
return CallWindowProc(oWndProc, hwnd, uMsg, wParam, lParam);
|
||||
|
||||
ImGui::GetIO().MouseDrawCursor = Menu::menuToggle.GetValue();
|
||||
ImGui_ImplWin32_WndProcHandler(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
if (Menu::menuToggle.GetValue()) {
|
||||
if (!toggledMenu)
|
||||
pCInput->BlockGameInput();
|
||||
|
||||
toggledMenu = true;
|
||||
return true;
|
||||
} else if (toggledMenu) {
|
||||
toggledMenu = false;
|
||||
pCInput->UnlockGameInput();
|
||||
}
|
||||
|
||||
return CallWindowProc(oWndProc, hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
void impl::win32::init(HWND hwnd) {
|
||||
oWndProc = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)hkWindowProc);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
misc/cpp/
|
||||
InputText() wrappers for C++ standard library (STL) type: std::string.
|
||||
This is also an example of how you may wrap your own similar types.
|
||||
|
||||
misc/debuggers/
|
||||
Helper files for popular debuggers.
|
||||
With the .natvis file, types like ImVector<> will be displayed nicely in Visual Studio debugger.
|
||||
|
||||
misc/fonts/
|
||||
Fonts loading/merging instructions (e.g. How to handle glyph ranges, how to merge icons fonts).
|
||||
Command line tool "binary_to_compressed_c" to create compressed arrays to embed data in source code.
|
||||
Suggested fonts and links.
|
||||
|
||||
misc/freetype/
|
||||
Font atlas builder/rasterizer using FreeType instead of stb_truetype.
|
||||
Benefit from better FreeType rasterization, in particular for small fonts.
|
||||
|
||||
misc/single_file/
|
||||
Single-file header stub.
|
||||
We use this to validate compiling all *.cpp files in a same compilation unit.
|
||||
Users of that technique (also called "Unity builds") can generally provide this themselves,
|
||||
so we don't really recommend you use this in your projects.
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
imgui_stdlib.h + imgui_stdlib.cpp
|
||||
InputText() wrappers for C++ standard library (STL) type: std::string.
|
||||
This is also an example of how you may wrap your own similar types.
|
||||
|
||||
imgui_scoped.h
|
||||
[Experimental, not currently in main repository]
|
||||
Additional header file with some RAII-style wrappers for common Dear ImGui functions.
|
||||
Try by merging: https://github.com/ocornut/imgui/pull/2197
|
||||
Discuss at: https://github.com/ocornut/imgui/issues/2096
|
||||
|
||||
See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki:
|
||||
https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness
|
||||
@@ -1,75 +0,0 @@
|
||||
// dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.)
|
||||
// This is also an example of how you may wrap your own similar types.
|
||||
|
||||
// Changelog:
|
||||
// - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string
|
||||
|
||||
// See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki:
|
||||
// https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness
|
||||
|
||||
#include "imgui.h"
|
||||
#include "imgui_stdlib.h"
|
||||
|
||||
struct InputTextCallback_UserData
|
||||
{
|
||||
std::string* Str;
|
||||
ImGuiInputTextCallback ChainCallback;
|
||||
void* ChainCallbackUserData;
|
||||
};
|
||||
|
||||
static int InputTextCallback(ImGuiInputTextCallbackData* data)
|
||||
{
|
||||
InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData;
|
||||
if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
|
||||
{
|
||||
// Resize string callback
|
||||
// If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want.
|
||||
std::string* str = user_data->Str;
|
||||
IM_ASSERT(data->Buf == str->c_str());
|
||||
str->resize(data->BufTextLen);
|
||||
data->Buf = (char*)str->c_str();
|
||||
}
|
||||
else if (user_data->ChainCallback)
|
||||
{
|
||||
// Forward to user callback, if any
|
||||
data->UserData = user_data->ChainCallbackUserData;
|
||||
return user_data->ChainCallback(data);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
|
||||
{
|
||||
IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
|
||||
flags |= ImGuiInputTextFlags_CallbackResize;
|
||||
|
||||
InputTextCallback_UserData cb_user_data;
|
||||
cb_user_data.Str = str;
|
||||
cb_user_data.ChainCallback = callback;
|
||||
cb_user_data.ChainCallbackUserData = user_data;
|
||||
return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data);
|
||||
}
|
||||
|
||||
bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
|
||||
{
|
||||
IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
|
||||
flags |= ImGuiInputTextFlags_CallbackResize;
|
||||
|
||||
InputTextCallback_UserData cb_user_data;
|
||||
cb_user_data.Str = str;
|
||||
cb_user_data.ChainCallback = callback;
|
||||
cb_user_data.ChainCallbackUserData = user_data;
|
||||
return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data);
|
||||
}
|
||||
|
||||
bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
|
||||
{
|
||||
IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
|
||||
flags |= ImGuiInputTextFlags_CallbackResize;
|
||||
|
||||
InputTextCallback_UserData cb_user_data;
|
||||
cb_user_data.Str = str;
|
||||
cb_user_data.ChainCallback = callback;
|
||||
cb_user_data.ChainCallbackUserData = user_data;
|
||||
return InputTextWithHint(label, hint, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.)
|
||||
// This is also an example of how you may wrap your own similar types.
|
||||
|
||||
// Changelog:
|
||||
// - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string
|
||||
|
||||
// See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki:
|
||||
// https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ImGui
|
||||
{
|
||||
// ImGui::InputText() with std::string
|
||||
// Because text input needs dynamic resizing, we need to setup a callback to grow the capacity
|
||||
IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);
|
||||
IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);
|
||||
IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
HELPER FILES FOR POPULAR DEBUGGERS
|
||||
|
||||
imgui.gdb
|
||||
GDB: disable stepping into trivial functions.
|
||||
(read comments inside file for details)
|
||||
|
||||
imgui.natstepfilter
|
||||
Visual Studio Debugger: disable stepping into trivial functions.
|
||||
(read comments inside file for details)
|
||||
|
||||
imgui.natvis
|
||||
Visual Studio Debugger: describe Dear ImGui types for better display.
|
||||
With this, types like ImVector<> will be displayed nicely in the debugger.
|
||||
(read comments inside file for details)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# GDB configuration to aid debugging experience
|
||||
|
||||
# To enable these customizations edit $HOME/.gdbinit (or ./.gdbinit if local gdbinit is enabled) and add:
|
||||
# add-auto-load-safe-path /path/to/imgui.gdb
|
||||
# source /path/to/imgui.gdb
|
||||
#
|
||||
# More Information at:
|
||||
# * https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html
|
||||
# * https://sourceware.org/gdb/current/onlinedocs/gdb/Init-File-in-the-Current-Directory.html#Init-File-in-the-Current-Directory
|
||||
|
||||
# Disable stepping into trivial functions
|
||||
skip -rfunction Im(Vec2|Vec4|Strv|Vector|Span)::.+
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
.natstepfilter file for Visual Studio debugger.
|
||||
Purpose: instruct debugger to skip some functions when using StepInto (F11)
|
||||
|
||||
Since Visual Studio 2022 version 17.6 Preview 2 (currently available as a "Preview" build on March 14, 2023)
|
||||
It is possible to add the .natstepfilter file to your project file and it will automatically be used.
|
||||
(https://developercommunity.visualstudio.com/t/allow-natstepfilter-and-natjmc-to-be-included-as-p/561718)
|
||||
|
||||
For older Visual Studio version prior to 2022 17.6 Preview 2:
|
||||
* copy in %USERPROFILE%\Documents\Visual Studio XXXX\Visualizers (current user)
|
||||
* or copy in %VsInstallDirectory%\Common7\Packages\Debugger\Visualizers (all users)
|
||||
If you have multiple VS version installed, the version that matters is the one you are using the IDE/debugger
|
||||
of (not the compiling toolset). This is supported since Visual Studio 2012.
|
||||
|
||||
More information at: https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code?view=vs-2019#BKMK_C___Just_My_Code
|
||||
-->
|
||||
|
||||
<StepFilter xmlns="http://schemas.microsoft.com/vstudio/debugger/natstepfilter/2010">
|
||||
|
||||
<!-- Disable stepping into trivial functions -->
|
||||
<Function>
|
||||
<Name>(ImVec2|ImVec4|ImStrv)::.+</Name>
|
||||
<Action>NoStepInto</Action>
|
||||
</Function>
|
||||
<Function>
|
||||
<Name>(ImVector|ImSpan).*::operator.+</Name>
|
||||
<Action>NoStepInto</Action>
|
||||
</Function>
|
||||
|
||||
</StepFilter>
|
||||
@@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
.natvis file for Visual Studio debugger.
|
||||
Purpose: provide nicer views on data types used by Dear ImGui.
|
||||
|
||||
To enable:
|
||||
* include file in your VS project (most recommended: not intrusive and always kept up to date!)
|
||||
* or copy in %USERPROFILE%\Documents\Visual Studio XXXX\Visualizers (current user)
|
||||
* or copy in %VsInstallDirectory%\Common7\Packages\Debugger\Visualizers (all users)
|
||||
|
||||
More information at: https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2019
|
||||
-->
|
||||
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
|
||||
<Type Name="ImVector<*>">
|
||||
<DisplayString>{{Size={Size} Capacity={Capacity}}}</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems>
|
||||
<Size>Size</Size>
|
||||
<ValuePointer>Data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="ImSpan<*>">
|
||||
<DisplayString>{{Size={DataEnd-Data} }}</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems>
|
||||
<Size>DataEnd-Data</Size>
|
||||
<ValuePointer>Data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="ImVec2">
|
||||
<DisplayString>{{x={x,g} y={y,g}}}</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="ImVec4">
|
||||
<DisplayString>{{x={x,g} y={y,g} z={z,g} w={w,g}}}</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="ImRect">
|
||||
<DisplayString>{{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="Min">Min</Item>
|
||||
<Item Name="Max">Max</Item>
|
||||
<Item Name="[Width]">Max.x - Min.x</Item>
|
||||
<Item Name="[Height]">Max.y - Min.y</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="ImGuiWindow">
|
||||
<DisplayString>{{Name {Name,s} Active {(Active||WasActive)?1:0,d} Child {(Flags & 0x01000000)?1:0,d} Popup {(Flags & 0x04000000)?1:0,d} Hidden {(Hidden)?1:0,d}}</DisplayString>
|
||||
</Type>
|
||||
|
||||
</AutoVisualizer>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,388 +0,0 @@
|
||||
// dear imgui
|
||||
// (binary_to_compressed_c.cpp)
|
||||
// Helper tool to turn a file into a C array, if you want to embed font data in your source code.
|
||||
|
||||
// The data is first compressed with stb_compress() to reduce source code size,
|
||||
// then encoded in Base85 to fit in a string so we can fit roughly 4 bytes of compressed data into 5 bytes of source code (suggested by @mmalex)
|
||||
// (If we used 32-bit constants it would require take 11 bytes of source code to encode 4 bytes, and be endianness dependent)
|
||||
// Note that even with compression, the output array is likely to be bigger than the binary file..
|
||||
// Load compressed TTF fonts with ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF()
|
||||
|
||||
// Build with, e.g:
|
||||
// # cl.exe binary_to_compressed_c.cpp
|
||||
// # g++ binary_to_compressed_c.cpp
|
||||
// # clang++ binary_to_compressed_c.cpp
|
||||
// You can also find a precompiled Windows binary in the binary/demo package available from https://github.com/ocornut/imgui
|
||||
|
||||
// Usage:
|
||||
// binary_to_compressed_c.exe [-base85] [-nocompress] [-nostatic] <inputfile> <symbolname>
|
||||
// Usage example:
|
||||
// # binary_to_compressed_c.exe myfont.ttf MyFont > myfont.cpp
|
||||
// # binary_to_compressed_c.exe -base85 myfont.ttf MyFont > myfont.cpp
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
// stb_compress* from stb.h - declaration
|
||||
typedef unsigned int stb_uint;
|
||||
typedef unsigned char stb_uchar;
|
||||
stb_uint stb_compress(stb_uchar* out, stb_uchar* in, stb_uint len);
|
||||
|
||||
static bool binary_to_compressed_c(const char* filename, const char* symbol, bool use_base85_encoding, bool use_compression, bool use_static);
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
printf("Syntax: %s [-base85] [-nocompress] [-nostatic] <inputfile> <symbolname>\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int argn = 1;
|
||||
bool use_base85_encoding = false;
|
||||
bool use_compression = true;
|
||||
bool use_static = true;
|
||||
while (argn < (argc - 2) && argv[argn][0] == '-')
|
||||
{
|
||||
if (strcmp(argv[argn], "-base85") == 0) { use_base85_encoding = true; argn++; }
|
||||
else if (strcmp(argv[argn], "-nocompress") == 0) { use_compression = false; argn++; }
|
||||
else if (strcmp(argv[argn], "-nostatic") == 0) { use_static = false; argn++; }
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Unknown argument: '%s'\n", argv[argn]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
bool ret = binary_to_compressed_c(argv[argn], argv[argn + 1], use_base85_encoding, use_compression, use_static);
|
||||
if (!ret)
|
||||
fprintf(stderr, "Error opening or reading file: '%s'\n", argv[argn]);
|
||||
return ret ? 0 : 1;
|
||||
}
|
||||
|
||||
char Encode85Byte(unsigned int x)
|
||||
{
|
||||
x = (x % 85) + 35;
|
||||
return (char)((x >= '\\') ? x + 1 : x);
|
||||
}
|
||||
|
||||
bool binary_to_compressed_c(const char* filename, const char* symbol, bool use_base85_encoding, bool use_compression, bool use_static)
|
||||
{
|
||||
// Read file
|
||||
FILE* f = fopen(filename, "rb");
|
||||
if (!f) return false;
|
||||
int data_sz;
|
||||
if (fseek(f, 0, SEEK_END) || (data_sz = (int)ftell(f)) == -1 || fseek(f, 0, SEEK_SET)) { fclose(f); return false; }
|
||||
char* data = new char[data_sz + 4];
|
||||
if (fread(data, 1, data_sz, f) != (size_t)data_sz) { fclose(f); delete[] data; return false; }
|
||||
memset((void*)(((char*)data) + data_sz), 0, 4);
|
||||
fclose(f);
|
||||
|
||||
// Compress
|
||||
int maxlen = data_sz + 512 + (data_sz >> 2) + sizeof(int); // total guess
|
||||
char* compressed = use_compression ? new char[maxlen] : data;
|
||||
int compressed_sz = use_compression ? stb_compress((stb_uchar*)compressed, (stb_uchar*)data, data_sz) : data_sz;
|
||||
if (use_compression)
|
||||
memset(compressed + compressed_sz, 0, maxlen - compressed_sz);
|
||||
|
||||
// Output as Base85 encoded
|
||||
FILE* out = stdout;
|
||||
fprintf(out, "// File: '%s' (%d bytes)\n", filename, (int)data_sz);
|
||||
fprintf(out, "// Exported using binary_to_compressed_c.cpp\n");
|
||||
const char* static_str = use_static ? "static " : "";
|
||||
const char* compressed_str = use_compression ? "compressed_" : "";
|
||||
if (use_base85_encoding)
|
||||
{
|
||||
fprintf(out, "%sconst char %s_%sdata_base85[%d+1] =\n \"", static_str, symbol, compressed_str, (int)((compressed_sz + 3) / 4)*5);
|
||||
char prev_c = 0;
|
||||
for (int src_i = 0; src_i < compressed_sz; src_i += 4)
|
||||
{
|
||||
// This is made a little more complicated by the fact that ??X sequences are interpreted as trigraphs by old C/C++ compilers. So we need to escape pairs of ??.
|
||||
unsigned int d = *(unsigned int*)(compressed + src_i);
|
||||
for (unsigned int n5 = 0; n5 < 5; n5++, d /= 85)
|
||||
{
|
||||
char c = Encode85Byte(d);
|
||||
fprintf(out, (c == '?' && prev_c == '?') ? "\\%c" : "%c", c);
|
||||
prev_c = c;
|
||||
}
|
||||
if ((src_i % 112) == 112 - 4)
|
||||
fprintf(out, "\"\n \"");
|
||||
}
|
||||
fprintf(out, "\";\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(out, "%sconst unsigned int %s_%ssize = %d;\n", static_str, symbol, compressed_str, (int)compressed_sz);
|
||||
fprintf(out, "%sconst unsigned int %s_%sdata[%d/4] =\n{", static_str, symbol, compressed_str, (int)((compressed_sz + 3) / 4)*4);
|
||||
int column = 0;
|
||||
for (int i = 0; i < compressed_sz; i += 4)
|
||||
{
|
||||
unsigned int d = *(unsigned int*)(compressed + i);
|
||||
if ((column++ % 12) == 0)
|
||||
fprintf(out, "\n 0x%08x, ", d);
|
||||
else
|
||||
fprintf(out, "0x%08x, ", d);
|
||||
}
|
||||
fprintf(out, "\n};\n\n");
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
delete[] data;
|
||||
if (use_compression)
|
||||
delete[] compressed;
|
||||
return true;
|
||||
}
|
||||
|
||||
// stb_compress* from stb.h - definition
|
||||
|
||||
//////////////////// compressor ///////////////////////
|
||||
|
||||
static stb_uint stb_adler32(stb_uint adler32, stb_uchar *buffer, stb_uint buflen)
|
||||
{
|
||||
const unsigned long ADLER_MOD = 65521;
|
||||
unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16;
|
||||
unsigned long blocklen, i;
|
||||
|
||||
blocklen = buflen % 5552;
|
||||
while (buflen) {
|
||||
for (i=0; i + 7 < blocklen; i += 8) {
|
||||
s1 += buffer[0], s2 += s1;
|
||||
s1 += buffer[1], s2 += s1;
|
||||
s1 += buffer[2], s2 += s1;
|
||||
s1 += buffer[3], s2 += s1;
|
||||
s1 += buffer[4], s2 += s1;
|
||||
s1 += buffer[5], s2 += s1;
|
||||
s1 += buffer[6], s2 += s1;
|
||||
s1 += buffer[7], s2 += s1;
|
||||
|
||||
buffer += 8;
|
||||
}
|
||||
|
||||
for (; i < blocklen; ++i)
|
||||
s1 += *buffer++, s2 += s1;
|
||||
|
||||
s1 %= ADLER_MOD, s2 %= ADLER_MOD;
|
||||
buflen -= blocklen;
|
||||
blocklen = 5552;
|
||||
}
|
||||
return (s2 << 16) + s1;
|
||||
}
|
||||
|
||||
static unsigned int stb_matchlen(stb_uchar *m1, stb_uchar *m2, stb_uint maxlen)
|
||||
{
|
||||
stb_uint i;
|
||||
for (i=0; i < maxlen; ++i)
|
||||
if (m1[i] != m2[i]) return i;
|
||||
return i;
|
||||
}
|
||||
|
||||
// simple implementation that just takes the source data in a big block
|
||||
|
||||
static stb_uchar *stb__out;
|
||||
static FILE *stb__outfile;
|
||||
static stb_uint stb__outbytes;
|
||||
|
||||
static void stb__write(unsigned char v)
|
||||
{
|
||||
fputc(v, stb__outfile);
|
||||
++stb__outbytes;
|
||||
}
|
||||
|
||||
//#define stb_out(v) (stb__out ? *stb__out++ = (stb_uchar) (v) : stb__write((stb_uchar) (v)))
|
||||
#define stb_out(v) do { if (stb__out) *stb__out++ = (stb_uchar) (v); else stb__write((stb_uchar) (v)); } while (0)
|
||||
|
||||
static void stb_out2(stb_uint v) { stb_out(v >> 8); stb_out(v); }
|
||||
static void stb_out3(stb_uint v) { stb_out(v >> 16); stb_out(v >> 8); stb_out(v); }
|
||||
static void stb_out4(stb_uint v) { stb_out(v >> 24); stb_out(v >> 16); stb_out(v >> 8 ); stb_out(v); }
|
||||
|
||||
static void outliterals(stb_uchar *in, int numlit)
|
||||
{
|
||||
while (numlit > 65536) {
|
||||
outliterals(in,65536);
|
||||
in += 65536;
|
||||
numlit -= 65536;
|
||||
}
|
||||
|
||||
if (numlit == 0) ;
|
||||
else if (numlit <= 32) stb_out (0x000020 + numlit-1);
|
||||
else if (numlit <= 2048) stb_out2(0x000800 + numlit-1);
|
||||
else /* numlit <= 65536) */ stb_out3(0x070000 + numlit-1);
|
||||
|
||||
if (stb__out) {
|
||||
memcpy(stb__out,in,numlit);
|
||||
stb__out += numlit;
|
||||
} else
|
||||
fwrite(in, 1, numlit, stb__outfile);
|
||||
}
|
||||
|
||||
static int stb__window = 0x40000; // 256K
|
||||
|
||||
static int stb_not_crap(int best, int dist)
|
||||
{
|
||||
return ((best > 2 && dist <= 0x00100)
|
||||
|| (best > 5 && dist <= 0x04000)
|
||||
|| (best > 7 && dist <= 0x80000));
|
||||
}
|
||||
|
||||
static stb_uint stb__hashsize = 32768;
|
||||
|
||||
// note that you can play with the hashing functions all you
|
||||
// want without needing to change the decompressor
|
||||
#define stb__hc(q,h,c) (((h) << 7) + ((h) >> 25) + q[c])
|
||||
#define stb__hc2(q,h,c,d) (((h) << 14) + ((h) >> 18) + (q[c] << 7) + q[d])
|
||||
#define stb__hc3(q,c,d,e) ((q[c] << 14) + (q[d] << 7) + q[e])
|
||||
|
||||
static unsigned int stb__running_adler;
|
||||
|
||||
static int stb_compress_chunk(stb_uchar *history,
|
||||
stb_uchar *start,
|
||||
stb_uchar *end,
|
||||
int length,
|
||||
int *pending_literals,
|
||||
stb_uchar **chash,
|
||||
stb_uint mask)
|
||||
{
|
||||
(void)history;
|
||||
int window = stb__window;
|
||||
stb_uint match_max;
|
||||
stb_uchar *lit_start = start - *pending_literals;
|
||||
stb_uchar *q = start;
|
||||
|
||||
#define STB__SCRAMBLE(h) (((h) + ((h) >> 16)) & mask)
|
||||
|
||||
// stop short of the end so we don't scan off the end doing
|
||||
// the hashing; this means we won't compress the last few bytes
|
||||
// unless they were part of something longer
|
||||
while (q < start+length && q+12 < end) {
|
||||
int m;
|
||||
stb_uint h1,h2,h3,h4, h;
|
||||
stb_uchar *t;
|
||||
int best = 2, dist=0;
|
||||
|
||||
if (q+65536 > end)
|
||||
match_max = (stb_uint)(end-q);
|
||||
else
|
||||
match_max = 65536;
|
||||
|
||||
#define stb__nc(b,d) ((d) <= window && ((b) > 9 || stb_not_crap((int)(b),(int)(d))))
|
||||
|
||||
#define STB__TRY(t,p) /* avoid retrying a match we already tried */ \
|
||||
if (p ? dist != (int)(q-t) : 1) \
|
||||
if ((m = stb_matchlen(t, q, match_max)) > best) \
|
||||
if (stb__nc(m,q-(t))) \
|
||||
best = m, dist = (int)(q - (t))
|
||||
|
||||
// rather than search for all matches, only try 4 candidate locations,
|
||||
// chosen based on 4 different hash functions of different lengths.
|
||||
// this strategy is inspired by LZO; hashing is unrolled here using the
|
||||
// 'hc' macro
|
||||
h = stb__hc3(q,0, 1, 2); h1 = STB__SCRAMBLE(h);
|
||||
t = chash[h1]; if (t) STB__TRY(t,0);
|
||||
h = stb__hc2(q,h, 3, 4); h2 = STB__SCRAMBLE(h);
|
||||
h = stb__hc2(q,h, 5, 6); t = chash[h2]; if (t) STB__TRY(t,1);
|
||||
h = stb__hc2(q,h, 7, 8); h3 = STB__SCRAMBLE(h);
|
||||
h = stb__hc2(q,h, 9,10); t = chash[h3]; if (t) STB__TRY(t,1);
|
||||
h = stb__hc2(q,h,11,12); h4 = STB__SCRAMBLE(h);
|
||||
t = chash[h4]; if (t) STB__TRY(t,1);
|
||||
|
||||
// because we use a shared hash table, can only update it
|
||||
// _after_ we've probed all of them
|
||||
chash[h1] = chash[h2] = chash[h3] = chash[h4] = q;
|
||||
|
||||
if (best > 2)
|
||||
assert(dist > 0);
|
||||
|
||||
// see if our best match qualifies
|
||||
if (best < 3) { // fast path literals
|
||||
++q;
|
||||
} else if (best > 2 && best <= 0x80 && dist <= 0x100) {
|
||||
outliterals(lit_start, (int)(q-lit_start)); lit_start = (q += best);
|
||||
stb_out(0x80 + best-1);
|
||||
stb_out(dist-1);
|
||||
} else if (best > 5 && best <= 0x100 && dist <= 0x4000) {
|
||||
outliterals(lit_start, (int)(q-lit_start)); lit_start = (q += best);
|
||||
stb_out2(0x4000 + dist-1);
|
||||
stb_out(best-1);
|
||||
} else if (best > 7 && best <= 0x100 && dist <= 0x80000) {
|
||||
outliterals(lit_start, (int)(q-lit_start)); lit_start = (q += best);
|
||||
stb_out3(0x180000 + dist-1);
|
||||
stb_out(best-1);
|
||||
} else if (best > 8 && best <= 0x10000 && dist <= 0x80000) {
|
||||
outliterals(lit_start, (int)(q-lit_start)); lit_start = (q += best);
|
||||
stb_out3(0x100000 + dist-1);
|
||||
stb_out2(best-1);
|
||||
} else if (best > 9 && dist <= 0x1000000) {
|
||||
if (best > 65536) best = 65536;
|
||||
outliterals(lit_start, (int)(q-lit_start)); lit_start = (q += best);
|
||||
if (best <= 0x100) {
|
||||
stb_out(0x06);
|
||||
stb_out3(dist-1);
|
||||
stb_out(best-1);
|
||||
} else {
|
||||
stb_out(0x04);
|
||||
stb_out3(dist-1);
|
||||
stb_out2(best-1);
|
||||
}
|
||||
} else { // fallback literals if no match was a balanced tradeoff
|
||||
++q;
|
||||
}
|
||||
}
|
||||
|
||||
// if we didn't get all the way, add the rest to literals
|
||||
if (q-start < length)
|
||||
q = start+length;
|
||||
|
||||
// the literals are everything from lit_start to q
|
||||
*pending_literals = (int)(q - lit_start);
|
||||
|
||||
stb__running_adler = stb_adler32(stb__running_adler, start, (stb_uint)(q - start));
|
||||
return (int)(q - start);
|
||||
}
|
||||
|
||||
static int stb_compress_inner(stb_uchar *input, stb_uint length)
|
||||
{
|
||||
int literals = 0;
|
||||
stb_uint len,i;
|
||||
|
||||
stb_uchar **chash;
|
||||
chash = (stb_uchar**) malloc(stb__hashsize * sizeof(stb_uchar*));
|
||||
if (chash == nullptr) return 0; // failure
|
||||
for (i=0; i < stb__hashsize; ++i)
|
||||
chash[i] = nullptr;
|
||||
|
||||
// stream signature
|
||||
stb_out(0x57); stb_out(0xbc);
|
||||
stb_out2(0);
|
||||
|
||||
stb_out4(0); // 64-bit length requires 32-bit leading 0
|
||||
stb_out4(length);
|
||||
stb_out4(stb__window);
|
||||
|
||||
stb__running_adler = 1;
|
||||
|
||||
len = stb_compress_chunk(input, input, input+length, length, &literals, chash, stb__hashsize-1);
|
||||
assert(len == length);
|
||||
|
||||
outliterals(input+length - literals, literals);
|
||||
|
||||
free(chash);
|
||||
|
||||
stb_out2(0x05fa); // end opcode
|
||||
|
||||
stb_out4(stb__running_adler);
|
||||
|
||||
return 1; // success
|
||||
}
|
||||
|
||||
stb_uint stb_compress(stb_uchar *out, stb_uchar *input, stb_uint length)
|
||||
{
|
||||
stb__out = out;
|
||||
stb__outfile = nullptr;
|
||||
|
||||
stb_compress_inner(input, length);
|
||||
|
||||
return (stb_uint)(stb__out - out);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
# imgui_freetype
|
||||
|
||||
Build font atlases using FreeType instead of stb_truetype (which is the default font rasterizer).
|
||||
<br>by @vuhdo, @mikesart, @ocornut.
|
||||
|
||||
### Usage
|
||||
|
||||
1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype --triplet=x64-windows`, `vcpkg integrate install`).
|
||||
2. Add imgui_freetype.h/cpp alongside your project files.
|
||||
3. Add `#define IMGUI_ENABLE_FREETYPE` in your [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) file
|
||||
|
||||
### About Gamma Correct Blending
|
||||
|
||||
FreeType assumes blending in linear space rather than gamma space.
|
||||
See FreeType note for [FT_Render_Glyph](https://freetype.org/freetype2/docs/reference/ft2-glyph_retrieval.html#ft_render_glyph).
|
||||
For correct results you need to be using sRGB and convert to linear space in the pixel shader output.
|
||||
The default Dear ImGui styles will be impacted by this change (alpha values will need tweaking).
|
||||
|
||||
### Testbed for toying with settings (for developers)
|
||||
|
||||
See https://gist.github.com/ocornut/b3a9ecf13502fd818799a452969649ad
|
||||
|
||||
### Known issues
|
||||
|
||||
- Oversampling settins are ignored but also not so much necessary with the higher quality rendering.
|
||||
|
||||
### Comparison
|
||||
|
||||
Small, thin anti-aliased fonts typically benefit a lot from FreeType's hinting:
|
||||

|
||||
|
||||
### Colorful glyphs/emojis
|
||||
|
||||
You can use the `ImGuiFreeTypeBuilderFlags_LoadColor` flag to load certain colorful glyphs. See the
|
||||
["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md.
|
||||
|
||||

|
||||
@@ -1,29 +0,0 @@
|
||||
// dear imgui: single-file wrapper include
|
||||
// We use this to validate compiling all *.cpp files in a same compilation unit.
|
||||
// Users of that technique (also called "Unity builds") can generally provide this themselves,
|
||||
// so we don't really recommend you use this in your projects.
|
||||
|
||||
// Do this:
|
||||
// #define IMGUI_IMPLEMENTATION
|
||||
// Before you include this file in *one* C++ file to create the implementation.
|
||||
// Using this in your project will leak the contents of imgui_internal.h and ImVec2 operators in this compilation unit.
|
||||
|
||||
#ifdef IMGUI_IMPLEMENTATION
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
|
||||
#include "../../imgui.h"
|
||||
#ifdef IMGUI_ENABLE_FREETYPE
|
||||
#include "../../misc/freetype/imgui_freetype.h"
|
||||
#endif
|
||||
|
||||
#ifdef IMGUI_IMPLEMENTATION
|
||||
#include "../../imgui.cpp"
|
||||
#include "../../imgui_demo.cpp"
|
||||
#include "../../imgui_draw.cpp"
|
||||
#include "../../imgui_tables.cpp"
|
||||
#include "../../imgui_widgets.cpp"
|
||||
#ifdef IMGUI_ENABLE_FREETYPE
|
||||
#include "../../misc/freetype/imgui_freetype.cpp"
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,61 +0,0 @@
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include <imgui_internal.h>
|
||||
#include "..\core.h"
|
||||
|
||||
namespace ImGui {
|
||||
bool Checkbox(const char* label, Option* v) {
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
if (window->SkipItems)
|
||||
return false;
|
||||
|
||||
ImGuiContext& g = *GImGui;
|
||||
const ImGuiStyle& style = g.Style;
|
||||
const ImGuiID id = window->GetID(label);
|
||||
const ImVec2 label_size = CalcTextSize(label, NULL, true);
|
||||
|
||||
const float square_sz = GetFrameHeight();
|
||||
const ImVec2 pos = window->DC.CursorPos;
|
||||
const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
|
||||
ItemSize(total_bb, style.FramePadding.y);
|
||||
if (!ItemAdd(total_bb, id)) {
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (v->GetValue() ? ImGuiItemStatusFlags_Checked : 0));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hovered, held;
|
||||
bool pressed = ButtonBehavior(total_bb, id, &hovered, &held);
|
||||
if (pressed) {
|
||||
v->Toggle();
|
||||
MarkItemEdited(id);
|
||||
}
|
||||
|
||||
const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz));
|
||||
RenderNavHighlight(total_bb, id);
|
||||
RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding);
|
||||
ImU32 check_col = GetColorU32(ImGuiCol_CheckMark);
|
||||
bool mixed_value = (g.LastItemData.InFlags & ImGuiItemFlags_MixedValue) != 0;
|
||||
if (mixed_value) {
|
||||
// Undocumented tristate/mixed/indeterminate checkbox (#2644)
|
||||
// This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox)
|
||||
ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)));
|
||||
window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding);
|
||||
} else if (v->GetValue()) {
|
||||
const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
|
||||
RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f);
|
||||
}
|
||||
|
||||
ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
|
||||
if (g.LogEnabled)
|
||||
LogRenderedText(&label_pos, mixed_value ? "[~]" : v->GetValue() ? "[x]" : "[ ]");
|
||||
if (label_size.x > 0.0f)
|
||||
RenderText(label_pos, label);
|
||||
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (v->GetValue() ? ImGuiItemStatusFlags_Checked : 0));
|
||||
return pressed;
|
||||
}
|
||||
|
||||
void BeginDisabled(bool disabled, Option* v) {
|
||||
BeginDisabled(disabled);
|
||||
v->SetImGuiDisabled(disabled);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
#include "..\core.h"
|
||||
|
||||
namespace ImGui {
|
||||
bool Checkbox(const char* label, Option* v);
|
||||
void BeginDisabled(bool disabled, Option* v);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,36 +0,0 @@
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include <imgui_internal.h>
|
||||
#include "Hotkey.h"
|
||||
|
||||
bool ImGui::isAnyHotkeyBtnPressed = false;
|
||||
Utils::Timer ImGui::timeSinceHotkeyBtnPressed{ 250 };
|
||||
|
||||
void ImGui::Hotkey(std::string_view label, KeyBindOption& key, float samelineOffset, const ImVec2& size) {
|
||||
const auto id = ImGui::GetID(label.data());
|
||||
ImGui::PushID(label.data());
|
||||
|
||||
if (!label.contains("##"))
|
||||
ImGui::Text("%s", label.data());
|
||||
ImGui::SameLine(samelineOffset);
|
||||
|
||||
if (ImGui::GetActiveID() == id) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetColorU32(ImGuiCol_ButtonActive));
|
||||
ImGui::Button("...", size);
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::GetCurrentContext()->ActiveIdAllowOverlap = true;
|
||||
if ((!ImGui::IsItemHovered() && ImGui::GetIO().MouseClicked[0]) || key.SetToPressedKey()) {
|
||||
timeSinceHotkeyBtnPressed = Utils::Timer(250);
|
||||
isAnyHotkeyBtnPressed = false;
|
||||
ImGui::ClearActiveID();
|
||||
}
|
||||
else
|
||||
ImGui::SetActiveID(id, ImGui::GetCurrentWindow());
|
||||
}
|
||||
else if (ImGui::Button(key.ToString(), size)) {
|
||||
isAnyHotkeyBtnPressed = true;
|
||||
ImGui::SetActiveID(id, ImGui::GetCurrentWindow());
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
#include <imgui.h>
|
||||
#include "..\..\core.h"
|
||||
#include "..\utils.h"
|
||||
|
||||
namespace ImGui {
|
||||
extern bool isAnyHotkeyBtnPressed;
|
||||
extern Utils::Timer timeSinceHotkeyBtnPressed;
|
||||
|
||||
void Hotkey(std::string_view label, KeyBindOption& key, float samelineOffset = 0.0f, const ImVec2& size = { 0.0f, 0.0f });
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include <chrono>
|
||||
#include <iomanip>
|
||||
|
||||
template <class result_t = std::chrono::milliseconds, class clock_t = std::chrono::steady_clock, class duration_t = std::chrono::milliseconds> auto since(std::chrono::time_point<clock_t, duration_t> const& start) {
|
||||
return std::chrono::duration_cast<result_t>(clock_t::now() - start);
|
||||
}
|
||||
|
||||
inline std::ostringstream GetTimestamp() {
|
||||
time_t timeInstance = time(0);
|
||||
tm timestamp{};
|
||||
localtime_s(×tamp, &timeInstance);
|
||||
std::ostringstream oss{};
|
||||
oss << "[" << std::setw(2) << std::setfill('0') << timestamp.tm_hour << "h:"
|
||||
<< std::setw(2) << std::setfill('0') << timestamp.tm_min << "m:"
|
||||
<< std::setw(2) << std::setfill('0') << timestamp.tm_sec << "s] ";
|
||||
|
||||
return oss;
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
#include <MinHook.h>
|
||||
#include <Windows.h>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include "ImGui\impl\d3d11_impl.h"
|
||||
#include "ImGui\impl\d3d12_impl.h"
|
||||
#include "config\config.h"
|
||||
#include "game_classes.h"
|
||||
#include "hook.h"
|
||||
#include "kiero.h"
|
||||
#include "menu\menu.h"
|
||||
#include "sigscan\offsets.h"
|
||||
|
||||
#pragma region KeyBindOption
|
||||
bool KeyBindOption::wasAnyKeyPressed = false;
|
||||
#pragma endregion
|
||||
|
||||
namespace Core {
|
||||
// Console stuff
|
||||
static void DisableConsoleQuickEdit() {
|
||||
DWORD prev_mode = 0;
|
||||
const HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
GetConsoleMode(hInput, &prev_mode);
|
||||
SetConsoleMode(hInput, prev_mode & ENABLE_EXTENDED_FLAGS);
|
||||
}
|
||||
|
||||
static FILE* f = nullptr;
|
||||
static void EnableConsole() {
|
||||
AllocConsole();
|
||||
SetConsoleTitle("EGameTools");
|
||||
freopen_s(&f, "CONOUT$", "w", stdout);
|
||||
DisableConsoleQuickEdit();
|
||||
}
|
||||
void DisableConsole() {
|
||||
if (f)
|
||||
fclose(f);
|
||||
FreeConsole();
|
||||
}
|
||||
|
||||
// Core
|
||||
bool exiting = false;
|
||||
static bool createdConfigThread = false;
|
||||
|
||||
std::thread hookRendererThread{};
|
||||
std::thread configLoopThread{};
|
||||
std::thread configSaveLoopThread{};
|
||||
|
||||
static std::string_view rendererAPI{};
|
||||
static void LoopHookRenderer() {
|
||||
while (true) {
|
||||
if (exiting)
|
||||
return;
|
||||
|
||||
Sleep(1000);
|
||||
|
||||
if (rendererAPI.empty())
|
||||
continue;
|
||||
|
||||
if (kiero::init(rendererAPI == "d3d11" ? kiero::RenderType::D3D11 : kiero::RenderType::D3D12) != kiero::Status::Success)
|
||||
continue;
|
||||
|
||||
switch (kiero::getRenderType()) {
|
||||
case kiero::RenderType::D3D11:
|
||||
impl::d3d11::init();
|
||||
break;
|
||||
case kiero::RenderType::D3D12:
|
||||
impl::d3d12::init();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma region GetRendererAPI
|
||||
static bool(*pReadVideoSettings)(LPVOID instance, LPVOID file, bool flag1) = nullptr;
|
||||
static bool(*oReadVideoSettings)(LPVOID instance, LPVOID file, bool flag1) = nullptr;
|
||||
bool detourReadVideoSettings(LPVOID instance, LPVOID file, bool flag1) {
|
||||
if (!rendererAPI.empty())
|
||||
return oReadVideoSettings(instance, file, flag1);
|
||||
|
||||
DWORD renderer = *reinterpret_cast<PDWORD>(reinterpret_cast<DWORD64>(instance) + 0x7C);
|
||||
rendererAPI = !renderer ? "d3d11" : "d3d12";
|
||||
|
||||
return oReadVideoSettings(instance, file, flag1);
|
||||
}
|
||||
void LoopHookReadVideoSettings() {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
|
||||
if (!pReadVideoSettings)
|
||||
pReadVideoSettings = (decltype(pReadVideoSettings))Offsets::Get_ReadVideoSettings();
|
||||
else if (!oReadVideoSettings && MH_CreateHook(pReadVideoSettings, &detourReadVideoSettings, reinterpret_cast<LPVOID*>(&oReadVideoSettings)) == MH_OK) {
|
||||
MH_EnableHook(pReadVideoSettings);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
void OnPostUpdate() {
|
||||
if (!createdConfigThread) {
|
||||
configLoopThread = std::thread(Config::ConfigLoop);
|
||||
configLoopThread.detach();
|
||||
configSaveLoopThread = std::thread(Config::ConfigSaveLoop);
|
||||
configSaveLoopThread.detach();
|
||||
|
||||
createdConfigThread = true;
|
||||
}
|
||||
|
||||
if (!GamePH::PlayerVariables::gotPlayerVars)
|
||||
GamePH::PlayerVariables::GetPlayerVars();
|
||||
|
||||
for (auto& menuTab : *Menu::MenuTab::GetInstances())
|
||||
menuTab.second->Update();
|
||||
|
||||
/*Engine::CRTTI* g_BackgroundModuleScreenController = GamePH::BackgroundModuleScreenController::Get();
|
||||
if (!g_BackgroundModuleScreenController)
|
||||
return;
|
||||
|
||||
Engine::CRTTIField* field = g_BackgroundModuleScreenController->FindField("m_LoadingProgress");
|
||||
if (!field)
|
||||
return;
|
||||
*/
|
||||
}
|
||||
|
||||
DWORD64 WINAPI MainThread(HMODULE hModule) {
|
||||
EnableConsole();
|
||||
|
||||
Config::InitConfig();
|
||||
GamePH::PlayerVariables::SortPlayerVars();
|
||||
|
||||
MH_Initialize();
|
||||
LoopHookReadVideoSettings();
|
||||
|
||||
hookRendererThread = std::thread(LoopHookRenderer);
|
||||
hookRendererThread.detach();
|
||||
|
||||
for (auto& hook : *Hook::HookBase::GetInstances())
|
||||
hook->HookLoop();
|
||||
for (auto& hook : *Hook::HookBase::GetInstances())
|
||||
hook->HookLoop();
|
||||
|
||||
const HANDLE proc = GetCurrentProcess();
|
||||
WaitForSingleObject(proc, INFINITE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void Cleanup() {
|
||||
exiting = true;
|
||||
|
||||
Config::SaveConfig();
|
||||
|
||||
MH_DisableHook(MH_ALL_HOOKS);
|
||||
MH_Uninitialize();
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#include "core.h"
|
||||
|
||||
static HANDLE hMainThread{};
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD64 ul_reason_for_call, LPVOID lpReserved) {
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH: {
|
||||
DisableThreadLibraryCalls(hModule);
|
||||
hMainThread = CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)Core::MainThread, hModule, 0, nullptr);
|
||||
|
||||
if (!hMainThread)
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
case DLL_PROCESS_DETACH:
|
||||
Core::Cleanup();
|
||||
Core::DisableConsole();
|
||||
|
||||
if (hMainThread)
|
||||
CloseHandle(hMainThread);
|
||||
FreeLibraryAndExitThread(hModule, 0);
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1,965 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include "config\config.h"
|
||||
#include "game_classes.h"
|
||||
#include "memory.h"
|
||||
#include "menu\camera.h"
|
||||
#include "menu\misc.h"
|
||||
#include "menu\player.h"
|
||||
#include "print.h"
|
||||
#include "sigscan\offsets.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace Core {
|
||||
extern void OnPostUpdate();
|
||||
}
|
||||
|
||||
#pragma region GamePH
|
||||
namespace GamePH {
|
||||
#pragma region Hooks
|
||||
// Forward decl
|
||||
static DWORD64 detourCreatePlayerHealthModule(DWORD64 playerHealthModule);
|
||||
static void detourOnPostUpdate(LPVOID pGameDI_PH2);
|
||||
static DWORD64 detourCalculateFreeCamCollision(LPVOID pFreeCamera, float* finalPos);
|
||||
static void detourLifeSetHealth(float* pLifeHealth, float health);
|
||||
static void detourTogglePhotoMode(LPVOID guiPhotoModeData, bool enabled);
|
||||
static void detourShowTPPModelFunc3(DWORD64 a1, bool showTPPModel);
|
||||
static void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos);
|
||||
static bool detourIsNotOutOfBounds(LPVOID pInstance, DWORD64 a2);
|
||||
static void detourShowUIManager(LPVOID pLevelDI, bool enabled);
|
||||
|
||||
#pragma region CreatePlayerHealthModule
|
||||
static Hook::MHook<LPVOID, DWORD64(*)(DWORD64)> CreatePlayerHealthModuleHook{ &Offsets::Get_CreatePlayerHealthModule, &detourCreatePlayerHealthModule };
|
||||
|
||||
static DWORD64 detourCreatePlayerHealthModule(DWORD64 playerHealthModule) {
|
||||
PlayerHealthModule::pPlayerHealthModule = reinterpret_cast<PlayerHealthModule*>(playerHealthModule);
|
||||
return CreatePlayerHealthModuleHook.pOriginal(playerHealthModule);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region OnPostUpdate
|
||||
static Hook::VTHook<GamePH::GameDI_PH2*, void(*)(LPVOID)> OnPostUpdateHook{ &GamePH::GameDI_PH2::Get, &detourOnPostUpdate, 0x3A8 };
|
||||
|
||||
static void detourOnPostUpdate(LPVOID pGameDI_PH2) {
|
||||
OnPostUpdateHook.pOriginal(pGameDI_PH2);
|
||||
Core::OnPostUpdate();
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CalculateFreeCamCollision
|
||||
static Hook::MHook<LPVOID, DWORD64(*)(LPVOID, float*)> CalculateFreeCamCollisionHook{ &Offsets::Get_CalculateFreeCamCollision, &detourCalculateFreeCamCollision };
|
||||
|
||||
static DWORD64 detourCalculateFreeCamCollision(LPVOID pFreeCamera, float* finalPos) {
|
||||
if (Menu::Camera::disablePhotoModeLimits.GetValue() || Menu::Camera::freeCam.GetValue())
|
||||
return 0;
|
||||
|
||||
return CalculateFreeCamCollisionHook.pOriginal(pFreeCamera, finalPos);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region LifeSetHealth
|
||||
static Hook::MHook<LPVOID, void(*)(float*, float)> LifeSetHealthHook{ &Offsets::Get_LifeSetHealth, &detourLifeSetHealth };
|
||||
|
||||
static void detourLifeSetHealth(float* pLifeHealth, float health) {
|
||||
if (!Menu::Player::godMode.GetValue() && !Menu::Camera::freeCam.GetValue())
|
||||
return LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
|
||||
GamePH::PlayerHealthModule* playerHealthModule = GamePH::PlayerHealthModule::Get();
|
||||
if (!playerHealthModule)
|
||||
return LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
|
||||
if (std::abs(reinterpret_cast<LONG64>(playerHealthModule) - reinterpret_cast<LONG64>(pLifeHealth)) < 0x100 && playerHealthModule->health > 0.0f)
|
||||
return;
|
||||
|
||||
LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region TogglePhotoMode
|
||||
static Hook::MHook<LPVOID, void(*)(LPVOID, bool)> TogglePhotoModeHook{ &Offsets::Get_TogglePhotoMode, &detourTogglePhotoMode };
|
||||
|
||||
static void detourTogglePhotoMode(LPVOID guiPhotoModeData, bool enabled) {
|
||||
Menu::Camera::photoMode.Set(enabled);
|
||||
|
||||
if (!Menu::Camera::freeCam.GetValue())
|
||||
return TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
GamePH::GameDI_PH* pGameDI_PH = GamePH::GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
return TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
GamePH::FreeCamera* pFreeCam = GamePH::FreeCamera::Get();
|
||||
if (!pFreeCam)
|
||||
return TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
|
||||
if (enabled) {
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(0);
|
||||
}
|
||||
|
||||
TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ShowTPPModelFunc3
|
||||
static Option wannaUseTPPModel{};
|
||||
static Hook::MHook<LPVOID, void(*)(DWORD64, bool)> ShowTPPModelFunc3Hook{ &Offsets::Get_ShowTPPModelFunc3, &detourShowTPPModelFunc3 };
|
||||
|
||||
static void detourShowTPPModelFunc3(DWORD64 a1, bool showTPPModel) {
|
||||
wannaUseTPPModel.Set(showTPPModel);
|
||||
|
||||
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
|
||||
if (!pgen_TPPModel) {
|
||||
ShowTPPModelFunc3Hook.pOriginal(a1, showTPPModel);
|
||||
return;
|
||||
}
|
||||
if (wannaUseTPPModel.HasChangedTo(false)) {
|
||||
wannaUseTPPModel.SetPrevValue(false);
|
||||
pgen_TPPModel->enableTPPModel2 = true;
|
||||
pgen_TPPModel->enableTPPModel1 = true;
|
||||
}
|
||||
ShowTPPModelFunc3Hook.pOriginal(a1, showTPPModel);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MoveCameraFromForwardUpPos
|
||||
static Hook::MHook<LPVOID, void(*)(LPVOID, float*, float*, Vector3*)> MoveCameraFromForwardUpPosHook{ &Offsets::Get_MoveCameraFromForwardUpPos, &detourMoveCameraFromForwardUpPos };
|
||||
|
||||
static void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos) {
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
|
||||
if (pgen_TPPModel) {
|
||||
if (wannaUseTPPModel.GetValue()) {
|
||||
wannaUseTPPModel.SetPrevValue(true);
|
||||
if (Menu::Camera::thirdPersonCamera.GetValue() && Menu::Camera::tpUseTPPModel.GetValue()) {
|
||||
pgen_TPPModel->enableTPPModel2 = false;
|
||||
pgen_TPPModel->enableTPPModel1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (Menu::Camera::photoMode.HasChangedTo(false) && !wannaUseTPPModel.GetValue()) {
|
||||
if (!Menu::Camera::freeCam.GetValue() && !Menu::Camera::tpUseTPPModel.GetValue()) {
|
||||
Menu::Camera::photoMode.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::freeCam.GetValue() || (Menu::Camera::tpUseTPPModel.GetValue() && Menu::Camera::thirdPersonCamera.GetValue())) {
|
||||
Menu::Camera::photoMode.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::photoMode.HasChangedTo(true)) {
|
||||
Menu::Camera::photoMode.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
} else if (Menu::Camera::freeCam.HasChangedTo(false)) {
|
||||
if (!Menu::Camera::photoMode.GetValue() && !Menu::Camera::thirdPersonCamera.GetValue()) {
|
||||
Menu::Camera::freeCam.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::photoMode.GetValue() || (Menu::Camera::tpUseTPPModel.GetValue() && Menu::Camera::thirdPersonCamera.GetValue())) {
|
||||
Menu::Camera::freeCam.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::freeCam.HasChangedTo(true)) {
|
||||
Menu::Camera::freeCam.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
} else if (Menu::Camera::thirdPersonCamera.HasChangedTo(false)) {
|
||||
if (!Menu::Camera::freeCam.GetValue() && !Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::thirdPersonCamera.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::freeCam.GetValue() || Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::thirdPersonCamera.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::thirdPersonCamera.HasChangedTo(true) && Menu::Camera::tpUseTPPModel.GetValue()) {
|
||||
Menu::Camera::thirdPersonCamera.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
} else if (Menu::Camera::tpUseTPPModel.HasChangedTo(false)) {
|
||||
if (!Menu::Camera::freeCam.GetValue() && !Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::tpUseTPPModel.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::freeCam.GetValue() || Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::tpUseTPPModel.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::tpUseTPPModel.HasChangedTo(true) && Menu::Camera::thirdPersonCamera.GetValue()) {
|
||||
Menu::Camera::tpUseTPPModel.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Menu::Camera::thirdPersonCamera.GetValue() || Menu::Camera::photoMode.GetValue() || Menu::Camera::freeCam.GetValue() || !pos)
|
||||
return MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
CameraFPPDI* viewCam = static_cast<CameraFPPDI*>(iLevel->GetViewCamera());
|
||||
if (!viewCam)
|
||||
return MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
Vector3 forwardVec{};
|
||||
viewCam->GetForwardVector(&forwardVec);
|
||||
const Vector3 normForwardVec = forwardVec.normalize();
|
||||
|
||||
Vector3 newCamPos = *pos - normForwardVec * -Menu::Camera::tpDistanceBehindPlayer;
|
||||
newCamPos.Y += Menu::Camera::tpHeightAbovePlayer - 1.5f;
|
||||
|
||||
*pos = newCamPos;
|
||||
|
||||
MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region IsNotOutOfBounds
|
||||
static Hook::MHook<LPVOID, bool(*)(LPVOID, DWORD64)> IsNotOutOfBoundsHook{ &Offsets::Get_IsNotOutOfBounds, &detourIsNotOutOfBounds };
|
||||
|
||||
static bool detourIsNotOutOfBounds(LPVOID pInstance, DWORD64 a2) {
|
||||
if (Menu::Player::disableOutOfBoundsTimer.GetValue())
|
||||
return true;
|
||||
|
||||
return IsNotOutOfBoundsHook.pOriginal(pInstance, a2);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ShowUIManager
|
||||
static LPVOID GetShowUIManager() {
|
||||
return Utils::GetProcAddr("engine_x64_rwdi.dll", "?ShowUIManager@ILevel@@QEAAX_N@Z");
|
||||
}
|
||||
static Hook::MHook<LPVOID, void(*)(LPVOID, bool)> ShowUIManagerHook{ &GetShowUIManager, &detourShowUIManager };
|
||||
|
||||
static void detourShowUIManager(LPVOID pLevelDI, bool enabled) {
|
||||
if (Menu::Misc::disableHUD.GetValue())
|
||||
enabled = false;
|
||||
|
||||
ShowUIManagerHook.pOriginal(pLevelDI, enabled);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region OtherFuncs
|
||||
static DWORD64 ShowTPPModelFunc2(LPVOID a1) {
|
||||
DWORD64(*pShowTPPModelFunc2)(LPVOID a1) = (decltype(pShowTPPModelFunc2))Offsets::Get_ShowTPPModelFunc2();
|
||||
if (!pShowTPPModelFunc2)
|
||||
return 0;
|
||||
|
||||
return pShowTPPModelFunc2(a1);
|
||||
}
|
||||
void ShowTPPModel(bool showTPPModel) {
|
||||
GameDI_PH* pGameDI_PH = GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
return;
|
||||
DWORD64 tppFunc2Addr = ShowTPPModelFunc2(pGameDI_PH);
|
||||
if (!tppFunc2Addr)
|
||||
return;
|
||||
if (!ShowTPPModelFunc3Hook.pTarget)
|
||||
return;
|
||||
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
|
||||
if (!pgen_TPPModel)
|
||||
return;
|
||||
|
||||
ShowTPPModelFunc3Hook.pTarget(tppFunc2Addr, showTPPModel);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerVariables
|
||||
static const int FLOAT_VAR_OFFSET = 3;
|
||||
static const int BOOL_VAR_OFFSET = 2;
|
||||
static const int VAR_LOC_OFFSET = 1;
|
||||
|
||||
std::vector<std::pair<std::string, std::pair<LPVOID, std::string>>> PlayerVariables::playerVars;
|
||||
std::vector<std::pair<std::string, std::pair<std::any, std::string>>> PlayerVariables::playerVarsDefault;
|
||||
std::vector<std::pair<std::string, std::pair<std::any, std::string>>> PlayerVariables::playerCustomVarsDefault;
|
||||
bool PlayerVariables::gotPlayerVars = false;
|
||||
|
||||
static PDWORD64 getFloatPlayerVariableVT() {
|
||||
if (!Offsets::Get_InitializePlayerVariables())
|
||||
return nullptr;
|
||||
|
||||
const DWORD64 offsetToInstr = Offsets::Get_InitializePlayerVariables() + Offsets::Get_initPlayerFloatVarsInstr_offset() + 0x3; // 0x3 is instruction size
|
||||
const DWORD floatPlayerVariableVTOffset = *reinterpret_cast<DWORD*>(offsetToInstr);
|
||||
|
||||
return reinterpret_cast<PDWORD64>(offsetToInstr + sizeof(DWORD) + floatPlayerVariableVTOffset);
|
||||
}
|
||||
static PDWORD64 getBoolPlayerVariableVT() {
|
||||
if (!Offsets::Get_InitializePlayerVariables())
|
||||
return nullptr;
|
||||
|
||||
const DWORD64 offsetToInstr = Offsets::Get_InitializePlayerVariables() + Offsets::Get_initPlayerBoolVarsInstr_offset() + 0x3; // 0x3 is instruction size
|
||||
const DWORD boolPlayerVariableVTOffset = *reinterpret_cast<DWORD*>(offsetToInstr);
|
||||
|
||||
return reinterpret_cast<PDWORD64>(offsetToInstr + sizeof(DWORD) + boolPlayerVariableVTOffset);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static void updateDefaultVar(std::vector<std::pair<std::string, std::pair<std::any, std::string>>>& defaultVars, const std::string& varName, T varValue) {
|
||||
static_assert(std::is_same<T, float>::value || std::is_same<T, bool>::value, "Invalid type: value must be float or bool");
|
||||
|
||||
auto it = std::find_if(defaultVars.begin(), defaultVars.end(), [&varName](const auto& pair) {
|
||||
return pair.first == varName;
|
||||
});
|
||||
if (it == defaultVars.end())
|
||||
return;
|
||||
|
||||
it->second.first.template emplace<T>(varValue);
|
||||
}
|
||||
static void processPlayerVar(PDWORD64*& playerVarsMem, std::pair<std::string, std::pair<LPVOID, std::string>>& var) {
|
||||
while (true) {
|
||||
const bool isFloatPlayerVar = *playerVarsMem == getFloatPlayerVariableVT();
|
||||
const bool isBoolPlayerVar = *playerVarsMem == getBoolPlayerVariableVT();
|
||||
|
||||
if (isFloatPlayerVar || isBoolPlayerVar) {
|
||||
var.second.first = playerVarsMem + VAR_LOC_OFFSET;
|
||||
const std::string& varName = var.first;
|
||||
|
||||
if (isFloatPlayerVar) {
|
||||
float* varValue = reinterpret_cast<float*>(var.second.first);
|
||||
updateDefaultVar(GamePH::PlayerVariables::playerVarsDefault, varName, *varValue);
|
||||
updateDefaultVar(GamePH::PlayerVariables::playerCustomVarsDefault, varName, *varValue);
|
||||
|
||||
playerVarsMem += FLOAT_VAR_OFFSET;
|
||||
}
|
||||
else {
|
||||
bool* varValue = reinterpret_cast<bool*>(var.second.first);
|
||||
updateDefaultVar(GamePH::PlayerVariables::playerVarsDefault, varName, *varValue);
|
||||
updateDefaultVar(GamePH::PlayerVariables::playerCustomVarsDefault, varName, *varValue);
|
||||
|
||||
playerVarsMem += BOOL_VAR_OFFSET;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
playerVarsMem += 1;
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerVariables::GetPlayerVars() {
|
||||
if (gotPlayerVars)
|
||||
return;
|
||||
if (!Get())
|
||||
return;
|
||||
if (playerVars.empty())
|
||||
return;
|
||||
if (!getFloatPlayerVariableVT())
|
||||
return;
|
||||
if (!getBoolPlayerVariableVT())
|
||||
return;
|
||||
|
||||
PDWORD64* playerVarsMem = reinterpret_cast<PDWORD64*>(Get());
|
||||
|
||||
for (auto& var : playerVars)
|
||||
processPlayerVar(playerVarsMem, var);
|
||||
|
||||
gotPlayerVars = true;
|
||||
}
|
||||
void PlayerVariables::SortPlayerVars() {
|
||||
if (!playerVars.empty())
|
||||
return;
|
||||
|
||||
std::stringstream ss(Config::playerVars);
|
||||
|
||||
while (ss.good()) {
|
||||
// separate the string by the , character to get each variable
|
||||
std::string pVar{};
|
||||
getline(ss, pVar, ',');
|
||||
|
||||
std::stringstream ssPVar(pVar);
|
||||
|
||||
std::string varName{};
|
||||
std::string varType{};
|
||||
|
||||
while (ssPVar.good()) {
|
||||
// seperate the string by the : character to get name and type of variable
|
||||
std::string subStr{};
|
||||
getline(ssPVar, subStr, ':');
|
||||
|
||||
if (subStr != "float" && subStr != "bool")
|
||||
varName = subStr;
|
||||
else
|
||||
varType = subStr;
|
||||
}
|
||||
|
||||
PlayerVariables::playerVars.emplace_back(varName, std::make_pair(nullptr, varType));
|
||||
PlayerVariables::playerVarsDefault.emplace_back(varName, std::make_pair(varType == "float" ? 0.0f : false, varType));
|
||||
PlayerVariables::playerCustomVarsDefault.emplace_back(varName, std::make_pair(varType == "float" ? 0.0f : false, varType));
|
||||
}
|
||||
}
|
||||
|
||||
PlayerVariables* PlayerVariables::Get() {
|
||||
__try {
|
||||
PlayerState* pPlayerState = PlayerState::Get();
|
||||
if (!pPlayerState)
|
||||
return nullptr;
|
||||
|
||||
PlayerVariables* ptr = pPlayerState->playerVars;
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerState
|
||||
PlayerState* PlayerState::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_PlayerState())
|
||||
return nullptr;
|
||||
|
||||
PlayerState* ptr = *reinterpret_cast<PlayerState**>(Offsets::Get_PlayerState());
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerHealthModule
|
||||
PlayerHealthModule* PlayerHealthModule::pPlayerHealthModule = nullptr;
|
||||
PlayerHealthModule* PlayerHealthModule::Get() {
|
||||
__try {
|
||||
if (!pPlayerHealthModule)
|
||||
return nullptr;
|
||||
if (!*reinterpret_cast<LPVOID*>(pPlayerHealthModule))
|
||||
return nullptr;
|
||||
|
||||
return pPlayerHealthModule;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
pPlayerHealthModule = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region TPPCameraDI
|
||||
TPPCameraDI* TPPCameraDI::Get() {
|
||||
__try {
|
||||
FreeCamera* pFreeCam = FreeCamera::Get();
|
||||
if (!pFreeCam)
|
||||
return nullptr;
|
||||
|
||||
CoBaseCameraProxy* pCoBaseCameraProxy = pFreeCam->pCoBaseCameraProxy;
|
||||
if (!pCoBaseCameraProxy)
|
||||
return nullptr;
|
||||
|
||||
TPPCameraDI* ptr = pCoBaseCameraProxy->pTPPCameraDI;
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CameraFPPDI
|
||||
Vector3* CameraFPPDI::GetForwardVector(Vector3* outForwardVec) {
|
||||
Vector3* (*pGetForwardVector)(LPVOID pCameraFPPDI, Vector3 * outForwardVec) = (decltype(pGetForwardVector))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetForwardVector@IBaseCamera@@QEBA?BVvec3@@XZ");
|
||||
if (!pGetForwardVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetForwardVector(this, outForwardVec);
|
||||
}
|
||||
Vector3* CameraFPPDI::GetPosition(Vector3* posIN) {
|
||||
return Memory::CallVT<181, Vector3*>(this, posIN);
|
||||
}
|
||||
|
||||
/*CameraFPPDI* CameraFPPDI::Get() {
|
||||
__try {
|
||||
PDWORD64 pg_CameraFPPDI = Offsets::Get_g_CameraFPPDI();
|
||||
if (!pg_CameraFPPDI)
|
||||
return nullptr;
|
||||
|
||||
CameraFPPDI* ptr = reinterpret_cast<CameraFPPDI*>(*pg_CameraFPPDI);
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}*/
|
||||
#pragma endregion
|
||||
|
||||
#pragma region FreeCamera
|
||||
Vector3* FreeCamera::GetForwardVector(Vector3* outForwardVec) {
|
||||
Vector3* (*pGetForwardVector)(LPVOID pFreeCamera, Vector3 * outForwardVec) = (decltype(pGetForwardVector))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetForwardVector@IBaseCamera@@QEBA?BVvec3@@XZ");
|
||||
if (!pGetForwardVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetForwardVector(this, outForwardVec);
|
||||
}
|
||||
Vector3* FreeCamera::GetPosition(Vector3* posIN) {
|
||||
return Memory::CallVT<181, Vector3*>(this, posIN);
|
||||
}
|
||||
void FreeCamera::AllowCameraMovement(int mode) {
|
||||
Memory::CallVT<187>(this, mode);
|
||||
}
|
||||
|
||||
FreeCamera* FreeCamera::Get() {
|
||||
__try {
|
||||
PDWORD64 pg_FreeCamera = Offsets::Get_g_FreeCamera();
|
||||
if (!pg_FreeCamera)
|
||||
return nullptr;
|
||||
|
||||
FreeCamera* ptr = reinterpret_cast<FreeCamera*>(*pg_FreeCamera);
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region DayNightCycle
|
||||
void DayNightCycle::SetDaytime(float time) {
|
||||
time /= 24;
|
||||
time1 = time;
|
||||
time2 = time;
|
||||
time3 = time;
|
||||
}
|
||||
|
||||
DayNightCycle* DayNightCycle::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_g_DayNightCycle())
|
||||
return nullptr;
|
||||
|
||||
DayNightCycle* ptr = *reinterpret_cast<DayNightCycle**>(Offsets::Get_g_DayNightCycle());
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region TimeWeather
|
||||
namespace TimeWeather {
|
||||
#pragma region CSystem
|
||||
void CSystem::SetForcedWeather(int weather) {
|
||||
void(*pSetForcedWeather)(LPVOID timeWeatherSystem, int weather) = (decltype(pSetForcedWeather))Utils::GetProcAddr("engine_x64_rwdi.dll", "?SetForcedWeather@CSystem@TimeWeather@@QEAAXW4TYPE@EWeather@@VApiDebugAccess@2@@Z");
|
||||
if (!pSetForcedWeather)
|
||||
return;
|
||||
|
||||
pSetForcedWeather(this, weather);
|
||||
}
|
||||
int CSystem::GetCurrentWeather() {
|
||||
int(*pGetCurrentWeather)(LPVOID timeWeatherSystem) = (decltype(pGetCurrentWeather))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetCurrentWeather@CSystem@TimeWeather@@QEBA?AW4TYPE@EWeather@@XZ");
|
||||
if (!pGetCurrentWeather)
|
||||
return EWeather::TYPE::Default;
|
||||
|
||||
return pGetCurrentWeather(this);
|
||||
}
|
||||
|
||||
CSystem* CSystem::Get() {
|
||||
__try {
|
||||
LevelDI* pLevelDI = LevelDI::Get();
|
||||
if (!pLevelDI)
|
||||
return nullptr;
|
||||
|
||||
CSystem* ptr = pLevelDI->GetTimeWeatherSystem();
|
||||
if (!Memory::IsValidPtr(ptr))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region LevelDI
|
||||
bool LevelDI::IsLoading() {
|
||||
bool(*pIsLoading)(LPVOID iLevel) = (decltype(pIsLoading))Utils::GetProcAddr("engine_x64_rwdi.dll", "?IsLoading@ILevel@@QEBA_NXZ");
|
||||
if (!pIsLoading)
|
||||
return true;
|
||||
|
||||
return pIsLoading(this);
|
||||
}
|
||||
bool LevelDI::IsLoaded() {
|
||||
static float loadDeltaTime = 0.0f;
|
||||
if (IsLoading() || !GamePH::PlayerObjProperties::Get()) {
|
||||
loadDeltaTime = 0.0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
loadDeltaTime += GetTimeDelta();
|
||||
if (loadDeltaTime > 3.0f)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
LPVOID LevelDI::GetViewCamera() {
|
||||
LPVOID(*pGetViewCamera)(LPVOID iLevel) = (decltype(pGetViewCamera))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetViewCamera@ILevel@@QEBAPEAVIBaseCamera@@XZ");
|
||||
if (!pGetViewCamera)
|
||||
return nullptr;
|
||||
|
||||
return pGetViewCamera(this);
|
||||
}
|
||||
float LevelDI::GetTimeDelta() {
|
||||
return Memory::CallVT<176, float>(this);
|
||||
}
|
||||
void LevelDI::SetViewCamera(LPVOID viewCam) {
|
||||
Memory::CallVT<289, void>(this, viewCam);
|
||||
}
|
||||
float LevelDI::GetTimePlayed() {
|
||||
return Memory::CallVT<317, float>(this);
|
||||
}
|
||||
void LevelDI::ShowUIManager(bool enabled) {
|
||||
void(*pShowUIManager)(LPVOID iLevel, bool enabled) = (decltype(pShowUIManager))Utils::GetProcAddr("engine_x64_rwdi.dll", "?ShowUIManager@ILevel@@QEAAX_N@Z");
|
||||
if (!pShowUIManager)
|
||||
return;
|
||||
|
||||
pShowUIManager(this, enabled);
|
||||
}
|
||||
TimeWeather::CSystem* LevelDI::GetTimeWeatherSystem() {
|
||||
TimeWeather::CSystem*(*pGetTimeWeatherSystem)(LevelDI* iLevel) = (decltype(pGetTimeWeatherSystem))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetTimeWeatherSystem@ILevel@@QEBAPEAVCSystem@TimeWeather@@XZ");
|
||||
if (!pGetTimeWeatherSystem)
|
||||
return nullptr;
|
||||
|
||||
return pGetTimeWeatherSystem(this);
|
||||
}
|
||||
|
||||
LevelDI* LevelDI::Get() {
|
||||
__try {
|
||||
Engine::CLevel* pCLevel = Engine::CLevel::Get();
|
||||
if (!pCLevel)
|
||||
return nullptr;
|
||||
|
||||
LevelDI* ptr = pCLevel->pLevelDI;
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region gen_TPPModel
|
||||
gen_TPPModel* gen_TPPModel::Get() {
|
||||
__try {
|
||||
LocalClientDI* pLocalClientDI = LocalClientDI::Get();
|
||||
if (!pLocalClientDI)
|
||||
return nullptr;
|
||||
|
||||
gen_TPPModel* ptr = pLocalClientDI->pgen_TPPModel;
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region LocalClientDI
|
||||
LocalClientDI* LocalClientDI::Get() {
|
||||
__try {
|
||||
SessionCooperativeDI* pSessionCooperativeDI = SessionCooperativeDI::Get();
|
||||
if (!pSessionCooperativeDI)
|
||||
return nullptr;
|
||||
|
||||
LocalClientDI* ptr = pSessionCooperativeDI->pLocalClientDI;
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region SessionCooperativeDI
|
||||
SessionCooperativeDI* SessionCooperativeDI::Get() {
|
||||
__try {
|
||||
GameDI_PH* pGameDI_PH = GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
return nullptr;
|
||||
|
||||
SessionCooperativeDI* ptr = pGameDI_PH->pSessionCooperativeDI;
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region GameDI_PH2
|
||||
GameDI_PH2* GameDI_PH2::Get() {
|
||||
__try {
|
||||
GameDI_PH* pGameDI_PH = GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
return nullptr;
|
||||
|
||||
GameDI_PH2* ptr = reinterpret_cast<GameDI_PH2*>(reinterpret_cast<DWORD64>(pGameDI_PH) + Offsets::Get_gameDI_PH2_offset());
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region GameDI_PH
|
||||
float GameDI_PH::GetGameTimeDelta() {
|
||||
float(*pGetGameTimeDelta)(LPVOID pGameDI_PH) = (decltype(pGetGameTimeDelta))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetGameTimeDelta@IGame@@QEBAMXZ");
|
||||
if (!pGetGameTimeDelta)
|
||||
return -1.0f;
|
||||
|
||||
return pGetGameTimeDelta(this);
|
||||
}
|
||||
DWORD64 GameDI_PH::GetCurrentGameVersion() {
|
||||
return Memory::CallVT<225, DWORD64>(this);
|
||||
}
|
||||
void GameDI_PH::TogglePhotoMode(bool doNothing, bool setAsOptionalCamera) {
|
||||
Memory::CallVT<258>(this, doNothing, setAsOptionalCamera);
|
||||
}
|
||||
|
||||
GameDI_PH* GameDI_PH::Get() {
|
||||
__try {
|
||||
Engine::CGame* pCGame = Engine::CGame::Get();
|
||||
if (!pCGame)
|
||||
return nullptr;
|
||||
|
||||
GameDI_PH* ptr = pCGame->pGameDI_PH;
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerObjProperties
|
||||
PlayerObjProperties* PlayerObjProperties::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_g_PlayerObjProperties())
|
||||
return nullptr;
|
||||
|
||||
PlayerObjProperties* ptr = *reinterpret_cast<PlayerObjProperties**>(Offsets::Get_g_PlayerObjProperties());
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region BackgroundModuleScreenController
|
||||
BackgroundModuleScreenController* BackgroundModuleScreenController::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_g_BackgroundModuleScreenController())
|
||||
return nullptr;
|
||||
|
||||
BackgroundModuleScreenController* ptr = reinterpret_cast<BackgroundModuleScreenController*>(Offsets::Get_g_BackgroundModuleScreenController());
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Engine
|
||||
namespace Engine {
|
||||
#pragma region CVideoSettings
|
||||
CVideoSettings* CVideoSettings::Get() {
|
||||
__try {
|
||||
CGame* pCGame = CGame::Get();
|
||||
if (!pCGame)
|
||||
return nullptr;
|
||||
|
||||
CVideoSettings* ptr = pCGame->pCVideoSettings;
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CLevel
|
||||
CLevel* CLevel::Get() {
|
||||
__try {
|
||||
CGame* pCGame = CGame::Get();
|
||||
if (!pCGame)
|
||||
return nullptr;
|
||||
|
||||
CLevel* ptr = pCGame->pCLevel;
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CGame
|
||||
CGame* CGame::Get() {
|
||||
__try {
|
||||
CLobbySteam* pCLobbySteam = CLobbySteam::Get();
|
||||
if (!pCLobbySteam)
|
||||
return nullptr;
|
||||
|
||||
CGame* ptr = pCLobbySteam->pCGame;
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CLobbySteam
|
||||
CLobbySteam* CLobbySteam::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_CLobbySteam())
|
||||
return nullptr;
|
||||
|
||||
CLobbySteam* ptr = *reinterpret_cast<CLobbySteam**>(Offsets::Get_CLobbySteam());
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CInput
|
||||
DWORD64 CInput::BlockGameInput() {
|
||||
return Memory::CallVT<2, DWORD64>(this);
|
||||
}
|
||||
void CInput::UnlockGameInput() {
|
||||
Memory::CallVT<1>(this);
|
||||
}
|
||||
|
||||
CInput* CInput::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_g_CInput())
|
||||
return nullptr;
|
||||
|
||||
CInput* ptr = *reinterpret_cast<CInput**>(Offsets::Get_g_CInput());
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CBulletPhysicsCharacter
|
||||
Vector3 CBulletPhysicsCharacter::posBeforeFreeze{};
|
||||
|
||||
void CBulletPhysicsCharacter::FreezeCharacter() {
|
||||
MoveCharacter(posBeforeFreeze);
|
||||
}
|
||||
void CBulletPhysicsCharacter::MoveCharacter(const Vector3& pos) {
|
||||
playerDownwardVelocity = 0.0f;
|
||||
playerPos = pos;
|
||||
playerPos2 = pos;
|
||||
}
|
||||
|
||||
CBulletPhysicsCharacter* CBulletPhysicsCharacter::Get() {
|
||||
__try {
|
||||
CoPhysicsProperty* pCoPhysicsProperty = CoPhysicsProperty::Get();
|
||||
if (!pCoPhysicsProperty)
|
||||
return nullptr;
|
||||
|
||||
CBulletPhysicsCharacter* ptr = pCoPhysicsProperty->pCBulletPhysicsCharacter;
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CoPhysicsProperty
|
||||
CoPhysicsProperty* CoPhysicsProperty::Get() {
|
||||
__try {
|
||||
GamePH::PlayerObjProperties* pPlayerObjProperties = GamePH::PlayerObjProperties::Get();
|
||||
if (!pPlayerObjProperties)
|
||||
return nullptr;
|
||||
|
||||
CoPhysicsProperty* ptr = pPlayerObjProperties->pCoPhysicsProperty;
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CRTTIField
|
||||
DWORD64 CRTTIField::Get_float(CRTTI* crtti, float& out) {
|
||||
if (!Offsets::Get_CRTTIFieldTypedNative_Get_float())
|
||||
return 0;
|
||||
|
||||
DWORD64(*pCRTTIFieldTypedNative_Get_float)(LPVOID pCRTTIFieldTypedNative, CRTTI* crtti, float& out) = (decltype(pCRTTIFieldTypedNative_Get_float))Offsets::Get_CRTTIFieldTypedNative_Get_float();
|
||||
if (!pCRTTIFieldTypedNative_Get_float)
|
||||
return 0;
|
||||
|
||||
return pCRTTIFieldTypedNative_Get_float(this, crtti, out);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CRTTI
|
||||
CRTTIField* CRTTI::FindField(const char* name) {
|
||||
if (!Offsets::Get_CRTTI_FindField())
|
||||
return nullptr;
|
||||
|
||||
CRTTIField*(*pCRTTI_FindField)(LPVOID pCRTTI, const char* name) = (decltype(pCRTTI_FindField))Offsets::Get_CRTTI_FindField();
|
||||
if (!pCRTTI_FindField)
|
||||
return nullptr;
|
||||
|
||||
return pCRTTI_FindField(this, name);
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
@@ -1,399 +0,0 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include <any>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "hook.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define STR_MERGE_IMPL(a, b) a##b
|
||||
#define STR_MERGE(a, b) STR_MERGE_IMPL(a, b)
|
||||
#define MAKE_PAD(size) STR_MERGE(_pad, __COUNTER__)[size]
|
||||
#define DEFINE_MEMBER_N(type, name, offset) struct {unsigned char MAKE_PAD(offset); type name;}
|
||||
#define DEFINE_MEMBER_0(type, name) struct {type name;}
|
||||
|
||||
// Game structs
|
||||
struct Vector3 {
|
||||
float X, Y, Z;
|
||||
|
||||
bool operator==(const Vector3& v) const {
|
||||
return Utils::are_same(X, v.X) && Utils::are_same(Y, v.Y) && Utils::are_same(Z, v.Z);
|
||||
}
|
||||
Vector3& operator+=(const Vector3& v) {
|
||||
X += v.X;
|
||||
Y += v.Y;
|
||||
Z += v.Z;
|
||||
return *this;
|
||||
}
|
||||
Vector3& operator-=(const Vector3& v) {
|
||||
X -= v.X;
|
||||
Y -= v.Y;
|
||||
Z -= v.Z;
|
||||
return *this;
|
||||
}
|
||||
Vector3 operator+(const Vector3& v) const {
|
||||
return { X + v.X, Y + v.Y, Z + v.Z };
|
||||
}
|
||||
Vector3 operator-(const Vector3& v) const {
|
||||
return { X - v.X, Y - v.Y, Z - v.Z };
|
||||
}
|
||||
Vector3 operator*(float scalar) const {
|
||||
return { X * scalar, Y * scalar, Z * scalar };
|
||||
}
|
||||
Vector3 operator/(float scalar) const {
|
||||
return { X / scalar, Y / scalar, Z / scalar };
|
||||
}
|
||||
|
||||
Vector3 normalize() {
|
||||
float length = std::sqrt(X * X + Y * Y + Z * Z);
|
||||
return { X / length, Y / length, Z / length };
|
||||
}
|
||||
Vector3 cross(const Vector3& v) const {
|
||||
return {
|
||||
Y * v.Z - Z * v.Y,
|
||||
Z * v.X - X * v.Z,
|
||||
X * v.Y - Y * v.X
|
||||
};
|
||||
}
|
||||
|
||||
bool isDefault() const {
|
||||
return Utils::are_same(X, 0.0f) && Utils::are_same(Y, 0.0f) && Utils::are_same(Z, 0.0f);
|
||||
}
|
||||
};
|
||||
namespace EWeather {
|
||||
enum TYPE {
|
||||
Default = 0,
|
||||
Foggy = 1,
|
||||
Clear = 2,
|
||||
Overcast = 3,
|
||||
Cloudy = 4,
|
||||
Rainy = 5,
|
||||
Stormy = 6
|
||||
};
|
||||
}
|
||||
|
||||
// Forward decl
|
||||
namespace Engine {
|
||||
class CBaseCamera;
|
||||
class CoPhysicsProperty;
|
||||
class CRTTI;
|
||||
|
||||
// Inheritance classes
|
||||
class CRTTIField {
|
||||
public:
|
||||
DWORD64 Get_float(CRTTI* crtti, float& out);
|
||||
};
|
||||
|
||||
class CRTTI {
|
||||
public:
|
||||
CRTTIField* FindField(char const* name);
|
||||
};
|
||||
}
|
||||
|
||||
namespace GamePH {
|
||||
extern void ShowTPPModel(bool showTPPModel);
|
||||
|
||||
class PlayerVariables {
|
||||
public:
|
||||
static std::vector<std::pair<std::string, std::pair<LPVOID, std::string>>> playerVars;
|
||||
static std::vector<std::pair<std::string, std::pair<std::any, std::string>>> playerVarsDefault;
|
||||
static std::vector<std::pair<std::string, std::pair<std::any, std::string>>> playerCustomVarsDefault;
|
||||
static bool gotPlayerVars;
|
||||
|
||||
static void GetPlayerVars();
|
||||
static void SortPlayerVars();
|
||||
|
||||
template <typename T>
|
||||
static void ChangePlayerVar(const std::string& playerVar, const T value) {
|
||||
static_assert(std::is_same<T, bool>::value || std::is_same<T, float>::value || std::is_same<T, std::string>::value, "Invalid type: value must be bool, float or string");
|
||||
|
||||
auto it = std::find_if(PlayerVariables::playerVars.begin(), PlayerVariables::playerVars.end(), [&playerVar](const auto& pair) {
|
||||
return pair.first == playerVar;
|
||||
});
|
||||
|
||||
if (it == PlayerVariables::playerVars.end())
|
||||
return;
|
||||
|
||||
if (std::is_same<T, std::string>::value) {
|
||||
std::string valueStr = Utils::to_string(value);
|
||||
if (it->second.second == "float") {
|
||||
float* const varValue = reinterpret_cast<float*>(it->second.first);
|
||||
const float actualValue = std::stof(valueStr);
|
||||
|
||||
*varValue = actualValue;
|
||||
*(varValue + 1) = actualValue;
|
||||
}
|
||||
else {
|
||||
bool* const varValue = reinterpret_cast<bool*>(it->second.first);
|
||||
const bool actualValue = valueStr == "true";
|
||||
|
||||
*varValue = actualValue;
|
||||
*(varValue + 1) = actualValue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
T* const varValue = reinterpret_cast<T*>(it->second.first);
|
||||
|
||||
*varValue = value;
|
||||
*(varValue + 1) = value;
|
||||
}
|
||||
}
|
||||
|
||||
static PlayerVariables* Get();
|
||||
};
|
||||
|
||||
class PlayerState {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(PlayerVariables*, playerVars, 0x290);
|
||||
};
|
||||
|
||||
static PlayerState* Get();
|
||||
};
|
||||
|
||||
class PlayerHealthModule {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(float, health, 0x2C);
|
||||
DEFINE_MEMBER_N(float, maxHealth, 0x3C);
|
||||
};
|
||||
|
||||
static PlayerHealthModule* pPlayerHealthModule;
|
||||
static PlayerHealthModule* Get();
|
||||
};
|
||||
|
||||
class TPPCameraDI {
|
||||
public:
|
||||
static TPPCameraDI* Get();
|
||||
};
|
||||
|
||||
class CameraFPPDI {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(Engine::CBaseCamera*, pCBaseCamera, 0x38);
|
||||
};
|
||||
|
||||
Vector3* GetForwardVector(Vector3* outForwardVec);
|
||||
Vector3* GetUpVector(Vector3* outUpVec);
|
||||
Vector3* GetPosition(Vector3* posIN);
|
||||
|
||||
//static CameraFPPDI* Get();
|
||||
};
|
||||
|
||||
class CoBaseCameraProxy {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(TPPCameraDI*, pTPPCameraDI, 0xD0);
|
||||
};
|
||||
};
|
||||
|
||||
class FreeCamera {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(CoBaseCameraProxy*, pCoBaseCameraProxy, 0x18);
|
||||
DEFINE_MEMBER_N(Engine::CBaseCamera*, pCBaseCamera, 0x38);
|
||||
DEFINE_MEMBER_N(bool, enableSpeedMultiplier1, 0x42);
|
||||
DEFINE_MEMBER_N(bool, enableSpeedMultiplier2, 0x43);
|
||||
DEFINE_MEMBER_N(float, speedMultiplier, 0x1CC);
|
||||
};
|
||||
|
||||
Vector3* GetForwardVector(Vector3* outForwardVec);
|
||||
Vector3* GetUpVector(Vector3* outUpVec);
|
||||
Vector3* GetPosition(Vector3* posIN);
|
||||
void AllowCameraMovement(int mode = 2);
|
||||
|
||||
static FreeCamera* Get();
|
||||
};
|
||||
|
||||
class DayNightCycle {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(float, time1, 0x10);
|
||||
DEFINE_MEMBER_N(float, time2, 0x20);
|
||||
DEFINE_MEMBER_N(float, time3, 0x5C);
|
||||
};
|
||||
|
||||
void SetDaytime(float time);
|
||||
|
||||
static DayNightCycle* Get();
|
||||
};
|
||||
|
||||
namespace TimeWeather {
|
||||
class CSystem {
|
||||
public:
|
||||
void SetForcedWeather(int weather);
|
||||
int GetCurrentWeather();
|
||||
|
||||
static CSystem* Get();
|
||||
};
|
||||
}
|
||||
|
||||
class LevelDI {
|
||||
public:
|
||||
bool IsLoading();
|
||||
bool IsLoaded();
|
||||
LPVOID GetViewCamera();
|
||||
float GetTimeDelta();
|
||||
void SetViewCamera(LPVOID viewCam);
|
||||
float GetTimePlayed();
|
||||
void ShowUIManager(bool enabled);
|
||||
TimeWeather::CSystem* GetTimeWeatherSystem();
|
||||
|
||||
static LevelDI* Get();
|
||||
};
|
||||
|
||||
class gen_TPPModel {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(bool, enableTPPModel1, 0x2CF9);
|
||||
DEFINE_MEMBER_N(bool, enableTPPModel2, 0x2CFA);
|
||||
};
|
||||
|
||||
static gen_TPPModel* Get();
|
||||
};
|
||||
|
||||
class LocalClientDI {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(gen_TPPModel*, pgen_TPPModel, 0x90);
|
||||
};
|
||||
|
||||
static LocalClientDI* Get();
|
||||
};
|
||||
|
||||
class SessionCooperativeDI {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(LocalClientDI*, pLocalClientDI, 0xE08);
|
||||
};
|
||||
|
||||
static SessionCooperativeDI* Get();
|
||||
};
|
||||
|
||||
class GameDI_PH2 {
|
||||
public:
|
||||
static GameDI_PH2* Get();
|
||||
};
|
||||
|
||||
class GameDI_PH {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(SessionCooperativeDI*, pSessionCooperativeDI, 0xF0);
|
||||
DEFINE_MEMBER_N(bool, blockPauseGameOnPlayerAfk, 0x830);
|
||||
};
|
||||
|
||||
float GetGameTimeDelta();
|
||||
DWORD64 GetCurrentGameVersion();
|
||||
void TogglePhotoMode(bool doNothing = false, bool setAsOptionalCamera = false);
|
||||
|
||||
static GameDI_PH* Get();
|
||||
};
|
||||
|
||||
class PlayerObjProperties {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(Engine::CoPhysicsProperty*, pCoPhysicsProperty, 0xF0);
|
||||
DEFINE_MEMBER_N(bool, isOutOfBounds, 0x2E80);
|
||||
DEFINE_MEMBER_N(float, outOfBoundsTimer, 0x2E84);
|
||||
};
|
||||
|
||||
static PlayerObjProperties* Get();
|
||||
};
|
||||
|
||||
class BackgroundModuleScreenController : public Engine::CRTTI {
|
||||
public:
|
||||
static BackgroundModuleScreenController* Get();
|
||||
};
|
||||
}
|
||||
|
||||
namespace Engine {
|
||||
class CVideoSettings {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(float, extraFOV, 0x7C);
|
||||
};
|
||||
|
||||
static CVideoSettings* Get();
|
||||
};
|
||||
|
||||
class CLevel {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(GamePH::LevelDI*, pLevelDI, 0x20);
|
||||
};
|
||||
|
||||
static CLevel* Get();
|
||||
};
|
||||
|
||||
class CGame {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(GamePH::GameDI_PH*, pGameDI_PH, 0x8);
|
||||
DEFINE_MEMBER_N(CVideoSettings*, pCVideoSettings, 0x28);
|
||||
DEFINE_MEMBER_N(CLevel*, pCLevel, 0x380);
|
||||
};
|
||||
|
||||
static CGame* Get();
|
||||
};
|
||||
|
||||
class CLobbySteam {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(CGame*, pCGame, 0xF8);
|
||||
};
|
||||
|
||||
static CLobbySteam* Get();
|
||||
};
|
||||
|
||||
class CInput {
|
||||
public:
|
||||
DWORD64 BlockGameInput();
|
||||
void UnlockGameInput();
|
||||
|
||||
static CInput* Get();
|
||||
};
|
||||
|
||||
class CBaseCamera {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(float, yaw, 0x48);
|
||||
DEFINE_MEMBER_N(float, X, 0x4C);
|
||||
DEFINE_MEMBER_N(float, pitch, 0x58);
|
||||
DEFINE_MEMBER_N(float, Y, 0x5C);
|
||||
DEFINE_MEMBER_N(float, Z, 0x6C);
|
||||
};
|
||||
};
|
||||
|
||||
class CBulletPhysicsCharacter {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(Vector3, playerPos2, 0x8A0);
|
||||
DEFINE_MEMBER_N(Vector3, playerPos, 0x8B8);
|
||||
DEFINE_MEMBER_N(float, playerDownwardVelocity, 0xC38);
|
||||
};
|
||||
|
||||
static Vector3 posBeforeFreeze;
|
||||
|
||||
void FreezeCharacter();
|
||||
void MoveCharacter(const Vector3& pos);
|
||||
|
||||
static CBulletPhysicsCharacter* Get();
|
||||
};
|
||||
|
||||
class CoPhysicsProperty {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(CBulletPhysicsCharacter*, pCBulletPhysicsCharacter, 0x20);
|
||||
};
|
||||
|
||||
static CoPhysicsProperty* Get();
|
||||
};
|
||||
}
|
||||
|
||||
#undef DEFINE_MEMBER_0
|
||||
#undef DEFINE_MEMBER_N
|
||||
#undef MAKE_PAD
|
||||
#undef STR_MERGE
|
||||
#undef STR_MERGE_IMPL
|
||||
@@ -1,137 +0,0 @@
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include "hook.h"
|
||||
#include "sigscan\offsets.h"
|
||||
|
||||
namespace Hook {
|
||||
// VTable hooking
|
||||
static int VTHookUnprotect(LPCVOID region) {
|
||||
MEMORY_BASIC_INFORMATION mbi{};
|
||||
VirtualQuery(region, &mbi, sizeof(mbi));
|
||||
VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_READWRITE, &mbi.Protect);
|
||||
return mbi.Protect;
|
||||
}
|
||||
static void VTHookProtect(LPCVOID region, int protection) {
|
||||
MEMORY_BASIC_INFORMATION mbi{};
|
||||
VirtualQuery(region, &mbi, sizeof(mbi));
|
||||
VirtualProtect(mbi.BaseAddress, mbi.RegionSize, protection, &mbi.Protect);
|
||||
}
|
||||
|
||||
void HookVT(LPVOID instance, LPVOID pDetour, LPVOID* ppOriginal, const DWORD offset) {
|
||||
PDWORD64* entry = reinterpret_cast<PDWORD64*>(*reinterpret_cast<DWORD64*>(instance) + offset);
|
||||
*ppOriginal = *entry;
|
||||
|
||||
const int original_protection = VTHookUnprotect(entry);
|
||||
*entry = reinterpret_cast<PDWORD64>(pDetour);
|
||||
VTHookProtect(entry, original_protection);
|
||||
}
|
||||
|
||||
// Trampoline hooking
|
||||
DETOUR_INFO MidFuncHook(LPVOID pTarget, LPVOID pHookedFunc, const size_t nops, const size_t bytesToSkip) {
|
||||
DWORD dwOldProtect, dwBkup{};
|
||||
|
||||
const size_t finalHookSize = 13 + nops;
|
||||
|
||||
DETOUR_INFO detour{ pTarget, pHookedFunc };
|
||||
detour.oBytes.resize(finalHookSize);
|
||||
detour.patchedBytes.resize(finalHookSize);
|
||||
|
||||
VirtualProtect(pTarget, finalHookSize, PAGE_EXECUTE_READWRITE, &dwOldProtect);
|
||||
|
||||
BYTE* temp_target = reinterpret_cast<BYTE*>(pTarget);
|
||||
std::copy(temp_target, temp_target + finalHookSize, detour.oBytes.begin());
|
||||
|
||||
// push rax
|
||||
*temp_target = 0x50;
|
||||
temp_target++;
|
||||
|
||||
// mov rax, hookedFuncAddr
|
||||
*temp_target = 0x48;
|
||||
*(temp_target + 1) = 0xB8;
|
||||
*reinterpret_cast<PDWORD64>(temp_target + 2) = reinterpret_cast<DWORD64>(pHookedFunc) + bytesToSkip;
|
||||
temp_target += 2 + sizeof(DWORD64);
|
||||
|
||||
// jmp rax
|
||||
*temp_target = 0xFF;
|
||||
*(temp_target + 1) = 0xE0;
|
||||
temp_target += 2;
|
||||
|
||||
// nop
|
||||
if (nops != 0) {
|
||||
for (int i = 0; i < nops; i++) {
|
||||
*temp_target = 0x90;
|
||||
temp_target++;
|
||||
}
|
||||
}
|
||||
|
||||
detour.jmpBack = reinterpret_cast<PDWORD64>(temp_target);
|
||||
temp_target = reinterpret_cast<BYTE*>(pTarget);
|
||||
std::copy(temp_target, temp_target + finalHookSize, detour.patchedBytes.begin());
|
||||
|
||||
VirtualProtect(pTarget, finalHookSize, dwOldProtect, &dwBkup);
|
||||
|
||||
return detour;
|
||||
}
|
||||
|
||||
// Breakpoint hooking
|
||||
static std::vector<BreakpointHook*> s_hookList;
|
||||
|
||||
BreakpointHook::BreakpointHook(PDWORD64 addr, std::function<void(PEXCEPTION_POINTERS)> handler) {
|
||||
m_addr = addr;
|
||||
m_handler = handler;
|
||||
m_originalBytes = *reinterpret_cast<BYTE*>(m_addr);
|
||||
|
||||
AddVectoredExceptionHandler(true, (PVECTORED_EXCEPTION_HANDLER)OnException);
|
||||
|
||||
s_hookList.push_back(this);
|
||||
|
||||
Enable();
|
||||
}
|
||||
void BreakpointHook::Enable() {
|
||||
DWORD oldProtection = 0;
|
||||
|
||||
VirtualProtect(m_addr, 1, PAGE_EXECUTE_READWRITE, &m_originalProtection);
|
||||
*reinterpret_cast<BYTE*>(m_addr) = 0xCC;
|
||||
VirtualProtect(m_addr, 1, m_originalProtection, &oldProtection);
|
||||
}
|
||||
void BreakpointHook::Disable() {
|
||||
DWORD oldProtection = 0;
|
||||
|
||||
VirtualProtect(m_addr, 1, PAGE_EXECUTE_READWRITE, &oldProtection);
|
||||
*reinterpret_cast<BYTE*>(m_addr) = m_originalBytes;
|
||||
VirtualProtect(m_addr, 1, m_originalProtection, &oldProtection);
|
||||
}
|
||||
BreakpointHook::~BreakpointHook() {
|
||||
Disable();
|
||||
|
||||
auto it = std::find(s_hookList.begin(), s_hookList.end(), this);
|
||||
|
||||
if (it != s_hookList.end())
|
||||
s_hookList.erase(it);
|
||||
}
|
||||
|
||||
static PDWORD64 lastBpAddress = nullptr;
|
||||
long WINAPI BreakpointHook::OnException(PEXCEPTION_POINTERS info) {
|
||||
for (auto it = s_hookList.begin(); it != s_hookList.end(); it++) {
|
||||
BreakpointHook* bp = *it;
|
||||
|
||||
if (bp->m_addr == info->ExceptionRecord->ExceptionAddress) {
|
||||
bp->Disable();
|
||||
|
||||
lastBpAddress = bp->m_addr;
|
||||
info->ContextRecord->EFlags |= 0x100; // Set EFLAGS to single step
|
||||
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
} else if (info->ExceptionRecord->ExceptionCode == STATUS_SINGLE_STEP && bp->m_addr == lastBpAddress) {
|
||||
bp->Enable();
|
||||
info->ContextRecord->EFlags &= ~0x00000100; // Remove TRACE from EFLAGS
|
||||
|
||||
bp->m_handler(info);
|
||||
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
}
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include <functional>
|
||||
#include <set>
|
||||
#include "MinHook\include\MinHook.h"
|
||||
|
||||
namespace Hook {
|
||||
struct DETOUR_INFO {
|
||||
LPVOID target;
|
||||
LPVOID hookedFunc;
|
||||
PDWORD64 jmpBack;
|
||||
std::vector<BYTE> oBytes;
|
||||
std::vector<BYTE> patchedBytes;
|
||||
|
||||
DETOUR_INFO() = default;
|
||||
DETOUR_INFO(LPVOID pTarget, LPVOID pHookedFunc) {
|
||||
target = pTarget;
|
||||
hookedFunc = pHookedFunc;
|
||||
jmpBack = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
extern void HookVT(LPVOID instance, LPVOID pDetour, LPVOID* ppOriginal, const DWORD offset);
|
||||
|
||||
extern DETOUR_INFO MidFuncHook(LPVOID pTarget, LPVOID hookedFunc, const size_t nops = 0, const size_t bytesToSkip = 0);
|
||||
|
||||
class BreakpointHook {
|
||||
private:
|
||||
PDWORD64 m_addr;
|
||||
BYTE m_originalBytes;
|
||||
std::function<void(PEXCEPTION_POINTERS)> m_handler;
|
||||
DWORD m_originalProtection;
|
||||
|
||||
static long WINAPI OnException(PEXCEPTION_POINTERS info);
|
||||
public:
|
||||
BreakpointHook(PDWORD64 addr, std::function<void(PEXCEPTION_POINTERS)> handler);
|
||||
void Enable();
|
||||
void Disable();
|
||||
~BreakpointHook();
|
||||
};
|
||||
|
||||
class HookBase {
|
||||
public:
|
||||
HookBase() { GetInstances()->insert(this); }
|
||||
~HookBase() { GetInstances()->erase(this); }
|
||||
static std::set<HookBase*>* GetInstances() { static std::set<HookBase*> instances{}; return &instances; };
|
||||
|
||||
virtual void HookLoop() {};
|
||||
};
|
||||
template <typename GetTargetOffsetRetType, typename OrigType>
|
||||
class MHook : HookBase {
|
||||
public:
|
||||
MHook(GetTargetOffsetRetType(*pGetOffsetFunc)(), OrigType pDetour) : pGetOffsetFunc(pGetOffsetFunc), pDetour(pDetour) {}
|
||||
|
||||
void HookLoop() override {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
|
||||
if (!pGetOffsetFunc)
|
||||
continue;
|
||||
|
||||
if (!pTarget)
|
||||
pTarget = reinterpret_cast<OrigType>(pGetOffsetFunc());
|
||||
else if (!pOriginal && MH_CreateHook(pTarget, pDetour, reinterpret_cast<LPVOID*>(&pOriginal)) == MH_OK) {
|
||||
MH_EnableHook(pTarget);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OrigType pOriginal = nullptr;
|
||||
OrigType pTarget = nullptr;
|
||||
private:
|
||||
GetTargetOffsetRetType(*pGetOffsetFunc)() = nullptr;
|
||||
OrigType pDetour = nullptr;
|
||||
};
|
||||
template <typename GetTargetOffsetRetType, typename OrigType>
|
||||
class VTHook : HookBase {
|
||||
public:
|
||||
VTHook(GetTargetOffsetRetType(*pGetOffsetFunc)(), OrigType pDetour, DWORD offset) : pGetOffsetFunc(pGetOffsetFunc), pDetour(pDetour), offset(offset) {}
|
||||
|
||||
void HookLoop() override {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
|
||||
if (!pGetOffsetFunc)
|
||||
continue;
|
||||
|
||||
if (!pInstance)
|
||||
pInstance = pGetOffsetFunc();
|
||||
else if (!pOriginal) {
|
||||
Hook::HookVT(pInstance, pDetour, reinterpret_cast<LPVOID*>(&pOriginal), offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OrigType pOriginal = nullptr;
|
||||
private:
|
||||
GetTargetOffsetRetType(*pGetOffsetFunc)() = nullptr;
|
||||
LPVOID pInstance = nullptr;
|
||||
OrigType pDetour = nullptr;
|
||||
|
||||
DWORD offset = 0x0;
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#include <Windows.h>
|
||||
#include <Psapi.h>
|
||||
|
||||
namespace Memory {
|
||||
MODULEINFO GetModuleInfo(const char* szModule) {
|
||||
const HMODULE hModule = GetModuleHandle(szModule);
|
||||
if (hModule == 0)
|
||||
return MODULEINFO();
|
||||
|
||||
MODULEINFO moduleInfo{};
|
||||
GetModuleInformation(GetCurrentProcess(), hModule, &moduleInfo, sizeof(MODULEINFO));
|
||||
return moduleInfo;
|
||||
}
|
||||
|
||||
bool IsAddressValidMod(const DWORD64 ptr, const char* moduleName) {
|
||||
MODULEINFO moduleInf = GetModuleInfo(moduleName);
|
||||
|
||||
const DWORD64 moduleEntryPoint = reinterpret_cast<DWORD64>(moduleInf.EntryPoint);
|
||||
const DWORD64 moduleEndPoint = moduleEntryPoint + moduleInf.SizeOfImage;
|
||||
return ptr && (ptr <= moduleEndPoint && ptr >= moduleEntryPoint);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include <Psapi.h>
|
||||
|
||||
namespace Memory {
|
||||
extern MODULEINFO GetModuleInfo(const char* szModule);
|
||||
|
||||
extern bool IsAddressValidMod(const DWORD64 ptr, const char* moduleName);
|
||||
|
||||
template<typename ptrT>
|
||||
bool IsValidPtr(ptrT ptr) {
|
||||
return !IsBadReadPtr(reinterpret_cast<LPVOID>(ptr), sizeof(LPVOID));
|
||||
}
|
||||
|
||||
template<typename ptrT = LPVOID>
|
||||
bool IsValidPtrMod(ptrT ptr, const char* moduleName, const bool checkForVT = true) {
|
||||
return IsValidPtr<ptrT>(ptr) && IsAddressValidMod(checkForVT ? *(PDWORD64)(ptr) : (DWORD64)(ptr), moduleName);
|
||||
}
|
||||
|
||||
template <std::size_t Index, typename ReturnType = void, typename... Args> __forceinline ReturnType CallVT(LPVOID instance, Args... args) {
|
||||
using Fn = ReturnType(__thiscall*)(LPVOID, Args...);
|
||||
|
||||
auto function = (*reinterpret_cast<Fn**>(instance))[Index];
|
||||
return function(instance, args...);
|
||||
}
|
||||
|
||||
template <std::size_t Index, typename ReturnType = void, typename... Args> __forceinline ReturnType CallFromVT(LPVOID instance, LPVOID vtable, Args... args) {
|
||||
using Fn = ReturnType(__thiscall*)(LPVOID, Args...);
|
||||
|
||||
auto function = reinterpret_cast<Fn*>(vtable)[Index];
|
||||
return function(instance, args...);
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
#include <Hotkey.h>
|
||||
#include <ImGuiEx.h>
|
||||
#include <imgui.h>
|
||||
#include "..\core.h"
|
||||
#include "..\game_classes.h"
|
||||
#include "..\sigscan\offsets.h"
|
||||
#include "camera.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace Camera {
|
||||
int FOV = 57;
|
||||
|
||||
Option photoMode{};
|
||||
|
||||
KeyBindOption freeCam{ VK_F3 };
|
||||
float freeCamSpeed = 2.0f;
|
||||
KeyBindOption teleportPlayerToCamera{ VK_F4 };
|
||||
|
||||
KeyBindOption thirdPersonCamera{ VK_F1 };
|
||||
KeyBindOption tpUseTPPModel{ VK_F2 };
|
||||
float tpDistanceBehindPlayer = 2.0f;
|
||||
float tpHeightAbovePlayer = 1.35f;
|
||||
|
||||
Option disablePhotoModeLimits{};
|
||||
Option disableSafezoneFOVReduction{};
|
||||
|
||||
static const int baseFOV = 57;
|
||||
static const float baseSafezoneFOVReduction = -10.0f;
|
||||
|
||||
static void UpdateFOV() {
|
||||
if (menuToggle.GetValue())
|
||||
return;
|
||||
|
||||
Engine::CVideoSettings* videoSettings = Engine::CVideoSettings::Get();
|
||||
if (!videoSettings)
|
||||
return;
|
||||
|
||||
FOV = static_cast<int>(videoSettings->extraFOV) + baseFOV;
|
||||
}
|
||||
static void FreeCamUpdate() {
|
||||
if (photoMode.GetValue())
|
||||
return;
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return;
|
||||
LPVOID viewCam = iLevel->GetViewCamera();
|
||||
if (!viewCam)
|
||||
return;
|
||||
GamePH::GameDI_PH* pGameDI_PH = GamePH::GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
return;
|
||||
GamePH::FreeCamera* pFreeCam = GamePH::FreeCamera::Get();
|
||||
if (!pFreeCam)
|
||||
return;
|
||||
|
||||
if (freeCam.GetValue()) {
|
||||
if (viewCam == pFreeCam) {
|
||||
pFreeCam->enableSpeedMultiplier1 = true;
|
||||
pFreeCam->speedMultiplier = freeCamSpeed;
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftShift))
|
||||
pFreeCam->speedMultiplier *= 2.0f;
|
||||
else if (ImGui::IsKeyDown(ImGuiKey_LeftAlt))
|
||||
pFreeCam->speedMultiplier /= 2.0f;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(2);
|
||||
|
||||
freeCam.SetPrevValue(true);
|
||||
} else {
|
||||
if (freeCam.GetPrevValue()) {
|
||||
pFreeCam->enableSpeedMultiplier1 = false;
|
||||
pFreeCam->speedMultiplier = 0.1f;
|
||||
}
|
||||
if (viewCam != pFreeCam)
|
||||
return;
|
||||
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(0);
|
||||
|
||||
freeCam.SetPrevValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdatePlayerVars() {
|
||||
if (!GamePH::PlayerVariables::gotPlayerVars)
|
||||
return;
|
||||
|
||||
if (disableSafezoneFOVReduction.GetValue()) {
|
||||
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", 0.0f);
|
||||
disableSafezoneFOVReduction.SetPrevValue(true);
|
||||
} else if (disableSafezoneFOVReduction.GetPrevValue()) {
|
||||
disableSafezoneFOVReduction.SetPrevValue(false);
|
||||
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", baseSafezoneFOVReduction);
|
||||
}
|
||||
}
|
||||
|
||||
Tab Tab::instance{};
|
||||
void Tab::Update() {
|
||||
UpdateFOV();
|
||||
FreeCamUpdate();
|
||||
UpdatePlayerVars();
|
||||
}
|
||||
void Tab::Render() {
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
ImGui::SeparatorText("Free Camera");
|
||||
ImGui::BeginDisabled(!iLevel || !iLevel->IsLoaded() || photoMode.GetValue(), &freeCam); {
|
||||
ImGui::Checkbox("Enabled##FreeCam", &freeCam);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##FreeCamToggleKey", freeCam);
|
||||
ImGui::SliderFloat("Speed##FreeCam", &freeCamSpeed, 0.0f, 100.0f);
|
||||
ImGui::BeginDisabled(!iLevel || !iLevel->IsLoaded(), &teleportPlayerToCamera); {
|
||||
ImGui::Checkbox("Teleport Player to Camera", &teleportPlayerToCamera);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##TeleportPlayerToCamToggleKey", teleportPlayerToCamera);
|
||||
|
||||
ImGui::SeparatorText("Third Person Camera");
|
||||
ImGui::BeginDisabled(freeCam.GetValue() || photoMode.GetValue(), &thirdPersonCamera); {
|
||||
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCamera);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##ThirdPersonToggleKey", thirdPersonCamera);
|
||||
ImGui::BeginDisabled(freeCam.GetValue() || photoMode.GetValue(), &tpUseTPPModel); {
|
||||
ImGui::Checkbox("Use Third Person Player (TPP) Model", &tpUseTPPModel);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##TPPModelToggleKey", tpUseTPPModel);
|
||||
ImGui::SliderFloat("Distance behind player", &tpDistanceBehindPlayer, 1.0f, 10.0f);
|
||||
ImGui::SliderFloat("Height above player", &tpHeightAbovePlayer, 1.0f, 3.0f);
|
||||
|
||||
ImGui::SeparatorText("Misc");
|
||||
Engine::CVideoSettings* pCVideoSettings = Engine::CVideoSettings::Get();
|
||||
ImGui::BeginDisabled(!pCVideoSettings); {
|
||||
if (ImGui::SliderInt("FOV", &FOV, 20, 160) && pCVideoSettings)
|
||||
pCVideoSettings->extraFOV = static_cast<float>(FOV - baseFOV);
|
||||
else if (pCVideoSettings)
|
||||
FOV = static_cast<int>(pCVideoSettings->extraFOV) + baseFOV;
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Checkbox("Disable Photo Mode Limits", &disablePhotoModeLimits);
|
||||
ImGui::Checkbox("Disable Safezone FOV Reduction", &disableSafezoneFOVReduction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#include <Hotkey.h>
|
||||
#include <imgui.h>
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
static const ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
|
||||
static const ImVec2 minWndSize = ImVec2(0.0f, 0.0f);
|
||||
static const ImVec2 maxWndSize = ImVec2(900.0f, 675.0f);
|
||||
|
||||
KeyBindOption menuToggle = KeyBindOption(VK_F5);
|
||||
float transparency = 99.0f;
|
||||
|
||||
void Render() {
|
||||
ImGuiStyle* style = &ImGui::GetStyle();
|
||||
style->Colors[ImGuiCol_WindowBg] = ImVec4(style->Colors[ImGuiCol_WindowBg].x, style->Colors[ImGuiCol_WindowBg].y, style->Colors[ImGuiCol_WindowBg].z, static_cast<float>(transparency) / 100.0f);
|
||||
|
||||
ImGui::SetNextWindowSizeConstraints(minWndSize, maxWndSize);
|
||||
ImGui::Begin("EGameTools", &menuToggle.value, windowFlags); {
|
||||
if (ImGui::BeginTabBar("##MainTabBar")) {
|
||||
for (auto& tab : *MenuTab::GetInstances()) {
|
||||
if (ImGui::BeginTabItem(tab.second->tabName.data())) {
|
||||
tab.second->Render();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
}
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Hotkey("Menu Toggle Key", menuToggle);
|
||||
ImGui::SliderFloat("Menu Transparency", &transparency, 0.0f, 100.0f, "%.1f%%", ImGuiSliderFlags_AlwaysClamp);
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#include <Hotkey.h>
|
||||
#include <ImGuiEx.h>
|
||||
#include <imgui.h>
|
||||
#include "..\game_classes.h"
|
||||
#include "misc.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace Misc {
|
||||
KeyBindOption disableHUD{ VK_F8 };
|
||||
|
||||
Tab Tab::instance{};
|
||||
void Tab::Update() {
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel)
|
||||
return;
|
||||
|
||||
if (disableHUD.HasChanged()) {
|
||||
disableHUD.SetPrevValue(disableHUD.GetValue());
|
||||
iLevel->ShowUIManager(!disableHUD.GetValue());
|
||||
}
|
||||
}
|
||||
void Tab::Render() {
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
ImGui::SeparatorText("Misc##Misc");
|
||||
ImGui::BeginDisabled(!iLevel->IsLoaded(), &disableHUD); {
|
||||
ImGui::Checkbox("Disable HUD", &disableHUD);
|
||||
ImGui::Hotkey("##GodModeToggleKey", disableHUD);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "..\core.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace Player {
|
||||
extern float playerHealth;
|
||||
extern float playerMaxHealth;
|
||||
extern KeyBindOption godMode;
|
||||
extern KeyBindOption freezePlayer;
|
||||
extern Option playerVariables;
|
||||
extern Option disableOutOfBoundsTimer;
|
||||
|
||||
extern std::string saveSCRPath;
|
||||
extern std::string loadSCRFilePath;
|
||||
|
||||
class Tab : MenuTab {
|
||||
public:
|
||||
Tab() : MenuTab("Player", 0) {}
|
||||
void Update() override;
|
||||
void Render() override;
|
||||
|
||||
static Tab instance;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
#include <imgui.h>
|
||||
#include "..\game_classes.h"
|
||||
#include "world.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace World {
|
||||
float time = 0.0f;
|
||||
|
||||
EWeather::TYPE weather = EWeather::TYPE::Default;
|
||||
static const char* const weatherItems[7] = {
|
||||
"Default",
|
||||
"Foggy",
|
||||
"Clear",
|
||||
"Overcast",
|
||||
"Cloudy",
|
||||
"Rainy",
|
||||
"Stormy"
|
||||
};
|
||||
|
||||
Tab Tab::instance{};
|
||||
void Tab::Update() {}
|
||||
void Tab::Render() {
|
||||
GamePH::DayNightCycle* dayNightCycle = GamePH::DayNightCycle::Get();
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
ImGui::SeparatorText("Misc##World");
|
||||
ImGui::BeginDisabled(!iLevel || !iLevel->IsLoaded() || !dayNightCycle || dayNightCycle->time1 == 0.0f); {
|
||||
if (ImGui::SliderFloat("Time", &time, 0.01f, 24.0f, "%.2f", ImGuiSliderFlags_AlwaysClamp) && dayNightCycle)
|
||||
dayNightCycle->SetDaytime(time);
|
||||
else if (dayNightCycle)
|
||||
time = dayNightCycle->time1 * 24;
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
GamePH::TimeWeather::CSystem* timeWeatherSystem = GamePH::TimeWeather::CSystem::Get();
|
||||
const bool weatherDisabledFlag = !iLevel || !iLevel->IsLoaded() || !timeWeatherSystem;
|
||||
|
||||
ImGui::SeparatorText("Weather");
|
||||
ImGui::BeginDisabled(weatherDisabledFlag); {
|
||||
if (ImGui::Combo("Weather", reinterpret_cast<int*>(&weather), weatherItems, IM_ARRAYSIZE(weatherItems)) && timeWeatherSystem)
|
||||
timeWeatherSystem->SetForcedWeather(static_cast<EWeather::TYPE>(weather - 1));
|
||||
ImGui::Text("Setting weather to: %s", !weatherDisabledFlag ? weatherItems[weather] : "");
|
||||
ImGui::Text("Current weather: %s", !weatherDisabledFlag ? weatherItems[timeWeatherSystem->GetCurrentWeather() + 1] : "");
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
#include "..\game_classes.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace World {
|
||||
extern float time;
|
||||
|
||||
extern EWeather::TYPE weather;
|
||||
|
||||
class Tab : MenuTab {
|
||||
public:
|
||||
Tab() : MenuTab("World", 3) {}
|
||||
void Update() override;
|
||||
void Render() override;
|
||||
|
||||
static Tab instance;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include <string>
|
||||
#include "config\time_tools.h"
|
||||
|
||||
enum ConsoleColors {
|
||||
c_black,
|
||||
c_blue,
|
||||
c_green,
|
||||
c_aqua,
|
||||
c_red,
|
||||
c_purple,
|
||||
c_yellow,
|
||||
c_white,
|
||||
c_gray,
|
||||
c_lightblue,
|
||||
c_lightgreen,
|
||||
c_lightaqua,
|
||||
c_lightred,
|
||||
c_lightpurple,
|
||||
c_lightyellow,
|
||||
c_brightwhite
|
||||
};
|
||||
|
||||
template<typename... Args> std::string PrintError(std::string f, Args... args) {
|
||||
f.append("\n");
|
||||
std::ostringstream oss = GetTimestamp();
|
||||
oss << f;
|
||||
const std::string ossStr = oss.str();
|
||||
|
||||
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(hConsole, c_red);
|
||||
printf(ossStr.c_str(), args...);
|
||||
SetConsoleTextAttribute(hConsole, c_white);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
template<typename... Args> std::string PrintWarning(std::string f, Args... args) {
|
||||
f.append("\n");
|
||||
std::ostringstream oss = GetTimestamp();
|
||||
oss << f;
|
||||
const std::string ossStr = oss.str();
|
||||
|
||||
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(hConsole, c_yellow);
|
||||
printf(ossStr.c_str(), args...);
|
||||
SetConsoleTextAttribute(hConsole, c_white);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
template<typename... Args> std::string PrintSuccess(std::string f, Args... args) {
|
||||
f.append("\n");
|
||||
std::ostringstream oss = GetTimestamp();
|
||||
oss << f;
|
||||
const std::string ossStr = oss.str();
|
||||
|
||||
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(hConsole, c_green);
|
||||
printf(ossStr.c_str(), args...);
|
||||
SetConsoleTextAttribute(hConsole, c_white);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
template<typename... Args> std::string PrintInfo(std::string f, Args... args) {
|
||||
f.append("\n");
|
||||
std::ostringstream oss = GetTimestamp();
|
||||
oss << f;
|
||||
const std::string ossStr = oss.str();
|
||||
|
||||
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(hConsole, c_brightwhite);
|
||||
printf(ossStr.c_str(), args...);
|
||||
SetConsoleTextAttribute(hConsole, c_white);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
template<typename... Args> std::string PrintWaiting(std::string f, Args... args) {
|
||||
f.append("\n");
|
||||
std::ostringstream oss = GetTimestamp();
|
||||
oss << f;
|
||||
const std::string ossStr = oss.str();
|
||||
|
||||
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(hConsole, c_gray);
|
||||
printf(ossStr.c_str(), args...);
|
||||
SetConsoleTextAttribute(hConsole, c_white);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
template<typename... Args> std::string PrintCustom(std::string f, const ConsoleColors color, Args... args) {
|
||||
f.append("\n");
|
||||
std::ostringstream oss = GetTimestamp();
|
||||
oss << f;
|
||||
const std::string ossStr = oss.str();
|
||||
|
||||
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(hConsole, color);
|
||||
printf(ossStr.c_str(), args...);
|
||||
SetConsoleTextAttribute(hConsole, c_white);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
#pragma once
|
||||
#include "..\memory.h"
|
||||
#include "sigscan.h"
|
||||
|
||||
#define AddOffset(name, moduleName, pattern, type, retType)\
|
||||
static retType Get_## name () {\
|
||||
static retType name = NULL;\
|
||||
if (Memory::IsValidPtr(name)) return name;\
|
||||
return name=reinterpret_cast<retType>(PatternScanner::FindPattern(moduleName, {pattern, type}));\
|
||||
}
|
||||
#define AddStaticOffset(name, off)\
|
||||
static DWORD64 Get_## name () {\
|
||||
static DWORD64 name = 0;\
|
||||
if (name) return name; \
|
||||
return name=static_cast<DWORD64>(off);\
|
||||
}
|
||||
#define AddStaticOffset2(name, moduleName, off) \
|
||||
static DWORD64 Get_## name () {\
|
||||
static DWORD64 name = 0;\
|
||||
if (Memory::IsValidPtr(name)) return name;\
|
||||
return name=reinterpret_cast<DWORD64>(GetModuleHandle(moduleName)) + static_cast<DWORD64>(off);\
|
||||
}
|
||||
|
||||
struct Offsets {
|
||||
// ntdll.dll
|
||||
//AddOffset(LdrpCallInitRoutine, "ntdll.dll", "[48 89 5C 24 08 44 89 44 24 18 48", PatternType::Address, PDWORD64)
|
||||
//AddOffset(LdrpRunInitializeRoutines, "ntdll.dll", "[48 89 4C 24 08 53 56 57 41 54 41 55 41 56 41 57 48 81 EC 90", PatternType::Address, PDWORD64) // for win7
|
||||
|
||||
// Input related
|
||||
AddOffset(g_CInput, "engine_x64_rwdi.dll", "48 8B 0D [?? ?? ?? ?? 48 85 C9 74 0F 48 8B 01 84 D2", PatternType::RelativePointer, PDWORD64*)
|
||||
|
||||
// Player vars related
|
||||
AddStaticOffset(LoadPlayerVariableFunc_size, 0x14E)
|
||||
AddOffset(LoadPlayerFloatVariable, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8B D0 48 8D 8C 24 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 94 24 ?? ?? ?? ?? 48 8B 8C 24 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8C 24 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8C 24 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B 84 24 ?? ?? ?? ??", PatternType::RelativePointer, PDWORD64);
|
||||
AddOffset(InitializePlayerVariables, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8B F0 48 8B CF", PatternType::RelativePointer, DWORD64)
|
||||
AddStaticOffset(initPlayerFloatVarsInstr_offset, 0x99);
|
||||
AddStaticOffset(initPlayerBoolVarsInstr_offset, 0x2E7);
|
||||
AddOffset(PlayerState, "gamedll_ph_x64_rwdi.dll", "4C 8B 35 [?? ?? ?? ?? 4C 8B E2", PatternType::RelativePointer, LPVOID)
|
||||
|
||||
// Game related
|
||||
AddStaticOffset(gameDI_PH2_offset, 0x28)
|
||||
AddOffset(CLobbySteam, "engine_x64_rwdi.dll", "48 8B 05 [?? ?? ?? ?? 48 85 C0 74 05 48 83 C0 08 C3", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(g_PlayerObjProperties, "gamedll_ph_x64_rwdi.dll", "48 8B D9 48 89 0D [?? ?? ?? ??", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(g_DayNightCycle, "gamedll_ph_x64_rwdi.dll", "48 8B 0D [?? ?? ?? ?? 48 85 C9 74 10 E8 ?? ?? ?? ?? 84 C0 74 07 B0 01 48 83 C4 28 C3 32 C0", PatternType::RelativePointer, LPVOID)
|
||||
//AddOffset(g_CameraFPPDI, "gamedll_ph_x64_rwdi.dll", "48 89 05 [?? ?? ?? ?? 40 84 FF", PatternType::RelativePointer, PDWORD64)
|
||||
AddOffset(g_FreeCamera, "gamedll_ph_x64_rwdi.dll", "48 89 05 [?? ?? ?? ?? 48 89 4C 24 ??", PatternType::RelativePointer, PDWORD64)
|
||||
AddStaticOffset2(g_BackgroundModuleScreenController, "gamedll_ph_x64_rwdi.dll", 0x3377760)
|
||||
//AddOffset(CameraFPPDI_VT, "gamedll_ph_x64_rwdi.dll", "48 8D 05 [?? ?? ?? ?? 48 89 07 48 8D 4F 60", PatternType::RelativePointer, DWORD64)
|
||||
|
||||
// Functions
|
||||
AddOffset(ReadVideoSettings, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8D 4C 24 ?? FF 15 ?? ?? ?? ?? 48 C7 C2 ?? ?? ?? ??", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(CalculateFreeCamCollision, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8B 06 4C 8D 4C 24 ??", PatternType::RelativePointer, LPVOID)
|
||||
//AddOffset(GetViewCamera, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 85 C0 74 28 48 8B C8", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(CreatePlayerHealthModule, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 4C 8B F1 E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ??", PatternType::Address, LPVOID)
|
||||
AddOffset(LifeSetHealth, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 49 8D 4C 24 ?? 49 03 CE", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(TogglePhotoMode, "gamedll_ph_x64_rwdi.dll", "48 83 EC 48 38 91 ?? ?? ?? ??", PatternType::Address, LPVOID)
|
||||
//AddOffset(OnUpdate_ChangeMap, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 88 44 24 20 48 8B 84 24 ?? ?? ?? ?? 48 83 78 ?? ??", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(ShowTPPModelFunc2, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 45 8D 45 40", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(ShowTPPModelFunc3, "gamedll_ph_x64_rwdi.dll", "E9 [?? ?? ?? ?? 48 85 D2 74 0A", PatternType::RelativePointer, LPVOID)
|
||||
//AddOffset(CalculateOutOfBoundsTimer, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 74 24 ?? 57 48 81 EC ?? ?? ?? ?? 0F B6 99", PatternType::Address, LPVOID)
|
||||
AddOffset(IsNotOutOfBounds, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 41 56 41 57 48 83 EC ?? 4C 8B F9 48 85 D2", PatternType::Address, LPVOID)
|
||||
//AddOffset(GetTimeWeatherSystem, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 33 D2 48 8B C8 E8 ?? ?? ?? ?? 49 8D 4F 38", PatternType::RelativePointer, LPVOID)
|
||||
//AddOffset(SetForcedWeather, "engine_x64_rwdi.dll", "89 51 68 C3 CC CC CC CC CC CC CC CC CC CC CC CC", PatternType::Address, LPVOID)
|
||||
//AddOffset(GetCurrentWeather, "engine_x64_rwdi.dll", "48 8B 41 78 48 85 C0 75 0F", PatternType::Address, LPVOID)
|
||||
AddOffset(MoveCameraFromForwardUpPos, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8B 03 48 8B CB F3 0F 10 9B ?? ?? ?? ??", PatternType::RelativePointer, LPVOID)
|
||||
//AddOffset(GetForwardVector, "engine_x64_rwdi.dll", "4C 8B 41 38 41 8B 40 48", PatternType::Address, LPVOID)
|
||||
//AddOffset(IsLoading, "engine_x64_rwdi.dll", "48 8B 05 ?? ?? ?? ?? 48 8B 51 38", PatternType::Address, LPVOID)
|
||||
//AddOffset(ShowUIManager, "engine_x64_rwdi.dll", "48 8B 0D ?? ?? ?? ?? E9 ?? ?? ?? ?? CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 40 53", PatternType::Address, LPVOID)
|
||||
//AddOffset(GetGameTimeDelta, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? F3 0F 59 05 ?? ?? ?? ?? F3 0F 58 03", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(CRTTI_FindField, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 85 C0 75 2C", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(CRTTIFieldTypedNative_Get_float, "engine_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC 20 8B 41 14 49 8B F8 4C 8B 02 48 8B D9 C1 E8 11 48 8B CA A8 01 74 06 41 FF 50 30 EB 04 41 FF 50 20 4C 8B C8 48 8B 43 60 48 85 C0 74 13 48 8B D7 49 8B C9 48 8B 5C 24 ?? 48 83 C4 20 5F 48 FF E0 48 63 43 50 48 8B 5C 24 ?? 42 8B 0C 08", PatternType::Address, LPVOID)
|
||||
};
|
||||
|
||||
#undef AddOffset
|
||||
#undef AddStaticOffset
|
||||
#undef AddStaticOffset2
|
||||
@@ -1,218 +0,0 @@
|
||||
#include "sigscan.h"
|
||||
#include <iostream>
|
||||
|
||||
DWORD64 GetModuleSize(const char* module) {
|
||||
MODULEINFO hModuleInfo{};
|
||||
|
||||
HMODULE hModule = GetModuleHandle(module);
|
||||
if (hModule == 0)
|
||||
return 0;
|
||||
|
||||
GetModuleInformation(GetCurrentProcess(), hModule, &hModuleInfo, sizeof(MODULEINFO));
|
||||
return hModuleInfo.SizeOfImage;
|
||||
}
|
||||
|
||||
LPVOID PatternScanner::FindPattern(const std::string_view ModuleName, const Pattern &pattern) {
|
||||
return PatternScanner::FindPattern(GetModuleHandle(ModuleName.data()), GetModuleSize(ModuleName.data()), pattern);
|
||||
}
|
||||
|
||||
LPVOID PatternScanner::FindPattern(const Pattern &pattern) {
|
||||
MODULEINFO hModuleInfo;
|
||||
GetModuleInformation(GetCurrentProcess(), GetModuleHandle(nullptr), &hModuleInfo, sizeof(hModuleInfo));
|
||||
return PatternScanner::FindPattern(GetModuleHandle(nullptr), hModuleInfo.SizeOfImage, pattern);
|
||||
}
|
||||
|
||||
std::vector<LPVOID> PatternScanner::FindPatterns(const std::string_view ModuleName, const Pattern &pattern) {
|
||||
return PatternScanner::FindPatterns(GetModuleHandle(ModuleName.data()), GetModuleSize(ModuleName.data()), pattern);
|
||||
}
|
||||
|
||||
std::vector<LPVOID> PatternScanner::FindPatterns(LPVOID startAddress, DWORD64 searchSize, const Pattern &pattern) {
|
||||
std::vector<LPVOID> ret;
|
||||
|
||||
LPVOID base = startAddress;
|
||||
DWORD64 size = searchSize;
|
||||
LPVOID addr = base;
|
||||
do {
|
||||
addr = PatternScanner::FindPattern(reinterpret_cast<LPVOID>((reinterpret_cast<DWORD64>(addr) + 1)), size - (reinterpret_cast<DWORD64>(addr) - reinterpret_cast<DWORD64>(base) + 1), pattern);
|
||||
if (addr)
|
||||
ret.push_back(addr);
|
||||
} while (!addr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
LPVOID PatternScanner::FindPattern(LPVOID startAddress, DWORD64 searchSize, const Pattern &pattern) {
|
||||
size_t len = strlen(pattern.pattern);
|
||||
if (len == 0)
|
||||
return nullptr;
|
||||
|
||||
DWORD64 pos = 0;
|
||||
|
||||
size_t byteCount = 1;
|
||||
uint32_t i = 0;
|
||||
while (i < len - 1) {
|
||||
if (pattern.pattern[i] == ' ')
|
||||
byteCount++;
|
||||
i++;
|
||||
}
|
||||
|
||||
BYTE* patt = reinterpret_cast<BYTE*>(malloc(byteCount + 1));
|
||||
if (!patt)
|
||||
return nullptr;
|
||||
|
||||
BYTE* mask = reinterpret_cast<BYTE*>(malloc(byteCount + 1));
|
||||
if (!mask) {
|
||||
free(patt);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
int bytesCounted = 0;
|
||||
i = 0;
|
||||
while (i < len - 1) {
|
||||
if (pattern.pattern[i] == '[') {
|
||||
i++;
|
||||
offset = bytesCounted;
|
||||
}
|
||||
|
||||
if (pattern.pattern[i] == '\0')
|
||||
break;
|
||||
|
||||
if (pattern.pattern[i] == '?' && pattern.pattern[i + 1] == '?') {
|
||||
mask[bytesCounted] = '?';
|
||||
patt[bytesCounted] = '\0';
|
||||
} else {
|
||||
BYTE hn = pattern.pattern[i] > '9' ? pattern.pattern[i] - 'A' + 10 : pattern.pattern[i] - '0';
|
||||
BYTE ln = pattern.pattern[i + 1] > '9' ? pattern.pattern[i + 1] - 'A' + 10 : pattern.pattern[i + 1] - '0';
|
||||
BYTE n = (hn << 4) | ln;
|
||||
|
||||
mask[bytesCounted] = 'x';
|
||||
patt[bytesCounted] = n;
|
||||
}
|
||||
|
||||
bytesCounted++;
|
||||
|
||||
i += 2;
|
||||
while (i < len && (pattern.pattern[i] == ' ' || pattern.pattern[i] == '\t' || pattern.pattern[i] == '\r' || pattern.pattern[i] == '\n'))
|
||||
i++;
|
||||
}
|
||||
if (bytesCounted <= byteCount)
|
||||
mask[bytesCounted] = '\0';
|
||||
|
||||
size_t searchLen = strlen(reinterpret_cast<char*>(&mask[0])) - 1;
|
||||
|
||||
LPVOID ret = nullptr;
|
||||
for (DWORD64 retAddress = reinterpret_cast<DWORD64>(startAddress); retAddress < reinterpret_cast<DWORD64>(startAddress) + searchSize; retAddress++) {
|
||||
__try {
|
||||
if ((pos < bytesCounted && *reinterpret_cast<BYTE*>(retAddress) == patt[pos]) || mask[pos] == '?') {
|
||||
if (bytesCounted <= byteCount && pos < bytesCounted && mask[pos + 1] == '\0') {
|
||||
ret = reinterpret_cast<LPVOID>(retAddress - searchLen + offset);
|
||||
break;
|
||||
}
|
||||
|
||||
pos++;
|
||||
} else
|
||||
pos = 0;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
pos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
free(patt);
|
||||
free(mask);
|
||||
|
||||
switch (pattern.type)
|
||||
{
|
||||
case PatternType::Pointer:
|
||||
ret = PatternScanner::ResolvePtr<DWORD64>(ret);
|
||||
break;
|
||||
|
||||
case PatternType::PointerBYTE:
|
||||
ret = PatternScanner::ResolvePtr<BYTE>(ret);
|
||||
break;
|
||||
|
||||
case PatternType::PointerWORD:
|
||||
ret = PatternScanner::ResolvePtr<WORD>(ret);
|
||||
break;
|
||||
|
||||
case PatternType::PointerQWORD:
|
||||
ret = PatternScanner::ResolvePtr<DWORD64>(ret);
|
||||
break;
|
||||
|
||||
case PatternType::RelativePointer:
|
||||
ret = PatternScanner::ResolveRelativePtr<int32_t>(ret);
|
||||
break;
|
||||
|
||||
case PatternType::RelativePointerBYTE:
|
||||
ret = PatternScanner::ResolveRelativePtr<BYTE>(ret);
|
||||
break;
|
||||
|
||||
case PatternType::RelativePointerWORD:
|
||||
ret = PatternScanner::ResolveRelativePtr<WORD>(ret);
|
||||
break;
|
||||
|
||||
case PatternType::RelativePointerQWORD:
|
||||
ret = PatternScanner::ResolveRelativePtr<DWORD64>(ret);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
LPVOID PatternScanner::FindPattern(LPVOID startAddress, DWORD64 searchSize, const Pattern* patterns, float *ratio) {
|
||||
int totalCount = 0;
|
||||
struct result {
|
||||
LPVOID addr;
|
||||
int count;
|
||||
};
|
||||
std::list<result> results;
|
||||
|
||||
int bestCount = 0;
|
||||
LPVOID ret = nullptr;
|
||||
|
||||
while (true) {
|
||||
Pattern pattern = patterns[totalCount];
|
||||
if (!pattern.pattern)
|
||||
break;
|
||||
|
||||
totalCount++;
|
||||
|
||||
LPVOID addr = PatternScanner::FindPattern(startAddress, searchSize, pattern);
|
||||
if (!addr)
|
||||
continue;
|
||||
|
||||
bool found = false;
|
||||
auto it = std::find_if(results.begin(), results.end(), [addr](result& res) { return res.addr == addr; });
|
||||
if (it != results.end()) {
|
||||
it->count++;
|
||||
|
||||
if (it->count > bestCount) {
|
||||
ret = addr;
|
||||
bestCount = it->count;
|
||||
}
|
||||
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
result res = { addr, 1 };
|
||||
results.push_back(res);
|
||||
|
||||
if (bestCount == 0) {
|
||||
bestCount = 1;
|
||||
ret = addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ratio)
|
||||
*ratio = static_cast<float>(bestCount) / totalCount;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
LPVOID PatternScanner::FindPattern(const std::string_view ModuleName, Pattern *patterns, float *ratio) {
|
||||
return PatternScanner::FindPattern(GetModuleHandle(ModuleName.data()), GetModuleSize(ModuleName.data()), patterns, ratio);
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
#include <Windows.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <Psapi.h>
|
||||
#include <string_view>
|
||||
|
||||
enum class PatternType {
|
||||
Address,
|
||||
Pointer,
|
||||
PointerBYTE,
|
||||
PointerWORD,
|
||||
PointerDWORD,
|
||||
PointerQWORD,
|
||||
RelativePointer,
|
||||
RelativePointerBYTE,
|
||||
RelativePointerWORD,
|
||||
RelativePointerDWORD,
|
||||
RelativePointerQWORD,
|
||||
};
|
||||
|
||||
struct Pattern {
|
||||
const char* pattern;
|
||||
PatternType type;
|
||||
};
|
||||
|
||||
class PatternScanner {
|
||||
private:
|
||||
template <typename T> static LPVOID ResolveRelativePtr(LPVOID Address) {
|
||||
if (!Address)
|
||||
return nullptr;
|
||||
|
||||
T offset = *reinterpret_cast<T*>(Address);
|
||||
if (!offset)
|
||||
return nullptr;
|
||||
|
||||
return reinterpret_cast<LPVOID>(reinterpret_cast<DWORD64>(Address) + offset + sizeof(T));
|
||||
}
|
||||
|
||||
template <typename T> static LPVOID ResolvePtr(LPVOID Address) {
|
||||
if (!Address)
|
||||
return nullptr;
|
||||
|
||||
return reinterpret_cast<LPVOID>(*reinterpret_cast<T*>(Address));
|
||||
}
|
||||
|
||||
public:
|
||||
static LPVOID FindPattern(LPVOID startAddress, DWORD64 searchSize, const Pattern &pattern);
|
||||
static LPVOID FindPattern(const std::string_view ModuleName, const Pattern &pattern);
|
||||
static LPVOID FindPattern(const Pattern &pattern);
|
||||
|
||||
static std::vector<LPVOID> FindPatterns(const std::string_view ModuleName, const Pattern &pattern);
|
||||
static std::vector<LPVOID> FindPatterns(LPVOID startAddress, DWORD64 searchSize, const Pattern &pattern);
|
||||
|
||||
static LPVOID FindPattern(LPVOID startAddress, DWORD64 searchSize, const Pattern* patterns, float *ratio = nullptr);
|
||||
static LPVOID FindPattern(const std::string_view ModuleName, Pattern* patterns, float *ratio = nullptr);
|
||||
};
|
||||
@@ -1,94 +0,0 @@
|
||||
#include <Windows.h>
|
||||
#include <shlobj.h>
|
||||
#include "utils.h"
|
||||
|
||||
namespace Utils {
|
||||
Timer::Timer(long timeMs) : timeToPass(timeMs), timePassed(false) {
|
||||
start = std::chrono::time_point_cast<std::chrono::milliseconds>(clock::now());
|
||||
}
|
||||
bool Timer::GetTimePassed() {
|
||||
if (timePassed)
|
||||
return timePassed;
|
||||
|
||||
auto end = clock::now();
|
||||
long timePassedMs = static_cast<long>((end - start).count());
|
||||
|
||||
if (timePassedMs < 0) {
|
||||
start = std::chrono::time_point_cast<std::chrono::milliseconds>(clock::now());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (timePassedMs >= timeToPass)
|
||||
timePassed = true;
|
||||
return timePassed;
|
||||
}
|
||||
|
||||
bool are_same(float a, float b) {
|
||||
return abs(a - b) < 0.0001f;
|
||||
}
|
||||
|
||||
bool str_replace(std::string& str, const std::string& from, const std::string& to) {
|
||||
const size_t start_pos = str.find(from);
|
||||
if (start_pos == std::string::npos)
|
||||
return false;
|
||||
|
||||
str.replace(start_pos, from.length(), to);
|
||||
return true;
|
||||
}
|
||||
|
||||
FARPROC GetProcAddr(std::string_view module, std::string_view funcName) {
|
||||
HMODULE moduleHandle = GetModuleHandleA(module.data());
|
||||
if (!moduleHandle)
|
||||
return nullptr;
|
||||
|
||||
return GetProcAddress(moduleHandle, funcName.data());
|
||||
}
|
||||
|
||||
std::string_view GetDesktopDir() {
|
||||
char path[MAX_PATH + 1];
|
||||
if (!SHGetSpecialFolderPathA(HWND_DESKTOP, path, CSIDL_DESKTOP, FALSE))
|
||||
return {};
|
||||
|
||||
return path;
|
||||
}
|
||||
WindowsVersion GetWindowsVersion() {
|
||||
OSVERSIONINFOEX info{};
|
||||
DWORDLONG dwlConditionMask = 0;
|
||||
|
||||
ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
|
||||
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
info.dwMajorVersion = 6;
|
||||
|
||||
VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_EQUAL);
|
||||
|
||||
if (VerifyVersionInfo(&info, VER_MAJORVERSION, dwlConditionMask)) {
|
||||
// The major version is 6.
|
||||
info.dwMinorVersion = 1;
|
||||
VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_EQUAL);
|
||||
|
||||
if (VerifyVersionInfo(&info, VER_MINORVERSION, dwlConditionMask))
|
||||
return WindowsVersion::Windows7;
|
||||
|
||||
info.dwMinorVersion = 2;
|
||||
VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_EQUAL);
|
||||
|
||||
if (VerifyVersionInfo(&info, VER_MINORVERSION, dwlConditionMask))
|
||||
return WindowsVersion::Windows10; // Windows 8 and 8.1 also use 6.2
|
||||
|
||||
info.dwMinorVersion = 3;
|
||||
VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_EQUAL);
|
||||
|
||||
if (VerifyVersionInfo(&info, VER_MINORVERSION, dwlConditionMask))
|
||||
return WindowsVersion::Windows10;
|
||||
} else {
|
||||
// The major version is not 6. Check if it's greater than 6.
|
||||
info.dwMajorVersion = 7;
|
||||
VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
|
||||
|
||||
if (VerifyVersionInfo(&info, VER_MAJORVERSION, dwlConditionMask))
|
||||
return WindowsVersion::Windows10;
|
||||
}
|
||||
|
||||
return WindowsVersion::Unknown;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#pragma once
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
|
||||
enum class WindowsVersion {
|
||||
Unknown,
|
||||
Windows7,
|
||||
Windows10,
|
||||
};
|
||||
|
||||
namespace Utils {
|
||||
class Timer {
|
||||
using clock = std::chrono::system_clock;
|
||||
using time_point_type = std::chrono::time_point<clock, std::chrono::milliseconds>;
|
||||
public:
|
||||
long timeToPass;
|
||||
Timer(long timeMs);
|
||||
|
||||
bool GetTimePassed();
|
||||
private:
|
||||
time_point_type start;
|
||||
bool timePassed;
|
||||
};
|
||||
|
||||
extern bool are_same(float a, float b);
|
||||
|
||||
extern bool str_replace(std::string& str, const std::string& from, const std::string& to);
|
||||
template <typename T>
|
||||
auto to_string(T val) {
|
||||
if constexpr (std::is_same<T, std::string>::value)
|
||||
return static_cast<std::string>(val);
|
||||
else
|
||||
return std::to_string(val);
|
||||
}
|
||||
|
||||
extern FARPROC GetProcAddr(std::string_view module, std::string_view funcName);
|
||||
|
||||
extern std::string_view GetDesktopDir();
|
||||
extern WindowsVersion GetWindowsVersion();
|
||||
}
|
||||
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33530.505
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DL2GameOverhaulScript", "DL2GameOverhaulScript\DL2GameOverhaulScript.vcxproj", "{6399CAFA-D04A-44FB-8C1D-1FC3A3B59C00}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EGameTools", "EGameTools\EGameTools.vcxproj", "{6399CAFA-D04A-44FB-8C1D-1FC3A3B59C00}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -0,0 +1,345 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch\pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\config\config.cpp" />
|
||||
<ClCompile Include="source\core.cpp" />
|
||||
<ClCompile Include="source\dllmain.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CBaseCamera.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CBulletPhysicsCharacter.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CGame.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CGSObject.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CGSObject2.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CInput.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CLevel.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CLevel2.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CLobbySteam.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CoPhysicsProperty.cpp" />
|
||||
<ClCompile Include="source\game\Engine\CVideoSettings.cpp" />
|
||||
<ClCompile Include="source\game\Engine\engine_hooks.cpp" />
|
||||
<ClCompile Include="source\game\Engine\engine_misc.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\DayNightCycle.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\FreeCamera.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\GameDI_PH.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\GameDI_PH2.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\game_hooks.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\InventoryContainerDI.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\InventoryItem.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\LevelDI.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\LocalClientDI.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\LogicalPlayer.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\gameph_misc.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\PlayerDI_PH.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\PlayerHealthModule.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\PlayerInfectionModule.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\PlayerState.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\PlayerVariables.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\SessionCooperativeDI.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\TimeWeather\CSystem.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\TPPCameraDI.cpp" />
|
||||
<ClCompile Include="source\game\Vector3.cpp" />
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx11.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx12.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_win32.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imguiex.cpp" />
|
||||
<ClCompile Include="source\ImGui\imguiex_animation.cpp" />
|
||||
<ClCompile Include="source\ImGui\ImGuiFileDialog\ImGuiFileDialog.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_draw.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_hotkey.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_tables.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_widgets.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\impl\d3d11_impl.cpp" />
|
||||
<ClCompile Include="source\ImGui\impl\d3d12_impl.cpp" />
|
||||
<ClCompile Include="source\ImGui\impl\win32_impl.cpp" />
|
||||
<ClCompile Include="source\ImGui\misc\freetype\imgui_freetype.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\kiero.cpp" />
|
||||
<ClCompile Include="source\memscan\memscan.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\memscan\util\util.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\camera.cpp" />
|
||||
<ClCompile Include="source\menu\debug.cpp" />
|
||||
<ClCompile Include="source\menu\init.cpp" />
|
||||
<ClCompile Include="source\menu\menu.cpp" />
|
||||
<ClCompile Include="source\menu\misc.cpp" />
|
||||
<ClCompile Include="source\menu\player.cpp" />
|
||||
<ClCompile Include="source\menu\teleport.cpp" />
|
||||
<ClCompile Include="source\menu\weapon.cpp" />
|
||||
<ClCompile Include="source\menu\world.cpp" />
|
||||
<ClCompile Include="source\utils\files.cpp" />
|
||||
<ClCompile Include="source\utils\hook.cpp" />
|
||||
<ClCompile Include="source\utils\memory.cpp" />
|
||||
<ClCompile Include="source\utils\rtti.cpp" />
|
||||
<ClCompile Include="source\utils\sigscan.cpp" />
|
||||
<ClCompile Include="source\utils\texture.cpp" />
|
||||
<ClCompile Include="source\utils\time.cpp" />
|
||||
<ClCompile Include="source\utils\values.cpp" />
|
||||
<ClCompile Include="source\utils\windows.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch\pch.h" />
|
||||
<ClInclude Include="source\changelog.h" />
|
||||
<ClInclude Include="source\config\config.h" />
|
||||
<ClInclude Include="source\config\ini.h" />
|
||||
<ClInclude Include="source\core.h" />
|
||||
<ClInclude Include="source\game\buffer.h" />
|
||||
<ClInclude Include="source\game\Engine\CBaseCamera.h" />
|
||||
<ClInclude Include="source\game\Engine\CBulletPhysicsCharacter.h" />
|
||||
<ClInclude Include="source\game\Engine\CGame.h" />
|
||||
<ClInclude Include="source\game\Engine\CGSObject.h" />
|
||||
<ClInclude Include="source\game\Engine\CGSObject2.h" />
|
||||
<ClInclude Include="source\game\Engine\CInput.h" />
|
||||
<ClInclude Include="source\game\Engine\CLevel.h" />
|
||||
<ClInclude Include="source\game\Engine\CLevel2.h" />
|
||||
<ClInclude Include="source\game\Engine\CLobbySteam.h" />
|
||||
<ClInclude Include="source\game\Engine\CoPhysicsProperty.h" />
|
||||
<ClInclude Include="source\game\Engine\CVideoSettings.h" />
|
||||
<ClInclude Include="source\game\Engine\engine_hooks.h" />
|
||||
<ClInclude Include="source\game\Engine\engine_misc.h" />
|
||||
<ClInclude Include="source\game\GamePH\CoBaseCameraProxy.h" />
|
||||
<ClInclude Include="source\game\GamePH\DayNightCycle.h" />
|
||||
<ClInclude Include="source\game\GamePH\FreeCamera.h" />
|
||||
<ClInclude Include="source\game\GamePH\GameDI_PH.h" />
|
||||
<ClInclude Include="source\game\GamePH\GameDI_PH2.h" />
|
||||
<ClInclude Include="source\game\GamePH\InventoryContainerDI.h" />
|
||||
<ClInclude Include="source\game\GamePH\InventoryItem.h" />
|
||||
<ClInclude Include="source\game\GamePH\InventoryMoney.h" />
|
||||
<ClInclude Include="source\game\GamePH\ItemDescWithContext.h" />
|
||||
<ClInclude Include="source\game\GamePH\LevelDI.h" />
|
||||
<ClInclude Include="source\game\GamePH\LocalClientDI.h" />
|
||||
<ClInclude Include="source\game\GamePH\LogicalPlayer.h" />
|
||||
<ClInclude Include="source\game\GamePH\gameph_misc.h" />
|
||||
<ClInclude Include="source\game\GamePH\PlayerDI_PH.h" />
|
||||
<ClInclude Include="source\game\GamePH\PlayerHealthModule.h" />
|
||||
<ClInclude Include="source\game\GamePH\PlayerInfectionModule.h" />
|
||||
<ClInclude Include="source\game\GamePH\PlayerState.h" />
|
||||
<ClInclude Include="source\game\GamePH\PlayerVariables.h" />
|
||||
<ClInclude Include="source\game\GamePH\SessionCooperativeDI.h" />
|
||||
<ClInclude Include="source\game\GamePH\TimeWeather\CSystem.h" />
|
||||
<ClInclude Include="source\game\GamePH\TimeWeather\EWeather.h" />
|
||||
<ClInclude Include="source\game\GamePH\TPPCameraDI.h" />
|
||||
<ClInclude Include="source\game\Vector3.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx11.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx12.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_win32.h" />
|
||||
<ClInclude Include="source\ImGui\imconfig.h" />
|
||||
<ClInclude Include="source\ImGui\imgui.h" />
|
||||
<ClInclude Include="source\ImGui\imguiex.h" />
|
||||
<ClInclude Include="source\ImGui\imguiex_animation.h" />
|
||||
<ClInclude Include="source\ImGui\ImGuiFileDialog\ImGuiFileDialog.h" />
|
||||
<ClInclude Include="source\ImGui\ImGuiFileDialog\ImGuiFileDialogConfig.h" />
|
||||
<ClInclude Include="source\ImGui\imgui_hotkey.h" />
|
||||
<ClInclude Include="source\ImGui\imgui_internal.h" />
|
||||
<ClInclude Include="source\ImGui\impl\d3d11_impl.h" />
|
||||
<ClInclude Include="source\ImGui\impl\d3d12_impl.h" />
|
||||
<ClInclude Include="source\ImGui\impl\win32_impl.h" />
|
||||
<ClInclude Include="source\ImGui\imstb_rectpack.h" />
|
||||
<ClInclude Include="source\ImGui\imstb_textedit.h" />
|
||||
<ClInclude Include="source\ImGui\imstb_truetype.h" />
|
||||
<ClInclude Include="source\ImGui\misc\freetype\imgui_freetype.h" />
|
||||
<ClInclude Include="source\kiero.h" />
|
||||
<ClInclude Include="source\memscan\memscan.h" />
|
||||
<ClInclude Include="source\memscan\util\util.h" />
|
||||
<ClInclude Include="source\menu\camera.h" />
|
||||
<ClInclude Include="source\menu\debug.h" />
|
||||
<ClInclude Include="source\menu\init.h" />
|
||||
<ClInclude Include="source\menu\menu.h" />
|
||||
<ClInclude Include="source\menu\misc.h" />
|
||||
<ClInclude Include="source\menu\player.h" />
|
||||
<ClInclude Include="source\menu\teleport.h" />
|
||||
<ClInclude Include="source\menu\weapon.h" />
|
||||
<ClInclude Include="source\menu\world.h" />
|
||||
<ClInclude Include="source\MinHook\MinHook.h" />
|
||||
<ClInclude Include="source\offsets.h" />
|
||||
<ClInclude Include="source\utils\files.h" />
|
||||
<ClInclude Include="source\utils\hook.h" />
|
||||
<ClInclude Include="source\utils\memory.h" />
|
||||
<ClInclude Include="source\utils\rtti.h" />
|
||||
<ClInclude Include="source\utils\sigscan.h" />
|
||||
<ClInclude Include="source\utils\texture.h" />
|
||||
<ClInclude Include="source\utils\time.h" />
|
||||
<ClInclude Include="source\utils\values.h" />
|
||||
<ClInclude Include="source\utils\windows.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{6399cafa-d04a-44fb-8c1d-1fc3a3b59c00}</ProjectGuid>
|
||||
<RootNamespace>EGameTools</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>EGameTools</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<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|x64'">
|
||||
<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)'=='Release|x64'">
|
||||
<TargetExt>.asi</TargetExt>
|
||||
<TargetName>EGameTools</TargetName>
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
|
||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TargetName>EGameTools</TargetName>
|
||||
<TargetExt>.asi</TargetExt>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<VcpkgUseStatic>true</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x64-windows</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<VcpkgUseStatic>true</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x64-windows</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgEnabled>false</VcpkgEnabled>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING;_DEBUG;EGameTools_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<Optimization>
|
||||
</Optimization>
|
||||
<IntrinsicFunctions>
|
||||
</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>pch;source\spdlog\include;source\ImGui\freetype\include;source\ImGui;source\MinHook;source\memscan;</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)_$(PlatformTarget).pch</PrecompiledHeaderOutputFile>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<MultiProcessorCompilation>
|
||||
</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>DbgHelp.lib;Version.lib;spdlog-mtd.lib;freetype-mtd.lib;libMinHook-x64-v141-mtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OptimizeReferences>
|
||||
</OptimizeReferences>
|
||||
<EnableCOMDATFolding>
|
||||
</EnableCOMDATFolding>
|
||||
<AdditionalLibraryDirectories>source\spdlog\lib;source\ImGui\freetype\lib;source\MinHook\lib;</AdditionalLibraryDirectories>
|
||||
<AssemblyDebug>true</AssemblyDebug>
|
||||
<ImportLibrary />
|
||||
<FixedBaseAddress>
|
||||
</FixedBaseAddress>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y "$(SolutionDir)Extra Files\Default Config\EGameTools.ini" "$(SolutionDir)$(PlatformShortName)\$(Configuration)\EGameTools.ini"</Command>
|
||||
<Message>Copying the default config file to the debug build directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>pch;source\spdlog\include;source\ImGui\freetype\include;source\ImGui;source\MinHook;source\memscan;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)_$(PlatformTarget).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalLibraryDirectories>source\spdlog\lib;source\ImGui\freetype\lib;source\MinHook\lib;source\CrashRpt\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>DbgHelp.lib;Version.lib;spdlog-mt.lib;freetype-mt.lib;libMinHook-x64-v141-mtd.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ImportLibrary />
|
||||
<AdditionalOptions>/NOIMPLIB /NOEXP %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblyDebug>true</AssemblyDebug>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y "$(SolutionDir)Extra Files\Default Config\EGameTools.ini" "$(SolutionDir)$(PlatformShortName)\$(Configuration)\EGameTools.ini"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying the default config file to the release build directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,513 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="source\core.cpp" />
|
||||
<ClCompile Include="source\dllmain.cpp" />
|
||||
<ClCompile Include="source\kiero.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_draw.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_tables.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_widgets.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx11.cpp">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx12.cpp">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_win32.cpp">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\impl\d3d11_impl.cpp">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\impl\win32_impl.cpp">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\camera.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\menu.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\impl\d3d12_impl.cpp">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\config\config.cpp">
|
||||
<Filter>config</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\player.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\world.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\misc.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\files.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\values.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\windows.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\time.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\memory.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\sigscan.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\hook.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imguiex.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imguiex_animation.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_hotkey.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\ImGuiFileDialog\ImGuiFileDialog.cpp">
|
||||
<Filter>ImGui\ImGuiFileDialog</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Vector3.cpp">
|
||||
<Filter>game</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CGame.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CGSObject.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CGSObject2.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CInput.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CLevel.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CLevel2.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CLobbySteam.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CoPhysicsProperty.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CVideoSettings.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\engine_hooks.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CBaseCamera.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\CBulletPhysicsCharacter.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\FreeCamera.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\GameDI_PH.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\GameDI_PH2.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\game_hooks.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\LevelDI.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\LocalClientDI.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\LogicalPlayer.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\gameph_misc.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\PlayerHealthModule.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\PlayerObjProperties.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\PlayerState.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\PlayerVariables.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\SessionCooperativeDI.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\TPPCameraDI.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\DayNightCycle.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\TimeWeather\CSystem.cpp">
|
||||
<Filter>game\GamePH\TimeWeather</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch\pch.cpp" />
|
||||
<ClCompile Include="source\game\GamePH\PlayerDI_PH.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\debug.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\texture.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\misc\freetype\imgui_freetype.cpp">
|
||||
<Filter>ImGui\misc\freetype</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\init.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\Engine\engine_misc.cpp">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\PlayerInfectionModule.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\utils\rtti.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\weapon.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\InventoryItem.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\game\GamePH\InventoryContainerDI.cpp">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\menu\teleport.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\memscan\memscan.c">
|
||||
<Filter>memscan</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\memscan\util\util.c">
|
||||
<Filter>memscan\util</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="source\kiero.h" />
|
||||
<ClInclude Include="source\ImGui\imconfig.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imgui.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imgui_internal.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imstb_rectpack.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imstb_textedit.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imstb_truetype.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx11.h">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx12.h">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_win32.h">
|
||||
<Filter>ImGui\backends</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\impl\d3d11_impl.h">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\impl\win32_impl.h">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\camera.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\menu.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\core.h" />
|
||||
<ClInclude Include="source\ImGui\impl\d3d12_impl.h">
|
||||
<Filter>ImGui\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\config\ini.h">
|
||||
<Filter>config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\config\config.h">
|
||||
<Filter>config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\player.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\world.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\misc.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\files.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\values.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\windows.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\time.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\memory.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\sigscan.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\offsets.h" />
|
||||
<ClInclude Include="source\utils\hook.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\MinHook\MinHook.h">
|
||||
<Filter>MinHook</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imguiex.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imguiex_animation.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\imgui_hotkey.h">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\ImGuiFileDialog\ImGuiFileDialog.h">
|
||||
<Filter>ImGui\ImGuiFileDialog</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\ImGuiFileDialog\ImGuiFileDialogConfig.h">
|
||||
<Filter>ImGui\ImGuiFileDialog</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\buffer.h">
|
||||
<Filter>game</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Vector3.h">
|
||||
<Filter>game</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CBulletPhysicsCharacter.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CGame.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CGSObject.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CGSObject2.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CInput.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CLevel.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CLevel2.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CLobbySteam.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CoPhysicsProperty.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CVideoSettings.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\CBaseCamera.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\DayNightCycle.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\FreeCamera.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\GameDI_PH.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\GameDI_PH2.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\LevelDI.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\LocalClientDI.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\LogicalPlayer.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\gameph_misc.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\PlayerHealthModule.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\PlayerObjProperties.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\PlayerState.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\PlayerVariables.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\SessionCooperativeDI.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\TPPCameraDI.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\CoBaseCameraProxy.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\TimeWeather\CSystem.h">
|
||||
<Filter>game\GamePH\TimeWeather</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\TimeWeather\EWeather.h">
|
||||
<Filter>game\GamePH\TimeWeather</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch\pch.h" />
|
||||
<ClInclude Include="source\game\Engine\engine_hooks.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\changelog.h" />
|
||||
<ClInclude Include="source\game\GamePH\PlayerDI_PH.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\debug.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\texture.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGui\misc\freetype\imgui_freetype.h">
|
||||
<Filter>ImGui\misc\freetype</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\init.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\Engine\engine_misc.h">
|
||||
<Filter>game\Engine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\PlayerInfectionModule.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\utils\rtti.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\weapon.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\InventoryItem.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\ItemDescWithContext.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\InventoryContainerDI.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\game\GamePH\InventoryMoney.h">
|
||||
<Filter>game\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\menu\teleport.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\memscan\memscan.h">
|
||||
<Filter>memscan</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\memscan\util\util.h">
|
||||
<Filter>memscan\util</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="MinHook">
|
||||
<UniqueIdentifier>{794284a1-160f-4b62-bfd0-d160dbb38e40}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui">
|
||||
<UniqueIdentifier>{8b35dc3d-fbec-4ae6-af90-4b9cc2b758e3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui\backends">
|
||||
<UniqueIdentifier>{70e27b28-a2be-49e4-a4a1-5ed696079ee0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui\impl">
|
||||
<UniqueIdentifier>{28cd5a16-84b1-4a9e-96a4-79fc75982912}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="menu">
|
||||
<UniqueIdentifier>{775559c7-e9f6-49d5-a2d4-6458b99e8cd9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="config">
|
||||
<UniqueIdentifier>{50f832bc-5ff2-45db-8d20-e8f458c78596}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="utils">
|
||||
<UniqueIdentifier>{0e7be9b3-e988-471b-95e5-51ca0c69a046}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui\ImGuiFileDialog">
|
||||
<UniqueIdentifier>{bb4754c3-ee86-4349-bbf1-2cc4e298052e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="game">
|
||||
<UniqueIdentifier>{8a23ad21-b2aa-444a-b20e-a87689d4f649}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="game\GamePH">
|
||||
<UniqueIdentifier>{9afd9b80-0702-47ac-b291-27c901911b46}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="game\GamePH\TimeWeather">
|
||||
<UniqueIdentifier>{383948e8-c7b5-46bc-bec6-7cfffb473f5b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="game\Engine">
|
||||
<UniqueIdentifier>{06a6e99d-eb6b-4430-bd86-76f3aed2ab32}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui\misc">
|
||||
<UniqueIdentifier>{838a40a1-3f7e-49e0-949c-07c534592052}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGui\misc\freetype">
|
||||
<UniqueIdentifier>{122420d5-ac60-4778-80bf-1384697fcc44}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="memscan">
|
||||
<UniqueIdentifier>{1e82ab1f-550e-4fac-8fac-0888e1e62873}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="memscan\util">
|
||||
<UniqueIdentifier>{7e81ee9f-f74a-4af8-8a10-7530b26c3c86}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LocalDebuggerCommand>D:\Program Files (x86)\Steam\steamapps\common\Dying Light 2\ph\work\bin\x64\DyingLightGame_x64_rwdi.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>D:\Program Files (x86)\Steam\steamapps\common\Dying Light 2\ph\work\bin\x64</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LocalDebuggerCommand>D:\Program Files (x86)\Steam\steamapps\common\Dying Light 2\ph\work\bin\x64\DyingLightGame_x64_rwdi.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>D:\Program Files (x86)\Steam\steamapps\common\Dying Light 2\ph\work\bin\x64</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1 @@
|
||||
#include "pch.h"
|
||||
@@ -0,0 +1,87 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include <DbgHelp.h>
|
||||
#include <any>
|
||||
#include <filesystem>
|
||||
#include <exception>
|
||||
#include <ctype.h>
|
||||
#include <cfloat>
|
||||
#include <cstring>
|
||||
#include <cstdarg>
|
||||
#include <iomanip>
|
||||
#include <ctime>
|
||||
#include <cstdio>
|
||||
#include <cerrno>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <complex>
|
||||
#include <list>
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
#include <assert.h>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <semaphore>
|
||||
#include <atomic>
|
||||
|
||||
#include <dxgi.h>
|
||||
#include <dxgi1_4.h>
|
||||
#include <d3d11.h>
|
||||
#include <d3d12.h>
|
||||
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include <spdlog\spdlog.h>
|
||||
#include <spdlog\sinks\rotating_file_sink.h>
|
||||
#include <backends\imgui_impl_dx11.h>
|
||||
#include <backends\imgui_impl_dx12.h>
|
||||
#include <backends\imgui_impl_win32.h>
|
||||
#include <impl\d3d11_impl.h>
|
||||
#include <impl\d3d12_impl.h>
|
||||
#include <impl\win32_impl.h>
|
||||
#include <misc\dirent\dirent.h>
|
||||
#include <misc\fonts\Ruda-Bold.embed>
|
||||
#include <ImGuiFileDialog\ImGuiFileDialog.h>
|
||||
#include <ImGuiFileDialog\ImGuiFileDialogConfig.h>
|
||||
#include <imconfig.h>
|
||||
#include <imgui_hotkey.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <imguiex.h>
|
||||
#include <imguiex_animation.h>
|
||||
#include <imstb_rectpack.h>
|
||||
#include <imstb_textedit.h>
|
||||
#include <imstb_truetype.h>
|
||||
#include <MinHook.h>
|
||||
#include <memscan.h>
|
||||
|
||||
#include "..\source\config\ini.h"
|
||||
#include "..\source\game\Engine\GameSpeedHandler.h"
|
||||
#include "..\source\game\Vector3.h"
|
||||
#include "..\source\game\buffer.h"
|
||||
#include "..\source\utils\files.h"
|
||||
#include "..\source\utils\hook.h"
|
||||
#include "..\source\utils\memory.h"
|
||||
#include "..\source\utils\rtti.h"
|
||||
#include "..\source\utils\sigscan.h"
|
||||
#include "..\source\utils\texture.h"
|
||||
#include "..\source\utils\time.h"
|
||||
#include "..\source\utils\values.h"
|
||||
#include "..\source\utils\windows.h"
|
||||
#include "..\source\kiero.h"
|
||||
|
||||
#include "..\textures\EGTWhiteLogo.embed"
|
||||
+252
-263
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2023 Omar Cornut
|
||||
Copyright (c) 2014-2024 Omar Cornut
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
+10
-7
@@ -7,8 +7,11 @@
|
||||
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
// Learn about Dear ImGui:
|
||||
// - FAQ https://dearimgui.com/faq
|
||||
// - Getting Started https://dearimgui.com/getting-started
|
||||
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
||||
// - Introduction, links and more at the top of imgui.cpp
|
||||
|
||||
// CHANGELOG
|
||||
// (minor and older changes stripped away, please see git history for details)
|
||||
@@ -30,7 +33,7 @@
|
||||
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
|
||||
// 2016-05-07: DirectX11: Disabling depth-write.
|
||||
|
||||
#include <imgui.h>
|
||||
#include "imgui.h"
|
||||
#ifndef IMGUI_DISABLE
|
||||
#include "imgui_impl_dx11.h"
|
||||
|
||||
@@ -423,9 +426,9 @@ bool ImGui_ImplDX11_CreateDeviceObjects()
|
||||
// Create the input layout
|
||||
D3D11_INPUT_ELEMENT_DESC local_layout[] =
|
||||
{
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, uv), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (UINT)IM_OFFSETOF(ImDrawVert, col), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)offsetof(ImDrawVert, pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)offsetof(ImDrawVert, uv), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (UINT)offsetof(ImDrawVert, col), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
};
|
||||
if (bd->pd3dDevice->CreateInputLayout(local_layout, 3, vertexShaderBlob->GetBufferPointer(), vertexShaderBlob->GetBufferSize(), &bd->pInputLayout) != S_OK)
|
||||
{
|
||||
@@ -460,7 +463,7 @@ bool ImGui_ImplDX11_CreateDeviceObjects()
|
||||
\
|
||||
float4 main(PS_INPUT input) : SV_Target\
|
||||
{\
|
||||
float4 out_col = pow(input.col, 2.2) * texture0.Sample(sampler0, input.uv); \
|
||||
float4 out_col = input.col * texture0.Sample(sampler0, input.uv); \
|
||||
return out_col; \
|
||||
}";
|
||||
|
||||
+6
-3
@@ -7,11 +7,14 @@
|
||||
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
// Learn about Dear ImGui:
|
||||
// - FAQ https://dearimgui.com/faq
|
||||
// - Getting Started https://dearimgui.com/getting-started
|
||||
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
||||
// - Introduction, links and more at the top of imgui.cpp
|
||||
|
||||
#pragma once
|
||||
#include <imgui.h> // IMGUI_IMPL_API
|
||||
#include "imgui.h" // IMGUI_IMPL_API
|
||||
#ifndef IMGUI_DISABLE
|
||||
|
||||
struct ID3D11Device;
|
||||
+9
-6
@@ -15,8 +15,11 @@
|
||||
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
// Learn about Dear ImGui:
|
||||
// - FAQ https://dearimgui.com/faq
|
||||
// - Getting Started https://dearimgui.com/getting-started
|
||||
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
||||
// - Introduction, links and more at the top of imgui.cpp
|
||||
|
||||
// CHANGELOG
|
||||
// (minor and older changes stripped away, please see git history for details)
|
||||
@@ -38,7 +41,7 @@
|
||||
// 2018-06-08: DirectX12: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle (to ease support for future multi-viewport).
|
||||
// 2018-02-22: Merged into master with all Win32 code synchronized to other examples.
|
||||
|
||||
#include <imgui.h>
|
||||
#include "imgui.h"
|
||||
#ifndef IMGUI_DISABLE
|
||||
#include "imgui_impl_dx12.h"
|
||||
|
||||
@@ -589,9 +592,9 @@ bool ImGui_ImplDX12_CreateDeviceObjects()
|
||||
// Create the input layout
|
||||
static D3D12_INPUT_ELEMENT_DESC local_layout[] =
|
||||
{
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, pos), D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, uv), D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (UINT)IM_OFFSETOF(ImDrawVert, col), D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)offsetof(ImDrawVert, pos), D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)offsetof(ImDrawVert, uv), D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (UINT)offsetof(ImDrawVert, col), D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
};
|
||||
psoDesc.InputLayout = { local_layout, 3 };
|
||||
}
|
||||
+6
-3
@@ -10,11 +10,14 @@
|
||||
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
// Learn about Dear ImGui:
|
||||
// - FAQ https://dearimgui.com/faq
|
||||
// - Getting Started https://dearimgui.com/getting-started
|
||||
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
||||
// - Introduction, links and more at the top of imgui.cpp
|
||||
|
||||
#pragma once
|
||||
#include <imgui.h> // IMGUI_IMPL_API
|
||||
#include "imgui.h" // IMGUI_IMPL_API
|
||||
#ifndef IMGUI_DISABLE
|
||||
#include <dxgiformat.h> // DXGI_FORMAT
|
||||
|
||||
+45
-6
@@ -10,10 +10,13 @@
|
||||
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
// Learn about Dear ImGui:
|
||||
// - FAQ https://dearimgui.com/faq
|
||||
// - Getting Started https://dearimgui.com/getting-started
|
||||
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
||||
// - Introduction, links and more at the top of imgui.cpp
|
||||
|
||||
#include <imgui.h>
|
||||
#include "imgui.h"
|
||||
#ifndef IMGUI_DISABLE
|
||||
#include "imgui_impl_win32.h"
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
@@ -36,6 +39,9 @@ typedef DWORD (WINAPI *PFN_XInputGetState)(DWORD, XINPUT_STATE*);
|
||||
|
||||
// CHANGELOG
|
||||
// (minor and older changes stripped away, please see git history for details)
|
||||
// 2023-10-05: Inputs: Added support for extra ImGuiKey values: F13 to F24 function keys, app back/forward keys.
|
||||
// 2023-09-25: Inputs: Synthesize key-down event on key-up for VK_SNAPSHOT / ImGuiKey_PrintScreen as Windows doesn't emit it (same behavior as GLFW/SDL).
|
||||
// 2023-09-07: Inputs: Added support for keyboard codepage conversion for when application is compiled in MBCS mode and using a non-Unicode window.
|
||||
// 2023-04-19: Added ImGui_ImplWin32_InitForOpenGL() to facilitate combining raw Win32/Winapi with OpenGL. (#3218)
|
||||
// 2023-04-04: Inputs: Added support for io.AddMouseSourceEvent() to discriminate ImGuiMouseSource_Mouse/ImGuiMouseSource_TouchScreen/ImGuiMouseSource_Pen. (#2702)
|
||||
// 2023-02-15: Inputs: Use WM_NCMOUSEMOVE / WM_NCMOUSELEAVE to track mouse position over non-client area (e.g. OS decorations) when app is not focused. (#6045, #6162)
|
||||
@@ -94,6 +100,7 @@ struct ImGui_ImplWin32_Data
|
||||
INT64 Time;
|
||||
INT64 TicksPerSecond;
|
||||
ImGuiMouseCursor LastMouseCursor;
|
||||
UINT32 KeyboardCodePage;
|
||||
|
||||
#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
|
||||
bool HasGamepad;
|
||||
@@ -116,6 +123,16 @@ static ImGui_ImplWin32_Data* ImGui_ImplWin32_GetBackendData()
|
||||
}
|
||||
|
||||
// Functions
|
||||
static void ImGui_ImplWin32_UpdateKeyboardCodePage()
|
||||
{
|
||||
// Retrieve keyboard code page, required for handling of non-Unicode Windows.
|
||||
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData();
|
||||
HKL keyboard_layout = ::GetKeyboardLayout(0);
|
||||
LCID keyboard_lcid = MAKELCID(HIWORD(keyboard_layout), SORT_DEFAULT);
|
||||
if (::GetLocaleInfoA(keyboard_lcid, (LOCALE_RETURN_NUMBER | LOCALE_IDEFAULTANSICODEPAGE), (LPSTR)&bd->KeyboardCodePage, sizeof(bd->KeyboardCodePage)) == 0)
|
||||
bd->KeyboardCodePage = CP_ACP; // Fallback to default ANSI code page when fails.
|
||||
}
|
||||
|
||||
static bool ImGui_ImplWin32_InitEx(void* hwnd, bool platform_has_own_dc)
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
@@ -138,6 +155,7 @@ static bool ImGui_ImplWin32_InitEx(void* hwnd, bool platform_has_own_dc)
|
||||
bd->TicksPerSecond = perf_frequency;
|
||||
bd->Time = perf_counter;
|
||||
bd->LastMouseCursor = ImGuiMouseCursor_COUNT;
|
||||
ImGui_ImplWin32_UpdateKeyboardCodePage();
|
||||
|
||||
// Set platform dependent data in viewport
|
||||
ImGui::GetMainViewport()->PlatformHandleRaw = (void*)hwnd;
|
||||
@@ -499,6 +517,20 @@ static ImGuiKey ImGui_ImplWin32_VirtualKeyToImGuiKey(WPARAM wParam)
|
||||
case VK_F10: return ImGuiKey_F10;
|
||||
case VK_F11: return ImGuiKey_F11;
|
||||
case VK_F12: return ImGuiKey_F12;
|
||||
case VK_F13: return ImGuiKey_F13;
|
||||
case VK_F14: return ImGuiKey_F14;
|
||||
case VK_F15: return ImGuiKey_F15;
|
||||
case VK_F16: return ImGuiKey_F16;
|
||||
case VK_F17: return ImGuiKey_F17;
|
||||
case VK_F18: return ImGuiKey_F18;
|
||||
case VK_F19: return ImGuiKey_F19;
|
||||
case VK_F20: return ImGuiKey_F20;
|
||||
case VK_F21: return ImGuiKey_F21;
|
||||
case VK_F22: return ImGuiKey_F22;
|
||||
case VK_F23: return ImGuiKey_F23;
|
||||
case VK_F24: return ImGuiKey_F24;
|
||||
case VK_BROWSER_BACK: return ImGuiKey_AppBack;
|
||||
case VK_BROWSER_FORWARD: return ImGuiKey_AppForward;
|
||||
default: return ImGuiKey_None;
|
||||
}
|
||||
}
|
||||
@@ -640,10 +672,14 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARA
|
||||
int vk = (int)wParam;
|
||||
if ((wParam == VK_RETURN) && (HIWORD(lParam) & KF_EXTENDED))
|
||||
vk = IM_VK_KEYPAD_ENTER;
|
||||
|
||||
// Submit key event
|
||||
const ImGuiKey key = ImGui_ImplWin32_VirtualKeyToImGuiKey(vk);
|
||||
const int scancode = (int)LOBYTE(HIWORD(lParam));
|
||||
|
||||
// Special behavior for VK_SNAPSHOT / ImGuiKey_PrintScreen as Windows doesn't emit the key down event.
|
||||
if (key == ImGuiKey_PrintScreen && !is_key_down)
|
||||
ImGui_ImplWin32_AddKeyEvent(key, true, vk, scancode);
|
||||
|
||||
// Submit key event
|
||||
if (key != ImGuiKey_None)
|
||||
ImGui_ImplWin32_AddKeyEvent(key, is_key_down, vk, scancode);
|
||||
|
||||
@@ -671,6 +707,9 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARA
|
||||
case WM_KILLFOCUS:
|
||||
io.AddFocusEvent(msg == WM_SETFOCUS);
|
||||
return 0;
|
||||
case WM_INPUTLANGCHANGE:
|
||||
ImGui_ImplWin32_UpdateKeyboardCodePage();
|
||||
return 0;
|
||||
case WM_CHAR:
|
||||
if (::IsWindowUnicode(hwnd))
|
||||
{
|
||||
@@ -681,7 +720,7 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARA
|
||||
else
|
||||
{
|
||||
wchar_t wch = 0;
|
||||
::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (char*)&wParam, 1, &wch, 1);
|
||||
::MultiByteToWideChar(bd->KeyboardCodePage, MB_PRECOMPOSED, (char*)&wParam, 1, &wch, 1);
|
||||
io.AddInputCharacter(wch);
|
||||
}
|
||||
return 0;
|
||||
+6
-3
@@ -10,11 +10,14 @@
|
||||
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
// Learn about Dear ImGui:
|
||||
// - FAQ https://dearimgui.com/faq
|
||||
// - Getting Started https://dearimgui.com/getting-started
|
||||
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
||||
// - Introduction, links and more at the top of imgui.cpp
|
||||
|
||||
#pragma once
|
||||
#include <imgui.h> // IMGUI_IMPL_API
|
||||
#include "imgui.h" // IMGUI_IMPL_API
|
||||
#ifndef IMGUI_DISABLE
|
||||
|
||||
IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd);
|
||||
@@ -0,0 +1,169 @@
|
||||
The FreeType Project LICENSE
|
||||
----------------------------
|
||||
|
||||
2006-Jan-27
|
||||
|
||||
Copyright 1996-2002, 2006 by
|
||||
David Turner, Robert Wilhelm, and Werner Lemberg
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
The FreeType Project is distributed in several archive packages;
|
||||
some of them may contain, in addition to the FreeType font engine,
|
||||
various tools and contributions which rely on, or relate to, the
|
||||
FreeType Project.
|
||||
|
||||
This license applies to all files found in such packages, and
|
||||
which do not fall under their own explicit license. The license
|
||||
affects thus the FreeType font engine, the test programs,
|
||||
documentation and makefiles, at the very least.
|
||||
|
||||
This license was inspired by the BSD, Artistic, and IJG
|
||||
(Independent JPEG Group) licenses, which all encourage inclusion
|
||||
and use of free software in commercial and freeware products
|
||||
alike. As a consequence, its main points are that:
|
||||
|
||||
o We don't promise that this software works. However, we will be
|
||||
interested in any kind of bug reports. (`as is' distribution)
|
||||
|
||||
o You can use this software for whatever you want, in parts or
|
||||
full form, without having to pay us. (`royalty-free' usage)
|
||||
|
||||
o You may not pretend that you wrote this software. If you use
|
||||
it, or only parts of it, in a program, you must acknowledge
|
||||
somewhere in your documentation that you have used the
|
||||
FreeType code. (`credits')
|
||||
|
||||
We specifically permit and encourage the inclusion of this
|
||||
software, with or without modifications, in commercial products.
|
||||
We disclaim all warranties covering The FreeType Project and
|
||||
assume no liability related to The FreeType Project.
|
||||
|
||||
|
||||
Finally, many people asked us for a preferred form for a
|
||||
credit/disclaimer to use in compliance with this license. We thus
|
||||
encourage you to use the following text:
|
||||
|
||||
"""
|
||||
Portions of this software are copyright © <year> The FreeType
|
||||
Project (www.freetype.org). All rights reserved.
|
||||
"""
|
||||
|
||||
Please replace <year> with the value from the FreeType version you
|
||||
actually use.
|
||||
|
||||
|
||||
Legal Terms
|
||||
===========
|
||||
|
||||
0. Definitions
|
||||
--------------
|
||||
|
||||
Throughout this license, the terms `package', `FreeType Project',
|
||||
and `FreeType archive' refer to the set of files originally
|
||||
distributed by the authors (David Turner, Robert Wilhelm, and
|
||||
Werner Lemberg) as the `FreeType Project', be they named as alpha,
|
||||
beta or final release.
|
||||
|
||||
`You' refers to the licensee, or person using the project, where
|
||||
`using' is a generic term including compiling the project's source
|
||||
code as well as linking it to form a `program' or `executable'.
|
||||
This program is referred to as `a program using the FreeType
|
||||
engine'.
|
||||
|
||||
This license applies to all files distributed in the original
|
||||
FreeType Project, including all source code, binaries and
|
||||
documentation, unless otherwise stated in the file in its
|
||||
original, unmodified form as distributed in the original archive.
|
||||
If you are unsure whether or not a particular file is covered by
|
||||
this license, you must contact us to verify this.
|
||||
|
||||
The FreeType Project is copyright (C) 1996-2000 by David Turner,
|
||||
Robert Wilhelm, and Werner Lemberg. All rights reserved except as
|
||||
specified below.
|
||||
|
||||
1. No Warranty
|
||||
--------------
|
||||
|
||||
THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
|
||||
USE, OF THE FREETYPE PROJECT.
|
||||
|
||||
2. Redistribution
|
||||
-----------------
|
||||
|
||||
This license grants a worldwide, royalty-free, perpetual and
|
||||
irrevocable right and license to use, execute, perform, compile,
|
||||
display, copy, create derivative works of, distribute and
|
||||
sublicense the FreeType Project (in both source and object code
|
||||
forms) and derivative works thereof for any purpose; and to
|
||||
authorize others to exercise some or all of the rights granted
|
||||
herein, subject to the following conditions:
|
||||
|
||||
o Redistribution of source code must retain this license file
|
||||
(`FTL.TXT') unaltered; any additions, deletions or changes to
|
||||
the original files must be clearly indicated in accompanying
|
||||
documentation. The copyright notices of the unaltered,
|
||||
original files must be preserved in all copies of source
|
||||
files.
|
||||
|
||||
o Redistribution in binary form must provide a disclaimer that
|
||||
states that the software is based in part of the work of the
|
||||
FreeType Team, in the distribution documentation. We also
|
||||
encourage you to put an URL to the FreeType web page in your
|
||||
documentation, though this isn't mandatory.
|
||||
|
||||
These conditions apply to any software derived from or based on
|
||||
the FreeType Project, not just the unmodified files. If you use
|
||||
our work, you must acknowledge us. However, no fee need be paid
|
||||
to us.
|
||||
|
||||
3. Advertising
|
||||
--------------
|
||||
|
||||
Neither the FreeType authors and contributors nor you shall use
|
||||
the name of the other for commercial, advertising, or promotional
|
||||
purposes without specific prior written permission.
|
||||
|
||||
We suggest, but do not require, that you use one or more of the
|
||||
following phrases to refer to this software in your documentation
|
||||
or advertising materials: `FreeType Project', `FreeType Engine',
|
||||
`FreeType library', or `FreeType Distribution'.
|
||||
|
||||
As you have not signed this license, you are not required to
|
||||
accept it. However, as the FreeType Project is copyrighted
|
||||
material, only this license, or another one contracted with the
|
||||
authors, grants you the right to use, distribute, and modify it.
|
||||
Therefore, by using, distributing, or modifying the FreeType
|
||||
Project, you indicate that you understand and accept all the terms
|
||||
of this license.
|
||||
|
||||
4. Contacts
|
||||
-----------
|
||||
|
||||
There are two mailing lists related to FreeType:
|
||||
|
||||
o freetype@nongnu.org
|
||||
|
||||
Discusses general use and applications of FreeType, as well as
|
||||
future and wanted additions to the library and distribution.
|
||||
If you are looking for support, start in this list if you
|
||||
haven't found anything to help you in the documentation.
|
||||
|
||||
o freetype-devel@nongnu.org
|
||||
|
||||
Discusses bugs, as well as engine internals, design issues,
|
||||
specific licenses, porting, etc.
|
||||
|
||||
Our home page can be found at
|
||||
|
||||
https://www.freetype.org
|
||||
|
||||
|
||||
--- end of FTL.TXT ---
|
||||
@@ -0,0 +1,51 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftconfig.h
|
||||
*
|
||||
* ANSI-specific configuration file (specification only).
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This header file contains a number of macro definitions that are used by
|
||||
* the rest of the engine. Most of the macros here are automatically
|
||||
* determined at compile time, and you should not need to change it to port
|
||||
* FreeType, except to compile the library with a non-ANSI compiler.
|
||||
*
|
||||
* Note however that if some specific modifications are needed, we advise
|
||||
* you to place a modified copy in your build directory.
|
||||
*
|
||||
* The build directory is usually `builds/<system>`, and contains
|
||||
* system-specific files that are always included first when building the
|
||||
* library.
|
||||
*
|
||||
* This ANSI version should stay in `include/config/`.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FTCONFIG_H_
|
||||
#define FTCONFIG_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
#include <freetype/config/integer-types.h>
|
||||
#include <freetype/config/public-macros.h>
|
||||
#include <freetype/config/mac-support.h>
|
||||
|
||||
#endif /* FTCONFIG_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,836 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftheader.h
|
||||
*
|
||||
* Build macros of the FreeType 2 library.
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FTHEADER_H_
|
||||
#define FTHEADER_H_
|
||||
|
||||
|
||||
/*@***********************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_BEGIN_HEADER */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used in association with @FT_END_HEADER in header */
|
||||
/* files to ensure that the declarations within are properly */
|
||||
/* encapsulated in an `extern "C" { .. }` block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifndef FT_BEGIN_HEADER
|
||||
# ifdef __cplusplus
|
||||
# define FT_BEGIN_HEADER extern "C" {
|
||||
# else
|
||||
# define FT_BEGIN_HEADER /* nothing */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*@***********************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_END_HEADER */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used in association with @FT_BEGIN_HEADER in header */
|
||||
/* files to ensure that the declarations within are properly */
|
||||
/* encapsulated in an `extern "C" { .. }` block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifndef FT_END_HEADER
|
||||
# ifdef __cplusplus
|
||||
# define FT_END_HEADER }
|
||||
# else
|
||||
# define FT_END_HEADER /* nothing */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Aliases for the FreeType 2 public and configuration files.
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* header_file_macros
|
||||
*
|
||||
* @title:
|
||||
* Header File Macros
|
||||
*
|
||||
* @abstract:
|
||||
* Macro definitions used to `#include` specific header files.
|
||||
*
|
||||
* @description:
|
||||
* In addition to the normal scheme of including header files like
|
||||
*
|
||||
* ```
|
||||
* #include <freetype/freetype.h>
|
||||
* #include <freetype/ftmm.h>
|
||||
* #include <freetype/ftglyph.h>
|
||||
* ```
|
||||
*
|
||||
* it is possible to used named macros instead. They can be used
|
||||
* directly in `#include` statements as in
|
||||
*
|
||||
* ```
|
||||
* #include FT_FREETYPE_H
|
||||
* #include FT_MULTIPLE_MASTERS_H
|
||||
* #include FT_GLYPH_H
|
||||
* ```
|
||||
*
|
||||
* These macros were introduced to overcome the infamous 8.3~naming rule
|
||||
* required by DOS (and `FT_MULTIPLE_MASTERS_H` is a lot more meaningful
|
||||
* than `ftmm.h`).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* configuration files */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_CONFIG_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* FreeType~2 configuration data.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_CONFIG_H
|
||||
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_STANDARD_LIBRARY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* FreeType~2 interface to the standard C library functions.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_STANDARD_LIBRARY_H
|
||||
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_OPTIONS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* FreeType~2 project-specific configuration options.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_OPTIONS_H
|
||||
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_MODULES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* list of FreeType~2 modules that are statically linked to new library
|
||||
* instances in @FT_Init_FreeType.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_MODULES_H
|
||||
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
/* public headers */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_FREETYPE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* base FreeType~2 API.
|
||||
*
|
||||
*/
|
||||
#define FT_FREETYPE_H <freetype/freetype.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ERRORS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* list of FreeType~2 error codes (and messages).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_ERRORS_H <freetype/fterrors.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MODULE_ERRORS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* list of FreeType~2 module error offsets (and messages).
|
||||
*
|
||||
*/
|
||||
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SYSTEM_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 interface to low-level operations (i.e., memory management
|
||||
* and stream i/o).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_SYSTEM_H <freetype/ftsystem.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_IMAGE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing type
|
||||
* definitions related to glyph images (i.e., bitmaps, outlines,
|
||||
* scan-converter parameters).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_IMAGE_H <freetype/ftimage.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TYPES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* basic data types defined by FreeType~2.
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_TYPES_H <freetype/fttypes.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LIST_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* list management API of FreeType~2.
|
||||
*
|
||||
* (Most applications will never need to include this file.)
|
||||
*
|
||||
*/
|
||||
#define FT_LIST_H <freetype/ftlist.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OUTLINE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* scalable outline management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_OUTLINE_H <freetype/ftoutln.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SIZES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* API which manages multiple @FT_Size objects per face.
|
||||
*
|
||||
*/
|
||||
#define FT_SIZES_H <freetype/ftsizes.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MODULE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* module management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_MODULE_H <freetype/ftmodapi.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_RENDER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* renderer module management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_RENDER_H <freetype/ftrender.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_DRIVER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* structures and macros related to the driver modules.
|
||||
*
|
||||
*/
|
||||
#define FT_DRIVER_H <freetype/ftdriver.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_AUTOHINTER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* structures and macros related to the auto-hinting module.
|
||||
*
|
||||
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
|
||||
*
|
||||
*/
|
||||
#define FT_AUTOHINTER_H FT_DRIVER_H
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CFF_DRIVER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* structures and macros related to the CFF driver module.
|
||||
*
|
||||
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
|
||||
*
|
||||
*/
|
||||
#define FT_CFF_DRIVER_H FT_DRIVER_H
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_DRIVER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* structures and macros related to the TrueType driver module.
|
||||
*
|
||||
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_PCF_DRIVER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing
|
||||
* structures and macros related to the PCF driver module.
|
||||
*
|
||||
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
|
||||
*
|
||||
*/
|
||||
#define FT_PCF_DRIVER_H FT_DRIVER_H
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TYPE1_TABLES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* types and API specific to the Type~1 format.
|
||||
*
|
||||
*/
|
||||
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_IDS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* enumeration values which identify name strings, languages, encodings,
|
||||
* etc. This file really contains a _large_ set of constant macro
|
||||
* definitions, taken from the TrueType and OpenType specifications.
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_TABLES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* types and API specific to the TrueType (as well as OpenType) format.
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_TAGS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* definitions of TrueType four-byte 'tags' which identify blocks in
|
||||
* SFNT-based font formats (i.e., TrueType and OpenType).
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BDF_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* definitions of an API which accesses BDF-specific strings from a face.
|
||||
*
|
||||
*/
|
||||
#define FT_BDF_H <freetype/ftbdf.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CID_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* definitions of an API which access CID font information from a face.
|
||||
*
|
||||
*/
|
||||
#define FT_CID_H <freetype/ftcid.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GZIP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* definitions of an API which supports gzip-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_GZIP_H <freetype/ftgzip.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LZW_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* definitions of an API which supports LZW-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_LZW_H <freetype/ftlzw.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BZIP2_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* definitions of an API which supports bzip2-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_BZIP2_H <freetype/ftbzip2.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_WINFONTS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* definitions of an API which supports Windows FNT files.
|
||||
*
|
||||
*/
|
||||
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GLYPH_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* API of the optional glyph management component.
|
||||
*
|
||||
*/
|
||||
#define FT_GLYPH_H <freetype/ftglyph.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BITMAP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* API of the optional bitmap conversion component.
|
||||
*
|
||||
*/
|
||||
#define FT_BITMAP_H <freetype/ftbitmap.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BBOX_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* API of the optional exact bounding box computation routines.
|
||||
*
|
||||
*/
|
||||
#define FT_BBOX_H <freetype/ftbbox.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* API of the optional FreeType~2 cache sub-system.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_H <freetype/ftcache.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MAC_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* Macintosh-specific FreeType~2 API. The latter is used to access fonts
|
||||
* embedded in resource forks.
|
||||
*
|
||||
* This header file must be explicitly included by client applications
|
||||
* compiled on the Mac (note that the base API still works though).
|
||||
*
|
||||
*/
|
||||
#define FT_MAC_H <freetype/ftmac.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MULTIPLE_MASTERS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* optional multiple-masters management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SFNT_NAMES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* optional FreeType~2 API which accesses embedded 'name' strings in
|
||||
* SFNT-based font formats (i.e., TrueType and OpenType).
|
||||
*
|
||||
*/
|
||||
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OPENTYPE_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* optional FreeType~2 API which validates OpenType tables ('BASE',
|
||||
* 'GDEF', 'GPOS', 'GSUB', 'JSTF').
|
||||
*
|
||||
*/
|
||||
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GX_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* optional FreeType~2 API which validates TrueTypeGX/AAT tables ('feat',
|
||||
* 'mort', 'morx', 'bsln', 'just', 'kern', 'opbd', 'trak', 'prop').
|
||||
*
|
||||
*/
|
||||
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_PFR_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which accesses PFR-specific data.
|
||||
*
|
||||
*/
|
||||
#define FT_PFR_H <freetype/ftpfr.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_STROKER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which provides functions to stroke outline paths.
|
||||
*/
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SYNTHESIS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which performs artificial obliquing and emboldening.
|
||||
*/
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_FONT_FORMATS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which provides functions specific to font formats.
|
||||
*/
|
||||
#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
|
||||
|
||||
/* deprecated */
|
||||
#define FT_XFREE86_H FT_FONT_FORMATS_H
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRIGONOMETRY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which performs trigonometric computations (e.g.,
|
||||
* cosines and arc tangents).
|
||||
*/
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LCD_FILTER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which performs color filtering for subpixel rendering.
|
||||
*/
|
||||
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_INCREMENTAL_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which performs incremental glyph loading.
|
||||
*/
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GASP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which returns entries from the TrueType GASP table.
|
||||
*/
|
||||
#define FT_GASP_H <freetype/ftgasp.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ADVANCES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which returns individual and ranged glyph advances.
|
||||
*/
|
||||
#define FT_ADVANCES_H <freetype/ftadvanc.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_COLOR_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which handles the OpenType 'CPAL' table.
|
||||
*/
|
||||
#define FT_COLOR_H <freetype/ftcolor.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OTSVG_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* FreeType~2 API which handles the OpenType 'SVG~' glyphs.
|
||||
*/
|
||||
#define FT_OTSVG_H <freetype/otsvg.h>
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/* These header files don't need to be included by the user. */
|
||||
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
|
||||
#define FT_PARAMETER_TAGS_H <freetype/ftparams.h>
|
||||
|
||||
/* Deprecated macros. */
|
||||
#define FT_UNPATENTED_HINTING_H <freetype/ftparams.h>
|
||||
#define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h>
|
||||
|
||||
/* `FT_CACHE_H` is the only header file needed for the cache subsystem. */
|
||||
#define FT_CACHE_IMAGE_H FT_CACHE_H
|
||||
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_H
|
||||
|
||||
/* The internals of the cache sub-system are no longer exposed. We */
|
||||
/* default to `FT_CACHE_H` at the moment just in case, but we know */
|
||||
/* of no rogue client that uses them. */
|
||||
/* */
|
||||
#define FT_CACHE_MANAGER_H FT_CACHE_H
|
||||
#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
|
||||
#define FT_CACHE_INTERNAL_MANAGER_H FT_CACHE_H
|
||||
#define FT_CACHE_INTERNAL_CACHE_H FT_CACHE_H
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H FT_CACHE_H
|
||||
#define FT_CACHE_INTERNAL_IMAGE_H FT_CACHE_H
|
||||
#define FT_CACHE_INTERNAL_SBITS_H FT_CACHE_H
|
||||
|
||||
/* TODO(david): Move this section below to a different header */
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* We disable the warning `conditional expression is constant' here */
|
||||
/* in order to compile cleanly with the maximum level of warnings. */
|
||||
/* In particular, the warning complains about stuff like `while(0)' */
|
||||
/* which is very useful in macro definitions. There is no benefit */
|
||||
/* in having it enabled. */
|
||||
#pragma warning( disable : 4127 )
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
#endif /* FT2_BUILD_LIBRARY */
|
||||
|
||||
#endif /* FTHEADER_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file registers the FreeType modules compiled into the library.
|
||||
*
|
||||
* If you use GNU make, this file IS NOT USED! Instead, it is created in
|
||||
* the objects directory (normally `<topdir>/objs/`) based on information
|
||||
* from `<topdir>/modules.cfg`.
|
||||
*
|
||||
* Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile
|
||||
* FreeType without GNU make.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_USE_MODULE( FT_Module_Class, autofit_module_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
|
||||
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
|
||||
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
|
||||
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
|
||||
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class )
|
||||
|
||||
/* EOF */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,185 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftstdlib.h
|
||||
*
|
||||
* ANSI-specific library and header configuration file (specification
|
||||
* only).
|
||||
*
|
||||
* Copyright (C) 2002-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This file is used to group all `#includes` to the ANSI~C library that
|
||||
* FreeType normally requires. It also defines macros to rename the
|
||||
* standard functions within the FreeType source code.
|
||||
*
|
||||
* Load a file which defines `FTSTDLIB_H_` before this one to override it.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTSTDLIB_H_
|
||||
#define FTSTDLIB_H_
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define ft_ptrdiff_t ptrdiff_t
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* integer limits
|
||||
*
|
||||
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
|
||||
* `int` and `long` in bytes at compile-time. So far, this works for all
|
||||
* platforms the library has been tested on. We also check `ULLONG_MAX`
|
||||
* to see whether we can use 64-bit `long long` later on.
|
||||
*
|
||||
* Note that on the extremely rare platforms that do not provide integer
|
||||
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
|
||||
* `int` is 36~bits), we do not make any guarantee about the correct
|
||||
* behaviour of FreeType~2 with all fonts.
|
||||
*
|
||||
* In these cases, `ftconfig.h` will refuse to compile anyway with a
|
||||
* message like 'couldn't find 32-bit type' or something similar.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#define FT_USHORT_MAX USHRT_MAX
|
||||
#define FT_INT_MAX INT_MAX
|
||||
#define FT_INT_MIN INT_MIN
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_LONG_MIN LONG_MIN
|
||||
#define FT_LONG_MAX LONG_MAX
|
||||
#define FT_ULONG_MAX ULONG_MAX
|
||||
#ifdef LLONG_MAX
|
||||
#define FT_LLONG_MAX LLONG_MAX
|
||||
#endif
|
||||
#ifdef LLONG_MIN
|
||||
#define FT_LLONG_MIN LLONG_MIN
|
||||
#endif
|
||||
#ifdef ULLONG_MAX
|
||||
#define FT_ULLONG_MAX ULLONG_MAX
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* character and string processing
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define ft_memchr memchr
|
||||
#define ft_memcmp memcmp
|
||||
#define ft_memcpy memcpy
|
||||
#define ft_memmove memmove
|
||||
#define ft_memset memset
|
||||
#define ft_strcat strcat
|
||||
#define ft_strcmp strcmp
|
||||
#define ft_strcpy strcpy
|
||||
#define ft_strlen strlen
|
||||
#define ft_strncmp strncmp
|
||||
#define ft_strncpy strncpy
|
||||
#define ft_strrchr strrchr
|
||||
#define ft_strstr strstr
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* file handling
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define FT_FILE FILE
|
||||
#define ft_fclose fclose
|
||||
#define ft_fopen fopen
|
||||
#define ft_fread fread
|
||||
#define ft_fseek fseek
|
||||
#define ft_ftell ftell
|
||||
#define ft_snprintf snprintf
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* sorting
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ft_qsort qsort
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* memory allocation
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define ft_scalloc calloc
|
||||
#define ft_sfree free
|
||||
#define ft_smalloc malloc
|
||||
#define ft_srealloc realloc
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* miscellaneous
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define ft_strtol strtol
|
||||
#define ft_getenv getenv
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* execution control
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
|
||||
/* `jmp_buf` is defined as a macro */
|
||||
/* on certain platforms */
|
||||
|
||||
#define ft_longjmp longjmp
|
||||
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
|
||||
|
||||
|
||||
/* The following is only used for debugging purposes, i.e., if */
|
||||
/* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
#endif /* FTSTDLIB_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,250 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* config/integer-types.h
|
||||
*
|
||||
* FreeType integer types definitions.
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
#ifndef FREETYPE_CONFIG_INTEGER_TYPES_H_
|
||||
#define FREETYPE_CONFIG_INTEGER_TYPES_H_
|
||||
|
||||
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
|
||||
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
|
||||
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
|
||||
/* is probably unexpected. */
|
||||
/* */
|
||||
/* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
|
||||
/* `char` type. */
|
||||
|
||||
#ifndef FT_CHAR_BIT
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#endif
|
||||
|
||||
#ifndef FT_SIZEOF_INT
|
||||
|
||||
/* The size of an `int` type. */
|
||||
#if FT_UINT_MAX == 0xFFFFUL
|
||||
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `int' type!"
|
||||
#endif
|
||||
|
||||
#endif /* !defined(FT_SIZEOF_INT) */
|
||||
|
||||
#ifndef FT_SIZEOF_LONG
|
||||
|
||||
/* The size of a `long` type. A five-byte `long` (as used e.g. on the */
|
||||
/* DM642) is recognized but avoided. */
|
||||
#if FT_ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `long' type!"
|
||||
#endif
|
||||
|
||||
#endif /* !defined(FT_SIZEOF_LONG) */
|
||||
|
||||
#ifndef FT_SIZEOF_LONG_LONG
|
||||
|
||||
/* The size of a `long long` type if available */
|
||||
#if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL
|
||||
#define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#define FT_SIZEOF_LONG_LONG 0
|
||||
#endif
|
||||
|
||||
#endif /* !defined(FT_SIZEOF_LONG_LONG) */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* basic_types
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit signed integer type.
|
||||
*/
|
||||
typedef signed short FT_Int16;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* this #if 0 ... #endif clause is for documentation purposes */
|
||||
#if 0
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int32
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 32bit signed integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef signed XXX FT_Int32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt32
|
||||
*
|
||||
* A typedef for a 32bit unsigned integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int64
|
||||
*
|
||||
* A typedef for a 64bit signed integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef signed XXX FT_Int64;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt64
|
||||
*
|
||||
* A typedef for a 64bit unsigned integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt64;
|
||||
|
||||
/* */
|
||||
|
||||
#endif
|
||||
|
||||
#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
|
||||
/* look up an integer type that is at least 32~bits */
|
||||
#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit integer type */
|
||||
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
|
||||
|
||||
#define FT_INT64 long
|
||||
#define FT_UINT64 unsigned long
|
||||
|
||||
#elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT )
|
||||
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* A 64-bit data type may create compilation problems if you compile in
|
||||
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
|
||||
* `__STDC__` is defined. You can however ignore this rule by defining the
|
||||
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
|
||||
*/
|
||||
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of `__BORLANDC__` in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */
|
||||
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the `long long` type */
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#endif /* !__STDC__ */
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
||||
|
||||
#ifdef FT_INT64
|
||||
typedef FT_INT64 FT_Int64;
|
||||
typedef FT_UINT64 FT_UInt64;
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */
|
||||
@@ -0,0 +1,49 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* config/mac-support.h
|
||||
*
|
||||
* Mac/OS X support configuration header.
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
#ifndef FREETYPE_CONFIG_MAC_SUPPORT_H_
|
||||
#define FREETYPE_CONFIG_MAC_SUPPORT_H_
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Mac support
|
||||
*
|
||||
* This is the only necessary change, so it is defined here instead
|
||||
* providing a new configuration file.
|
||||
*/
|
||||
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
/* No Carbon frameworks for 64bit 10.4.x. */
|
||||
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
|
||||
/* so guess the system version by maximum errno before inclusion. */
|
||||
#include <errno.h>
|
||||
#ifdef ECANCELED /* defined since 10.2 */
|
||||
#include "AvailabilityMacros.h"
|
||||
#endif
|
||||
#if defined( __LP64__ ) && \
|
||||
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
|
||||
#undef FT_MACINTOSH
|
||||
#endif
|
||||
|
||||
#elif defined( __SC__ ) || defined( __MRC__ )
|
||||
/* Classic MacOS compilers */
|
||||
#include "ConditionalMacros.h"
|
||||
#if TARGET_OS_MAC
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
#endif /* Mac support */
|
||||
|
||||
#endif /* FREETYPE_CONFIG_MAC_SUPPORT_H_ */
|
||||
@@ -0,0 +1,138 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* config/public-macros.h
|
||||
*
|
||||
* Define a set of compiler macros used in public FreeType headers.
|
||||
*
|
||||
* Copyright (C) 2020-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The definitions in this file are used by the public FreeType headers
|
||||
* and thus should be considered part of the public API.
|
||||
*
|
||||
* Other compiler-specific macro definitions that are not exposed by the
|
||||
* FreeType API should go into
|
||||
* `include/freetype/internal/compiler-macros.h` instead.
|
||||
*/
|
||||
#ifndef FREETYPE_CONFIG_PUBLIC_MACROS_H_
|
||||
#define FREETYPE_CONFIG_PUBLIC_MACROS_H_
|
||||
|
||||
/*
|
||||
* `FT_BEGIN_HEADER` and `FT_END_HEADER` might have already been defined
|
||||
* by `freetype/config/ftheader.h`, but we don't want to include this
|
||||
* header here, so redefine the macros here only when needed. Their
|
||||
* definition is very stable, so keeping them in sync with the ones in the
|
||||
* header should not be a maintenance issue.
|
||||
*/
|
||||
#ifndef FT_BEGIN_HEADER
|
||||
#ifdef __cplusplus
|
||||
#define FT_BEGIN_HEADER extern "C" {
|
||||
#else
|
||||
#define FT_BEGIN_HEADER /* empty */
|
||||
#endif
|
||||
#endif /* FT_BEGIN_HEADER */
|
||||
|
||||
#ifndef FT_END_HEADER
|
||||
#ifdef __cplusplus
|
||||
#define FT_END_HEADER }
|
||||
#else
|
||||
#define FT_END_HEADER /* empty */
|
||||
#endif
|
||||
#endif /* FT_END_HEADER */
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*
|
||||
* Mark a function declaration as public. This ensures it will be
|
||||
* properly exported to client code. Place this before a function
|
||||
* declaration.
|
||||
*
|
||||
* NOTE: This macro should be considered an internal implementation
|
||||
* detail, and not part of the FreeType API. It is only defined here
|
||||
* because it is needed by `FT_EXPORT`.
|
||||
*/
|
||||
|
||||
/* Visual C, mingw */
|
||||
#if defined( _WIN32 )
|
||||
|
||||
#if defined( FT2_BUILD_LIBRARY ) && defined( DLL_EXPORT )
|
||||
#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport )
|
||||
#elif defined( DLL_IMPORT )
|
||||
#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllimport )
|
||||
#endif
|
||||
|
||||
/* gcc, clang */
|
||||
#elif ( defined( __GNUC__ ) && __GNUC__ >= 4 ) || defined( __clang__ )
|
||||
#define FT_PUBLIC_FUNCTION_ATTRIBUTE \
|
||||
__attribute__(( visibility( "default" ) ))
|
||||
|
||||
/* Sun */
|
||||
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
|
||||
#define FT_PUBLIC_FUNCTION_ATTRIBUTE __global
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FT_PUBLIC_FUNCTION_ATTRIBUTE
|
||||
#define FT_PUBLIC_FUNCTION_ATTRIBUTE /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Define a public FreeType API function. This ensures it is properly
|
||||
* exported or imported at build time. The macro parameter is the
|
||||
* function's return type as in:
|
||||
*
|
||||
* FT_EXPORT( FT_Bool )
|
||||
* FT_Object_Method( FT_Object obj,
|
||||
* ... );
|
||||
*
|
||||
* NOTE: This requires that all `FT_EXPORT` uses are inside
|
||||
* `FT_BEGIN_HEADER ... FT_END_HEADER` blocks. This guarantees that the
|
||||
* functions are exported with C linkage, even when the header is included
|
||||
* by a C++ source file.
|
||||
*/
|
||||
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
|
||||
|
||||
|
||||
/*
|
||||
* `FT_UNUSED` indicates that a given parameter is not used -- this is
|
||||
* only used to get rid of unpleasant compiler warnings.
|
||||
*
|
||||
* Technically, this was not meant to be part of the public API, but some
|
||||
* third-party code depends on it.
|
||||
*/
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Support for casts in both C and C++.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
#define FT_STATIC_CAST( type, var ) static_cast<type>(var)
|
||||
#define FT_REINTERPRET_CAST( type, var ) reinterpret_cast<type>(var)
|
||||
|
||||
#define FT_STATIC_BYTE_CAST( type, var ) \
|
||||
static_cast<type>( static_cast<unsigned char>( var ) )
|
||||
#else
|
||||
#define FT_STATIC_CAST( type, var ) (type)(var)
|
||||
#define FT_REINTERPRET_CAST( type, var ) (type)(var)
|
||||
|
||||
#define FT_STATIC_BYTE_CAST( type, var ) (type)(unsigned char)(var)
|
||||
#endif
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,188 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftadvanc.h
|
||||
*
|
||||
* Quick computation of advance widths (specification only).
|
||||
*
|
||||
* Copyright (C) 2008-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTADVANC_H_
|
||||
#define FTADVANC_H_
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* quick_advance
|
||||
*
|
||||
* @title:
|
||||
* Quick retrieval of advance values
|
||||
*
|
||||
* @abstract:
|
||||
* Retrieve horizontal and vertical advance values without processing
|
||||
* glyph outlines, if possible.
|
||||
*
|
||||
* @description:
|
||||
* This section contains functions to quickly extract advance values
|
||||
* without handling glyph outlines, if possible.
|
||||
*
|
||||
* @order:
|
||||
* FT_Get_Advance
|
||||
* FT_Get_Advances
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_ADVANCE_FLAG_FAST_ONLY
|
||||
*
|
||||
* @description:
|
||||
* A bit-flag to be OR-ed with the `flags` parameter of the
|
||||
* @FT_Get_Advance and @FT_Get_Advances functions.
|
||||
*
|
||||
* If set, it indicates that you want these functions to fail if the
|
||||
* corresponding hinting mode or font driver doesn't allow for very quick
|
||||
* advance computation.
|
||||
*
|
||||
* Typically, glyphs that are either unscaled, unhinted, bitmapped, or
|
||||
* light-hinted can have their advance width computed very quickly.
|
||||
*
|
||||
* Normal and bytecode hinted modes that require loading, scaling, and
|
||||
* hinting of the glyph outline, are extremely slow by comparison.
|
||||
*/
|
||||
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_Advance
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the advance value of a given glyph outline in an @FT_Face.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source @FT_Face handle.
|
||||
*
|
||||
* gindex ::
|
||||
* The glyph index.
|
||||
*
|
||||
* load_flags ::
|
||||
* A set of bit flags similar to those used when calling
|
||||
* @FT_Load_Glyph, used to determine what kind of advances you need.
|
||||
*
|
||||
* @output:
|
||||
* padvance ::
|
||||
* The advance value. If scaling is performed (based on the value of
|
||||
* `load_flags`), the advance value is in 16.16 format. Otherwise, it
|
||||
* is in font units.
|
||||
*
|
||||
* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance
|
||||
* corresponding to a vertical layout. Otherwise, it is the horizontal
|
||||
* advance in a horizontal layout.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
|
||||
* the corresponding font backend doesn't have a quick way to retrieve
|
||||
* the advances.
|
||||
*
|
||||
* A scaled advance is returned in 16.16 format but isn't transformed by
|
||||
* the affine transformation specified by @FT_Set_Transform.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_Advance( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int32 load_flags,
|
||||
FT_Fixed *padvance );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_Advances
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the advance values of several glyph outlines in an @FT_Face.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source @FT_Face handle.
|
||||
*
|
||||
* start ::
|
||||
* The first glyph index.
|
||||
*
|
||||
* count ::
|
||||
* The number of advance values you want to retrieve.
|
||||
*
|
||||
* load_flags ::
|
||||
* A set of bit flags similar to those used when calling
|
||||
* @FT_Load_Glyph.
|
||||
*
|
||||
* @output:
|
||||
* padvance ::
|
||||
* The advance values. This array, to be provided by the caller, must
|
||||
* contain at least `count` elements.
|
||||
*
|
||||
* If scaling is performed (based on the value of `load_flags`), the
|
||||
* advance values are in 16.16 format. Otherwise, they are in font
|
||||
* units.
|
||||
*
|
||||
* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances
|
||||
* corresponding to a vertical layout. Otherwise, they are the
|
||||
* horizontal advances in a horizontal layout.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
|
||||
* the corresponding font backend doesn't have a quick way to retrieve
|
||||
* the advances.
|
||||
*
|
||||
* Scaled advances are returned in 16.16 format but aren't transformed by
|
||||
* the affine transformation specified by @FT_Set_Transform.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_Advances( FT_Face face,
|
||||
FT_UInt start,
|
||||
FT_UInt count,
|
||||
FT_Int32 load_flags,
|
||||
FT_Fixed *padvances );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTADVANC_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,101 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftbbox.h
|
||||
*
|
||||
* FreeType exact bbox computation (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This component has a _single_ role: to compute exact outline bounding
|
||||
* boxes.
|
||||
*
|
||||
* It is separated from the rest of the engine for various technical
|
||||
* reasons. It may well be integrated in 'ftoutln' later.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTBBOX_H_
|
||||
#define FTBBOX_H_
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* outline_processing
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Outline_Get_BBox
|
||||
*
|
||||
* @description:
|
||||
* Compute the exact bounding box of an outline. This is slower than
|
||||
* computing the control box. However, it uses an advanced algorithm
|
||||
* that returns _very_ quickly when the two boxes coincide. Otherwise,
|
||||
* the outline Bezier arcs are traversed to extract their extrema.
|
||||
*
|
||||
* @input:
|
||||
* outline ::
|
||||
* A pointer to the source outline.
|
||||
*
|
||||
* @output:
|
||||
* abbox ::
|
||||
* The outline's exact bounding box.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* If the font is tricky and the glyph has been loaded with
|
||||
* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get
|
||||
* reasonable values for the BBox it is necessary to load the glyph at a
|
||||
* large ppem value (so that the hinting instructions can properly shift
|
||||
* and scale the subglyphs), then extracting the BBox, which can be
|
||||
* eventually converted back to font units.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Get_BBox( FT_Outline* outline,
|
||||
FT_BBox *abbox );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTBBOX_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
@@ -0,0 +1,212 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftbdf.h
|
||||
*
|
||||
* FreeType API for accessing BDF-specific strings (specification).
|
||||
*
|
||||
* Copyright (C) 2002-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTBDF_H_
|
||||
#define FTBDF_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* bdf_fonts
|
||||
*
|
||||
* @title:
|
||||
* BDF and PCF Files
|
||||
*
|
||||
* @abstract:
|
||||
* BDF and PCF specific API.
|
||||
*
|
||||
* @description:
|
||||
* This section contains the declaration of functions specific to BDF and
|
||||
* PCF fonts.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* BDF_PropertyType
|
||||
*
|
||||
* @description:
|
||||
* A list of BDF property types.
|
||||
*
|
||||
* @values:
|
||||
* BDF_PROPERTY_TYPE_NONE ::
|
||||
* Value~0 is used to indicate a missing property.
|
||||
*
|
||||
* BDF_PROPERTY_TYPE_ATOM ::
|
||||
* Property is a string atom.
|
||||
*
|
||||
* BDF_PROPERTY_TYPE_INTEGER ::
|
||||
* Property is a 32-bit signed integer.
|
||||
*
|
||||
* BDF_PROPERTY_TYPE_CARDINAL ::
|
||||
* Property is a 32-bit unsigned integer.
|
||||
*/
|
||||
typedef enum BDF_PropertyType_
|
||||
{
|
||||
BDF_PROPERTY_TYPE_NONE = 0,
|
||||
BDF_PROPERTY_TYPE_ATOM = 1,
|
||||
BDF_PROPERTY_TYPE_INTEGER = 2,
|
||||
BDF_PROPERTY_TYPE_CARDINAL = 3
|
||||
|
||||
} BDF_PropertyType;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* BDF_Property
|
||||
*
|
||||
* @description:
|
||||
* A handle to a @BDF_PropertyRec structure to model a given BDF/PCF
|
||||
* property.
|
||||
*/
|
||||
typedef struct BDF_PropertyRec_* BDF_Property;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* BDF_PropertyRec
|
||||
*
|
||||
* @description:
|
||||
* This structure models a given BDF/PCF property.
|
||||
*
|
||||
* @fields:
|
||||
* type ::
|
||||
* The property type.
|
||||
*
|
||||
* u.atom ::
|
||||
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
|
||||
* `NULL`, indicating an empty string.
|
||||
*
|
||||
* u.integer ::
|
||||
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
|
||||
*
|
||||
* u.cardinal ::
|
||||
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
|
||||
*/
|
||||
typedef struct BDF_PropertyRec_
|
||||
{
|
||||
BDF_PropertyType type;
|
||||
union {
|
||||
const char* atom;
|
||||
FT_Int32 integer;
|
||||
FT_UInt32 cardinal;
|
||||
|
||||
} u;
|
||||
|
||||
} BDF_PropertyRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_BDF_Charset_ID
|
||||
*
|
||||
* @description:
|
||||
* Retrieve a BDF font character set identity, according to the BDF
|
||||
* specification.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* @output:
|
||||
* acharset_encoding ::
|
||||
* Charset encoding, as a C~string, owned by the face.
|
||||
*
|
||||
* acharset_registry ::
|
||||
* Charset registry, as a C~string, owned by the face.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with BDF faces, returning an error otherwise.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_BDF_Charset_ID( FT_Face face,
|
||||
const char* *acharset_encoding,
|
||||
const char* *acharset_registry );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_BDF_Property
|
||||
*
|
||||
* @description:
|
||||
* Retrieve a BDF property from a BDF or PCF font file.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* name ::
|
||||
* The property name.
|
||||
*
|
||||
* @output:
|
||||
* aproperty ::
|
||||
* The property.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function works with BDF _and_ PCF fonts. It returns an error
|
||||
* otherwise. It also returns an error if the property is not in the
|
||||
* font.
|
||||
*
|
||||
* A 'property' is a either key-value pair within the STARTPROPERTIES
|
||||
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the
|
||||
* `info->props` array within a `FontRec` structure of a PCF font.
|
||||
*
|
||||
* Integer properties are always stored as 'signed' within PCF fonts;
|
||||
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
|
||||
* for BDF fonts only.
|
||||
*
|
||||
* In case of error, `aproperty->type` is always set to
|
||||
* @BDF_PROPERTY_TYPE_NONE.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_BDF_Property( FT_Face face,
|
||||
const char* prop_name,
|
||||
BDF_PropertyRec *aproperty );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTBDF_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,329 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftbitmap.h
|
||||
*
|
||||
* FreeType utility functions for bitmaps (specification).
|
||||
*
|
||||
* Copyright (C) 2004-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTBITMAP_H_
|
||||
#define FTBITMAP_H_
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/ftcolor.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* bitmap_handling
|
||||
*
|
||||
* @title:
|
||||
* Bitmap Handling
|
||||
*
|
||||
* @abstract:
|
||||
* Handling FT_Bitmap objects.
|
||||
*
|
||||
* @description:
|
||||
* This section contains functions for handling @FT_Bitmap objects,
|
||||
* automatically adjusting the target's bitmap buffer size as needed.
|
||||
*
|
||||
* Note that none of the functions changes the bitmap's 'flow' (as
|
||||
* indicated by the sign of the `pitch` field in @FT_Bitmap).
|
||||
*
|
||||
* To set the flow, assign an appropriate positive or negative value to
|
||||
* the `pitch` field of the target @FT_Bitmap object after calling
|
||||
* @FT_Bitmap_Init but before calling any of the other functions
|
||||
* described here.
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Bitmap_Init
|
||||
*
|
||||
* @description:
|
||||
* Initialize a pointer to an @FT_Bitmap structure.
|
||||
*
|
||||
* @inout:
|
||||
* abitmap ::
|
||||
* A pointer to the bitmap structure.
|
||||
*
|
||||
* @note:
|
||||
* A deprecated name for the same function is `FT_Bitmap_New`.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Bitmap_Init( FT_Bitmap *abitmap );
|
||||
|
||||
|
||||
/* deprecated */
|
||||
FT_EXPORT( void )
|
||||
FT_Bitmap_New( FT_Bitmap *abitmap );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Bitmap_Copy
|
||||
*
|
||||
* @description:
|
||||
* Copy a bitmap into another one.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to a library object.
|
||||
*
|
||||
* source ::
|
||||
* A handle to the source bitmap.
|
||||
*
|
||||
* @output:
|
||||
* target ::
|
||||
* A handle to the target bitmap.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* `source->buffer` and `target->buffer` must neither be equal nor
|
||||
* overlap.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Copy( FT_Library library,
|
||||
const FT_Bitmap *source,
|
||||
FT_Bitmap *target );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Bitmap_Embolden
|
||||
*
|
||||
* @description:
|
||||
* Embolden a bitmap. The new bitmap will be about `xStrength` pixels
|
||||
* wider and `yStrength` pixels higher. The left and bottom borders are
|
||||
* kept unchanged.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to a library object.
|
||||
*
|
||||
* xStrength ::
|
||||
* How strong the glyph is emboldened horizontally. Expressed in 26.6
|
||||
* pixel format.
|
||||
*
|
||||
* yStrength ::
|
||||
* How strong the glyph is emboldened vertically. Expressed in 26.6
|
||||
* pixel format.
|
||||
*
|
||||
* @inout:
|
||||
* bitmap ::
|
||||
* A handle to the target bitmap.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The current implementation restricts `xStrength` to be less than or
|
||||
* equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.
|
||||
*
|
||||
* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, you
|
||||
* should call @FT_GlyphSlot_Own_Bitmap on the slot first.
|
||||
*
|
||||
* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format are
|
||||
* converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp).
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Embolden( FT_Library library,
|
||||
FT_Bitmap* bitmap,
|
||||
FT_Pos xStrength,
|
||||
FT_Pos yStrength );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Bitmap_Convert
|
||||
*
|
||||
* @description:
|
||||
* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to
|
||||
* a bitmap object with depth 8bpp, making the number of used bytes per
|
||||
* line (a.k.a. the 'pitch') a multiple of `alignment`.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to a library object.
|
||||
*
|
||||
* source ::
|
||||
* The source bitmap.
|
||||
*
|
||||
* alignment ::
|
||||
* The pitch of the bitmap is a multiple of this argument. Common
|
||||
* values are 1, 2, or 4.
|
||||
*
|
||||
* @output:
|
||||
* target ::
|
||||
* The target bitmap.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* It is possible to call @FT_Bitmap_Convert multiple times without
|
||||
* calling @FT_Bitmap_Done (the memory is simply reallocated).
|
||||
*
|
||||
* Use @FT_Bitmap_Done to finally remove the bitmap object.
|
||||
*
|
||||
* The `library` argument is taken to have access to FreeType's memory
|
||||
* handling functions.
|
||||
*
|
||||
* `source->buffer` and `target->buffer` must neither be equal nor
|
||||
* overlap.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Convert( FT_Library library,
|
||||
const FT_Bitmap *source,
|
||||
FT_Bitmap *target,
|
||||
FT_Int alignment );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Bitmap_Blend
|
||||
*
|
||||
* @description:
|
||||
* Blend a bitmap onto another bitmap, using a given color.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to a library object.
|
||||
*
|
||||
* source ::
|
||||
* The source bitmap, which can have any @FT_Pixel_Mode format.
|
||||
*
|
||||
* source_offset ::
|
||||
* The offset vector to the upper left corner of the source bitmap in
|
||||
* 26.6 pixel format. It should represent an integer offset; the
|
||||
* function will set the lowest six bits to zero to enforce that.
|
||||
*
|
||||
* color ::
|
||||
* The color used to draw `source` onto `target`.
|
||||
*
|
||||
* @inout:
|
||||
* target ::
|
||||
* A handle to an `FT_Bitmap` object. It should be either initialized
|
||||
* as empty with a call to @FT_Bitmap_Init, or it should be of type
|
||||
* @FT_PIXEL_MODE_BGRA.
|
||||
*
|
||||
* atarget_offset ::
|
||||
* The offset vector to the upper left corner of the target bitmap in
|
||||
* 26.6 pixel format. It should represent an integer offset; the
|
||||
* function will set the lowest six bits to zero to enforce that.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function doesn't perform clipping.
|
||||
*
|
||||
* The bitmap in `target` gets allocated or reallocated as needed; the
|
||||
* vector `atarget_offset` is updated accordingly.
|
||||
*
|
||||
* In case of allocation or reallocation, the bitmap's pitch is set to
|
||||
* `4 * width`. Both `source` and `target` must have the same bitmap
|
||||
* flow (as indicated by the sign of the `pitch` field).
|
||||
*
|
||||
* `source->buffer` and `target->buffer` must neither be equal nor
|
||||
* overlap.
|
||||
*
|
||||
* @since:
|
||||
* 2.10
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Blend( FT_Library library,
|
||||
const FT_Bitmap* source,
|
||||
const FT_Vector source_offset,
|
||||
FT_Bitmap* target,
|
||||
FT_Vector *atarget_offset,
|
||||
FT_Color color );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_GlyphSlot_Own_Bitmap
|
||||
*
|
||||
* @description:
|
||||
* Make sure that a glyph slot owns `slot->bitmap`.
|
||||
*
|
||||
* @input:
|
||||
* slot ::
|
||||
* The glyph slot.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function is to be used in combination with @FT_Bitmap_Embolden.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Bitmap_Done
|
||||
*
|
||||
* @description:
|
||||
* Destroy a bitmap object initialized with @FT_Bitmap_Init.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to a library object.
|
||||
*
|
||||
* bitmap ::
|
||||
* The bitmap object to be freed.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The `library` argument is taken to have access to FreeType's memory
|
||||
* handling functions.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Done( FT_Library library,
|
||||
FT_Bitmap *bitmap );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTBITMAP_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,102 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftbzip2.h
|
||||
*
|
||||
* Bzip2-compressed stream support.
|
||||
*
|
||||
* Copyright (C) 2010-2024 by
|
||||
* Joel Klinghed.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTBZIP2_H_
|
||||
#define FTBZIP2_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* bzip2
|
||||
*
|
||||
* @title:
|
||||
* BZIP2 Streams
|
||||
*
|
||||
* @abstract:
|
||||
* Using bzip2-compressed font files.
|
||||
*
|
||||
* @description:
|
||||
* In certain builds of the library, bzip2 compression recognition is
|
||||
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
|
||||
* This means that if no font driver is capable of handling the raw
|
||||
* compressed file, the library will try to open a bzip2 compressed
|
||||
* stream from it and re-open the face with it.
|
||||
*
|
||||
* The stream implementation is very basic and resets the decompression
|
||||
* process each time seeking backwards is needed within the stream,
|
||||
* which significantly undermines the performance.
|
||||
*
|
||||
* This section contains the declaration of Bzip2-specific functions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stream_OpenBzip2
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse bzip2-compressed font files. This is
|
||||
* mainly used to support the compressed `*.pcf.bz2` fonts that come with
|
||||
* XFree86.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* The target embedding stream.
|
||||
*
|
||||
* source ::
|
||||
* The source stream.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The source stream must be opened _before_ calling this function.
|
||||
*
|
||||
* Calling the internal function `FT_Stream_Close` on the new stream will
|
||||
* **not** call `FT_Stream_Close` on the source stream. None of the
|
||||
* stream objects will be released to the heap.
|
||||
*
|
||||
* This function may return `FT_Err_Unimplemented_Feature` if your build
|
||||
* of FreeType was not compiled with bzip2 support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stream_OpenBzip2( FT_Stream stream,
|
||||
FT_Stream source );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTBZIP2_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,168 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* This file defines the structure of the FreeType reference.
|
||||
* It is used by the python script that generates the HTML files.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* general_remarks
|
||||
*
|
||||
* @title:
|
||||
* General Remarks
|
||||
*
|
||||
* @sections:
|
||||
* preamble
|
||||
* header_inclusion
|
||||
* user_allocation
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* core_api
|
||||
*
|
||||
* @title:
|
||||
* Core API
|
||||
*
|
||||
* @sections:
|
||||
* basic_types
|
||||
* library_setup
|
||||
* face_creation
|
||||
* font_testing_macros
|
||||
* sizing_and_scaling
|
||||
* glyph_retrieval
|
||||
* character_mapping
|
||||
* information_retrieval
|
||||
* other_api_data
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* extended_api
|
||||
*
|
||||
* @title:
|
||||
* Extended API
|
||||
*
|
||||
* @sections:
|
||||
* glyph_variants
|
||||
* color_management
|
||||
* layer_management
|
||||
* glyph_management
|
||||
* mac_specific
|
||||
* sizes_management
|
||||
* header_file_macros
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* format_specific
|
||||
*
|
||||
* @title:
|
||||
* Format-Specific API
|
||||
*
|
||||
* @sections:
|
||||
* multiple_masters
|
||||
* truetype_tables
|
||||
* type1_tables
|
||||
* sfnt_names
|
||||
* bdf_fonts
|
||||
* cid_fonts
|
||||
* pfr_fonts
|
||||
* winfnt_fonts
|
||||
* svg_fonts
|
||||
* font_formats
|
||||
* gasp_table
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* module_specific
|
||||
*
|
||||
* @title:
|
||||
* Controlling FreeType Modules
|
||||
*
|
||||
* @sections:
|
||||
* auto_hinter
|
||||
* cff_driver
|
||||
* t1_cid_driver
|
||||
* tt_driver
|
||||
* pcf_driver
|
||||
* ot_svg_driver
|
||||
* properties
|
||||
* parameter_tags
|
||||
* lcd_rendering
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* cache_subsystem
|
||||
*
|
||||
* @title:
|
||||
* Cache Sub-System
|
||||
*
|
||||
* @sections:
|
||||
* cache_subsystem
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* support_api
|
||||
*
|
||||
* @title:
|
||||
* Support API
|
||||
*
|
||||
* @sections:
|
||||
* computations
|
||||
* list_processing
|
||||
* outline_processing
|
||||
* quick_advance
|
||||
* bitmap_handling
|
||||
* raster
|
||||
* glyph_stroker
|
||||
* system_interface
|
||||
* module_management
|
||||
* gzip
|
||||
* lzw
|
||||
* bzip2
|
||||
* debugging_apis
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @chapter:
|
||||
* error_codes
|
||||
*
|
||||
* @title:
|
||||
* Error Codes
|
||||
*
|
||||
* @sections:
|
||||
* error_enumerations
|
||||
* error_code_values
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,167 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftcid.h
|
||||
*
|
||||
* FreeType API for accessing CID font information (specification).
|
||||
*
|
||||
* Copyright (C) 2007-2024 by
|
||||
* Dereg Clegg and Michael Toftdal.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTCID_H_
|
||||
#define FTCID_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* cid_fonts
|
||||
*
|
||||
* @title:
|
||||
* CID Fonts
|
||||
*
|
||||
* @abstract:
|
||||
* CID-keyed font-specific API.
|
||||
*
|
||||
* @description:
|
||||
* This section contains the declaration of CID-keyed font-specific
|
||||
* functions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_CID_Registry_Ordering_Supplement
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the Registry/Ordering/Supplement triple (also known as the
|
||||
* "R/O/S") from a CID-keyed font.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* @output:
|
||||
* registry ::
|
||||
* The registry, as a C~string, owned by the face.
|
||||
*
|
||||
* ordering ::
|
||||
* The ordering, as a C~string, owned by the face.
|
||||
*
|
||||
* supplement ::
|
||||
* The supplement.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with CID faces, returning an error
|
||||
* otherwise.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.6
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
|
||||
const char* *registry,
|
||||
const char* *ordering,
|
||||
FT_Int *supplement );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_CID_Is_Internally_CID_Keyed
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the type of the input face, CID keyed or not. In contrast
|
||||
* to the @FT_IS_CID_KEYED macro this function returns successfully also
|
||||
* for CID-keyed fonts in an SFNT wrapper.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* @output:
|
||||
* is_cid ::
|
||||
* The type of the face as an @FT_Bool.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with CID faces and OpenType fonts, returning
|
||||
* an error otherwise.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.9
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
|
||||
FT_Bool *is_cid );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_CID_From_Glyph_Index
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the CID of the input glyph index.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* glyph_index ::
|
||||
* The input glyph index.
|
||||
*
|
||||
* @output:
|
||||
* cid ::
|
||||
* The CID as an @FT_UInt.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with CID faces and OpenType fonts, returning
|
||||
* an error otherwise.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.9
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_CID_From_Glyph_Index( FT_Face face,
|
||||
FT_UInt glyph_index,
|
||||
FT_UInt *cid );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTCID_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,283 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* fterrdef.h
|
||||
*
|
||||
* FreeType error codes (specification).
|
||||
*
|
||||
* Copyright (C) 2002-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* error_code_values
|
||||
*
|
||||
* @title:
|
||||
* Error Code Values
|
||||
*
|
||||
* @abstract:
|
||||
* All possible error codes returned by FreeType functions.
|
||||
*
|
||||
* @description:
|
||||
* The list below is taken verbatim from the file `fterrdef.h` (loaded
|
||||
* automatically by including `FT_FREETYPE_H`). The first argument of the
|
||||
* `FT_ERROR_DEF_` macro is the error label; by default, the prefix
|
||||
* `FT_Err_` gets added so that you get error names like
|
||||
* `FT_Err_Cannot_Open_Resource`. The second argument is the error code,
|
||||
* and the last argument an error string, which is not used by FreeType.
|
||||
*
|
||||
* Within your application you should **only** use error names and
|
||||
* **never** its numeric values! The latter might (and actually do)
|
||||
* change in forthcoming FreeType versions.
|
||||
*
|
||||
* Macro `FT_NOERRORDEF_` defines `FT_Err_Ok`, which is always zero. See
|
||||
* the 'Error Enumerations' subsection how to automatically generate a
|
||||
* list of error strings.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_Err_XXX
|
||||
*
|
||||
*/
|
||||
|
||||
/* generic errors */
|
||||
|
||||
FT_NOERRORDEF_( Ok, 0x00,
|
||||
"no error" )
|
||||
|
||||
FT_ERRORDEF_( Cannot_Open_Resource, 0x01,
|
||||
"cannot open resource" )
|
||||
FT_ERRORDEF_( Unknown_File_Format, 0x02,
|
||||
"unknown file format" )
|
||||
FT_ERRORDEF_( Invalid_File_Format, 0x03,
|
||||
"broken file" )
|
||||
FT_ERRORDEF_( Invalid_Version, 0x04,
|
||||
"invalid FreeType version" )
|
||||
FT_ERRORDEF_( Lower_Module_Version, 0x05,
|
||||
"module version is too low" )
|
||||
FT_ERRORDEF_( Invalid_Argument, 0x06,
|
||||
"invalid argument" )
|
||||
FT_ERRORDEF_( Unimplemented_Feature, 0x07,
|
||||
"unimplemented feature" )
|
||||
FT_ERRORDEF_( Invalid_Table, 0x08,
|
||||
"broken table" )
|
||||
FT_ERRORDEF_( Invalid_Offset, 0x09,
|
||||
"broken offset within table" )
|
||||
FT_ERRORDEF_( Array_Too_Large, 0x0A,
|
||||
"array allocation size too large" )
|
||||
FT_ERRORDEF_( Missing_Module, 0x0B,
|
||||
"missing module" )
|
||||
FT_ERRORDEF_( Missing_Property, 0x0C,
|
||||
"missing property" )
|
||||
|
||||
/* glyph/character errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10,
|
||||
"invalid glyph index" )
|
||||
FT_ERRORDEF_( Invalid_Character_Code, 0x11,
|
||||
"invalid character code" )
|
||||
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12,
|
||||
"unsupported glyph image format" )
|
||||
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13,
|
||||
"cannot render this glyph format" )
|
||||
FT_ERRORDEF_( Invalid_Outline, 0x14,
|
||||
"invalid outline" )
|
||||
FT_ERRORDEF_( Invalid_Composite, 0x15,
|
||||
"invalid composite glyph" )
|
||||
FT_ERRORDEF_( Too_Many_Hints, 0x16,
|
||||
"too many hints" )
|
||||
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
|
||||
"invalid pixel size" )
|
||||
FT_ERRORDEF_( Invalid_SVG_Document, 0x18,
|
||||
"invalid SVG document" )
|
||||
|
||||
/* handle errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Handle, 0x20,
|
||||
"invalid object handle" )
|
||||
FT_ERRORDEF_( Invalid_Library_Handle, 0x21,
|
||||
"invalid library handle" )
|
||||
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22,
|
||||
"invalid module handle" )
|
||||
FT_ERRORDEF_( Invalid_Face_Handle, 0x23,
|
||||
"invalid face handle" )
|
||||
FT_ERRORDEF_( Invalid_Size_Handle, 0x24,
|
||||
"invalid size handle" )
|
||||
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25,
|
||||
"invalid glyph slot handle" )
|
||||
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26,
|
||||
"invalid charmap handle" )
|
||||
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27,
|
||||
"invalid cache manager handle" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28,
|
||||
"invalid stream handle" )
|
||||
|
||||
/* driver errors */
|
||||
|
||||
FT_ERRORDEF_( Too_Many_Drivers, 0x30,
|
||||
"too many modules" )
|
||||
FT_ERRORDEF_( Too_Many_Extensions, 0x31,
|
||||
"too many extensions" )
|
||||
|
||||
/* memory errors */
|
||||
|
||||
FT_ERRORDEF_( Out_Of_Memory, 0x40,
|
||||
"out of memory" )
|
||||
FT_ERRORDEF_( Unlisted_Object, 0x41,
|
||||
"unlisted object" )
|
||||
|
||||
/* stream errors */
|
||||
|
||||
FT_ERRORDEF_( Cannot_Open_Stream, 0x51,
|
||||
"cannot open stream" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52,
|
||||
"invalid stream seek" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53,
|
||||
"invalid stream skip" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Read, 0x54,
|
||||
"invalid stream read" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55,
|
||||
"invalid stream operation" )
|
||||
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56,
|
||||
"invalid frame operation" )
|
||||
FT_ERRORDEF_( Nested_Frame_Access, 0x57,
|
||||
"nested frame access" )
|
||||
FT_ERRORDEF_( Invalid_Frame_Read, 0x58,
|
||||
"invalid frame read" )
|
||||
|
||||
/* raster errors */
|
||||
|
||||
FT_ERRORDEF_( Raster_Uninitialized, 0x60,
|
||||
"raster uninitialized" )
|
||||
FT_ERRORDEF_( Raster_Corrupted, 0x61,
|
||||
"raster corrupted" )
|
||||
FT_ERRORDEF_( Raster_Overflow, 0x62,
|
||||
"raster overflow" )
|
||||
FT_ERRORDEF_( Raster_Negative_Height, 0x63,
|
||||
"negative height while rastering" )
|
||||
|
||||
/* cache errors */
|
||||
|
||||
FT_ERRORDEF_( Too_Many_Caches, 0x70,
|
||||
"too many registered caches" )
|
||||
|
||||
/* TrueType and SFNT errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Opcode, 0x80,
|
||||
"invalid opcode" )
|
||||
FT_ERRORDEF_( Too_Few_Arguments, 0x81,
|
||||
"too few arguments" )
|
||||
FT_ERRORDEF_( Stack_Overflow, 0x82,
|
||||
"stack overflow" )
|
||||
FT_ERRORDEF_( Code_Overflow, 0x83,
|
||||
"code overflow" )
|
||||
FT_ERRORDEF_( Bad_Argument, 0x84,
|
||||
"bad argument" )
|
||||
FT_ERRORDEF_( Divide_By_Zero, 0x85,
|
||||
"division by zero" )
|
||||
FT_ERRORDEF_( Invalid_Reference, 0x86,
|
||||
"invalid reference" )
|
||||
FT_ERRORDEF_( Debug_OpCode, 0x87,
|
||||
"found debug opcode" )
|
||||
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88,
|
||||
"found ENDF opcode in execution stream" )
|
||||
FT_ERRORDEF_( Nested_DEFS, 0x89,
|
||||
"nested DEFS" )
|
||||
FT_ERRORDEF_( Invalid_CodeRange, 0x8A,
|
||||
"invalid code range" )
|
||||
FT_ERRORDEF_( Execution_Too_Long, 0x8B,
|
||||
"execution context too long" )
|
||||
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C,
|
||||
"too many function definitions" )
|
||||
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D,
|
||||
"too many instruction definitions" )
|
||||
FT_ERRORDEF_( Table_Missing, 0x8E,
|
||||
"SFNT font table missing" )
|
||||
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F,
|
||||
"horizontal header (hhea) table missing" )
|
||||
FT_ERRORDEF_( Locations_Missing, 0x90,
|
||||
"locations (loca) table missing" )
|
||||
FT_ERRORDEF_( Name_Table_Missing, 0x91,
|
||||
"name table missing" )
|
||||
FT_ERRORDEF_( CMap_Table_Missing, 0x92,
|
||||
"character map (cmap) table missing" )
|
||||
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93,
|
||||
"horizontal metrics (hmtx) table missing" )
|
||||
FT_ERRORDEF_( Post_Table_Missing, 0x94,
|
||||
"PostScript (post) table missing" )
|
||||
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95,
|
||||
"invalid horizontal metrics" )
|
||||
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96,
|
||||
"invalid character map (cmap) format" )
|
||||
FT_ERRORDEF_( Invalid_PPem, 0x97,
|
||||
"invalid ppem value" )
|
||||
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98,
|
||||
"invalid vertical metrics" )
|
||||
FT_ERRORDEF_( Could_Not_Find_Context, 0x99,
|
||||
"could not find context" )
|
||||
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A,
|
||||
"invalid PostScript (post) table format" )
|
||||
FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
|
||||
"invalid PostScript (post) table" )
|
||||
FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C,
|
||||
"found FDEF or IDEF opcode in glyf bytecode" )
|
||||
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
|
||||
"missing bitmap in strike" )
|
||||
FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E,
|
||||
"SVG hooks have not been set" )
|
||||
|
||||
/* CFF, CID, and Type 1 errors */
|
||||
|
||||
FT_ERRORDEF_( Syntax_Error, 0xA0,
|
||||
"opcode syntax error" )
|
||||
FT_ERRORDEF_( Stack_Underflow, 0xA1,
|
||||
"argument stack underflow" )
|
||||
FT_ERRORDEF_( Ignore, 0xA2,
|
||||
"ignore" )
|
||||
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
|
||||
"no Unicode glyph name found" )
|
||||
FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
|
||||
"glyph too big for hinting" )
|
||||
|
||||
/* BDF errors */
|
||||
|
||||
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0,
|
||||
"`STARTFONT' field missing" )
|
||||
FT_ERRORDEF_( Missing_Font_Field, 0xB1,
|
||||
"`FONT' field missing" )
|
||||
FT_ERRORDEF_( Missing_Size_Field, 0xB2,
|
||||
"`SIZE' field missing" )
|
||||
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3,
|
||||
"`FONTBOUNDINGBOX' field missing" )
|
||||
FT_ERRORDEF_( Missing_Chars_Field, 0xB4,
|
||||
"`CHARS' field missing" )
|
||||
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5,
|
||||
"`STARTCHAR' field missing" )
|
||||
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6,
|
||||
"`ENCODING' field missing" )
|
||||
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7,
|
||||
"`BBX' field missing" )
|
||||
FT_ERRORDEF_( Bbx_Too_Big, 0xB8,
|
||||
"`BBX' too big" )
|
||||
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9,
|
||||
"Font header corrupted or missing fields" )
|
||||
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
|
||||
"Font glyphs corrupted or missing fields" )
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,296 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* fterrors.h
|
||||
*
|
||||
* FreeType error code handling (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* error_enumerations
|
||||
*
|
||||
* @title:
|
||||
* Error Enumerations
|
||||
*
|
||||
* @abstract:
|
||||
* How to handle errors and error strings.
|
||||
*
|
||||
* @description:
|
||||
* The header file `fterrors.h` (which is automatically included by
|
||||
* `freetype.h`) defines the handling of FreeType's enumeration
|
||||
* constants. It can also be used to generate error message strings
|
||||
* with a small macro trick explained below.
|
||||
*
|
||||
* **Error Formats**
|
||||
*
|
||||
* The configuration macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` can be
|
||||
* defined in `ftoption.h` in order to make the higher byte indicate the
|
||||
* module where the error has happened (this is not compatible with
|
||||
* standard builds of FreeType~2, however). See the file `ftmoderr.h`
|
||||
* for more details.
|
||||
*
|
||||
* **Error Message Strings**
|
||||
*
|
||||
* Error definitions are set up with special macros that allow client
|
||||
* applications to build a table of error message strings. The strings
|
||||
* are not included in a normal build of FreeType~2 to save space (most
|
||||
* client applications do not use them).
|
||||
*
|
||||
* To do so, you have to define the following macros before including
|
||||
* this file.
|
||||
*
|
||||
* ```
|
||||
* FT_ERROR_START_LIST
|
||||
* ```
|
||||
*
|
||||
* This macro is called before anything else to define the start of the
|
||||
* error list. It is followed by several `FT_ERROR_DEF` calls.
|
||||
*
|
||||
* ```
|
||||
* FT_ERROR_DEF( e, v, s )
|
||||
* ```
|
||||
*
|
||||
* This macro is called to define one single error. 'e' is the error
|
||||
* code identifier (e.g., `Invalid_Argument`), 'v' is the error's
|
||||
* numerical value, and 's' is the corresponding error string.
|
||||
*
|
||||
* ```
|
||||
* FT_ERROR_END_LIST
|
||||
* ```
|
||||
*
|
||||
* This macro ends the list.
|
||||
*
|
||||
* Additionally, you have to undefine `FTERRORS_H_` before #including
|
||||
* this file.
|
||||
*
|
||||
* Here is a simple example.
|
||||
*
|
||||
* ```
|
||||
* #undef FTERRORS_H_
|
||||
* #define FT_ERRORDEF( e, v, s ) { e, s },
|
||||
* #define FT_ERROR_START_LIST {
|
||||
* #define FT_ERROR_END_LIST { 0, NULL } };
|
||||
*
|
||||
* const struct
|
||||
* {
|
||||
* int err_code;
|
||||
* const char* err_msg;
|
||||
* } ft_errors[] =
|
||||
*
|
||||
* #include <freetype/fterrors.h>
|
||||
* ```
|
||||
*
|
||||
* An alternative to using an array is a switch statement.
|
||||
*
|
||||
* ```
|
||||
* #undef FTERRORS_H_
|
||||
* #define FT_ERROR_START_LIST switch ( error_code ) {
|
||||
* #define FT_ERRORDEF( e, v, s ) case v: return s;
|
||||
* #define FT_ERROR_END_LIST }
|
||||
* ```
|
||||
*
|
||||
* If you use `FT_CONFIG_OPTION_USE_MODULE_ERRORS`, `error_code` should
|
||||
* be replaced with `FT_ERROR_BASE(error_code)` in the last example.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
/* In previous FreeType versions we used `__FTERRORS_H__`. However, */
|
||||
/* using two successive underscores in a non-system symbol name */
|
||||
/* violates the C (and C++) standard, so it was changed to the */
|
||||
/* current form. In spite of this, we have to make */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* #undefine __FTERRORS_H__ */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* work for backward compatibility. */
|
||||
/* */
|
||||
#if !( defined( FTERRORS_H_ ) && defined ( __FTERRORS_H__ ) )
|
||||
#define FTERRORS_H_
|
||||
#define __FTERRORS_H__
|
||||
|
||||
|
||||
/* include module base error codes */
|
||||
#include <freetype/ftmoderr.h>
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
/***** *****/
|
||||
/***** SETUP MACROS *****/
|
||||
/***** *****/
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
#undef FT_NEED_EXTERN_C
|
||||
|
||||
|
||||
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
|
||||
/* By default, we use `FT_Err_`. */
|
||||
/* */
|
||||
#ifndef FT_ERR_PREFIX
|
||||
#define FT_ERR_PREFIX FT_Err_
|
||||
#endif
|
||||
|
||||
|
||||
/* FT_ERR_BASE is used as the base for module-specific errors. */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
|
||||
|
||||
#ifndef FT_ERR_BASE
|
||||
#define FT_ERR_BASE FT_Mod_Err_Base
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#undef FT_ERR_BASE
|
||||
#define FT_ERR_BASE 0
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
|
||||
|
||||
|
||||
/* If FT_ERRORDEF is not defined, we need to define a simple */
|
||||
/* enumeration type. */
|
||||
/* */
|
||||
#ifndef FT_ERRORDEF
|
||||
|
||||
#define FT_INCLUDE_ERR_PROTOS
|
||||
|
||||
#define FT_ERRORDEF( e, v, s ) e = v,
|
||||
#define FT_ERROR_START_LIST enum {
|
||||
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_NEED_EXTERN_C
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#endif /* !FT_ERRORDEF */
|
||||
|
||||
|
||||
/* this macro is used to define an error */
|
||||
#define FT_ERRORDEF_( e, v, s ) \
|
||||
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
|
||||
|
||||
/* this is only used for <module>_Err_Ok, which must be 0! */
|
||||
#define FT_NOERRORDEF_( e, v, s ) \
|
||||
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
|
||||
|
||||
|
||||
#ifdef FT_ERROR_START_LIST
|
||||
FT_ERROR_START_LIST
|
||||
#endif
|
||||
|
||||
|
||||
/* now include the error codes */
|
||||
#include <freetype/fterrdef.h>
|
||||
|
||||
|
||||
#ifdef FT_ERROR_END_LIST
|
||||
FT_ERROR_END_LIST
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
/***** *****/
|
||||
/***** SIMPLE CLEANUP *****/
|
||||
/***** *****/
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
|
||||
#ifdef FT_NEED_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef FT_ERROR_START_LIST
|
||||
#undef FT_ERROR_END_LIST
|
||||
|
||||
#undef FT_ERRORDEF
|
||||
#undef FT_ERRORDEF_
|
||||
#undef FT_NOERRORDEF_
|
||||
|
||||
#undef FT_NEED_EXTERN_C
|
||||
#undef FT_ERR_BASE
|
||||
|
||||
/* FT_ERR_PREFIX is needed internally */
|
||||
#ifndef FT2_BUILD_LIBRARY
|
||||
#undef FT_ERR_PREFIX
|
||||
#endif
|
||||
|
||||
/* FT_INCLUDE_ERR_PROTOS: Control whether function prototypes should be */
|
||||
/* included with */
|
||||
/* */
|
||||
/* #include <freetype/fterrors.h> */
|
||||
/* */
|
||||
/* This is only true where `FT_ERRORDEF` is */
|
||||
/* undefined. */
|
||||
/* */
|
||||
/* FT_ERR_PROTOS_DEFINED: Actual multiple-inclusion protection of */
|
||||
/* `fterrors.h`. */
|
||||
#ifdef FT_INCLUDE_ERR_PROTOS
|
||||
#undef FT_INCLUDE_ERR_PROTOS
|
||||
|
||||
#ifndef FT_ERR_PROTOS_DEFINED
|
||||
#define FT_ERR_PROTOS_DEFINED
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Error_String
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the description of a valid FreeType error code.
|
||||
*
|
||||
* @input:
|
||||
* error_code ::
|
||||
* A valid FreeType error code.
|
||||
*
|
||||
* @return:
|
||||
* A C~string or `NULL`, if any error occurred.
|
||||
*
|
||||
* @note:
|
||||
* FreeType has to be compiled with `FT_CONFIG_OPTION_ERROR_STRINGS` or
|
||||
* `FT_DEBUG_LEVEL_ERROR` to get meaningful descriptions.
|
||||
* 'error_string' will be `NULL` otherwise.
|
||||
*
|
||||
* Module identification will be ignored:
|
||||
*
|
||||
* ```c
|
||||
* strcmp( FT_Error_String( FT_Err_Unknown_File_Format ),
|
||||
* FT_Error_String( BDF_Err_Unknown_File_Format ) ) == 0;
|
||||
* ```
|
||||
*/
|
||||
FT_EXPORT( const char* )
|
||||
FT_Error_String( FT_Error error_code );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* FT_ERR_PROTOS_DEFINED */
|
||||
|
||||
#endif /* FT_INCLUDE_ERR_PROTOS */
|
||||
|
||||
#endif /* !(FTERRORS_H_ && __FTERRORS_H__) */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,93 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftfntfmt.h
|
||||
*
|
||||
* Support functions for font formats.
|
||||
*
|
||||
* Copyright (C) 2002-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTFNTFMT_H_
|
||||
#define FTFNTFMT_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* font_formats
|
||||
*
|
||||
* @title:
|
||||
* Font Formats
|
||||
*
|
||||
* @abstract:
|
||||
* Getting the font format.
|
||||
*
|
||||
* @description:
|
||||
* The single function in this section can be used to get the font format.
|
||||
* Note that this information is not needed normally; however, there are
|
||||
* special cases (like in PDF devices) where it is important to
|
||||
* differentiate, in spite of FreeType's uniform API.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_Font_Format
|
||||
*
|
||||
* @description:
|
||||
* Return a string describing the format of a given face. Possible values
|
||||
* are 'TrueType', 'Type~1', 'BDF', 'PCF', 'Type~42', 'CID~Type~1', 'CFF',
|
||||
* 'PFR', and 'Windows~FNT'.
|
||||
*
|
||||
* The return value is suitable to be used as an X11 FONT_PROPERTY.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* Input face handle.
|
||||
*
|
||||
* @return:
|
||||
* Font format string. `NULL` in case of error.
|
||||
*
|
||||
* @note:
|
||||
* A deprecated name for the same function is `FT_Get_X11_Font_Format`.
|
||||
*/
|
||||
FT_EXPORT( const char* )
|
||||
FT_Get_Font_Format( FT_Face face );
|
||||
|
||||
|
||||
/* deprecated */
|
||||
FT_EXPORT( const char* )
|
||||
FT_Get_X11_Font_Format( FT_Face face );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTFNTFMT_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,143 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftgasp.h
|
||||
*
|
||||
* Access of TrueType's 'gasp' table (specification).
|
||||
*
|
||||
* Copyright (C) 2007-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTGASP_H_
|
||||
#define FTGASP_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* gasp_table
|
||||
*
|
||||
* @title:
|
||||
* Gasp Table
|
||||
*
|
||||
* @abstract:
|
||||
* Retrieving TrueType 'gasp' table entries.
|
||||
*
|
||||
* @description:
|
||||
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType
|
||||
* font for specific entries in its 'gasp' table, if any. This is mainly
|
||||
* useful when implementing native TrueType hinting with the bytecode
|
||||
* interpreter to duplicate the Windows text rendering results.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_GASP_XXX
|
||||
*
|
||||
* @description:
|
||||
* A list of values and/or bit-flags returned by the @FT_Get_Gasp
|
||||
* function.
|
||||
*
|
||||
* @values:
|
||||
* FT_GASP_NO_TABLE ::
|
||||
* This special value means that there is no GASP table in this face.
|
||||
* It is up to the client to decide what to do.
|
||||
*
|
||||
* FT_GASP_DO_GRIDFIT ::
|
||||
* Grid-fitting and hinting should be performed at the specified ppem.
|
||||
* This **really** means TrueType bytecode interpretation. If this bit
|
||||
* is not set, no hinting gets applied.
|
||||
*
|
||||
* FT_GASP_DO_GRAY ::
|
||||
* Anti-aliased rendering should be performed at the specified ppem.
|
||||
* If not set, do monochrome rendering.
|
||||
*
|
||||
* FT_GASP_SYMMETRIC_SMOOTHING ::
|
||||
* If set, smoothing along multiple axes must be used with ClearType.
|
||||
*
|
||||
* FT_GASP_SYMMETRIC_GRIDFIT ::
|
||||
* Grid-fitting must be used with ClearType's symmetric smoothing.
|
||||
*
|
||||
* @note:
|
||||
* The bit-flags `FT_GASP_DO_GRIDFIT` and `FT_GASP_DO_GRAY` are to be
|
||||
* used for standard font rasterization only. Independently of that,
|
||||
* `FT_GASP_SYMMETRIC_SMOOTHING` and `FT_GASP_SYMMETRIC_GRIDFIT` are to
|
||||
* be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT` and
|
||||
* `FT_GASP_DO_GRAY` are consequently ignored).
|
||||
*
|
||||
* 'ClearType' is Microsoft's implementation of LCD rendering, partly
|
||||
* protected by patents.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.0
|
||||
*/
|
||||
#define FT_GASP_NO_TABLE -1
|
||||
#define FT_GASP_DO_GRIDFIT 0x01
|
||||
#define FT_GASP_DO_GRAY 0x02
|
||||
#define FT_GASP_SYMMETRIC_GRIDFIT 0x04
|
||||
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_Gasp
|
||||
*
|
||||
* @description:
|
||||
* For a TrueType or OpenType font file, return the rasterizer behaviour
|
||||
* flags from the font's 'gasp' table corresponding to a given character
|
||||
* pixel size.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source face handle.
|
||||
*
|
||||
* ppem ::
|
||||
* The vertical character pixel size.
|
||||
*
|
||||
* @return:
|
||||
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
|
||||
* 'gasp' table in the face.
|
||||
*
|
||||
* @note:
|
||||
* If you want to use the MM functionality of OpenType variation fonts
|
||||
* (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
|
||||
* function **after** setting an instance since the return values can
|
||||
* change.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.0
|
||||
*/
|
||||
FT_EXPORT( FT_Int )
|
||||
FT_Get_Gasp( FT_Face face,
|
||||
FT_UInt ppem );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTGASP_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,750 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftglyph.h
|
||||
*
|
||||
* FreeType convenience functions to handle glyphs (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This file contains the definition of several convenience functions that
|
||||
* can be used by client applications to easily retrieve glyph bitmaps and
|
||||
* outlines from a given face.
|
||||
*
|
||||
* These functions should be optional if you are writing a font server or
|
||||
* text layout engine on top of FreeType. However, they are pretty handy
|
||||
* for many other simple uses of the library.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTGLYPH_H_
|
||||
#define FTGLYPH_H_
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* glyph_management
|
||||
*
|
||||
* @title:
|
||||
* Glyph Management
|
||||
*
|
||||
* @abstract:
|
||||
* Generic interface to manage individual glyph data.
|
||||
*
|
||||
* @description:
|
||||
* This section contains definitions used to manage glyph data through
|
||||
* generic @FT_Glyph objects. Each of them can contain a bitmap,
|
||||
* a vector outline, or even images in other formats. These objects are
|
||||
* detached from @FT_Face, contrary to @FT_GlyphSlot.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* forward declaration to a private type */
|
||||
typedef struct FT_Glyph_Class_ FT_Glyph_Class;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Glyph
|
||||
*
|
||||
* @description:
|
||||
* Handle to an object used to model generic glyph images. It is a
|
||||
* pointer to the @FT_GlyphRec structure and can contain a glyph bitmap
|
||||
* or pointer.
|
||||
*
|
||||
* @note:
|
||||
* Glyph objects are not owned by the library. You must thus release
|
||||
* them manually (through @FT_Done_Glyph) _before_ calling
|
||||
* @FT_Done_FreeType.
|
||||
*/
|
||||
typedef struct FT_GlyphRec_* FT_Glyph;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_GlyphRec
|
||||
*
|
||||
* @description:
|
||||
* The root glyph structure contains a given glyph image plus its advance
|
||||
* width in 16.16 fixed-point format.
|
||||
*
|
||||
* @fields:
|
||||
* library ::
|
||||
* A handle to the FreeType library object.
|
||||
*
|
||||
* clazz ::
|
||||
* A pointer to the glyph's class. Private.
|
||||
*
|
||||
* format ::
|
||||
* The format of the glyph's image.
|
||||
*
|
||||
* advance ::
|
||||
* A 16.16 vector that gives the glyph's advance width.
|
||||
*/
|
||||
typedef struct FT_GlyphRec_
|
||||
{
|
||||
FT_Library library;
|
||||
const FT_Glyph_Class* clazz;
|
||||
FT_Glyph_Format format;
|
||||
FT_Vector advance;
|
||||
|
||||
} FT_GlyphRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_BitmapGlyph
|
||||
*
|
||||
* @description:
|
||||
* A handle to an object used to model a bitmap glyph image. This is a
|
||||
* 'sub-class' of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.
|
||||
*/
|
||||
typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_BitmapGlyphRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used for bitmap glyph images. This really is a
|
||||
* 'sub-class' of @FT_GlyphRec.
|
||||
*
|
||||
* @fields:
|
||||
* root ::
|
||||
* The root fields of @FT_Glyph.
|
||||
*
|
||||
* left ::
|
||||
* The left-side bearing, i.e., the horizontal distance from the
|
||||
* current pen position to the left border of the glyph bitmap.
|
||||
*
|
||||
* top ::
|
||||
* The top-side bearing, i.e., the vertical distance from the current
|
||||
* pen position to the top border of the glyph bitmap. This distance
|
||||
* is positive for upwards~y!
|
||||
*
|
||||
* bitmap ::
|
||||
* A descriptor for the bitmap.
|
||||
*
|
||||
* @note:
|
||||
* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have
|
||||
* `glyph->format == FT_GLYPH_FORMAT_BITMAP`. This lets you access the
|
||||
* bitmap's contents easily.
|
||||
*
|
||||
* The corresponding pixel buffer is always owned by @FT_BitmapGlyph and
|
||||
* is thus created and destroyed with it.
|
||||
*/
|
||||
typedef struct FT_BitmapGlyphRec_
|
||||
{
|
||||
FT_GlyphRec root;
|
||||
FT_Int left;
|
||||
FT_Int top;
|
||||
FT_Bitmap bitmap;
|
||||
|
||||
} FT_BitmapGlyphRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_OutlineGlyph
|
||||
*
|
||||
* @description:
|
||||
* A handle to an object used to model an outline glyph image. This is a
|
||||
* 'sub-class' of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec.
|
||||
*/
|
||||
typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_OutlineGlyphRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used for outline (vectorial) glyph images. This really is
|
||||
* a 'sub-class' of @FT_GlyphRec.
|
||||
*
|
||||
* @fields:
|
||||
* root ::
|
||||
* The root @FT_Glyph fields.
|
||||
*
|
||||
* outline ::
|
||||
* A descriptor for the outline.
|
||||
*
|
||||
* @note:
|
||||
* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have
|
||||
* `glyph->format == FT_GLYPH_FORMAT_OUTLINE`. This lets you access the
|
||||
* outline's content easily.
|
||||
*
|
||||
* As the outline is extracted from a glyph slot, its coordinates are
|
||||
* expressed normally in 26.6 pixels, unless the flag @FT_LOAD_NO_SCALE
|
||||
* was used in @FT_Load_Glyph or @FT_Load_Char.
|
||||
*
|
||||
* The outline's tables are always owned by the object and are destroyed
|
||||
* with it.
|
||||
*/
|
||||
typedef struct FT_OutlineGlyphRec_
|
||||
{
|
||||
FT_GlyphRec root;
|
||||
FT_Outline outline;
|
||||
|
||||
} FT_OutlineGlyphRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_SvgGlyph
|
||||
*
|
||||
* @description:
|
||||
* A handle to an object used to model an SVG glyph. This is a
|
||||
* 'sub-class' of @FT_Glyph, and a pointer to @FT_SvgGlyphRec.
|
||||
*
|
||||
* @since:
|
||||
* 2.12
|
||||
*/
|
||||
typedef struct FT_SvgGlyphRec_* FT_SvgGlyph;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_SvgGlyphRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used for OT-SVG glyphs. This is a 'sub-class' of
|
||||
* @FT_GlyphRec.
|
||||
*
|
||||
* @fields:
|
||||
* root ::
|
||||
* The root @FT_GlyphRec fields.
|
||||
*
|
||||
* svg_document ::
|
||||
* A pointer to the SVG document.
|
||||
*
|
||||
* svg_document_length ::
|
||||
* The length of `svg_document`.
|
||||
*
|
||||
* glyph_index ::
|
||||
* The index of the glyph to be rendered.
|
||||
*
|
||||
* metrics ::
|
||||
* A metrics object storing the size information.
|
||||
*
|
||||
* units_per_EM ::
|
||||
* The size of the EM square.
|
||||
*
|
||||
* start_glyph_id ::
|
||||
* The first glyph ID in the glyph range covered by this document.
|
||||
*
|
||||
* end_glyph_id ::
|
||||
* The last glyph ID in the glyph range covered by this document.
|
||||
*
|
||||
* transform ::
|
||||
* A 2x2 transformation matrix to apply to the glyph while rendering
|
||||
* it.
|
||||
*
|
||||
* delta ::
|
||||
* Translation to apply to the glyph while rendering.
|
||||
*
|
||||
* @note:
|
||||
* The Glyph Management API requires @FT_Glyph or its 'sub-class' to have
|
||||
* all the information needed to completely define the glyph's rendering.
|
||||
* Outline-based glyphs can directly apply transformations to the outline
|
||||
* but this is not possible for an SVG document that hasn't been parsed.
|
||||
* Therefore, the transformation is stored along with the document. In
|
||||
* the absence of a 'ViewBox' or 'Width'/'Height' attribute, the size of
|
||||
* the ViewPort should be assumed to be 'units_per_EM'.
|
||||
*/
|
||||
typedef struct FT_SvgGlyphRec_
|
||||
{
|
||||
FT_GlyphRec root;
|
||||
|
||||
FT_Byte* svg_document;
|
||||
FT_ULong svg_document_length;
|
||||
|
||||
FT_UInt glyph_index;
|
||||
|
||||
FT_Size_Metrics metrics;
|
||||
FT_UShort units_per_EM;
|
||||
|
||||
FT_UShort start_glyph_id;
|
||||
FT_UShort end_glyph_id;
|
||||
|
||||
FT_Matrix transform;
|
||||
FT_Vector delta;
|
||||
|
||||
} FT_SvgGlyphRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_New_Glyph
|
||||
*
|
||||
* @description:
|
||||
* A function used to create a new empty glyph image. Note that the
|
||||
* created @FT_Glyph object must be released with @FT_Done_Glyph.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to the FreeType library object.
|
||||
*
|
||||
* format ::
|
||||
* The format of the glyph's image.
|
||||
*
|
||||
* @output:
|
||||
* aglyph ::
|
||||
* A handle to the glyph object.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @since:
|
||||
* 2.10
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_New_Glyph( FT_Library library,
|
||||
FT_Glyph_Format format,
|
||||
FT_Glyph *aglyph );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_Glyph
|
||||
*
|
||||
* @description:
|
||||
* A function used to extract a glyph image from a slot. Note that the
|
||||
* created @FT_Glyph object must be released with @FT_Done_Glyph.
|
||||
*
|
||||
* @input:
|
||||
* slot ::
|
||||
* A handle to the source glyph slot.
|
||||
*
|
||||
* @output:
|
||||
* aglyph ::
|
||||
* A handle to the glyph object. `NULL` in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* Because `*aglyph->advance.x` and `*aglyph->advance.y` are 16.16
|
||||
* fixed-point numbers, `slot->advance.x` and `slot->advance.y` (which
|
||||
* are in 26.6 fixed-point format) must be in the range ]-32768;32768[.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_Glyph( FT_GlyphSlot slot,
|
||||
FT_Glyph *aglyph );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Glyph_Copy
|
||||
*
|
||||
* @description:
|
||||
* A function used to copy a glyph image. Note that the created
|
||||
* @FT_Glyph object must be released with @FT_Done_Glyph.
|
||||
*
|
||||
* @input:
|
||||
* source ::
|
||||
* A handle to the source glyph object.
|
||||
*
|
||||
* @output:
|
||||
* target ::
|
||||
* A handle to the target glyph object. `NULL` in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Glyph_Copy( FT_Glyph source,
|
||||
FT_Glyph *target );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Glyph_Transform
|
||||
*
|
||||
* @description:
|
||||
* Transform a glyph image if its format is scalable.
|
||||
*
|
||||
* @inout:
|
||||
* glyph ::
|
||||
* A handle to the target glyph object.
|
||||
*
|
||||
* @input:
|
||||
* matrix ::
|
||||
* A pointer to a 2x2 matrix to apply.
|
||||
*
|
||||
* delta ::
|
||||
* A pointer to a 2d vector to apply. Coordinates are expressed in
|
||||
* 1/64 of a pixel.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code (if not 0, the glyph format is not scalable).
|
||||
*
|
||||
* @note:
|
||||
* The 2x2 transformation matrix is also applied to the glyph's advance
|
||||
* vector.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Glyph_Transform( FT_Glyph glyph,
|
||||
const FT_Matrix* matrix,
|
||||
const FT_Vector* delta );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_Glyph_BBox_Mode
|
||||
*
|
||||
* @description:
|
||||
* The mode how the values of @FT_Glyph_Get_CBox are returned.
|
||||
*
|
||||
* @values:
|
||||
* FT_GLYPH_BBOX_UNSCALED ::
|
||||
* Return unscaled font units.
|
||||
*
|
||||
* FT_GLYPH_BBOX_SUBPIXELS ::
|
||||
* Return unfitted 26.6 coordinates.
|
||||
*
|
||||
* FT_GLYPH_BBOX_GRIDFIT ::
|
||||
* Return grid-fitted 26.6 coordinates.
|
||||
*
|
||||
* FT_GLYPH_BBOX_TRUNCATE ::
|
||||
* Return coordinates in integer pixels.
|
||||
*
|
||||
* FT_GLYPH_BBOX_PIXELS ::
|
||||
* Return grid-fitted pixel coordinates.
|
||||
*/
|
||||
typedef enum FT_Glyph_BBox_Mode_
|
||||
{
|
||||
FT_GLYPH_BBOX_UNSCALED = 0,
|
||||
FT_GLYPH_BBOX_SUBPIXELS = 0,
|
||||
FT_GLYPH_BBOX_GRIDFIT = 1,
|
||||
FT_GLYPH_BBOX_TRUNCATE = 2,
|
||||
FT_GLYPH_BBOX_PIXELS = 3
|
||||
|
||||
} FT_Glyph_BBox_Mode;
|
||||
|
||||
|
||||
/* these constants are deprecated; use the corresponding */
|
||||
/* `FT_Glyph_BBox_Mode` values instead */
|
||||
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
|
||||
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
|
||||
#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
|
||||
#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
|
||||
#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Glyph_Get_CBox
|
||||
*
|
||||
* @description:
|
||||
* Return a glyph's 'control box'. The control box encloses all the
|
||||
* outline's points, including Bezier control points. Though it
|
||||
* coincides with the exact bounding box for most glyphs, it can be
|
||||
* slightly larger in some situations (like when rotating an outline that
|
||||
* contains Bezier outside arcs).
|
||||
*
|
||||
* Computing the control box is very fast, while getting the bounding box
|
||||
* can take much more time as it needs to walk over all segments and arcs
|
||||
* in the outline. To get the latter, you can use the 'ftbbox'
|
||||
* component, which is dedicated to this single task.
|
||||
*
|
||||
* @input:
|
||||
* glyph ::
|
||||
* A handle to the source glyph object.
|
||||
*
|
||||
* mode ::
|
||||
* The mode that indicates how to interpret the returned bounding box
|
||||
* values.
|
||||
*
|
||||
* @output:
|
||||
* acbox ::
|
||||
* The glyph coordinate bounding box. Coordinates are expressed in
|
||||
* 1/64 of pixels if it is grid-fitted.
|
||||
*
|
||||
* @note:
|
||||
* Coordinates are relative to the glyph origin, using the y~upwards
|
||||
* convention.
|
||||
*
|
||||
* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode` must
|
||||
* be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font units in 26.6
|
||||
* pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS is another name for
|
||||
* this constant.
|
||||
*
|
||||
* If the font is tricky and the glyph has been loaded with
|
||||
* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get
|
||||
* reasonable values for the CBox it is necessary to load the glyph at a
|
||||
* large ppem value (so that the hinting instructions can properly shift
|
||||
* and scale the subglyphs), then extracting the CBox, which can be
|
||||
* eventually converted back to font units.
|
||||
*
|
||||
* Note that the maximum coordinates are exclusive, which means that one
|
||||
* can compute the width and height of the glyph image (be it in integer
|
||||
* or 26.6 pixels) as:
|
||||
*
|
||||
* ```
|
||||
* width = bbox.xMax - bbox.xMin;
|
||||
* height = bbox.yMax - bbox.yMin;
|
||||
* ```
|
||||
*
|
||||
* Note also that for 26.6 coordinates, if `bbox_mode` is set to
|
||||
* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,
|
||||
* which corresponds to:
|
||||
*
|
||||
* ```
|
||||
* bbox.xMin = FLOOR(bbox.xMin);
|
||||
* bbox.yMin = FLOOR(bbox.yMin);
|
||||
* bbox.xMax = CEILING(bbox.xMax);
|
||||
* bbox.yMax = CEILING(bbox.yMax);
|
||||
* ```
|
||||
*
|
||||
* To get the bbox in pixel coordinates, set `bbox_mode` to
|
||||
* @FT_GLYPH_BBOX_TRUNCATE.
|
||||
*
|
||||
* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode` to
|
||||
* @FT_GLYPH_BBOX_PIXELS.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Glyph_Get_CBox( FT_Glyph glyph,
|
||||
FT_UInt bbox_mode,
|
||||
FT_BBox *acbox );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Glyph_To_Bitmap
|
||||
*
|
||||
* @description:
|
||||
* Convert a given glyph object to a bitmap glyph object.
|
||||
*
|
||||
* @inout:
|
||||
* the_glyph ::
|
||||
* A pointer to a handle to the target glyph.
|
||||
*
|
||||
* @input:
|
||||
* render_mode ::
|
||||
* An enumeration that describes how the data is rendered.
|
||||
*
|
||||
* origin ::
|
||||
* A pointer to a vector used to translate the glyph image before
|
||||
* rendering. Can be~0 (if no translation). The origin is expressed
|
||||
* in 26.6 pixels.
|
||||
*
|
||||
* destroy ::
|
||||
* A boolean that indicates that the original glyph image should be
|
||||
* destroyed by this function. It is never destroyed in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function does nothing if the glyph format isn't scalable.
|
||||
*
|
||||
* The glyph image is translated with the `origin` vector before
|
||||
* rendering.
|
||||
*
|
||||
* The first parameter is a pointer to an @FT_Glyph handle that will be
|
||||
* _replaced_ by this function (with newly allocated data). Typically,
|
||||
* you would do something like the following (omitting error handling).
|
||||
*
|
||||
* ```
|
||||
* FT_Glyph glyph;
|
||||
* FT_BitmapGlyph glyph_bitmap;
|
||||
*
|
||||
*
|
||||
* // load glyph
|
||||
* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT );
|
||||
*
|
||||
* // extract glyph image
|
||||
* error = FT_Get_Glyph( face->glyph, &glyph );
|
||||
*
|
||||
* // convert to a bitmap (default render mode + destroying old)
|
||||
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
|
||||
* {
|
||||
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
|
||||
* 0, 1 );
|
||||
* if ( error ) // `glyph' unchanged
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* // access bitmap content by typecasting
|
||||
* glyph_bitmap = (FT_BitmapGlyph)glyph;
|
||||
*
|
||||
* // do funny stuff with it, like blitting/drawing
|
||||
* ...
|
||||
*
|
||||
* // discard glyph image (bitmap or not)
|
||||
* FT_Done_Glyph( glyph );
|
||||
* ```
|
||||
*
|
||||
* Here is another example, again without error handling.
|
||||
*
|
||||
* ```
|
||||
* FT_Glyph glyphs[MAX_GLYPHS]
|
||||
*
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* for ( idx = 0; i < MAX_GLYPHS; i++ )
|
||||
* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||
|
||||
* FT_Get_Glyph ( face->glyph, &glyphs[idx] );
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* for ( idx = 0; i < MAX_GLYPHS; i++ )
|
||||
* {
|
||||
* FT_Glyph bitmap = glyphs[idx];
|
||||
*
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // after this call, `bitmap' no longer points into
|
||||
* // the `glyphs' array (and the old value isn't destroyed)
|
||||
* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* FT_Done_Glyph( bitmap );
|
||||
* }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* for ( idx = 0; i < MAX_GLYPHS; i++ )
|
||||
* FT_Done_Glyph( glyphs[idx] );
|
||||
* ```
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
|
||||
FT_Render_Mode render_mode,
|
||||
const FT_Vector* origin,
|
||||
FT_Bool destroy );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Done_Glyph
|
||||
*
|
||||
* @description:
|
||||
* Destroy a given glyph.
|
||||
*
|
||||
* @input:
|
||||
* glyph ::
|
||||
* A handle to the target glyph object. Can be `NULL`.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Done_Glyph( FT_Glyph glyph );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* other helpful functions */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* computations
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Matrix_Multiply
|
||||
*
|
||||
* @description:
|
||||
* Perform the matrix operation `b = a*b`.
|
||||
*
|
||||
* @input:
|
||||
* a ::
|
||||
* A pointer to matrix `a`.
|
||||
*
|
||||
* @inout:
|
||||
* b ::
|
||||
* A pointer to matrix `b`.
|
||||
*
|
||||
* @note:
|
||||
* The result is undefined if either `a` or `b` is zero.
|
||||
*
|
||||
* Since the function uses wrap-around arithmetic, results become
|
||||
* meaningless if the arguments are very large.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Matrix_Multiply( const FT_Matrix* a,
|
||||
FT_Matrix* b );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Matrix_Invert
|
||||
*
|
||||
* @description:
|
||||
* Invert a 2x2 matrix. Return an error if it can't be inverted.
|
||||
*
|
||||
* @inout:
|
||||
* matrix ::
|
||||
* A pointer to the target matrix. Remains untouched in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Matrix_Invert( FT_Matrix* matrix );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTGLYPH_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
@@ -0,0 +1,354 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftgxval.h
|
||||
*
|
||||
* FreeType API for validating TrueTypeGX/AAT tables (specification).
|
||||
*
|
||||
* Copyright (C) 2004-2024 by
|
||||
* Masatake YAMATO, Redhat K.K,
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* gxvalid is derived from both gxlayout module and otvalid module.
|
||||
* Development of gxlayout is supported by the Information-technology
|
||||
* Promotion Agency(IPA), Japan.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTGXVAL_H_
|
||||
#define FTGXVAL_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* gx_validation
|
||||
*
|
||||
* @title:
|
||||
* TrueTypeGX/AAT Validation
|
||||
*
|
||||
* @abstract:
|
||||
* An API to validate TrueTypeGX/AAT tables.
|
||||
*
|
||||
* @description:
|
||||
* This section contains the declaration of functions to validate some
|
||||
* TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak,
|
||||
* prop, lcar).
|
||||
*
|
||||
* @order:
|
||||
* FT_TrueTypeGX_Validate
|
||||
* FT_TrueTypeGX_Free
|
||||
*
|
||||
* FT_ClassicKern_Validate
|
||||
* FT_ClassicKern_Free
|
||||
*
|
||||
* FT_VALIDATE_GX_LENGTH
|
||||
* FT_VALIDATE_GXXXX
|
||||
* FT_VALIDATE_CKERNXXX
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Warning: Use `FT_VALIDATE_XXX` to validate a table.
|
||||
* Following definitions are for gxvalid developers.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_VALIDATE_feat_INDEX 0
|
||||
#define FT_VALIDATE_mort_INDEX 1
|
||||
#define FT_VALIDATE_morx_INDEX 2
|
||||
#define FT_VALIDATE_bsln_INDEX 3
|
||||
#define FT_VALIDATE_just_INDEX 4
|
||||
#define FT_VALIDATE_kern_INDEX 5
|
||||
#define FT_VALIDATE_opbd_INDEX 6
|
||||
#define FT_VALIDATE_trak_INDEX 7
|
||||
#define FT_VALIDATE_prop_INDEX 8
|
||||
#define FT_VALIDATE_lcar_INDEX 9
|
||||
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_VALIDATE_GX_LENGTH
|
||||
*
|
||||
* @description:
|
||||
* The number of tables checked in this module. Use it as a parameter
|
||||
* for the `table-length` argument of function @FT_TrueTypeGX_Validate.
|
||||
*/
|
||||
#define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
|
||||
|
||||
/* */
|
||||
|
||||
/* Up to 0x1000 is used by otvalid.
|
||||
Ox2xxx is reserved for feature OT extension. */
|
||||
#define FT_VALIDATE_GX_START 0x4000
|
||||
#define FT_VALIDATE_GX_BITFIELD( tag ) \
|
||||
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_GXXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
|
||||
* indicate which TrueTypeGX/AAT Type tables should be validated.
|
||||
*
|
||||
* @values:
|
||||
* FT_VALIDATE_feat ::
|
||||
* Validate 'feat' table.
|
||||
*
|
||||
* FT_VALIDATE_mort ::
|
||||
* Validate 'mort' table.
|
||||
*
|
||||
* FT_VALIDATE_morx ::
|
||||
* Validate 'morx' table.
|
||||
*
|
||||
* FT_VALIDATE_bsln ::
|
||||
* Validate 'bsln' table.
|
||||
*
|
||||
* FT_VALIDATE_just ::
|
||||
* Validate 'just' table.
|
||||
*
|
||||
* FT_VALIDATE_kern ::
|
||||
* Validate 'kern' table.
|
||||
*
|
||||
* FT_VALIDATE_opbd ::
|
||||
* Validate 'opbd' table.
|
||||
*
|
||||
* FT_VALIDATE_trak ::
|
||||
* Validate 'trak' table.
|
||||
*
|
||||
* FT_VALIDATE_prop ::
|
||||
* Validate 'prop' table.
|
||||
*
|
||||
* FT_VALIDATE_lcar ::
|
||||
* Validate 'lcar' table.
|
||||
*
|
||||
* FT_VALIDATE_GX ::
|
||||
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
|
||||
* opbd, trak, prop and lcar).
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
|
||||
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
|
||||
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
|
||||
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
|
||||
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
|
||||
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
|
||||
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
|
||||
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
|
||||
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
|
||||
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
|
||||
|
||||
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
|
||||
FT_VALIDATE_mort | \
|
||||
FT_VALIDATE_morx | \
|
||||
FT_VALIDATE_bsln | \
|
||||
FT_VALIDATE_just | \
|
||||
FT_VALIDATE_kern | \
|
||||
FT_VALIDATE_opbd | \
|
||||
FT_VALIDATE_trak | \
|
||||
FT_VALIDATE_prop | \
|
||||
FT_VALIDATE_lcar )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_TrueTypeGX_Validate
|
||||
*
|
||||
* @description:
|
||||
* Validate various TrueTypeGX tables to assure that all offsets and
|
||||
* indices are valid. The idea is that a higher-level library that
|
||||
* actually does the text layout can access those tables without error
|
||||
* checking (which can be quite time consuming).
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field that specifies the tables to be validated. See
|
||||
* @FT_VALIDATE_GXXXX for possible values.
|
||||
*
|
||||
* table_length ::
|
||||
* The size of the `tables` array. Normally, @FT_VALIDATE_GX_LENGTH
|
||||
* should be passed.
|
||||
*
|
||||
* @output:
|
||||
* tables ::
|
||||
* The array where all validated sfnt tables are stored. The array
|
||||
* itself must be allocated by a client.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with TrueTypeGX fonts, returning an error
|
||||
* otherwise.
|
||||
*
|
||||
* After use, the application should deallocate the buffers pointed to by
|
||||
* each `tables` element, by calling @FT_TrueTypeGX_Free. A `NULL` value
|
||||
* indicates that the table either doesn't exist in the font, the
|
||||
* application hasn't asked for validation, or the validator doesn't have
|
||||
* the ability to validate the sfnt table.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_TrueTypeGX_Validate( FT_Face face,
|
||||
FT_UInt validation_flags,
|
||||
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
|
||||
FT_UInt table_length );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_TrueTypeGX_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by TrueTypeGX validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer allocated by @FT_TrueTypeGX_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_TrueTypeGX_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_TrueTypeGX_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_CKERNXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_ClassicKern_Validate to
|
||||
* indicate the classic kern dialect or dialects. If the selected type
|
||||
* doesn't fit, @FT_ClassicKern_Validate regards the table as invalid.
|
||||
*
|
||||
* @values:
|
||||
* FT_VALIDATE_MS ::
|
||||
* Handle the 'kern' table as a classic Microsoft kern table.
|
||||
*
|
||||
* FT_VALIDATE_APPLE ::
|
||||
* Handle the 'kern' table as a classic Apple kern table.
|
||||
*
|
||||
* FT_VALIDATE_CKERN ::
|
||||
* Handle the 'kern' as either classic Apple or Microsoft kern table.
|
||||
*/
|
||||
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
|
||||
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
|
||||
|
||||
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_ClassicKern_Validate
|
||||
*
|
||||
* @description:
|
||||
* Validate classic (16-bit format) kern table to assure that the
|
||||
* offsets and indices are valid. The idea is that a higher-level
|
||||
* library that actually does the text layout can access those tables
|
||||
* without error checking (which can be quite time consuming).
|
||||
*
|
||||
* The 'kern' table validator in @FT_TrueTypeGX_Validate deals with both
|
||||
* the new 32-bit format and the classic 16-bit format, while
|
||||
* FT_ClassicKern_Validate only supports the classic 16-bit format.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field that specifies the dialect to be validated. See
|
||||
* @FT_VALIDATE_CKERNXXX for possible values.
|
||||
*
|
||||
* @output:
|
||||
* ckern_table ::
|
||||
* A pointer to the kern table.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* After use, the application should deallocate the buffers pointed to by
|
||||
* `ckern_table`, by calling @FT_ClassicKern_Free. A `NULL` value
|
||||
* indicates that the table doesn't exist in the font.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_ClassicKern_Validate( FT_Face face,
|
||||
FT_UInt validation_flags,
|
||||
FT_Bytes *ckern_table );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_ClassicKern_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by classic Kern validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer that is allocated by
|
||||
* @FT_ClassicKern_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_ClassicKern_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_ClassicKern_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTGXVAL_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,151 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftgzip.h
|
||||
*
|
||||
* Gzip-compressed stream support.
|
||||
*
|
||||
* Copyright (C) 2002-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTGZIP_H_
|
||||
#define FTGZIP_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* gzip
|
||||
*
|
||||
* @title:
|
||||
* GZIP Streams
|
||||
*
|
||||
* @abstract:
|
||||
* Using gzip-compressed font files.
|
||||
*
|
||||
* @description:
|
||||
* In certain builds of the library, gzip compression recognition is
|
||||
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
|
||||
* This means that if no font driver is capable of handling the raw
|
||||
* compressed file, the library will try to open a gzipped stream from it
|
||||
* and re-open the face with it.
|
||||
*
|
||||
* The stream implementation is very basic and resets the decompression
|
||||
* process each time seeking backwards is needed within the stream,
|
||||
* which significantly undermines the performance.
|
||||
*
|
||||
* This section contains the declaration of Gzip-specific functions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stream_OpenGzip
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse gzip-compressed font files. This is mainly
|
||||
* used to support the compressed `*.pcf.gz` fonts that come with
|
||||
* XFree86.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* The target embedding stream.
|
||||
*
|
||||
* source ::
|
||||
* The source stream.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The source stream must be opened _before_ calling this function.
|
||||
*
|
||||
* Calling the internal function `FT_Stream_Close` on the new stream will
|
||||
* **not** call `FT_Stream_Close` on the source stream. None of the
|
||||
* stream objects will be released to the heap.
|
||||
*
|
||||
* This function may return `FT_Err_Unimplemented_Feature` if your build
|
||||
* of FreeType was not compiled with zlib support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stream_OpenGzip( FT_Stream stream,
|
||||
FT_Stream source );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Gzip_Uncompress
|
||||
*
|
||||
* @description:
|
||||
* Decompress a zipped input buffer into an output buffer. This function
|
||||
* is modeled after zlib's `uncompress` function.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* A FreeType memory handle.
|
||||
*
|
||||
* input ::
|
||||
* The input buffer.
|
||||
*
|
||||
* input_len ::
|
||||
* The length of the input buffer.
|
||||
*
|
||||
* @output:
|
||||
* output ::
|
||||
* The output buffer.
|
||||
*
|
||||
* @inout:
|
||||
* output_len ::
|
||||
* Before calling the function, this is the total size of the output
|
||||
* buffer, which must be large enough to hold the entire uncompressed
|
||||
* data (so the size of the uncompressed data must be known in
|
||||
* advance). After calling the function, `output_len` is the size of
|
||||
* the used data in `output`.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function may return `FT_Err_Unimplemented_Feature` if your build
|
||||
* of FreeType was not compiled with zlib support.
|
||||
*
|
||||
* @since:
|
||||
* 2.5.1
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Gzip_Uncompress( FT_Memory memory,
|
||||
FT_Byte* output,
|
||||
FT_ULong* output_len,
|
||||
const FT_Byte* input,
|
||||
FT_ULong input_len );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTGZIP_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,348 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftincrem.h
|
||||
*
|
||||
* FreeType incremental loading (specification).
|
||||
*
|
||||
* Copyright (C) 2002-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTINCREM_H_
|
||||
#define FTINCREM_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/ftparams.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* incremental
|
||||
*
|
||||
* @title:
|
||||
* Incremental Loading
|
||||
*
|
||||
* @abstract:
|
||||
* Custom Glyph Loading.
|
||||
*
|
||||
* @description:
|
||||
* This section contains various functions used to perform so-called
|
||||
* 'incremental' glyph loading. This is a mode where all glyphs loaded
|
||||
* from a given @FT_Face are provided by the client application.
|
||||
*
|
||||
* Apart from that, all other tables are loaded normally from the font
|
||||
* file. This mode is useful when FreeType is used within another
|
||||
* engine, e.g., a PostScript Imaging Processor.
|
||||
*
|
||||
* To enable this mode, you must use @FT_Open_Face, passing an
|
||||
* @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
|
||||
* @FT_Incremental_Interface value. See the comments for
|
||||
* @FT_Incremental_InterfaceRec for an example.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Incremental
|
||||
*
|
||||
* @description:
|
||||
* An opaque type describing a user-provided object used to implement
|
||||
* 'incremental' glyph loading within FreeType. This is used to support
|
||||
* embedded fonts in certain environments (e.g., PostScript
|
||||
* interpreters), where the glyph data isn't in the font file, or must be
|
||||
* overridden by different values.
|
||||
*
|
||||
* @note:
|
||||
* It is up to client applications to create and implement
|
||||
* @FT_Incremental objects, as long as they provide implementations for
|
||||
* the methods @FT_Incremental_GetGlyphDataFunc,
|
||||
* @FT_Incremental_FreeGlyphDataFunc and
|
||||
* @FT_Incremental_GetGlyphMetricsFunc.
|
||||
*
|
||||
* See the description of @FT_Incremental_InterfaceRec to understand how
|
||||
* to use incremental objects with FreeType.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_IncrementalRec_* FT_Incremental;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_Incremental_MetricsRec
|
||||
*
|
||||
* @description:
|
||||
* A small structure used to contain the basic glyph metrics returned by
|
||||
* the @FT_Incremental_GetGlyphMetricsFunc method.
|
||||
*
|
||||
* @fields:
|
||||
* bearing_x ::
|
||||
* Left bearing, in font units.
|
||||
*
|
||||
* bearing_y ::
|
||||
* Top bearing, in font units.
|
||||
*
|
||||
* advance ::
|
||||
* Horizontal component of glyph advance, in font units.
|
||||
*
|
||||
* advance_v ::
|
||||
* Vertical component of glyph advance, in font units.
|
||||
*
|
||||
* @note:
|
||||
* These correspond to horizontal or vertical metrics depending on the
|
||||
* value of the `vertical` argument to the function
|
||||
* @FT_Incremental_GetGlyphMetricsFunc.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_Incremental_MetricsRec_
|
||||
{
|
||||
FT_Long bearing_x;
|
||||
FT_Long bearing_y;
|
||||
FT_Long advance;
|
||||
FT_Long advance_v; /* since 2.3.12 */
|
||||
|
||||
} FT_Incremental_MetricsRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_Incremental_Metrics
|
||||
*
|
||||
* @description:
|
||||
* A handle to an @FT_Incremental_MetricsRec structure.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Incremental_GetGlyphDataFunc
|
||||
*
|
||||
* @description:
|
||||
* A function called by FreeType to access a given glyph's data bytes
|
||||
* during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
|
||||
* enabled.
|
||||
*
|
||||
* Note that the format of the glyph's data bytes depends on the font
|
||||
* file format. For TrueType, it must correspond to the raw bytes within
|
||||
* the 'glyf' table. For PostScript formats, it must correspond to the
|
||||
* **unencrypted** charstring bytes, without any `lenIV` header. It is
|
||||
* undefined for any other format.
|
||||
*
|
||||
* @input:
|
||||
* incremental ::
|
||||
* Handle to an opaque @FT_Incremental handle provided by the client
|
||||
* application.
|
||||
*
|
||||
* glyph_index ::
|
||||
* Index of relevant glyph.
|
||||
*
|
||||
* @output:
|
||||
* adata ::
|
||||
* A structure describing the returned glyph data bytes (which will be
|
||||
* accessed as a read-only byte block).
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* If this function returns successfully the method
|
||||
* @FT_Incremental_FreeGlyphDataFunc will be called later to release the
|
||||
* data bytes.
|
||||
*
|
||||
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
|
||||
* compound glyphs.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
|
||||
FT_UInt glyph_index,
|
||||
FT_Data* adata );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Incremental_FreeGlyphDataFunc
|
||||
*
|
||||
* @description:
|
||||
* A function used to release the glyph data bytes returned by a
|
||||
* successful call to @FT_Incremental_GetGlyphDataFunc.
|
||||
*
|
||||
* @input:
|
||||
* incremental ::
|
||||
* A handle to an opaque @FT_Incremental handle provided by the client
|
||||
* application.
|
||||
*
|
||||
* data ::
|
||||
* A structure describing the glyph data bytes (which will be accessed
|
||||
* as a read-only byte block).
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
|
||||
FT_Data* data );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Incremental_GetGlyphMetricsFunc
|
||||
*
|
||||
* @description:
|
||||
* A function used to retrieve the basic metrics of a given glyph index
|
||||
* before accessing its data. This allows for handling font types such
|
||||
* as PCL~XL Format~1, Class~2 downloaded TrueType fonts, where the glyph
|
||||
* metrics (`hmtx` and `vmtx` tables) are permitted to be omitted from
|
||||
* the font, and the relevant metrics included in the header of the glyph
|
||||
* outline data. Importantly, this is not intended to allow custom glyph
|
||||
* metrics (for example, Postscript Metrics dictionaries), because that
|
||||
* conflicts with the requirements of outline hinting. Such custom
|
||||
* metrics must be handled separately, by the calling application.
|
||||
*
|
||||
* @input:
|
||||
* incremental ::
|
||||
* A handle to an opaque @FT_Incremental handle provided by the client
|
||||
* application.
|
||||
*
|
||||
* glyph_index ::
|
||||
* Index of relevant glyph.
|
||||
*
|
||||
* vertical ::
|
||||
* If true, return vertical metrics.
|
||||
*
|
||||
* ametrics ::
|
||||
* This parameter is used for both input and output. The original
|
||||
* glyph metrics, if any, in font units. If metrics are not available
|
||||
* all the values must be set to zero.
|
||||
*
|
||||
* @output:
|
||||
* ametrics ::
|
||||
* The glyph metrics in font units.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FT_Incremental_GetGlyphMetricsFunc)
|
||||
( FT_Incremental incremental,
|
||||
FT_UInt glyph_index,
|
||||
FT_Bool vertical,
|
||||
FT_Incremental_MetricsRec *ametrics );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_Incremental_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* A table of functions for accessing fonts that load data incrementally.
|
||||
* Used in @FT_Incremental_InterfaceRec.
|
||||
*
|
||||
* @fields:
|
||||
* get_glyph_data ::
|
||||
* The function to get glyph data. Must not be null.
|
||||
*
|
||||
* free_glyph_data ::
|
||||
* The function to release glyph data. Must not be null.
|
||||
*
|
||||
* get_glyph_metrics ::
|
||||
* The function to get glyph metrics. May be null if the font does not
|
||||
* require it.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_Incremental_FuncsRec_
|
||||
{
|
||||
FT_Incremental_GetGlyphDataFunc get_glyph_data;
|
||||
FT_Incremental_FreeGlyphDataFunc free_glyph_data;
|
||||
FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
|
||||
|
||||
} FT_Incremental_FuncsRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_Incremental_InterfaceRec
|
||||
*
|
||||
* @description:
|
||||
* A structure to be used with @FT_Open_Face to indicate that the user
|
||||
* wants to support incremental glyph loading. You should use it with
|
||||
* @FT_PARAM_TAG_INCREMENTAL as in the following example:
|
||||
*
|
||||
* ```
|
||||
* FT_Incremental_InterfaceRec inc_int;
|
||||
* FT_Parameter parameter;
|
||||
* FT_Open_Args open_args;
|
||||
*
|
||||
*
|
||||
* // set up incremental descriptor
|
||||
* inc_int.funcs = my_funcs;
|
||||
* inc_int.object = my_object;
|
||||
*
|
||||
* // set up optional parameter
|
||||
* parameter.tag = FT_PARAM_TAG_INCREMENTAL;
|
||||
* parameter.data = &inc_int;
|
||||
*
|
||||
* // set up FT_Open_Args structure
|
||||
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
|
||||
* open_args.pathname = my_font_pathname;
|
||||
* open_args.num_params = 1;
|
||||
* open_args.params = ¶meter; // we use one optional argument
|
||||
*
|
||||
* // open the font
|
||||
* error = FT_Open_Face( library, &open_args, index, &face );
|
||||
* ...
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
typedef struct FT_Incremental_InterfaceRec_
|
||||
{
|
||||
const FT_Incremental_FuncsRec* funcs;
|
||||
FT_Incremental object;
|
||||
|
||||
} FT_Incremental_InterfaceRec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Incremental_Interface
|
||||
*
|
||||
* @description:
|
||||
* A pointer to an @FT_Incremental_InterfaceRec structure.
|
||||
*
|
||||
*/
|
||||
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTINCREM_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,323 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftlcdfil.h
|
||||
*
|
||||
* FreeType API for color filtering of subpixel bitmap glyphs
|
||||
* (specification).
|
||||
*
|
||||
* Copyright (C) 2006-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTLCDFIL_H_
|
||||
#define FTLCDFIL_H_
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/ftparams.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* lcd_rendering
|
||||
*
|
||||
* @title:
|
||||
* Subpixel Rendering
|
||||
*
|
||||
* @abstract:
|
||||
* API to control subpixel rendering.
|
||||
*
|
||||
* @description:
|
||||
* FreeType provides two alternative subpixel rendering technologies.
|
||||
* Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
|
||||
* `ftoption.h` file, this enables ClearType-style rendering.
|
||||
* Otherwise, Harmony LCD rendering is enabled. These technologies are
|
||||
* controlled differently and API described below, although always
|
||||
* available, performs its function when appropriate method is enabled
|
||||
* and does nothing otherwise.
|
||||
*
|
||||
* ClearType-style LCD rendering exploits the color-striped structure of
|
||||
* LCD pixels, increasing the available resolution in the direction of
|
||||
* the stripe (usually horizontal RGB) by a factor of~3. Using the
|
||||
* subpixel coverages unfiltered can create severe color fringes
|
||||
* especially when rendering thin features. Indeed, to produce
|
||||
* black-on-white text, the nearby color subpixels must be dimmed
|
||||
* evenly. Therefore, an equalizing 5-tap FIR filter should be applied
|
||||
* to subpixel coverages regardless of pixel boundaries and should have
|
||||
* these properties:
|
||||
*
|
||||
* 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
|
||||
* any shifts in appearance.
|
||||
*
|
||||
* 2. It should be color-balanced, meaning a~+ b~=~c, to reduce color
|
||||
* fringes by distributing the computed coverage for one subpixel to
|
||||
* all subpixels equally.
|
||||
*
|
||||
* 3. It should be normalized, meaning 2a~+ 2b~+ c~=~1.0 to maintain
|
||||
* overall brightness.
|
||||
*
|
||||
* Boxy 3-tap filter {0, 1/3, 1/3, 1/3, 0} is sharper but is less
|
||||
* forgiving of non-ideal gamma curves of a screen (and viewing angles),
|
||||
* beveled filters are fuzzier but more tolerant.
|
||||
*
|
||||
* Use the @FT_Library_SetLcdFilter or @FT_Library_SetLcdFilterWeights
|
||||
* API to specify a low-pass filter, which is then applied to
|
||||
* subpixel-rendered bitmaps generated through @FT_Render_Glyph.
|
||||
*
|
||||
* Harmony LCD rendering is suitable to panels with any regular subpixel
|
||||
* structure, not just monitors with 3 color striped subpixels, as long
|
||||
* as the color subpixels have fixed positions relative to the pixel
|
||||
* center. In this case, each color channel can be rendered separately
|
||||
* after shifting the outline opposite to the subpixel shift so that the
|
||||
* coverage maps are aligned. This method is immune to color fringes
|
||||
* because the shifts do not change integral coverage.
|
||||
*
|
||||
* The subpixel geometry must be specified by xy-coordinates for each
|
||||
* subpixel. By convention they may come in the RGB order: {{-1/3, 0},
|
||||
* {0, 0}, {1/3, 0}} for standard RGB striped panel or {{-1/6, 1/4},
|
||||
* {-1/6, -1/4}, {1/3, 0}} for a certain PenTile panel.
|
||||
*
|
||||
* Use the @FT_Library_SetLcdGeometry API to specify subpixel positions.
|
||||
* If one follows the RGB order convention, the same order applies to the
|
||||
* resulting @FT_PIXEL_MODE_LCD and @FT_PIXEL_MODE_LCD_V bitmaps. Note,
|
||||
* however, that the coordinate frame for the latter must be rotated
|
||||
* clockwise. Harmony with default LCD geometry is equivalent to
|
||||
* ClearType with light filter.
|
||||
*
|
||||
* As a result of ClearType filtering or Harmony shifts, the resulting
|
||||
* dimensions of LCD bitmaps can be slightly wider or taller than the
|
||||
* dimensions the original outline with regard to the pixel grid.
|
||||
* For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
|
||||
* the left, and 2~subpixels to the right. The bitmap offset values are
|
||||
* adjusted accordingly, so clients shouldn't need to modify their layout
|
||||
* and glyph positioning code when enabling the filter.
|
||||
*
|
||||
* The ClearType and Harmony rendering is applicable to glyph bitmaps
|
||||
* rendered through @FT_Render_Glyph, @FT_Load_Glyph, @FT_Load_Char, and
|
||||
* @FT_Glyph_To_Bitmap, when @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V
|
||||
* is specified. This API does not control @FT_Outline_Render and
|
||||
* @FT_Outline_Get_Bitmap.
|
||||
*
|
||||
* The described algorithms can completely remove color artefacts when
|
||||
* combined with gamma-corrected alpha blending in linear space. Each of
|
||||
* the 3~alpha values (subpixels) must by independently used to blend one
|
||||
* color channel. That is, red alpha blends the red channel of the text
|
||||
* color with the red channel of the background pixel.
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_LcdFilter
|
||||
*
|
||||
* @description:
|
||||
* A list of values to identify various types of LCD filters.
|
||||
*
|
||||
* @values:
|
||||
* FT_LCD_FILTER_NONE ::
|
||||
* Do not perform filtering. When used with subpixel rendering, this
|
||||
* results in sometimes severe color fringes.
|
||||
*
|
||||
* FT_LCD_FILTER_DEFAULT ::
|
||||
* This is a beveled, normalized, and color-balanced five-tap filter
|
||||
* with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256 units.
|
||||
*
|
||||
* FT_LCD_FILTER_LIGHT ::
|
||||
* this is a boxy, normalized, and color-balanced three-tap filter with
|
||||
* weights of [0x00 0x55 0x56 0x55 0x00] in 1/256 units.
|
||||
*
|
||||
* FT_LCD_FILTER_LEGACY ::
|
||||
* FT_LCD_FILTER_LEGACY1 ::
|
||||
* This filter corresponds to the original libXft color filter. It
|
||||
* provides high contrast output but can exhibit really bad color
|
||||
* fringes if glyphs are not extremely well hinted to the pixel grid.
|
||||
* This filter is only provided for comparison purposes, and might be
|
||||
* disabled or stay unsupported in the future. The second value is
|
||||
* provided for compatibility with FontConfig, which historically used
|
||||
* different enumeration, sometimes incorrectly forwarded to FreeType.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.0 (`FT_LCD_FILTER_LEGACY1` since 2.6.2)
|
||||
*/
|
||||
typedef enum FT_LcdFilter_
|
||||
{
|
||||
FT_LCD_FILTER_NONE = 0,
|
||||
FT_LCD_FILTER_DEFAULT = 1,
|
||||
FT_LCD_FILTER_LIGHT = 2,
|
||||
FT_LCD_FILTER_LEGACY1 = 3,
|
||||
FT_LCD_FILTER_LEGACY = 16,
|
||||
|
||||
FT_LCD_FILTER_MAX /* do not remove */
|
||||
|
||||
} FT_LcdFilter;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Library_SetLcdFilter
|
||||
*
|
||||
* @description:
|
||||
* This function is used to change filter applied to LCD decimated
|
||||
* bitmaps, like the ones used when calling @FT_Render_Glyph with
|
||||
* @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to the target library instance.
|
||||
*
|
||||
* filter ::
|
||||
* The filter type.
|
||||
*
|
||||
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or
|
||||
* @FT_LCD_FILTER_DEFAULT to use a default filter that should work well
|
||||
* on most LCD screens.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* Since 2.10.3 the LCD filtering is enabled with @FT_LCD_FILTER_DEFAULT.
|
||||
* It is no longer necessary to call this function explicitly except
|
||||
* to choose a different filter or disable filtering altogether with
|
||||
* @FT_LCD_FILTER_NONE.
|
||||
*
|
||||
* This function does nothing but returns `FT_Err_Unimplemented_Feature`
|
||||
* if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is
|
||||
* not defined in your build of the library.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.0
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Library_SetLcdFilter( FT_Library library,
|
||||
FT_LcdFilter filter );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Library_SetLcdFilterWeights
|
||||
*
|
||||
* @description:
|
||||
* This function can be used to enable LCD filter with custom weights,
|
||||
* instead of using presets in @FT_Library_SetLcdFilter.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to the target library instance.
|
||||
*
|
||||
* weights ::
|
||||
* A pointer to an array; the function copies the first five bytes and
|
||||
* uses them to specify the filter weights in 1/256 units.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function does nothing but returns `FT_Err_Unimplemented_Feature`
|
||||
* if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is
|
||||
* not defined in your build of the library.
|
||||
*
|
||||
* LCD filter weights can also be set per face using @FT_Face_Properties
|
||||
* with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
|
||||
*
|
||||
* @since:
|
||||
* 2.4.0
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Library_SetLcdFilterWeights( FT_Library library,
|
||||
unsigned char *weights );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_LcdFiveTapFilter
|
||||
*
|
||||
* @description:
|
||||
* A typedef for passing the five LCD filter weights to
|
||||
* @FT_Face_Properties within an @FT_Parameter structure.
|
||||
*
|
||||
* @since:
|
||||
* 2.8
|
||||
*
|
||||
*/
|
||||
#define FT_LCD_FILTER_FIVE_TAPS 5
|
||||
|
||||
typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Library_SetLcdGeometry
|
||||
*
|
||||
* @description:
|
||||
* This function can be used to modify default positions of color
|
||||
* subpixels, which controls Harmony LCD rendering.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A handle to the target library instance.
|
||||
*
|
||||
* sub ::
|
||||
* A pointer to an array of 3 vectors in 26.6 fractional pixel format;
|
||||
* the function modifies the default values, see the note below.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* Subpixel geometry examples:
|
||||
*
|
||||
* - {{-21, 0}, {0, 0}, {21, 0}} is the default, corresponding to 3 color
|
||||
* stripes shifted by a third of a pixel. This could be an RGB panel.
|
||||
*
|
||||
* - {{21, 0}, {0, 0}, {-21, 0}} looks the same as the default but can
|
||||
* specify a BGR panel instead, while keeping the bitmap in the same
|
||||
* RGB888 format.
|
||||
*
|
||||
* - {{0, 21}, {0, 0}, {0, -21}} is the vertical RGB, but the bitmap
|
||||
* stays RGB888 as a result.
|
||||
*
|
||||
* - {{-11, 16}, {-11, -16}, {22, 0}} is a certain PenTile arrangement.
|
||||
*
|
||||
* This function does nothing and returns `FT_Err_Unimplemented_Feature`
|
||||
* in the context of ClearType-style subpixel rendering when
|
||||
* `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is defined in your build of the
|
||||
* library.
|
||||
*
|
||||
* @since:
|
||||
* 2.10.0
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Library_SetLcdGeometry( FT_Library library,
|
||||
FT_Vector sub[3] );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTLCDFIL_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,296 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftlist.h
|
||||
*
|
||||
* Generic list support for FreeType (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This file implements functions relative to list processing. Its data
|
||||
* structures are defined in `freetype.h`.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTLIST_H_
|
||||
#define FTLIST_H_
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* list_processing
|
||||
*
|
||||
* @title:
|
||||
* List Processing
|
||||
*
|
||||
* @abstract:
|
||||
* Simple management of lists.
|
||||
*
|
||||
* @description:
|
||||
* This section contains various definitions related to list processing
|
||||
* using doubly-linked nodes.
|
||||
*
|
||||
* @order:
|
||||
* FT_List
|
||||
* FT_ListNode
|
||||
* FT_ListRec
|
||||
* FT_ListNodeRec
|
||||
*
|
||||
* FT_List_Add
|
||||
* FT_List_Insert
|
||||
* FT_List_Find
|
||||
* FT_List_Remove
|
||||
* FT_List_Up
|
||||
* FT_List_Iterate
|
||||
* FT_List_Iterator
|
||||
* FT_List_Finalize
|
||||
* FT_List_Destructor
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_List_Find
|
||||
*
|
||||
* @description:
|
||||
* Find the list node for a given listed object.
|
||||
*
|
||||
* @input:
|
||||
* list ::
|
||||
* A pointer to the parent list.
|
||||
* data ::
|
||||
* The address of the listed object.
|
||||
*
|
||||
* @return:
|
||||
* List node. `NULL` if it wasn't found.
|
||||
*/
|
||||
FT_EXPORT( FT_ListNode )
|
||||
FT_List_Find( FT_List list,
|
||||
void* data );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_List_Add
|
||||
*
|
||||
* @description:
|
||||
* Append an element to the end of a list.
|
||||
*
|
||||
* @inout:
|
||||
* list ::
|
||||
* A pointer to the parent list.
|
||||
* node ::
|
||||
* The node to append.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_List_Add( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_List_Insert
|
||||
*
|
||||
* @description:
|
||||
* Insert an element at the head of a list.
|
||||
*
|
||||
* @inout:
|
||||
* list ::
|
||||
* A pointer to parent list.
|
||||
* node ::
|
||||
* The node to insert.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_List_Insert( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_List_Remove
|
||||
*
|
||||
* @description:
|
||||
* Remove a node from a list. This function doesn't check whether the
|
||||
* node is in the list!
|
||||
*
|
||||
* @input:
|
||||
* node ::
|
||||
* The node to remove.
|
||||
*
|
||||
* @inout:
|
||||
* list ::
|
||||
* A pointer to the parent list.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_List_Remove( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_List_Up
|
||||
*
|
||||
* @description:
|
||||
* Move a node to the head/top of a list. Used to maintain LRU lists.
|
||||
*
|
||||
* @inout:
|
||||
* list ::
|
||||
* A pointer to the parent list.
|
||||
* node ::
|
||||
* The node to move.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_List_Up( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_List_Iterator
|
||||
*
|
||||
* @description:
|
||||
* An FT_List iterator function that is called during a list parse by
|
||||
* @FT_List_Iterate.
|
||||
*
|
||||
* @input:
|
||||
* node ::
|
||||
* The current iteration list node.
|
||||
*
|
||||
* user ::
|
||||
* A typeless pointer passed to @FT_List_Iterate. Can be used to point
|
||||
* to the iteration's state.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FT_List_Iterator)( FT_ListNode node,
|
||||
void* user );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_List_Iterate
|
||||
*
|
||||
* @description:
|
||||
* Parse a list and calls a given iterator function on each element.
|
||||
* Note that parsing is stopped as soon as one of the iterator calls
|
||||
* returns a non-zero value.
|
||||
*
|
||||
* @input:
|
||||
* list ::
|
||||
* A handle to the list.
|
||||
* iterator ::
|
||||
* An iterator function, called on each node of the list.
|
||||
* user ::
|
||||
* A user-supplied field that is passed as the second argument to the
|
||||
* iterator.
|
||||
*
|
||||
* @return:
|
||||
* The result (a FreeType error code) of the last iterator call.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_List_Iterate( FT_List list,
|
||||
FT_List_Iterator iterator,
|
||||
void* user );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_List_Destructor
|
||||
*
|
||||
* @description:
|
||||
* An @FT_List iterator function that is called during a list
|
||||
* finalization by @FT_List_Finalize to destroy all elements in a given
|
||||
* list.
|
||||
*
|
||||
* @input:
|
||||
* system ::
|
||||
* The current system object.
|
||||
*
|
||||
* data ::
|
||||
* The current object to destroy.
|
||||
*
|
||||
* user ::
|
||||
* A typeless pointer passed to @FT_List_Iterate. It can be used to
|
||||
* point to the iteration's state.
|
||||
*/
|
||||
typedef void
|
||||
(*FT_List_Destructor)( FT_Memory memory,
|
||||
void* data,
|
||||
void* user );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_List_Finalize
|
||||
*
|
||||
* @description:
|
||||
* Destroy all elements in the list as well as the list itself.
|
||||
*
|
||||
* @input:
|
||||
* list ::
|
||||
* A handle to the list.
|
||||
*
|
||||
* destroy ::
|
||||
* A list destructor that will be applied to each element of the list.
|
||||
* Set this to `NULL` if not needed.
|
||||
*
|
||||
* memory ::
|
||||
* The current memory object that handles deallocation.
|
||||
*
|
||||
* user ::
|
||||
* A user-supplied field that is passed as the last argument to the
|
||||
* destructor.
|
||||
*
|
||||
* @note:
|
||||
* This function expects that all nodes added by @FT_List_Add or
|
||||
* @FT_List_Insert have been dynamically allocated.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_List_Finalize( FT_List list,
|
||||
FT_List_Destructor destroy,
|
||||
FT_Memory memory,
|
||||
void* user );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTLIST_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,184 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftlogging.h
|
||||
*
|
||||
* Additional debugging APIs.
|
||||
*
|
||||
* Copyright (C) 2020-2024 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTLOGGING_H_
|
||||
#define FTLOGGING_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* debugging_apis
|
||||
*
|
||||
* @title:
|
||||
* External Debugging APIs
|
||||
*
|
||||
* @abstract:
|
||||
* Public APIs to control the `FT_DEBUG_LOGGING` macro.
|
||||
*
|
||||
* @description:
|
||||
* This section contains the declarations of public functions that
|
||||
* enables fine control of what the `FT_DEBUG_LOGGING` macro outputs.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Set_Level
|
||||
*
|
||||
* @description:
|
||||
* Change the levels of tracing components of FreeType at run time.
|
||||
*
|
||||
* @input:
|
||||
* tracing_level ::
|
||||
* New tracing value.
|
||||
*
|
||||
* @example:
|
||||
* The following call makes FreeType trace everything but the 'memory'
|
||||
* component.
|
||||
*
|
||||
* ```
|
||||
* FT_Trace_Set_Level( "any:7 memory:0" );
|
||||
* ```
|
||||
*
|
||||
* @note:
|
||||
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
|
||||
* isn't set.
|
||||
*
|
||||
* @since:
|
||||
* 2.11
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Trace_Set_Level( const char* tracing_level );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Set_Default_Level
|
||||
*
|
||||
* @description:
|
||||
* Reset tracing value of FreeType's components to the default value
|
||||
* (i.e., to the value of the `FT2_DEBUG` environment value or to NULL
|
||||
* if `FT2_DEBUG` is not set).
|
||||
*
|
||||
* @note:
|
||||
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
|
||||
* isn't set.
|
||||
*
|
||||
* @since:
|
||||
* 2.11
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Trace_Set_Default_Level( void );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Custom_Log_Handler
|
||||
*
|
||||
* @description:
|
||||
* A function typedef that is used to handle the logging of tracing and
|
||||
* debug messages on a file system.
|
||||
*
|
||||
* @input:
|
||||
* ft_component ::
|
||||
* The name of `FT_COMPONENT` from which the current debug or error
|
||||
* message is produced.
|
||||
*
|
||||
* fmt ::
|
||||
* Actual debug or tracing message.
|
||||
*
|
||||
* args::
|
||||
* Arguments of debug or tracing messages.
|
||||
*
|
||||
* @since:
|
||||
* 2.11
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*FT_Custom_Log_Handler)( const char* ft_component,
|
||||
const char* fmt,
|
||||
va_list args );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Set_Log_Handler
|
||||
*
|
||||
* @description:
|
||||
* A function to set a custom log handler.
|
||||
*
|
||||
* @input:
|
||||
* handler ::
|
||||
* New logging function.
|
||||
*
|
||||
* @note:
|
||||
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
|
||||
* isn't set.
|
||||
*
|
||||
* @since:
|
||||
* 2.11
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Set_Log_Handler( FT_Custom_Log_Handler handler );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Set_Default_Log_Handler
|
||||
*
|
||||
* @description:
|
||||
* A function to undo the effect of @FT_Set_Log_Handler, resetting the
|
||||
* log handler to FreeType's built-in version.
|
||||
*
|
||||
* @note:
|
||||
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
|
||||
* isn't set.
|
||||
*
|
||||
* @since:
|
||||
* 2.11
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Set_Default_Log_Handler( void );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTLOGGING_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user