You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.4 KiB
85 lines
1.4 KiB
|
|
#pragma once |
|
|
|
#include <vector> |
|
|
|
#if defined (_WIN32) |
|
#include <SDL.h> |
|
#else |
|
#include <SDL2/SDL.h> |
|
#endif |
|
|
|
#include <glm/glm.hpp> |
|
|
|
#include "entity.h" |
|
#include "hexlib.h" |
|
#include "mesh.h" |
|
#include "util.h" |
|
|
|
|
|
// TODO: should move this to renderer.h |
|
struct SDL_Handles |
|
{ |
|
SDL_Window *window; |
|
SDL_GLContext glContext; |
|
SDL_DisplayMode currentDisplayMode; |
|
std::vector<SDL_Surface*> texSurfaces; |
|
}; |
|
|
|
struct hex_info |
|
{ |
|
int32 hexID = 0; |
|
Hex hex = {}; |
|
real64 XPos = 0; |
|
real64 YPos = 0; |
|
uint32 current_color = 0; // RGBA |
|
uint32 stored_color = 0; // RGBA |
|
bool selected = false; |
|
std::vector<Point> vertices; |
|
}; |
|
|
|
enum HexDrawMode |
|
{ |
|
NONE, |
|
FILL, |
|
LINE, |
|
CONE_FILL, |
|
PATHFINDING |
|
}; |
|
|
|
struct render_state |
|
{ |
|
v2i viewport_dims; |
|
bool is_debug_draw; |
|
uint32 fill_color; |
|
uint32 selected_fill_color; |
|
}; |
|
|
|
struct game_state |
|
{ |
|
std::vector<hex_info> *hex_array; |
|
hex_info *start_hex; |
|
hex_info *current_hex; |
|
vector<hex_info> selected_hexes; |
|
HexDrawMode draw_mode; |
|
const Layout hex_layout; |
|
|
|
// TODO: WiP |
|
uint32 entity_count = 0; |
|
Entity* entities = nullptr; |
|
|
|
// camera movement controls |
|
bool is_selecting = false; |
|
bool is_camera_rotate = false; |
|
bool is_moveforward = false; |
|
bool is_movebackward = false; |
|
bool is_moveup = false; |
|
bool is_movedown = false; |
|
bool is_moveleft = false; |
|
bool is_moveright = false; |
|
bool is_rotateCW = false; |
|
bool is_rotateCCW = false; |
|
|
|
game_state(Layout &l) : hex_layout(l) {} |
|
}; |
|
|
|
|