From e5e164e9b5ac9d7ede98f00ea73353ae902c4d06 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 29 Dec 2016 02:21:45 +0100 Subject: [PATCH] [IGfxImage] Fix non-streamed image loading --- src/Components/Modules/AssetInterfaces/IGfxImage.cpp | 12 +++++++++++- src/Game/Structs.hpp | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Components/Modules/AssetInterfaces/IGfxImage.cpp b/src/Components/Modules/AssetInterfaces/IGfxImage.cpp index df80a01d..e5f41ea6 100644 --- a/src/Components/Modules/AssetInterfaces/IGfxImage.cpp +++ b/src/Components/Modules/AssetInterfaces/IGfxImage.cpp @@ -7,7 +7,7 @@ namespace Assets void IGfxImage::load(Game::XAssetHeader* header, std::string name, Components::ZoneBuilder::Zone* builder) { Game::GfxImage* image = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_IMAGE, name.data()).image; - if (image) return; + if (image && name[0] != '*') return; image = builder->getAllocator()->allocate(); if (!image) @@ -43,6 +43,12 @@ namespace Assets image->dataLen2 = image->dataLen1; image->loadDef = reinterpret_cast(reader.readArray(image->dataLen1 + 16)); + + image->height = image->loadDef->dimensions[0]; + image->width = image->loadDef->dimensions[1]; + image->depth = image->loadDef->dimensions[2]; + + image->loaded = true; } else { @@ -81,6 +87,10 @@ namespace Assets image->loadDef->flags = 0; image->loadDef->levelCount = 0; + image->height = image->loadDef->dimensions[0]; + image->width = image->loadDef->dimensions[1]; + image->depth = image->loadDef->dimensions[2]; + switch (iwiHeader->format) { case Game::IWI_COMPRESSION::IWI_ARGB: diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index 57e37e00..c24f4d4f 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -3003,7 +3003,7 @@ namespace Game struct GfxPackedPlacement { float origin[3]; - PackedUnitVec axis[3]; + vec3_t/*PackedUnitVec*/ axis[3]; float scale; }; @@ -3011,7 +3011,7 @@ namespace Game { GfxPackedPlacement placement; - char pad[24]; + //char pad[24]; XModel *model; // 52 float cullDist;