This commit is contained in:
ZakatTeamI2P 2026-03-31 00:12:07 +04:00
commit adfa3b703e
4 changed files with 51 additions and 0 deletions

View file

@ -13,6 +13,17 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
## Setup main source ##
# oldimpls dir stuff
set(OLDIMPLS_HEADERS
src/oldimpls/include.h
src/oldimpls/sdl/include.h
)
set(OLDIMPLS_SOURCE
src/oldimpls/sdl/rgb-surfaces.cpp
)
# main stuff
set(MAIN_HEADERS
src/quadarray.h
src/audio.h
@ -74,6 +85,7 @@ set(MAIN_HEADERS
chromasdk/RzErrors.h
chromasdk/ChromaApi.h
src/i18n.h
${OLDIMPLS_HEADERS}
)
set(MAIN_SOURCE
@ -116,6 +128,7 @@ set(MAIN_SOURCE
src/oneshot.cpp
src/screen.cpp
src/i18n.cpp
${OLDIMPLS_SOURCE}
)
if(WIN32)

1
src/oldimpls/include.h Normal file
View file

@ -0,0 +1 @@
#include "sdl/include.h"

View file

@ -0,0 +1,11 @@
#ifndef _OLDIMPLS_SDL_INCLUDE_H
#define _OLDIMPLS_SDL_INCLUDE_H
#include <SDL3/SDL_surface.h>
static SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
static SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format);
static SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
static SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
#endif

View file

@ -0,0 +1,26 @@
#include "include.h"
// taken from: https://wiki.libsdl.org/SDL3/README-migration#sdl_surfaceh
static SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
{
return SDL_CreateSurface(width, height,
SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask));
}
static SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format)
{
return SDL_CreateSurface(width, height, (SDL_PixelFormat)format);
}
static SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
{
return SDL_CreateSurfaceFrom(width, height,
SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask),
pixels, pitch);
}
static SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format)
{
return SDL_CreateSurfaceFrom(width, height, (SDL_PixelFormat)format, pixels, pitch);
}