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

Add sprite loaders for C&C Remastered Collection #18543

Merged
merged 2 commits into from
Jan 16, 2021

Conversation

pchote
Copy link
Member

@pchote pchote commented Aug 19, 2020

This PR adds sprite loaders for object (unit/structure/vfx/etc) and terrain artwork.

Object artwork is packaged as a zip file containing tga images and json metadata.
Terrain artwork is loose dds files that will need additional tileset support before a mod can use them. As noted in the code, this is intended as a first implementation of DDS that I expect we will eventually rewrite to keep the texture data compressed all the way through to the GPU.

This is best tested by combining with #18443 and then modifying TD's mod.yaml to add /path/to/TEXTURES_TD_SRGB.MEG in the Packages list; ShpRemastered, Dds to the SpriteFormats list and .ZIP, .DDS to the AssetBrowser SupportedExtensions list. The sprites can then be viewed in the asset browser.

@pchote pchote force-pushed the remaster-spriteloaders branch 2 times, most recently from 2aeefba to c45697f Compare August 19, 2020 17:53
@pchote
Copy link
Member Author

pchote commented Aug 22, 2020

Note to self: look into https://www.nuget.org/packages/pfim as an option to offload my (too?) minimal tga and dds parsing.

@pchote
Copy link
Member Author

pchote commented Aug 22, 2020

Note to self: SRGB != RGB. Before we start actually using these ingame, SpriteFrameType and SheetBuilder should gain a way to track SRGB data so that the texture can be uploaded with internalformat GL_SRGB8_ALPHA8.

@pchote
Copy link
Member Author

pchote commented Aug 22, 2020

There are a few misc unpackaged TGA images that we need to load, so I will need to refactor out a separate TgaLoader.

@pchote pchote force-pushed the remaster-spriteloaders branch 2 times, most recently from cb5277f to cc5c506 Compare October 8, 2020 21:30
@pchote
Copy link
Member Author

pchote commented Oct 8, 2020

Updated:

  • Rewritten using Pfim for file parsing
  • Added TgaLoader
  • Moved TgaLoader DdsLoader to Mods.Common
  • Changed ShpRemasteredLoader to reuse the new TGA code instead of duplicating it

This should now be significantly easier to understand and review.

@abcdefg30
Copy link
Member

Isn't putting those in Mods.Common running contrary to #12775?

@MustaphaTR
Copy link
Member

MustaphaTR commented Oct 9, 2020

Isn't putting those in Mods.Common running contrary to #12775?

Neither .tga or .dds are Westwood formats.

@pchote
Copy link
Member Author

pchote commented Oct 9, 2020

Indeed, both are widely used formats in games so I felt it more appropriate to put these in Common, and the remaster-specific wrapper in Mods.Cnc.

@abcdefg30
Copy link
Member

Neither .tga or .dds are Westwood formats.

The larger idea was to move specific formats out of common, but if they are more widely used it's ok I guess.

@pchote pchote force-pushed the remaster-spriteloaders branch 2 times, most recently from 5e92780 to 1fcfcc1 Compare December 14, 2020 20:42
@pchote
Copy link
Member Author

pchote commented Dec 14, 2020

Rebased.

@pchote
Copy link
Member Author

pchote commented Dec 19, 2020

Updated to use the plumbing from #18938.

@pchote
Copy link
Member Author

pchote commented Dec 25, 2020

Rebased.

teinarss
teinarss previously approved these changes Jan 1, 2021
@reaperrr
Copy link
Contributor

reaperrr commented Jan 11, 2021

The larger idea was to move specific formats out of common, but if they are more widely used it's ok I guess.

The idea on my end was mostly about moving support of proprietary formats out of Mods.Common, so any future commercial projects using OpenRA's engine don't have to rip anything out of Common for legal safety and just need to drop the Westwood/EA-specific dlls.
I know we made an exception for ShpTS so far, since it uses non-proprietary RLZero compression and we didn't have any good alternatives at that point. Once this PR is in, it might be time now to move that as well (in its own PR).

@reaperrr
Copy link
Contributor

Code looks good as far as I'm able to judge it, but not tested yet.
Needs a rebase, though.

@pchote
Copy link
Member Author

pchote commented Jan 11, 2021

Rebased.

@reaperrr reaperrr merged commit f51603e into OpenRA:bleed Jan 16, 2021
@pchote pchote deleted the remaster-spriteloaders branch April 8, 2021 21:15
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.

None yet

5 participants