diff --git a/main.cxx b/main.cxx index b4e726c..792cb9d 100644 --- a/main.cxx +++ b/main.cxx @@ -90,10 +90,10 @@ struct sparse_entry_t { } g_a[Y][X]; // marker particle data -const size_t N = 4*Y*X; +const size_t k_max_marker_count = 4*Y*X; size_t g_markers_length; bool g_source_exhausted; -vec2f g_markers[N]; +vec2f g_markers[k_max_marker_count]; uint8_t g_marker_count[Y][X]; uint8_t g_old_marker_count[Y][X]; @@ -301,7 +301,6 @@ void sim_init(args_t in) { if (g_rainbow_enabled) { colorize(); } - } void update_fluid_sources() { @@ -309,7 +308,7 @@ void update_fluid_sources() { // The current extrapolation implementation assumes that the fluid is never // more than one cell from a cell where fluid was in the previous step. If // we stop and then later restart generating fluid, that may not hold true. - g_source_exhausted |= (g_markers_length == N-1); + g_source_exhausted |= (g_markers_length == k_max_marker_count-1); float t = 0.6f / k_source_color_period * g_frame_count; for (size_t y = 0; y < Y; ++y) { @@ -318,7 +317,7 @@ void update_fluid_sources() { if (!g_source_exhausted && g_marker_count[y][x] < 4) { g_markers[g_markers_length++] = k_s*vec2f{x+g_rng(), y+g_rng()}; g_marker_count[y][x]++; - g_source_exhausted |= (g_markers_length == N-1); + g_source_exhausted |= (g_markers_length == k_max_marker_count-1); } g_r[y][x] = hsv_basis(t + 2.f); g_g[y][x] = hsv_basis(t);