(07-16-2022, 05:38 PM)SierraKen Wrote: I might have found the problem, it probably has to do with the fact that I keep all my QB64 apps in a completely different directory than QB64. I started doing that recently so I wouldn't lose them when I update QB64. But I just opened the .BI file inside QB64 and the error was that it couldn't locate direntry.h I tried to put that in the same directory as your game but no luck. Then I tried putting it outside of the directory but still no luck. I also tried putting it in its own directory in both locations and no luck. But the strange thing is, I also tried your game inside my QB64 folder and it still wouldn't find it. I might be using the wrong direntry.h file or just don't have the right one. Your BI file says to look at your GUI.txt file but that wasn't included in your zip so I don't have it.
Oh nutz, I forgot the BI/BM uses direntry.h, I am sorry, thanks for providing more details.
The download zip was supposed to be a self contained project Folder you could put anywhere, direct the QB64 IDE to that folder select the bas and Run... but the BI/BM does need direntry.h either in the folder or a one time only addition to your QB64.exe Folder.
OK direntry.h is just this:
Code: (Select All)
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
const int IS_DIR_FLAG = 1, IS_FILE_FLAG = 2;
DIR *pdir;
struct dirent *next_entry;
struct stat statbuf1;
char current_dir[FILENAME_MAX];
#ifdef QB64_WINDOWS
#define GetCurrentDir _getcwd
#else
#define GetCurrentDir getcwd
#endif
int load_dir (char * path) {
struct dirent *pent;
struct stat statbuf1;
//Open current directory
pdir = opendir(path);
if (!pdir) {
return 0; //Didn't open
}
return -1;
}
int has_next_entry () {
next_entry = readdir(pdir);
if (next_entry == NULL) return -1;
stat(next_entry->d_name, &statbuf1);
return strlen(next_entry->d_name);
}
void get_next_entry (char * nam, int * flags, int * file_size) {
strcpy(nam, next_entry->d_name);
if (S_ISDIR(statbuf1.st_mode)) {
*flags = IS_DIR_FLAG;
} else {
*flags = IS_FILE_FLAG;
}
*file_size = statbuf1.st_size;
return ;
}
void close_dir () {
closedir(pdir);
pdir = NULL;
return ;
}
int current_dir_length () {
GetCurrentDir(current_dir, sizeof(current_dir));
return strlen(current_dir);
}
void get_current_dir(char *dir) {
memcpy(dir, current_dir, strlen(current_dir));
return ;
}
Copy/Paste into txt editor, save as direntry.h in your QB64.exe folder.
I will try and remember to add it to zips for the GUI stuff.
Thanks for staying with this Ken. TTT doesn't even use the Files Folders function so it slipped my mind that you still need drientry.h.
It should work either in the Project Folder or in the QB64.exe Folder and having it in both places should do no harm.
b = b + ...