physfs compilation on windows
* external calls must always be named
* physfs has to be compiled as dll
* there shouln't be external variables, implemented a function that sets buffer
* physfs extras is now integrated in main physfs
* removed physfs extras
#include <lua.h>
#include <physfs.h>
#define BUFSIZE 1024
void *physfsReaderBuffer;
const char * physfsReader(lua_State *L, PHYSFS_File *f, size_t *size)
{
if(PHYSFS_eof(f))
{
return NULL;
}
else
{
*size = PHYSFS_readBytes(f, physfsReaderBuffer, BUFSIZE);
if(*size == 0)
return NULL;
else
return physfsReaderBuffer;
}
}
void physfsReaderSetBuffer(void *buffer)
{
physfsReaderBuffer = buffer;
}