summaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2019-01-13 19:08:18 +0100
committerSilvan Jegen <s.jegen@gmail.com>2019-01-13 19:08:18 +0100
commitfd98f62956d3558c2d3e36915ce282844af0f5df (patch)
tree363c56bb9c732148f4b517688ede7375705ee80a /render.c
parent4e3b66e4a82f7997ad9f1c2112e2af20728e406d (diff)
Remove uncommented code
Diffstat (limited to 'render.c')
-rw-r--r--render.c47
1 files changed, 6 insertions, 41 deletions
diff --git a/render.c b/render.c
index a713d5e..04a3105 100644
--- a/render.c
+++ b/render.c
@@ -87,46 +87,23 @@ 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 with SDL_RenderCopy?
- // 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);
-
- printf("pixmap_crop x: %d, y: %d, w: %d, h: %d\n",
- pixmap_crop.x, pixmap_crop.y, pixmap_crop.w, pixmap_crop.h);
-
- printf("destination x: %d, y: %d, w: %d, h: %d\n",
- destination.x, destination.y, destination.w, destination.h);
-
- int ret = SDL_RenderCopy(renderer, currentlevel->surf_tiles_tex,
+ int ret = SDL_RenderCopy(renderer, currentlevel->surf_tiles,
&pixmap_crop,
&destination);
- printf("SDL_RenderCopy ret: %d\n", ret);
if (ret < 0 ) {
printf("Error (SDL): %s: %s\n", "could not render copy surf_tiles", SDL_GetError());
}
-
- //printf("surf_tile pitch: %d\n", currentlevel->surf_tiles->pitch);
}
}
- // SDL_RenderPresent(renderer);
- // SDL_Delay(500);
-
/// Entity drawing
// First of all the character
get_pixmap_lemon( currentlevel->player_face, &pixmap_crop );
destination.x = currentlevel->px * TILE_SIZE;
destination.y = currentlevel->py * TILE_SIZE;
- // Draw onto screen
- //SDL_BlitSurface ( currentlevel->surf_entities, &pixmap_crop, surf_screen, &destination );
- //SDL_UpdateTexture(surf_screen, &destination,
- // currentlevel->surf_entities->pixels,
- // currentlevel->surf_entities->pitch);
-
- SDL_RenderCopy(renderer, currentlevel->surf_entities_tex,
+ // Render onto screen
+ SDL_RenderCopy(renderer, currentlevel->surf_entities,
&pixmap_crop,
&destination);
@@ -145,36 +122,24 @@ void render(SDL_Renderer* renderer, struct level_struct *currentlevel, SDL_Textu
destination.x = current_echidna.xpos * TILE_SIZE;
destination.y = current_echidna.ypos * TILE_SIZE;
- // Draw it onscreen
- // SDL_BlitSurface ( currentlevel->surf_entities, &pixmap_crop, surf_screen, &destination );
- // SDL_UpdateTexture(surf_screen, &destination,
- // currentlevel->surf_entities->pixels,
- // currentlevel->surf_entities->pitch);
-
- SDL_RenderCopy(renderer, currentlevel->surf_entities_tex,
+ // Render it onscreen
+ SDL_RenderCopy(renderer, currentlevel->surf_entities,
&pixmap_crop,
&destination);
}
}
- /// Flip screen, so everything we have 'blitted' can now be seen
- //SDL_Flip( surf_screen );
-
- //SDL_RenderClear(renderer);
- //SDL_RenderCopy(renderer, surf_screen, NULL, NULL);
+ // Flip screen, so everything we have 'blitted' can now be seen
SDL_RenderPresent(renderer);
}
void render_a_losingscreen(SDL_Renderer* renderer, struct level_struct *currentlevel, SDL_Texture * surf_screen )
{
// Render a losing screen
- //SDL_BlitSurface ( currentlevel->surf_losingscreens[0], NULL, surf_screen, NULL );
-
SDL_UpdateTexture(surf_screen, NULL,
currentlevel->surf_losingscreens[0]->pixels,
currentlevel->surf_losingscreens[0]->pitch);
- //SDL_Flip( surf_screen );
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, surf_screen, NULL, NULL);