From 7729aa3962edffc2345c9e7e41b06df660f3beb3 Mon Sep 17 00:00:00 2001 From: redthing1 Date: Tue, 16 Jul 2024 00:01:30 -0700 Subject: [PATCH] rename output_rect --- demo/multiscene/source/play.d | 8 ++++---- source/re/core.d | 2 +- source/re/ng/scene.d | 4 ++-- source/re/ng/scene2d.d | 4 ++-- source/re/ng/scene3d.d | 4 ++-- source/re/ng/viewport.d | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/demo/multiscene/source/play.d b/demo/multiscene/source/play.d index e4dc9cb..63718f0 100644 --- a/demo/multiscene/source/play.d +++ b/demo/multiscene/source/play.d @@ -38,23 +38,23 @@ class PlayScene : Scene2D { // cam following the first box auto cam1_nt = create_entity("cam1"); auto cam1 = cam1_nt.add_component(new SceneCamera2D()); - auto left_half_output_rect = Rectangle( + auto left_half_output_bounds = Rectangle( 0, 0, Core.window.screen_width / 2, Core.window.screen_height ); - auto vp1 = add_viewport(cam1, left_half_output_rect, half_vp_resolution); + auto vp1 = add_viewport(cam1, left_half_output_bounds, half_vp_resolution); auto follow1 = cam1_nt.add_component(new CameraFollow2D(vp1, box1, 0.05)); // cam following the second box auto cam2_nt = create_entity("cam2"); auto cam2 = cam2_nt.add_component(new SceneCamera2D()); - auto right_half_output_rect = Rectangle( + auto right_half_output_bounds = Rectangle( Core.window.screen_width / 2, 0, Core.window.screen_width / 2, Core.window.screen_height ); - auto vp2 = add_viewport(cam2, right_half_output_rect, half_vp_resolution); + auto vp2 = add_viewport(cam2, right_half_output_bounds, half_vp_resolution); auto follow2 = cam2_nt.add_component(new CameraFollow2D(vp2, box2, 0.05)); follow2.follow_rotation = true; } diff --git a/source/re/core.d b/source/re/core.d index 98ca7f9..779e0f0 100644 --- a/source/re/core.d +++ b/source/re/core.d @@ -242,7 +242,7 @@ abstract class Core { foreach (viewport; scene.viewports) { RenderExt.draw_render_target( - viewport.render_target, viewport.output_rect, scene.composite_mode.color + viewport.render_target, viewport.output_bounds, scene.composite_mode.color ); } diff --git a/source/re/ng/scene.d b/source/re/ng/scene.d index 148090f..dfcc82d 100644 --- a/source/re/ng/scene.d +++ b/source/re/ng/scene.d @@ -165,9 +165,9 @@ abstract class Scene { if (viewport.sync_maximized) { // copy output rect from screen bounds - viewport.output_rect = Core.window.screen_bounds; + viewport.output_bounds = Core.window.screen_bounds; viewport.resolution = resolution; // copy resolution - Core.log.info(format("synced viewport to screen bounds: %s", viewport.output_rect)); + Core.log.info(format("synced viewport to screen bounds: %s", viewport.output_bounds)); } // create render target diff --git a/source/re/ng/scene2d.d b/source/re/ng/scene2d.d index eb91dcd..c5f60ae 100644 --- a/source/re/ng/scene2d.d +++ b/source/re/ng/scene2d.d @@ -25,10 +25,10 @@ abstract class Scene2D : Scene { add_viewport(cam, Core.window.screen_bounds, resolution); } - Viewport2D add_viewport(SceneCamera2D cam, Rectangle output_rect, Vector2 resolution) { + Viewport2D add_viewport(SceneCamera2D cam, Rectangle output_bounds, Vector2 resolution) { auto vp = new Viewport2D(); vp.cam = cam; - vp.output_rect = output_rect; + vp.output_bounds = output_bounds; vp.resolution = resolution; vp.render_target = RenderExt.create_render_target( cast(int) vp.resolution.x, cast(int) vp.resolution.y diff --git a/source/re/ng/scene3d.d b/source/re/ng/scene3d.d index 6391d24..43e02ef 100644 --- a/source/re/ng/scene3d.d +++ b/source/re/ng/scene3d.d @@ -25,10 +25,10 @@ abstract class Scene3D : Scene { add_viewport(cam, Core.window.screen_bounds, resolution); } - Viewport3D add_viewport(SceneCamera3D cam, Rectangle output_rect, Vector2 resolution) { + Viewport3D add_viewport(SceneCamera3D cam, Rectangle output_bounds, Vector2 resolution) { auto vp = new Viewport3D(); vp.cam = cam; - vp.output_rect = output_rect; + vp.output_bounds = output_bounds; vp.resolution = resolution; vp.render_target = RenderExt.create_render_target( cast(int) vp.resolution.x, cast(int) vp.resolution.y diff --git a/source/re/ng/viewport.d b/source/re/ng/viewport.d index 9d97058..d01fe8d 100644 --- a/source/re/ng/viewport.d +++ b/source/re/ng/viewport.d @@ -13,8 +13,8 @@ import re.ng.camera.cam3d; abstract class Viewport { /// the render target's texture public RenderTarget render_target; - /// the render target's output rectangle - public Rectangle output_rect; + /// the render target's output bounds: the area of the screen it renders to + public Rectangle output_bounds; /// the render target's resolution public Vector2 resolution;