SAPF{DOGPFOSG

This commit is contained in:
ZakatTeamI2P 2026-03-31 00:10:53 +04:00
parent d1cf3a0435
commit 8d541597d3
9 changed files with 20 additions and 22 deletions

View File

@ -79,8 +79,7 @@ static const RbException excToRbExc[] =
MKXP /* MKXPError */ MKXP /* MKXPError */
}; };
void raiseRbExc(const Exception &exc) void raiseRbExc(const Exception &exc){
{
RbData *data = getRbData(); RbData *data = getRbData();
VALUE excClass = data->exc[excToRbExc[exc.type]]; VALUE excClass = data->exc[excToRbExc[exc.type]];

View File

@ -23,6 +23,9 @@
#define BINDING_UTIL_H #define BINDING_UTIL_H
#include <ruby.h> #include <ruby.h>
//костыль ебаный сука
#undef snprintf
#undef inline #undef inline
#include "exception.h" #include "exception.h"

View File

@ -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_OpenIO(); SDL_IOStream *ops;
try try
{ {

View File

@ -220,7 +220,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, 4);
SDL_SeekIO(srcOps, 0, SDL_IO_SEEK_SET); SDL_SeekIO(srcOps, 0, SDL_IO_SEEK_SET);
try try

View File

@ -92,7 +92,7 @@ struct BitmapPrivate
* getPixel calls. Is invalidated any time the bitmap * getPixel calls. Is invalidated any time the bitmap
* is modified */ * is modified */
SDL_Surface *surface; SDL_Surface *surface;
SDL_PixelFormatDetails *format; SDL_PixelFormatDetails format;
/* The 'tainted' area describes which parts of the /* The 'tainted' area describes which parts of the
* bitmap are not cleared, ie. don't have 0 opacity. * bitmap are not cleared, ie. don't have 0 opacity.
@ -121,9 +121,7 @@ struct BitmapPrivate
void allocSurface() void allocSurface()
{ {
surface = SDL_CreateRGBSurface(0, gl.width, gl.height, format->BitsPerPixel, surface = SDL_CreateSurface(gl.width, gl.height, format);
format->Rmask, format->Gmask,
format->Bmask, format->Amask);
} }
void clearTaintedArea() void clearTaintedArea()
@ -1259,7 +1257,7 @@ IntRect Bitmap::textSize(const char *str)
str = fixed.c_str(); str = fixed.c_str();
int w, h; int w, h;
TTF_GetStringSize(font, str, &w, &h); TTF_SizeText(font, str, &w, &h);
/* If str is one character long, *endPtr == 0 */ /* If str is one character long, *endPtr == 0 */
const char *endPtr; const char *endPtr;

View File

@ -156,8 +156,7 @@ _TTF_Font *SharedFontState::getFont(std::string family,
throw Exception(Exception::SDLError, "%s", SDL_GetError()); throw Exception(Exception::SDLError, "%s", SDL_GetError());
p->pool.insert(key, font); p->pool.insert(key, font);
return (_TTF_Font*)font;
return font;
} }
bool SharedFontState::fontPresent(std::string family) const bool SharedFontState::fontPresent(std::string family) const

View File

@ -42,8 +42,9 @@ void subRectImageUpload(GLint srcW, GLint srcX, GLint srcY,
} }
else else
{ {
SDL_PixelFormat *form = src->format; SDL_PixelFormat *form = &src->format
SDL_Surface *tmp = SDL_CreateRGBSurface(0, dstW, dstH, form->BitsPerPixel, //SDL_PixelFormat *form = src->format;
SDL_Surface *tmp = SDL_CreateSurface(0, dstW, dstH, form->BitsPerPixel,
form->Rmask, form->Gmask, form->Bmask, form->Amask); form->Rmask, form->Gmask, form->Bmask, form->Amask);
SDL_Rect srcRect = { srcX, srcY, dstW, dstH }; SDL_Rect srcRect = { srcX, srcY, dstW, dstH };

View File

@ -48,9 +48,8 @@ int screenMain(Config &conf)
//} //}
SDL_Window *win; SDL_Window *win;
win = SDL_CreateShapedWindow("The Journal", win = SDL_CreateWindow("The Journal", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SDL_WINDOW_RESIZABLE);
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, //SDL_SetWindowShape(win, );
DEFAULT_WIDTH, DEFAULT_HEIGHT, 0);
if (!win) if (!win)
{ {
@ -62,9 +61,10 @@ int screenMain(Config &conf)
shapeMode.mode = ShapeModeColorKey; shapeMode.mode = ShapeModeColorKey;
shapeMode.parameters.colorKey = colorKey; shapeMode.parameters.colorKey = colorKey;
//SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8); //SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8);
SDL_Surface *shape = SDL_CreateRGBSurface(DEFAULT_WIDTH, DEFAULT_HEIGHT, 0, 0, 0, 0); //SDL_PIXELFORMAT_UNKNOWN - 0,0,0,0 ....maybe?
// SDL_Palette *palette = SDL_CreateSurfacePalette(surface); SDL_Surface *shape = SDL_CreateSurface(DEFAULT_WIDTH, DEFAULT_HEIGHT, SDL_PIXELFORMAT_UNKNOWN);
SDL_SetPaletteColors(shape, &black, 0, 1); SDL_Palette *palette = SDL_CreateSurfacePalette(surface);
SDL_SetPaletteColors(palette, &black, 0, 1);
char messageBuf[256]; char messageBuf[256];

View File

@ -395,10 +395,8 @@ struct SettingsMenuPrivate
{ {
int bpp; int bpp;
Uint32 rMask, gMask, bMask, aMask; Uint32 rMask, gMask, bMask, aMask;
SDL_GetMasksForPixelFormat(SDL_PIXELFORMAT_ABGR8888,
&bpp, &rMask, &gMask, &bMask, &aMask);
//SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8); //SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8);
return SDL_CreateRGBSurface(w, h, rMask, gMask, bMask, 0); return SDL_CreateSurface(w, h, SDL_PIXELFORMAT_ABGR8888);
} }
void fillSurface(SDL_Surface *surf, uint8_t grey){ void fillSurface(SDL_Surface *surf, uint8_t grey){