|
@ -23,17 +23,31 @@ void markmap_reusable_deinit(Markmap_reusable* map); |
|
|
|
|
|
|
|
|
void mbuffer_clear(Mbuffer map, Usz height, Usz width); |
|
|
void mbuffer_clear(Mbuffer map, Usz height, Usz width); |
|
|
|
|
|
|
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
|
|
|
static Mark_flags mbuffer_peek(Mbuffer map, Usz map_height, Usz map_width, |
|
|
|
|
|
Usz y, Usz x); |
|
|
ORCA_OK_IF_UNUSED |
|
|
ORCA_OK_IF_UNUSED |
|
|
static Mark_flags mbuffer_peek_relative(Mbuffer map, Usz map_height, |
|
|
static Mark_flags mbuffer_peek_relative(Mbuffer map, Usz map_height, |
|
|
Usz map_width, Usz y, Usz x, Isz offs_y, |
|
|
Usz map_width, Usz y, Usz x, Isz offs_y, |
|
|
Isz offs_x); |
|
|
Isz offs_x); |
|
|
ORCA_OK_IF_UNUSED |
|
|
ORCA_OK_IF_UNUSED |
|
|
static void mbuffer_poke_relative(Mbuffer map, Usz map_height, Usz map_width, |
|
|
static void mbuffer_poke_flags_or(Mbuffer map, Usz map_height, Usz map_width, |
|
|
Usz y, Usz x, Isz offs_y, Isz offs_x, |
|
|
Usz y, Usz x, Mark_flags flags); |
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
|
|
|
static void mbuffer_poke_relative_flags_or(Mbuffer map, Usz map_height, |
|
|
|
|
|
Usz map_width, Usz y, Usz x, |
|
|
|
|
|
Isz offs_y, Isz offs_x, |
|
|
Mark_flags flags); |
|
|
Mark_flags flags); |
|
|
|
|
|
|
|
|
// Inline implementation
|
|
|
// Inline implementation
|
|
|
|
|
|
|
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
|
|
|
static Mark_flags mbuffer_peek(Mbuffer map, Usz map_height, Usz map_width, |
|
|
|
|
|
Usz y, Usz x) { |
|
|
|
|
|
(void)map_height; |
|
|
|
|
|
return map[y * map_width + x]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
ORCA_OK_IF_UNUSED |
|
|
static Mark_flags mbuffer_peek_relative(Mbuffer map, Usz map_height, |
|
|
static Mark_flags mbuffer_peek_relative(Mbuffer map, Usz map_height, |
|
|
Usz map_width, Usz y, Usz x, Isz offs_y, |
|
|
Usz map_width, Usz y, Usz x, Isz offs_y, |
|
@ -46,14 +60,10 @@ static Mark_flags mbuffer_peek_relative(Mbuffer map, Usz map_height, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
ORCA_OK_IF_UNUSED |
|
|
static void mbuffer_poke_relative(Mbuffer map, Usz map_height, Usz map_width, |
|
|
static void mbuffer_poke_flags_or(Mbuffer map, Usz map_height, Usz map_width, |
|
|
Usz y, Usz x, Isz offs_y, Isz offs_x, |
|
|
Usz y, Usz x, Mark_flags flags) { |
|
|
Mark_flags flags) { |
|
|
(void)map_height; |
|
|
Isz y0 = (Isz)y + offs_y; |
|
|
map[y * map_width + x] |= (U8)flags; |
|
|
Isz x0 = (Isz)x + offs_x; |
|
|
|
|
|
if (y0 >= (Isz)map_height || x0 >= (Isz)map_width || y0 < 0 || x0 < 0) |
|
|
|
|
|
return; |
|
|
|
|
|
map[(Usz)y0 * map_width + (Usz)x0] = (U8)flags; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
ORCA_OK_IF_UNUSED |
|
@ -67,17 +77,3 @@ static void mbuffer_poke_relative_flags_or(Mbuffer map, Usz map_height, |
|
|
return; |
|
|
return; |
|
|
map[(Usz)y0 * map_width + (Usz)x0] |= (U8)flags; |
|
|
map[(Usz)y0 * map_width + (Usz)x0] |= (U8)flags; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
|
|
|
static void mbuffer_poke_flags_or(Mbuffer map, Usz map_height, Usz map_width, |
|
|
|
|
|
Usz y, Usz x, Mark_flags flags) { |
|
|
|
|
|
(void)map_height; |
|
|
|
|
|
map[y * map_width + x] |= (U8)flags; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ORCA_OK_IF_UNUSED |
|
|
|
|
|
static Mark_flags mbuffer_peek(Mbuffer map, Usz map_height, Usz map_width, |
|
|
|
|
|
Usz y, Usz x) { |
|
|
|
|
|
(void)map_height; |
|
|
|
|
|
return map[y * map_width + x]; |
|
|
|
|
|
} |
|
|
|
|
|