summaryrefslogtreecommitdiff
path: root/src/objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/object.cc2
-rw-r--r--src/objects/pass.cc31
-rw-r--r--src/objects/scene.cc6
3 files changed, 23 insertions, 16 deletions
diff --git a/src/objects/object.cc b/src/objects/object.cc
index 4cf9790..6240c30 100644
--- a/src/objects/object.cc
+++ b/src/objects/object.cc
@@ -1,3 +1,5 @@
+#include "../log.h"
+
#include "object.h"
#include "scene.h"
#include "pass.h"
diff --git a/src/objects/pass.cc b/src/objects/pass.cc
index 0ed32ae..dc19378 100644
--- a/src/objects/pass.cc
+++ b/src/objects/pass.cc
@@ -1,5 +1,6 @@
#include "../gl.h"
-#include "../context.h"
+//#define AL_LOG_ENABLE_TRACE
+#include "../log.h"
#include "pass.h"
@@ -271,14 +272,13 @@ RenderPass::RenderPass(Engine *engine, Pass *pass)
}
}
-#ifdef _DEBUG_
- debug("PASS (%s)", this->command == COPY ? "copy" : "draw");
- debug(" object: %s (passthrough: %s, fullscreen %s)", this->object->name.c_str(),
+ trace("PASS (%s)", this->command == COPY ? "copy" : "draw");
+ trace(" object: %s (passthrough: %s, fullscreen %s)", this->object->name.c_str(),
BOOLSTR(this->object->passthrough), BOOLSTR(this->object->fullscreen));
- debug(" visible: %s", BOOLSTR(this->object->visible));
- debug(" shader: %s", this->shader->origin()->name.c_str());
- debug(" target: %s", pass->target.c_str());
- debug(" textures (%u):", this->shader->origin()->texture_count);
+ trace(" visible: %s", BOOLSTR(this->object->visible));
+ trace(" shader: %s", this->shader->origin()->name.c_str());
+ trace(" target: %s", pass->target.c_str());
+ trace(" textures (%u):", this->shader->origin()->texture_count);
for (u32 i = 0; i < this->shader->origin()->texture_count; i++)
{
switch (this->texture_types[i])
@@ -286,27 +286,26 @@ RenderPass::RenderPass(Engine *engine, Pass *pass)
case STATIC:
if (!this->shader->origin()->textures[i].empty() && pass->textures[i] == this->shader->origin()->textures[i])
{
- debug(" [%u] %s (DEFAULT)", i, this->shader->origin()->textures[i].c_str());
+ trace(" [%u] %s (DEFAULT)", i, this->shader->origin()->textures[i].c_str());
}
else
{
- debug(" [%u] %s", i, pass->textures[i].c_str());
+ trace(" [%u] %s", i, pass->textures[i].c_str());
}
break;
case PREVIOUS:
- debug(" [%u] previous", i);
+ trace(" [%u] previous", i);
break;
}
}
- debug(" uniforms (%u)", this->shader->uniforms.size());
+ trace(" uniforms (%u)", this->shader->uniforms.size());
for (Uniform *uniform : this->shader->uniforms)
{
- debug(" %s %s %s", uniform_type_to_string(uniform->type).c_str(),
+ trace(" %s %s %s", uniform_type_to_string(uniform->type).c_str(),
uniform->uname.c_str(), glm::to_string(*uniform->value).c_str());
}
- debug(" model: %s", BOOLSTR(this->model));
- debug(" combine: %s", BOOLSTR(this->combine));
-#endif
+ trace(" model: %s", BOOLSTR(this->model));
+ trace(" combine: %s", BOOLSTR(this->combine));
}
auto RenderPass::draw(Engine *engine) -> void
diff --git a/src/objects/scene.cc b/src/objects/scene.cc
index b9728c7..fa03622 100644
--- a/src/objects/scene.cc
+++ b/src/objects/scene.cc
@@ -37,6 +37,12 @@ auto Scene::parse(const std::string &path) -> Scene *
if (obj) scene->objects.emplace_back(obj);
}
+ if ((scene->width == 0 || scene->height == 0) && scene->objects.size() > 0)
+ {
+ scene->width = scene->objects[0]->size[0];
+ scene->height = scene->objects[0]->size[1];
+ }
+
return scene;
}