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 an assertion when using old-school sprite loading with compressed sprites #512

Open
rasky opened this issue Apr 1, 2024 · 1 comment
Labels
fixed-in-preview Fixed in the preview branch

Comments

@rasky
Copy link
Collaborator

rasky commented Apr 1, 2024

Some examples on trunk still use the old-school sprite loading instead of sprite_load:

    fp = dfs_open("/background1.sprite");
    sprite_t *background1 = malloc( dfs_size( fp ) );
    dfs_read( background1, 1, dfs_size( fp ), fp );
    dfs_close( fp );

This is compatible with sprites created with mksprite with the old syntax. When switching to the new syntax, mksprite compresses sprites by default so they're not compatible anymore. Instead, users get random crashes.

We could try and add an assertion here, maybe in __sprite_upgrade().

@rasky rasky added the fixed-in-preview Fixed in the preview branch label Apr 26, 2024
@rasky
Copy link
Collaborator Author

rasky commented Apr 26, 2024

Fixed in preview: c1a13d9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-preview Fixed in the preview branch
Projects
None yet
Development

No branches or pull requests

1 participant