mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2024-11-17 15:20:17 +01:00
partman: improved bad zMap skip.
This commit is contained in:
parent
37198f1b99
commit
95007c9253
1 changed files with 4 additions and 2 deletions
|
@ -92,16 +92,18 @@ DatFile* partman::load_records(LPCSTR lpFileName, bool fullTiltMode)
|
|||
fread(&zMapHeader, 1, sizeof(dat16BitBmpHeader), fileHandle);
|
||||
auto length = fieldSize - sizeof(dat16BitBmpHeader);
|
||||
|
||||
auto zMap = new zmap_header_type(zMapHeader.Width, zMapHeader.Height, zMapHeader.Stride);
|
||||
zMap->Resolution = zMapResolution;
|
||||
zmap_header_type* zMap;
|
||||
if (zMapHeader.Stride * zMapHeader.Height * 2u == length)
|
||||
{
|
||||
zMap = new zmap_header_type(zMapHeader.Width, zMapHeader.Height, zMapHeader.Stride);
|
||||
zMap->Resolution = zMapResolution;
|
||||
fread(zMap->ZPtr1, 1, length, fileHandle);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 3DPB .dat has zeroed zMap headers, in groups 497 and 498, skip them.
|
||||
fseek(fileHandle, static_cast<int>(length), SEEK_CUR);
|
||||
zMap = new zmap_header_type(0, 0, 0);
|
||||
}
|
||||
entryData->Buffer = reinterpret_cast<char*>(zMap);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue