Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a .wsa file reader #17984

Merged
merged 1 commit into from
Apr 3, 2021
Merged

Added a .wsa file reader #17984

merged 1 commit into from
Apr 3, 2021

Conversation

Mailaender
Copy link
Member

Closes #6781.

@pchote
Copy link
Member

pchote commented Apr 26, 2020

This appears to be a tweaked version of the D2 mod's wsa parser. Do you have @evgeniysergeev's permission to replace the copyright statement with OpenRA's standard header?

@evgeniysergeev
Copy link
Contributor

Is it possible to put it in common or something, because d2 mod will depend on cnc dll, right now it is not depend on it.

@Mailaender
Copy link
Member Author

I think you don't want this for Dune 2. Sadly there is no version field. You will need to keep, but better rename your D2WsaReader. You may want to use parts of my code especially the IsWsa checks as yours was only guessing for large file sizes and maybe using the actual offsets to read the data. It was a requirement to get the cnc variant working. You only need to remove some fields:

  • X and Y
  • flags and the palette

You probably also need to keep the FrameOffsets can be set to 0 exception which I ripped out.

@pchote
Copy link
Member

pchote commented May 6, 2020

Is there any advantage to treating these as paletted sprites? We could parse them straight to RBGA and then treat them similarly to vqa.

@abcdefg30
Copy link
Member

#17984 (comment) is unaddressed.

@Mailaender
Copy link
Member Author

I agree. While this is something in between sprites and movies, it should be handled like we do .vqa movies. That depends on #12775 now which is a rather large refactor I am currently experimenting on.

@Mailaender
Copy link
Member Author

Rebased and rewrote this using my new IVideo API.

penev92
penev92 previously approved these changes Feb 17, 2021
Copy link
Member

@penev92 penev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can verify that the implementation here is in line with the cited sources, as well as being in line with the current VqaLoader/Reader implementation.
Opened all available WSA files for TD and RA in the asset browser and didn't see any obvious issues.
Only thing I admittedly didn't look into is the palette reading segment, but the colors look OK ingame.

Of course my comments on WsaReader also apply to WsaLoader since they share a bunch of code.

OpenRA.Mods.Cnc/FileFormats/WsaReader.cs Show resolved Hide resolved
OpenRA.Mods.Cnc/FileFormats/WsaReader.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Cnc/FileFormats/WsaReader.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Cnc/FileFormats/WsaReader.cs Show resolved Hide resolved
mods/ra/mod.yaml Show resolved Hide resolved
@reaperrr reaperrr merged commit a027371 into OpenRA:bleed Apr 3, 2021
@Mailaender Mailaender deleted the wsa branch April 3, 2021 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WSA file format support
6 participants