diff options
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");
}
|