aboutsummaryrefslogtreecommitdiff
path: root/src/effect.c
blob: 65daad1b5ffcc5ee678cd55665a2e008506b1f9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <assert.h>

#include "layout.h"
#include "effect.h"
#include "any_log.h"

void effect_init(effect_t *effect, const effect_info_t *info)
{
    assert(effect != NULL);
    effect->info = info;
    effect->start = timespec_from_ms(0);
    effect->next = NULL;
}

void effect_info_free(effect_info_t *info)
{
    free(info->state);
    free(info);
}

void effect_free(effect_t *effect)
{
    assert(effect->info->finalize != NULL);
    effect->info->finalize(effect);
}