From 9ca793417149cbaa7b5f4b7797bc929e6e191f28 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Sat, 1 Feb 2025 01:14:03 +0100 Subject: use custom integer types --- lib/nes/app/graphics/image-view.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/nes/app/graphics/image-view.hh') diff --git a/lib/nes/app/graphics/image-view.hh b/lib/nes/app/graphics/image-view.hh index a9b8e94..cde4989 100644 --- a/lib/nes/app/graphics/image-view.hh +++ b/lib/nes/app/graphics/image-view.hh @@ -1,5 +1,7 @@ #pragma once +#include "nes/common/types.hh" + namespace nes::app { struct image_tile; @@ -10,13 +12,13 @@ namespace nes::app class image_view { image_tile const* data_{ nullptr }; - unsigned width_{ 0 }; - unsigned height_{ 0 }; + u32 width_{ 0 }; + u32 height_{ 0 }; public: explicit image_view() = default; - explicit image_view(image_tile const* data, unsigned const width, unsigned const height) + explicit image_view(image_tile const* data, u32 const width, u32 const height) : data_{ data } , width_{ width } , height_{ height } @@ -24,8 +26,8 @@ namespace nes::app } auto get_data() const -> image_tile const* { return data_; } - auto get_width() const -> unsigned { return width_; } - auto get_height() const -> unsigned { return height_; } - auto get(unsigned const x, unsigned const y) const -> image_tile const& { return data_[y * height_ + x]; } + auto get_width() const -> u32 { return width_; } + auto get_height() const -> u32 { return height_; } + auto get(u32 const x, u32 const y) const -> image_tile const& { return data_[y * height_ + x]; } }; } // namespace nes::app \ No newline at end of file -- cgit v1.3.1