From a236f83d8cd680f956677ac6d65f0a953036e144 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 19 Feb 2021 10:02:23 +0300 Subject: Room can be loaded. --- src/texture.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/texture.c (limited to 'src/texture.c') diff --git a/src/texture.c b/src/texture.c new file mode 100644 index 0000000..3606274 --- /dev/null +++ b/src/texture.c @@ -0,0 +1,22 @@ +#include "texture.h" + + +const SDL_Rect tt_texture_floor = { 16 * 7, 0, 16, 16 }; +const SDL_Rect tt_texture_corner_lu = { 16 * 5, 0, 16, 16 }; +const SDL_Rect tt_texture_corner_ru = { 16 * 6, 0, 16, 16 }; +const SDL_Rect tt_texture_corner_ld = { 16 * 5, 16, 16, 16 }; +const SDL_Rect tt_texture_corner_rd = { 16 * 6, 16, 16, 16 }; +const SDL_Rect tt_texture_wall_l = { 16 * 8, 0, 16, 16 }; +const SDL_Rect tt_texture_wall_r = { 16 * 8, 16, 16, 16 }; +const SDL_Rect tt_texture_wall_u = { 16 * 9, 0, 16, 16 }; +const SDL_Rect tt_texture_wall_d = { 16 * 9, 16, 16, 16 }; +const SDL_Rect tt_texture_player = { 0, 0, 0, 0 }; + + +SDL_Texture *tt_texture_load(SDL_Renderer *rdr) +{ + SDL_Surface *surf = SDL_LoadBMP("data/textures.bmp"); + SDL_Texture *res = SDL_CreateTextureFromSurface(rdr, surf); + SDL_FreeSurface(surf); + return res; +} -- cgit v1.2.3