taisei/src/transition.h
Andrei Alexeyev 513d613387
Consistent indentation: indent with tabs, align with spaces (#104)
I would've preferred to just go with 4-spaces for indent and no tabs,
but lao is a bit conservative about it. :^)

Still, this is a ton better than mixing different styles all over the
place, especially within the same file.
2018-01-12 20:26:07 +02:00

55 lines
1.2 KiB
C

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#include "taisei.h"
#include <stdbool.h>
typedef struct Transition Transition;
typedef void (*TransitionRule)(double fade);
typedef void (*TransitionCallback)(void *a);
struct Transition {
double fade;
int dur1; // first half
int dur2; // second half
TransitionCallback callback;
void *arg;
enum {
TRANS_IDLE,
TRANS_FADE_IN,
TRANS_FADE_OUT,
} state;
TransitionRule rule;
TransitionRule rule2;
struct {
int dur1;
int dur2;
TransitionRule rule;
TransitionCallback callback;
void *arg;
} queued;
};
extern Transition transition;
void TransFadeBlack(double fade);
void TransFadeWhite(double fade);
void TransLoader(double fade);
void TransMenu(double fade);
void TransMenuDark(double fade);
void TransEmpty(double fade);
void set_transition(TransitionRule rule, int dur1, int dur2);
void set_transition_callback(TransitionRule rule, int dur1, int dur2, TransitionCallback cb, void *arg);
void draw_transition(void);
void update_transition(void);