This repository was archived by the owner on Nov 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.h
More file actions
42 lines (36 loc) · 1.24 KB
/
display.h
File metadata and controls
42 lines (36 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef DISPLAY_H
#define DISPLAY_H
#include "includes.h"
#include "room.h"
#define WINDOW_X 1600
#define WINDOW_Y 900
#define MAX_PATH 128
#define GRAPHICS_ICON "./data/graphics/icon.png"
#define GRAPHICS_MAP_TILESET "./data/graphics/map_tileset.png"
#define GRAPHICS_ROBOT_VISION_TILESET "./data/graphics/robotVision_tileset.png"
#define GRAPHICS_ROBOT_SPRITESHEET "./data/graphics/robot_spritesheet.png"
#define GRAPHICS_FIRE_ANIMATION "./data/graphics/fire_animation.png"
#define FONT_SIZE 32
#define FONT_PATH "./data/calibri.ttf"
#define SOUND_BACKGROUND_MUSIC "./data/sounds/background_theme.mp3"
typedef struct s_SDLData {
SDL_Surface* window;
SDL_Surface* icon;
SDL_Surface* mapTileset;
SDL_Surface* robotVisionTileset;
SDL_Surface* robotSpritesheet;
SDL_Surface* fireAnimation;
TTF_Font* font;
Mix_Music* music;
int fireAnimationStep;
} s_SDLData;
s_SDLData initSDL();
SDL_Rect getRobotSprite(s_robot* robot);
SDL_Rect getMapTileRect(char c);
SDL_Rect getRobotVisionTileRect(char c);
SDL_Rect getFireAnimationStep(char c, s_SDLData* data);
void displayScreen(s_SDLData* data, s_room* room);
void displayBanner(s_SDLData* data, s_robot* robot);
int getEvents(SDL_Event* event);
void freeSDL(s_SDLData* data);
#endif