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;