summaryrefslogtreecommitdiffstats
path: root/libdimension/scene.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-07-29 00:38:18 -0600
committerTavian Barnes <tavianator@gmail.com>2011-07-29 00:38:18 -0600
commit5a8b1d413e98abd10b8ca6b1eb5eb91987f39ebf (patch)
tree705f357b3e8acddce87578f46cb8f9cb013b36eb /libdimension/scene.c
parent9de8a544bc0bae9ebbc2eed10c120a7e14af441e (diff)
downloaddimension-5a8b1d413e98abd10b8ca6b1eb5eb91987f39ebf.tar.xz
Support rendering image subregions.
This is the first step to supporting distributed renders.
Diffstat (limited to 'libdimension/scene.c')
-rw-r--r--libdimension/scene.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libdimension/scene.c b/libdimension/scene.c
index ef597ee..f0ff451 100644
--- a/libdimension/scene.c
+++ b/libdimension/scene.c
@@ -37,6 +37,10 @@ dmnsn_new_scene(void)
scene->default_texture = dmnsn_new_texture();
scene->default_interior = dmnsn_new_interior();
scene->canvas = NULL;
+ scene->region_x = 0;
+ scene->region_y = 0;
+ scene->outer_width = 0;
+ scene->outer_height = 0;
scene->objects = dmnsn_new_array(sizeof(dmnsn_object *));
scene->lights = dmnsn_new_array(sizeof(dmnsn_light *));
scene->camera = NULL;
@@ -83,6 +87,13 @@ dmnsn_initialize_scene(dmnsn_scene *scene)
dmnsn_assert(!scene->initialized, "Texture double-initialized.");
scene->initialized = true;
+ if (scene->outer_width == 0) {
+ scene->outer_width = scene->canvas->width;
+ }
+ if (scene->outer_height == 0) {
+ scene->outer_height = scene->canvas->height;
+ }
+
dmnsn_initialize_texture(scene->default_texture);
if (scene->sky_sphere) {