aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'map.c')
-rw-r--r--map.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/map.c b/map.c
index b9eb0ac..0cd6532 100644
--- a/map.c
+++ b/map.c
@@ -126,12 +126,16 @@ void render_map(Map* map, int cx, int cy) {
Bitmap bitmap;
Rectangle rect;
- bitmap.pixels = map->pixels;
- bitmap.w = mbmp_w;
- bitmap.h = mbmp_h;
+ get_map_bitmap(map, &bitmap);
rect.x = 0;
rect.y = 0;
rect.w = bitmap.w;
rect.h = bitmap.h;
render_bitmap(&bitmap, -cx >> fbits, -cy >> fbits, &rect);
}
+
+void get_map_bitmap(Map* map, Bitmap* bitmap) {
+ bitmap->pixels = map->pixels;
+ bitmap->w = mbmp_w;
+ bitmap->h = mbmp_h;
+}