(svn r23362) -Codechange: refactor AIScanner, splitting it in AIScannerInfo and AIScannerLibrary

This commit is contained in:
truebrain
2011-11-29 23:21:52 +00:00
parent ae8540f5e0
commit e37149a1de
14 changed files with 536 additions and 474 deletions

View File

@@ -440,13 +440,19 @@ static SQInteger _io_file_read(SQUserPointer file, SQUserPointer buf, SQInteger
SQRESULT Squirrel::LoadFile(HSQUIRRELVM vm, const char *filename, SQBool printerror)
{
size_t size;
FILE *file = FioFOpenFile(filename, "rb", AI_DIR, &size);
if (file == NULL) file = FioFOpenFile(filename, "rb", AI_LIBRARY_DIR, &size);
FILE *file;
SQInteger ret;
unsigned short us;
unsigned char uc;
SQLEXREADFUNC func;
if (strncmp(this->GetAPIName(), "AI", 2) == 0) {
file = FioFOpenFile(filename, "rb", AI_DIR, &size);
if (file == NULL) file = FioFOpenFile(filename, "rb", AI_LIBRARY_DIR, &size);
} else {
NOT_REACHED();
}
if (file != NULL) {
SQFile f(file, size);
ret = fread(&us, 1, sizeof(us), file);