Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
planetrendering.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2025 Conquer Space
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <map>
20#include <vector>
21
22#include <entt/entt.hpp>
23#include <glm/glm.hpp>
24
28
31 entt::entity resource;
32};
33
34struct Offset {
35 glm::vec3 offset;
36};
37
39 std::vector<std::tuple<entt::entity, glm::vec3, std::string>> offsets;
40};
41
45
46 void DeleteData() {
47 delete terrain_albedo;
48 delete heightmap;
49 }
50};
51
59 // province_map.size() == province_indices.size() == province_map width * province_map height
60 std::vector<entt::entity> province_map;
61 // Indices for the color on the map
62 // The indices are the index on the province_color
63 std::vector<uint16_t> province_indices;
64 // province_colors.size() == n provinces
65 // rgba of the province colors
66 // the color of the province is province_colors[province_index_map[province_color]]
67 std::vector<glm::vec4> province_colors;
68 // Converts an entity to a value on the province color vector
69 std::unordered_map<entt::entity, uint16_t> province_index_map;
70
71 // Width and height of the province indices vector and the
72 // province map
73 int width = 0;
74 int height = 0;
75 bool has_provinces = false;
76
78 // Delete all the textures that are not from the asset loader
79 delete province_color_map;
81 delete overlay;
82 }
83};
84
85struct OrbitMesh {
87
88 ~OrbitMesh() = default;
89};
90} // namespace cqsp::client::components
Definition: texture.h:32
Definition: framebuffertexture.h:26
Definition: planetrendering.h:29
std::shared_ptr< Mesh > Mesh_t
Definition: mesh.h:43
Definition: planetrendering.h:34
glm::vec3 offset
Definition: planetrendering.h:35
Definition: planetrendering.h:85
engine::Mesh_t orbit_mesh
Definition: planetrendering.h:86
Definition: planetrendering.h:38
std::vector< std::tuple< entt::entity, glm::vec3, std::string > > offsets
Definition: planetrendering.h:39
Definition: planetrendering.h:30
entt::entity resource
Definition: planetrendering.h:31
Definition: planetrendering.h:52
std::vector< entt::entity > province_map
Definition: planetrendering.h:60
bool has_provinces
Definition: planetrendering.h:75
std::vector< glm::vec4 > province_colors
Definition: planetrendering.h:67
asset::Texture * terrain
Definition: planetrendering.h:53
int height
Definition: planetrendering.h:74
asset::Texture * normal
Definition: planetrendering.h:54
engine::FramebufferTexture * overlay
Definition: planetrendering.h:58
asset::Texture * province_color_map
Definition: planetrendering.h:57
std::vector< uint16_t > province_indices
Definition: planetrendering.h:63
int width
Definition: planetrendering.h:73
~PlanetTexture()
Definition: planetrendering.h:77
std::unordered_map< entt::entity, uint16_t > province_index_map
Definition: planetrendering.h:69
asset::Texture * province_index_texture
Definition: planetrendering.h:56
asset::Texture * roughness
Definition: planetrendering.h:55
Definition: planetrendering.h:42
asset::Texture * heightmap
Definition: planetrendering.h:44
void DeleteData()
Definition: planetrendering.h:46
asset::Texture * terrain_albedo
Definition: planetrendering.h:43