ScummVM API documentation
detection.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 SAGA_DETECTION_H
23 #define SAGA_DETECTION_H
24 
25 #include "engines/advancedDetector.h"
26 
27 namespace Saga {
28 
29 enum GameIds {
30  GID_ITE = 0,
31  GID_IHNM = 1
32 };
33 
34 enum GameFeatures {
35  GF_ITE_FLOPPY = 1 << 0,
36  GF_ITE_DOS_DEMO = 1 << 1,
37  GF_EXTRA_ITE_CREDITS = 1 << 2,
38  GF_8BIT_UNSIGNED_PCM = 1 << 3,
39  GF_IHNM_COLOR_FIX = 1 << 4,
40  GF_SOME_MAC_RESOURCES= 1 << 5,
41  GF_AGA_GRAPHICS = 1 << 6,
42  GF_ECS_GRAPHICS = 1 << 7,
43  GF_INSTALLER = 1 << 8,
44  GF_EMBED_FONT = 1 << 9,
45  GF_POWERPACK_GFX = 1 << 10,
46 };
47 
48 enum GameFileTypes {
49  // Common
50  GAME_RESOURCEFILE = 1 << 0, // Game resources
51  GAME_SCRIPTFILE = 1 << 1, // Game scripts
52  GAME_SOUNDFILE = 1 << 2, // SFX (also contains voices and MIDI music in SAGA 2 games)
53  GAME_VOICEFILE = 1 << 3, // Voices (also contains SFX in the ITE floppy version)
54  // ITE specific
55  GAME_DIGITALMUSICFILE = 1 << 4, // ITE digital music, added by Wyrmkeep
56  GAME_MACBINARY = 1 << 5, // ITE Mac CD Guild
57  GAME_DEMOFILE = 1 << 6, // Early ITE demo
58  GAME_SWAPENDIAN = 1 << 7, // Used to identify the BE voice file in the ITE combined version
59  // IHNM specific
60  GAME_MUSICFILE_FM = 1 << 8, // IHNM
61  GAME_MUSICFILE_GM = 1 << 9, // IHNM, ITE Mac CD Guild
62  GAME_PATCHFILE = 1 << 10 // IHNM patch file (patch.re_/patch.res)
63 };
64 
65 // Make sure to update ResourceLists in saga.cpp if this enum is reordered.
66 enum GameResourceList : uint8 {
67  RESOURCELIST_NONE = 0,
68  RESOURCELIST_ITE,
69  RESOURCELIST_ITE_ENGLISH_ECS,
70  RESOURCELIST_ITE_GERMAN_AGA,
71  RESOURCELIST_ITE_GERMAN_ECS,
72  RESOURCELIST_ITE_DEMO,
73  RESOURCELIST_IHNM,
74  RESOURCELIST_IHNM_DEMO,
75  RESOURCELIST_MAX
76 };
77 
78 // Make sure to update FontLists in font.cpp if this enum is reordered.
79 enum GameFontList : uint8 {
80  FONTLIST_NONE = 0,
81  FONTLIST_ITE,
82  FONTLIST_ITE_DEMO,
83  FONTLIST_ITE_WIN_DEMO,
84  FONTLIST_IHNM_DEMO,
85  FONTLIST_IHNM_CD,
86  FONTLIST_IHNM_ZH,
87  FONTLIST_MAX
88 };
89 
90 // Make sure to update PatchLists in resource.cpp if this enum is reordered.
91 enum GamePatchList : uint8 {
92  PATCHLIST_NONE = 0,
93  PATCHLIST_ITE,
94  PATCHLIST_ITE_MAC,
95  PATCHLIST_MAX
96 };
97 
98 // Make sure to update ITE_IntroLists in introproc_ite.cpp if this enum is reordered.
99 enum GameIntroList : uint8 {
100  INTROLIST_NONE = 0,
101  INTROLIST_ITE_DEFAULT,
102  INTROLIST_ITE_AMIGA_ENGLISH_ECS,
103  INTROLIST_ITE_AMIGA_GERMAN_AGA,
104  INTROLIST_ITE_AMIGA_GERMAN_ECS,
105  INTROLIST_ITE_DOS_DEMO,
106  INTROLIST_MAX
107 };
108 
110  ADGameDescription desc;
111 
112  int gameId;
113  uint32 features;
114  int startSceneNumber;
115  GameResourceList resourceList;
116  GameFontList fontList;
117  GamePatchList patchList;
118  GameIntroList introList;
119  // Only used if GF_INSTALLER is set
120  ADGameFileDescription filesInArchive[5];
121 
122  uint32 sizeBuffer() const {
123  uint32 ret = desc.sizeBuffer();
124  for(int i = 0; i < ARRAYSIZE(filesInArchive); i++) {
125  ret += filesInArchive[i].sizeBuffer();
126  }
127  return ret;
128  }
129 
130  void *toBuffer(void *buffer) {
131  buffer = desc.toBuffer(buffer);
132  for(int i = 0; i < ARRAYSIZE(filesInArchive); i++) {
133  buffer = filesInArchive[i].toBuffer(buffer);
134  }
135  return buffer;
136  }
137 };
138 
139 #define GAMEOPTION_COPY_PROTECTION GUIO_GAMEOPTIONS1
140 
141 } // End of namespace Saga
142 
143 #endif // SAGA_DETECTION_H
#define ARRAYSIZE(x)
Definition: util.h:91
uint32 sizeBuffer() const
Definition: advancedDetector.h:220
Definition: advancedDetector.h:163
Definition: detection.h:109
void * toBuffer(void *buffer)
Definition: advancedDetector.h:238
Definition: actor.h:34
Definition: advancedDetector.h:78