#include "twn_draw.h"
#include "twn_draw_c.h"
#include "twn_util.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();
}
