NULL
This commit is contained in:
parent
661ce21503
commit
d1cf3a0435
|
|
@ -40,7 +40,7 @@ DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance);
|
||||||
static VALUE
|
static VALUE
|
||||||
fileIntForPath(const char *path, bool rubyExc)
|
fileIntForPath(const char *path, bool rubyExc)
|
||||||
{
|
{
|
||||||
SDL_IOStream *ops = SDL_AllocRW();
|
SDL_IOStream *ops = SDL_OpenIO();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -75,10 +75,10 @@ RB_METHOD(fileIntRead)
|
||||||
|
|
||||||
if (length == -1)
|
if (length == -1)
|
||||||
{
|
{
|
||||||
Sint64 cur = SDL_RWtell(ops);
|
Sint64 cur = SDL_TellIO(ops);
|
||||||
Sint64 end = SDL_RWseek(ops, 0, SEEK_END);
|
Sint64 end = SDL_SeekIO(ops, 0, SEEK_END);
|
||||||
length = end - cur;
|
length = end - cur;
|
||||||
SDL_RWseek(ops, cur, SEEK_SET);
|
SDL_SeekIO(ops, cur, SEEK_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ struct ALStreamOpenHandler : FileSystem::OpenHandler
|
||||||
/* Try to read ogg file signature */
|
/* Try to read ogg file signature */
|
||||||
char sig[5] = { 0 };
|
char sig[5] = { 0 };
|
||||||
SDL_ReadIO(srcOps, sig, 1, 4);
|
SDL_ReadIO(srcOps, sig, 1, 4);
|
||||||
SDL_SeekIO(srcOps, 0, RW_SEEK_SET);
|
SDL_SeekIO(srcOps, 0, SDL_IO_SEEK_SET);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -434,7 +434,7 @@ void Bitmap::stretchBlt(const IntRect &destRect,
|
||||||
SDL_Rect btmRect = { 0, 0, width(), height() };
|
SDL_Rect btmRect = { 0, 0, width(), height() };
|
||||||
SDL_Rect bltRect;
|
SDL_Rect bltRect;
|
||||||
|
|
||||||
if (SDL_GetRectIntersection(&btmRect, &dstRect, &bltRect) != SDL_TRUE)
|
if (SDL_GetRectIntersection(&btmRect, &dstRect, &bltRect) != true)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int bpp;
|
int bpp;
|
||||||
|
|
@ -1268,7 +1268,7 @@ IntRect Bitmap::textSize(const char *str)
|
||||||
/* For cursive characters, returning the advance
|
/* For cursive characters, returning the advance
|
||||||
* as width yields better results */
|
* as width yields better results */
|
||||||
if (p->font->getItalic() && *endPtr == '\0')
|
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);
|
return IntRect(0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,7 @@ void Oneshot::update()
|
||||||
|
|
||||||
//костыль ебучий
|
//костыль ебучий
|
||||||
int num_displays;
|
int num_displays;
|
||||||
SDL_DisplayID *displays = SDL_GetDisplays(&num_displays)
|
SDL_DisplayID *displays = SDL_GetDisplays(&num_displays);
|
||||||
SDL_free(displays);
|
SDL_free(displays);
|
||||||
//Update obscured map and texture for window portion offscreen
|
//Update obscured map and texture for window portion offscreen
|
||||||
for (int i = 0, max = num_displays; i < max; ++i)
|
for (int i = 0, max = num_displays; i < max; ++i)
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,14 @@ int screenMain(Config &conf)
|
||||||
|
|
||||||
Pipe ipc("oneshot-pipe", Pipe::Read);
|
Pipe ipc("oneshot-pipe", Pipe::Read);
|
||||||
|
|
||||||
int imgFlags = IMG_INIT_PNG;
|
//int imgFlags = IMG_INIT_PNG;
|
||||||
if (IMG_Init(imgFlags) != imgFlags)
|
//if (IMG_Init(imgFlags) != imgFlags)
|
||||||
{
|
//{
|
||||||
showInitError(std::string("Error initializing SDL_image: ") + SDL_GetError());
|
// showInitError(std::string("Error initializing SDL_image: ") + SDL_GetError());
|
||||||
SDL_Quit();
|
// SDL_Quit();
|
||||||
|
//
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
//}
|
||||||
|
|
||||||
SDL_Window *win;
|
SDL_Window *win;
|
||||||
win = SDL_CreateShapedWindow("The Journal",
|
win = SDL_CreateShapedWindow("The Journal",
|
||||||
|
|
@ -74,7 +74,7 @@ int screenMain(Config &conf)
|
||||||
SDL_Event e;
|
SDL_Event e;
|
||||||
while (SDL_PollEvent(&e)) {
|
while (SDL_PollEvent(&e)) {
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case SDL_QUIT:
|
case SDL_EVENT_QUIT:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ SDL_Thread *createSDLThread(C *obj, const std::string &name = std::string())
|
||||||
// if (!f)
|
// if (!f)
|
||||||
// return SDL_RWFromFile(filename, mode);
|
// 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){
|
inline bool readFileSDL(const char *path, std::string &out){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue