This commit is contained in:
ZakatTeamI2P 2026-03-30 23:02:31 +04:00
parent 661ce21503
commit d1cf3a0435
6 changed files with 18 additions and 18 deletions

View file

@ -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)

View file

@ -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
{

View file

@ -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);
}

View file

@ -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)

View file

@ -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;
}
}

View file

@ -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){