-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainView.h
More file actions
53 lines (41 loc) · 1.14 KB
/
mainView.h
File metadata and controls
53 lines (41 loc) · 1.14 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
43
44
45
46
47
48
49
50
51
52
53
#ifndef __MAINVIEW_H__
#define __MAINVIEW_H__
#include <iostream>
#include <SDL2/include/SDL.h>
#include <SDL2/include/SDL_ttf.h>
#include <SDL2/include/SDL_image.h>
#include <stdlib.h>
#include <fstream>
#include <string>
#include "error.h"
#define taille_map 20
class MainView
{
public:
MainView(SDL_Renderer *renderer, std::string map_file, int w_fenetre, int h_fenetre);
~MainView();
void scrolling_right();
void scrolling_left();
void scrolling_up();
void scrolling_down();
void set_tile_at_screen(int x, int y, int tile_id);
void draw_palette(int x, int y);
void save_map(std::string filename);
void show();
private:
void blitMap();
std::string load_map(std::string filename);
void load_tiles_image(std::string image_name);
void mapTableAllocation(int wmax, int hmax);
SDL_Renderer *m_renderer;
SDL_Texture *m_tiles_image;
SDL_Rect m_tiles_image_rect;
int **m_tiles_position;
std::string m_tiles_image_name;
int **m_colision_position;
int h_tiles, w_tiles;
int m_wfenetre, m_hfenetre;
int m_nb_wmap, m_nb_hmap;
int scrolling_number_right, scrolling_number_up;
};
#endif