diff --git a/binding-mri/filesystem-binding.cpp b/binding-mri/filesystem-binding.cpp index 4eb7c57..dcfa7a6 100644 --- a/binding-mri/filesystem-binding.cpp +++ b/binding-mri/filesystem-binding.cpp @@ -40,7 +40,7 @@ DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance); static VALUE fileIntForPath(const char *path, bool rubyExc) { - SDL_IOStream *ops = SDL_AllocRW(); + SDL_IOStream *ops = SDL_OpenIO(); try { @@ -75,10 +75,10 @@ RB_METHOD(fileIntRead) if (length == -1) { - Sint64 cur = SDL_RWtell(ops); - Sint64 end = SDL_RWseek(ops, 0, SEEK_END); + Sint64 cur = SDL_TellIO(ops); + Sint64 end = SDL_SeekIO(ops, 0, SEEK_END); length = end - cur; - SDL_RWseek(ops, cur, SEEK_SET); + SDL_SeekIO(ops, cur, SEEK_SET); } if (length == 0) diff --git a/src/alstream.cpp b/src/alstream.cpp index 36f07f7..0f1c95b 100644 --- a/src/alstream.cpp +++ b/src/alstream.cpp @@ -221,7 +221,7 @@ struct ALStreamOpenHandler : FileSystem::OpenHandler /* Try to read ogg file signature */ char sig[5] = { 0 }; SDL_ReadIO(srcOps, sig, 1, 4); - SDL_SeekIO(srcOps, 0, RW_SEEK_SET); + SDL_SeekIO(srcOps, 0, SDL_IO_SEEK_SET); try { diff --git a/src/bitmap.cpp b/src/bitmap.cpp index 5e2f7ad..133efbf 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -434,7 +434,7 @@ void Bitmap::stretchBlt(const IntRect &destRect, SDL_Rect btmRect = { 0, 0, width(), height() }; SDL_Rect bltRect; - if (SDL_GetRectIntersection(&btmRect, &dstRect, &bltRect) != SDL_TRUE) + if (SDL_GetRectIntersection(&btmRect, &dstRect, &bltRect) != true) return; int bpp; @@ -1268,7 +1268,7 @@ IntRect Bitmap::textSize(const char *str) /* For cursive characters, returning the advance * as width yields better results */ if (p->font->getItalic() && *endPtr == '\0') - TTF_GlyphMetrics(font, ucs2, 0, 0, 0, 0, &w); + TTF_GetGlyphMetrics(font, ucs2, 0, 0, 0, 0, &w); return IntRect(0, 0, w, h); } diff --git a/src/oneshot.cpp b/src/oneshot.cpp index 23461b4..3eafea9 100644 --- a/src/oneshot.cpp +++ b/src/oneshot.cpp @@ -358,7 +358,7 @@ void Oneshot::update() //костыль ебучий int num_displays; - SDL_DisplayID *displays = SDL_GetDisplays(&num_displays) + SDL_DisplayID *displays = SDL_GetDisplays(&num_displays); SDL_free(displays); //Update obscured map and texture for window portion offscreen for (int i = 0, max = num_displays; i < max; ++i) diff --git a/src/screen.cpp b/src/screen.cpp index 004dde7..f30e59c 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -38,14 +38,14 @@ int screenMain(Config &conf) Pipe ipc("oneshot-pipe", Pipe::Read); - int imgFlags = IMG_INIT_PNG; - if (IMG_Init(imgFlags) != imgFlags) - { - showInitError(std::string("Error initializing SDL_image: ") + SDL_GetError()); - SDL_Quit(); - - return 0; - } + //int imgFlags = IMG_INIT_PNG; + //if (IMG_Init(imgFlags) != imgFlags) + //{ + // showInitError(std::string("Error initializing SDL_image: ") + SDL_GetError()); + // SDL_Quit(); + // + // return 0; + //} SDL_Window *win; win = SDL_CreateShapedWindow("The Journal", @@ -74,7 +74,7 @@ int screenMain(Config &conf) SDL_Event e; while (SDL_PollEvent(&e)) { switch (e.type) { - case SDL_QUIT: + case SDL_EVENT_QUIT: return 0; } } diff --git a/src/sdl-util.h b/src/sdl-util.h index 7897dad..cda2991 100644 --- a/src/sdl-util.h +++ b/src/sdl-util.h @@ -65,7 +65,7 @@ SDL_Thread *createSDLThread(C *obj, const std::string &name = std::string()) // if (!f) // return SDL_RWFromFile(filename, mode); // -// return SDL_RWFromFP(f, SDL_TRUE); +// return SDL_RWFromFP(f, true); //} inline bool readFileSDL(const char *path, std::string &out){