townengine/src/rendering/twn_fog.c
2024-10-22 10:39:40 +03:00

34 lines
592 B
C

#include "twn_draw.h"
#include "twn_draw_c.h"
#include <stdbool.h>
static float start_cache, end_cache, density_cache;
static Color color_cache;
static bool fog_used = false;
void draw_fog(float start, float end, float density, Color color) {
start_cache = start;
end_cache = end;
density_cache = density;
color_cache = color;
fog_used = true;
}
void apply_fog(void) {
if (!fog_used)
return;
finally_apply_fog(start_cache, end_cache, density_cache, color_cache);
}
void pop_fog(void) {
if (!fog_used)
return;
finally_pop_fog();
}