2012-08-13 19:20:40 +02:00
|
|
|
/*
|
2019-08-03 19:43:48 +02:00
|
|
|
* This software is licensed under the terms of the MIT License.
|
2017-02-11 04:52:08 +01:00
|
|
|
* 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
|
|
|
*/
|
|
|
|
|
2021-08-12 23:09:01 +02:00
|
|
|
#pragma once
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
2012-08-13 19:20:40 +02:00
|
|
|
|
2023-04-07 05:47:47 +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
|
|
|
|
2023-04-07 07:49:15 +02:00
|
|
|
#define TRANSITION_RESULT_CANCELED(ccr) ((bool)(uintptr_t)ccr.result)
|
|
|
|
|
2012-08-13 19:20:40 +02:00
|
|
|
struct Transition {
|
2018-01-12 19:26:07 +01:00
|
|
|
double fade;
|
2012-08-13 19:20:40 +02:00
|
|
|
int dur1; // first half
|
|
|
|
int dur2; // second half
|
2023-04-07 05:47:47 +02:00
|
|
|
CallChain cc;
|
2017-02-24 22:58:27 +01:00
|
|
|
|
2018-01-12 19:26:07 +01:00
|
|
|
enum {
|
|
|
|
TRANS_IDLE,
|
|
|
|
TRANS_FADE_IN,
|
|
|
|
TRANS_FADE_OUT,
|
|
|
|
} state;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2012-08-13 19:20:40 +02:00
|
|
|
TransitionRule rule;
|
2018-01-12 19:26:07 +01:00
|
|
|
TransitionRule rule2;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int dur1;
|
|
|
|
int dur2;
|
|
|
|
TransitionRule rule;
|
2023-04-07 05:47:47 +02:00
|
|
|
CallChain cc;
|
2018-01-12 19:26:07 +01:00
|
|
|
} queued;
|
2012-08-13 19:20:40 +02:00
|
|
|
};
|
|
|
|
|
2017-02-24 22:58:27 +01: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
|
|
|
|
2023-04-07 05:47:47 +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);
|