Quick fixup to allow IW4OF to handle CODO structs (ultimately some of those fixes should be moved to Zones.cpp)

This commit is contained in:
Louvenarde 2023-08-19 18:12:41 +02:00
parent 395e531d8d
commit fe4ea0156f
2 changed files with 46 additions and 1 deletions

View File

@ -1267,8 +1267,36 @@ namespace Components
if (!ZoneBuilder::DumpingZone.empty()) if (!ZoneBuilder::DumpingZone.empty())
{ {
Utils::Memory::Allocator assetReallocator{}; // Needed to translate some assets from CODO for instance
// IW4OF only supports gameworldMP for now, fortunately the types are very similar
if (type == Game::XAssetType::ASSET_TYPE_GAMEWORLD_SP && asset.gameWorldSp)
{
type = Game::XAssetType::ASSET_TYPE_GAMEWORLD_MP;
auto* newWorldMp = assetReallocator.allocate<Game::GameWorldMp>();
newWorldMp->name = asset.gameWorldSp->name;
newWorldMp->g_glassData = asset.gameWorldSp->g_glassData;
asset.gameWorldMp = newWorldMp;
}
if (ExporterAPI.is_type_supported(type) && name[0] != ',') if (ExporterAPI.is_type_supported(type) && name[0] != ',')
{ {
if (type == Game::XAssetType::ASSET_TYPE_IMAGE)
{
if (asset.image->category == Game::ImageCategory::IMG_CATEGORY_UNKNOWN)
{
asset.image->category = Game::ImageCategory::IMG_CATEGORY_LOAD_FROM_FILE;
}
}
if (type == Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET && asset.techniqueSet)
{
// fix for garbage PTRs hanging out in iw4 memory
asset.techniqueSet->remappedTechniqueSet = nullptr;
}
ExporterAPI.write(type, asset.data); ExporterAPI.write(type, asset.data);
Components::Logger::Print("."); Components::Logger::Print(".");
} }

View File

@ -2766,6 +2766,23 @@ namespace Game
int max_stream_channels; int max_stream_channels;
}; };
struct SndStartAliasInfo
{
snd_alias_t* alias0;
snd_alias_t* alias1;
float lerp;
SndEntHandle sndEnt;
float org[3];
float volume;
float pitch;
int timeshift;
float fraction;
int startDelay;
bool master;
float timescaleLerp;
snd_alias_system_t system;
};
struct Poly struct Poly
{ {
float(*pts)[3]; float(*pts)[3];
@ -10994,7 +11011,7 @@ namespace Game
volatile int firstFreeSparkFountain; volatile int firstFreeSparkFountain;
volatile int firstFreeSparkFountainCluster; volatile int firstFreeSparkFountainCluster;
volatile int deferredElemCount; volatile int deferredElemCount;
volatile int activeElemCount; int activeElemCount;
volatile int activeTrailElemCount; volatile int activeTrailElemCount;
volatile int activeTrailCount; volatile int activeTrailCount;
volatile int activeBoltCount; volatile int activeBoltCount;