32 PRAGMA48(GCC diagnostic ignored
"-Wshadow")
33 #include <SDL_rwops.h>
49 File *
const handle =
static_cast<File *
>(
50 rw->hidden.unknown.data1);
52 const size_t mSize = handle->
mSize;
56 if (whence == SEEK_SET)
60 else if (whence == SEEK_CUR)
62 const int64_t current =
mPos;
66 "VirtFs::rwops_seek: Can't find position in file.");
71 if (
static_cast<int64_t
>(pos) != current)
74 "Can't fit current file position in an int!");
83 else if (whence == SEEK_END)
85 pos =
static_cast<RWOPSINT>(mSize + offset);
90 "VirtFs::rwops_seek: Invalid 'whence' parameter.");
97 "Attempt to seek past start of file.");
103 if (pos >
static_cast<RWOPSINT>(mSize))
119 File *
const handle =
static_cast<File *
>(
120 rw->hidden.unknown.data1);
122 const int64_t rc = handle->
funcs->
read(handle,
141 File *
const handle =
static_cast<File*
>(
142 rw->hidden.unknown.data1);
149 RWOPSINT rwops_size(SDL_RWops *
const rw)
153 File *
const handle =
static_cast<File *
>(
154 rw->hidden.unknown.data1);
155 return handle->
mSize;
void assertLog(const char *const log_text,...)
int rwops_read(SDL_RWops *const rw, void *const ptr, const int size, const int maxnum)
int rwops_write(SDL_RWops *const rw, const void *const ptr, const int size, const int num)
int rwops_close(SDL_RWops *const rw)
int32_t rwops_seek(SDL_RWops *const rw, const int32_t offset, const int whence)
int64_t(* read)(File *const file, void *const buffer, const uint32_t objSize, const uint32_t objCount)