2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-29 07:47:48 +00:00

refactor: fix x64 compilation for ObjLoading

This commit is contained in:
Jan
2025-04-26 10:11:28 +01:00
committed by Jan Laupetin
parent ee4301952a
commit 5d0c94e430
34 changed files with 212 additions and 212 deletions

View File

@@ -83,7 +83,7 @@ namespace
menu::MenuAssetZoneState& zoneState,
MenuConversionZoneState& conversionState,
std::vector<menuDef_t*>& menus,
AssetRegistration<AssetMenuList>& registration)
AssetRegistration<AssetMenuList>& registration) const
{
const auto alreadyLoadedMenuFile = conversionState.m_menus_by_filename.find(menuFilePath);
if (alreadyLoadedMenuFile != conversionState.m_menus_by_filename.end())
@@ -125,14 +125,14 @@ namespace
menu::MenuAssetZoneState& zoneState,
MenuConversionZoneState& conversionState,
std::vector<menuDef_t*>& menus,
AssetRegistration<AssetMenuList>& registration)
AssetRegistration<AssetMenuList>& registration) const
{
const auto menuCount = parsingResult.m_menus.size();
const auto functionCount = parsingResult.m_functions.size();
const auto menuLoadCount = parsingResult.m_menus_to_load.size();
auto totalItemCount = 0u;
for (const auto& menu : parsingResult.m_menus)
totalItemCount += menu->m_items.size();
totalItemCount += static_cast<unsigned>(menu->m_items.size());
std::cout << std::format("Successfully read menu file \"{}\" ({} loads, {} menus, {} functions, {} items)\n",
fileName,
@@ -152,7 +152,7 @@ namespace
// Convert all menus and add them as assets
for (auto& commonMenu : parsingResult.m_menus)
{
auto converter = IMenuConverter::Create(ObjLoading::Configuration.MenuNoOptimization, m_search_path, m_memory, context);
const auto converter = IMenuConverter::Create(ObjLoading::Configuration.MenuNoOptimization, m_search_path, m_memory, context);
auto* menuAsset = m_memory.Alloc<menuDef_t>();
AssetRegistration<AssetMenu> menuRegistration(commonMenu->m_name, menuAsset);
@@ -182,7 +182,7 @@ namespace
return true;
}
void CreateMenuListAsset(MenuList& menuList, const std::vector<menuDef_t*>& menus)
void CreateMenuListAsset(MenuList& menuList, const std::vector<menuDef_t*>& menus) const
{
menuList.menuCount = static_cast<int>(menus.size());
@@ -196,7 +196,8 @@ namespace
menuList.menus = nullptr;
}
std::unique_ptr<menu::ParsingResult> ParseMenuFile(std::istream& stream, const std::string& menuFileName, const menu::MenuAssetZoneState& zoneState)
std::unique_ptr<menu::ParsingResult>
ParseMenuFile(std::istream& stream, const std::string& menuFileName, const menu::MenuAssetZoneState& zoneState) const
{
menu::MenuFileReader reader(stream, menuFileName, menu::FeatureLevel::IW5, m_search_path);

View File

@@ -44,7 +44,7 @@ namespace
zs.zfree = Z_NULL;
zs.opaque = Z_NULL;
zs.avail_in = static_cast<uInt>(file.m_length);
zs.avail_out = compressionBufferSize;
zs.avail_out = static_cast<unsigned>(compressionBufferSize);
zs.next_in = reinterpret_cast<const Bytef*>(uncompressedBuffer.get());
zs.next_out = reinterpret_cast<Bytef*>(compressedBuffer);

View File

@@ -57,7 +57,7 @@ namespace
return AssetCreationResult::Failure();
}
if (offset + (scriptFile->compressedLen + scriptFile->bytecodeLen) > file.m_length)
if (offset + static_cast<size_t>(scriptFile->compressedLen + scriptFile->bytecodeLen) > static_cast<size_t>(file.m_length))
{
std::cerr << std::format("Error: Specified length in {} GSC BIN structure exceeds the actual file size\n", assetName);
return AssetCreationResult::Failure();

View File

@@ -232,7 +232,7 @@ namespace
}
m_weapon.weapCompleteDef.animOverrides = animOverrides;
m_weapon.weapCompleteDef.numAnimOverrides = valueArray.size();
m_weapon.weapCompleteDef.numAnimOverrides = static_cast<unsigned>(valueArray.size());
return true;
}
@@ -267,7 +267,7 @@ namespace
}
m_weapon.weapCompleteDef.soundOverrides = soundOverrides;
m_weapon.weapCompleteDef.numSoundOverrides = valueArray.size();
m_weapon.weapCompleteDef.numSoundOverrides = static_cast<unsigned>(valueArray.size());
return true;
}
@@ -305,7 +305,7 @@ namespace
}
m_weapon.weapCompleteDef.fxOverrides = fxOverrides;
m_weapon.weapCompleteDef.numFxOverrides = valueArray.size();
m_weapon.weapCompleteDef.numFxOverrides = static_cast<unsigned>(valueArray.size());
return true;
}
@@ -339,7 +339,7 @@ namespace
}
m_weapon.weapCompleteDef.reloadOverrides = reloadOverrides;
m_weapon.weapCompleteDef.numReloadStateTimerOverrides = valueArray.size();
m_weapon.weapCompleteDef.numReloadStateTimerOverrides = static_cast<unsigned>(valueArray.size());
return true;
}
@@ -392,7 +392,7 @@ namespace
m_weapon.weapCompleteDef.notetrackOverrides = m_memory.Alloc<NoteTrackToSoundEntry>(overrideVector.size());
memcpy(m_weapon.weapCompleteDef.notetrackOverrides, overrideVector.data(), sizeof(NoteTrackToSoundEntry) * overrideVector.size());
m_weapon.weapCompleteDef.numNotetrackOverrides = overrideVector.size();
m_weapon.weapCompleteDef.numNotetrackOverrides = static_cast<unsigned>(overrideVector.size());
return true;
}
@@ -437,7 +437,7 @@ namespace
return false;
}
void ParseAnim(const std::string& value, const char*& animName)
void ParseAnim(const std::string& value, const char*& animName) const
{
if (value == "none")
{
@@ -449,7 +449,7 @@ namespace
m_registration.AddIndirectAssetReference(m_context.LoadIndirectAssetReference<AssetXAnim>(value));
}
void ParseSoundAlias(const std::string& value, SndAliasCustom& soundAlias)
void ParseSoundAlias(const std::string& value, SndAliasCustom& soundAlias) const
{
if (value == "none")
{
@@ -462,7 +462,7 @@ namespace
m_registration.AddIndirectAssetReference(m_context.LoadIndirectAssetReference<AssetSound>(value));
}
bool ParseFxEffectDef(const std::string& value, FxEffectDef*& fx)
bool ParseFxEffectDef(const std::string& value, FxEffectDef*& fx) const
{
if (value == "none")
{
@@ -542,7 +542,7 @@ namespace
return true;
}
void ParseScriptString(const std::string& value, ScriptString& out)
void ParseScriptString(const std::string& value, ScriptString& out) const
{
out = m_zone_script_strings.AddOrGetScriptString(value);
m_registration.AddScriptString(out);
@@ -863,7 +863,7 @@ InfoStringLoaderWeapon::InfoStringLoaderWeapon(MemoryManager& memory, ISearchPat
{
}
AssetCreationResult InfoStringLoaderWeapon::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
AssetCreationResult InfoStringLoaderWeapon::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) const
{
auto* weaponFullDef = m_memory.Alloc<WeaponFullDef>();

View File

@@ -11,7 +11,7 @@ namespace IW5
public:
InfoStringLoaderWeapon(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) const;
private:
MemoryManager& m_memory;