mirror of
https://github.com/dpethes/rerogue.git
synced 2025-06-07 18:58:32 +02:00
fix some datatype mismatches in parsers to run properly in debug mode
This commit is contained in:
parent
252d93702a
commit
de4de4db13
@ -125,14 +125,6 @@
|
||||
</Checks>
|
||||
<VerifyObjMethodCallValidity Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
<UseHeaptrc Value="True"/>
|
||||
<TrashVariables Value="True"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="2">
|
||||
|
@ -58,7 +58,7 @@ var
|
||||
image: TRSImage;
|
||||
buf: array[0..27] of byte;
|
||||
description: TImageDescription;
|
||||
color_rgba: integer;
|
||||
color_rgba: longword;
|
||||
pos: int64;
|
||||
u0, u1, bits_per_sample: byte;
|
||||
begin
|
||||
@ -73,7 +73,7 @@ begin
|
||||
bits_per_sample := f.ReadByte;
|
||||
image.type_ := f.ReadByte;
|
||||
u1 := f.ReadByte;
|
||||
color_rgba := f.ReadDWord;
|
||||
color_rgba := f.ReadDWord; //unused?
|
||||
|
||||
pos := f.Position;
|
||||
f.Seek(tex.name_offset, TSeekOrigin.soBeginning);
|
||||
@ -85,9 +85,16 @@ begin
|
||||
image.sampleBits := description.sample_bits;
|
||||
image.paletteEntries := description.palette_entries;
|
||||
image.width := tex.width;
|
||||
//if (image.width and 1) > 1 then image.width += 1;
|
||||
image.height := tex.height;
|
||||
|
||||
//fix stride in some images?
|
||||
//if (image.width and 1) > 1 then image.width += 1;
|
||||
//if (image.type_ = 4) and (image.sampleBits = 4) then
|
||||
// if (image.width and 1) = 1 then begin
|
||||
// image.width += 1;
|
||||
// writeln('fix width');
|
||||
// end;
|
||||
|
||||
writeln('name: ', tex.name_string);
|
||||
writeln('size: ', tex.width, 'x', tex.height);
|
||||
writeln('subtype: ', image.type_);
|
||||
|
@ -8,7 +8,7 @@ uses
|
||||
|
||||
type
|
||||
TRGBA = record
|
||||
color: integer;
|
||||
color: longword;
|
||||
end;
|
||||
|
||||
TTexCoord = record
|
||||
@ -95,7 +95,7 @@ var
|
||||
face: THobFace;
|
||||
zero: integer;
|
||||
file_pos: integer;
|
||||
color: integer;
|
||||
color: longword;
|
||||
begin
|
||||
zero := f.ReadQWord;
|
||||
if (zero <> 0) then
|
||||
@ -152,8 +152,8 @@ begin
|
||||
//uv coords
|
||||
if face.flags and FACE_UV > 0 then begin
|
||||
for k := 0 to face.ftype - 1 do begin
|
||||
face.tex_coords[k].u := f.ReadWord;
|
||||
face.tex_coords[k].v := f.ReadWord;
|
||||
face.tex_coords[k].u := smallint(f.ReadWord);
|
||||
face.tex_coords[k].v := smallint(f.ReadWord);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user