Update OSFFile.cs

This commit is contained in:
Tiago Conceição
2022-08-23 20:49:57 +01:00
parent f99d50772a
commit 0206ce3f70
+17 -20
View File
@@ -121,39 +121,36 @@ struct HEADER {
}
} header;
struct LAYER_DEF {
ushort Mark <fgcolor=cBlack, bgcolor=cYellow>; // (OD OA begins, indicating that the model + support is included; the beginning of 0D 0B, indicating that the layer only has support data)
uint NumberOfPixels <fgcolor=cBlack, bgcolor=cYellow>;
ushort StartY <fgcolor=cBlack, bgcolor=cYellow>;
local long currentPos = FTell();
local long rleSize = 0;
while(!FEof())
{
if(ReadByte() == 0x0D && (ReadByte(FTell()+1) == 0x0A || ReadByte(FTell()+1) == 0x0B))
{
break;
}
rleSize++;
FSkip(1);
}
FSeek(currentPos);
ubyte RLE[rleSize] <fgcolor=cBlack, bgcolor=cWhite>;
};
typedef struct(int size) {
ubyte layerDataBlock[size] <fgcolor=cBlack, bgcolor=cWhite>;
} LAYER_RLE;
FSeek(header.HeaderLength);
struct LAYERS {
local int i = 0;
local long currentPos = 0;
local long rleSize = 0;
for( i = 0; i < header.LayerCount; i++ ){
LAYER_DEF layerDef <fgcolor=cBlack, bgcolor=cYellow>;
currentPos = FTell();
rleSize = 0;
while(!FEof())
{
if(ReadByte() == 0x0D && (ReadByte(FTell()+1) == 0x0A || ReadByte(FTell()+1) == 0x0B))
{
break;
}
rleSize++;
FSkip(1);
}
FSeek(currentPos);
LAYER_RLE layerRLE(rleSize);
}
}
} layers;