-
Notifications
You must be signed in to change notification settings - Fork 4
/
Robinson.h
88 lines (63 loc) · 1.68 KB
/
Robinson.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef ROBINSON_H
#define ROBINSON_H
#include "RESFile.h"
#include "ADSFile.h"
#include "SCRFile.h"
#include "BMPFile.h"
#include "PALFile.h"
#include "TTMPlayer.h"
#include "RIFFPlayer.h"
#include "RobinsonMenu.h"
#include "RobinsonCompositor.h"
#ifdef WIN32
#include <SDL_ttf.h>
#else
#include <SDL2/SDL_ttf.h>
#endif
namespace SCRANTIC {
class Robinson
{
private:
Robinson(Robinson &C);
RESFile *res;
ADSFile *ads;
RIFFPlayer *audioPlayer;
RobinsonMenu *menu;
RobinsonCompositor *compositor;
SDL_Renderer *renderer;
SDL_Color *palette;
bool movieRunning;
bool movieFirstRun;
bool movieLastRun;
bool renderMenu;
//u16 currentMovie;
std::string adsFileName;
std::list<TTMPlayer *> ttmScenes;
std::list<std::pair<u16, bool>> movieQueue;
std::list<u16> lastHashes;
std::list<u16> killedHashes;
BMPFile *images[MAX_IMAGES];
u16 delay;
u16 currentMovie;
u32 delayTicks;
void resetPlayer();
void addTTM(Command cmd);
void runTTMs();
void runADSBlock(bool togetherWith, u16 movie, u16 hash, u16 num = 0, bool skipToPlayAds = false);
public:
Robinson(const std::string &path, bool readUnpacked);
~Robinson();
bool navigateMenu(SDL_Keycode key);
void initRenderer(SDL_Renderer *rendererSDL, TTF_Font *font);
void advanceScripts();
void render();
bool isMenuOpen() { return renderMenu; }
bool isMovieRunning() { return movieRunning; }
bool loadMovie(const std::string &adsName, u16 num);
void startMovie();
u32 getCurrentDelay() { return delay; }
void displayMenu(bool show) { renderMenu = show; }
void displaySplash();
};
}
#endif // ROBINSON_H