# HG changeset patch # User Mike Becker # Date 1769351843 -3600 # Node ID f4f7886f10f0e2be0d2fab7c9805258259184aa1 # Parent c72df1f06671bf2b28d23469d0b094a664156813 recreate player sprite from scratch and remove all the interpolation noise diff -r c72df1f06671 -r f4f7886f10f0 demo/snake/snake.c --- a/demo/snake/snake.c Sun Jan 25 14:07:50 2026 +0100 +++ b/demo/snake/snake.c Sun Jan 25 15:37:23 2026 +0100 @@ -126,9 +126,14 @@ } static void textures_init(void) { - asc_texture_init_2d(tex2d, TEXTURE_2D_COUNT); + // don't use interpolation for pixel art + asc_texture_init(tex2d, 2, ASC_TEXTURE_2D, + ASC_TEXTURE_MIN_FILTER_NEAREST, ASC_TEXTURE_MAG_FILTER_NEAREST); asc_texture_from_file(TEXTURE_PLAYER, "player.png"); asc_texture_from_file(TEXTURE_PLAYER_COLOR_MAP, "player-color-map.png"); + // interpolate larger, not pixelated, textures + asc_texture_init(tex2d+2, 1, ASC_TEXTURE_2D, + ASC_TEXTURE_MIN_FILTER_LINEAR, ASC_TEXTURE_MAG_FILTER_LINEAR); asc_texture_from_file(TEXTURE_BACKDROP, "backdrop.png"); asc_gl_context_add_cleanup_func(asc_active_glctx, textures_destroy); } diff -r c72df1f06671 -r f4f7886f10f0 demo/snake/textures/player-color-map.png Binary file demo/snake/textures/player-color-map.png has changed diff -r c72df1f06671 -r f4f7886f10f0 demo/snake/textures/player.png Binary file demo/snake/textures/player.png has changed diff -r c72df1f06671 -r f4f7886f10f0 src/ascension/texture.h --- a/src/ascension/texture.h Sun Jan 25 14:07:50 2026 +0100 +++ b/src/ascension/texture.h Sun Jan 25 15:37:23 2026 +0100 @@ -80,14 +80,6 @@ void asc_texture_destroy(AscTexture *tex, unsigned count); -#define asc_texture_init_rectangle(tex, count) \ - asc_texture_init(tex, count, ASC_TEXTURE_RECTANGLE, \ - ASC_TEXTURE_MIN_FILTER_NEAREST, ASC_TEXTURE_MAG_FILTER_NEAREST) - -#define asc_texture_init_2d(tex, count) \ - asc_texture_init(tex, count, ASC_TEXTURE_2D, \ - ASC_TEXTURE_MIN_FILTER_LINEAR, ASC_TEXTURE_MAG_FILTER_LINEAR) - void asc_texture_bind(const AscTexture *tex, int uniform_location, int unit); void asc_texture_from_surface(AscTexture *tex, const SDL_Surface *surface); diff -r c72df1f06671 -r f4f7886f10f0 src/text.c --- a/src/text.c Sun Jan 25 14:07:50 2026 +0100 +++ b/src/text.c Sun Jan 25 15:37:23 2026 +0100 @@ -167,7 +167,8 @@ // initialize texture // mesh will be created in the update func text->texture = cxMallocDefault(sizeof(AscTexture)); - asc_texture_init_rectangle(text->texture, 1); + asc_texture_init(text->texture, 1, ASC_TEXTURE_RECTANGLE, + ASC_TEXTURE_MIN_FILTER_NEAREST, ASC_TEXTURE_MAG_FILTER_NEAREST); // basic node properties asc_scene_node_init(node,