scp-fs2open / PCS2

A tool to convert and edit models for use in FreeSpace 2 and FreeSpace Open
3 stars 11 forks source link

POF version 2118 Support #16

Open Shivansps opened 4 years ago

Shivansps commented 4 years ago

Due to everything that has been discussed here https://www.hard-light.net/forums/index.php?topic=96055.0 and on issue#15 https://github.com/scp-fs2open/PCS2/issues/15 bumping the POF version to 2118 and create the "SLC2" chunk type in replacement of SLDC was the solution to pof alignment problems.

POF version 2118 must have all POF Chunk types aligned, this means, all chunks with a string on them (FUEL, GLOW, SPCL, TXTR, DOCK, PATH, SLDC, OBJ2) must have the proper space padding, and if the string is empty it must have 4 null terminators.

POF version 2118 also has a new chunk type, "SLC2", SLC2 is a revised version of the SLDC chunk, that changes the type of node char for a type of node int.

SLC2

uint tree_size for each node, n { int type // 0 = SPLIT, 1 = LEAF/polylist uint size if !type { // SPLIT vector bound_min vector bound_max uint front_offset uint back_offset } else { // LEAF vector bound_min vector bound_max uint num_polygons for each polygon, p { uint polygon_addr // indexed into shield mesh face list? } } }

It is just a clone of the SLDC chunk but with ints.

For compatibility, Pof 2118 must have both the SLDC and SLC2 chunks. No data has to be stripped away.