Giter VIP home page Giter VIP logo

Comments (2)

Goober5000 avatar Goober5000 commented on August 15, 2024

Thread for context:
https://www.hard-light.net/forums/index.php?topic=96055.0

Here's the section of the readme:

- If you save a POF in the editor that you just extracted from the original
  FreeSpace 1/2 .VP files, the file will be a bit smaller than the original
  file, even though nothing changed. This is not a bug, there is no
  information lost. However the original Volition editors wasted some bytes
  containing nothing but null or CRLF bytes at the end of strings, which are
  however totally useless. MODELVIEW in contrast cuts strings to their actual
  content.

from pcs2.

Shivansps avatar Shivansps commented on August 15, 2024

After looking into this issue myself i have the guidelines to properly align the data:

  1. All chunks offsets no matter what must be divisible by 4.
  2. All strings lenght must be divisible by 4, this means every chunk with a string the lenght must be adjusted so it is divisible and fill the extra characters with a null terminator
  3. If a string is empty, for example "properties" on OBJ2 chunk the length must be 4, not 0, and the string must cointain 4 nulls terminators.
  4. Defpoints is the only chunk on bsp_data that has a chance to be unaligned, it is important to ensure the defpoints chunk size is divisible by 4, and the vertex data offset inside is also divisible by 4.
  5. Nothing can be done about the SLDC chunk, the system is unaligned by design, so only adjust the size if needed so the next chunk after it is aligned.

from pcs2.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.