This commit is contained in:
momo5502 2016-05-16 17:17:25 +02:00
parent f637670e52
commit 18f4bb0a44
5 changed files with 15 additions and 10 deletions

View File

@ -62,14 +62,13 @@ namespace Assets
{ {
if (builder->HasPointer(technique)) if (builder->HasPointer(technique))
{ {
OutputDebugStringA(asset->name);
dest->techniques[i] = builder->GetPointer(technique); dest->techniques[i] = builder->GetPointer(technique);
} }
else else
{ {
// Size-check is obsolete, as the structure is dynamic // Size-check is obsolete, as the structure is dynamic
buffer->Align(Utils::Stream::ALIGN_4); buffer->Align(Utils::Stream::ALIGN_4);
//builder->StorePointer(technique); builder->StorePointer(technique);
Game::MaterialTechnique* destTechnique = buffer->Dest<Game::MaterialTechnique>(); Game::MaterialTechnique* destTechnique = buffer->Dest<Game::MaterialTechnique>();
buffer->Save(technique, 8); buffer->Save(technique, 8);

View File

@ -145,11 +145,16 @@ namespace Assets
{ {
if (asset->lods[i].surfaces) if (asset->lods[i].surfaces)
{ {
// Requiring this asset is not possible, as it has to be loaded as part of the model buffer->PushBlock(Game::XFILE_BLOCK_TEMP);
buffer->Align(Utils::Stream::ALIGN_4);
// Requiring this asset is not possible, it has to be loaded as part of the model
//dest->lods[i].surfaces = builder->RequireAsset(Game::XAssetType::ASSET_TYPE_XMODELSURFS, asset->lods[i].surfaces->name).surfaces; //dest->lods[i].surfaces = builder->RequireAsset(Game::XAssetType::ASSET_TYPE_XMODELSURFS, asset->lods[i].surfaces->name).surfaces;
IXModelSurfs().Save({ asset->lods[i].surfaces }, builder); IXModelSurfs().Save({ asset->lods[i].surfaces }, builder);
dest->lods[i].surfaces = reinterpret_cast<Game::XModelSurfs*>(-1); dest->lods[i].surfaces = reinterpret_cast<Game::XModelSurfs*>(-1);
buffer->PopBlock();
} }
} }
} }

View File

@ -33,7 +33,6 @@ namespace Assets
if (surf->blendInfo) if (surf->blendInfo)
{ {
buffer->Align(Utils::Stream::ALIGN_2); buffer->Align(Utils::Stream::ALIGN_2);
buffer->Save(surf->blendInfo, sizeof(short), surf->blendNum1 + (surf->blendNum2 * 3) + (surf->blendNum3 * 5) + (surf->blendNum4 * 7)); buffer->Save(surf->blendInfo, sizeof(short), surf->blendNum1 + (surf->blendNum2 * 3) + (surf->blendNum3 * 5) + (surf->blendNum4 * 7));
destSurf->blendInfo = reinterpret_cast<char*>(-1); destSurf->blendInfo = reinterpret_cast<char*>(-1);
} }

View File

@ -1318,9 +1318,11 @@ namespace Game
struct XModelLodInfo struct XModelLodInfo
{ {
char pad[8]; char pad[4]; // +0
XModelSurfs* surfaces; short numSurfs; // +4
char pad2[32]; short pad2;// +6
XModelSurfs* surfaces; // +8
char pad3[32]; // +12
}; };
struct cplane_t struct cplane_t

View File

@ -41,7 +41,7 @@ namespace Utils
{ {
//if (stream == XFILE_BLOCK_TEMP || stream == XFILE_BLOCK_VIRTUAL || stream == XFILE_BLOCK_PHYSICAL) // Only those seem to actually write data. //if (stream == XFILE_BLOCK_TEMP || stream == XFILE_BLOCK_VIRTUAL || stream == XFILE_BLOCK_PHYSICAL) // Only those seem to actually write data.
// As I'm not sure though, I'll still write the data // As I'm not sure though, I'll still write the data
// Use IncreaseStreamSize to fill virtual streams // Use IncreaseBlockSize to fill virtual streams
auto data = Stream::Data(); auto data = Stream::Data();
if (Stream::IsCriticalSection() && Stream::Length() + (size * count) > Stream::Capacity()) if (Stream::IsCriticalSection() && Stream::Length() + (size * count) > Stream::Capacity())
@ -58,7 +58,7 @@ namespace Utils
__debugbreak(); __debugbreak();
} }
Stream::IncreaseBlockSize(stream, size * count); // stay up to date on those streams Stream::IncreaseBlockSize(stream, size * count);
return Stream::At() - (size * count); return Stream::At() - (size * count);
} }
@ -177,7 +177,7 @@ namespace Utils
{ {
if (!Stream::StreamStack.empty()) if (!Stream::StreamStack.empty())
{ {
return Stream::StreamStack[Stream::StreamStack.size() - 1]; return Stream::StreamStack.back();
} }
return Game::XFILE_BLOCK_INVALID; return Game::XFILE_BLOCK_INVALID;