generalization of deferred commands and any_gl rendering where appropriate
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
#include "twn_draw.h"
|
||||
#include "twn_draw_c.h"
|
||||
|
||||
#include <stb_ds.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
static float start_cache, end_cache, density_cache;
|
||||
@ -21,7 +23,17 @@ void apply_fog(void) {
|
||||
if (!fog_used)
|
||||
return;
|
||||
|
||||
finally_apply_fog(start_cache, end_cache, density_cache, color_cache);
|
||||
DeferredCommand command = {
|
||||
.type = DEFERRED_COMMAND_TYPE_APPLY_FOG,
|
||||
.apply_fog = (DeferredCommandApplyFog){
|
||||
.start = start_cache,
|
||||
.end = end_cache,
|
||||
.density = density_cache,
|
||||
.color = color_cache
|
||||
}
|
||||
};
|
||||
|
||||
arrpush(deferred_commands, command);
|
||||
}
|
||||
|
||||
|
||||
@ -29,5 +41,9 @@ void pop_fog(void) {
|
||||
if (!fog_used)
|
||||
return;
|
||||
|
||||
finally_pop_fog();
|
||||
DeferredCommand command = {
|
||||
.type = DEFERRED_COMMAND_TYPE_POP_FOG,
|
||||
};
|
||||
|
||||
arrpush(deferred_commands, command);
|
||||
}
|
||||
|
Reference in New Issue
Block a user