diff --git a/binding-mri/filesystem-binding.cpp b/binding-mri/filesystem-binding.cpp index 4bc5e03..5433e67 100644 --- a/binding-mri/filesystem-binding.cpp +++ b/binding-mri/filesystem-binding.cpp @@ -31,7 +31,7 @@ static void fileIntFreeInstance(void *inst) { - SDL_RWops *ops = static_cast(inst); + SDL_IOStream *ops = static_cast(inst); SDL_RWclose(ops); SDL_FreeRW(ops); @@ -42,7 +42,7 @@ DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance); static VALUE fileIntForPath(const char *path, bool rubyExc) { - SDL_RWops *ops = SDL_AllocRW(); + SDL_IOStream *ops = SDL_AllocRW(); try { @@ -73,7 +73,7 @@ RB_METHOD(fileIntRead) int length = -1; rb_get_args(argc, argv, "i", &length RB_ARG_END); - SDL_RWops *ops = getPrivateData(self); + SDL_IOStream *ops = getPrivateData(self); if (length == -1) { @@ -97,7 +97,7 @@ RB_METHOD(fileIntClose) { RB_UNUSED_PARAM; - SDL_RWops *ops = getPrivateData(self); + SDL_IOStream *ops = getPrivateData(self); SDL_RWclose(ops); return Qnil; @@ -107,7 +107,7 @@ RB_METHOD(fileIntGetByte) { RB_UNUSED_PARAM; - SDL_RWops *ops = getPrivateData(self); + SDL_IOStream *ops = getPrivateData(self); unsigned char byte; size_t result = SDL_RWread(ops, &byte, 1, 1); diff --git a/src/aldatasource.h b/src/aldatasource.h index 17209c7..eee10cf 100644 --- a/src/aldatasource.h +++ b/src/aldatasource.h @@ -57,12 +57,12 @@ struct ALDataSource virtual bool setPitch(float value) = 0; }; -ALDataSource *createSDLSource(SDL_RWops &ops, +ALDataSource *createSDLSource(SDL_IOStream &ops, const char *extension, uint32_t maxBufSize, bool looped); -ALDataSource *createVorbisSource(SDL_RWops &ops, +ALDataSource *createVorbisSource(SDL_IOStream &ops, bool looped); #endif // ALDATASOURCE_H diff --git a/src/eventthread.cpp b/src/eventthread.cpp index 09b3010..d440ecc 100644 --- a/src/eventthread.cpp +++ b/src/eventthread.cpp @@ -456,18 +456,18 @@ void EventThread::process(RGSSThreadData &rtData) break; case SDL_EVENT_FINGER_DOWN : - i = event.tfinger.fingerId; + i = event.tfinger.fingerID; touchState.fingers[i].down = true; /* falls through */ case SDL_EVENT_FINGER_MOTION : - i = event.tfinger.fingerId; + i = event.tfinger.fingerID; touchState.fingers[i].x = event.tfinger.x * winW; touchState.fingers[i].y = event.tfinger.y * winH; break; case SDL_EVENT_FINGER_UP : - i = event.tfinger.fingerId; + i = event.tfinger.fingerID; memset(&touchState.fingers[i], 0, sizeof(touchState.fingers[0])); break; @@ -801,7 +801,7 @@ SyncPoint::Util::Util() SyncPoint::Util::~Util() { - SDL_DestroyCond(cond); + SDL_DestroyCondition(cond); SDL_DestroyMutex(mut); } diff --git a/src/filesystem.cpp b/src/filesystem.cpp index 6038ed7..a03650c 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -148,7 +148,7 @@ static inline PHYSFS_File *sdlPHYS(SDL_IOStream *ops) return static_cast(ops->hidden.unknown.data1); } -static Sint64 SDL_RWopsSize(SDL_IOStream *ops) +static Sint64 SDL_IOStreamSize(SDL_IOStream *ops) { PHYSFS_File *f = sdlPHYS(ops); @@ -158,7 +158,7 @@ static Sint64 SDL_RWopsSize(SDL_IOStream *ops) return PHYSFS_fileLength(f); } -static Sint64 SDL_RWopsSeek(SDL_IOStream *ops, int64_t offset, int whence) +static Sint64 SDL_IOStreamSeek(SDL_IOStream *ops, int64_t offset, int whence) { PHYSFS_File *f = sdlPHYS(ops); @@ -186,7 +186,7 @@ static Sint64 SDL_RWopsSeek(SDL_IOStream *ops, int64_t offset, int whence) return (result != 0) ? PHYSFS_tell(f) : -1; } -static size_t SDL_RWopsRead(SDL_IO_SEEK_END *ops, void *buffer, size_t size, size_t maxnum) +static size_t SDL_IOStreamRead(SDL_IO_SEEK_END *ops, void *buffer, size_t size, size_t maxnum) { PHYSFS_File *f = sdlPHYS(ops); @@ -198,7 +198,7 @@ static size_t SDL_RWopsRead(SDL_IO_SEEK_END *ops, void *buffer, size_t size, siz return (result != -1) ? (result / size) : 0; } -static size_t SDL_RWopsWrite(SDL_IOStream *ops, const void *buffer, size_t size, size_t num) +static size_t SDL_IOStreamWrite(SDL_IOStream *ops, const void *buffer, size_t size, size_t num) { PHYSFS_File *f = sdlPHYS(ops); @@ -210,7 +210,7 @@ static size_t SDL_RWopsWrite(SDL_IOStream *ops, const void *buffer, size_t size, return (result != -1) ? (result / size) : 0; } -static int SDL_RWopsClose(SDL_IOStream *ops) +static int SDL_IOStreamClose(SDL_IOStream *ops) { PHYSFS_File *f = sdlPHYS(ops); @@ -223,9 +223,9 @@ static int SDL_RWopsClose(SDL_IOStream *ops) return (result != 0) ? 0 : -1; } -static int SDL_RWopsCloseFree(SDL_IOStream *ops) +static int SDL_IOStreamCloseFree(SDL_IOStream *ops) { - int result = SDL_RWopsClose(ops); + int result = SDL_IOStreamClose(ops); SDL_CloseIO(ops); @@ -276,15 +276,15 @@ initReadOps(PHYSFS_File *handle, SDL_IOStream &ops, bool freeOnClose) { - ops.size = SDL_RWopsSize; - ops.seek = SDL_RWopsSeek; - ops.read = SDL_RWopsRead; - ops.write = SDL_RWopsWrite; + ops.size = SDL_IOStreamSize; + ops.seek = SDL_IOStreamSeek; + ops.read = SDL_IOStreamRead; + ops.write = SDL_IOStreamWrite; if (freeOnClose) - ops.close = SDL_RWopsCloseFree; + ops.close = SDL_IOStreamCloseFree; else - ops.close = SDL_RWopsClose; + ops.close = SDL_IOStreamClose; ops.type = SDL_RWOPS_PHYSFS; ops.hidden.unknown.data1 = handle; @@ -339,7 +339,7 @@ void FileSystem::addPath(const char *path) if (!PHYSFS_mount(path, 0, 1)) { /* If it didn't work, try mounting via a wrapped - * SDL_RWops */ + * SDL_IOStream */ PHYSFS_Io *io = createSDLRWIo(path); if (io) @@ -648,7 +648,7 @@ void FileSystem::openRead(OpenHandler &handler, const char *filename) throw Exception(Exception::NoFileError, "%s", filename); } -void FileSystem::openReadRaw(SDL_RWops &ops, +void FileSystem::openReadRaw(SDL_IOStream &ops, const char *filename, bool freeOnClose) { diff --git a/src/oneshot.cpp b/src/oneshot.cpp index 94026e1..f34be76 100644 --- a/src/oneshot.cpp +++ b/src/oneshot.cpp @@ -10,8 +10,8 @@ #include "font.h" #include -#include -#include +#include +#include // OS-Specific code #if defined _WIN32 @@ -68,7 +68,7 @@ struct OneshotPrivate // Alpha texture data for portions of window obscured by screen edges int winX, winY; - SDL_mutex *winMutex; + SDL_Mutex *winMutex; bool winPosChanged; std::vector obscuredMap; bool obscuredCleared; diff --git a/src/sdl-util.h b/src/sdl-util.h index 1893836..7897dad 100644 --- a/src/sdl-util.h +++ b/src/sdl-util.h @@ -57,7 +57,7 @@ SDL_Thread *createSDLThread(C *obj, const std::string &name = std::string()) * on the physical filesystem. This wrapper attempts to open a * real file first before falling back to the assets folder */ //static inline -//SDL_RWops *RWFromFile(const char *filename, +//SDL_IOStream *RWFromFile(const char *filename, // const char *mode) //{ // FILE *f = fopen(filename, mode); diff --git a/src/vorbissource.cpp b/src/vorbissource.cpp index 7716a69..d72aa85 100644 --- a/src/vorbissource.cpp +++ b/src/vorbissource.cpp @@ -29,17 +29,17 @@ static size_t vfRead(void *ptr, size_t size, size_t nmemb, void *ops) { - return SDL_RWread(static_cast(ops), ptr, size, nmemb); + return SDL_RWread(static_cast(ops), ptr, size, nmemb); } static int vfSeek(void *ops, ogg_int64_t offset, int whence) { - return SDL_RWseek(static_cast(ops), offset, whence); + return SDL_RWseek(static_cast(ops), offset, whence); } static long vfTell(void *ops) { - return SDL_RWtell(static_cast(ops)); + return SDL_RWtell(static_cast(ops)); } static ov_callbacks OvCallbacks = @@ -53,7 +53,7 @@ static ov_callbacks OvCallbacks = struct VorbisSource : ALDataSource { - SDL_RWops &src; + SDL_IOStream &src; OggVorbis_File vf; @@ -78,7 +78,7 @@ struct VorbisSource : ALDataSource std::vector sampleBuf; - VorbisSource(SDL_RWops &ops, + VorbisSource(SDL_IOStream &ops, bool looped) : src(ops), currentFrame(0) @@ -87,7 +87,7 @@ struct VorbisSource : ALDataSource if (error) { - SDL_RWclose(&src); + SDL_CloseIO(&src); throw Exception(Exception::MKXPError, "Vorbisfile: Cannot read ogg file"); } @@ -99,7 +99,7 @@ struct VorbisSource : ALDataSource if (info.channels > 2) { ov_clear(&vf); - SDL_RWclose(&src); + SDL_CloseIO(&src); throw Exception(Exception::MKXPError, "Cannot handle audio with more than 2 channels"); } @@ -148,7 +148,7 @@ struct VorbisSource : ALDataSource ~VorbisSource() { ov_clear(&vf); - SDL_RWclose(&src); + SDL_CloseIO(&src); } int sampleRate() @@ -282,7 +282,7 @@ struct VorbisSource : ALDataSource } }; -ALDataSource *createVorbisSource(SDL_RWops &ops, +ALDataSource *createVorbisSource(SDL_IOStream &ops, bool looped) { return new VorbisSource(ops, looped);