|
@@ -70,7 +70,7 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
|
|
if (current == -1)
|
|
if (current == -1)
|
|
|
{
|
|
{
|
|
|
SDL_SetError("Can't find position in file: %s",
|
|
SDL_SetError("Can't find position in file: %s",
|
|
|
- PHYSFS_getLastError());
|
|
|
|
|
|
|
+ PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
|
|
return -1;
|
|
return -1;
|
|
|
} /* if */
|
|
} /* if */
|
|
|
|
|
|
|
@@ -91,7 +91,7 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
|
|
const PHYSFS_sint64 len = PHYSFS_fileLength(handle);
|
|
const PHYSFS_sint64 len = PHYSFS_fileLength(handle);
|
|
|
if (len == -1)
|
|
if (len == -1)
|
|
|
{
|
|
{
|
|
|
- SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError());
|
|
|
|
|
|
|
+ SDL_SetError("Can't find end of file: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
|
|
return -1;
|
|
return -1;
|
|
|
} /* if */
|
|
} /* if */
|
|
|
|
|
|
|
@@ -112,7 +112,7 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
|
|
|
|
|
|
|
if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
|
|
if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
|
|
|
{
|
|
{
|
|
|
- SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
|
|
|
|
|
|
+ SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
|
|
return -1;
|
|
return -1;
|
|
|
} /* if */
|
|
} /* if */
|
|
|
|
|
|
|
@@ -138,7 +138,7 @@ static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum)
|
|
|
{
|
|
{
|
|
|
if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */
|
|
if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */
|
|
|
{
|
|
{
|
|
|
- SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
|
|
|
|
|
|
+ SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
|
|
|
|
|
|
|
#if TARGET_SDL2
|
|
#if TARGET_SDL2
|
|
|
return 0;
|
|
return 0;
|
|
@@ -167,7 +167,7 @@ static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num)
|
|
|
const PHYSFS_uint64 writelen = (PHYSFS_uint64) (num * size);
|
|
const PHYSFS_uint64 writelen = (PHYSFS_uint64) (num * size);
|
|
|
const PHYSFS_sint64 rc = PHYSFS_writeBytes(handle, ptr, writelen);
|
|
const PHYSFS_sint64 rc = PHYSFS_writeBytes(handle, ptr, writelen);
|
|
|
if (rc != ((PHYSFS_sint64) writelen))
|
|
if (rc != ((PHYSFS_sint64) writelen))
|
|
|
- SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
|
|
|
|
|
|
+ SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
|
|
|
|
|
|
|
#if TARGET_SDL2
|
|
#if TARGET_SDL2
|
|
|
return (size_t) rc;
|
|
return (size_t) rc;
|
|
@@ -182,7 +182,7 @@ static int physfsrwops_close(SDL_RWops *rw)
|
|
|
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
|
|
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
|
|
|
if (!PHYSFS_close(handle))
|
|
if (!PHYSFS_close(handle))
|
|
|
{
|
|
{
|
|
|
- SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
|
|
|
|
|
|
+ SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
|
|
return -1;
|
|
return -1;
|
|
|
} /* if */
|
|
} /* if */
|
|
|
|
|
|
|
@@ -196,7 +196,7 @@ static SDL_RWops *create_rwops(PHYSFS_File *handle)
|
|
|
SDL_RWops *retval = NULL;
|
|
SDL_RWops *retval = NULL;
|
|
|
|
|
|
|
|
if (handle == NULL)
|
|
if (handle == NULL)
|
|
|
- SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
|
|
|
|
|
|
+ SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
retval = SDL_AllocRW();
|
|
retval = SDL_AllocRW();
|