summaryrefslogtreecommitdiff
path: root/lib/nes/app/graphics
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-04 23:39:24 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-04 23:39:24 +0100
commit64308c9e520dbd8e72b675d0ba064ecdaf9bd494 (patch)
treeff8dc176d62340df9565e424f19b9d6349c4e8b8 /lib/nes/app/graphics
parent79553ab1fa3d707612e80dd03bf95ca65fa0c411 (diff)
add error handling to ui
Diffstat (limited to 'lib/nes/app/graphics')
-rw-r--r--lib/nes/app/graphics/renderer.cc2
-rw-r--r--lib/nes/app/graphics/renderer.hh9
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/nes/app/graphics/renderer.cc b/lib/nes/app/graphics/renderer.cc
index 6429a52..d512e71 100644
--- a/lib/nes/app/graphics/renderer.cc
+++ b/lib/nes/app/graphics/renderer.cc
@@ -129,7 +129,7 @@ namespace nes::app
i32 const x, i32 const y, u32 const width, u32 const height, color const c) -> void
{
if (c == color::transparent) { return; }
- if (x >= static_cast<i32>(width) || y >= static_cast<i32>(height)) { return; }
+ if (x >= static_cast<i32>(renderer::width) || y >= static_cast<i32>(renderer::height)) { return; }
auto const resolved = resolve_color(c);
auto const x_stop = std::min(x + static_cast<i32>(width), static_cast<i32>(renderer::width));
diff --git a/lib/nes/app/graphics/renderer.hh b/lib/nes/app/graphics/renderer.hh
index cfc1889..9b764a6 100644
--- a/lib/nes/app/graphics/renderer.hh
+++ b/lib/nes/app/graphics/renderer.hh
@@ -20,8 +20,8 @@ namespace nes::app
/// Renders tiles and other primitive shapes onto a display.
///
- /// The renderer sees the display as a canvas divided into 8x8 tiles. All elements (except shadows and borders) must
- /// be arranged on this 8x8 grid.
+ /// The renderer sees the display as a canvas divided into 8x8 tiles. All elements must be arranged on this 8x8
+ /// grid.
class renderer
{
display& display_;
@@ -37,11 +37,6 @@ namespace nes::app
auto operator=(renderer const&) -> renderer& = delete;
auto operator=(renderer&&) -> renderer& = delete;
- /// If set, add a drop shadow behind newly drawn opaque elements.
- auto set_shadow(u32 x_px, u32 y_px, color) -> void;
- /// If set, add an inner border inside newly drawn opaque elements.
- auto set_border(u32 px, color) -> void;
-
/// Render a colored tile at the given tile coordinates.
auto render_image_tile(i32 x, i32 y, image_tile const&) -> void;
/// Render an alpha-only tile at the given tile coordinates with the given color.