diff --git a/base.h b/base.h index 11cb10a..2e1198e 100644 --- a/base.h +++ b/base.h @@ -32,10 +32,10 @@ typedef ssize_t Isz; typedef char Glyph; -typedef Glyph* Field_buffer; +typedef Glyph* Gbuffer; typedef struct { - Field_buffer buffer; + Gbuffer buffer; U16 height; U16 width; } Field; diff --git a/field.h b/field.h index 9d9f5e7..7b5406e 100644 --- a/field.h +++ b/field.h @@ -28,7 +28,7 @@ typedef enum { Field_load_error field_load_file(char const* filepath, Field* field); -inline Glyph gbuffer_peek_relative(Field_buffer gbuffer, Usz height, Usz width, +inline Glyph gbuffer_peek_relative(Gbuffer gbuffer, Usz height, Usz width, Usz y, Usz x, Isz delta_y, Isz delta_x) { Isz y0 = (Isz)y + delta_y; Isz x0 = (Isz)x + delta_x; diff --git a/sim.c b/sim.c index fbda7f9..07a2fa2 100644 --- a/sim.c +++ b/sim.c @@ -48,8 +48,8 @@ static inline Glyph glyphs_mod(Glyph a, Glyph b) { return indexed_glyphs[ib == 0 ? 0 : (ia % ib)]; } -static inline bool oper_has_neighboring_bang(Field_buffer gbuf, Usz h, Usz w, - Usz y, Usz x) { +static inline bool oper_has_neighboring_bang(Gbuffer gbuf, Usz h, Usz w, Usz y, + Usz x) { return gbuffer_peek_relative(gbuf, h, w, y, x, 0, 1) == '*' || gbuffer_peek_relative(gbuf, h, w, y, x, 0, -1) == '*' || gbuffer_peek_relative(gbuf, h, w, y, x, 1, 0) == '*' || @@ -57,7 +57,7 @@ static inline bool oper_has_neighboring_bang(Field_buffer gbuf, Usz h, Usz w, } static inline void -oper_move_relative_or_explode(Field_buffer field_buffer, Markmap_buffer markmap, +oper_move_relative_or_explode(Gbuffer field_buffer, Markmap_buffer markmap, Usz field_height, Usz field_width, Glyph moved, Usz y, Usz x, Isz delta_y, Isz delta_x) { Isz y0 = (Isz)y + delta_y;