mirror of
https://github.com/FreeTheTech101/t5exp.git
synced 2025-06-07 18:07:52 -05:00
Small optimization.
This commit is contained in:
parent
26152d9b0b
commit
86f3a2d9e7
@ -1,13 +1,11 @@
|
||||
#include "stdinc.h"
|
||||
|
||||
typedef void(__cdecl * DB_LoadXAssets_t)(XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
||||
DB_LoadXAssets_t DB_LoadXAssets = (DB_LoadXAssets_t)0x4359A0;
|
||||
|
||||
void XModelExport(const char* name);
|
||||
|
||||
void DumpStuff()
|
||||
{
|
||||
XModelExport("t5_weapon_ak74u_viewmodel");
|
||||
XModelExport("t5_weapon_galil_viewmodel");
|
||||
}
|
||||
|
||||
void RunStuff()
|
||||
@ -36,13 +34,14 @@ void Sys_RunInit()
|
||||
// Custom command line
|
||||
*(char**)0x403683 = "+set dedicated 1";
|
||||
|
||||
//nop(0x456E03, 5);
|
||||
*(BYTE*)0x46EA60 = 0xC3;
|
||||
|
||||
// Hook random frame function. FastFiles will all be loaded then.
|
||||
call(0x86C785, RunStuff, PATCH_CALL);
|
||||
|
||||
// Don't initialize network stuff
|
||||
*(BYTE*)0x46EA60 = 0xC3;
|
||||
|
||||
// Ignore dedi authentication
|
||||
nop(0x4ED3E8, 5);
|
||||
*(BYTE*)0x5AFD60 = 0xC3;
|
||||
*(BYTE*)0x5D4500 = 0xC3;
|
||||
}
|
6
t5exp/T5.cpp
Normal file
6
t5exp/T5.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "stdinc.h"
|
||||
|
||||
Com_Printf_t Com_Printf = (Com_Printf_t)0x4126C0;
|
||||
DB_FindXAssetHeader_t DB_FindXAssetHeader = (DB_FindXAssetHeader_t)0x493A60;
|
||||
DB_LoadXAssets_t DB_LoadXAssets = (DB_LoadXAssets_t)0x4359A0;
|
||||
SL_ConvertToString_t SL_ConvertToString = (SL_ConvertToString_t)0x624C70;
|
@ -1,5 +1,7 @@
|
||||
#include <d3d9.h>
|
||||
|
||||
typedef float vec3_t[3];
|
||||
|
||||
struct DObjAnimMat
|
||||
{
|
||||
float quat[4];
|
||||
@ -562,7 +564,7 @@ struct XModel
|
||||
float maxs[3];
|
||||
__int16 numLods;
|
||||
__int16 collLod;
|
||||
|
||||
|
||||
union
|
||||
{
|
||||
XModelStreamInfo streamInfo;
|
||||
@ -634,3 +636,23 @@ struct XZoneInfo
|
||||
int allocFlags;
|
||||
int freeFlags;
|
||||
};
|
||||
|
||||
|
||||
enum scriptInstance_t
|
||||
{
|
||||
SCRIPTINSTANCE_SERVER = 0x0,
|
||||
SCRIPTINSTANCE_CLIENT = 0x1,
|
||||
SCRIPT_INSTANCE_MAX = 0x2,
|
||||
};
|
||||
|
||||
typedef void(__cdecl * Com_Printf_t)(int channel, const char *fmt, ...);
|
||||
extern Com_Printf_t Com_Printf;
|
||||
|
||||
typedef void *(__cdecl * DB_FindXAssetHeader_t)(XAssetType type, const char *name, bool errorIfMissing, int waitTime);
|
||||
extern DB_FindXAssetHeader_t DB_FindXAssetHeader;
|
||||
|
||||
typedef void(__cdecl * DB_LoadXAssets_t)(XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
||||
extern DB_LoadXAssets_t DB_LoadXAssets;
|
||||
|
||||
typedef const char *(__cdecl * SL_ConvertToString_t)(unsigned int stringValue, scriptInstance_t inst);
|
||||
extern SL_ConvertToString_t SL_ConvertToString;
|
@ -1,20 +1,4 @@
|
||||
#include "stdinc.h"
|
||||
#include <direct.h>
|
||||
|
||||
typedef float vec3_t[3];
|
||||
|
||||
enum scriptInstance_t
|
||||
{
|
||||
SCRIPTINSTANCE_SERVER = 0x0,
|
||||
SCRIPTINSTANCE_CLIENT = 0x1,
|
||||
SCRIPT_INSTANCE_MAX = 0x2,
|
||||
};
|
||||
|
||||
typedef void *(__cdecl * DB_FindXAssetHeader_t)(XAssetType type, const char *name, bool errorIfMissing, int waitTime);
|
||||
DB_FindXAssetHeader_t DB_FindXAssetHeader = (DB_FindXAssetHeader_t)0x493A60;
|
||||
|
||||
typedef const char *(__cdecl * SL_ConvertToString_t)(unsigned int stringValue, scriptInstance_t inst);
|
||||
SL_ConvertToString_t SL_ConvertToString = (SL_ConvertToString_t)0x624C70;
|
||||
|
||||
Stream* Buffer = 0;
|
||||
|
||||
@ -346,6 +330,11 @@ void XModelExport(const char* name)
|
||||
{
|
||||
fwrite(_Buffer.Data(), _Buffer.Size(), 1, fp);
|
||||
fclose(fp);
|
||||
Com_Printf(0, "File '%s' written\n", _name.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
Com_Printf(0, "Unable to write file '%s'\n", _name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
@ -3,6 +3,9 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <direct.h>
|
||||
|
||||
#include "Hooking.h"
|
||||
#include "XModel.h"
|
||||
#include "Stream.h"
|
||||
#include "Stream.h"
|
||||
|
||||
#include "T5.h"
|
@ -89,7 +89,7 @@
|
||||
<ClInclude Include="Hooking.h" />
|
||||
<ClInclude Include="stdinc.h" />
|
||||
<ClInclude Include="Stream.h" />
|
||||
<ClInclude Include="XModel.h" />
|
||||
<ClInclude Include="T5.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Hooking.cpp" />
|
||||
@ -104,6 +104,7 @@
|
||||
<ClCompile Include="PatchT5.cpp" />
|
||||
<ClCompile Include="SDLLP.cpp" />
|
||||
<ClCompile Include="Stream.cpp" />
|
||||
<ClCompile Include="T5.cpp" />
|
||||
<ClCompile Include="XModelExport.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
@ -33,6 +33,9 @@
|
||||
<ClCompile Include="Stream.cpp">
|
||||
<Filter>Quelldateien</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="T5.cpp">
|
||||
<Filter>Quelldateien</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdinc.h">
|
||||
@ -41,10 +44,10 @@
|
||||
<ClInclude Include="Hooking.h">
|
||||
<Filter>Headerdateien</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="XModel.h">
|
||||
<ClInclude Include="Stream.h">
|
||||
<Filter>Headerdateien</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Stream.h">
|
||||
<ClInclude Include="T5.h">
|
||||
<Filter>Headerdateien</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerCommand>t5exp.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerCommand>BlackOpsMP.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>D:\Games\SteamLibrary\steamapps\common\Call of Duty Black Ops\</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerCommand>t5exp.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerCommand>BlackOpsMP.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>D:\Games\SteamLibrary\steamapps\common\Call of Duty Black Ops\</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user