ScummVM API documentation
state.h
1/* ScummVM - Graphic Adventure Engine
2*
3* ScummVM is the legal property of its developers, whose names
4* are too numerous to list here. Please refer to the COPYRIGHT
5* file distributed with this source distribution.
6*
7* This program is free software: you can redistribute it and/or modify
8* it under the terms of the GNU General Public License as published by
9* the Free Software Foundation, either version 3 of the License, or
10* (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16*
17* You should have received a copy of the GNU General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*
20*/
21
22#ifndef SNATCHER_STATE_H
23#define SNATCHER_STATE_H
24
25#include "common/str.h"
26#include "common/rect.h"
27#include "common/scummsys.h"
28
29#include "snatcher/mem_mapping.h"
30
31namespace Snatcher {
32
33class SnatcherEngine;
34class SceneModule;
35class FIO;
36
37struct Config {
38 Config() : volumeMusic(0), volumeSFX(0), volumeSpeech(0), lightGunAvailable(1), useLightGun(0), controllerSetup(0), disableStereo(0), hasRAMCart(1), hasFreeBuram(1), lightGunBias(0, -16) {}
39 int16 volumeMusic;
40 int16 volumeSFX;
41 int16 volumeSpeech;
42 int16 lightGunAvailable;
43 int16 useLightGun;
44 int16 controllerSetup;
45 int16 disableStereo;
46 int16 hasRAMCart;
47 int16 hasFreeBuram;
48 Common::Point lightGunBias;
49};
50
51struct SaveInfo {
52 SaveInfo() : slotUsage(0), saveCount(0), act(0) {}
53 struct Slot {
54 Slot() : playTime(0), numSaves(0), act(0), desc() {}
55 Common::String desc;
56 uint16 numSaves;
57 uint16 playTime;
58 uint8 act;
59 } slots[4];
60 int16 slotUsage;
61 int16 saveCount;
62 uint8 act;
63};
64
65struct Script {
66 Script(uint32 textResourceOffset, int16 &chaptr) : sentenceDone(0), sentencePos(0), data(nullptr), dataSize(0), curPos(0), newPos(0xFFFF), curFileNo(0), curGfxScript(-1), phase(chaptr), textResOffset(textResourceOffset) {}
67 ~Script() {
68 delete[] data;
69 }
70 const uint8 *getTextResource() const {
71 return data + textResOffset;
72 }
73 uint8 sentenceDone;
74 uint8 sentencePos;
75 uint8 curFileNo;
76 int16 curGfxScript;
77 const uint8 *data;
78 uint32 dataSize;
79 uint16 curPos;
80 uint16 newPos;
81 int16 &phase;
82 const uint32 textResOffset;
83
84 struct Temp {
85 Temp() : curFileNo(0), curPos(0) {
86 memset(arr4, 0, sizeof(arr4));
87 }
88 uint8 curFileNo;
89 uint16 curPos;
90 uint16 arr4[4];
91 } temp;
92};
93
94struct GameState {
95 GameState() : frameNo(0), frameState(0), modFinish(0), modPhaseTop(0), modPhaseSub(0), counter(0), modIndex(0), menuSelect(0), prologue(0),
96 pendingSaveLoad(0), phase(0), updateFlags(0), saveInfo(), conf(), script(MemMapping::MEM_SCRIPT_TEXT_LOCATION - MemMapping::MEM_SCRIPT_LOCATION, phase), totalPlayTime(0) {}
97 int16 frameNo;
98 int16 frameState;
99 int16 modFinish;
100 int16 modPhaseTop;
101 int16 modPhaseSub;
102 int16 counter;
103 int16 modIndex;
104 int16 menuSelect;
105 int16 pendingSaveLoad;
106 int16 prologue;
107 int16 phase;
108 int16 updateFlags;
109 SaveInfo saveInfo;
110 Config conf;
111 Script script;
112 uint32 totalPlayTime;
113};
114
115} // End of namespace Snatcher
116
117#endif // SNATCHER_STATE_H
Definition: str.h:59
Definition: rect.h:144
Definition: state.h:37
Definition: state.h:94
Definition: state.h:53
Definition: state.h:51
Definition: state.h:84
Definition: state.h:65