mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
Update OSFFile.cs
This commit is contained in:
+17
-20
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user