Git Product home page Git Product logo

bsa's People

Contributors

guekka avatar ryan-rsm-mckenzie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bsa's Issues

Textures are not written correctly

I am able to reproduce this bug with this simple code

#include <bsa/fo4.hpp>

int main()
{
    using namespace bsa::fo4;
    file f;
    f.read("textures/in.dds", format::directx);
    f.write("textures/out.dds", format::directx);
}

This corrupts all tested textures. : Example

By looking at it in a hex editor, the header appears to be fine. The corruption starts at the end of the header, as soon as we enter the data section

The issue appears to be in write . Creating a textures BSA, and extracting it with another tool seems to work

`file::write` accesses null pointer when default constructed

This is due to how byte_container is defined. By default, it creates an empty span

std::variant<
std::span<const std::byte>,
std::vector<std::byte>,
data_proxy>
_data;

Obviously, std::data of this empty span will return nullptr.

By making data_owner the first alternative, we could avoid this issue. Or maybe default construction should be a span to a static empty vector, for performance?

If this is by design, I suggest adding an assertion to make debugging easier.

RFC regarding breaking API changes needed to implement Starfield support.

With the introduction of the v2 and v3 variants of the .ba2 format in Starfield, the archive format is no longer sufficient to discriminate between data format variants. Most functions now also require a compression_format to handle compression properly, which means that configuring inputs to functions has become overly obnoxious. As a result, I have taken the liberty to convert many functions to take some form of *_param. This offers users the flexibility to override only the fields they need, while leaving others untouched by leveraging designated initializers. Unfortunately, this has the undesired side effect of being the largest API break this library has had thus far. This issue stands as a forum for users to provide feedback on the new API changes: whether they like them/don't like them/think they could be better/etc.

For reference, the .ba2 format is described in detail here.

created fo4dds ba2s are invalid

I am currently investigating, but haven't found anything yet

Reproducing:

  • Create a fo4dds archive
  • Open in archive2
  • Delete a single file
  • Try to save the archive
  • Lots of errors will appear about "unsupported file type"

Recap of what I found so far:

  • BitsPerPixel should be always 8.
  • Flags should be 0 or 1 if the texture is a cubemap
  • It looks like archive2 does not produce the same archive header as rsm-bsa. I linked an example below. bsarch is correct, so studying its code may help. The first difference is the string table offset

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.