2019-11-04 21:24:37 +00:00
|
|
|
/* 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.
|
|
|
|
*
|
2021-12-26 23:54:17 +00:00
|
|
|
* 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.
|
2019-11-04 21:24:37 +00:00
|
|
|
*
|
|
|
|
* 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
|
2021-12-26 23:54:17 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2019-11-04 21:24:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-09-12 03:13:53 +00:00
|
|
|
#include "chewy/defines.h"
|
2022-01-08 04:00:56 +00:00
|
|
|
#include "chewy/events.h"
|
2021-09-13 02:53:23 +00:00
|
|
|
#include "chewy/file.h"
|
2022-02-14 02:43:31 +00:00
|
|
|
#include "chewy/globals.h"
|
2022-01-30 14:51:42 +00:00
|
|
|
#include "chewy/resource.h"
|
2019-11-04 21:24:37 +00:00
|
|
|
|
2021-09-12 22:41:09 +00:00
|
|
|
namespace Chewy {
|
|
|
|
|
2022-02-13 02:35:13 +00:00
|
|
|
static const byte IO_PAL1[7] = { 11, 60, 14, 2, 1, 5, 4 };
|
|
|
|
|
2022-02-05 02:57:38 +00:00
|
|
|
Common::File *File::open(const char *name) {
|
2021-10-11 01:50:09 +00:00
|
|
|
Common::File *f = new Common::File();
|
|
|
|
if (f->open(name)) {
|
|
|
|
return f;
|
|
|
|
} else {
|
|
|
|
delete f;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool File::readArray(Common::SeekableReadStream *src, uint16 *arr, size_t size) {
|
|
|
|
Common::SeekableReadStream *rs = src->readStream(size * 2);
|
|
|
|
|
|
|
|
bool result = (uint32)rs->size() == (size * 2);
|
|
|
|
if (result) {
|
|
|
|
for (; size > 0; --size, ++arr)
|
2021-10-16 22:37:36 +00:00
|
|
|
*arr = rs->readUint16LE();
|
2021-10-11 01:50:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
delete rs;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2021-09-12 22:41:09 +00:00
|
|
|
} // namespace Chewy
|