diff options
Diffstat (limited to 'src/editor.h')
-rw-r--r-- | src/editor.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/editor.h b/src/editor.h index dc908b9..dbf50c0 100644 --- a/src/editor.h +++ b/src/editor.h | |||
@@ -3,10 +3,26 @@ | |||
3 | 3 | ||
4 | #include "state.h" | 4 | #include "state.h" |
5 | #include "vector.h" | 5 | #include "vector.h" |
6 | #include "level.h" | ||
7 | #include "input.h" | ||
8 | #include "input_lag.h" | ||
6 | 9 | ||
7 | class Editor : public State { | 10 | class Editor : public State { |
8 | public: | 11 | public: |
9 | 12 | ||
13 | Editor(SDL_Renderer* ren) : level_(ren) | ||
14 | { | ||
15 | surface_ptr bgSurf(IMG_Load("../res/editor_bg.png")); | ||
16 | |||
17 | if (!bgSurf) | ||
18 | { | ||
19 | throw img_error(); | ||
20 | } | ||
21 | |||
22 | background_.reset(SDL_CreateTextureFromSurface(ren, bgSurf.get())); | ||
23 | bgSize_ = { bgSurf->w, bgSurf->h }; | ||
24 | } | ||
25 | |||
10 | void tick( | 26 | void tick( |
11 | double dt, | 27 | double dt, |
12 | const Uint8* keystate) override; | 28 | const Uint8* keystate) override; |
@@ -15,9 +31,23 @@ public: | |||
15 | 31 | ||
16 | private: | 32 | private: |
17 | 33 | ||
34 | Level level_; | ||
35 | |||
18 | texture_ptr background_; | 36 | texture_ptr background_; |
19 | vec2i bgSize_; | 37 | vec2i bgSize_; |
20 | 38 | ||
39 | texture_ptr renderedMap_; | ||
40 | |||
41 | bool mapFocus_ = true; | ||
42 | vec2s cursor_; | ||
43 | |||
44 | size_t selectedTile_ = 0; | ||
45 | |||
46 | Input input_; | ||
47 | InputLag inputLag_; | ||
48 | |||
49 | Layer layer_ = Layer::map; | ||
50 | |||
21 | }; | 51 | }; |
22 | 52 | ||
23 | #endif /* end of include guard: EDITOR_H_8BB54FE3 */ | 53 | #endif /* end of include guard: EDITOR_H_8BB54FE3 */ |