File: detection.h

package info (click to toggle)
scummvm 2.9.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 450,268 kB
  • sloc: cpp: 4,297,604; asm: 28,322; python: 12,901; sh: 11,219; java: 8,477; xml: 7,843; perl: 2,633; ansic: 2,465; yacc: 1,670; javascript: 1,020; makefile: 933; lex: 578; awk: 275; objc: 82; sed: 11; php: 1
file content (143 lines) | stat: -rw-r--r-- 4,106 bytes parent folder | download | duplicates (2)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef SAGA_DETECTION_H
#define SAGA_DETECTION_H

#include "engines/advancedDetector.h"

namespace Saga {

enum GameIds {
	GID_ITE = 0,
	GID_IHNM = 1
};

enum GameFeatures {
	GF_ITE_FLOPPY        = 1 << 0,
	GF_ITE_DOS_DEMO      = 1 << 1,
	GF_EXTRA_ITE_CREDITS = 1 << 2,
	GF_8BIT_UNSIGNED_PCM = 1 << 3,
	GF_IHNM_COLOR_FIX    = 1 << 4,
	GF_SOME_MAC_RESOURCES= 1 << 5,
	GF_AGA_GRAPHICS      = 1 << 6,
	GF_ECS_GRAPHICS      = 1 << 7,
	GF_INSTALLER         = 1 << 8,
	GF_EMBED_FONT        = 1 << 9,
	GF_POWERPACK_GFX     = 1 << 10,
};

enum GameFileTypes {
	// Common
	GAME_RESOURCEFILE     = 1 << 0,    // Game resources
	GAME_SCRIPTFILE       = 1 << 1,    // Game scripts
	GAME_SOUNDFILE        = 1 << 2,    // SFX (also contains voices and MIDI music in SAGA 2 games)
	GAME_VOICEFILE        = 1 << 3,    // Voices (also contains SFX in the ITE floppy version)
	// ITE specific
	GAME_DIGITALMUSICFILE = 1 << 4,    // ITE digital music, added by Wyrmkeep
	GAME_MACBINARY        = 1 << 5,    // ITE Mac CD Guild
	GAME_DEMOFILE         = 1 << 6,    // Early ITE demo
	GAME_SWAPENDIAN       = 1 << 7,    // Used to identify the BE voice file in the ITE combined version
	// IHNM specific
	GAME_MUSICFILE_FM     = 1 << 8,    // IHNM
	GAME_MUSICFILE_GM     = 1 << 9,    // IHNM, ITE Mac CD Guild
	GAME_PATCHFILE        = 1 << 10    // IHNM patch file (patch.re_/patch.res)
};

// Make sure to update ResourceLists in saga.cpp if this enum is reordered.
enum GameResourceList : uint8 {
	RESOURCELIST_NONE = 0,
	RESOURCELIST_ITE,
	RESOURCELIST_ITE_ENGLISH_ECS,
	RESOURCELIST_ITE_GERMAN_AGA,
	RESOURCELIST_ITE_GERMAN_ECS,
	RESOURCELIST_ITE_DEMO,
	RESOURCELIST_IHNM,
	RESOURCELIST_IHNM_DEMO,
	RESOURCELIST_MAX
};

// Make sure to update FontLists in font.cpp if this enum is reordered.
enum GameFontList : uint8 {
	FONTLIST_NONE = 0,
	FONTLIST_ITE,
	FONTLIST_ITE_DEMO,
	FONTLIST_ITE_WIN_DEMO,
	FONTLIST_IHNM_DEMO,
	FONTLIST_IHNM_CD,
	FONTLIST_IHNM_ZH,
	FONTLIST_MAX
};

// Make sure to update PatchLists in resource.cpp if this enum is reordered.
enum GamePatchList : uint8 {
	PATCHLIST_NONE = 0,
	PATCHLIST_ITE,
	PATCHLIST_ITE_MAC,
	PATCHLIST_MAX
};

// Make sure to update ITE_IntroLists in introproc_ite.cpp if this enum is reordered.
enum GameIntroList : uint8 {
	INTROLIST_NONE = 0,
	INTROLIST_ITE_DEFAULT,
	INTROLIST_ITE_AMIGA_ENGLISH_ECS,
	INTROLIST_ITE_AMIGA_GERMAN_AGA,
	INTROLIST_ITE_AMIGA_GERMAN_ECS,
	INTROLIST_ITE_DOS_DEMO,
	INTROLIST_MAX
};

struct SAGAGameDescription {
	ADGameDescription desc;

	int gameId;
	uint32 features;
	int startSceneNumber;
	GameResourceList resourceList;
	GameFontList fontList;
	GamePatchList patchList;
	GameIntroList introList;
	// Only used if GF_INSTALLER is set
	ADGameFileDescription filesInArchive[5];

	uint32 sizeBuffer() const {
		uint32 ret = desc.sizeBuffer();
		for(int i = 0; i < ARRAYSIZE(filesInArchive); i++) {
			ret += filesInArchive[i].sizeBuffer();
		}
		return ret;
	}

	void *toBuffer(void *buffer) {
		buffer = desc.toBuffer(buffer);
		for(int i = 0; i < ARRAYSIZE(filesInArchive); i++) {
			buffer = filesInArchive[i].toBuffer(buffer);
		}
		return buffer;
	}
};

#define GAMEOPTION_COPY_PROTECTION	GUIO_GAMEOPTIONS1

} // End of namespace Saga

#endif // SAGA_DETECTION_H