summaryrefslogtreecommitdiff
path: root/lib/nes/app/graphics/renderer.hh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nes/app/graphics/renderer.hh')
-rw-r--r--lib/nes/app/graphics/renderer.hh24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/nes/app/graphics/renderer.hh b/lib/nes/app/graphics/renderer.hh
index 7b46461..5de3dcd 100644
--- a/lib/nes/app/graphics/renderer.hh
+++ b/lib/nes/app/graphics/renderer.hh
@@ -1,7 +1,7 @@
#pragma once
+#include "nes/common/types.hh"
#include <string_view>
-#include <cstdint>
namespace nes
{
@@ -14,7 +14,7 @@ namespace nes::app
struct image_tile;
struct mask_tile;
class image_view;
- enum class color : std::uint8_t;
+ enum class color : u8;
/// Renders tiles and other primitive shapes onto a display.
///
@@ -25,8 +25,8 @@ namespace nes::app
display& display_;
public:
- static constexpr auto width = unsigned{ 32 };
- static constexpr auto height = unsigned{ 30 };
+ static constexpr auto width = u32{ 32 };
+ static constexpr auto height = u32{ 30 };
explicit renderer(display&);
@@ -36,23 +36,23 @@ namespace nes::app
auto operator=(renderer&&) -> renderer& = delete;
/// If set, add a drop shadow behind newly drawn opaque elements.
- auto set_shadow(unsigned x_px, unsigned y_px, color) -> void;
+ 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(unsigned px, color) -> void;
+ auto set_border(u32 px, color) -> void;
/// Render a colored tile at the given tile coordinates.
- auto render_image_tile(unsigned x, unsigned y, image_tile) -> void;
+ auto render_image_tile(u32 x, u32 y, image_tile const&) -> void;
/// Render an alpha-only tile at the given tile coordinates with the given color.
- auto render_mask_tile(unsigned x, unsigned y, mask_tile, color) -> void;
+ auto render_mask_tile(u32 x, u32 y, mask_tile, color) -> void;
/// Render an image at the given tile coordinates.
- auto render_image(unsigned x, unsigned y, image_view) -> void;
+ auto render_image(u32 x, u32 y, image_view) -> void;
/// Render a string of text at the given tile coordinates (one tile per character).
- auto render_text(unsigned x, unsigned y, std::string_view, color) -> void;
+ auto render_text(u32 x, u32 y, std::string_view, color) -> void;
/// Render a string of text at the given tile coordinates, limiting its length to the given width and
/// ellipsizing afterward.
- auto render_text(unsigned x, unsigned y, std::string_view, unsigned width, color) -> void;
+ auto render_text(u32 x, u32 y, std::string_view, u32 width, color) -> void;
/// Render a rectangle at the given tile coordinates with a given size (measured in tiles).
- auto render_rect(unsigned x, unsigned y, unsigned width, unsigned height, color) -> void;
+ auto render_rect(u32 x, u32 y, u32 width, u32 height, color) -> void;
/// Completely fill the screen.
auto render_fill(color) -> void;