Hello,
I've got a 'small' problem with trying to load an image file using physfs. Here's part of a modified ex_physfs.c:
Why can't A5 find ex_physfs.zip even though it's the data/ is in the same directory as the executable produced?
TIA,
xtheunknown0
You've changed into the resources directory, so it's probably looking in resources/data.
Now I've added
al_remove_path_component(path, -1);
before the addToSearchPath call, and it still doesn't work. What could I be missing?
TIA,
xtheunknown0
if (!PHYSFS_addToSearchPath("data/ex_physfs.zip", 1)) {
Are you supposed to have already set up a search path ? (if so, you haven't).
Now I've added
al_remove_path_component(path, -1);before the addToSearchPath call, and it still doesn't work. What could I be missing?
Did you change the directory again? If not, it's still in resources/.
Great.
Now A5 won't load the image file. Here's the rest of the code:
bmp = al_load_bitmap("02.gif"); if (bmp) { show_image(bmp); al_rest(4.0); al_destroy_bitmap(bmp); } else { al_draw_textf(font, al_map_rgb(255, 255, 255), 50, 350, 0, "Error loading gif"); al_flip_display(); al_rest(4.0); } PHYSFS_deinit(); al_destroy_path(path);
BTW, addToSearchPath works (no need to create one).
This doesn't seem to be consistent with putting resources in a zip folder. Am I not understanding something?
I think (someone correct me if I'm wrong...) that you need to call al_set_physfs_file_interface, load your bitmap into an ALLEGRO_FILE* with al_fopen and then load your bitmap using al_load_bitmap_f. I'm not sure that al_load_bitmap respects the use of PHYSFS.