diff --git a/flake.lock b/flake.lock index 03d5d29..8d99453 100644 --- a/flake.lock +++ b/flake.lock @@ -63,34 +63,34 @@ "sdl3": { "flake": false, "locked": { - "lastModified": 1718035458, - "narHash": "sha256-PGt/GfYUuT7u8UjIU4wvIJhBIMG+wq/fYasSW/4Y00k=", + "lastModified": 1721156595, + "narHash": "sha256-BamJ5xK2uEHv1Q5AM2aNYk+ZDsrKCVsyZ4ium7pTTis=", "owner": "libsdl-org", "repo": "SDL", - "rev": "657c0135b1ff1685afa1bad63b0417d92f4bcb46", + "rev": "d65a8146b950abe31b4fbf779f3e2fea731af9bd", "type": "github" }, "original": { "owner": "libsdl-org", "repo": "SDL", - "rev": "657c0135b1ff1685afa1bad63b0417d92f4bcb46", + "rev": "d65a8146b950abe31b4fbf779f3e2fea731af9bd", "type": "github" } }, "sdl3_image": { "flake": false, "locked": { - "lastModified": 1717528558, - "narHash": "sha256-VS5GMxcJgmghmck1FoGJmrt94ubtBr9eGQUmYEMoUZQ=", + "lastModified": 1721253495, + "narHash": "sha256-mZjO5Tfu6TyGGC/2AduzOqKHW9NdH4oSzyVGjipW5bQ=", "owner": "libsdl-org", "repo": "SDL_image", - "rev": "8eff782fa33d795c9ea1ac42dbe7e17cc9874c78", + "rev": "8abc07df88cc035997e797967ac2f479b0e50981", "type": "github" }, "original": { "owner": "libsdl-org", "repo": "SDL_image", - "rev": "8eff782fa33d795c9ea1ac42dbe7e17cc9874c78", + "rev": "8abc07df88cc035997e797967ac2f479b0e50981", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 429745a..2fdbb9a 100644 --- a/flake.nix +++ b/flake.nix @@ -11,11 +11,11 @@ flake = false; }; sdl3 = { - url = "github:libsdl-org/SDL/657c0135b1ff1685afa1bad63b0417d92f4bcb46"; # keep in sync this cmake + url = "github:libsdl-org/SDL/d65a8146b950abe31b4fbf779f3e2fea731af9bd"; # keep in sync this cmake flake = false; }; sdl3_image = { - url = "github:libsdl-org/SDL_image/8eff782fa33d795c9ea1ac42dbe7e17cc9874c78"; + url = "github:libsdl-org/SDL_image/8abc07df88cc035997e797967ac2f479b0e50981"; flake = false; }; }; diff --git a/src/image_loader_sdl_bmp.cpp b/src/image_loader_sdl_bmp.cpp index 0a65605..709ba76 100644 --- a/src/image_loader_sdl_bmp.cpp +++ b/src/image_loader_sdl_bmp.cpp @@ -33,7 +33,7 @@ ImageLoaderSDLBMP::ImageResult ImageLoaderSDLBMP::loadFromMemoryRGBA(const uint8 return res; } - SDL_Surface* conv_surf = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_RGBA32); + SDL_Surface* conv_surf = SDL_ConvertSurface(surf, SDL_PIXELFORMAT_RGBA32); SDL_DestroySurface(surf); if (conv_surf == nullptr) { return res; diff --git a/src/image_loader_sdl_image.cpp b/src/image_loader_sdl_image.cpp index ef52368..892a8b5 100644 --- a/src/image_loader_sdl_image.cpp +++ b/src/image_loader_sdl_image.cpp @@ -89,7 +89,7 @@ ImageLoaderSDLImage::ImageResult ImageLoaderSDLImage::loadFromMemoryRGBA(const u } for (int i = 0; i < anim->count; i++) { - SDL_Surface* conv_surf = SDL_ConvertSurfaceFormat(anim->frames[i], SDL_PIXELFORMAT_RGBA32); + SDL_Surface* conv_surf = SDL_ConvertSurface(anim->frames[i], SDL_PIXELFORMAT_RGBA32); if (conv_surf == nullptr) { return res; } diff --git a/src/sdlrenderer_texture_uploader.cpp b/src/sdlrenderer_texture_uploader.cpp index f518eda..fc1798e 100644 --- a/src/sdlrenderer_texture_uploader.cpp +++ b/src/sdlrenderer_texture_uploader.cpp @@ -14,16 +14,16 @@ SDLRendererTextureUploader::SDLRendererTextureUploader(SDL_Renderer* renderer_) uint64_t SDLRendererTextureUploader::uploadRGBA(const uint8_t* data, uint32_t width, uint32_t height, Filter filter, Access access) { // TODO: test if pitch is 4 or 4*width SDL_Surface* surf = SDL_CreateSurfaceFrom( - (void*)data, width, height, - 4*width, - SDL_PIXELFORMAT_RGBA32 // auto big/little + SDL_PIXELFORMAT_RGBA32, // auto big/little + (void*)data, + 4*width ); assert(surf); // TODO: add error reporting SDL_Texture* tex = SDL_CreateTexture( renderer, - surf->format->format, + surf->format, access == Access::STREAMING ? SDL_TEXTUREACCESS_STREAMING : SDL_TEXTUREACCESS_STATIC, surf->w, surf->h );