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

Improve texture loading #478

Merged
merged 1 commit into from
Aug 7, 2021

Conversation

rickgaiser
Copy link
Member

It's now more readable and easy to add new file extensions or loaders for certain file types:

static struct STexLoader texLoader[] = {
    {"png", texPngLoad},
    {"jpg", texJpgLoad},
    {"bmp", texBmpLoad},
    {NULL, NULL}};

Add texFree function for deleting a texture. This solves some memory leaks, where for instance the texture clut was not freed.

Remove the 'psm' argument from most functions. the argument was mostly ignored and confusing. When a file exists, it is loaded, and the psm is set in the texture struct.

@KrahJohlito
Copy link
Member

Looks good, much cleaner & works well. Thanks @rickgaiser!

@KrahJohlito KrahJohlito merged commit d3c3edb into ps2homebrew:master Aug 7, 2021
AKuHAK pushed a commit that referenced this pull request Sep 30, 2021
@rickgaiser rickgaiser deleted the for-ps2h-textures branch June 15, 2022 19:20
citronalco pushed a commit to citronalco/OPL-Daily-Builds that referenced this pull request Sep 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants