2013-09-01 14:27:21 +00:00
|
|
|
/*
|
|
|
|
** graphics.h
|
|
|
|
**
|
|
|
|
** This file is part of mkxp.
|
|
|
|
**
|
|
|
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
|
|
|
**
|
|
|
|
** mkxp is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 2 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** mkxp is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GRAPHICS_H
|
|
|
|
#define GRAPHICS_H
|
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
class Scene;
|
|
|
|
class Bitmap;
|
2014-08-24 05:36:19 +00:00
|
|
|
class Disposable;
|
2013-09-01 14:27:21 +00:00
|
|
|
struct RGSSThreadData;
|
|
|
|
struct GraphicsPrivate;
|
2014-08-24 05:36:19 +00:00
|
|
|
struct AtomicFlag;
|
2013-09-01 14:27:21 +00:00
|
|
|
|
|
|
|
class Graphics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update();
|
|
|
|
void freeze();
|
|
|
|
void transition(int duration = 8,
|
2015-06-10 11:23:39 +00:00
|
|
|
const char *filename = "",
|
2013-09-01 14:27:21 +00:00
|
|
|
int vague = 40);
|
2013-10-06 07:55:27 +00:00
|
|
|
void frameReset();
|
|
|
|
|
|
|
|
DECL_ATTR( FrameRate, int )
|
|
|
|
DECL_ATTR( FrameCount, int )
|
2014-08-28 17:07:29 +00:00
|
|
|
DECL_ATTR( Brightness, int )
|
2013-09-01 14:27:21 +00:00
|
|
|
|
|
|
|
void wait(int duration);
|
|
|
|
void fadeout(int duration);
|
|
|
|
void fadein(int duration);
|
|
|
|
|
|
|
|
Bitmap *snapToBitmap();
|
|
|
|
|
|
|
|
int width() const;
|
|
|
|
int height() const;
|
|
|
|
void resizeScreen(int width, int height);
|
2015-10-30 15:01:36 +00:00
|
|
|
void playMovie(const char *filename);
|
2013-09-01 14:27:21 +00:00
|
|
|
|
2014-08-24 05:36:19 +00:00
|
|
|
void reset();
|
|
|
|
|
2013-09-01 14:27:21 +00:00
|
|
|
/* Non-standard extension */
|
|
|
|
DECL_ATTR( Fullscreen, bool )
|
2013-09-24 20:52:42 +00:00
|
|
|
DECL_ATTR( ShowCursor, bool )
|
2013-09-01 14:27:21 +00:00
|
|
|
|
|
|
|
/* <internal> */
|
|
|
|
Scene *getScreen() const;
|
|
|
|
/* Repaint screen with static image until exitCond
|
2014-08-24 05:36:19 +00:00
|
|
|
* is set. Observes reset flag on top of shutdown
|
|
|
|
* if "checkReset" */
|
|
|
|
void repaintWait(const AtomicFlag &exitCond,
|
|
|
|
bool checkReset = true);
|
2013-09-01 14:27:21 +00:00
|
|
|
|
|
|
|
private:
|
2013-12-04 23:34:11 +00:00
|
|
|
Graphics(RGSSThreadData *data);
|
|
|
|
~Graphics();
|
|
|
|
|
2014-08-24 05:36:19 +00:00
|
|
|
void addDisposable(Disposable *);
|
|
|
|
void remDisposable(Disposable *);
|
|
|
|
|
2013-12-04 23:34:11 +00:00
|
|
|
friend struct SharedStatePrivate;
|
2014-08-24 05:36:19 +00:00
|
|
|
friend class Disposable;
|
2013-12-04 23:34:11 +00:00
|
|
|
|
2013-09-01 14:27:21 +00:00
|
|
|
GraphicsPrivate *p;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GRAPHICS_H
|