diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2019-01-13 17:12:17 +0100 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2019-01-13 17:13:30 +0100 |
commit | 54bb3b30f1a625e48621a9b139127e7a2dd82561 (patch) | |
tree | 018e927eeaf7234cc11cfa90fd090bffed872f6f /level.c | |
parent | 86432dccc8e223959a10a13dd2897deba5f1376d (diff) |
Switch back to surfaces
Diffstat (limited to 'level.c')
-rw-r--r-- | level.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -66,14 +66,14 @@ struct level_struct int sx, sy; // Player X and Y starting positions
// Resources
- SDL_Texture * surf_entities; // Player and echidna pictures
- SDL_Texture * surf_tiles; // Level tiles/squares
+ SDL_Surface * surf_entities; // Player and echidna pictures
+ SDL_Surface * surf_tiles; // Level tiles/squares
// A various selection of losing screens
- SDL_Texture * surf_losingscreens[5];
+ SDL_Surface * surf_losingscreens[5];
// The screen to display when the game ends
- SDL_Texture * surf_winning_screen;
+ SDL_Surface * surf_winning_screen;
// Up to ten echidnas
struct echidna echidnas[10];
@@ -102,18 +102,13 @@ void eat_until_newline( FILE *currentfile ) void level_load_resources(SDL_Renderer* renderer, struct level_struct *level )
{
// Load the images for things into their own 'surfaces'
- SDL_Surface* surf_entities = IMG_Load( "entities.png" );
- level->surf_entities = SDL_CreateTextureFromSurface(renderer, surf_entities);
+ level->surf_entities = IMG_Load( "entities.png" );
- SDL_Surface* surf_tiles = IMG_Load( "tiles.png" );
- level->surf_tiles = SDL_CreateTextureFromSurface(renderer, surf_tiles);
+ level->surf_tiles = IMG_Load( "tiles.png" );
// Do the same for the losing screens
- SDL_Surface* surf_losingscreen = IMG_Load("failscreen_01.png");
- level->surf_losingscreens[0] = SDL_CreateTextureFromSurface(renderer, surf_losingscreen);
-
- SDL_Surface* surf_winning_screen = IMG_Load("winningscreen.png");
- level->surf_winning_screen = SDL_CreateTextureFromSurface(renderer, surf_winning_screen);
+ level->surf_losingscreens[0] = IMG_Load("failscreen_01.png");
+ level->surf_winning_screen = IMG_Load("winningscreen.png");
}
|