summaryrefslogtreecommitdiff
path: root/bitmap.h
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-01-23 17:11:38 -0700
committercflip <cflip@cflip.net>2022-01-23 17:11:38 -0700
commit98e2eb0beed4f57461956a10eeae014bf88a51c6 (patch)
treee180295cf1286f8cc4b7127e275746c0c733bc0b /bitmap.h
parent6085e71a3274cfadc0e52a4f2355af0176310df0 (diff)
Simple tile editor
Diffstat (limited to 'bitmap.h')
-rw-r--r--bitmap.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/bitmap.h b/bitmap.h
new file mode 100644
index 0000000..76f2f7a
--- /dev/null
+++ b/bitmap.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <cstdint>
+
+class Bitmap {
+public:
+ Bitmap(int width, int height)
+ : width(width), height(height)
+ {
+ data = new uint32_t[width * height];
+ }
+
+ Bitmap(const char* image);
+
+ ~Bitmap() { delete[] data; }
+
+ void clear(uint32_t colour);
+ void blit(Bitmap const& other, int x, int y, int xc, int yc, int w, int h);
+
+ uint32_t* data;
+ int width, height;
+}; \ No newline at end of file