Hi... Using DarkBASIC I created a custom file format for myself. It's by no means the most sophisticated file format out there, but it suits my needs... Anyway, now that I've gotten Dark GDK I would like to try and use that same format. However, I'm having trouble loading the custom files I created using DarkBASIC. Here's the code of the function, with an explanation below the snippet:
bool LoadCMF (char* Filename)
{
char FileSig [5];
dbOpenToRead (1, Filename);
for (byte bytecounter=0; bytecounter < 5; bytecounter++)
{
dbReadByte (1,FileSig[bytecounter]);
}
if (FileSig == "CMF11" || FileSig == "CMF12")
return true;
else
return false;
dbCloseFile(1);
}
The first step for loading this file is reading the five-byte signature at the top of the file. So, before I proceed with programming the actual loading of most of the data, I just want to test once the bytes are read whether they equal the signature--that's why the function is boolean for the moment. However, dbReadByte doesn't like those bytes for some reason, or I've gotten something mixed up in my code (the latter being the most likely). Here is the output I get when I try to compile:
>Compiling...
1>Main.cpp
1>c:\users\*name omitted*\documents\visual studio 2008\projects\dark gdk - game1\dark gdk - game1\cmap.h(40) : error C2665: 'dbReadByte' : none of the 2 overloads could convert all the argument types
1> c:\program files\the game creators\dark gdk\include\darksdkfile.h(99): could be 'unsigned char dbReadByte(int,unsigned char *)'
1> while trying to match the argument list '(int, char)'
It would appear that the problem resides with how I'm using the dbReadByte command, as everything else compiles correctly. But, what do I know? Could someone please advise me on what my mistake is and what the solution is?