Initial committ

This commit is contained in:
Silent 2014-05-30 20:14:47 +02:00
commit 62052759e1
23 changed files with 3667 additions and 0 deletions

190
.gitignore vendored Normal file
View file

@ -0,0 +1,190 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Nn]ormal/
[Nn]ightly/
output/
symbols/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
*.cso
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/*
## TODO: If the tool you use requires repositories.config, also uncomment the next line
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
!packages/build/
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# =========================
# Windows detritus
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/

114
IIIFix/IIIFix.vcxproj Normal file
View file

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\SilentPatch\dllmain.cpp" />
<ClCompile Include="..\SilentPatch\Timer.cpp" />
</ItemGroup>
<ItemGroup>
<MASM Include="..\SilentPatch\win2000.asm" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\SilentPatch\MemoryMgr.h" />
<ClInclude Include="..\SilentPatch\Timer.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{652975D8-60B0-48E4-A973-4F10BA54FFCB}</ProjectGuid>
<RootNamespace>IIIFix</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetExt>.asi</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetExt>.asi</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PreprocessorDefinitions>SILENTPATCH_III_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>D:\RWSDK\Graphics\rwsdk\include\d3d9</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<SubSystem>Windows</SubSystem>
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<EntryPointSymbol>
</EntryPointSymbol>
<AdditionalDependencies>Winmm.lib</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto 3\SilentPatchIII.asi"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StringPooling>true</StringPooling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<PreprocessorDefinitions>SILENTPATCH_III_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>D:\RWSDK\Graphics\rwsdk\include\d3d9</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<SubSystem>Windows</SubSystem>
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<EntryPointSymbol>
</EntryPointSymbol>
<AdditionalDependencies>Winmm.lib</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto 3\SilentPatchIII.asi"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\SilentPatch\dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SilentPatch\Timer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<MASM Include="..\SilentPatch\win2000.asm">
<Filter>Source Files</Filter>
</MASM>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\SilentPatch\MemoryMgr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\Timer.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

118
SAFix/SAFix.vcxproj Normal file
View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D3E18BC0-A120-451D-A16A-F77072625D66}</ProjectGuid>
<RootNamespace>SAFix</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>SILENTPATCH_SA_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>D:\RWSDK\Graphics\rwsdk\include\d3d9</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\GTA San Andreas clean\SilentPatchSA.asi"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<PreprocessorDefinitions>SILENTPATCH_SA_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>D:\RWSDK\Graphics\rwsdk\include\d3d9</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Windows</SubSystem>
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\GTA San Andreas clean\SilentPatchSA.asi"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\SilentPatch\dllmain.cpp" />
<ClCompile Include="..\SilentPatch\General.cpp" />
<ClCompile Include="..\SilentPatch\ModelInfoSA.cpp" />
<ClCompile Include="..\SilentPatch\StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\SilentPatch\Timer.cpp" />
<ClCompile Include="..\SilentPatch\Vehicle.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="..\SilentPatch\win2000.asm" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\SilentPatch\General.h" />
<ClInclude Include="..\SilentPatch\LinkList.h" />
<ClInclude Include="..\SilentPatch\Maths.h" />
<ClInclude Include="..\SilentPatch\MemoryMgr.h" />
<ClInclude Include="..\SilentPatch\ModelInfoSA.h" />
<ClInclude Include="..\SilentPatch\StdAfx.h" />
<ClInclude Include="..\SilentPatch\Timer.h" />
<ClInclude Include="..\SilentPatch\Vehicle.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\SilentPatch\dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SilentPatch\General.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SilentPatch\Vehicle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SilentPatch\StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SilentPatch\Timer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SilentPatch\ModelInfoSA.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\SilentPatch\win2000.asm">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\SilentPatch\MemoryMgr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\General.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\Vehicle.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\LinkList.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\Maths.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\Timer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\ModelInfoSA.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

32
SilentPatch.sln Normal file
View file

@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IIIFix", "IIIFix\IIIFix.vcxproj", "{652975D8-60B0-48E4-A973-4F10BA54FFCB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VCFix", "VCFix\VCFix.vcxproj", "{374D4CB4-548A-4DA0-AB68-8EA356424626}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SAFix", "SAFix\SAFix.vcxproj", "{D3E18BC0-A120-451D-A16A-F77072625D66}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{652975D8-60B0-48E4-A973-4F10BA54FFCB}.Debug|Win32.ActiveCfg = Debug|Win32
{652975D8-60B0-48E4-A973-4F10BA54FFCB}.Debug|Win32.Build.0 = Debug|Win32
{652975D8-60B0-48E4-A973-4F10BA54FFCB}.Release|Win32.ActiveCfg = Release|Win32
{652975D8-60B0-48E4-A973-4F10BA54FFCB}.Release|Win32.Build.0 = Release|Win32
{374D4CB4-548A-4DA0-AB68-8EA356424626}.Debug|Win32.ActiveCfg = Debug|Win32
{374D4CB4-548A-4DA0-AB68-8EA356424626}.Debug|Win32.Build.0 = Debug|Win32
{374D4CB4-548A-4DA0-AB68-8EA356424626}.Release|Win32.ActiveCfg = Release|Win32
{374D4CB4-548A-4DA0-AB68-8EA356424626}.Release|Win32.Build.0 = Release|Win32
{D3E18BC0-A120-451D-A16A-F77072625D66}.Debug|Win32.ActiveCfg = Debug|Win32
{D3E18BC0-A120-451D-A16A-F77072625D66}.Debug|Win32.Build.0 = Debug|Win32
{D3E18BC0-A120-451D-A16A-F77072625D66}.Release|Win32.ActiveCfg = Release|Win32
{D3E18BC0-A120-451D-A16A-F77072625D66}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

12
SilentPatch/General.cpp Normal file
View file

@ -0,0 +1,12 @@
#include "StdAfx.h"
#include "General.h"
// Wrappers
WRAPPER bool CalcScreenCoors(const CVector& vecIn, CVector* vecOut) { WRAPARG(vecIn); WRAPARG(vecOut); EAXJMP(0x71DAB0); }
WRAPPER void LoadingScreenLoadingFile(const char* pText) { WRAPARG(pText); EAXJMP(0x5B3680); }
WRAPPER void CEntity::UpdateRW() { EAXJMP(0x446F90); }
WRAPPER void CEntity::RegisterReference(CEntity** pAddress) { WRAPARG(pAddress); EAXJMP(0x571B70); }
WRAPPER void CEntity::CleanUpOldReference(CEntity** pAddress) { WRAPARG(pAddress); EAXJMP(0x571A00); }
WRAPPER void CEntity::Render() { EAXJMP(0x534310); }

283
SilentPatch/General.h Normal file
View file

@ -0,0 +1,283 @@
#ifndef __GENERAL
#define __GENERAL
class CSimpleTransform
{
public:
CVector m_translate;
float m_heading;
};
class CRGBA
{
public:
BYTE r, g, b, a;
inline CRGBA() {}
inline CRGBA(const CRGBA& in)
: r(in.r), g(in.g), b(in.b), a(in.a)
{}
inline CRGBA(const CRGBA& in, BYTE alpha)
: r(in.r), g(in.g), b(in.b), a(alpha)
{}
inline CRGBA(BYTE red, BYTE green, BYTE blue, BYTE alpha = 255)
: r(red), g(green), b(blue), a(alpha)
{}
template <typename T>
friend CRGBA Blend(const CRGBA& One, T OneStrength, const CRGBA& Two, T TwoStrength)
{ T TotalStrength = OneStrength + TwoStrength;
return CRGBA( ((One.r * OneStrength) + (Two.r * TwoStrength))/TotalStrength,
((One.g * OneStrength) + (Two.g * TwoStrength))/TotalStrength,
((One.b * OneStrength) + (Two.b * TwoStrength))/TotalStrength,
((One.a * OneStrength) + (Two.a * TwoStrength))/TotalStrength); }
template <typename T>
friend CRGBA Blend(const CRGBA& One, T OneStrength, const CRGBA& Two, T TwoStrength, const CRGBA& Three, T ThreeStrength)
{ T TotalStrength = OneStrength + TwoStrength + ThreeStrength;
return CRGBA( ((One.r * OneStrength) + (Two.r * TwoStrength) + (Three.r * ThreeStrength))/TotalStrength,
((One.g * OneStrength) + (Two.g * TwoStrength) + (Three.g * ThreeStrength))/TotalStrength,
((One.b * OneStrength) + (Two.b * TwoStrength) + (Three.b * ThreeStrength))/TotalStrength,
((One.a * OneStrength) + (Two.a * TwoStrength) + (Three.a * ThreeStrength))/TotalStrength); }
void BaseColors__Constructor();
};
class CRect
{
public:
float x1, y1;
float x2, y2;
inline CRect() {}
inline CRect(float a, float b, float c, float d)
: x1(a), y1(b), x2(c), y2(d)
{}
};
class CPlaceable
{
private:
CSimpleTransform m_transform;
CMatrix* m_pCoords;
public:
// Line up the VMTs
virtual ~CPlaceable() {}
inline CPlaceable() {}
explicit inline CPlaceable(int dummy)
{
// Dummy ctor
UNREFERENCED_PARAMETER(dummy);
}
inline CVector* GetCoords()
{ return m_pCoords ? reinterpret_cast<CVector*>(&m_pCoords->matrix.pos) : &m_transform.m_translate; }
inline CMatrix* GetMatrix()
{ return m_pCoords; }
inline CSimpleTransform& GetTransform()
{ return m_transform; }
inline float GetHeading()
{ return m_pCoords ? atan2(-m_pCoords->GetUp()->x, m_pCoords->GetUp()->y) : m_transform.m_heading; }
inline void SetCoords(const CVector& pos)
{ if ( m_pCoords ) { m_pCoords->matrix.pos.x = pos.x; m_pCoords->matrix.pos.y = pos.y; m_pCoords->matrix.pos.z = pos.z; }
else m_transform.m_translate = pos; }
inline void SetHeading(float fHeading)
{ if ( m_pCoords ) m_pCoords->SetRotateZOnly(fHeading); else m_transform.m_heading = fHeading; }
};
// TODO: May not be the best place to put it?
class NOVMT CEntity : public CPlaceable
{
public:
virtual void Add_CRect();
virtual void Add();
virtual void Remove();
virtual void SetIsStatic(bool);
virtual void SetModelIndex(int nModelIndex);
virtual void SetModelIndexNoCreate(int nModelIndex);
virtual void CreateRwObject();
virtual void DeleteRwObject();
virtual CRect GetBoundRect();
virtual void ProcessControl();
virtual void ProcessCollision();
virtual void ProcessShift();
virtual void TestCollision();
virtual void Teleport();
virtual void SpecialEntityPreCollisionStuff();
virtual void SpecialEntityCalcCollisionSteps();
virtual void PreRender();
virtual void Render();
virtual void SetupLighting();
virtual void RemoveLighting(bool bRemove=true);
virtual void FlagToDestroyWhenNextProcessed();
//private:
RpClump* m_pRwObject; // 0x18
/********** BEGIN CFLAGS (0x1C) **************/
unsigned long bUsesCollision : 1; // does entity use collision
unsigned long bCollisionProcessed : 1; // has object been processed by a ProcessEntityCollision function
unsigned long bIsStatic : 1; // is entity static
unsigned long bHasContacted : 1; // has entity processed some contact forces
unsigned long bIsStuck : 1; // is entity stuck
unsigned long bIsInSafePosition : 1; // is entity in a collision free safe position
unsigned long bWasPostponed : 1; // was entity control processing postponed
unsigned long bIsVisible : 1; //is the entity visible
unsigned long bIsBIGBuilding : 1; // Set if this entity is a big building
unsigned long bRenderDamaged : 1; // use damaged LOD models for objects with applicable damage
unsigned long bStreamingDontDelete : 1; // Dont let the streaming remove this
unsigned long bRemoveFromWorld : 1; // remove this entity next time it should be processed
unsigned long bHasHitWall : 1; // has collided with a building (changes subsequent collisions)
unsigned long bImBeingRendered : 1; // don't delete me because I'm being rendered
unsigned long bDrawLast :1; // draw object last
unsigned long bDistanceFade :1; // Fade entity because it is far away
unsigned long bDontCastShadowsOn : 1; // Dont cast shadows on this object
unsigned long bOffscreen : 1; // offscreen flag. This can only be trusted when it is set to true
unsigned long bIsStaticWaitingForCollision : 1; // this is used by script created entities - they are static until the collision is loaded below them
unsigned long bDontStream : 1; // tell the streaming not to stream me
unsigned long bUnderwater : 1; // this object is underwater change drawing order
unsigned long bHasPreRenderEffects : 1; // Object has a prerender effects attached to it
unsigned long bIsTempBuilding : 1; // whether or not the building is temporary (i.e. can be created and deleted more than once)
unsigned long bDontUpdateHierarchy : 1; // Don't update the aniamtion hierarchy this frame
unsigned long bHasRoadsignText : 1; // entity is roadsign and has some 2deffect text stuff to be rendered
unsigned long bDisplayedSuperLowLOD : 1;
unsigned long bIsProcObject : 1; // set object has been generate by procedural object generator
unsigned long bBackfaceCulled : 1; // has backface culling on
unsigned long bLightObject : 1; // light object with directional lights
unsigned long bUnimportantStream : 1; // set that this object is unimportant, if streaming is having problems
unsigned long bTunnel : 1; // Is this model part of a tunnel
unsigned long bTunnelTransition : 1; // This model should be rendered from within and outside of the tunnel
/********** END CFLAGS **************/
WORD RandomSeed; // 0x20
short m_nModelIndex; // 0x22
void* pReferences; // 0x24
void* m_pLastRenderedLink; // 0x28
WORD m_nScanCode; // 0x2C
BYTE m_iplIndex; // 0x2E
BYTE m_areaCode; // 0x2F
CEntity* m_pLod; // 0x30
BYTE numLodChildren; // 0x34
char numLodChildrenRendered; // 0x35
//********* BEGIN CEntityInfo **********//
BYTE nType : 3; // what type is the entity // 0x36 (2 == Vehicle)
BYTE nStatus : 5; // control status // 0x36
//********* END CEntityInfo ************//
public:
explicit inline CEntity(int dummy)
: CPlaceable(dummy)
{
// Dummy ctor
}
inline short& ModelIndex()
{ return m_nModelIndex; };
inline short GetModelIndex()
{ return m_nModelIndex; }
void UpdateRW();
void RegisterReference(CEntity** pAddress);
void CleanUpOldReference(CEntity** pAddress);
};
class NOVMT CPhysical : public CEntity
{
private:
float pad1; // 56
int __pad2; // 60
unsigned int b0x01 : 1; // 64
unsigned int bApplyGravity : 1;
unsigned int bDisableFriction : 1;
unsigned int bCollidable : 1;
unsigned int b0x10 : 1;
unsigned int bDisableMovement : 1;
unsigned int b0x40 : 1;
unsigned int b0x80 : 1;
unsigned int bSubmergedInWater : 1; // 65
unsigned int bOnSolidSurface : 1;
unsigned int bBroken : 1;
unsigned int b0x800 : 1; // ref @ 0x6F5CF0
unsigned int b0x1000 : 1;//
unsigned int b0x2000 : 1;//
unsigned int b0x4000 : 1;//
unsigned int b0x8000 : 1;//
unsigned int b0x10000 : 1; // 66
unsigned int b0x20000 : 1; // ref @ CPhysical__processCollision
unsigned int bBulletProof : 1;
unsigned int bFireProof : 1;
unsigned int bCollisionProof : 1;
unsigned int bMeeleProof : 1;
unsigned int bInvulnerable : 1;
unsigned int bExplosionProof : 1;
unsigned int b0x1000000 : 1; // 67
unsigned int bAttachedToEntity : 1;
unsigned int b0x4000000 : 1;
unsigned int bTouchingWater : 1;
unsigned int bEnableCollision : 1;
unsigned int bDestroyed : 1;
unsigned int b0x40000000 : 1;
unsigned int b0x80000000 : 1;
CVector m_vecLinearVelocity; // 68
CVector m_vecAngularVelocity; // 80
CVector m_vecCollisionLinearVelocity; // 92
CVector m_vecCollisionAngularVelocity; // 104
CVector m_vForce; // 0x74
CVector m_vTorque; // 0x80
float fMass; // 0x8C
float fTurnMass; // 0x90
float m_fVelocityFrequency; // 0x94
float m_fAirResistance; // 0x98
float m_fElasticity; // 0x9C
float m_fBuoyancyConstant; // 0xA0
CVector vecCenterOfMass; // 0xA4
DWORD dwUnk1; // 0xB0
void* unkCPtrNodeDoubleLink; // 0xB4
BYTE byUnk: 8; // 0xB8
BYTE byCollisionRecords: 8; // 0xB9
BYTE byUnk2: 8; // 0xBA (Baracus)
BYTE byUnk3: 8; // 0xBB
float pad4[6]; // 0xBC
float fDistanceTravelled; // 0xD4
float fDamageImpulseMagnitude; // 0xD8
CEntity* damageEntity; // 0xDC
BYTE pad2[28]; // 0xE0
CEntity* pAttachedEntity; // 0xFC
CVector m_vAttachedPosition; // 0x100
CVector m_vAttachedRotation; // 0x10C
BYTE pad3[20]; // 0x118
float fLighting; // 0x12C col lighting? CPhysical::GetLightingFromCol
float fLighting_2; // 0x130 added to col lighting in CPhysical::GetTotalLighting
BYTE pad3a[4]; // 0x134
public:
// Temp
CPhysical()
: CEntity(0) {}
};
static_assert(sizeof(CEntity) == 0x38, "Wrong size: CEntity");
static_assert(sizeof(CPhysical) == 0x138, "Wrong size: CPhysical");
#endif

134
SilentPatch/LinkList.h Normal file
View file

@ -0,0 +1,134 @@
#ifndef __LINKLIST__
#define __LINKLIST__
template <class T>
class CLink
{
public:
inline void Insert(CLink<T>* pAttach) {
pAttach->m_pNext = m_pNext;
m_pNext->m_pPrev = pAttach;
pAttach->m_pPrev = this;
m_pNext = pAttach;
}
inline void Remove(void) {
m_pNext->m_pPrev = m_pPrev;
m_pPrev->m_pNext = m_pNext;
}
inline T& V(void) {
return m_pItem;
}
T m_pItem; // 0-4
// an item
CLink<T>* m_pPrev; // 4-8
//next link in the list
CLink<T>* m_pNext; // 8-12
//prev link in the list
};
template <class T>
class CLinkList {
public:
CLinkList(void)
: m_plnLinks(nullptr)
{
}
void Init(int nNumLinks) {
m_plnLinks = new CLink<T>[nNumLinks];
m_lnListHead.m_pNext = &m_lnListTail;
m_lnListTail.m_pPrev = &m_lnListHead;
m_lnFreeListHead.m_pNext = &m_lnFreeListTail;
m_lnFreeListTail.m_pPrev = &m_lnFreeListHead;
for(int i = nNumLinks - 1; i >= 0; i--) {
m_lnFreeListHead.Insert(&m_plnLinks[i]);
}
}
void Shutdown(void) {
delete[] m_plnLinks;
m_plnLinks = nullptr;
}
CLink<T>* InsertSorted(const T& pItem) {
CLink<T>* pLink = m_lnFreeListHead.m_pNext;
if(pLink == &m_lnFreeListTail) {
return nullptr;
}
pLink->m_pItem = pItem;
pLink->Remove();
CLink<T>* pInsertAfter = &m_lnListHead;
while(pInsertAfter->m_pNext != &m_lnListTail && pInsertAfter->m_pNext->m_pItem < pItem) {
pInsertAfter = pInsertAfter->m_pNext;
}
pInsertAfter->Insert(pLink);
return pLink;
}
CLink<T>* Insert(const T& pItem) {
CLink<T>* pLink = m_lnFreeListHead.m_pNext;
if(pLink == &m_lnFreeListTail) {
return nullptr;
}
pLink->m_pItem = pItem;
pLink->Remove();
m_lnListHead.Insert(pLink);
return pLink;
}
void Clear(void) {
while(m_lnListHead.m_pNext != &m_lnListTail) {
m_lnListHead.m_pNext->Remove();
}
}
void Remove(CLink<T>* pLink) {
pLink->Remove();
m_lnFreeListHead.Insert(pLink);
}
CLink<T>* Next(CLink<T>* pCurrent) {
if(pCurrent == 0) {
pCurrent = &m_lnListHead;
}
if(pCurrent->m_pNext == &m_lnListTail) {
return 0;
}
else {
return pCurrent->m_pNext;
}
}
CLink<T> m_lnListHead; // 0-12
//head of the list of active links
CLink<T> m_lnListTail; // 12-24
//tail of the list of active links
CLink<T> m_lnFreeListHead; // 24-36
//head of the list of free links
CLink<T> m_lnFreeListTail; // 36-48
//tail of the list of free links
CLink<T>* m_plnLinks; // 48-52
//pointer to actual array of links
};
#endif

370
SilentPatch/Maths.h Normal file
View file

@ -0,0 +1,370 @@
#ifndef __MATHS__H
#define __MATHS__H
#define RAD_TO_DEG (180.0/M_PI)
#define DEG_TO_RAD (M_PI/180.0)
class CVector
{
public:
float x, y, z;
CVector()
{}
CVector(float fX, float fY, float fZ=0.0f)
: x(fX), y(fY), z(fZ)
{}
CVector(const RwV3d& rwVec)
: x(rwVec.x), y(rwVec.y), z(rwVec.z)
{}
CVector& operator+=(const CVector& vec)
{ x += vec.x; y += vec.y; z += vec.z;
return *this; }
CVector& operator+=(const RwV3d& vec)
{ x += vec.x; y += vec.y; z += vec.z;
return *this; }
CVector& operator-=(const CVector& vec)
{ x -= vec.x; y -= vec.y; z -= vec.z;
return *this; }
CVector& operator-=(const RwV3d& vec)
{ x -= vec.x; y -= vec.y; z -= vec.z;
return *this; }
inline float Magnitude()
{ return sqrt(x * x + y * y + z * z); }
inline float MagnitudeSqr()
{ return x * x + y * y + z * z; }
inline CVector& Normalize()
{ float fInvLen = 1.0f / Magnitude(); x *= fInvLen; y *= fInvLen; z *= fInvLen; return *this; }
friend inline float DotProduct(const CVector& vec1, const CVector& vec2)
{ return vec1.x * vec2.x + vec1.x * vec2.y + vec1.z * vec2.z; }
friend inline CVector CrossProduct(const CVector& vec1, const CVector& vec2)
{ return CVector( vec1.y * vec2.z - vec1.z * vec2.y,
vec1.z * vec2.x - vec1.x * vec2.z,
vec1.x * vec2.y - vec1.y * vec2.x); }
friend inline CVector operator*(const CVector& in, float fMul)
{ return CVector(in.x * fMul, in.y * fMul, in.z * fMul); }
friend inline CVector operator+(const CVector& vec1, const CVector& vec2)
{ return CVector(vec1.x + vec2.x, vec1.y + vec2.y, vec1.z + vec2.z); }
friend inline CVector operator+(const CVector& vec1, const RwV3d& vec2)
{ return CVector(vec1.x + vec2.x, vec1.y + vec2.y, vec1.z + vec2.z); }
friend inline CVector operator-(const CVector& vec1, const CVector& vec2)
{ return CVector(vec1.x - vec2.x, vec1.y - vec2.y, vec1.z - vec2.z); }
friend inline CVector operator-(const CVector& vec1, const RwV3d& vec2)
{ return CVector(vec1.x - vec2.x, vec1.y - vec2.y, vec1.z - vec2.z); }
friend inline CVector operator-(const CVector& vec)
{ return CVector(-vec.x, -vec.y, -vec.z); }
};
class CVector2D
{
public:
float x, y;
CVector2D()
{}
CVector2D(float fX, float fY)
: x(fX), y(fY)
{}
CVector2D& operator+=(const CVector2D& vec)
{ x += vec.x; y += vec.y;
return *this; }
CVector2D& operator-=(const CVector2D& vec)
{ x -= vec.x; y -= vec.y;
return *this; }
inline float Magnitude()
{ return sqrt(x * x + y * y); }
inline float MagnitudeSqr()
{ return x * x + y * y; }
inline CVector2D& Normalize()
{ float fInvLen = 1.0f / Magnitude(); x *= fInvLen; y *= fInvLen; return *this; }
friend inline float DotProduct(const CVector2D& vec1, const CVector2D& vec2)
{ return vec1.x * vec2.x + vec1.x * vec2.y; }
friend inline CVector2D operator*(const CVector2D& in, float fMul)
{ return CVector2D(in.x * fMul, in.y * fMul); }
friend inline CVector2D operator+(const CVector2D& vec1, const CVector2D& vec2)
{ return CVector2D(vec1.x + vec2.x, vec1.y + vec2.y); }
friend inline CVector2D operator-(const CVector2D& vec1, const CVector2D& vec2)
{ return CVector2D(vec1.x - vec2.x, vec1.y - vec2.y); }
friend inline CVector2D operator-(const CVector2D& vec)
{ return CVector2D(-vec.x, -vec.y); }
};
class CMatrix
{
public:
RwMatrix matrix;
RwMatrix* pMatrix;
BOOL haveRwMatrix;
public:
inline CMatrix()
: pMatrix(nullptr), haveRwMatrix(FALSE)
{}
inline CMatrix(RwMatrix* pMatrix, bool bHasMatrix=false)
: pMatrix(nullptr)
{ Attach(pMatrix, bHasMatrix); }
inline CMatrix(const CMatrix& theMatrix)
: pMatrix(nullptr), haveRwMatrix(FALSE), matrix(theMatrix.matrix)
{}
inline CMatrix(const CVector& vecRight, const CVector& vecUp, const CVector& vecAt, const CVector& vecPos)
{
matrix.right.x = vecRight.x;
matrix.right.y = vecRight.y;
matrix.right.z = vecRight.z;
matrix.up.x = vecUp.x;
matrix.up.y = vecUp.y;
matrix.up.z = vecUp.z;
matrix.at.x = vecAt.x;
matrix.at.y = vecAt.y;
matrix.at.z = vecAt.z;
matrix.pos.x = vecPos.x;
matrix.pos.y = vecPos.y;
matrix.pos.z = vecPos.z;
}
inline ~CMatrix()
{ if ( haveRwMatrix && pMatrix )
RwMatrixDestroy(pMatrix); }
friend inline CMatrix operator*(const CMatrix& Rot1, const CMatrix& Rot2)
{ return CMatrix( CVector(Rot1.matrix.right.x * Rot2.matrix.right.x + Rot1.matrix.right.y * Rot2.matrix.up.x + Rot1.matrix.right.z * Rot2.matrix.at.x + Rot2.matrix.pos.x,
Rot1.matrix.right.x * Rot2.matrix.right.y + Rot1.matrix.right.y * Rot2.matrix.up.y + Rot1.matrix.right.z * Rot2.matrix.at.y + Rot2.matrix.pos.y,
Rot1.matrix.right.x * Rot2.matrix.right.z + Rot1.matrix.right.y * Rot2.matrix.up.z + Rot1.matrix.right.z * Rot2.matrix.at.z + Rot2.matrix.pos.z),
CVector(Rot1.matrix.up.x * Rot2.matrix.right.x + Rot1.matrix.up.y * Rot2.matrix.up.x + Rot1.matrix.up.z * Rot2.matrix.at.x + Rot2.matrix.pos.x,
Rot1.matrix.up.x * Rot2.matrix.right.y + Rot1.matrix.up.y * Rot2.matrix.up.y + Rot1.matrix.up.z * Rot2.matrix.at.y + Rot2.matrix.pos.y,
Rot1.matrix.up.x * Rot2.matrix.right.z + Rot1.matrix.up.y * Rot2.matrix.up.z + Rot1.matrix.up.z * Rot2.matrix.at.z + Rot2.matrix.pos.z),
CVector(Rot1.matrix.at.x * Rot2.matrix.right.x + Rot1.matrix.at.y * Rot2.matrix.up.x + Rot1.matrix.at.z * Rot2.matrix.at.x + Rot2.matrix.pos.x,
Rot1.matrix.at.x * Rot2.matrix.right.y + Rot1.matrix.at.y * Rot2.matrix.up.y + Rot1.matrix.at.z * Rot2.matrix.at.y + Rot2.matrix.pos.y,
Rot1.matrix.at.x * Rot2.matrix.right.z + Rot1.matrix.at.y * Rot2.matrix.up.z + Rot1.matrix.at.z * Rot2.matrix.at.z + Rot2.matrix.pos.z),
CVector(Rot1.matrix.pos.x * Rot2.matrix.right.x + Rot1.matrix.pos.y * Rot2.matrix.up.x + Rot1.matrix.pos.z * Rot2.matrix.at.x + Rot2.matrix.pos.x,
Rot1.matrix.pos.x * Rot2.matrix.right.y + Rot1.matrix.pos.y * Rot2.matrix.up.y + Rot1.matrix.pos.z * Rot2.matrix.at.y + Rot2.matrix.pos.y,
Rot1.matrix.pos.x * Rot2.matrix.right.z + Rot1.matrix.pos.y * Rot2.matrix.up.z + Rot1.matrix.pos.z * Rot2.matrix.at.z + Rot2.matrix.pos.z)); };
friend inline CVector operator*(const CMatrix& matrix, const CVector& vec)
{ return CVector(matrix.matrix.up.x * vec.y + matrix.matrix.right.x * vec.x + matrix.matrix.at.x * vec.z + matrix.matrix.pos.x,
matrix.matrix.up.y * vec.y + matrix.matrix.right.y * vec.x + matrix.matrix.at.y * vec.z + matrix.matrix.pos.y,
matrix.matrix.up.z * vec.y + matrix.matrix.right.z * vec.x + matrix.matrix.at.z * vec.z + matrix.matrix.pos.z); };
inline CVector* GetRight()
{ return reinterpret_cast<CVector*>(&matrix.right); }
inline CVector* GetUp()
{ return reinterpret_cast<CVector*>(&matrix.up); }
inline CVector* GetAt()
{ return reinterpret_cast<CVector*>(&matrix.at); }
inline CVector* GetPos()
{ return reinterpret_cast<CVector*>(&matrix.pos); }
inline void SetTranslateOnly(float fX, float fY, float fZ)
{ matrix.pos.x = fX; matrix.pos.y = fY; matrix.pos.z = fZ; }
inline void SetRotateX(float fAngle)
{ SetRotateXOnly(fAngle); matrix.pos.x = 0.0f; matrix.pos.y = 0.0f; matrix.pos.z = 0.0f; }
inline void SetRotateY(float fAngle)
{ SetRotateYOnly(fAngle); matrix.pos.x = 0.0f; matrix.pos.y = 0.0f; matrix.pos.z = 0.0f; }
inline void SetRotateZ(float fAngle)
{ SetRotateZOnly(fAngle); matrix.pos.x = 0.0f; matrix.pos.y = 0.0f; matrix.pos.z = 0.0f; }
inline void SetRotate(float fAngleX, float fAngleY, float fAngleZ)
{ SetRotateOnly(fAngleX, fAngleY, fAngleZ); matrix.pos.x = 0.0f; matrix.pos.y = 0.0f; matrix.pos.z = 0.0f; }
inline void SetTranslate(float fX, float fY, float fZ)
{ matrix.right.x = 1.0f; matrix.right.y = 0.0f; matrix.right.z = 0.0f;
matrix.up.x = 0.0f; matrix.up.y = 1.0f; matrix.up.z = 0.0f;
matrix.at.x = 0.0f; matrix.at.y = 0.0f; matrix.at.z = 1.0f;
SetTranslateOnly(fX, fY, fZ); }
inline void SetUnity()
{
matrix.right.x = 1.0f; matrix.right.y = 0.0f; matrix.right.z = 0.0f;
matrix.up.x = 0.0f; matrix.up.y = 1.0f; matrix.up.z = 0.0f;
matrix.at.x = 0.0f; matrix.at.y = 0.0f; matrix.at.z = 1.0f;
matrix.pos.x = 0.0f; matrix.pos.y = 0.0f; matrix.pos.z = 0.0f;
}
inline void SetScale(float fScale)
{
matrix.right.x = fScale; matrix.right.y = 0.0f; matrix.right.z = 0.0f;
matrix.up.x = 0.0f; matrix.up.y = fScale; matrix.up.z = 0.0f;
matrix.at.x = 0.0f; matrix.at.y = 0.0f; matrix.at.z = fScale;
matrix.pos.x = 0.0f; matrix.pos.y = 0.0f; matrix.pos.z = 0.0f;
}
inline void RotateX(float fAngle)
{
CMatrix RotationMatrix;
RotationMatrix.SetRotateX(fAngle);
*this = *this * RotationMatrix;
}
inline void RotateY(float fAngle)
{
CMatrix RotationMatrix;
RotationMatrix.SetRotateY(fAngle);
*this = *this * RotationMatrix;
}
inline void RotateZ(float fAngle)
{
CMatrix RotationMatrix;
RotationMatrix.SetRotateZ(fAngle);
*this = *this * RotationMatrix;
}
inline void Rotate(float fAngleX, float fAngleY, float fAngleZ)
{
CMatrix RotationMatrix;
RotationMatrix.SetRotate(fAngleX, fAngleY, fAngleZ);
*this = *this * RotationMatrix;
}
inline void SetRotateXOnly(float fAngle)
{
matrix.right.x = 1.0f;
matrix.right.y = 0.0f;
matrix.right.z = 0.0f;
matrix.up.x = 0.0f;
matrix.up.y = cos(fAngle);
matrix.up.z = sin(fAngle);
matrix.at.x = 0.0f;
matrix.at.y = -sin(fAngle);
matrix.at.z = cos(fAngle);
}
inline void SetRotateYOnly(float fAngle)
{
matrix.right.x = cos(fAngle);
matrix.right.y = 0.0f;
matrix.right.z = sin(fAngle);
matrix.up.x = 0.0f;
matrix.up.y = 1.0f;
matrix.up.z = 0.0f;
matrix.at.x = -sin(fAngle);
matrix.at.y = 0.0f;
matrix.at.z = cos(fAngle);
}
inline void SetRotateZOnly(float fAngle)
{
matrix.at.x = 0.0f;
matrix.at.y = 0.0f;
matrix.at.z = 1.0f;
matrix.up.x = -sin(fAngle);
matrix.up.y = cos(fAngle);
matrix.up.z = 0.0f;
matrix.right.x = cos(fAngle);
matrix.right.y = sin(fAngle);
matrix.right.z = 0.0f;
}
inline void SetRotateOnly(float fAngleX, float fAngleY, float fAngleZ)
{
matrix.right.x = cos(fAngleZ) * cos(fAngleY) - sin(fAngleZ) * sin(fAngleX) * sin(fAngleY);
matrix.right.y = cos(fAngleZ) * sin(fAngleX) * sin(fAngleY) + sin(fAngleZ) * cos(fAngleY);
matrix.right.z = -cos(fAngleX) * sin(fAngleY);
matrix.up.x = -sin(fAngleZ) * cos(fAngleX);
matrix.up.y = cos(fAngleZ) * cos(fAngleX);
matrix.up.z = sin(fAngleX);
matrix.at.x = sin(fAngleZ) * sin(fAngleX) * cos(fAngleY) + cos(fAngleZ) * sin(fAngleY);
matrix.at.y = sin(fAngleZ) * sin(fAngleY) - cos(fAngleZ) * sin(fAngleX) * cos(fAngleY);
matrix.at.z = cos(fAngleX) * cos(fAngleY);
}
inline void Attach(RwMatrix* pMatrix, bool bHasMatrix)
{
if ( this->pMatrix && haveRwMatrix )
RwMatrixDestroy(this->pMatrix);
this->pMatrix = pMatrix;
haveRwMatrix = bHasMatrix;
Update();
}
inline void AttachRw(RwMatrix* pMatrix, bool bHasMatrix)
{
if ( this->pMatrix && haveRwMatrix )
RwMatrixDestroy(this->pMatrix);
this->pMatrix = pMatrix;
haveRwMatrix = bHasMatrix;
UpdateRW();
}
inline void Detach()
{
if ( pMatrix )
{
if ( haveRwMatrix )
RwMatrixDestroy(pMatrix);
pMatrix = nullptr;
}
}
inline void UpdateRW() const
{
if ( pMatrix )
UpdateRwMatrix(pMatrix);
}
inline void Update()
{
UpdateMatrix(pMatrix);
}
inline void UpdateMatrix(RwMatrix* pMatrix)
{
matrix.right = pMatrix->right;
matrix.up = pMatrix->up;
matrix.at = pMatrix->at;
matrix.pos = pMatrix->pos;
}
inline void UpdateRwMatrix(RwMatrix* pMatrix) const
{
pMatrix->right = matrix.right;
pMatrix->up = matrix.up;
pMatrix->at = matrix.at;
pMatrix->pos = matrix.pos;
RwMatrixUpdate(pMatrix);
}
inline void CopyToRwMatrix(RwMatrix* pMatrix) const
{
pMatrix->right = this->pMatrix->right;
pMatrix->up = this->pMatrix->up;
pMatrix->at = this->pMatrix->at;
pMatrix->pos = this->pMatrix->pos;
RwMatrixUpdate(pMatrix);
}
inline void CopyOnlyMatrix(const CMatrix& from)
{
matrix = from.matrix;
}
};
#endif

118
SilentPatch/MemoryMgr.h Normal file
View file

@ -0,0 +1,118 @@
#ifndef __MEMORYMGR
#define __MEMORYMGR
#define WRAPPER __declspec(naked)
#define EAXJMP(a) { _asm mov eax, a _asm jmp eax }
#define WRAPARG(a) UNREFERENCED_PARAMETER(a)
#define NOVMT __declspec(novtable)
#define SETVMT(a) *((DWORD_PTR*)this) = (DWORD_PTR)a
// A macro used to inject method pointers
#define InjectMethod(address, hook, nType) { void* __funcPtr; { _asm mov eax, offset hook _asm mov __funcPtr, eax } \
Memory::InjectHook(address, __funcPtr, nType); }
#define InjectMethodVP(address, hook, nType) { void* __funcPtr; { _asm mov eax, offset hook _asm mov __funcPtr, eax } \
MemoryVP::InjectHook(address, __funcPtr, nType); }
enum
{
PATCH_CALL,
PATCH_JUMP,
PATCH_NOTHING,
};
namespace Memory
{
template<typename T, typename AT>
inline void Patch(AT address, T value)
{ *(T*)address = value; }
template<typename AT>
inline void Nop(AT address, unsigned int nCount)
// TODO: Finish multibyte nops
{ memset((void*)address, 0x90, nCount); }
template<typename AT, typename HT>
inline void InjectHook(AT address, HT hook, unsigned int nType=PATCH_NOTHING)
{
switch ( nType )
{
case PATCH_JUMP:
*(BYTE*)address = 0xE9;
break;
case PATCH_CALL:
*(BYTE*)address = 0xE8;
break;
}
*(DWORD*)((DWORD)address + 1) = (DWORD)hook - (DWORD)address - 5;
}
};
namespace MemoryVP
{
template<typename T, typename AT>
inline void Patch(AT address, T value)
{
DWORD dwProtect[2];
VirtualProtect((void*)address, sizeof(T), PAGE_EXECUTE_READWRITE, &dwProtect[0]);
*(T*)address = value;
VirtualProtect((void*)address, sizeof(T), dwProtect[0], &dwProtect[1]);
}
template<typename AT>
inline void Nop(AT address, unsigned int nCount)
// TODO: Finish multibyte nops
{
DWORD dwProtect[2];
VirtualProtect((void*)address, nCount, PAGE_EXECUTE_READWRITE, &dwProtect[0]);
memset((void*)address, 0x90, nCount);
VirtualProtect((void*)address, nCount, dwProtect[0], &dwProtect[1]);
}
template<typename AT, typename HT>
inline void InjectHook(AT address, HT hook, unsigned int nType=PATCH_NOTHING)
{
DWORD dwProtect[2];
switch ( nType )
{
case PATCH_JUMP:
VirtualProtect((void*)address, 5, PAGE_EXECUTE_READWRITE, &dwProtect[0]);
*(BYTE*)address = 0xE9;
break;
case PATCH_CALL:
VirtualProtect((void*)address, 5, PAGE_EXECUTE_READWRITE, &dwProtect[0]);
*(BYTE*)address = 0xE8;
break;
default:
VirtualProtect((void*)((DWORD)address + 1), 4, PAGE_EXECUTE_READWRITE, &dwProtect[0]);
break;
}
*(DWORD*)((DWORD)address + 1) = (DWORD)hook - (DWORD)address - 5;
if ( nType == PATCH_NOTHING )
VirtualProtect((void*)((DWORD)address + 1), 4, dwProtect[0], &dwProtect[1]);
else
VirtualProtect((void*)address, 5, dwProtect[0], &dwProtect[1]);
}
};
// Old code, remove asap
#define patch(a, v, s) _patch((void*)(a), (DWORD)(v), (s))
#define patchf(a, v) _patch((void*)(a), (float)(v))
#define nop(a, v) _nop((void*)(a), (v))
#define call(a, v, bAddCall) _call((void*)(a), (DWORD)(v), (bAddCall))
#define charptr(a, v) _charptr((void*)(a), (const char*)(v))
__declspec(deprecated) inline void _patch(void* pAddress, DWORD data, DWORD iSize)
{
switch(iSize)
{
case 1: *(BYTE*)pAddress = (BYTE)data;
break;
case 2: *(WORD*)pAddress = (WORD)data;
break;
case 4: *(DWORD*)pAddress = (DWORD)data;
break;
}
}
#endif

View file

@ -0,0 +1,41 @@
#include "StdAfx.h"
#include "ModelInfoSA.h"
void CVehicleModelInfo::FindEditableMaterialList()
{
std::pair<CVehicleModelInfo*,int> MatsPair = std::make_pair(this, 0);
RpClumpForAllAtomics(reinterpret_cast<RpClump*>(pRwObject), GetEditableMaterialListCB, &MatsPair);
if ( m_pVehicleStruct->m_nNumExtras > 0 )
{
for ( int i = 0; i < m_pVehicleStruct->m_nNumExtras; i++ )
GetEditableMaterialListCB(m_pVehicleStruct->m_apExtras[i], &MatsPair);
}
m_nPrimaryColor = -1;
m_nSecondaryColor = -1;
m_nTertiaryColor = -1;
m_nQuaternaryColor = -1;
}
RpAtomic* CVehicleModelInfo::GetEditableMaterialListCB(RpAtomic* pAtomic, void* pData)
{
RpGeometryForAllMaterials(RpAtomicGetGeometry(pAtomic), GetEditableMaterialListCB, pData);
return pAtomic;
}
RpMaterial* CVehicleModelInfo::GetEditableMaterialListCB(RpMaterial* pMaterial, void* pData)
{
if ( RpMaterialGetTexture(pMaterial) )
{
if ( !strncmp(RwTextureGetName(RpMaterialGetTexture(pMaterial)), "vehiclegrunge256", 16) )
{
std::pair<CVehicleModelInfo*,int>* pMats = static_cast<std::pair<CVehicleModelInfo*,int>*>(pData);
if ( pMats->second < 32 )
pMats->first->m_apDirtMaterials[pMats->second++] = pMaterial;
}
}
return pMaterial;
}

282
SilentPatch/ModelInfoSA.h Normal file
View file

@ -0,0 +1,282 @@
#ifndef __MODELINFO
#define __MODELINFO
#include "General.h"
// TODO: Move to a separate file?
typedef struct
{
CVector vecMin;
CVector vecMax;
CVector vecOffset;
FLOAT fRadius;
} CBoundingBox;
typedef struct
{
CVector vecCenter;
float fRadius;
} CColSphere;
typedef struct
{
CVector min;
CVector max;
} CColBox;
/*typedef struct
{
unsigned short v1;
unsigned short v2;
unsigned short v3;
EColSurface material;
CColLighting lighting;
} CColTriangle;
typedef struct
{
BYTE pad0 [ 12 ];
} CColTrianglePlane;*/
typedef struct
{
char version[4];
DWORD size;
char name[0x18];
} ColModelFileHeader;
typedef struct
{
WORD numColSpheres;
WORD numColBoxes;
WORD numColTriangles;
BYTE ucNumWheels;
BYTE pad3;
CColSphere* pColSpheres;
CColBox* pColBoxes;
void* pSuspensionLines;
void* pUnknown;
void* pColTriangles;
void* pColTrianglePlanes;
} CColData;
class CColModel
{
public:
CBoundingBox boundingBox;
BYTE level;
BYTE unknownFlags;
BYTE pad [ 2 ];
CColData* pColData;
public:
~CColModel()
{
// Dirty!
((void(__thiscall*)(CColModel*))0x40F700)(this);
}
void operator delete(void* ptr);
};
class C2dEffect
{
public:
CVector vecPos;
BYTE bType;
DWORD nCount;
};
class CTimeInfo
{
public:
unsigned char bTimeOn, bTimeOff;
signed short nPairedModel;
public:
CTimeInfo(signed short nModel)
: nPairedModel(nModel)
{}
};
struct UpgradePosnDesc
{
CVector m_vPosition;
CVector m_qRotation;
float imag;
int m_dwParentComponentId;
};
class CAtomicModelInfo;
class CDamageAtomicModelInfo;
class CLodAtomicModelInfo;
class CBaseModelInfo
{
public:
unsigned int ulHashKey; // +4 Generated by CKeyGen::GetUppercaseKey(char const *) called by CBaseModelInfo::SetModelName(char const *)
unsigned short usNumberOfRefs: 16; // +8
short usTextureDictionary: 16; // +10
unsigned char ucAlpha: 8; // +12
unsigned char ucNumOf2DEffects: 8; // +13
unsigned short usUnknown: 16; // +14 Something with 2d effects
unsigned char ucDynamicIndex: 8; // +16
unsigned char dwUnknownFlag9: 1; // +17
unsigned char dwUnknownFlag10: 1;
unsigned char dwUnknownFlag11: 1;
unsigned char dwUnknownFlag12: 1;
unsigned char dwUnknownFlag13: 1;
unsigned char dwUnknownFlag14: 1;
unsigned char dwUnknownFlag15: 1;
unsigned char dwUnknownFlag16: 1;
// Flags used by CBaseModelInfo
unsigned char bHasBeenPreRendered: 1; // +18
unsigned char bAlphaTransparency: 1;
unsigned char bIsLod: 1;
unsigned char bDontCastShadowsOn: 1;
unsigned char bDontWriteZBuffer: 1;
unsigned char bDrawAdditive: 1;
unsigned char bDrawLast: 1;
unsigned char bDoWeOwnTheColModel: 1;
unsigned char dwUnknownFlag25: 1; // +19
unsigned char dwUnknownFlag26: 1;
unsigned char dwUnknownFlag27: 1;
unsigned char bSwaysInWind: 1;
unsigned char bCollisionWasStreamedWithModel: 1; // CClumpModelInfo::SetCollisionWasStreamedWithModel(unsigned int)
unsigned char bDontCollideWithFlyer: 1; // CAtomicModelInfo::SetDontCollideWithFlyer(unsigned int)
unsigned char bHasComplexHierarchy: 1; // CClumpModelInfo::SetHasComplexHierarchy(unsigned int)
unsigned char bWetRoadReflection: 1; // CAtomicModelInfo::SetWetRoadReflection(unsigned int)
CColModel* pColModel; // +20 CColModel: public CBoundingBox
float fLodDistanceUnscaled; // +24 Scaled is this value multiplied with flt_B6F118
RwObject* pRwObject; // +28
public:
virtual ~CBaseModelInfo() {}
virtual CAtomicModelInfo* AsAtomicModelInfoPtr() { return nullptr; }
virtual CDamageAtomicModelInfo* AsDamageAtomicModelInfoPtr() { return nullptr; }
virtual CLodAtomicModelInfo* AsLodAtomicModelInfoPtr() { return nullptr; }
virtual unsigned char GetModelType()=0;
virtual CTimeInfo* GetTimeInfo() { return nullptr; }
virtual void Init();
virtual void Shutdown();
virtual void DeleteRwObject()=0;
virtual int GetRwModelType()=0;
virtual RpAtomic* CreateInstance_(RwMatrix* pMatrix)=0;
virtual RpAtomic* CreateInstance()=0;
virtual void SetAnimFile(const char* pName) { UNREFERENCED_PARAMETER(pName); }
virtual void ConvertAnimFileIndex() {}
virtual int GetAnimFileIndex() { return -1; }
CBaseModelInfo()
: usNumberOfRefs(0), usTextureDictionary(-1)
{}
inline CColModel* GetColModel() { return pColModel; }
inline unsigned int GetHash() { return ulHashKey; }
inline short GetTextureDict() { return usTextureDictionary; }
void RecalcDrawDistance(float fOldDist);
void SetTexDictionary(const char* pDict);
void AddRef();
};
class CClumpModelInfo : public CBaseModelInfo
{
public:
int nAnimIndex;
public:
virtual unsigned char GetModelType() override { return 5; }
virtual void Init() override;
virtual void DeleteRwObject() override;
virtual int GetRwModelType() override { return rpCLUMP; }
virtual RpAtomic* CreateInstance_(RwMatrix* pMatrix) override;
virtual RpAtomic* CreateInstance() override;
virtual void SetAnimFile(const char* pName) override;
virtual void ConvertAnimFileIndex() override;
virtual int GetAnimFileIndex() override { return nAnimIndex; }
virtual CColModel* GetBoundingBox() { return pColModel; }
virtual void SetClump(RpClump* pClump);
};
class CVehicleModelInfo : public CClumpModelInfo
{
public:
RpMaterial* m_pPlateMaterial;
char m_plateText[8];
char field_30;
unsigned char m_nPlateType;
char m_nGameName[8];
unsigned int m_dwType;
float m_fWheelSizeFront;
float m_fWheelSizeRear;
unsigned short m_wWheelModelId;
unsigned short m_wHandlingIndex;
unsigned char m_nNumDoors;
unsigned char m_nClass;
unsigned char m_nFlags;
unsigned char m_nWheelUpgradeClass;
unsigned short m_wTimesUsed;
unsigned short m_wFrq;
union{
unsigned int m_dwCompRules;
struct{
unsigned int m_nExtraA_comp1 : 4;
unsigned int m_nExtraA_comp2 : 4;
unsigned int m_nExtraA_comp3 : 4;
unsigned int m_nExtraA_rule : 4;
unsigned int m_nExtraB_comp1 : 4;
unsigned int m_nExtraB_comp2 : 4;
unsigned int m_nExtraB_comp3 : 4;
unsigned int m_nExtraB_rule : 4;
};
};
float m_fBikeSteerAngle;
class CVehicleStructure{
public:
CVector m_avDummyPosn[15];
UpgradePosnDesc m_aUpgrades[18];
RpAtomic* m_apExtras[6];
unsigned char m_nNumExtras;
unsigned int m_dwMaskComponentsDamagable;
} *m_pVehicleStruct;
char field_60[464];
RpMaterial* m_apDirtMaterials[32];
unsigned char m_anPrimaryColors[8];
unsigned char m_anSecondaryColors[8];
unsigned char m_anTertiaryColors[8];
unsigned char m_anQuaternaryColors[8];
unsigned char m_nNumColorVariations;
unsigned char m_nLastColorVariation;
signed char m_nPrimaryColor;
signed char m_nSecondaryColor;
signed char m_nTertiaryColor;
signed char m_nQuaternaryColor;
short m_awUpgrades[18];
short m_awRemapTxds[5];
class CAnimBlock* m_pAnimBlock;
public:
void FindEditableMaterialList();
static RpAtomic* GetEditableMaterialListCB(RpAtomic* pAtomic, void* pData);
static RpMaterial* GetEditableMaterialListCB(RpMaterial* pMaterial, void* pData);
};
static_assert(sizeof(CBaseModelInfo) == 0x20, "Wrong size: CBaseModelInfo");
static_assert(sizeof(CClumpModelInfo) == 0x24, "Wrong size: CClumpModelInfo");
static_assert(sizeof(CVehicleModelInfo) == 0x308, "Wrong size: CvehicleModelInfo");
#endif

1
SilentPatch/StdAfx.cpp Normal file
View file

@ -0,0 +1 @@
#include "StdAfx.h"

25
SilentPatch/StdAfx.h Normal file
View file

@ -0,0 +1,25 @@
#pragma warning(disable:4481) // nonstandard extension used: override specifier 'override'
#pragma warning(disable:4401) // member is bit field
#pragma warning(disable:4733) // handler not registered as safe handler
#pragma warning(disable:4725) // instruction may be inaccurate on some Pentiums
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <limits>
#include <utility>
#include <mmsystem.h>
#define RwEngineInstance (*rwengine)
#define RWFRAMESTATICPLUGINSSIZE 24
#include <rwcore.h>
#include <rpworld.h>
#include "MemoryMgr.h"
#include "Maths.h"

185
SilentPatch/Timer.cpp Normal file
View file

@ -0,0 +1,185 @@
#include "StdAfx.h"
#include "Timer.h"
float* CTimer::ms_fTimeScale;
float* CTimer::ms_fTimeStep;
float* CTimer::ms_fTimeStepNotClipped;
bool* CTimer::m_UserPause;
bool* CTimer::m_CodePause;
int* CTimer::m_snTimeInMilliseconds;
int* CTimer::m_snPreviousTimeInMilliseconds;
int* CTimer::m_snTimeInMillisecondsNonClipped;
int* CTimer::m_snTimeInMillisecondsPauseMode;
unsigned int* CTimer::m_FrameCounter;
static gtaTimer timerFunction;
static unsigned int suspendDepth;
static long long timerFreq;
static long long oldTime, suspendTime;
static long long cyclesTime, cyclesTimeNonClipped, cyclesTimePauseMode, cyclesPreviousTime;
static long long QPC()
{
LARGE_INTEGER Counter;
QueryPerformanceCounter(&Counter);
return Counter.QuadPart;
}
static long long OldTimer()
{
TIMECAPS caps;
long long nTime;
timeGetDevCaps(&caps, sizeof(TIMECAPS));
timeBeginPeriod(caps.wPeriodMin);
nTime = timeGetTime();
timeEndPeriod(caps.wPeriodMin);
return nTime;
}
static inline void InitTimerFunc()
{
if ( timerFunction )
return;
LARGE_INTEGER Frequency;
if ( QueryPerformanceFrequency(&Frequency) )
{
timerFreq = Frequency.QuadPart / 1000;
timerFunction = QPC;
}
else
{
timerFreq = 1;
timerFunction = OldTimer;
}
}
extern void (__stdcall *AudioResetTimers)(unsigned int);
extern bool* bSnapShotActive;
void CTimer::Initialise()
{
suspendDepth = 0;
*ms_fTimeScale = *ms_fTimeStep = 1.0f;
*m_UserPause = false;
*m_CodePause = false;
*m_snTimeInMilliseconds = 0;
*m_snPreviousTimeInMilliseconds = 0;
*m_snTimeInMillisecondsNonClipped = 0;
*m_FrameCounter = 0;
InitTimerFunc();
oldTime = timerFunction();
AudioResetTimers(0);
}
void CTimer::Suspend()
{
if ( suspendDepth++ == 0 )
{
#ifdef SILENTPATCH_VC_VER
// MVL fix
InitTimerFunc();
#endif
suspendTime = timerFunction();
}
}
void CTimer::Resume()
{
if ( --suspendDepth == 0 )
{
#ifdef SILENTPATCH_VC_VER
// MVL fix
InitTimerFunc();
#endif
oldTime = timerFunction() - suspendTime;
}
}
unsigned int CTimer::GetCyclesPerFrame()
{
#ifdef SILENTPATCH_VC_VER
// MVL fix
InitTimerFunc();
#endif
return static_cast<unsigned int>(timerFunction() - oldTime);
}
unsigned int CTimer::GetCyclesPerMillisecond()
{
return static_cast<unsigned int>(timerFreq);
}
void CTimer::Update()
{
#ifdef SILENTPATCH_VC_VER
// CTimer::Initialise workaround
static bool bIntialisedIt = false;
if ( !bIntialisedIt )
{
Initialise();
bIntialisedIt = true;
}
#endif
*m_snPreviousTimeInMilliseconds = *m_snTimeInMilliseconds;
cyclesPreviousTime = cyclesTime;
long long nCurTime;
float nDelta;
nCurTime = timerFunction();
nDelta = (nCurTime - oldTime) * *ms_fTimeScale;
oldTime = nCurTime;
//*m_snTimeInMillisecondsPauseMode += nDelta;
cyclesTimePauseMode += static_cast<long long>(nDelta);
if ( *m_UserPause || *m_CodePause )
*ms_fTimeStep = 0.0f;
else
{
*ms_fTimeStep = (nDelta/timerFreq) * 0.05f;
cyclesTime += static_cast<long long>(nDelta);
cyclesTimeNonClipped += static_cast<long long>(nDelta);
//*m_snTimeInMilliseconds += nDelta;
//*m_snTimeInMillisecondsNonClipped += nDelta;
}
#ifdef SILENTPATCH_III_VER
if ( *ms_fTimeStep < 0.01f && !*m_UserPause && !*m_CodePause )
#else
if ( *ms_fTimeStep < 0.01f && !*m_UserPause && !*m_CodePause && !*bSnapShotActive )
#endif
*ms_fTimeStep = 0.01f;
*ms_fTimeStepNotClipped = *ms_fTimeStep;
if ( *ms_fTimeStep > 3.0f )
*ms_fTimeStep = 3.0f;
/*if ( *m_snTimeInMilliseconds - *m_snPreviousTimeInMilliseconds > 60 )
*m_snTimeInMilliseconds = *m_snPreviousTimeInMilliseconds + 60;*/
if ( cyclesTime - cyclesPreviousTime > 60 * timerFreq )
cyclesTime = cyclesPreviousTime + (60 * timerFreq);
*m_snTimeInMillisecondsPauseMode = static_cast<int>(cyclesTimePauseMode / timerFreq);
*m_snTimeInMilliseconds = static_cast<int>(cyclesTime / timerFreq);
*m_snTimeInMillisecondsNonClipped = static_cast<int>(cyclesTimeNonClipped / timerFreq);
++(*m_FrameCounter);
}
void CTimer::RecoverFromSave()
{
cyclesTime = *m_snTimeInMilliseconds * timerFreq;
cyclesPreviousTime = *m_snPreviousTimeInMilliseconds * timerFreq;
cyclesTimePauseMode = *m_snTimeInMillisecondsPauseMode * timerFreq;
cyclesTimeNonClipped = *m_snTimeInMillisecondsNonClipped * timerFreq;
}

30
SilentPatch/Timer.h Normal file
View file

@ -0,0 +1,30 @@
#ifndef __TIMER
#define __TIMER
typedef long long(*gtaTimer)();
class CTimer
{
public:
static float* ms_fTimeScale;
static float* ms_fTimeStep;
static float* ms_fTimeStepNotClipped;
static bool* m_UserPause;
static bool* m_CodePause;
static int* m_snTimeInMilliseconds;
static int* m_snPreviousTimeInMilliseconds;
static int* m_snTimeInMillisecondsNonClipped;
static int* m_snTimeInMillisecondsPauseMode;
static unsigned int* m_FrameCounter;
public:
static void Initialise();
static void Suspend();
static void Resume();
static unsigned int GetCyclesPerFrame();
static unsigned int GetCyclesPerMillisecond();
static void Update();
static void RecoverFromSave();
};
#endif

120
SilentPatch/Vehicle.cpp Normal file
View file

@ -0,0 +1,120 @@
#include "StdAfx.h"
#include "Vehicle.h"
#include "Timer.h"
WRAPPER void CVehicle::SetComponentAtomicAlpha(RpAtomic* pAtomic, int nAlpha) { WRAPARG(pAtomic); WRAPARG(nAlpha); EAXJMP(0x6D2960); }
WRAPPER void CVehicle::Render() { EAXJMP(0x6D0E60); }
static RwObject* GetCurrentAtomicObjectCB(RwObject* pObject, void* data)
{
if ( RpAtomicGetFlags(pObject) & rpATOMICRENDER )
*static_cast<RwObject**>(data) = pObject;
return pObject;
}
void CHeli::Render()
{
double dRotorsSpeed, dMovingRotorSpeed;
m_nTimeTillWeNeedThisCar = *CTimer::m_snTimeInMilliseconds + 3000;
if ( m_fRotorSpeed > 0.0 )
dRotorsSpeed = min(1.7 * (1.0/0.22) * m_fRotorSpeed, 1.5);
else
dRotorsSpeed = 0.0;
dMovingRotorSpeed = dRotorsSpeed - 0.4;
if ( dMovingRotorSpeed < 0.0 )
dMovingRotorSpeed = 0.0;
int nStaticRotorAlpha = static_cast<int>(min((1.5-dRotorsSpeed) * 255.0, 255));
int nMovingRotorAlpha = static_cast<int>(min(dMovingRotorSpeed * 175.0, 175));
if ( m_pCarNode[11] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[11], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nStaticRotorAlpha);
}
if ( m_pCarNode[13] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[13], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nStaticRotorAlpha);
}
if ( m_pCarNode[12] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[12], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nMovingRotorAlpha);
}
if ( m_pCarNode[14] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[14], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nMovingRotorAlpha);
}
CEntity::Render();
}
void CPlane::Render()
{
double dRotorsSpeed, dMovingRotorSpeed;
m_nTimeTillWeNeedThisCar = *CTimer::m_snTimeInMilliseconds + 3000;
if ( m_fPropellerSpeed > 0.0 )
dRotorsSpeed = min(1.7 * (1.0/0.31) * m_fPropellerSpeed, 1.5);
else
dRotorsSpeed = 0.0;
dMovingRotorSpeed = dRotorsSpeed - 0.4;
if ( dMovingRotorSpeed < 0.0 )
dMovingRotorSpeed = 0.0;
int nStaticRotorAlpha = static_cast<int>(min((1.5-dRotorsSpeed) * 255.0, 255));
int nMovingRotorAlpha = static_cast<int>(min(dMovingRotorSpeed * 175.0, 175));
if ( m_pCarNode[11] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[11], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nStaticRotorAlpha);
}
if ( m_pCarNode[13] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[13], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nStaticRotorAlpha);
}
if ( m_pCarNode[12] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[12], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nMovingRotorAlpha);
}
if ( m_pCarNode[14] )
{
RpAtomic* pOutAtomic = nullptr;
RwFrameForAllObjects(m_pCarNode[14], GetCurrentAtomicObjectCB, &pOutAtomic);
if ( pOutAtomic )
SetComponentAtomicAlpha(pOutAtomic, nMovingRotorAlpha);
}
CVehicle::Render();
}

141
SilentPatch/Vehicle.h Normal file
View file

@ -0,0 +1,141 @@
#ifndef __VEHICLE
#define __VEHICLE
#include "General.h"
struct CVehicleFlags
{
//0x428
unsigned char bIsLawEnforcer: 1; // Is this guy chasing the player at the moment
unsigned char bIsAmbulanceOnDuty: 1; // Ambulance trying to get to an accident
unsigned char bIsFireTruckOnDuty: 1; // Firetruck trying to get to a fire
unsigned char bIsLocked: 1; // Is this guy locked by the script (cannot be removed)
unsigned char bEngineOn: 1; // For sound purposes. Parked cars have their engines switched off (so do destroyed cars)
unsigned char bIsHandbrakeOn: 1; // How's the handbrake doing ?
unsigned char bLightsOn: 1; // Are the lights switched on ?
unsigned char bFreebies: 1; // Any freebies left in this vehicle ?
//0x429
unsigned char bIsVan: 1; // Is this vehicle a van (doors at back of vehicle)
unsigned char bIsBus: 1; // Is this vehicle a bus
unsigned char bIsBig: 1; // Is this vehicle big
unsigned char bLowVehicle: 1; // Need this for sporty type cars to use low getting-in/out anims
unsigned char bComedyControls: 1; // Will make the car hard to control (hopefully in a funny way)
unsigned char bWarnedPeds: 1; // Has scan and warn peds of danger been processed?
unsigned char bCraneMessageDone: 1; // A crane message has been printed for this car allready
// unsigned char bExtendedRange: 1; // This vehicle needs to be a bit further away to get deleted
unsigned char bTakeLessDamage: 1; // This vehicle is stronger (takes about 1/4 of damage)
//0x42A
unsigned char bIsDamaged: 1; // This vehicle has been damaged and is displaying all its components
unsigned char bHasBeenOwnedByPlayer : 1;// To work out whether stealing it is a crime
unsigned char bFadeOut: 1; // Fade vehicle out
unsigned char bIsBeingCarJacked: 1;
unsigned char bCreateRoadBlockPeds : 1;// If this vehicle gets close enough we will create peds (coppers or gang members) round it
unsigned char bCanBeDamaged: 1; // Set to FALSE during cut scenes to avoid explosions
// unsigned char bUsingSpecialColModel : 1;
// Is player vehicle using special collision model, stored in player strucure
unsigned char bOccupantsHaveBeenGenerated : 1; // Is true if the occupants have already been generated. (Shouldn't happen again)
unsigned char bGunSwitchedOff: 1; // Level designers can use this to switch off guns on boats
//0x42B
unsigned char bVehicleColProcessed : 1;// Has ProcessEntityCollision been processed for this car?
unsigned char bIsCarParkVehicle: 1; // Car has been created using the special CAR_PARK script command
unsigned char bHasAlreadyBeenRecorded : 1; // Used for replays
unsigned char bPartOfConvoy: 1;
unsigned char bHeliMinimumTilt: 1; // This heli should have almost no tilt really
unsigned char bAudioChangingGear: 1; // sounds like vehicle is changing gear
unsigned char bIsDrowning: 1; // is vehicle occupants taking damage in water (i.e. vehicle is dead in water)
unsigned char bTyresDontBurst: 1; // If this is set the tyres are invincible
//0x42C
unsigned char bCreatedAsPoliceVehicle : 1;// True if this guy was created as a police vehicle (enforcer, policecar, miamivice car etc)
unsigned char bRestingOnPhysical: 1; // Dont go static cause car is sitting on a physical object that might get removed
unsigned char bParking : 1;
unsigned char bCanPark : 1;
unsigned char bFireGun: 1; // Does the ai of this vehicle want to fire it's gun?
unsigned char bDriverLastFrame: 1; // Was there a driver present last frame ?
unsigned char bNeverUseSmallerRemovalRange: 1;// Some vehicles (like planes) we don't want to remove just behind the camera.
unsigned char bIsRCVehicle: 1; // Is this a remote controlled (small) vehicle. True whether the player or AI controls it.
//0x42D
unsigned char bAlwaysSkidMarks: 1; // This vehicle leaves skidmarks regardless of the wheels' states.
unsigned char bEngineBroken: 1; // Engine doesn't work. Player can get in but the vehicle won't drive
unsigned char bVehicleCanBeTargetted : 1;// The ped driving this vehicle can be targetted, (for Torenos plane mission)
unsigned char bPartOfAttackWave: 1; // This car is used in an attack during a gang war
unsigned char bWinchCanPickMeUp: 1; // This car cannot be picked up by any ropes.
unsigned char bImpounded: 1; // Has this vehicle been in a police impounding garage
unsigned char bVehicleCanBeTargettedByHS : 1;// Heat seeking missiles will not target this vehicle.
unsigned char bSirenOrAlarm: 1; // Set to TRUE if siren or alarm active, else FALSE
//0x42E
unsigned char bHasGangLeaningOn: 1;
unsigned char bGangMembersForRoadBlock : 1;// Will generate gang members if NumPedsForRoadBlock > 0
unsigned char bDoesProvideCover: 1; // If this is false this particular vehicle can not be used to take cover behind.
unsigned char bMadDriver: 1; // This vehicle is driving like a lunatic
unsigned char bUpgradedStereo: 1; // This vehicle has an upgraded stereo
unsigned char bConsideredByPlayer: 1; // This vehicle is considered by the player to enter
unsigned char bPetrolTankIsWeakPoint : 1;// If false shootong the petrol tank will NOT Blow up the car
unsigned char bDisableParticles: 1; // Disable particles from this car. Used in garage.
//0x42F
unsigned char bHasBeenResprayed: 1; // Has been resprayed in a respray garage. Reset after it has been checked.
unsigned char bUseCarCheats: 1; // If this is true will set the car cheat stuff up in ProcessControl()
unsigned char bDontSetColourWhenRemapping : 1;// If the texture gets remapped we don't want to change the colour with it.
unsigned char bUsedForReplay: 1; // This car is controlled by replay and should be removed when replay is done.
};
class NOVMT CVehicle : public CPhysical
{
protected:
BYTE __pad1[752];
CVehicleFlags m_nVehicleFlags;
BYTE __pad2[160];
signed int m_nTimeTillWeNeedThisCar;
BYTE __pad4[56];
CEntity* pDamagingEntity;
BYTE __pad3[144];
public:
CVehicleFlags& GetVehicleFlags()
{ return m_nVehicleFlags; }
CEntity* GetDamagingEntity()
{ return pDamagingEntity; }
virtual void Render() override;
static void SetComponentAtomicAlpha(RpAtomic* pAtomic, int nAlpha);
};
class NOVMT CAutomobile : public CVehicle
{
public:
BYTE paddd[172];
RwFrame* m_pCarNode[20]; // May be wrong?
BYTE padding[432];
float m_fRotorSpeed;
BYTE __moarpad[312];
public:
};
class NOVMT CHeli : public CAutomobile
{
public:
virtual void Render() override;
};
class NOVMT CPlane : public CAutomobile
{
public:
BYTE __pad[60];
float m_fPropellerSpeed;
public:
virtual void Render() override;
};
static_assert(sizeof(CVehicle) == 0x5A0, "Wrong size: CVehicle");
static_assert(sizeof(CAutomobile) == 0x988, "Wrong size: CAutomobile");
#endif

1207
SilentPatch/dllmain.cpp Normal file

File diff suppressed because it is too large Load diff

12
SilentPatch/win2000.asm Normal file
View file

@ -0,0 +1,12 @@
.model flat
.data
__imp__EncodePointer@4 dd dummy
__imp__DecodePointer@4 dd dummy
EXTERNDEF __imp__EncodePointer@4 : DWORD
EXTERNDEF __imp__DecodePointer@4 : DWORD
.code
dummy proc
mov eax, [esp+4]
ret 4
dummy endp
end

108
VCFix/VCFix.vcxproj Normal file
View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{374D4CB4-548A-4DA0-AB68-8EA356424626}</ProjectGuid>
<RootNamespace>VCFix</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetExt>.asi</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetExt>.asi</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>SILENTPATCH_VC_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>D:\RWSDK\Graphics\rwsdk\include\d3d9</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<AdditionalDependencies>Winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto Vice City\SilentPatchVC.asi"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>SILENTPATCH_VC_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>D:\RWSDK\Graphics\rwsdk\include\d3d9</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Windows</SubSystem>
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<AdditionalDependencies>Winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto Vice City\SilentPatchVC.asi"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\SilentPatch\MemoryMgr.h" />
<ClInclude Include="..\SilentPatch\Timer.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\SilentPatch\dllmain.cpp" />
<ClCompile Include="..\SilentPatch\Timer.cpp" />
</ItemGroup>
<ItemGroup>
<MASM Include="..\SilentPatch\win2000.asm">
<FileType>Document</FileType>
</MASM>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\SilentPatch\MemoryMgr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\Timer.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\SilentPatch\dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SilentPatch\Timer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<MASM Include="..\SilentPatch\win2000.asm">
<Filter>Source Files</Filter>
</MASM>
</ItemGroup>
</Project>