taisei/src/transition.h

52 lines
1 KiB
C
Raw Normal View History

2012-08-13 19:20:40 +02:00
/*
* This software is licensed under the terms of the MIT License.
* See COPYING for further information.
2012-08-13 19:20:40 +02:00
* ---
2024-05-16 23:30:41 +02:00
* Copyright (c) 2011-2024, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2024, Andrei Alexeyev <akari@taisei-project.org>.
2012-08-13 19:20:40 +02:00
*/
#pragma once
#include "taisei.h"
2012-08-13 19:20:40 +02:00
#include "util/callchain.h"
2012-08-13 19:20:40 +02:00
typedef struct Transition Transition;
2017-02-25 14:23:22 +01:00
typedef void (*TransitionRule)(double fade);
2012-08-13 19:20:40 +02:00
#define TRANSITION_RESULT_CANCELED(ccr) ((bool)(uintptr_t)ccr.result)
2012-08-13 19:20:40 +02:00
struct Transition {
double fade;
2012-08-13 19:20:40 +02:00
int dur1; // first half
int dur2; // second half
CallChain cc;
enum {
TRANS_IDLE,
TRANS_FADE_IN,
TRANS_FADE_OUT,
} state;
2012-08-13 19:20:40 +02:00
TransitionRule rule;
TransitionRule rule2;
struct {
int dur1;
int dur2;
TransitionRule rule;
CallChain cc;
} queued;
2012-08-13 19:20:40 +02:00
};
extern Transition transition;
2017-02-25 14:23:22 +01:00
void TransFadeBlack(double fade);
void TransFadeWhite(double fade);
void TransLoader(double fade);
void TransEmpty(double fade);
2012-08-13 19:20:40 +02:00
void set_transition(TransitionRule rule, int dur1, int dur2, CallChain cc);
2012-08-13 19:20:40 +02:00
void draw_transition(void);
2017-02-26 13:17:48 +01:00
void update_transition(void);