EDIT: Solved! Forgot to run al_open_directory(ALLEGRO_FS_ENTRY);
I've made two functions that I am going to use to parse directories and get all files in them. The idea is that I only send the directory path to td_set_directory_to_parse() and then call td_next_file_in_directory() until it returns NULL. I've used these functions before without problem but then I logged all files and subdirectories to "content files" in each directory (old approach from back when I used A4 which I've converted to A5), but now I want to do it runtime instead of generating these content files.
Problem is that it crashes when I run al_read_directory(ParseDirectory); in the td_next_file_in_directory() function and I don't know why. ParseDirectory has been set to a File System entity and if I wouldn't it would be NULL and return NULL.
Anyone able to see what I've forgotten? I've been looking at the code for a few hours now and can't find it.
]]>