twn_fog.c: fog added!
This commit is contained in:
34
src/rendering/twn_fog.c
Normal file
34
src/rendering/twn_fog.c
Normal file
@ -0,0 +1,34 @@
|
||||
#include "twn_rendering.h"
|
||||
#include "twn_rendering_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 push_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();
|
||||
}
|
Reference in New Issue
Block a user