You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I was experimenting a bit with some of the examples and found some strange behavior when messing around with the spritemap example. If commenting out the graphics_draw_sprite_trans line, running the example below in Ares produces an error saying "ASSERTION FAILED: only sprites in FMT_RGBA16 or FMT_RGBA32 are supported" despite the sprite being the mudkip sprite from the example. Am I missing something here? Tested on both preview and unstable branches.
#include<libdragon.h>intmain() {
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 2, GAMMA_NONE, FILTERS_RESAMPLE);
dfs_init(DFS_DEFAULT_LOCATION);
rdpq_init();
surface_t*disp=display_get();
intfp=dfs_open("/mudkip.sprite");
sprite_t*mudkip=malloc(dfs_size(fp));
dfs_read(mudkip, 1, dfs_size(fp), fp);
dfs_close(fp);
// without this line, rdp_load_texture will cause an errorgraphics_draw_sprite_trans(disp, 50, 50, mudkip);
while (true) {
display_show(disp);
disp=display_get();
graphics_fill_screen(disp, 0xFFFFFFFF);
graphics_set_color(0x0, 0xFFFFFFFF);
graphics_draw_text(disp, 20, 20, "Test!");
rdpq_set_mode_copy(true);
rdpq_attach(disp, NULL);
// error will occur hererdp_load_texture(0, 0, MIRROR_DISABLED, mudkip);
rdp_draw_sprite(0, 50, 50, MIRROR_DISABLED);
rdpq_detach_wait();
}
}
The text was updated successfully, but these errors were encountered:
rasky
added a commit
to rasky/libdragon
that referenced
this issue
Mar 9, 2024
The new rdp shim was missing calls to __sprite_upgrade(), that are
necessary to be able to use the new sprite APIs like sprite_get_format
on old sprite files (generated by the old mksprite) and manually
loaded from ROM.
FixesDragonMinded#503
Thanks for the report, this seems like a bug in the preview branch. The APIs you're using (rdp_*) are deprecated in that branch and the implementation was rewritten to keep the same API and make it work above the new API (rdpq_*).
I've pushed a fix in the preview branch (6cf2fbc).
Hi all, I was experimenting a bit with some of the examples and found some strange behavior when messing around with the spritemap example. If commenting out the graphics_draw_sprite_trans line, running the example below in Ares produces an error saying "ASSERTION FAILED: only sprites in FMT_RGBA16 or FMT_RGBA32 are supported" despite the sprite being the mudkip sprite from the example. Am I missing something here? Tested on both preview and unstable branches.
The text was updated successfully, but these errors were encountered: