rendering.c: fix sprite uv in batches, fix alpha blending of texture atlas

This commit is contained in:
2024-07-27 17:55:57 +03:00
parent f5ba4a75bd
commit 910e45a44b
4 changed files with 24 additions and 10 deletions

View File

@@ -75,6 +75,7 @@ static void add_new_atlas(struct texture_cache *cache) {
a_mask);
SDL_FreeFormat(native_format);
SDL_SetSurfaceBlendMode(new_atlas, SDL_BLENDMODE_NONE);
SDL_SetSurfaceRLE(new_atlas, true);
arrput(cache->atlas_surfaces, new_atlas);
arrput(cache->atlas_textures, new_gl_texture());
@@ -108,7 +109,7 @@ static void upload_texture_from_surface(GLuint texture, SDL_Surface *surface) {
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA,
GL_RGBA8,
surface->w,
surface->h,
0,