From 0206ce3f70f406776bce30a279ce451ac37e81a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Tue, 23 Aug 2022 20:49:57 +0100 Subject: [PATCH] Update OSFFile.cs --- Scripts/010 Editor/osf.bt | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/Scripts/010 Editor/osf.bt b/Scripts/010 Editor/osf.bt index 1904fcc..3886887 100644 --- a/Scripts/010 Editor/osf.bt +++ b/Scripts/010 Editor/osf.bt @@ -121,39 +121,36 @@ struct HEADER { } } header; - struct LAYER_DEF { ushort Mark ; // (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 ; ushort StartY ; + + 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] ; }; -typedef struct(int size) { - ubyte layerDataBlock[size] ; -} 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 ; - 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;