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

Bitmap Decoding #21

Open
Gravemind2401 opened this issue Jul 1, 2020 · 2 comments
Open

Bitmap Decoding #21

Gravemind2401 opened this issue Jul 1, 2020 · 2 comments

Comments

@Gravemind2401
Copy link

I noticed some of the bitmap decoding for this is using super old Adjutant code (even including my comment at the top) and it has some todo comments to do some refactoring.
I have since rewritten all of the decode functions and added more in my System.Drawing.Dds repo. If it may be of any use to you, check the DdsConvert.cs file for better structured decode methods (I believe the old ones are endian-swapped compared to these).

@Beatthezombie
Copy link
Member

We also did some major refactors to this a few months ago. The main problem we had was that most bitmaps are tiled and have packed mipmap tails. The Xbox 360 xdk documentation was quite helpful. Indeed I had to endianswapp all the decoding functions, but most of the conversion code X360 -> PC doesn't require decode anymore. I suggest looking at the Bitmaps folder (BitmapConverter and XboxGraphics) and Direct3D/Xbox360 folder. We tested all bitmaps from Halo3/ODST and as far as I know, we can convert all of them flawlessly (except a few edge cases where mipmaps are not available). Halo Reach should use the exact same system but we haven't tested it thoroughly.

I added a CTX1-> DXN internal converter, feel free to use that in Adjutant. I also suggest to look at the dev branch of TagTool to get the latest information, the master branch is rarely updated because most features are still in dev. If you are ever interested in contributing to TagTool we are always looking for more contributors.

@Gravemind2401
Copy link
Author

Gravemind2401 commented Jul 3, 2020

I've had a look through the dev repo and it looks like all the areas I know about have already been covered pretty thoroughly, nice work! Other than that, one area I may be able to contribute is a UI, see the releases in my Reclaimer repo (see below) for an example of UI I could do.
I've added you to my most recent repos which are a lot more up to date and far better structured than the old Adjutant code, you can have a look and see if anything there is useful to you.
Regarding the bitmaps, as far as I can tell it looks like you only use the decode to convert from Xbox specific to DXGI then everything is saved as DDS. The DDS code I mentioned before may be useful if you want to support saving as PNG/TIFF as it has a number of methods to decompress BC1 to BC7 formats and a couple others.

Beatthezombie pushed a commit that referenced this issue Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants