Skip to content

Commit

Permalink
MW Update + Bo3 Hitboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Scobalula committed Apr 29, 2020
1 parent 57b901d commit aa0ab50
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/WraithXCOD/WraithXCOD/CoDAssets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,7 @@ ExportGameResult CoDAssets::ExportModelAsset(const CoDModel_t* Model, const std:
// Check the game
switch (CoDAssets::GameID)
{
case SupportedGames::BlackOps3:
case SupportedGames::BlackOps: Result = CoDXModelTranslator::TranslateXModelHitbox(GenericModel); break;
}

Expand Down
6 changes: 5 additions & 1 deletion src/WraithXCOD/WraithXCOD/DBGameAssets.h
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,11 @@ struct BO3XModel

uint64_t MaterialHandlesPtr;

uint8_t Padding3[0xB8];
uint8_t Padding3[0x18];

uint64_t BoneInfoPtr;

uint8_t Padding4[0x98];
};
#pragma pack(pop)

Expand Down
3 changes: 3 additions & 0 deletions src/WraithXCOD/WraithXCOD/GameBlackOps3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,9 @@ std::unique_ptr<XModel_t> GameBlackOps3::ReadXModel(const CoDModel_t* Model)
// Global matricies
ModelAsset->BaseMatriciesPtr = ModelData.BaseMatriciesPtr;

// Bone info ptr
ModelAsset->BoneInfoPtr = ModelData.BoneInfoPtr;

// Prepare to parse lods
for (uint32_t i = 0; i < ModelData.NumLods; i++)
{
Expand Down
10 changes: 6 additions & 4 deletions src/WraithXCOD/WraithXCOD/GameModernWarfare4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// Modern Warfare 4 SP
std::array<DBGameInfo, 1> GameModernWarfare4::SinglePlayerOffsets =
{{
{ 0xBF345201, 0x0, 0xD8A68001, 0x0 }
{ 0xC9634C0, 0x0, 0xE638F00, 0x0 }
}};

// -- Finished with databases
Expand Down Expand Up @@ -169,7 +169,7 @@ bool GameModernWarfare4::LoadOffsets()

// Attempt to locate via heuristic searching (Note: As of right now, none of the functions got inlined)
auto DBAssetsScan = CoDAssets::GameInstance->Scan("48 8D 04 40 4C 8D 8E ?? ?? ?? ?? 4D 8D 0C C1 8D 42 FF");
auto StringTableScan = CoDAssets::GameInstance->Scan("4C 8B C2 48 8D 1D ?? ?? ?? ?? 48 2B CB");
auto StringTableScan = CoDAssets::GameInstance->Scan("4D 8B C7 48 03 1D ?? ?? ?? ?? 49 8B D5");

// Check that we had hits
if (DBAssetsScan > 0 && StringTableScan > 0)
Expand All @@ -181,7 +181,7 @@ bool GameModernWarfare4::LoadOffsets()
// We don't use size offsets
0,
// Resolve strings from LEA
CoDAssets::GameInstance->Read<uint32_t>(StringTableScan + 0x6) + (StringTableScan + 0xA),
CoDAssets::GameInstance->Read<uint64_t>(CoDAssets::GameInstance->Read<uint32_t>(StringTableScan + 0x6) + (StringTableScan + 0xA)),
// We don't use package offsets
0
);
Expand Down Expand Up @@ -728,6 +728,8 @@ std::unique_ptr<XModel_t> GameModernWarfare4::ReadXModel(const CoDModel_t* Model
// Read the surface data
auto SurfaceInfo = CoDAssets::GameInstance->Read<MW4XModelSurface>(XSurfacePtr);

sizeof(MW4XModelSurface);

// Apply surface info
SubmeshReference.RigidWeightsPtr = SurfaceInfo.RigidWeightsPtr;
SubmeshReference.VertListcount = SurfaceInfo.VertListCount;
Expand Down Expand Up @@ -1227,7 +1229,7 @@ void GameModernWarfare4::LoadXModel(const XModelLod_t& ModelLOD, const std::uniq
std::string GameModernWarfare4::LoadStringEntry(uint64_t Index)
{
// Read and return (Offsets[3] = StringTable)
return CoDAssets::GameInstance->ReadNullTerminatedString((40 * Index) + CoDAssets::GameOffsetInfos[5] + 8);
return CoDAssets::GameInstance->ReadNullTerminatedString((16 * Index) + CoDAssets::GameOffsetInfos[5] + 8);
}
void GameModernWarfare4::PerformInitialSetup()
{
Expand Down
10 changes: 5 additions & 5 deletions src/WraithXCOD/WraithXCOD/WraithXCOD.rc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ BEGIN
CONTROL "Export Image Names",IDC_EXPORTIMGNAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,174,32,168,11
CONTROL "Export Vertex Colors",IDC_EXPORTVTXCOLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,174,48,83,11
LTEXT "Tip: Global images setting saves space and speeds up export time",IDC_TIP,17,198,312,8
LTEXT "Notice: Hitbox export is only available for Black Ops 1",IDC_NOTICE,17,210,312,8
LTEXT "Notice: Hitbox export is only available for Black Ops 1/3",IDC_NOTICE,17,210,312,8
LTEXT "Model export formats",IDC_TITLE2,8,100,156,16
CONTROL "Export .MA (Maya scene)",IDC_EXPORTMA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,122,109,11
CONTROL "Export .OBJ",IDC_EXPORTOBJ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,138,109,11
Expand Down Expand Up @@ -361,8 +361,8 @@ IDI_CHECKMARK ICON "..\\..\\WraithX\\Resources\\Che
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,99,0
PRODUCTVERSION 1,3,99,0
FILEVERSION 1,4,0,0
PRODUCTVERSION 1,4,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -379,12 +379,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "DTZxPorter / Scobalula"
VALUE "FileDescription", "Greyhound"
VALUE "FileVersion", "1.3.99.0"
VALUE "FileVersion", "1.4.0.0"
VALUE "InternalName", "Greyhound"
VALUE "LegalCopyright", "Copyright (C) 2019 DTZxPorter / Scobalula"
VALUE "OriginalFilename", "Greyhound.exe"
VALUE "ProductName", "Greyhound"
VALUE "ProductVersion", "1.3.99.0"
VALUE "ProductVersion", "1.4.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit aa0ab50

Please sign in to comment.