forked from jaildesigner-jailgames/jaildoctors_dilemma
Commit to continue on other pc
This commit is contained in:
55
source/fade.h
Normal file
55
source/fade.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
#include "ifdefs.h"
|
||||
#include "ltexture.h"
|
||||
|
||||
#ifndef FADE_H
|
||||
#define FADE_H
|
||||
|
||||
#define FADE_FULLSCREEN 0
|
||||
#define FADE_CENTER 1
|
||||
#define FADE_RANDOM_SQUARE 2
|
||||
|
||||
// Fade
|
||||
class Fade
|
||||
{
|
||||
private:
|
||||
SDL_Renderer *mRenderer; // El renderizador de la ventana
|
||||
SDL_Texture *mBackbuffer; // Textura para usar como backbuffer
|
||||
Uint8 mFadeType; // Tipo de fade a realizar
|
||||
Uint16 mCounter; // Contador interno
|
||||
bool mEnabled; // Indica si el fade está activo
|
||||
bool mFinished; // Indica si ha terminado la transición
|
||||
Uint8 mR, mG, mB; // Colores para el fade
|
||||
SDL_Rect mRect1; // Rectangulo usado para crear los efectos de transición
|
||||
SDL_Rect mRect2; // Rectangulo usado para crear los efectos de transición
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Fade(SDL_Renderer *renderer);
|
||||
|
||||
// Destructor
|
||||
~Fade();
|
||||
|
||||
// Inicializa las variables
|
||||
void init(Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
// Pinta una transición en pantalla
|
||||
void render();
|
||||
|
||||
// Actualiza las variables internas
|
||||
void update();
|
||||
|
||||
// Activa el fade
|
||||
void activateFade();
|
||||
|
||||
// Comprueba si ha terminado la transicion
|
||||
bool hasEnded();
|
||||
|
||||
// Comprueba si está activo
|
||||
bool isEnabled();
|
||||
|
||||
// Establece el tipo de fade
|
||||
void setFadeType(Uint8 fadeType);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user