summaryrefslogtreecommitdiff
path: root/lib/nes/app/graphics/image-view.hh
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-01 01:14:03 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-01 01:14:03 +0100
commit9ca793417149cbaa7b5f4b7797bc929e6e191f28 (patch)
tree3f067cad3fe7e606e5e9ea1dd8079874de3f048c /lib/nes/app/graphics/image-view.hh
parent1d5f5482f91391a6dfee9ec0e7cb0a22ee5f0464 (diff)
use custom integer types
Diffstat (limited to 'lib/nes/app/graphics/image-view.hh')
-rw-r--r--lib/nes/app/graphics/image-view.hh14
1 files changed, 8 insertions, 6 deletions
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