[IWeapon] Write effects to fastfile as well.

This commit is contained in:
TheApadayo 2019-01-15 23:09:50 -05:00
parent 59ef8edbe2
commit 4572425f00

View File

@ -103,29 +103,22 @@ namespace Assets
if (asset->weapDef->worldKnifeModel) builder->loadAsset(Game::XAssetType::ASSET_TYPE_XMODEL, asset->weapDef->worldKnifeModel); if (asset->weapDef->worldKnifeModel) builder->loadAsset(Game::XAssetType::ASSET_TYPE_XMODEL, asset->weapDef->worldKnifeModel);
if (asset->weapDef->projectileModel) builder->loadAsset(Game::XAssetType::ASSET_TYPE_XMODEL, asset->weapDef->projectileModel); if (asset->weapDef->projectileModel) builder->loadAsset(Game::XAssetType::ASSET_TYPE_XMODEL, asset->weapDef->projectileModel);
if (asset->weapDef->physCollmap) if (asset->weapDef->physCollmap) builder->loadAsset(Game::XAssetType::ASSET_TYPE_PHYSCOLLMAP, asset->weapDef->physCollmap);
{
builder->loadAsset(Game::XAssetType::ASSET_TYPE_PHYSCOLLMAP, asset->weapDef->physCollmap);
}
if (asset->weapDef->tracerType) if (asset->weapDef->tracerType) builder->loadAsset(Game::XAssetType::ASSET_TYPE_TRACER, asset->weapDef->tracerType);
{
builder->loadAsset(Game::XAssetType::ASSET_TYPE_TRACER, asset->weapDef->tracerType);
}
// don't write effects for now if (asset->weapDef->viewFlashEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->viewFlashEffect);
asset->weapDef->viewFlashEffect = NULL; if (asset->weapDef->worldFlashEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->worldFlashEffect);
asset->weapDef->worldFlashEffect = NULL; if (asset->weapDef->viewShellEjectEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->viewShellEjectEffect);
asset->weapDef->viewShellEjectEffect = NULL; if (asset->weapDef->worldShellEjectEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->worldShellEjectEffect);
asset->weapDef->worldShellEjectEffect = NULL; if (asset->weapDef->viewLastShotEjectEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->viewLastShotEjectEffect);
asset->weapDef->viewLastShotEjectEffect = NULL; if (asset->weapDef->worldLastShotEjectEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->worldLastShotEjectEffect);
asset->weapDef->worldLastShotEjectEffect = NULL; if (asset->weapDef->projExplosionEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->projExplosionEffect);
asset->weapDef->projExplosionEffect = NULL; if (asset->weapDef->projDudEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->projDudEffect);
asset->weapDef->projDudEffect = NULL; if (asset->weapDef->projTrailEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->projTrailEffect);
asset->weapDef->projTrailEffect = NULL; if (asset->weapDef->projBeaconEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->projBeaconEffect);
asset->weapDef->projBeaconEffect = NULL; if (asset->weapDef->projIgnitionEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->projIgnitionEffect);
asset->weapDef->projIgnitionEffect = NULL; if (asset->weapDef->turretOverheatEffect) builder->loadAsset(Game::XAssetType::ASSET_TYPE_FX, asset->weapDef->turretOverheatEffect);
asset->weapDef->turretOverheatEffect = NULL;
} }
void IWeapon::writeWeaponDef(Game::WeaponDef* def, Components::ZoneBuilder::Zone* builder, Utils::Stream* buffer) void IWeapon::writeWeaponDef(Game::WeaponDef* def, Components::ZoneBuilder::Zone* builder, Utils::Stream* buffer)
@ -255,8 +248,15 @@ namespace Assets
Utils::Stream::ClearPointer(&dest->notetrackRumbleMapValues); Utils::Stream::ClearPointer(&dest->notetrackRumbleMapValues);
} }
// viewFlashEffect) if (def->viewFlashEffect)
// worldFlashEffect {
dest->viewFlashEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->viewFlashEffect).fx;
}
if (def->worldFlashEffect)
{
dest->worldFlashEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->worldFlashEffect).fx;
}
// This is compressed because I don't want to write the same piece of code 47 times // This is compressed because I don't want to write the same piece of code 47 times
// TODO: verify that this is saving the aliases correctly because the old code looks wrong and this looks right but the old code worked so go figure // TODO: verify that this is saving the aliases correctly because the old code looks wrong and this looks right but the old code worked so go figure
@ -291,10 +291,25 @@ namespace Assets
Utils::Stream::ClearPointer(&dest->bounceSound); Utils::Stream::ClearPointer(&dest->bounceSound);
} }
// viewShellEjectEffect if (def->viewShellEjectEffect)
// worldShellEjectEffect {
// viewShellLastShotEjectEffect dest->viewShellEjectEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->viewShellEjectEffect).fx;
// worldShellLastShotEjectEffect }
if (def->worldShellEjectEffect)
{
dest->worldShellEjectEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->worldShellEjectEffect).fx;
}
if (def->viewLastShotEjectEffect)
{
dest->viewLastShotEjectEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->viewLastShotEjectEffect).fx;
}
if (def->worldLastShotEjectEffect)
{
dest->worldLastShotEjectEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->worldLastShotEjectEffect).fx;
}
if (def->reticleCenter) if (def->reticleCenter)
{ {
@ -406,8 +421,15 @@ namespace Assets
dest->projectileModel = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_XMODEL, def->projectileModel).model; dest->projectileModel = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_XMODEL, def->projectileModel).model;
} }
// projExplosionEffect if (def->projExplosionEffect)
// projDudEffect {
dest->projExplosionEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->projExplosionEffect).fx;
}
if (def->projDudEffect)
{
dest->projDudEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->projDudEffect).fx;
}
if (def->projExplosionSound) if (def->projExplosionSound)
{ {
@ -437,9 +459,20 @@ namespace Assets
Utils::Stream::ClearPointer(&dest->perpendicularBounce); Utils::Stream::ClearPointer(&dest->perpendicularBounce);
} }
// projTrailEffect if (def->projTrailEffect)
// projBeaconEffect {
// projIgnitionEffect dest->projTrailEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->projTrailEffect).fx;
}
if (def->projBeaconEffect)
{
dest->projBeaconEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->projBeaconEffect).fx;
}
if (def->projIgnitionEffect)
{
dest->projIgnitionEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->projIgnitionEffect).fx;
}
if (def->projIgnitionSound) if (def->projIgnitionSound)
{ {
@ -523,7 +556,10 @@ namespace Assets
Utils::Stream::ClearPointer(&dest->turretOverheatSound); Utils::Stream::ClearPointer(&dest->turretOverheatSound);
} }
// turretOverheatEffect if (def->turretOverheatEffect)
{
dest->turretOverheatEffect = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_FX, def->turretOverheatEffect).fx;
}
if (def->turretBarrelSpinRumble) if (def->turretBarrelSpinRumble)
{ {