Hello Allegro fans. Allegro newbie and first time poster (please be gentle). I am having trouble getting al_load_bitmap to work with the PhysFS addon. I am using allegro_monolith-debug-5.1.dll from the allegro-msvc2013-x86-5.1.12.zip with PhysFS 2.0.3 and VS2013. I've searched and read the manual and forums threads but without success.
The program is supposed to load a bitmap from a zip file and display it. The code successfully inits everything. It loads the zip file then calls al_set_physfs_file_interface(). Then it proceeds to check if file dodo.bmp exists (which it does). The program then explodes when calling al_load_bitmap(). Visual Studio debugger complains that an access violation exception happened.
I have no idea what I am doing wrong. If anyone could help I'd appreciate it.
This is quite a step in the dark... but does "/dodo.bmp" work?
One guess of mine is that you need to add the mount point to the file name when trying to load a file from it.
I just tried your program on Linux and it worked. Perhaps dodo.bmp is some weird 16 color bitmap that Allegro can't handle? Try loading it without the zipfile stuff.
EDIT: Good to hear it works for someone! I tried it with different files. The 02.bmp from the data folder in allegro, a png file, and a couple other bmp's. They're small images. Nothing huge or special about them. I can load files fine directly from the hard drive but can't get the PHYSFS addon to work properly.
@RPG Hacker: Sorry just tried it. Same results. Thanks anyway. Using the older PHYSFS_addToSearchPath() instead of PHYSFS_mount doesn't make a difference either. I get the same problem with the ex_physfs demo. Maybe it's a problem with my Visual Studio. I don't know.
[SOLUTION]
As suggested in another thread I took a look at the "linker->input->additional dependencies" in my project's properties window. For the program to work physfs.lib has to be declared after allegro_monolith-debug.lib (or whatever you use). At least that fixed it for my case. Thanks RPG Hacker and Arthur Kalliokoski for your attention.
I just tried this with my MSVC2013 and it seemed to work fine... I used x86 allegro_monolith-debug.lib too. The change you made doesn't seem to make sense to me, since that dependency should have been already linked in that library...