forked from Green-Sky/tomato
update flake and code
This commit is contained in:
parent
d6d91e61f4
commit
9fd2440ec6
16
flake.lock
16
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"
|
||||
}
|
||||
},
|
||||
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user