From 92a4fbb74a151038391ddc03cb48e6b567776a0d Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 13 Jan 2019 17:42:01 +0100 Subject: Fix pixel format issues --- render.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 2e8e97d..4e5db41 100644 --- a/render.c +++ b/render.c @@ -87,6 +87,8 @@ void render(SDL_Renderer* renderer, struct level_struct *currentlevel, SDL_Textu /// Draw this tile onto the screen //SDL_BlitSurface ( currentlevel->surf_tiles, &pixmap_crop, surf_screen, &destination ); + // TODO: use pixmap_crop + // printf("surf_tile format: %s\n", SDL_GetPixelFormatName(currentlevel->surf_tiles->format->format)); SDL_UpdateTexture(surf_screen, &destination, currentlevel->surf_tiles->pixels, currentlevel->surf_tiles->pitch); @@ -122,7 +124,7 @@ void render(SDL_Renderer* renderer, struct level_struct *currentlevel, SDL_Textu // Draw it onscreen // SDL_BlitSurface ( currentlevel->surf_entities, &pixmap_crop, surf_screen, &destination ); - SDL_UpdateTexture(surf_screen, &destination, + SDL_UpdateTexture(surf_screen, &destination, currentlevel->surf_entities->pixels, currentlevel->surf_entities->pitch); } -- cgit v1.2.1-18-gbd029