Improved compile time significantly
This commit is contained in:
@ -135,6 +135,7 @@ namespace Dawn {
|
||||
#if DAWN_DEBUG_BUILD
|
||||
std::vector<struct SceneDebugLine> debugLines;
|
||||
void debugLine(struct SceneDebugLine line);
|
||||
void debugRay(struct SceneDebugRay ray);
|
||||
void debugCube(struct SceneDebugCube cube);
|
||||
void debugOrigin();
|
||||
void debugGrid();
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
namespace Dawn {
|
||||
struct SceneItemComponentRegister {
|
||||
int32_t i;
|
||||
uint8_t i;
|
||||
};
|
||||
|
||||
class SceneItemComponentList {
|
||||
@ -16,10 +16,23 @@ namespace Dawn {
|
||||
std::vector<struct SceneItemComponentRegister> components;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Request the list to append a scene item component of type T
|
||||
* to the registry.
|
||||
*
|
||||
* @tparam T Parameter type of the SceneItemComponent
|
||||
*/
|
||||
template<class T>
|
||||
void append() {
|
||||
struct SceneItemComponentRegister r;
|
||||
this->components.push_back(r);
|
||||
}
|
||||
|
||||
public:
|
||||
/**
|
||||
* Initialies the scene item component list. This constructor is generated
|
||||
* at build time from the scene item component registry tool.
|
||||
*/
|
||||
SceneItemComponentList();
|
||||
};
|
||||
}
|
@ -57,6 +57,14 @@ void Scene::debugLine(struct SceneDebugLine line) {
|
||||
this->debugLines.push_back(line);
|
||||
}
|
||||
|
||||
void Scene::debugRay(struct SceneDebugRay ray) {
|
||||
this->debugLine((struct SceneDebugLine){
|
||||
.v0 = ray.start,
|
||||
.v1 = ray.start + ray.direction,
|
||||
.color = ray.color
|
||||
});
|
||||
}
|
||||
|
||||
void Scene::debugCube(struct SceneDebugCube cube) {
|
||||
auto min = cube.min;
|
||||
auto max = cube.max;
|
||||
|
@ -23,6 +23,12 @@ namespace Dawn {
|
||||
glm::mat4 transform = glm::mat4(1.0f);
|
||||
};
|
||||
|
||||
struct SceneDebugRay {
|
||||
glm::vec3 start;
|
||||
glm::vec3 direction;
|
||||
struct Color color = COLOR_RED;
|
||||
};
|
||||
|
||||
struct SceneDebugLine {
|
||||
glm::vec3 v0 = glm::vec3(0, 0, 0);
|
||||
glm::vec3 v1 = glm::vec3(1, 1, 1);
|
||||
|
Reference in New Issue
Block a user