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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
/* 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
#include "common/stdafx.h"
#include "parallaction/parallaction.h"
namespace Parallaction {
void DosDisk_br::errorFileNotFound(const char *s) {
error("File '%s' not found", s);
}
Common::String DosDisk_br::selectArchive(const Common::String& name) {
debugC(5, kDebugDisk, "DosDisk_br::selectArchive");
Common::String oldPath(_partPath);
strcpy(_partPath, name.c_str());
return oldPath;
}
void DosDisk_br::setLanguage(uint16 language) {
debugC(5, kDebugDisk, "DosDisk_br::setLanguage");
switch (language) {
case 0:
strcpy(_languageDir, "it");
break;
case 1:
strcpy(_languageDir, "fr");
break;
case 2:
strcpy(_languageDir, "en");
break;
case 3:
strcpy(_languageDir, "ge");
break;
default:
error("unknown language");
}
return;
}
DosDisk_br::DosDisk_br(Parallaction* vm) : _vm(vm) {
}
DosDisk_br::~DosDisk_br() {
}
Cnv* DosDisk_br::loadTalk(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadTalk");
return 0;
}
Script* DosDisk_br::loadLocation(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadLocation");
Common::File stream;
char path[PATH_LEN];
sprintf(path, "%s/%s/%s.slf", _partPath, _languageDir, name);
if (!stream.open(path)) {
sprintf(path, "%s/%s/%s.loc", _partPath, _languageDir, name);
if (!stream.open(path))
errorFileNotFound(path);
}
return new Script(&stream, false);
}
Script* DosDisk_br::loadScript(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadScript");
return 0;
}
// there are no Head resources in Big Red Adventure
Graphics::Surface* DosDisk_br::loadHead(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadHead");
return 0;
}
Graphics::Surface* DosDisk_br::loadPointer(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadPointer");
char path[PATH_LEN];
sprintf(path, "%s.ras", name);
Common::File stream;
if (!stream.open(path))
errorFileNotFound(path);
stream.skip(4);
uint width = stream.readUint32BE();
uint height = stream.readUint32BE();
stream.skip(20);
stream.skip(768);
Graphics::Surface *surf = new Graphics::Surface;
surf->create(width, height, 1);
stream.read(surf->pixels, width * height);
return surf;
}
Font* DosDisk_br::loadFont(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadFont");
char path[PATH_LEN];
sprintf(path, "%s.fnt", name);
Common::File stream;
if (!stream.open(path))
errorFileNotFound(path);
return createFont(name, stream);
}
Cnv* DosDisk_br::loadObjects(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadObjects");
return 0;
}
void genSlidePath(char *path, const char* name) {
sprintf(path, "%s.bmp", name);
}
Graphics::Surface* DosDisk_br::loadStatic(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadStatic");
return 0;
}
Cnv* DosDisk_br::loadFrames(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadFrames");
return 0;
}
// Slides in Nippon Safes are basically screen-sized pictures with valid
// palette data used for menu and for location switches. Big Red Adventure
// doesn't need slides in that sense, but it still has some special
// graphics resources with palette data, so those will be named slides.
//
BackgroundInfo* DosDisk_br::loadSlide(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadSlide");
char path[PATH_LEN];
genSlidePath(path, name);
Common::File stream;
if (!stream.open(path))
errorFileNotFound(path);
BackgroundInfo* info = new BackgroundInfo;
stream.skip(4);
info->width = stream.readUint32BE();
info->height = stream.readUint32BE();
stream.skip(20);
byte rgb[768];
stream.read(rgb, 768);
for (uint i = 0; i < 256; i++) {
info->palette.setEntry(i, rgb[i] >> 2, rgb[i+256] >> 2, rgb[i+512] >> 2);
}
info->bg.create(info->width, info->height, 1);
stream.read(info->bg.pixels, info->width * info->height);
return info;
}
BackgroundInfo* DosDisk_br::loadScenery(const char *name, const char *mask, const char* path) {
debugC(5, kDebugDisk, "DosDisk_br::loadScenery");
return 0;
}
Table* DosDisk_br::loadTable(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadTable");
char path[PATH_LEN];
sprintf(path, "%s/%s.tab", _partPath, name);
Common::File stream;
if (!stream.open(path))
errorFileNotFound(path);
Table *t = new Table(100);
fillBuffers(stream);
while (scumm_stricmp(_tokens[0], "ENDTABLE")) {
t->addData(_tokens[0]);
fillBuffers(stream);
}
stream.close();
return 0;
}
Common::SeekableReadStream* DosDisk_br::loadMusic(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadMusic");
return 0;
}
Common::ReadStream* DosDisk_br::loadSound(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadSound");
return 0;
}
} // namespace Parallaction
|