Fix zm_prototype_sh
This commit is contained in:
parent
61b2b0c920
commit
69c454a3fa
@ -117,7 +117,7 @@ namespace Components
|
|||||||
|
|
||||||
void AssetHandler::ModifyAsset(Game::XAssetType type, Game::XAssetHeader asset, std::string name)
|
void AssetHandler::ModifyAsset(Game::XAssetType type, Game::XAssetHeader asset, std::string name)
|
||||||
{
|
{
|
||||||
if (type == Game::XAssetType::ASSET_TYPE_MATERIAL && (name == "wc/codo_ui_viewer_black_decal3" || name == "wc/codo_ui_viewer_black_decal2" || name == "wc/hint_arrows02"))
|
if (type == Game::XAssetType::ASSET_TYPE_MATERIAL && (name == "wc/codo_ui_viewer_black_decal3" || name == "wc/codo_ui_viewer_black_decal2" || name == "wc/hint_arrows01" || name == "wc/hint_arrows02"))
|
||||||
{
|
{
|
||||||
asset.material->sortKey = 0xE;
|
asset.material->sortKey = 0xE;
|
||||||
}
|
}
|
||||||
|
@ -237,14 +237,7 @@ namespace Components
|
|||||||
|
|
||||||
if (Zones::ZoneVersion >= 359)
|
if (Zones::ZoneVersion >= 359)
|
||||||
{
|
{
|
||||||
for (int i = 0, offset = 20; i < 4; ++i, offset += 4)
|
for (int offset = 20; offset <= 56; offset += 4)
|
||||||
{
|
|
||||||
*Game::varXModelPtr = reinterpret_cast<Game::XModel**>(varWeaponCompleteDef + offset);
|
|
||||||
Game::Load_XModelPtr(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 148
|
|
||||||
for (int offset = 28; offset <= 56; offset += 4)
|
|
||||||
{
|
{
|
||||||
*Game::varXModelPtr = reinterpret_cast<Game::XModel**>(varWeaponCompleteDef + offset);
|
*Game::varXModelPtr = reinterpret_cast<Game::XModel**>(varWeaponCompleteDef + offset);
|
||||||
Game::Load_XModelPtr(false);
|
Game::Load_XModelPtr(false);
|
||||||
@ -972,11 +965,13 @@ namespace Components
|
|||||||
|
|
||||||
bool Zones::LoadmenuDef_t(bool atStreamStart, char* buffer, int size)
|
bool Zones::LoadmenuDef_t(bool atStreamStart, char* buffer, int size)
|
||||||
{
|
{
|
||||||
if (Zones::ZoneVersion < 359) size += 4;
|
if (Zones::ZoneVersion != 359) size += 4;
|
||||||
|
|
||||||
bool result = Game::Load_Stream(atStreamStart, buffer, size);
|
bool result = Game::Load_Stream(atStreamStart, buffer, size);
|
||||||
std::memmove(buffer + 168, buffer + 172, (Zones::ZoneVersion < 359 ? 232 : 228));
|
std::memmove(buffer + 168, buffer + 172, (Zones::ZoneVersion != 359 ? 232 : 228));
|
||||||
AssetHandler::Relocate(buffer + 172, buffer + 168, (Zones::ZoneVersion < 359 ? 232 : 228));
|
AssetHandler::Relocate(buffer + 172, buffer + 168, (Zones::ZoneVersion != 359 ? 232 : 228));
|
||||||
|
|
||||||
|
reinterpret_cast<Game::menuDef_t*>(buffer)->expressionData = nullptr;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1283,6 +1278,16 @@ namespace Components
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Zones::LoadWindowImage(bool atStreamStart)
|
||||||
|
{
|
||||||
|
Game::Load_MaterialHandle(atStreamStart);
|
||||||
|
|
||||||
|
if (Zones::Version() >= 360)
|
||||||
|
{
|
||||||
|
Game::Load_GfxImagePtr(atStreamStart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Zones::InstallPatches(int version)
|
void Zones::InstallPatches(int version)
|
||||||
{
|
{
|
||||||
AssetHandler::ClearRelocations();
|
AssetHandler::ClearRelocations();
|
||||||
@ -1336,13 +1341,11 @@ namespace Components
|
|||||||
// Patch ExpressionSupportingData loading in menus
|
// Patch ExpressionSupportingData loading in menus
|
||||||
if (Zones::Version() >= 359)
|
if (Zones::Version() >= 359)
|
||||||
{
|
{
|
||||||
Utils::Hook::Nop(0x41A590, 5);
|
Utils::Hook::Set<BYTE>(0x4AF680, 0xC3);
|
||||||
Utils::Hook::Set<BYTE>(0x459833, 0xC3);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Utils::Hook(0x41A590, 0x4AF680, HOOK_CALL).Install()->Quick();
|
Utils::Hook::Set<BYTE>(0x4AF680, 0xA1);
|
||||||
Utils::Hook(0x459833, 0x4AF680, HOOK_JUMP).Install()->Quick();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patch)
|
if (patch)
|
||||||
@ -1489,6 +1492,7 @@ namespace Components
|
|||||||
}, HOOK_CALL);
|
}, HOOK_CALL);
|
||||||
|
|
||||||
Utils::Hook(0x4597DD, Zones::LoadStatement, HOOK_CALL).Install()->Quick();
|
Utils::Hook(0x4597DD, Zones::LoadStatement, HOOK_CALL).Install()->Quick();
|
||||||
|
Utils::Hook(0x471A39, Zones::LoadWindowImage, HOOK_JUMP).Install()->Quick();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Easy dirty disk debugging
|
// Easy dirty disk debugging
|
||||||
|
@ -74,5 +74,6 @@ namespace Components
|
|||||||
static bool LoadGfxWorld(bool atStreamStart, char* buffer, int size);
|
static bool LoadGfxWorld(bool atStreamStart, char* buffer, int size);
|
||||||
static void Loadsunflare_t(bool atStreamStart);
|
static void Loadsunflare_t(bool atStreamStart);
|
||||||
static bool LoadStatement(bool atStreamStart, char* buffer, int size);
|
static bool LoadStatement(bool atStreamStart, char* buffer, int size);
|
||||||
|
static void LoadWindowImage(bool atStreamStart);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,7 @@ namespace Game
|
|||||||
Load_XStringCustom_t Load_XStringCustom = (Load_XStringCustom_t)0x4E0DD0;
|
Load_XStringCustom_t Load_XStringCustom = (Load_XStringCustom_t)0x4E0DD0;
|
||||||
Load_FxEffectDefHandle_t Load_FxEffectDefHandle = (Load_FxEffectDefHandle_t)0x4D9B90;
|
Load_FxEffectDefHandle_t Load_FxEffectDefHandle = (Load_FxEffectDefHandle_t)0x4D9B90;
|
||||||
Load_FxElemDef_t Load_FxElemDef = (Load_FxElemDef_t)0x45AD90;
|
Load_FxElemDef_t Load_FxElemDef = (Load_FxElemDef_t)0x45AD90;
|
||||||
|
Load_GfxImagePtr_t Load_GfxImagePtr = (Load_GfxImagePtr_t)0x4C13D0;
|
||||||
Load_Texture_t Load_Texture = (Load_Texture_t)0x51F4E0;
|
Load_Texture_t Load_Texture = (Load_Texture_t)0x51F4E0;
|
||||||
Load_GfxTextureLoad_t Load_GfxTextureLoad = (Load_GfxTextureLoad_t)0x4D3210;
|
Load_GfxTextureLoad_t Load_GfxTextureLoad = (Load_GfxTextureLoad_t)0x4D3210;
|
||||||
Load_SndAliasCustom_t Load_SndAliasCustom = (Load_SndAliasCustom_t)0x49B6B0;
|
Load_SndAliasCustom_t Load_SndAliasCustom = (Load_SndAliasCustom_t)0x49B6B0;
|
||||||
|
@ -266,6 +266,9 @@ namespace Game
|
|||||||
typedef void(__cdecl *Load_FxElemDef_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_FxElemDef_t)(bool atStreamStart);
|
||||||
extern Load_FxElemDef_t Load_FxElemDef;
|
extern Load_FxElemDef_t Load_FxElemDef;
|
||||||
|
|
||||||
|
typedef void(__cdecl *Load_GfxImagePtr_t)(bool atStreamStart);
|
||||||
|
extern Load_GfxImagePtr_t Load_GfxImagePtr;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_GfxTextureLoad_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_GfxTextureLoad_t)(bool atStreamStart);
|
||||||
extern Load_GfxTextureLoad_t Load_GfxTextureLoad;
|
extern Load_GfxTextureLoad_t Load_GfxTextureLoad;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user