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

Either Importing/Exporting ytd not working correctly? #35

Open
xZToxicZx opened this issue Feb 5, 2023 · 3 comments
Open

Either Importing/Exporting ytd not working correctly? #35

xZToxicZx opened this issue Feb 5, 2023 · 3 comments

Comments

@xZToxicZx
Copy link
Contributor

xZToxicZx commented Feb 5, 2023

I load the TXD like so:

        var ytd = new TextureDictionaryFileWrapper_GTA5_pc();
        ytd.Load(file.FullName);
        Console.WriteLine(file.FullName);

Then export again doing nothing in between the last line and this line:

        var output = Path.Join(file.Directory.FullName, "[done]", file.Name);
        Console.WriteLine(output);
        ytd.Save(output);

The input file size is 4,699kb output is 5,201kb.
When attempting to load into game some of the textures dont load and some do?
Digging into it further OpenIV when attempting to import the original dds files it duplicates them?
Not sure if this could be an issue with naming or something else but thought I'd try be in depth since I've been at this for about 5 hours now.
Please let me know if I'm being dumb or this is a bug because I cant seem to figure it out.

@xZToxicZx
Copy link
Contributor Author

Issue is when importing.
Stream still includes header here:

            var deflateStream = new DeflateStream(stream, CompressionMode.Decompress, true);
            deflateStream.ReadExactly(VirtualData, 0, (int)virtualSize);
            deflateStream.ReadExactly(PhysicalData, 0, (int)physicalSize);
            deflateStream.Close();

I've fixed locally will do a pull request if this repo is even still active.

@xZToxicZx
Copy link
Contributor Author

The above is incorrect, issue is to do with UpdateClass in TextureDictionaryWrapper_GTA5_pc
Have just commented locally and seems to have fixed, it only affects textures that have any transparency to them

@carmineos
Copy link
Owner

It is possible that ResourceWrappers have bugs, specially those related to textures. Note that resource wrappers are still old code from original gta-toolkit, they should be a way to expose high level API to handle resources but they are far from ready as even low level API aren't complete.

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