SDL_RWop::read() file size limit? |
loadRunner
|
Sorry about the auto correct, here is the correct code:
SDL_RWops *io = NULL; io =SDL_RWFromFile(fileName.c_str(), "r"); char name[1800000]; if (io != NULL) { Sint64 seek_ = SDL_RWseek(io, 0, RW_SEEK_END); Sint64 sizeOfFileInBytes = SDL_RWtell(io); seek_ = SDL_RWseek(io, 0, RW_SEEK_SET); if (io->read(io, name, sizeOfFileInBytes, 1) > 0) { SDL_Log("Failed to Load"); } io->close(io); } |
|||||||||||
|
SDL_RWop::read() file size limit? |
M. Gerhardy
Guest
|
Hi,
no, there is no limit, you just didn't use it correctly. See my code at https://github.com/mgerhardy/caveexpress/blob/master/src/engine/common/File.cpp#L111 for an example how to use it properly. The important part is the return value - read does not have to return all the requested bytes, but only parts of it. Regards Martin On Fri, Dec 19, 2014 at 1:15 AM, loadRunner wrote:
-- http://ufoai.sf.net http://sf.net/projects/ufoai |
|||||||||||||
|