CScanCooking: Make use of unsigned stream helpers
This commit is contained in:
parent
61ec2f2e08
commit
125da2d930
|
@ -12,7 +12,7 @@ bool CScanCooker::CookSCAN(CScan* pScan, IOutputStream& SCAN)
|
||||||
SCAN.WriteLong(5); // Version number; must be 5
|
SCAN.WriteLong(5); // Version number; must be 5
|
||||||
SCAN.WriteLong(0x0BADBEEF); // SCAN magic
|
SCAN.WriteLong(0x0BADBEEF); // SCAN magic
|
||||||
|
|
||||||
CStructRef ScanProperties = pScan->ScanData();
|
const CStructRef ScanProperties = pScan->ScanData();
|
||||||
CScriptCooker Cooker(pScan->Game());
|
CScriptCooker Cooker(pScan->Game());
|
||||||
Cooker.WriteProperty(SCAN, ScanProperties.Property(), ScanProperties.DataPointer(), true);
|
Cooker.WriteProperty(SCAN, ScanProperties.Property(), ScanProperties.DataPointer(), true);
|
||||||
}
|
}
|
||||||
|
@ -26,19 +26,19 @@ bool CScanCooker::CookSCAN(CScan* pScan, IOutputStream& SCAN)
|
||||||
// Scans in MP2/3 are saved with the script object data format
|
// Scans in MP2/3 are saved with the script object data format
|
||||||
// Write a dummy script object header here
|
// Write a dummy script object header here
|
||||||
SCAN.WriteLong( FOURCC('SNFO') ); // ScannableObjectInfo object ID
|
SCAN.WriteLong( FOURCC('SNFO') ); // ScannableObjectInfo object ID
|
||||||
uint ScanInstanceSizeOffset = SCAN.Tell();
|
const uint32 ScanInstanceSizeOffset = SCAN.Tell();
|
||||||
SCAN.WriteShort(0); // Object size
|
SCAN.WriteShort(0); // Object size
|
||||||
SCAN.WriteLong(0); // Instance ID
|
SCAN.WriteLong(0); // Instance ID
|
||||||
SCAN.WriteShort(0); // Link count
|
SCAN.WriteShort(0); // Link count
|
||||||
|
|
||||||
CStructRef ScanProperties = pScan->ScanData();
|
const CStructRef ScanProperties = pScan->ScanData();
|
||||||
CScriptCooker Cooker(pScan->Game());
|
CScriptCooker Cooker(pScan->Game());
|
||||||
Cooker.WriteProperty(SCAN, ScanProperties.Property(), ScanProperties.DataPointer(), false);
|
Cooker.WriteProperty(SCAN, ScanProperties.Property(), ScanProperties.DataPointer(), false);
|
||||||
|
|
||||||
uint ScanInstanceEnd = SCAN.Tell();
|
const uint32 ScanInstanceEnd = SCAN.Tell();
|
||||||
uint ScanInstanceSize = ScanInstanceEnd - ScanInstanceSizeOffset - 2;
|
const uint32 ScanInstanceSize = ScanInstanceEnd - ScanInstanceSizeOffset - 2;
|
||||||
SCAN.GoTo(ScanInstanceSizeOffset);
|
SCAN.GoTo(ScanInstanceSizeOffset);
|
||||||
SCAN.WriteShort( (uint16) ScanInstanceSize );
|
SCAN.WriteUShort(static_cast<uint16>(ScanInstanceSize));
|
||||||
SCAN.GoTo(ScanInstanceEnd);
|
SCAN.GoTo(ScanInstanceEnd);
|
||||||
|
|
||||||
// Write dependency list
|
// Write dependency list
|
||||||
|
@ -47,7 +47,7 @@ bool CScanCooker::CookSCAN(CScan* pScan, IOutputStream& SCAN)
|
||||||
std::vector<CAssetID> Dependencies;
|
std::vector<CAssetID> Dependencies;
|
||||||
CAssetDependencyListBuilder Builder(pScan->Entry());
|
CAssetDependencyListBuilder Builder(pScan->Entry());
|
||||||
Builder.BuildDependencyList(Dependencies);
|
Builder.BuildDependencyList(Dependencies);
|
||||||
SCAN.WriteLong(Dependencies.size());
|
SCAN.WriteULong(static_cast<uint32>(Dependencies.size()));
|
||||||
|
|
||||||
for (const CAssetID& kID : Dependencies)
|
for (const CAssetID& kID : Dependencies)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue