From a6150f9308f24f55793b8be07f8756d39763b59b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 27 Nov 2015 12:12:32 -0500 Subject: ACCESS: Creation of access.dat for holding Access games engine data --- devtools/create_access/amazon_resources.cpp | 757 +++++++++++++++++++++++++++ devtools/create_access/amazon_resources.h | 62 +++ devtools/create_access/create_access_dat.cpp | 430 +++++++++++++++ devtools/create_access/create_access_dat.h | 186 +++++++ devtools/create_access/martian_resources.cpp | 182 +++++++ devtools/create_access/martian_resources.h | 52 ++ devtools/create_access/module.mk | 13 + 7 files changed, 1682 insertions(+) create mode 100644 devtools/create_access/amazon_resources.cpp create mode 100644 devtools/create_access/amazon_resources.h create mode 100644 devtools/create_access/create_access_dat.cpp create mode 100644 devtools/create_access/create_access_dat.h create mode 100644 devtools/create_access/martian_resources.cpp create mode 100644 devtools/create_access/martian_resources.h create mode 100644 devtools/create_access/module.mk (limited to 'devtools') diff --git a/devtools/create_access/amazon_resources.cpp b/devtools/create_access/amazon_resources.cpp new file mode 100644 index 0000000000..50b8f334fb --- /dev/null +++ b/devtools/create_access/amazon_resources.cpp @@ -0,0 +1,757 @@ +/* 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. + * + */ + +#include "amazon_resources.h" + +namespace Amazon { + +const byte MOUSE0[] = { + // hotspot x and y, uint16 LE + 0, 0, 0, 0, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0, 2, 6, 1, + 0, 3, 6, 6, 1, + 0, 3, 6, 6, 1, + 0, 4, 6, 6, 6, 1, + 0, 4, 6, 6, 6, 1, + 0, 5, 6, 6, 6, 6, 1, + 0, 5, 6, 6, 6, 6, 1, + 0, 6, 6, 6, 6, 6, 6, 1, + 0, 6, 6, 6, 6, 6, 6, 1, + 0, 7, 6, 6, 6, 6, 6, 6, 1, + 0, 6, 6, 6, 6, 6, 6, 1, + 0, 5, 6, 6, 6, 6, 1, + 2, 3, 6, 6, 1, + 3, 3, 6, 6, 1, + 3, 3, 6, 6, 1, + 4, 2, 6, 1 +}; + +const byte MOUSE1[] = { + // hotspot x and y, uint16 LE + 0x07, 0x00, 0x07, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x06, 0x01, 0x05, + 0x04, 0x05, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, + 0x03, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x02, 0x09, 0xFF, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xFF, + 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x00, 0x0D, 0x05, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x00, 0x05, + 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x02, 0x09, 0xFF, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xFF, + 0x03, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x04, 0x05, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, + 0x06, 0x01, 0x05, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00 +}; + +const byte MOUSE2[] = { + // hotspot x and y, uint16 LE + 0x08, 0x00, 0x08, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x00, 0x00, + 0x00, 0x00, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x02, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x07, 0x02, 0x04, 0x05, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00 +}; + +const byte MOUSE3[] = { + // hotspot x and y, uint16 LE + 0x00, 0x00, 0x00, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x00, 0x0B, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x00, 0x0C, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x05, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x05, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, + 0x01, 0x0B, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00 +}; +const byte CURSEYE[] = { + // hotspot x and y, uint16 LE + 0x01, 0x00, 0x08, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x04, 0x06, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x03, 0x09, 0x0E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0D, 0x0D, + 0x02, 0x0B, 0x0E, 0x01, 0x33, 0x33, 0x01, 0x01, 0x33, 0x34, 0x01, 0x01, 0x0D, + 0x01, 0x0D, 0x0E, 0x01, 0x04, 0x34, 0x01, 0x01, 0x01, 0x07, 0x33, 0x04, 0x04, 0x01, 0x0D, + 0x00, 0x0F, 0x0E, 0x0E, 0x01, 0x07, 0x33, 0x33, 0x01, 0x01, 0x33, 0x34, 0x07, 0x07, 0x06, 0x01, 0x0E, + 0x01, 0x0D, 0x0F, 0x0F, 0x06, 0x07, 0x34, 0x33, 0x33, 0x34, 0x07, 0x07, 0x06, 0x0F, 0x0E, + 0x03, 0x09, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, + 0x01, 0x01, 0x07, + 0x00, 0x03, 0x07, 0x01, 0x07, + 0x01, 0x01, 0x07, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00 +}; + +const byte CURSHAND[] = { + // hotspot x and y, uint16 LE + 0x02, 0x00, 0x03, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x07, 0x02, 0x17, 0x0E, + 0x05, 0x07, 0x0E, 0x12, 0x17, 0x0E, 0x13, 0x17, 0x0E, + 0x02, 0x0C, 0x07, 0x00, 0x17, 0x0E, 0x11, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x00, 0x17, + 0x01, 0x0E, 0x07, 0x01, 0x07, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x11, 0x0F, 0x0E, 0x12, 0x17, 0x0E, + 0x02, 0x0D, 0x07, 0x00, 0x17, 0x0F, 0x12, 0x0F, 0x0F, 0x11, 0x17, 0x0E, 0x12, 0x0F, 0x0E, + 0x04, 0x0B, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x12, 0x0F, 0x0F, 0x11, 0x17, 0x0E, + 0x04, 0x0B, 0x17, 0x0E, 0x12, 0x17, 0x0E, 0x12, 0x17, 0x0E, 0x11, 0x0F, 0x0E, + 0x00, 0x0F, 0x0E, 0x0D, 0x12, 0x00, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x12, 0x0F, 0x0E, 0x12, 0x17, 0x0F, + 0x00, 0x0F, 0x0F, 0x17, 0x0D, 0x11, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, + 0x01, 0x0E, 0x0F, 0x17, 0x0F, 0x0E, 0x0F, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0F, 0x0F, 0x0E, 0x0D, + 0x02, 0x0D, 0x0F, 0x17, 0x0F, 0x0E, 0x0D, 0x0D, 0x0F, 0x0F, 0x0E, 0x0F, 0x0E, 0x0E, 0x12, + 0x03, 0x0C, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0E, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12, + 0x04, 0x0A, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0E, 0x0F, 0x0F, 0x0E, 0x0D, + 0x05, 0x09, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12, + 0x06, 0x08, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12, + 0x06, 0x07, 0x17, 0x0F, 0x0F, 0x0F, 0x3D, 0x0E, 0x0D +}; + +const byte CURSGET[] = { + // hotspot x and y, uint16 LE + 0x07, 0x00, 0x0E, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x0A, 0x05, 0x1C, 0x07, 0x0F, 0x0F, 0x0F, + 0x08, 0x08, 0x1C, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C, + 0x06, 0x0A, 0x1C, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C, + 0x05, 0x0A, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C, + 0x03, 0x0C, 0x07, 0x1C, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C, + 0x02, 0x0D, 0x1C, 0x0F, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C, + 0x01, 0x0E, 0x07, 0x0F, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C, + 0x00, 0x0F, 0x1C, 0x0F, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C, + 0x00, 0x0F, 0x1C, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0C, 0x0C, 0x0E, 0x0F, 0x0F, 0x0F, 0x0C, + 0x00, 0x0E, 0x1C, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x0F, 0x0F, 0x0C, + 0x00, 0x0E, 0x1C, 0x0E, 0x0F, 0x0D, 0x0F, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x1C, 0x0F, 0x0F, 0x0C, + 0x00, 0x0D, 0x1C, 0x0D, 0x0F, 0x0D, 0x0F, 0x0C, 0x00, 0x00, 0x00, 0x0E, 0x1C, 0x0F, 0x0C, + 0x01, 0x0B, 0x0E, 0x0F, 0x0E, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x07, 0x0F, 0x0C, + 0x02, 0x09, 0x0E, 0x0D, 0x0F, 0x0C, 0x00, 0x07, 0x0E, 0x0F, 0x0C, + 0x03, 0x06, 0x0E, 0x0F, 0x0E, 0x07, 0x01, 0x07, + 0x07, 0x01, 0x07 +}; + +const byte CURSCLIMB[] = { + // hotspot x and y, uint16 LE + 0x03, 0x00, 0x0E, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x06, 0x04, 0x01, 0x01, 0x01, 0x01, + 0x06, 0x04, 0x0F, 0x0E, 0x01, 0x01, + 0x06, 0x04, 0x0F, 0x0E, 0x0D, 0x01, + 0x07, 0x02, 0x0F, 0x0D, + 0x00, 0x0C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x13, 0x12, 0x12, 0x12, 0x12, 0x11, 0x11, + 0x00, 0x0D, 0x0D, 0x0E, 0x00, 0x00, 0x13, 0x14, 0x13, 0x12, 0x12, 0x12, 0x11, 0x11, 0x0E, + 0x01, 0x0C, 0x0D, 0x0D, 0x0D, 0x0E, 0x11, 0x13, 0x13, 0x12, 0x11, 0x11, 0x0E, 0x0D, + 0x02, 0x0C, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x13, 0x12, 0x11, 0x00, 0x00, 0x0E, 0x0D, + 0x03, 0x0B, 0x04, 0x04, 0x04, 0x22, 0x21, 0x21, 0x20, 0x00, 0x00, 0x00, 0x0D, + 0x02, 0x0D, 0x22, 0x04, 0x20, 0x22, 0x04, 0x21, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0E, 0x0E, + 0x03, 0x07, 0x22, 0x21, 0x20, 0x20, 0x22, 0x04, 0x20, + 0x04, 0x06, 0x01, 0x01, 0x00, 0x04, 0x22, 0x20, + 0x02, 0x09, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x04, 0x20, + 0x03, 0x09, 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x22, 0x04, 0x20, + 0x02, 0x0B, 0x07, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x20, + 0x03, 0x0A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 +}; + +const byte CURSTALK[] = { + // hotspot x and y, uint16 LE + 0x02, 0x00, 0x0B, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x03, 0x08, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x01, 0x0C, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, + 0x00, 0x0E, 0x06, 0x06, 0x06, 0x06, 0x07, 0x06, 0x07, 0x07, 0x06, 0x07, 0x07, 0x06, 0x07, 0x06, + 0x00, 0x0F, 0x06, 0x08, 0x08, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06, + 0x00, 0x0F, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x08, 0x06, 0x06, + 0x00, 0x0F, 0x06, 0x06, 0x08, 0x06, 0x08, 0x08, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06, + 0x01, 0x0E, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, + 0x02, 0x0C, 0x06, 0x06, 0x06, 0x07, 0x06, 0x07, 0x06, 0x06, 0x07, 0x06, 0x07, 0x06, + 0x04, 0x09, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, + 0x07, 0x04, 0x06, 0x07, 0x07, 0x06, + 0x02, 0x08, 0x07, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x01, 0x06, 0x07, 0x01, 0x07, 0x06, 0x06, 0x06, + 0x02, 0x01, 0x07, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00 +}; +const byte CURSHELP[] = { + // hotspot x and y, uint16 LE + 0x02, 0x00, 0x0B, 0x00, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0x04, 0x06, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x02, 0x0A, 0x24, 0x24, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20, + 0x01, 0x0C, 0x24, 0x22, 0x22, 0x22, 0x20, 0x20, 0x20, 0x22, 0x22, 0x22, 0x22, 0x20, + 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, + 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x20, + 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x20, + 0x01, 0x0D, 0x24, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, + 0x07, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, + 0x05, 0x07, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20, + 0x04, 0x05, 0x24, 0x22, 0x22, 0x22, 0x20, + 0x02, 0x07, 0x07, 0x00, 0x24, 0x20, 0x20, 0x20, 0x20, + 0x01, 0x03, 0x07, 0x01, 0x07, + 0x02, 0x07, 0x07, 0x00, 0x00, 0x24, 0x24, 0x24, 0x24, + 0x04, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, + 0x04, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, + 0x05, 0x04, 0x20, 0x20, 0x20, 0x20 +}; + +const byte *const CURSORS[AMAZON_NUM_CURSORS] = { + MOUSE0, MOUSE1, MOUSE2, MOUSE3, CURSEYE, CURSHAND, CURSGET, CURSCLIMB, CURSTALK, CURSHELP +}; +const uint CURSOR_SIZES[AMAZON_NUM_CURSORS] = { + sizeof(MOUSE0), sizeof(MOUSE1), sizeof(MOUSE2), sizeof(MOUSE3), sizeof(CURSEYE), + sizeof(CURSHAND), sizeof(CURSGET), sizeof(CURSCLIMB), sizeof(CURSTALK), sizeof(CURSHELP) +}; + + +const int FONT2_INDEX[] = { + 62, 2, 6, + 0x0000, 0x0019, 0x0021, 0x002e, 0x0041, 0x005a, 0x0073, 0x008c, 0x0093, 0x009b, + 0x00a3, 0x00bc, 0x00d5, 0x00dd, 0x00ea, 0x00f1, 0x00fe, 0x010b, 0x0118, 0x0125, + 0x0132, 0x013f, 0x014c, 0x0159, 0x0166, 0x0173, 0x0180, 0x0187, 0x018e, 0x01a7, + 0x01b4, 0x01cd, 0x01dc, 0x01f5, 0x0208, 0x0215, 0x0222, 0x022f, 0x023c, 0x0249, + 0x025c, 0x0269, 0x0276, 0x0285, 0x0292, 0x029f, 0x02b2, 0x02c5, 0x02d2, 0x02df, + 0x02ee, 0x02fb, 0x0308, 0x0315, 0x0322, 0x032f, 0x0342, 0x034f, 0x0362, 0x036f, + 0x0388, 0x03a1, +}; + +const byte FONT2_DATA[] = { + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0xf0, 0xf0, 0xf0, + 0x00, 0xf0, 0x00, 0x06, 0xf3, 0xc0, 0xc3, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x07, 0x1c, 0x00, + 0x67, 0x9e, 0xc0, 0x07, 0x1c, 0x00, 0x67, 0x9e, 0xc0, 0x07, + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0xc0, 0x00, 0x3f, + 0xfc, 0x00, 0xb2, 0xc0, 0x00, 0x3f, 0xfc, 0x00, 0x02, 0xcb, + 0x00, 0x3f, 0xfc, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x18, 0x60, + 0x70, 0x70, 0x60, 0x1c, 0x00, 0x04, 0x60, 0x18, 0x1c, 0x1c, + 0x1c, 0x70, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x30, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf0, 0xf0, + 0x00, 0x07, 0x00, 0xf0, 0x03, 0xc0, 0x0f, 0x00, 0x3c, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x07, 0x3f, 0xc0, 0x70, 0x70, 0x70, + 0x70, 0x70, 0x70, 0x3f, 0xc0, 0x00, 0x00, 0x07, 0x1f, 0x00, + 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0xff, 0xf0, 0x00, 0x00, + 0x08, 0x2b, 0xf0, 0xb0, 0x2c, 0x00, 0xa0, 0x0a, 0x00, 0xff, + 0xfc, 0x00, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x70, 0x03, 0xc0, + 0x00, 0x70, 0xff, 0xc0, 0x00, 0x00, 0x07, 0x0b, 0xc0, 0x2d, + 0xc0, 0xb1, 0xc0, 0xaa, 0xa0, 0x01, 0xc0, 0x00, 0x00, 0x07, + 0xff, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x00, 0xb0, 0xbf, 0xc0, + 0x00, 0x00, 0x07, 0x2f, 0xc0, 0x70, 0x00, 0x7f, 0xc0, 0x70, + 0x70, 0x3f, 0xc0, 0x00, 0x00, 0x08, 0xff, 0xfc, 0x00, 0xb0, + 0x02, 0xc0, 0x02, 0xc0, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x2f, + 0xf0, 0xb0, 0x1c, 0x2f, 0xf0, 0xb0, 0x1c, 0x2f, 0xf0, 0x00, + 0x00, 0x07, 0x3f, 0xc0, 0x70, 0x70, 0x3f, 0xf0, 0x00, 0x70, + 0x3f, 0xc0, 0x00, 0x00, 0x03, 0xf0, 0xf0, 0x00, 0xf0, 0xf0, + 0x00, 0x03, 0xf0, 0xf0, 0x00, 0xf0, 0x30, 0x00, 0x09, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0xff, 0x00, 0x03, 0xc0, 0x0f, 0x00, 0x3c, 0x00, + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0a, 0x00, 0x40, 0x00, 0x01, 0xf0, 0x00, 0x07, 0x1c, + 0x00, 0x1f, 0xff, 0x00, 0x70, 0x01, 0xc0, 0x00, 0x00, 0x00, + 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xf0, 0x70, 0x1c, 0x6a, + 0xb0, 0x00, 0x00, 0x08, 0x2f, 0xfc, 0x70, 0x00, 0x70, 0x00, + 0x70, 0x00, 0x2a, 0xa8, 0x00, 0x00, 0x08, 0x7f, 0xf0, 0x70, + 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x6a, 0xb0, 0x00, 0x00, 0x07, + 0x7f, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x70, 0x00, 0x6a, 0xa0, + 0x00, 0x00, 0x07, 0x7f, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x70, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x09, 0x3f, 0xfc, 0x00, 0x70, + 0x00, 0x00, 0x70, 0xff, 0x00, 0x70, 0x1c, 0x00, 0x2a, 0xbc, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x70, 0x1c, 0x70, 0x1c, 0x7f, + 0xfc, 0x70, 0x1c, 0x70, 0x1c, 0x00, 0x00, 0x07, 0xff, 0xf0, + 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0xaa, 0xa0, 0x00, 0x00, + 0x08, 0x0f, 0xfc, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x70, + 0x70, 0x2a, 0x40, 0x00, 0x00, 0x08, 0x70, 0x2c, 0x72, 0xc0, + 0x7f, 0x00, 0x72, 0xc0, 0x70, 0x28, 0x00, 0x00, 0x07, 0x70, + 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6a, 0xa0, 0x00, + 0x00, 0x0a, 0x70, 0x02, 0xc0, 0x7c, 0x09, 0xc0, 0x77, 0x2d, + 0xc0, 0x71, 0xb1, 0xc0, 0x60, 0xc1, 0x80, 0x00, 0x00, 0x00, + 0x09, 0x70, 0x07, 0x00, 0x77, 0x07, 0x00, 0x71, 0xc7, 0x00, + 0x70, 0x77, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x2f, 0xf0, 0x70, 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x2a, 0xa0, + 0x00, 0x00, 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xf0, 0x70, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x2f, 0xf0, 0x70, 0x1c, + 0x70, 0x1c, 0x71, 0xdc, 0x2a, 0xa0, 0x00, 0x1c, 0x00, 0x00, + 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xc0, 0x70, 0x70, 0x60, + 0x18, 0x00, 0x00, 0x07, 0x2f, 0xf0, 0x70, 0x00, 0x2f, 0xc0, + 0x00, 0xb0, 0xbf, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x0b, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, + 0x70, 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x70, 0xdc, 0x1f, 0x1c, + 0x00, 0x00, 0x08, 0xf0, 0x1c, 0xb0, 0x1c, 0x70, 0xb0, 0x72, + 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x0b, 0xf0, 0x00, 0xb0, 0xb0, + 0x00, 0x70, 0x70, 0xc0, 0x70, 0x72, 0x72, 0xc0, 0x7c, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x08, 0xf0, 0x3c, 0x1c, 0xe0, 0x07, + 0xc0, 0x1c, 0x70, 0x70, 0x1c, 0x00, 0x00, 0x09, 0x70, 0x07, + 0x00, 0x1c, 0x1c, 0x00, 0x07, 0xf0, 0x00, 0x01, 0xc0, 0x00, + 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xfc, 0x00, + 0x70, 0x07, 0x00, 0x1c, 0x00, 0xaa, 0xac, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const int FONT6x6_INDEX[] = { + 62, 1, 6, + 0x0000, 0x0007, 0x000e, 0x0015, 0x001c, 0x0023, 0x002a, 0x0031, 0x0038, 0x003f, + 0x0046, 0x004d, 0x0054, 0x005b, 0x0062, 0x0069, 0x0070, 0x0077, 0x007e, 0x0085, + 0x008c, 0x0093, 0x009a, 0x00a1, 0x00a8, 0x00af, 0x00b6, 0x00bd, 0x00c4, 0x00cb, + 0x00d2, 0x00d9, 0x00e0, 0x00e7, 0x00ee, 0x00f5, 0x00fc, 0x0103, 0x010a, 0x0111, + 0x0118, 0x011f, 0x0126, 0x012d, 0x0134, 0x013b, 0x0142, 0x0149, 0x0150, 0x0157, + 0x015e, 0x0165, 0x016c, 0x0173, 0x017a, 0x0181, 0x0188, 0x018f, 0x0196, 0x019d, + 0x01a4, 0x01ab, +}; + +const byte FONT6x6_DATA[] = { + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0x30, + 0x30, 0x30, 0x00, 0x30, 0x06, 0xd8, 0xd8, 0x90, 0x00, 0x00, + 0x00, 0x06, 0x50, 0xf8, 0x50, 0xf8, 0x50, 0x00, 0x06, 0x78, + 0xa0, 0x70, 0x28, 0xf0, 0x20, 0x06, 0xc8, 0xd0, 0x20, 0x58, + 0x98, 0x00, 0x06, 0x60, 0xd0, 0x60, 0xe8, 0xd0, 0x68, 0x06, + 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x06, 0x30, 0x60, 0x60, + 0x60, 0x30, 0x00, 0x07, 0x30, 0x18, 0x18, 0x18, 0x30, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x20, 0x20, + 0xf8, 0x20, 0x20, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x30, + 0x60, 0x06, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x06, 0x18, 0x30, 0x60, 0xc0, + 0x80, 0x00, 0x06, 0x70, 0x98, 0xa8, 0xc8, 0x70, 0x00, 0x06, + 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x06, 0xf0, 0x08, 0x70, + 0x80, 0xf8, 0x00, 0x06, 0xf0, 0x08, 0x70, 0x08, 0xf0, 0x00, + 0x06, 0x30, 0x50, 0x90, 0xf8, 0x10, 0x00, 0x06, 0xf0, 0x80, + 0xf0, 0x08, 0xf0, 0x00, 0x06, 0x70, 0x80, 0xf0, 0x88, 0x70, + 0x00, 0x06, 0xf8, 0x08, 0x10, 0x20, 0x20, 0x00, 0x06, 0x70, + 0x88, 0x70, 0x88, 0x70, 0x00, 0x06, 0x70, 0x88, 0x78, 0x08, + 0x70, 0x00, 0x06, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x06, + 0x60, 0x60, 0x00, 0x60, 0x20, 0x40, 0x06, 0x18, 0x30, 0x60, + 0x30, 0x18, 0x00, 0x06, 0x00, 0x78, 0x00, 0x78, 0x00, 0x00, + 0x06, 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0x06, 0x70, 0x98, + 0x30, 0x30, 0x00, 0x30, 0x06, 0x70, 0x88, 0xb8, 0xb0, 0x80, + 0x78, 0x06, 0x70, 0x88, 0xf8, 0x88, 0x88, 0x00, 0x06, 0xf0, + 0x88, 0xf0, 0x88, 0xf0, 0x00, 0x06, 0x78, 0x80, 0x80, 0x80, + 0x78, 0x00, 0x06, 0xf0, 0x88, 0x88, 0x88, 0xf0, 0x00, 0x06, + 0xf8, 0x80, 0xf0, 0x80, 0xf8, 0x00, 0x06, 0xf8, 0x80, 0xf0, + 0x80, 0x80, 0x00, 0x06, 0x78, 0x80, 0x98, 0x88, 0x78, 0x00, + 0x06, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x00, 0x06, 0x70, 0x20, + 0x20, 0x20, 0x70, 0x00, 0x06, 0x08, 0x08, 0x08, 0x88, 0x70, + 0x00, 0x06, 0x90, 0xa0, 0xc0, 0xa0, 0x90, 0x00, 0x06, 0x80, + 0x80, 0x80, 0x80, 0xf0, 0x00, 0x06, 0x88, 0xd8, 0xa8, 0x88, + 0x88, 0x00, 0x06, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x00, 0x06, + 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x06, 0xf0, 0x88, 0xf0, + 0x80, 0x80, 0x00, 0x06, 0x70, 0x88, 0x88, 0x88, 0x70, 0x18, + 0x06, 0xf0, 0x88, 0xf0, 0xa0, 0x98, 0x00, 0x06, 0x78, 0x80, + 0x70, 0x08, 0xf0, 0x00, 0x06, 0xf8, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x06, 0x88, 0x88, 0x88, 0x88, 0x78, 0x00, 0x06, 0x88, + 0x88, 0x88, 0x50, 0x20, 0x00, 0x06, 0x88, 0x88, 0xa8, 0xd8, + 0x88, 0x00, 0x06, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x06, + 0x88, 0x88, 0x50, 0x20, 0x20, 0x00, 0x06, 0xf8, 0x10, 0x20, + 0x40, 0xf8, 0x00, 0x06, 0x78, 0x60, 0x60, 0x60, 0x78, 0x00, + 0x06, 0xc0, 0x60, 0x30, 0x18, 0x08, 0x00, 0x06, 0x78, 0x18, + 0x18, 0x18, 0x78, 0x00, 0x00, 0x52, 0x41, 0x54, 0x00, 0x41, + 0x4c, 0x43, 0x4f, 0x48, 0x4f, 0x4c, 0x00, 0x53, 0x41, 0x46, + 0x45, 0x20, 0x43, 0x4f, 0x4d, 0x42, 0x49, 0x4e, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x00, 0x42, 0x45, 0x41, 0x4b, 0x45, 0x52, + 0x00, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x4d, + 0x00, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x20, 0x4b, 0x45, 0x59, + 0x00, 0x42, 0x4f, 0x4c, 0x54, 0x20, 0x43, 0x55, 0x54, 0x54, + 0x45, 0x52, 0x53, 0x00, 0x42, 0x4c, 0x4f, 0x57, 0x47, 0x55, + 0x4e, 0x00, 0x4c, 0x4f, 0x56, 0x45, 0x20, 0x50, 0x4f, 0x54, + 0x49, 0x4f, 0x4e, 0x00, 0x4d, 0x4f, 0x4e, 0x45, 0x59, 0x00, + 0x44, 0x41, 0x52, 0x54, 0x53, 0x00, 0x54, 0x41, 0x50, 0x45, + 0x00, 0x4a, 0x55, 0x4e, 0x47, 0x4c, 0x45, 0x20, 0x50, 0x4f, + 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4d, 0x4f, 0x56, 0x49, +}; + +const uint FONT2_INDEX_SIZE = sizeof(FONT2_INDEX) / 2; +const uint FONT2_DATA_SIZE = sizeof(FONT2_DATA); +const uint FONT6x6_INDEX_SIZE = sizeof(FONT6x6_INDEX) / 2; +const uint FONT6x6_DATA_SIZE = sizeof(FONT6x6_DATA); + +const char *const ROOM_DESCR[64] = { + "Credits", nullptr, nullptr, nullptr, "Outside of Allister Center", + "Hall", "Jason's Lab", nullptr, "Allen's Lab", "Outside of the Vault", + "Inside the Vault", "Reader", "Jason's Apartment", "Jason's ransacked apartment", "Cutscene 1", + "TBD FLYSOUTH", "Cuzco Airport", "TBD INAIR", "Green Monkey Club", "In Plane", + "TBD PILFALL", "TBD COCKPIT", "TBD CRASH", "TBD SINKING", "Cutscene Jungle Walk", + "TBD TOWN", "TBD HOTEL", "TBD CANTINA", nullptr, "TBD MASSACRE", + "TBD TRADE", "TBD BRIDGE", "TBD DOCK", "TBD DRIVER", nullptr, + nullptr, "TBD SHORE", "TBD BOAT", "TBD CABIN", "TBD CAPTIVE", + nullptr, nullptr, "TBD VILLAGE", nullptr, "TBD TREE", + "TBD CANOE", "TBD INTREE", "TBD FALLS", nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, "TBD WATERFALL", + "TBD INWATER", nullptr, "Cave Bridge", nullptr, nullptr, + nullptr, "Pit with Ants", nullptr, nullptr +}; + + +const byte DEATH_SCREENS_ENG[58] = { + 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 2, 4, 2, 1, 0, 0, 0, 0, 0, + 0, 2, 7, 7, 4, 6, 7, 10, 4, 2, + 0, 0, 0, 0, 5, 5, 3, 3, 3, 5, + 8, 8, 11, 9, 8, 12, 0, 1, 9, 8, + 8, 0, 5, 8, 0, 12, 12, 11 +}; + +const byte DEATH_SCREENS_ENG_DEMO[34] = { + 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, + 3, 4, 2, 4, 2, 1, 1, 1, 1, 1, + 1, 4, 2, 4, 2, 4, 2, 4, 4, 4, + 1, 1, 1, 1 +}; + +const char *const DEATH_TEXT_ENG[58] = { + "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.", + "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.", + "THE GUARD FILLS YOU FULL OF HOLES BEFORE TOSSING YOU TO THE PIRANHA.", + "YOU'RE ONLY ABLE TO SWIM HALFWAY ACROSS THE RIVER BEFORE RUNNING OUT OF AIR. " + "YOU MAKE SO MUCH NOISE GASPING FOR BREATH THAT SAM EASILY FINDS YOU AND LEAVES " + "YOU IN THE RIVER PERMANENTLY.", + "SAM SALVADOR NOTICES SOMEONE HAS BEEN PLAYING WITH THE CARGO. " + "HE TRACKS YOU DOWN AND LETS YOU HAVE IT.", + "THE GUARD COMES AROUND THE CORNER. HE DECIDES THAT THREE LEAD SLUGS WILL " + "TEACH YOU TO BE MORE POLITE.", + "THE CAPTAIN IS WAITING OUTSIDE THE DOOR.", + "THE CAPTAIN'S RANDOM SHOOTING FINALLY FINDS ITS TARGET.", + "THE CRATE OUTSIDE THE WINDOW EXPLODES, DESTROYING THE SHIP. " + "UNFORTUNATELY, YOU'RE STILL ABOARD.", + "THE DOOR WAS NOT BARRED AND THE CAPTAIN WALKS RIGHT IN AND PARTS YOUR HAIR.", + + "", + "YOU RUN OUT ON DECK, THEN REALIZE THAT MAYA IS STILL TIED UP. " + "AS YOU TURN TO GO BACK THE BOAT BLOWS UP.", + "AFTER YOU FAIL TO PROVE YOUR DIVINITY THE NATIVES EAT YOU FOR LUNCH.", + "THIS IS THE GENERIC DEATH SCENE", + "YOU ONLY MAKE IT HALFWAY ACROSS THE RIVER BEFORE THE PIRANHA STRIKE.", + "WITH NOTHING TO PROTECT HIM FROM THE HAIL OF BULLETS ALLEN IS QUICKLY GUNNED DOWN. " + "JASON AND MAYA SOON FOLLOW...", + "THE COMBINATION OF THE WIND AND GUNFIRE KNOCK THE CORRUGATED IRON OVER, " + "LEAVING YOU WITHOUT PROTECTION.", + "WITHOUT SUFFICIENT AMMUNITION, ALLEN IS UNABLE TO HOLD OFF THE ATTACKERS FOR LONG. " + "THIS RESULTS IN A SERIOUS CASE OF LEAD POISONING. ADDITIONAL AMMUNITION SHOULD " + "HAVE BEEN PURCHASED AT THE RIO BLANCO TRADING POST (CHAPTER 6).", + "ALLEN IS A MARVELOUS SHOT, BUT HIS AMMUNITION IS NOT UNLIMITED. " + "SOON IT IS ALL OVER.", + "THE PILOT FEELS YOU ARE TOO CLOSE AND PULLS THE TRIGGER.", + + "THE PILOT SHOOTS YOU IN THE HEART, THEN TOSSES YOUR LIFELESS BODY OUT THE DOOR.", + "THE PLANE CRASHES INTO THE JUNGLE CANOPY AT 200 MPH.", + "THE CANOE HITS THE ROCKS AND CAPSIZES, AND THE PIRANHA MAKE YOU THEIR LUNCH GUESTS.", + "YOU TAKE THE WRONG BRANCH AND ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL " + "IN SOUTH AMERICA.", + "YOU TAKE THE WRONG BRANCH AND DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.", + "YOU TAKE THE WRONG BRANCH AND BECOME LOST IN THE WINDING WATERWAYS. " + "YOU WANDER UNTIL YOU STARVE TO DEATH.", + "YOU TAKE THE WRONG BRANCH AND BECOME TRAPPED IN THE RAPIDS. " + "EVENTUALLY YOU AND MAYA ARE CRUSHED BETWEEN THE ROCKS.", + "YOU WAIT AROUND FOR SOME TIME, BUT HANS STROHEIM NEVER SPEAKS TO YOU AGAIN. " + "FINALLY YOU RETURN HOME KNOWING YOU HAVE FAILED.", + "DECIDING THAT YOU THREATEN HIM AND HIS WORK, HANS STROHEIM HAS THE NATIVES " + "IN THE VILLAGE KILL YOU.", + "YOU DO NOT GET FAR ENOUGH AWAY BEFORE THE DYNAMITE EXPLODES AND YOU ARE BLOWN " + "INTO A THOUSAND PIECES.", + + "YOU ARE STANDING SO CLOSE TO THE ENTRANCE WHEN SANCEZ AND HIS MEN BREAK THROUGH " + "THE WALL THAT YOU ARE QUICKLY SPOTTED AND SHOT", + "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.", + "SAM MAY BE UGLY, BUT HE'S NOT DEAF. HE HEARS ALL THE NOISE YOU ARE MAKING AND " + "CANCELS YOUR BOARDING PASS.", + "WITH THE BAR OFF THE DOOR THE CAPTAIN WALTZES IN AND BLOWS YOU AWAY", + "THE BEAR WANDERS OFF INTO THE WOODS AND DISTURBS THE TWO LOVEBIRDS. " + "WHEN THEY COME OUT THEY FIND YOU AND PUT YOU IN THE BIG HOUSE FOR TWENTY YEARS.", + "WHEN YOU DO NOT LEAVE THE SECURITY AREA QUICKLY ENOUGH YOU ARE ARRESTED AND CONVICTED " + "AS A COMMIE SPY. YOU EMBARK ON A NEW CAREER STAMPING OUT LICENSE PLATES.", + "THE HUNGRY BEAR SPOTS YOU AND DECIDES YOU WILL MAKE A NICE APPETIZER.", + "YOU DISTURB THE BEAR'S LUNCH AND HE EATS YOU FOR DESSERT.", + "AFTER FAILING TO FIND ANY LUNCH AT THE GARBAGE CAN THE BEAR EATS YOU INSTEAD.", + "THE SUSPICIOUS LIBRARIAN CALLS SECURITY AND YOU ARE SENT TO JAIL.", + + "YOU PLUMMET 10,000 FEET TO YOUR DEATH.", + "EL LOCO FLIES INTO AN INSANE RAGE AND BEATS YOU TO A BLOODY PULP.", + "THE WOMAN WALKS OUT THE DOOR AND NEVER RETURNS. YOU SPEND THE REST OF YOUR LIFE " + "IN A FUTILE ATTEMPT TO LOCATE ALLEN.", + "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.", + "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.", + "YOU COME TOO CLOSE TO THE POWERFUL JAWS OF THE ANT AND HE SNIPS YOU IN TWO BEFORE " + "DEVOURING YOU.", + "B.O.B. HAS A FLAW IN HIS PROGRAMMING THAT DIRECTS HIM TO SHOOT FIRST AND ASK QUESTIONS LATER.", + "THE PLANE SINKS AND THE PIRHANA ATTACK BEFORE YOU EVEN GET OUT THE DOOR.", + "MAYA FALLS OFF THE END OF THE BROKEN BRIDGE.", + "YOUR WEIGHT IS JUST ENOUGH TO CAUSE THE REMAINING SUPPORT CABLE TO SNAP AND YOU " + "FALL TO THE BOTTOM OF THE GORGE.", + + "EVEN WITH REPAIRS THE BRIDGE IS NOT STRONG ENOUGH TO HOLD TWO PEOPLE.", + "SANCHEZ AND HIS MEN FIND YOU AND HOLD FIRING SQUAD PRACTICE.", + "THE TWO GUARDS ARE DISTURBED IN THEIR LOVE NEST AND COME LOOKING FOR ANYONE ACTING SUSPICIOUS. " + "THEY FIND YOU AND SEND YOU UP THE RIVER.", + "THE PARACHUTE IS NOT LARGE ENOUGH TO SUPPORT YOU, AND YOU HIT THE TREES AT 140 M.P.H.", + "SANCHEZ AND HIS MEN FOLLOW YOU ACROSS THE BRIDGE AND CUT YOU DOWN IN A HAIL OF GUNFIRE", + "YOU TRIED TO STAB THE ANT BUT HIS SHELL IS TOO DIFFICULT TO PENETRATE. " + "YOU NOTICE A SLIGHT CUT IN THE SHELL UNDERNEATH BUT YOU CAN'T GET TO IT " + "AND HE SNIPS YOU INTO DELICIOUS MEATY CHUNKS.", + "AFTER THE ANT FINISHES SUCKING ALL OF THE SAP OUT OF THE VINE HE TURNS HIS ATTENTION BACK TO YOU " + "AND BITES YOUR HEAD OFF.", + "THE CANTINA OWNER NOTICES YOU ARE TRYING TO STEAL OBJECTS FROM THE TABLES. " + "TWENTY YEARS LATER YOU ARE RELEASED FROM A SOUTH AMERICAN PRISON." +}; + +const char *const DEATH_TEXT_ENG_DEMO[34] = { + "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.", + "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.", + "THE GUARD FILLS YOU FULL OF HOLES BEFORE TOSSING YOU TO THE PIRANHA.", + "YOU'RE ONLY ABLE TO SWIM HALFWAY ACROSS THE RIVER BEFORE RUNNING OUT OF AIR. YOU MAKE SO MUCH NOISE GASPING FOR BREATH THAT SAM EASILY FINDS YOU AND LEAVES YOU IN THE RIVER PERMANENTLY.", + "SAM SALVADOR NOTICES SOMEONE HAS BEEN PLAYING WITH THE CARGO. HE TRACKS YOU DOWN AND LETS YOU HAVE IT.", + "THE GUARD COMES AROUND THE CORNER. HE DECIDES THAT THREE LEAD SLUGS WILL TEACH YOU TO BE MORE POLITE.", + "THE CAPTAIN IS WAITING OUTSIDE THE DOOR.", + "THE CAPTAIN'S RANDOM SHOOTING FINALLY FINDS ITS TARGET.", + "THE CRATE OUTSIDE THE WINDOW EXPLODES, DESTROYING THE SHIP. UNFORTUNATELY, YOU'RE STILL ABOARD.", + "THE DOOR WAS NOT BARRED AND THE CAPTAIN WALKS RIGHT IN AND PARTS YOUR HAIR.", + "", + "YOU RUN OUT ON DECK, THEN REALIZE THAT MAYA IS STILL TIED UP. AS YOU TURN TO GO BACK THE BOAT BLOWS UP.", + "AFTER YOU FAIL TO PROVE YOUR DIVINITY THE NATIVES EAT YOU FOR LUNCH.", + "THIS IS THE GENERIC DEATH SCENE", + "YOU ONLY MAKE IT HALFWAY ACROSS THE RIVER BEFORE THE PIRANHA STRIKE.", + "WITH NOTHING TO PROTECT HIM FROM THE HAIL OF BULLETS ALLEN IS QUICKLY GUNNED DOWN. JASON AND MAYA SOON FOLLOW...", + "THE COMBINATION OF THE WIND AND GUNFIRE KNOCK THE CORRUGATED IRON OVER, LEAVING YOU WITHOUT PROTECTION.", + "WITHOUT SUFFICIENT AMMUNITION, ALLEN IS UNABLE TO HOLD OFF THE ATTACKERS FOR LONG. THIS RESULTS IN A SERIOUS CASE OF LEAD POISONING.", + "ALLEN IS A MARVELOUS SHOT, BUT HIS AMMUNITION IS NOT UNLIMITED. SOON IT IS ALL OVER.", + "THE PILOT FEELS YOU ARE TOO CLOSE AND PULLS THE TRIGGER.", + "THE PILOT SHOOTS YOU IN THE HEAD, THEN TOSSES YOUR LIFELESS", + "THE PLANE CRASHES INTO THE JUNGLE CANOPY AT 200 MPH.", + "THE CANOE HITS THE ROCKS AND CAPSIZES, AND THE PIRANHA MAKE YOU THEIR LUNCH GUESTS.", + "YOU ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL IN SOUTH AMERICA.", + "YOU DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.", + "YOU BECOME LOST IN THE WINDING WATERWAYS AND WANDER UNTIL YOU STARVE TO DEATH.", + "YOU BECOME TRAPPED IN THE RAPIDS AND ARE CRUSHED BETWEEN THE ROCKS.", + "YOU WAIT AROUND FOR SOME TIME, BUT HANS STROHEIM NEVER SPEAKS TO YOU AGAIN. FINALLY YOU RETURN HOME KNOWING YOU HAVE FAILED.", + "DECIDING THAT YOU THREATEN HIM AND HIS WORK, HANS STROHEIM HAS THE NATIVES IN THE VILLAGE KILL YOU.", + "YOU DO NOT GET FAR ENOUGH AWAY BEFORE THE DYNAMITE EXPLODES AND YOU ARE BLOWN INTO A THOUSAND PIECES.", + "STANDING OUT IN THE OPEN YOU ARE EXPOSED TO THE HAIL OF BULLETS FROM SANCHEZ' MEN.", + "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.", + "SAM MAY BE UGLY, BUT HE'S NOT DEAF. HE HEARS ALL THE NOISE YOU ARE MAKING AND CANCELS YOUR BOARDING PASS.", + "WITH THE BAR OFF THE DOOR THE CAPTAIN WALTZES IN AND BLOWS YOU AWAY" +}; + +const char *const INVENTORY_NAMES_ENG[85] = { + "RAT", "ALCOHOL", "SAFE COMBINATION", "BEAKER", "MICROFILM", + "VAULT KEY", "BOLT CUTTERS", "BLOWGUN", "LOVE POTION", "MONEY", + "DARTS", "TAPE", "JUNGLE POTION", "MOVIE", "CABINET KEY", + "DISPLAY CASE KEY", "FLITCH'S CAR KEYS", "COAT HANGER", + "CROWBAR", "COMPASS", "MAP", "LETTER OPENER", "LETTER", + "DECODER", "DIPPED DART", "LOADED BLOWGUN", "CARD", "JERRYCAN", + "CIGARETTES", "BIKE PUMP", "PARACHUTE", "PESO", "PEPPERS", + "MACHETE", "POISON ROOT", "AMMUNITION", "PADDLE", "FISHING NET", + "RAT TRAP", "CHEESE", "LOADED TRAP", "KNIFE", "CHOPPED PEPPERS", + "LIGHTER", "LADDER", "SMALL POLE", "JEEP KEY", "CHAIN", "ARROW", + "FILLED JERRY CAN", "EXPLOSIVES", "GEIGER COUNTER", "VINE", + "GOLD NUGGET", "HOLLOW REED", "AMAZON QUEEN KEYS", "FISHING POLE", + "HARPOON", "RAG", "BOTTLE OF RUM", "RAG IN BOTTLE", "MOLOTOV COCKTAIL", + "JUNGLE PLANT", "LADLE", "WORM", "FISH", "FIREWORKS", "BAITED POLE", + "FILLED LADLE", "EMERALD", "SMALL KEY", "SCROLL", "LIT EXPLOSIVES", + "LIGHTER", "BROKEN SPEAR", "SHOE LACES", "TORCH", "LACES AND SPEAR", + "KNIFE SPEAR", "GARBAGE CAN", "RAFT", "INFLATED RAFT", + "JASON'S CAR KEYS", "PESO BILLS", "PLANK" +}; + +const int COMBO_TABLE[85][4] = { + { -1, -1, -1, -1 }, + { 12, 3, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 24, 25, -1, -1 }, + { 10, 24, -1, -1 }, + { -1, -1, -1, -1 }, + { 8, 24, -1, -1 }, + { -1, -1, -1, -1 }, + { 1, 3, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 7, 25, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 80, 81, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 41, 42, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 39, 40, -1, -1 }, + { 38, 40, -1, -1 }, + { -1, -1, -1, -1 }, + { 32, 42, 77, 78 }, + { -1, -1, -1, -1 }, + { 60, 61, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 73, 72, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 64, 67, -1, -1 }, + { -1, -1, -1, -1 }, + { 59, 60, -1, -1 }, + { 58, 60, -1, -1 }, + { 43, 61, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 56, 67, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 50, 72, -1, -1 }, + { 75, 77, -1, -1 }, + { 74, 77, -1, -1 }, + { -1, -1, -1, -1 }, + { 41, 78, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { 29, 81, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 }, + { -1, -1, -1, -1 } +}; + +const char *const NO_HELP_MESSAGE_ENG = +"WE ARE UNABLE TO PROVIDE YOU WITH ANY MORE HINTS. YOUR IQ \ +HAS DECREASED SO FAR THAT WE CAN NO LONGER PUT THE HINTS IN TERMS \ +YOU CAN UNDERSTAND."; +const char *const NO_HINTS_MESSAGE_ENG = "THE HELP SYSTEM HAS BEEN TURNED OFF FOR THIS GAME."; +const char *const RIVER_HIT1_ENG = "YOU HIT THE ROCKS AND THE CANOE BEGINS TO LEAK."; +const char *const RIVER_HIT2_ENG = "YOU HIT THE ROCKS AND THE CANOE DEVELOPS SERIOUS LEAKS."; +const char *const BAR_MESSAGE_ENG = "YOU ARE TOO BUSY TRYING TO KEEP FROM SINKING TO DO THAT"; +const char *const HELPLVLTXT_ENG[3] = { " LEVEL 1 ", " LEVEL 2 ", " LEVEL 3 " }; + +const char *const IQLABELS_ENG[9] = { + "VEGETABLE", + "NEANDERTHAL", + "LOBOTOMIZED", + "DENSE", + "AVERAGE", + "INTELLIGENT", + "MURPHYITE", + "BRILLIANT", + "GENIUS" +}; + +const char *const CANT_GET_THERE_ENG = "YOU CAN'T GET THERE FROM HERE."; + +}; diff --git a/devtools/create_access/amazon_resources.h b/devtools/create_access/amazon_resources.h new file mode 100644 index 0000000000..fa281f8f7b --- /dev/null +++ b/devtools/create_access/amazon_resources.h @@ -0,0 +1,62 @@ +/* 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. + * + */ + +#ifndef __AMAZON_RESOURCES_H__ +#define __AMAZON_RESOURCES_H__ + +#include "common/scummsys.h" + +namespace Amazon { + +#define AMAZON_NUM_CURSORS 10 +extern const byte *const CURSORS[AMAZON_NUM_CURSORS]; +extern const uint CURSOR_SIZES[AMAZON_NUM_CURSORS]; + +extern const int FONT2_INDEX[]; +extern const byte FONT2_DATA[]; +extern const int FONT6x6_INDEX[]; +extern const byte FONT6x6_DATA[]; +extern const uint FONT2_INDEX_SIZE; +extern const uint FONT2_DATA_SIZE; +extern const uint FONT6x6_INDEX_SIZE; +extern const uint FONT6x6_DATA_SIZE; + +extern const char *const ROOM_DESCR[64]; +extern const char *const DEATH_TEXT_ENG[58]; +extern const char *const DEATH_TEXT_ENG_DEMO[34]; +extern const byte DEATH_SCREENS_ENG[58]; +extern const byte DEATH_SCREENS_ENG_DEMO[34]; +extern const char *const INVENTORY_NAMES_ENG[85]; +extern const int COMBO_TABLE[85][4]; + +extern const char *const NO_HELP_MESSAGE_ENG; +extern const char *const NO_HINTS_MESSAGE_ENG; +extern const char *const RIVER_HIT1_ENG; +extern const char *const RIVER_HIT2_ENG; +extern const char *const BAR_MESSAGE_ENG; +extern const char *const HELPLVLTXT_ENG[3]; +extern const char *const IQLABELS_ENG[9]; +extern const char *const CANT_GET_THERE_ENG; + +}; + +#endif diff --git a/devtools/create_access/create_access_dat.cpp b/devtools/create_access/create_access_dat.cpp new file mode 100644 index 0000000000..0e57f76395 --- /dev/null +++ b/devtools/create_access/create_access_dat.cpp @@ -0,0 +1,430 @@ +/* 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. + * + */ + +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +// HACK to allow building with the SDL backend on MinGW +// see bug #1800764 "TOOLS: MinGW tools building broken" +#ifdef main +#undef main +#endif // main + +#include +#include +#include +#include "common/language.h" +#include "common/rect.h" +#include "create_access_dat.h" +#include "amazon_resources.h" +#include "martian_resources.h" + +/** + * Format of the access.dat file that will be created: + * 4 Bytes - Magic string 'SVMA' to identify valid data file + * 2 bytes - Version number + * 2 Bytes - Number of different games data in the data file + * Series of index entries identifying each game: + * 1 byte - Game type: 1 = Amazon, 2 = Martian Memorandum, 3 = Noctropolis + * 1 byte - disc type: 0 = Floppy, 1 = CD, 2 = Common data shared across + * all variations of the given game + * 1 byte - Is Demo: 0 = Full game, 1 = Demo + * 1 byte - Language (Common::Language) + * 4 bytes - File offset for the data for the game + */ + +File outputFile; + +void writeHeader(int numExecutables); +void writeAmazonCommonData(); +void writeMartianCommonData(); +bool processExecutable(int idx, const char *name); + +void NORETURN_PRE error(const char *s, ...) { + printf("%s\n", s); + exit(1); +} + +int main(int argc, char *argv[]) { + const uint NUM_COMMON_ENTRIES = 2; + + if (argc < 3) { + printf("Format: %s output_filename executable1 [executable2 ..]\n", argv[0]); + exit(0); + } + + // Create the new data file for output + outputFile.open(argv[1], kFileWriteMode); + writeHeader(argc - 2 + NUM_COMMON_ENTRIES); + + // Write out entries containing common data for the games + writeAmazonCommonData(); + writeMartianCommonData(); + + // Iterate through processing each specified executable + outputFile.seek(0, SEEK_END); + for (int idx = 2; idx < argc; ++idx) { + if (!processExecutable(idx - 2 + NUM_COMMON_ENTRIES, argv[idx])) + break; + } + + // Close the output file + outputFile.close(); +} + +void writeHeader(int numExecutables) { + // Write out magic string + const char *MAGIC_STR = "SVMA"; + outputFile.write(MAGIC_STR, 4); + + // Write out version number + outputFile.writeWord(VERSION_NUMBER); + + // Write out the number of entries the data file will contain + outputFile.writeWord(numExecutables); + + // Write out padding for index entries that will be written + outputFile.writeByte(0, 8 * numExecutables); +} + +void writeAmazonCommonData() { + // Write out the header entry + outputFile.seek(8); + outputFile.writeByte(1); // Amazon + outputFile.writeByte(2); // Common data + outputFile.writeByte(0); + outputFile.writeByte(0); + outputFile.writeLong(outputFile.size()); + + // Write out cursor list + outputFile.seek(0, SEEK_END); + outputFile.writeWord(AMAZON_NUM_CURSORS); + + for (uint idx = 0; idx < AMAZON_NUM_CURSORS; ++idx) { + outputFile.writeWord(Amazon::CURSOR_SIZES[idx]); + outputFile.write(Amazon::CURSORS[idx], Amazon::CURSOR_SIZES[idx]); + } + + // Write out font data + outputFile.writeWord(Amazon::FONT2_INDEX_SIZE); + for (uint idx = 0; idx < Amazon::FONT2_INDEX_SIZE; ++idx) + outputFile.writeWord(Amazon::FONT2_INDEX[idx]); + + outputFile.writeWord(Amazon::FONT2_DATA_SIZE); + outputFile.write(Amazon::FONT2_DATA, Amazon::FONT2_DATA_SIZE); + + outputFile.writeWord(Amazon::FONT6x6_INDEX_SIZE); + for (uint idx = 0; idx < Amazon::FONT6x6_INDEX_SIZE; ++idx) + outputFile.writeWord(Amazon::FONT6x6_INDEX[idx]); + + outputFile.writeWord(Amazon::FONT6x6_DATA_SIZE); + outputFile.write(Amazon::FONT2_DATA, Amazon::FONT6x6_DATA_SIZE); +} + + +void writeMartianCommonData() { + // Write out the header entry + outputFile.seek(16); + outputFile.writeByte(2); // Martian + outputFile.writeByte(2); // Common data + outputFile.writeByte(0); + outputFile.writeByte(0); + outputFile.writeLong(outputFile.size()); + + // Write out cursor list + outputFile.seek(0, SEEK_END); + outputFile.writeByte(MARTIAN_NUM_CURSORS); + + for (uint idx = 0; idx < MARTIAN_NUM_CURSORS; ++idx) { + outputFile.writeWord(Martian::CURSOR_SIZES[idx]); + outputFile.write(Martian::CURSORS[idx], Martian::CURSOR_SIZES[idx]); + } +} + +bool processExecutable(int idx, const char *name) { + uint dataSegmentOffset; + uint filenamesOffset, numFilenames; + uint charsStart, charsEnd; + uint roomsStart, roomsEnd, numRooms; + uint travelPosOffset; + const char *const *roomDescs; + const byte *deathScreens; + const char *const *deathText; + uint numDeaths; + uint numItems; + const char *const *itemNames; + const int *comboTable; + byte gameId = 0, discType = 0, demoType = 0; + byte language = Common::EN_ANY; + + // Open up the file for access + File exeFile; + if (!exeFile.open(name)) { + printf("Could not open file - %s\n", name); + return false; + } + + // Total up the first 256 bytes of the executable as a simplified + // means of identifying the different executables we support + uint fileChecksum = 0; + for (int idx = 0; idx < 256; ++idx) + fileChecksum += exeFile.readByte(); + + switch (fileChecksum) { + case 11899: + // Amazon English floppy + gameId = 1; + dataSegmentOffset = 0xC8C0; + filenamesOffset = dataSegmentOffset + 0x3628; + numFilenames = 100; + charsStart = dataSegmentOffset + 0x4234; + charsEnd = dataSegmentOffset + 0x49c6; + roomsStart = dataSegmentOffset + 0x35a8; + roomsEnd = dataSegmentOffset + 0x4234; + travelPosOffset = dataSegmentOffset + 0x5ff7; + numRooms = 64; + roomDescs = &Amazon::ROOM_DESCR[0]; + deathScreens = Amazon::DEATH_SCREENS_ENG; + deathText = &Amazon::DEATH_TEXT_ENG[0]; + numDeaths = sizeof(Amazon::DEATH_SCREENS_ENG); + numItems = 85; + itemNames = &Amazon::INVENTORY_NAMES_ENG[0]; + comboTable = &Amazon::COMBO_TABLE[0][0]; + break; + + case 12360: + // Amazon CD English + gameId = 1; + discType = 1; + dataSegmentOffset = 0xd370; + filenamesOffset = dataSegmentOffset + 0x3EA0; + numFilenames = 116; + charsStart = dataSegmentOffset + 0x4BDC; + charsEnd = dataSegmentOffset + 0x5AF4; + roomsStart = dataSegmentOffset + 0x3E20; + roomsEnd = dataSegmentOffset + 0x4BDC; + travelPosOffset = dataSegmentOffset + 0x7125; + numRooms = 64; + roomDescs = &Amazon::ROOM_DESCR[0]; + deathScreens = Amazon::DEATH_SCREENS_ENG; + deathText = &Amazon::DEATH_TEXT_ENG[0]; + numDeaths = sizeof(Amazon::DEATH_SCREENS_ENG); + numItems = 85; + itemNames = &Amazon::INVENTORY_NAMES_ENG[0]; + comboTable = &Amazon::COMBO_TABLE[0][0]; + break; + + case 11748: + // Amazon English Demo + gameId = 1; + discType = 0; + demoType = 1; + dataSegmentOffset = 0xa2a0; + filenamesOffset = dataSegmentOffset + 0x242C; + numFilenames = 100; + charsStart = dataSegmentOffset + 0x2F1A; + charsEnd = dataSegmentOffset + 0x34FB; + roomsStart = dataSegmentOffset + 0x23AC; + roomsEnd = dataSegmentOffset + 0x2F1A; + travelPosOffset = dataSegmentOffset + 0x494E; + numRooms = 64; + roomDescs = &Amazon::ROOM_DESCR[0]; + deathScreens = Amazon::DEATH_SCREENS_ENG; + deathText = &Amazon::DEATH_TEXT_ENG[0]; + numDeaths = sizeof(Amazon::DEATH_SCREENS_ENG); + numItems = 85; + itemNames = &Amazon::INVENTORY_NAMES_ENG[0]; + comboTable = &Amazon::COMBO_TABLE[0][0]; + break; + + case 1224: + // Martian Memorandum English packed + printf("Martian Memorandum provided that's packed with EXEPACK.\n"); + printf("It needs to be first unpacked before it can be used with this tool.\n"); + return false; + + case 0: + // Martian Memorandum English + gameId = 2; + dataSegmentOffset = 0x8d78; + filenamesOffset = dataSegmentOffset + 0x373A; + numFilenames = 80; + charsStart = dataSegmentOffset + 0x40F2; + charsEnd = dataSegmentOffset + 0x46F8; + roomsStart = dataSegmentOffset + 0x36DA; + roomsEnd = dataSegmentOffset + 0x40F2; + travelPosOffset = dataSegmentOffset + 0x58E9; + numRooms = 48; + roomDescs = &Martian::ROOM_DESCR[0]; + deathScreens = Martian::DEATH_SCREENS_ENG; + deathText = &Martian::DEATH_TEXT_ENG[0]; + numDeaths = sizeof(Martian::DEATH_SCREENS_ENG); + numItems = 85; + itemNames = &Martian::INVENTORY_NAMES_ENG[0]; + comboTable = nullptr; + break; + + default: + printf("Unknown game executable specified - %s\n", name); + exeFile.close(); + return false; + } + + // Write out header entry + uint outputOffset = outputFile.size(); + outputFile.seek(8 + idx * 8); + outputFile.writeByte(gameId); + outputFile.writeByte(discType); + outputFile.writeByte(demoType); + outputFile.writeByte(language); + outputFile.writeLong(outputOffset); + outputFile.seek(0, SEEK_END); + + // Write out list of AP filenames + outputFile.writeWord(numFilenames); + for (uint idx = 0; idx < numFilenames; ++idx) { + exeFile.seek(filenamesOffset + idx * 2); + uint nameOffset = exeFile.readWord(); + + exeFile.seek(dataSegmentOffset + nameOffset); + outputFile.writeString(exeFile); + } + + // Write out the character list + exeFile.seek(charsStart); + Common::Array charOffsets; + charOffsets.push_back(exeFile.readWord()); + assert((dataSegmentOffset + charOffsets[0] - exeFile.pos()) < 512); + + while (exeFile.pos() < (dataSegmentOffset + charOffsets[0])) + charOffsets.push_back(exeFile.readWord()); + + outputFile.writeWord(charOffsets.size()); + charOffsets.push_back(charsEnd); + for (uint idx = 0; idx < charOffsets.size() - 1; ++idx) { + if (charOffsets[idx] == 0) { + outputFile.writeWord(0); + } else { + uint nextOffset = 0xffff; + for (uint idx2 = 0; idx2 < charOffsets.size(); ++idx2) { + if (charOffsets[idx2] && charOffsets[idx2] > charOffsets[idx] && charOffsets[idx2] < nextOffset) + nextOffset = charOffsets[idx2]; + } + uint size = nextOffset - charOffsets[idx]; + + exeFile.seek(dataSegmentOffset + charOffsets[idx]); + outputFile.writeWord(size); + outputFile.write(exeFile, size); + } + } + + // Write out the room data + Common::Array roomOffsets; + Common::Array travelPos; + + exeFile.seek(roomsStart); + for (uint idx = 0; idx < numRooms; ++idx) + roomOffsets.push_back(exeFile.readWord()); + roomOffsets.push_back(roomsEnd); + + exeFile.seek(travelPosOffset); + for (uint idx = 0; idx < numRooms; ++idx) { + int16 xp = (int16)exeFile.readWord(); + int16 yp = (int16)exeFile.readWord(); + travelPos.push_back(Common::Point(xp, yp)); + } + + outputFile.writeWord(numRooms); + for (uint idx = 0; idx < numRooms; ++idx) { + uint dataSize = 0; + + if (roomOffsets[idx] == 0) { + dataSize = 0; + } else { + // Find the offset of the next higher entry that's non-zero + uint offset = 0; + for (uint idx2 = idx + 1; !offset; ++idx2) + offset = roomOffsets[idx2]; + dataSize = offset - roomOffsets[idx]; + exeFile.seek(dataSegmentOffset + roomOffsets[idx]); + } + + // Write out the room description (used only by the debugger) + outputFile.writeString(roomDescs[idx]); + + // Write out travel position + outputFile.writeWord((uint16)travelPos[idx].x); + outputFile.writeWord((uint16)travelPos[idx].y); + + // Write out the data for the room + outputFile.writeWord(dataSize); + if (dataSize > 0) + outputFile.write(exeFile, dataSize); + } + + // Write out the deaths list + outputFile.writeWord(numDeaths); + for (uint idx = 0; idx < numDeaths; ++idx) { + // Write out the screen number and text + outputFile.writeByte(deathScreens[idx]); + outputFile.writeString(deathText[idx]); + } + + // Write out inventory data + outputFile.writeWord(numItems); + for (uint idx = 0; idx < numItems; ++idx) { + outputFile.writeString(itemNames[idx]); + + if (comboTable == nullptr) { + for (uint cIdx = 0; cIdx < 4; ++cIdx) + outputFile.writeWord(0); + } else { + for (uint cIdx = 0; cIdx < 4; ++cIdx, ++comboTable) + outputFile.writeWord((uint16)*comboTable); + } + } + + // Write out game specific strings and other data + if (gameId == 1) { + // Write out miscellaneous strings + outputFile.writeString(Amazon::NO_HELP_MESSAGE_ENG); + outputFile.writeString(Amazon::NO_HINTS_MESSAGE_ENG); + outputFile.writeString(Amazon::RIVER_HIT1_ENG); + outputFile.writeString(Amazon::RIVER_HIT2_ENG); + outputFile.writeString(Amazon::BAR_MESSAGE_ENG); + + for (int idx = 0; idx < 3; ++idx) + outputFile.writeString(Amazon::HELPLVLTXT_ENG[idx]); + for (int idx = 0; idx < 9; ++idx) + outputFile.writeString(Amazon::IQLABELS_ENG[idx]); + + outputFile.writeString(Amazon::CANT_GET_THERE_ENG); + } + + // Do final padding to the next paragraph boundary + if ((outputFile.size() % 16) != 0) + outputFile.writeByte(0, 16 - (outputFile.size() % 16)); + + // Close the executable and signal that it was processed successfully + exeFile.close(); + return true; +} diff --git a/devtools/create_access/create_access_dat.h b/devtools/create_access/create_access_dat.h new file mode 100644 index 0000000000..8b2af6b48b --- /dev/null +++ b/devtools/create_access/create_access_dat.h @@ -0,0 +1,186 @@ +/* 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. + * + */ + +#ifndef __CREATE_ACCESS_DAT_H__ +#define __CREATE_ACCESS_DAT_H__ + +#include +#include +#include "common/scummsys.h" +#include "common/endian.h" +#include "common/array.h" + +#define VERSION_NUMBER 1 + +enum AccessMode { + kFileReadMode = 1, + kFileWriteMode = 2 +}; + +class File { +private: + FILE *_f; + const byte *_memPtr; + size_t _offset, _size; +public: + File() : _f(nullptr), _memPtr(nullptr), _offset(0), _size(0) {} + + bool open(const char *filename, AccessMode mode = kFileReadMode) { + _memPtr = nullptr; + _f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb+"); + return (_f != NULL); + } + bool open(const byte *data, uint size) { + close(); + _memPtr = data; + _size = size; + return true; + } + + void close() { + if (_f) + fclose(_f); + _f = nullptr; + _memPtr = nullptr; + } + int seek(int32 offset, int whence = SEEK_SET) { + if (_f) + return fseek(_f, offset, whence); + + switch (whence) { + case SEEK_SET: + _offset = offset; + break; + case SEEK_CUR: + _offset += offset; + break; + case SEEK_END: + _offset = _size + offset; + break; + default: + break; + } + + return _offset; + } + void skip(int32 offset) { + if (_f) + fseek(_f, offset, SEEK_CUR); + else + _offset += offset; + } + long read(void *buffer, size_t len) { + if (_f) + return fread(buffer, 1, len, _f); + + uint bytesToRead = CLIP(len, (size_t)0, _size - _offset); + memcpy(buffer, &_memPtr[_offset], bytesToRead); + _offset += bytesToRead; + return bytesToRead; + } + void write(const void *buffer, size_t len) { + assert(_f); + fwrite(buffer, 1, len, _f); + } + void write(File &src, size_t len) { + for (size_t idx = 0; idx < len; ++idx) + writeByte(src.readByte()); + } + byte readByte() { + byte v; + read(&v, sizeof(byte)); + return v; + } + uint16 readWord() { + uint16 v; + read(&v, sizeof(uint16)); + return FROM_LE_16(v); + } + uint32 readLong() { + uint32 v; + read(&v, sizeof(uint32)); + return FROM_LE_32(v); + } + void writeByte(byte v) { + write(&v, sizeof(byte)); + } + void writeByte(byte v, int len) { + byte *b = new byte[len]; + memset(b, v, len); + write(b, len); + delete[] b; + } + void writeWord(uint16 v) { + uint16 vTemp = TO_LE_16(v); + write(&vTemp, sizeof(uint16)); + } + void writeLong(uint32 v) { + uint32 vTemp = TO_LE_32(v); + write(&vTemp, sizeof(uint32)); + } + void writeString(const char *msg) { + if (!msg) { + writeByte(0); + } else { + do { + writeByte(*msg); + } while (*msg++); + } + } + void writeString(File &src) { + char c; + do { + c = src.readByte(); + writeByte(c); + } while (c); + } + uint32 pos() const { + if (_f) + return ftell(_f); + else + return _offset; + } + uint32 size() const { + if (_f) { + uint32 currentPos = pos(); + fseek(_f, 0, SEEK_END); + uint32 result = pos(); + fseek(_f, currentPos, SEEK_SET); + return result; + } + else if (_memPtr) { + return _size; + } + else { + return 0; + } + } + bool eof() const { + if (_f) + return feof(_f) != 0; + else if (_memPtr) + return _offset >= _size; + return false; + } +}; + +#endif diff --git a/devtools/create_access/martian_resources.cpp b/devtools/create_access/martian_resources.cpp new file mode 100644 index 0000000000..2a726a78ea --- /dev/null +++ b/devtools/create_access/martian_resources.cpp @@ -0,0 +1,182 @@ +/* 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. + * + */ + +#include "martian_resources.h" + +namespace Martian { + + +const byte MOUSE0[] = { + // hotspot x and y, uint16 LE + 0, 0, 0, 0, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0, 2, 0xF7, 5, + 0, 3, 0xF7, 0xF7, 5, + 0, 3, 0xF7, 0xF7, 5, + 0, 4, 0xF7, 0xF7, 0xF7, 5, + 0, 4, 0xF7, 0xF7, 0xF7, 5, + 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 2, 3, 0xF7, 0xF7, 5, + 3, 3, 0xF7, 0xF7, 5, + 3, 3, 0xF7, 0xF7, 5, + 4, 2, 0xF7, 5 +}; +const byte MOUSE1[] = { + // hotspot x and y, uint16 LE + 7, 0, 7, 0, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 6, 1, 0xF7, + 4, 5, 0xFF, 0xFF, 0, 0xFF, 0xFF, + 3, 7, 0xFF, 0, 0, 0, 0, 0, 0xFF, + 2, 9, 0xFF, 0, 0, 0, 0xF7, 0, 0, 0, 0xFF, + 1, 11, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, + 1, 11, 0xFF, 0, 0, 0, 0, 0xF7, 0, 0, 0, 0, 0xFF, + 0, 13, 0xF7, 0, 0, 0xF7, 0, 0xF7, 0, 0xF7, 0, 0xF7, 0, 0, 0xF7, + 1, 11, 0xFF, 0, 0, 0, 0, 0xF7, 0, 0, 0, 0, 0xFF, + 1, 11, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, + 2, 9, 0xFF, 0, 0, 0, 0xF7, 0, 0, 0, 0xFF, + 3, 7, 0xFF, 0, 0, 0, 0, 0, 0xFF, + 4, 5, 0xFF, 0xFF, 0, 0xFF, 0xFF, + 6, 1, 0xF7, + 0, 0, + 0, 0, + 0, 0 +}; +const byte MOUSE2[] = { + // hotspot x and y, uint16 LE + 8, 0, 8, 0, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0, 0, + 0, 0, + 7, 2, 4, 5, + 7, 2, 4, 5, + 7, 2, 4, 5, + 7, 2, 4, 5, + 7, 2, 4, 5, + 2, 12, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 5, + 7, 2, 4, 5, + 7, 2, 4, 5, + 7, 2, 4, 5, + 7, 2, 4, 5, + 7, 2, 4, 5, + 0, 0, + 0, 0, + 0, 0 +}; +const byte MOUSE3[] = { + // hotspot x and y, uint16 LE + 0, 0, 0, 0, + // byte 1: number of skipped pixels + // byte 2: number of plotted pixels + // then, pixels + 0, 11, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 0, 12, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 5, + 0, 12, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 5, + 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 5, 0, 0, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5, + 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, + 1, 11, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 0, 0, + 0, 0, + 0, 0 +}; + +const byte *const CURSORS[MARTIAN_NUM_CURSORS] = { + MOUSE0, MOUSE1, MOUSE2, MOUSE3 +}; +const uint CURSOR_SIZES[MARTIAN_NUM_CURSORS] = { + sizeof(MOUSE0), sizeof(MOUSE1), sizeof(MOUSE2), sizeof(MOUSE3) +}; + +const char *const ROOM_DESCR[48] = { + nullptr, "TBD ROOM_TABLE1", "TBD ROOM_TABLE2", "TBD ROOM_TABLE3", "TBD ROOM_TABLE4", + "TBD ROOM_TABLE5", "TBD ROOM_TABLE6", "TBD ROOM_TABLE7", "TBD ROOM_TABLE8", "TBD ROOM_TABLE9", + nullptr, "TBD ROOM_TABLE11", nullptr, "TBD ROOM_TABLE13", "TBD ROOM_TABLE14", + "TBD ROOM_TABLE15", "TBD ROOM_TABLE16", "TBD ROOM_TABLE17", "TBD ROOM_TABLE18", nullptr, + nullptr, "TBD ROOM_TABLE21", "TBD ROOM_TABLE22", "TBD ROOM_TABLE23", "TBD ROOM_TABLE24", + "TBD ROOM_TABLE25", "TBD ROOM_TABLE26", "TBD ROOM_TABLE27", "TBD ROOM_TABLE28", "TBD ROOM_TABLE29", + "TBD ROOM_TABLE30", "TBD ROOM_TABLE31", "TBD ROOM_TABLE32", "TBD ROOM_TABLE33", nullptr, + "TBD ROOM_TABLE35", nullptr, "TBD ROOM_TABLE37", "TBD ROOM_TABLE38", "TBD ROOM_TABLE39", + nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, "TBD ROOM_TABLE47" +}; + +const byte DEATH_SCREENS_ENG[20] = { + 5, 5, 3, 3, 7, 4, 6, 2, 2, 2, 1, 5, 3, 5, 2, 8, 5, 3, 8, 5 +}; + +const char *const DEATH_TEXT_ENG[20] = { + "A VICIOUS THUG PULLS OUT HIS GUN AND AIR CONDITIONS YOUR BRAIN.", + "BIG DICK COMES BACK AND ANNOUNCES YOUR TIME IS UP. ONE OF HIS BOYS PROCEEDS TO PART YOUR EYEBROWS.", + "ALTHOUGH HIS FIRST SHOT MISSED, THE PUNK FINDS YOU AND TURNS YOU INTO A DOUGHNUT.", + "THE CREEP SPOTS YOU. HE TURNS AND FIRES HIS WEAPON. IT BURNS A HOLE A BUZZARD CAN FLY THROUGH.", + "OBVIOUSLY RICK LOGAN HAS A FEW TRICK UP HIS SLEEVE. A TREMENDOUS WEIGHT HITS YOUR HEAD. YOU MUMBLE; WATCH OUT FOR THAT TREE...", + "SLOWLY SINKING IN THE SLIMY OOZE, YOU THINK OF SEVERAL JELLO WRESTLING MATCHES YOU'VE ATTENDED. BUT NO MORE...", + "THE PATH SUDDENLY GIVES WAY AND YOU FEEL MANY STAKES TEAR THROUGH YOUR FLESH. HOW DO YOU LIKE YOUR STAKE", + "THE SNAKE SINKS ITS FANGS INTO YOU LEG. THE POISON WORKS QUICKLY. THE SNAKE THEN SWALLOWS YOU WHOLE.", + "YOU FADE AWAY, GLOWING LIKE A LIGHTBULB.", + "YOU TOUCH THE BUBBLING RADIOACTIVE SELTZER. IT IMMEDIATELY CAUSES VITAL ORGANS TO ELONGATE AND EXPLODE. YOU DIE WITH AN ABSURD AND FOOLISH LOOK ON YOUR FACE.", + "THE DOGS PRETTY HUNGRY. IT WON'T TAKE HIM LONG TO FINISH SO SIT BACK AND ENJOY IT.", + "ROCKY DOESN'T LIKE BEING FOLLOWED. HE DECIDES TO BEAT YOU. WITHIN AND INCH OF YOUR LIFE. UNFORTUNATELY, HE MISJUDGED THE DISTANCE", + "YOU STUMBLE INTO DEADLY LASER FIRE.", + "THE OUTPOST AND YOUR BODY PARTS ARE BLOWN TO KINGDOM COME.", + "YOU REACH THE TOP, BUT YOUR AIR SOON RUNS OUT LEAVING YOU BREATHLESS.", + "YOU DIE IN THE FIERY EXPLOSION.", + "YOU FALL HUNDREDS OF FEET TO YOUR DEATH.", + "YOU WALK ONTO A PRESSURE SENSITIVE SECURITY PAD. A LASER ZEROS IN AND BLOWS A HOLE THE SIZE OF A SUBARU TIRE THROUGH YOU.", + "DANGERFIELD'S EXPERIMENT BACKFIRES. IT RELEASES A DEMON FROM HIS SUBCONSCIOUS WHICH DESTROYS THE ENTIRE PLANET.", + "ONCE DANGERFIELD GETS OUT OF HIS CHAMBER, HE PULLS OUT A WEAPON AND LETS YOU HAVE IT." +}; + +const char *const INVENTORY_NAMES_ENG[55] = { + "CAMERA", "LENS", "PHOTOS", "MAIL", "GUN", + "CASH", "COMLINK", "AMMO", "LOCKPICK KIT", "EARRING", + "RECIEPTS", "PAPER", "LADDER", "BOOTS", "DOCUMENTS", + "KNIFE", "DAGGER", "KEYS", "ROCK", "LOG", + "SHOVEL", "STONE", "REMOTE CONTROL", "FOOD AND WATER", "DOOR CARD KEY", + "FLASHLIGHT", "INTERLOCK KEY", "TOOLS", "REBREATHER", "JET PACK", + "ROD", "HCL2", "SAFE CARD KEY", "TUNING FORK", "STONE", + "ROSE", "KEY", "NOTE", "ALLEN WRENCH", "HOVER BOARD", + "BLUE PRINTS", "LETTER", "MEMORANDUM", "MARKERS", "FILM", + "ANDRETTI FILM", "GLASSES", "AMULET", "FACIAL KIT", "CAT FOOD", + "MONKEY WRENCH", "BIG DICK CARD", "BRA", "BOLT", nullptr +}; + +}; diff --git a/devtools/create_access/martian_resources.h b/devtools/create_access/martian_resources.h new file mode 100644 index 0000000000..c3dfc2a7c2 --- /dev/null +++ b/devtools/create_access/martian_resources.h @@ -0,0 +1,52 @@ +/* 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. + * + */ + +#ifndef __MARTIAN_RESOURCES_H__ +#define __MARTIAN_RESOURCES_H__ + +#include "common/scummsys.h" + +namespace Martian { + +#define MARTIAN_NUM_CURSORS 4 +extern const byte *const CURSORS[MARTIAN_NUM_CURSORS]; +extern const uint CURSOR_SIZES[MARTIAN_NUM_CURSORS]; + +extern const char *const ROOM_DESCR[48]; + +extern const char *const DEATH_TEXT_ENG[20]; +extern const byte DEATH_SCREENS_ENG[20]; +extern const char *const INVENTORY_NAMES_ENG[55]; +extern const int COMBO_TABLE[85][4]; + +extern const char *const NO_HELP_MESSAGE_ENG; +extern const char *const NO_HINTS_MESSAGE_ENG; +extern const char *const RIVER_HIT1_ENG; +extern const char *const RIVER_HIT2_ENG; +extern const char *const BAR_MESSAGE_ENG; +extern const char *const HELPLVLTXT_ENG[3]; +extern const char *const IQLABELS_ENG[9]; +extern const char *const CANT_GET_THERE_ENG; + +}; + +#endif diff --git a/devtools/create_access/module.mk b/devtools/create_access/module.mk new file mode 100644 index 0000000000..4694ccc7ef --- /dev/null +++ b/devtools/create_access/module.mk @@ -0,0 +1,13 @@ + +MODULE := devtools/create_access + +MODULE_OBJS := \ + create_access_dat.o \ + amazon_resources.o \ + martian_resources.o + +# Set the name of the executable +TOOL_EXECUTABLE := create_access + +# Include common rules +include $(srcdir)/rules.mk -- cgit v1.2.3 From e9e099b6aca4b3b945158500fbb4d6706c6f7c72 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 6 Dec 2015 22:57:03 +0100 Subject: CREDITS: Add credit to the Mindfactory team for Broken Sword 2.5 --- devtools/credits.pl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'devtools') diff --git a/devtools/credits.pl b/devtools/credits.pl index f5d8542ae8..9bfbfd7b5d 100755 --- a/devtools/credits.pl +++ b/devtools/credits.pl @@ -1309,6 +1309,10 @@ begin_credits("Credits"); "Electronic Arts for providing the source code of the two Lost Files of Sherlock Holmes games. ". "James M. Ferguson and Barry Duncan for their tenacious efforts to recover the sources."); + add_paragraph( + "The Mindfactory team for writing Broken Sword 2.5, a splendid fan-made sequel, and for sharing ". + "the source code with us."); + end_section(); end_credits(); -- cgit v1.2.3 From c76059eaf9666058fa0b8fb6e8165d703d366a55 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 7 Dec 2015 00:06:50 +0100 Subject: CREDITS: Fix the case of mindFactory --- devtools/credits.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools') diff --git a/devtools/credits.pl b/devtools/credits.pl index 9bfbfd7b5d..1a038c7dee 100755 --- a/devtools/credits.pl +++ b/devtools/credits.pl @@ -1310,7 +1310,7 @@ begin_credits("Credits"); "James M. Ferguson and Barry Duncan for their tenacious efforts to recover the sources."); add_paragraph( - "The Mindfactory team for writing Broken Sword 2.5, a splendid fan-made sequel, and for sharing ". + "The mindFactory team for writing Broken Sword 2.5, a splendid fan-made sequel, and for sharing ". "the source code with us."); end_section(); -- cgit v1.2.3 From 5d1df1c2933b110e8edbe94f153c5d4c0ca022d3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 05:39:48 +0100 Subject: DEVTOOLS: Prefix varibles in structs/classes with '_' in xcode.[h/cpp]. This silences some variables and increases consistency with our code formatting conventions. --- devtools/create_project/xcode.cpp | 238 +++++++++++++++++++------------------- devtools/create_project/xcode.h | 128 ++++++++++---------- 2 files changed, 183 insertions(+), 183 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index babd530ad7..657adbc80f 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -42,42 +42,42 @@ namespace CreateProjectTool { defines.push_back(name); #define ADD_SETTING(config, key, value) \ - config.settings[key] = Setting(value, "", SettingsNoQuote); + config._settings[key] = Setting(value, "", SettingsNoQuote); #define ADD_SETTING_ORDER(config, key, value, order) \ - config.settings[key] = Setting(value, "", SettingsNoQuote, 0, order); + config._settings[key] = Setting(value, "", SettingsNoQuote, 0, order); #define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \ - config.settings[key] = Setting("", comment, SettingsNoValue, 0, order); + config._settings[key] = Setting("", comment, SettingsNoValue, 0, order); #define ADD_SETTING_QUOTE(config, key, value) \ - config.settings[key] = Setting(value); + config._settings[key] = Setting(value); #define ADD_SETTING_QUOTE_VAR(config, key, value) \ - config.settings[key] = Setting(value, "", SettingsQuoteVariable); + config._settings[key] = Setting(value, "", SettingsQuoteVariable); #define ADD_SETTING_LIST(config, key, values, flags, indent) \ - config.settings[key] = Setting(values, flags, indent); + config._settings[key] = Setting(values, flags, indent); #define REMOVE_SETTING(config, key) \ - config.settings.erase(key); + config._settings.erase(key); #define ADD_BUILD_FILE(id, name, fileRefId, comment) { \ Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); \ buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue); \ _buildFile.add(buildFile); \ - _buildFile.flags = SettingsSingleItem; \ + _buildFile._flags = SettingsSingleItem; \ } #define ADD_FILE_REFERENCE(id, name, properties) { \ Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); \ - if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue); \ - if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); \ - if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue|SettingsQuoteVariable); \ - if (!properties.filePath.empty()) fileRef->addProperty("path", properties.filePath, "", SettingsNoValue|SettingsQuoteVariable); \ - if (!properties.sourceTree.empty()) fileRef->addProperty("sourceTree", properties.sourceTree, "", SettingsNoValue); \ + if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", SettingsNoValue); \ + if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); \ + if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", SettingsNoValue|SettingsQuoteVariable); \ + if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", SettingsNoValue|SettingsQuoteVariable); \ + if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", SettingsNoValue); \ _fileReference.add(fileRef); \ - _fileReference.flags = SettingsSingleItem; \ + _fileReference._flags = SettingsSingleItem; \ } bool producesObjectFileOnOSX(const std::string &fileName) { @@ -93,7 +93,7 @@ bool producesObjectFileOnOSX(const std::string &fileName) { } XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) { - addProperty("name", name, "", SettingsNoValue|SettingsQuoteVariable); + addProperty("name", _name, "", SettingsNoValue|SettingsQuoteVariable); addProperty("sourceTree", "", "", SettingsNoValue|SettingsQuoteVariable); if (path != "") { @@ -106,43 +106,43 @@ XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &grou void XcodeProvider::Group::ensureChildExists(const std::string &name) { std::map::iterator it = _childGroups.find(name); if (it == _childGroups.end()) { - Group *child = new Group(parent, name, this->_treeName + '/' + name, name); + Group *child = new Group(_parent, name, this->_treeName + '/' + name, name); _childGroups[name] = child; addChildGroup(child); - parent->_groups.add(child); + _parent->_groups.add(child); } } void XcodeProvider::Group::addChildInternal(const std::string &id, const std::string &comment) { - if (properties.find("children") == properties.end()) { + if (_properties.find("children") == _properties.end()) { Property children; - children.hasOrder = true; - children.flags = SettingsAsList; - properties["children"] = children; + children._hasOrder = true; + children._flags = SettingsAsList; + _properties["children"] = children; } - properties["children"].settings[id] = Setting("", comment + " in Sources", SettingsNoValue, 0, _childOrder++); + _properties["children"]._settings[id] = Setting("", comment + " in Sources", SettingsNoValue, 0, _childOrder++); if (_childOrder == 1) { // Force children to use () even when there is only 1 child. // Also this enforces the use of "," after the single item, instead of ; (see writeProperty) - properties["children"].flags |= SettingsSingleItem; + _properties["children"]._flags |= SettingsSingleItem; } else { - properties["children"].flags ^= SettingsSingleItem; + _properties["children"]._flags ^= SettingsSingleItem; } } void XcodeProvider::Group::addChildGroup(const Group* group) { - addChildInternal(parent->getHash(group->_treeName), group->_treeName); + addChildInternal(_parent->getHash(group->_treeName), group->_treeName); } void XcodeProvider::Group::addChildFile(const std::string &name) { std::string id = "FileReference_" + _treeName + "/" + name; - addChildInternal(parent->getHash(id), name); + addChildInternal(_parent->getHash(id), name); FileProperty property = FileProperty(name, name, name, "\"\""); - parent->addFileReference(id, name, property); + _parent->addFileReference(id, name, property); if (producesObjectFileOnOSX(name)) { - parent->addBuildFile(_treeName + "/" + name, name, parent->getHash(id), name + " in Sources"); + _parent->addBuildFile(_treeName + "/" + name, name, _parent->getHash(id), name + " in Sources"); } } @@ -180,13 +180,13 @@ XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path) void XcodeProvider::addFileReference(const std::string &id, const std::string &name, FileProperty properties) { Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); - if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue); - if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); - if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue|SettingsQuoteVariable); - if (!properties.filePath.empty()) fileRef->addProperty("path", properties.filePath, "", SettingsNoValue|SettingsQuoteVariable); - if (!properties.sourceTree.empty()) fileRef->addProperty("sourceTree", properties.sourceTree, "", SettingsNoValue); + if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", SettingsNoValue); + if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); + if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", SettingsNoValue|SettingsQuoteVariable); + if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", SettingsNoValue|SettingsQuoteVariable); + if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", SettingsNoValue); _fileReference.add(fileRef); - _fileReference.flags = SettingsSingleItem; + _fileReference._flags = SettingsSingleItem; } void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) { @@ -196,7 +196,7 @@ void XcodeProvider::addProductFileReference(const std::string &id, const std::st fileRef->addProperty("path", name, "", SettingsNoValue|SettingsQuoteVariable); fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", SettingsNoValue); _fileReference.add(fileRef); - _fileReference.flags = SettingsSingleItem; + _fileReference._flags = SettingsSingleItem; } void XcodeProvider::addBuildFile(const std::string &id, const std::string &name, const std::string &fileRefId, const std::string &comment) { @@ -204,7 +204,7 @@ void XcodeProvider::addBuildFile(const std::string &id, const std::string &name, Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue); _buildFile.add(buildFile); - _buildFile.flags = SettingsSingleItem; + _buildFile._flags = SettingsSingleItem; } XcodeProvider::XcodeProvider(StringList &global_warnings, std::map &project_warnings, const int version) @@ -343,14 +343,14 @@ void XcodeProvider::setupCopyFilesBuildPhase() { * (each native target has different build rules) */ void XcodeProvider::setupFrameworksBuildPhase() { - _frameworksBuildPhase.comment = "PBXFrameworksBuildPhase"; + _frameworksBuildPhase._comment = "PBXFrameworksBuildPhase"; // Just use a hardcoded id for the Frameworks-group Group *frameworksGroup = new Group(this, "Frameworks", "PBXGroup_CustomTemplate_Frameworks_", ""); Property children; - children.hasOrder = true; - children.flags = SettingsAsList; + children._hasOrder = true; + children._flags = SettingsAsList; // Setup framework file properties std::map properties; @@ -380,7 +380,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { DEF_LOCALLIB_STATIC("libfreetype"); // DEF_LOCALLIB_STATIC("libmpeg2"); - frameworksGroup->properties["children"] = children; + frameworksGroup->_properties["children"] = children; _groups.add(frameworksGroup); // Force this to be added as a sub-group in the root. _rootSourceGroup->addChildGroup(frameworksGroup); @@ -398,8 +398,8 @@ void XcodeProvider::setupFrameworksBuildPhase() { // List of frameworks Property iPhone_files; - iPhone_files.hasOrder = true; - iPhone_files.flags = SettingsAsList; + iPhone_files._hasOrder = true; + iPhone_files._flags = SettingsAsList; ValueList frameworks_iPhone; frameworks_iPhone.push_back("CoreAudio.framework"); @@ -423,7 +423,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); } - framework_iPhone->properties["files"] = iPhone_files; + framework_iPhone->_properties["files"] = iPhone_files; _frameworksBuildPhase.add(framework_iPhone); #endif @@ -436,8 +436,8 @@ void XcodeProvider::setupFrameworksBuildPhase() { // List of frameworks Property osx_files; - osx_files.hasOrder = true; - osx_files.flags = SettingsAsList; + osx_files._hasOrder = true; + osx_files._flags = SettingsAsList; ValueList frameworks_osx; frameworks_osx.push_back("CoreFoundation.framework"); @@ -465,7 +465,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); } - framework_OSX->properties["files"] = osx_files; + framework_OSX->_properties["files"] = osx_files; _frameworksBuildPhase.add(framework_OSX); #ifdef ENABLE_IOS @@ -478,8 +478,8 @@ void XcodeProvider::setupFrameworksBuildPhase() { // List of frameworks Property simulator_files; - simulator_files.hasOrder = true; - simulator_files.flags = SettingsAsList; + simulator_files._hasOrder = true; + simulator_files._flags = SettingsAsList; ValueList frameworks_simulator; frameworks_simulator.push_back("CoreAudio.framework"); @@ -500,14 +500,14 @@ void XcodeProvider::setupFrameworksBuildPhase() { ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); } - framework_simulator->properties["files"] = simulator_files; + framework_simulator->_properties["files"] = simulator_files; _frameworksBuildPhase.add(framework_simulator); #endif } void XcodeProvider::setupNativeTarget() { - _nativeTarget.comment = "PBXNativeTarget"; + _nativeTarget._comment = "PBXNativeTarget"; // Just use a hardcoded id for the Products-group Group *productsGroup = new Group(this, "Products", "PBXGroup_CustomTemplate_Products_" , ""); @@ -523,12 +523,12 @@ void XcodeProvider::setupNativeTarget() { target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", SettingsNoValue); Property buildPhases; - buildPhases.hasOrder = true; - buildPhases.flags = SettingsAsList; - buildPhases.settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", SettingsNoValue, 0, 0); - buildPhases.settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", SettingsNoValue, 0, 1); - buildPhases.settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", SettingsNoValue, 0, 2); - target->properties["buildPhases"] = buildPhases; + buildPhases._hasOrder = true; + buildPhases._flags = SettingsAsList; + buildPhases._settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", SettingsNoValue, 0, 0); + buildPhases._settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", SettingsNoValue, 0, 1); + buildPhases._settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", SettingsNoValue, 0, 2); + target->_properties["buildPhases"] = buildPhases; target->addProperty("buildRules", "", "", SettingsNoValue|SettingsAsList); @@ -548,7 +548,7 @@ void XcodeProvider::setupNativeTarget() { } void XcodeProvider::setupProject() { - _project.comment = "PBXProject"; + _project._comment = "PBXProject"; Object *project = new Object(this, "PBXProject", "PBXProject", "PBXProject", "", "Project object"); @@ -559,12 +559,12 @@ void XcodeProvider::setupProject() { // List of known regions Property regions; - regions.flags = SettingsAsList; + regions._flags = SettingsAsList; ADD_SETTING_ORDER_NOVALUE(regions, "English", "", 0); ADD_SETTING_ORDER_NOVALUE(regions, "Japanese", "", 1); ADD_SETTING_ORDER_NOVALUE(regions, "French", "", 2); ADD_SETTING_ORDER_NOVALUE(regions, "German", "", 3); - project->properties["knownRegions"] = regions; + project->_properties["knownRegions"] = regions; project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", SettingsNoValue); project->addProperty("projectDirPath", _projectRoot, "", SettingsNoValue|SettingsQuoteVariable); @@ -572,25 +572,25 @@ void XcodeProvider::setupProject() { // List of targets Property targets; - targets.flags = SettingsAsList; + targets._flags = SettingsAsList; #ifdef ENABLE_IOS - targets.settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], SettingsNoValue, 0, 0); + targets._settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], SettingsNoValue, 0, 0); #endif - targets.settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], SettingsNoValue, 0, 1); + targets._settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], SettingsNoValue, 0, 1); #ifdef ENABLE_IOS - targets.settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], SettingsNoValue, 0, 2); + targets._settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], SettingsNoValue, 0, 2); #endif - project->properties["targets"] = targets; + project->_properties["targets"] = targets; #ifndef ENABLE_IOS // Force list even when there is only a single target - project->properties["targets"].flags |= SettingsSingleItem; + project->_properties["targets"]._flags |= SettingsSingleItem; #endif _project.add(project); } void XcodeProvider::setupResourcesBuildPhase() { - _resourcesBuildPhase.comment = "PBXResourcesBuildPhase"; + _resourcesBuildPhase._comment = "PBXResourcesBuildPhase"; // Setup resource file properties std::map properties; @@ -619,8 +619,8 @@ void XcodeProvider::setupResourcesBuildPhase() { // Add default files Property files; - files.hasOrder = true; - files.flags = SettingsAsList; + files._hasOrder = true; + files._flags = SettingsAsList; ValueList files_list; files_list.push_back("scummclassic.zip"); @@ -651,14 +651,14 @@ void XcodeProvider::setupResourcesBuildPhase() { // Add custom files depending on the target if (_targets[i] == PROJECT_DESCRIPTION "-OS X") { - files.settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", SettingsNoValue, 0, 6); + files._settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", SettingsNoValue, 0, 6); // Remove 2 iphone icon files - files.settings.erase(getHash("PBXResources_Default.png")); - files.settings.erase(getHash("PBXResources_icon.png")); + files._settings.erase(getHash("PBXResources_Default.png")); + files._settings.erase(getHash("PBXResources_icon.png")); } - resource->properties["files"] = files; + resource->_properties["files"] = files; resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); @@ -667,7 +667,7 @@ void XcodeProvider::setupResourcesBuildPhase() { } void XcodeProvider::setupSourcesBuildPhase() { - _sourcesBuildPhase.comment = "PBXSourcesBuildPhase"; + _sourcesBuildPhase._comment = "PBXSourcesBuildPhase"; // Setup source file properties std::map properties; @@ -679,19 +679,19 @@ void XcodeProvider::setupSourcesBuildPhase() { source->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); Property files; - files.hasOrder = true; - files.flags = SettingsAsList; + files._hasOrder = true; + files._flags = SettingsAsList; int order = 0; - for (std::vector::iterator file = _buildFile.objects.begin(); file !=_buildFile.objects.end(); ++file) { - if (!producesObjectFileOnOSX((*file)->name)) { + for (std::vector::iterator file = _buildFile._objects.begin(); file !=_buildFile._objects.end(); ++file) { + if (!producesObjectFileOnOSX((*file)->_name)) { continue; } - std::string comment = (*file)->name + " in Sources"; - ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->id), comment, order++); + std::string comment = (*file)->_name + " in Sources"; + ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->_id), comment, order++); } - source->properties["files"] = files; + source->_properties["files"] = files; source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); @@ -702,8 +702,8 @@ void XcodeProvider::setupSourcesBuildPhase() { // Setup all build configurations void XcodeProvider::setupBuildConfiguration() { - _buildConfiguration.comment = "XCBuildConfiguration"; - _buildConfiguration.flags = SettingsAsList; + _buildConfiguration._comment = "XCBuildConfiguration"; + _buildConfiguration._flags = SettingsAsList; ///**************************************** // * iPhone @@ -749,7 +749,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2"); iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); - iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug; + iPhone_Debug_Object->_properties["buildSettings"] = iPhone_Debug; // Release Object *iPhone_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Release", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Release"); @@ -760,7 +760,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app"); iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue); - iPhone_Release_Object->properties["buildSettings"] = iPhone_Release; + iPhone_Release_Object->_properties["buildSettings"] = iPhone_Release; _buildConfiguration.add(iPhone_Debug_Object); _buildConfiguration.add(iPhone_Release_Object); @@ -805,7 +805,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(scummvm_Debug, "SDKROOT", "macosx"); scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); - scummvm_Debug_Object->properties["buildSettings"] = scummvm_Debug; + scummvm_Debug_Object->_properties["buildSettings"] = scummvm_Debug; // Release Object *scummvm_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_NAME "_Release", PROJECT_NAME, "XCBuildConfiguration", "PBXProject", "Release"); @@ -816,7 +816,7 @@ void XcodeProvider::setupBuildConfiguration() { REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH"); scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue); - scummvm_Release_Object->properties["buildSettings"] = scummvm_Release; + scummvm_Release_Object->_properties["buildSettings"] = scummvm_Release; _buildConfiguration.add(scummvm_Debug_Object); _buildConfiguration.add(scummvm_Release_Object); @@ -880,7 +880,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); scummvmOSX_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); - scummvmOSX_Debug_Object->properties["buildSettings"] = scummvmOSX_Debug; + scummvmOSX_Debug_Object->_properties["buildSettings"] = scummvmOSX_Debug; // Release Object *scummvmOSX_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-OSX_Release", _targets[OSX_TARGET] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Release"); @@ -891,7 +891,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(scummvmOSX_Release, "WRAPPER_EXTENSION", "app"); scummvmOSX_Release_Object->addProperty("name", "Release", "", SettingsNoValue); - scummvmOSX_Release_Object->properties["buildSettings"] = scummvmOSX_Release; + scummvmOSX_Release_Object->_properties["buildSettings"] = scummvmOSX_Release; _buildConfiguration.add(scummvmOSX_Debug_Object); _buildConfiguration.add(scummvmOSX_Release_Object); @@ -910,7 +910,7 @@ void XcodeProvider::setupBuildConfiguration() { REMOVE_SETTING(scummvmSimulator_Debug, "TARGETED_DEVICE_FAMILY"); scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); - scummvmSimulator_Debug_Object->properties["buildSettings"] = scummvmSimulator_Debug; + scummvmSimulator_Debug_Object->_properties["buildSettings"] = scummvmSimulator_Debug; // Release Object *scummvmSimulator_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Release", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Release"); @@ -921,28 +921,28 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(scummvmSimulator_Release, "WRAPPER_EXTENSION", "app"); scummvmSimulator_Release_Object->addProperty("name", "Release", "", SettingsNoValue); - scummvmSimulator_Release_Object->properties["buildSettings"] = scummvmSimulator_Release; + scummvmSimulator_Release_Object->_properties["buildSettings"] = scummvmSimulator_Release; _buildConfiguration.add(scummvmSimulator_Debug_Object); _buildConfiguration.add(scummvmSimulator_Release_Object); ////////////////////////////////////////////////////////////////////////// // Configuration List - _configurationList.comment = "XCConfigurationList"; - _configurationList.flags = SettingsAsList; + _configurationList._comment = "XCConfigurationList"; + _configurationList._flags = SettingsAsList; #endif // Warning: This assumes we have all configurations with a Debug & Release pair - for (std::vector::iterator config = _buildConfiguration.objects.begin(); config != _buildConfiguration.objects.end(); config++) { + for (std::vector::iterator config = _buildConfiguration._objects.begin(); config != _buildConfiguration._objects.end(); config++) { - Object *configList = new Object(this, "XCConfigurationList_" + (*config)->name, (*config)->name, "XCConfigurationList", "", "Build configuration list for " + (*config)->refType + " \"" + (*config)->name + "\""); + Object *configList = new Object(this, "XCConfigurationList_" + (*config)->_name, (*config)->_name, "XCConfigurationList", "", "Build configuration list for " + (*config)->_refType + " \"" + (*config)->_name + "\""); Property buildConfigs; - buildConfigs.flags = SettingsAsList; + buildConfigs._flags = SettingsAsList; - buildConfigs.settings[getHash((*config)->id)] = Setting("", "Debug", SettingsNoValue, 0, 0); - buildConfigs.settings[getHash((*(++config))->id)] = Setting("", "Release", SettingsNoValue, 0, 1); + buildConfigs._settings[getHash((*config)->_id)] = Setting("", "Debug", SettingsNoValue, 0, 0); + buildConfigs._settings[getHash((*(++config))->_id)] = Setting("", "Release", SettingsNoValue, 0, 1); - configList->properties["buildConfigurations"] = buildConfigs; + configList->_properties["buildConfigurations"] = buildConfigs; configList->addProperty("defaultConfigurationIsVisible", "0", "", SettingsNoValue); configList->addProperty("defaultConfigurationName", "Release", "", SettingsNoValue); @@ -1034,28 +1034,28 @@ std::string XcodeProvider::writeProperty(const std::string &variable, Property & output += (flags & SettingsSingleItem ? "" : "\t\t\t") + variable + " = "; - if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem)) - output += (prop.flags & SettingsAsList) ? "(\n" : "{\n"; + if (prop._settings.size() > 1 || (prop._flags & SettingsSingleItem)) + output += (prop._flags & SettingsAsList) ? "(\n" : "{\n"; OrderedSettingList settings = prop.getOrderedSettingList(); for (OrderedSettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting) { - if (settings.size() > 1 || (prop.flags & SettingsSingleItem)) + if (settings.size() > 1 || (prop._flags & SettingsSingleItem)) output += (flags & SettingsSingleItem ? " " : "\t\t\t\t"); output += writeSetting((*setting).first, (*setting).second); // The combination of SettingsAsList, and SettingsSingleItem should use "," and not ";" (i.e children // in PBXGroup, so we special case that case here. - if ((prop.flags & SettingsAsList) && (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))) { - output += (prop.settings.size() > 0) ? ",\n" : "\n"; + if ((prop._flags & SettingsAsList) && (prop._settings.size() > 1 || (prop._flags & SettingsSingleItem))) { + output += (prop._settings.size() > 0) ? ",\n" : "\n"; } else { output += ";"; output += (flags & SettingsSingleItem ? " " : "\n"); } } - if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem)) - output += (prop.flags & SettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n"; + if (prop._settings.size() > 1 || (prop._flags & SettingsSingleItem)) + output += (prop._flags & SettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n"; return output; } @@ -1068,32 +1068,32 @@ std::string XcodeProvider::writeSetting(const std::string &variable, std::string // XCode project generator pbuilder_pbx.cpp, writeSettings() (under LGPL 2.1) std::string XcodeProvider::writeSetting(const std::string &variable, const Setting &setting) const { std::string output; - const std::string quote = (setting.flags & SettingsNoQuote) ? "" : "\""; + const std::string quote = (setting._flags & SettingsNoQuote) ? "" : "\""; const std::string escape_quote = quote.empty() ? "" : "\\" + quote; std::string newline = "\n"; // Get indent level - for (int i = 0; i < setting.indent; ++i) + for (int i = 0; i < setting._indent; ++i) newline += "\t"; // Setup variable - std::string var = (setting.flags & SettingsQuoteVariable) ? "\"" + variable + "\"" : variable; + std::string var = (setting._flags & SettingsQuoteVariable) ? "\"" + variable + "\"" : variable; // Output a list - if (setting.flags & SettingsAsList) { + if (setting._flags & SettingsAsList) { - output += var + ((setting.flags & SettingsNoValue) ? "(" : " = (") + newline; + output += var + ((setting._flags & SettingsNoValue) ? "(" : " = (") + newline; - for (unsigned int i = 0, count = 0; i < setting.entries.size(); ++i) { + for (unsigned int i = 0, count = 0; i < setting._entries.size(); ++i) { - std::string value = setting.entries.at(i).value; + std::string value = setting._entries.at(i)._value; if (!value.empty()) { if (count++ > 0) output += "," + newline; output += quote + replace(value, quote, escape_quote) + quote; - std::string comment = setting.entries.at(i).comment; + std::string comment = setting._entries.at(i)._comment; if (!comment.empty()) output += " /* " + comment + " */"; } @@ -1101,24 +1101,24 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti } // Add closing ")" on new line newline.resize(newline.size() - 1); - output += (setting.flags & SettingsNoValue) ? "\t\t\t)" : "," + newline + ")"; + output += (setting._flags & SettingsNoValue) ? "\t\t\t)" : "," + newline + ")"; } else { output += var; - output += (setting.flags & SettingsNoValue) ? "" : " = " + quote; + output += (setting._flags & SettingsNoValue) ? "" : " = " + quote; - for(unsigned int i = 0; i < setting.entries.size(); ++i) { - std::string value = setting.entries.at(i).value; + for(unsigned int i = 0; i < setting._entries.size(); ++i) { + std::string value = setting._entries.at(i)._value; if(i) output += " "; output += value; - std::string comment = setting.entries.at(i).comment; + std::string comment = setting._entries.at(i)._comment; if (!comment.empty()) output += " /* " + comment + " */"; } - output += (setting.flags & SettingsNoValue) ? "" : quote; + output += (setting._flags & SettingsNoValue) ? "" : quote; } return output; } diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index 2686d14986..00ed9ff573 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -56,14 +56,14 @@ private: // File properties struct FileProperty { - std::string fileEncoding; - std::string lastKnownFileType; - std::string fileName; - std::string filePath; - std::string sourceTree; + std::string _fileEncoding; + std::string _lastKnownFileType; + std::string _fileName; + std::string _filePath; + std::string _sourceTree; FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "") : - fileEncoding(""), lastKnownFileType(fileType), fileName(name), filePath(path), sourceTree(source) + _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) { } }; @@ -73,33 +73,33 @@ private: typedef std::vector ValueList; struct Entry { - std::string value; - std::string comment; + std::string _value; + std::string _comment; - Entry(std::string val, std::string cmt) : value(val), comment(cmt) {} + Entry(std::string val, std::string cmt) : _value(val), _comment(cmt) {} }; typedef std::vector EntryList; struct Setting { - EntryList entries; - int flags; - int indent; - int order; + EntryList _entries; + int _flags; + int _indent; + int _order; - explicit Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) { - entries.push_back(Entry(value, comment)); + explicit Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) { + _entries.push_back(Entry(value, comment)); } - explicit Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) { + explicit Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) { for (unsigned int i = 0; i < values.size(); i++) - entries.push_back(Entry(values[i], "")); + _entries.push_back(Entry(values[i], "")); } - explicit Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : entries(ents), flags(flgs), indent(idt), order(ord) {} + explicit Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : _entries(ents), _flags(flgs), _indent(idt), _order(ord) {} void addEntry(std::string value, std::string comment = "") { - entries.push_back(Entry(value, comment)); + _entries.push_back(Entry(value, comment)); } }; @@ -108,45 +108,45 @@ private: typedef std::vector OrderedSettingList; static bool OrderSortPredicate(const SettingPair& s1, const SettingPair& s2) { - return s1.second.order < s2.second.order; + return s1.second._order < s2.second._order; } struct Property { public: - SettingList settings; - int flags; - bool hasOrder; + SettingList _settings; + int _flags; + bool _hasOrder; - Property() : flags(0), hasOrder(false) {} + Property() : _flags(0), _hasOrder(false) {} // Constructs a simple Property - explicit Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) { - Setting setting(value, comment, flags, indent); + explicit Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) { + Setting setting(value, comment, _flags, indent); - settings[name] = setting; + _settings[name] = setting; } - Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) { - Setting setting(values, flags, indent); + Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) { + Setting setting(values, _flags, indent); - settings[name] = setting; + _settings[name] = setting; } // Copy constructor Property(const Property &rhs) { - settings = rhs.settings; - flags = rhs.flags; + _settings = rhs._settings; + _flags = rhs._flags; } OrderedSettingList getOrderedSettingList() { OrderedSettingList list; // Prepare vector to sort - for (SettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting) + for (SettingList::const_iterator setting = _settings.begin(); setting != _settings.end(); ++setting) list.push_back(SettingPair(setting->first, setting->second)); // Sort vector using setting order - if (hasOrder) + if (_hasOrder) std::sort(list.begin(), list.end(), OrderSortPredicate); return list; @@ -160,16 +160,16 @@ private: // be overkill since we only have to generate a single project struct Object { public: - std::string id; // Unique identifier for this object - std::string name; // Name (may not be unique - for ex. configuration entries) - std::string refType; // Type of object this references (if any) - std::string comment; // Main comment (empty for no comment) + std::string _id; // Unique identifier for this object + std::string _name; // Name (may not be unique - for ex. configuration entries) + std::string _refType; // Type of object this references (if any) + std::string _comment; // Main comment (empty for no comment) - PropertyList properties; // List of object properties, including output configuration + PropertyList _properties; // List of object properties, including output configuration // Constructs an object and add a default type property Object(XcodeProvider *objectParent, std::string objectId, std::string objectName, std::string objectType, std::string objectRefType = "", std::string objectComment = "") - : id(objectId), name(objectName), refType(objectRefType), comment(objectComment), parent(objectParent) { + : _id(objectId), _name(objectName), _refType(objectRefType), _comment(objectComment), _parent(objectParent) { assert(objectParent); assert(!objectId.empty()); assert(!objectName.empty()); @@ -180,25 +180,25 @@ private: // Add a simple Property with just a name and a value void addProperty(std::string propName, std::string propValue, std::string propComment = "", int propFlags = 0, int propIndent = 0) { - properties[propName] = Property(propValue, "", propComment, propFlags, propIndent); + _properties[propName] = Property(propValue, "", propComment, propFlags, propIndent); } std::string toString(int flags = 0) { std::string output; - output = "\t\t" + parent->getHash(id) + (comment.empty() ? "" : " /* " + comment + " */") + " = {"; + output = "\t\t" + _parent->getHash(_id) + (_comment.empty() ? "" : " /* " + _comment + " */") + " = {"; if (flags & SettingsAsList) output += "\n"; // Special case: always output the isa property first - output += parent->writeProperty("isa", properties["isa"], flags); + output += _parent->writeProperty("isa", _properties["isa"], flags); // Write each property - for (PropertyList::iterator property = properties.begin(); property != properties.end(); ++property) { + for (PropertyList::iterator property = _properties.begin(); property != _properties.end(); ++property) { if ((*property).first == "isa") continue; - output += parent->writeProperty((*property).first, (*property).second, flags); + output += _parent->writeProperty((*property).first, (*property).second, flags); } if (flags & SettingsAsList) @@ -211,14 +211,14 @@ private: // Slight hack, to allow Group access to parent. protected: - XcodeProvider *parent; + XcodeProvider *_parent; private: // Returns the type property (should always be the first in the properties map) std::string getType() { - assert(!properties.empty()); - assert(!properties["isa"].settings.empty()); + assert(!_properties.empty()); + assert(!_properties["isa"]._settings.empty()); - SettingList::iterator it = properties["isa"].settings.begin(); + SettingList::iterator it = _properties["isa"]._settings.begin(); return (*it).first; } @@ -226,33 +226,33 @@ private: struct ObjectList { private: - std::map objectMap; + std::map _objectMap; public: - std::vector objects; - std::string comment; - int flags; + std::vector _objects; + std::string _comment; + int _flags; void add(Object *obj) { - std::map::iterator it = objectMap.find(obj->id); - if (it != objectMap.end() && it->second == true) + std::map::iterator it = _objectMap.find(obj->_id); + if (it != _objectMap.end() && it->second == true) return; - objects.push_back(obj); - objectMap[obj->id] = true; + _objects.push_back(obj); + _objectMap[obj->_id] = true; } std::string toString() { std::string output; - if (!comment.empty()) - output = "\n/* Begin " + comment + " section */\n"; + if (!_comment.empty()) + output = "\n/* Begin " + _comment + " section */\n"; - for (std::vector::iterator object = objects.begin(); object != objects.end(); ++object) - output += (*object)->toString(flags); + for (std::vector::iterator object = _objects.begin(); object != _objects.end(); ++object) + output += (*object)->toString(_flags); - if (!comment.empty()) - output += "/* End " + comment + " section */\n"; + if (!_comment.empty()) + output += "/* End " + _comment + " section */\n"; return output; } @@ -274,7 +274,7 @@ private: void addChildGroup(const Group* group); void ensureChildExists(const std::string &name); Group *getChildGroup(const std::string &name); - std::string getHashRef() const { return parent->getHash(id); } + std::string getHashRef() const { return _parent->getHash(_id); } }; // The path used by the root-source group -- cgit v1.2.3 From 50807b3b0131664db7c073bc7fd14bf828e08e5e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:06:42 +0100 Subject: DEVTOOLS: Run astyle over xcode.[cpp/h]. Manual fix up included. --- devtools/create_project/xcode.cpp | 74 +++++++++++++++++++-------------------- devtools/create_project/xcode.h | 23 ++++++------ 2 files changed, 48 insertions(+), 49 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 657adbc80f..27cf88e837 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -93,18 +93,18 @@ bool producesObjectFileOnOSX(const std::string &fileName) { } XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) { - addProperty("name", _name, "", SettingsNoValue|SettingsQuoteVariable); - addProperty("sourceTree", "", "", SettingsNoValue|SettingsQuoteVariable); - + addProperty("name", _name, "", SettingsNoValue | SettingsQuoteVariable); + addProperty("sourceTree", "", "", SettingsNoValue | SettingsQuoteVariable); + if (path != "") { - addProperty("path", path, "", SettingsNoValue|SettingsQuoteVariable); + addProperty("path", path, "", SettingsNoValue | SettingsQuoteVariable); } _childOrder = 0; _treeName = uniqueName; } void XcodeProvider::Group::ensureChildExists(const std::string &name) { - std::map::iterator it = _childGroups.find(name); + std::map::iterator it = _childGroups.find(name); if (it == _childGroups.end()) { Group *child = new Group(_parent, name, this->_treeName + '/' + name, name); _childGroups[name] = child; @@ -131,7 +131,7 @@ void XcodeProvider::Group::addChildInternal(const std::string &id, const std::st } -void XcodeProvider::Group::addChildGroup(const Group* group) { +void XcodeProvider::Group::addChildGroup(const Group *group) { addChildInternal(_parent->getHash(group->_treeName), group->_treeName); } @@ -151,14 +151,14 @@ void XcodeProvider::Group::addChildByHash(const std::string &hash, const std::st } XcodeProvider::Group *XcodeProvider::Group::getChildGroup(const std::string &name) { - std::map::iterator it = _childGroups.find(name); + std::map::iterator it = _childGroups.find(name); assert(it != _childGroups.end()); return it->second; } XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path) { if (_rootSourceGroup == NULL) { - assert (path == _projectRoot); + assert(path == _projectRoot); _rootSourceGroup = new Group(this, "Sources", path, path); _groups.add(_rootSourceGroup); return _rootSourceGroup; @@ -181,9 +181,9 @@ XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path) void XcodeProvider::addFileReference(const std::string &id, const std::string &name, FileProperty properties) { Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", SettingsNoValue); - if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); - if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", SettingsNoValue|SettingsQuoteVariable); - if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", SettingsNoValue|SettingsQuoteVariable); + if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", SettingsNoValue | SettingsQuoteVariable); + if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", SettingsNoValue | SettingsQuoteVariable); + if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", SettingsNoValue | SettingsQuoteVariable); if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", SettingsNoValue); _fileReference.add(fileRef); _fileReference._flags = SettingsSingleItem; @@ -191,9 +191,9 @@ void XcodeProvider::addFileReference(const std::string &id, const std::string &n void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) { Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); - fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", SettingsNoValue|SettingsQuoteVariable); + fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", SettingsNoValue | SettingsQuoteVariable); fileRef->addProperty("includeInIndex", "0", "", SettingsNoValue); - fileRef->addProperty("path", name, "", SettingsNoValue|SettingsQuoteVariable); + fileRef->addProperty("path", name, "", SettingsNoValue | SettingsQuoteVariable); fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", SettingsNoValue); _fileReference.add(fileRef); _fileReference._flags = SettingsSingleItem; @@ -218,7 +218,7 @@ void XcodeProvider::createWorkspace(const BuildSetup &setup) { createDirectory(workspace); _projectRoot = setup.srcDir; touchGroupsForPath(_projectRoot); - + // Setup global objects setupDefines(setup); #ifdef ENABLE_IOS @@ -333,7 +333,7 @@ void XcodeProvider::setupCopyFilesBuildPhase() { #define DEF_SYSFRAMEWORK(framework) properties[framework".framework"] = FileProperty("wrapper.framework", framework".framework", "System/Library/Frameworks/" framework ".framework", "SDKROOT"); \ ADD_SETTING_ORDER_NOVALUE(children, getHash(framework".framework"), framework".framework", fwOrder++); - + #define DEF_LOCALLIB_STATIC(lib) properties[lib".a"] = FileProperty("archive.ar", lib".a", "/opt/local/lib/" lib ".a", "\"\""); \ ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++); @@ -530,16 +530,16 @@ void XcodeProvider::setupNativeTarget() { buildPhases._settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", SettingsNoValue, 0, 2); target->_properties["buildPhases"] = buildPhases; - target->addProperty("buildRules", "", "", SettingsNoValue|SettingsAsList); + target->addProperty("buildRules", "", "", SettingsNoValue | SettingsAsList); - target->addProperty("dependencies", "", "", SettingsNoValue|SettingsAsList); + target->addProperty("dependencies", "", "", SettingsNoValue | SettingsAsList); - target->addProperty("name", _targets[i], "", SettingsNoValue|SettingsQuoteVariable); + target->addProperty("name", _targets[i], "", SettingsNoValue | SettingsQuoteVariable); target->addProperty("productName", PROJECT_NAME, "", SettingsNoValue); addProductFileReference("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i], PROJECT_DESCRIPTION ".app"); productsGroup->addChildByHash(getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app"); target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", SettingsNoValue); - target->addProperty("productType", "com.apple.product-type.application", "", SettingsNoValue|SettingsQuoteVariable); + target->addProperty("productType", "com.apple.product-type.application", "", SettingsNoValue | SettingsQuoteVariable); _nativeTarget.add(target); } @@ -553,7 +553,7 @@ void XcodeProvider::setupProject() { Object *project = new Object(this, "PBXProject", "PBXProject", "PBXProject", "", "Project object"); project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"" PROJECT_NAME "\"", SettingsNoValue); - project->addProperty("compatibilityVersion", "Xcode 3.2", "", SettingsNoValue|SettingsQuoteVariable); + project->addProperty("compatibilityVersion", "Xcode 3.2", "", SettingsNoValue | SettingsQuoteVariable); project->addProperty("developmentRegion", "English", "", SettingsNoValue); project->addProperty("hasScannedForEncodings", "1", "", SettingsNoValue); @@ -567,8 +567,8 @@ void XcodeProvider::setupProject() { project->_properties["knownRegions"] = regions; project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", SettingsNoValue); - project->addProperty("projectDirPath", _projectRoot, "", SettingsNoValue|SettingsQuoteVariable); - project->addProperty("projectRoot", "", "", SettingsNoValue|SettingsQuoteVariable); + project->addProperty("projectDirPath", _projectRoot, "", SettingsNoValue | SettingsQuoteVariable); + project->addProperty("projectRoot", "", "", SettingsNoValue | SettingsQuoteVariable); // List of targets Property targets; @@ -683,7 +683,7 @@ void XcodeProvider::setupSourcesBuildPhase() { files._flags = SettingsAsList; int order = 0; - for (std::vector::iterator file = _buildFile._objects.begin(); file !=_buildFile._objects.end(); ++file) { + for (std::vector::iterator file = _buildFile._objects.begin(); file != _buildFile._objects.end(); ++file) { if (!producesObjectFileOnOSX((*file)->_name)) { continue; } @@ -734,7 +734,7 @@ void XcodeProvider::setupBuildConfiguration() { iPhone_HeaderSearchPaths.push_back("$(SRCROOT)/engines/"); iPhone_HeaderSearchPaths.push_back("$(SRCROOT)"); iPhone_HeaderSearchPaths.push_back("include/"); - ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, SettingsAsList|SettingsQuoteVariable, 5); + ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, SettingsAsList | SettingsQuoteVariable, 5); ADD_SETTING(iPhone_Debug, "INFOPLIST_FILE", "Info.plist"); ValueList iPhone_LibPaths; iPhone_LibPaths.push_back("$(inherited)"); @@ -787,7 +787,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_DEFINE(scummvm_defines, "IPHONE"); ADD_DEFINE(scummvm_defines, "XCODE"); ADD_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); - ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote | SettingsAsList, 5); ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO"); ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES"); @@ -796,7 +796,7 @@ void XcodeProvider::setupBuildConfiguration() { scummvm_HeaderPaths.push_back("include/"); scummvm_HeaderPaths.push_back("$(SRCROOT)/engines/"); scummvm_HeaderPaths.push_back("$(SRCROOT)"); - ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5); + ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsQuoteVariable | SettingsAsList, 5); ADD_SETTING_QUOTE(scummvm_Debug, "LIBRARY_SEARCH_PATHS", ""); ADD_SETTING(scummvm_Debug, "ONLY_ACTIVE_ARCH", "YES"); ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", ""); @@ -844,7 +844,7 @@ void XcodeProvider::setupBuildConfiguration() { ValueList scummvmOSX_defines(_defines); ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND"); ADD_DEFINE(scummvmOSX_defines, "MACOSX"); - ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote | SettingsAsList, 5); ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_VERSION", ""); ValueList scummvmOSX_HeaderPaths; scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL"); @@ -853,14 +853,14 @@ void XcodeProvider::setupBuildConfiguration() { scummvmOSX_HeaderPaths.push_back("include/"); scummvmOSX_HeaderPaths.push_back("$(SRCROOT)/engines/"); scummvmOSX_HeaderPaths.push_back("$(SRCROOT)"); - ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5); + ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, SettingsQuoteVariable | SettingsAsList, 5); ADD_SETTING_QUOTE(scummvmOSX_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/macosx/Info.plist"); ValueList scummvmOSX_LibPaths; scummvmOSX_LibPaths.push_back("/sw/lib"); scummvmOSX_LibPaths.push_back("/opt/local/lib"); scummvmOSX_LibPaths.push_back("\"$(inherited)\""); scummvmOSX_LibPaths.push_back("\"\\\\\\\"$(SRCROOT)/lib\\\\\\\"\""); // mmmh, all those slashes, it's almost Christmas \o/ - ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, SettingsNoQuote | SettingsAsList, 5); ADD_SETTING_QUOTE(scummvmOSX_Debug, "OTHER_CFLAGS", ""); ValueList scummvmOSX_LdFlags; scummvmOSX_LdFlags.push_back("-lSDLmain"); @@ -904,7 +904,7 @@ void XcodeProvider::setupBuildConfiguration() { Object *scummvmSimulator_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Debug", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); Property scummvmSimulator_Debug(iPhone_Debug); ADD_SETTING_QUOTE(scummvmSimulator_Debug, "FRAMEWORK_SEARCH_PATHS", "$(inherited)"); - ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote | SettingsAsList, 5); ADD_SETTING(scummvmSimulator_Debug, "SDKROOT", "iphonesimulator3.2"); ADD_SETTING_QUOTE(scummvmSimulator_Debug, "VALID_ARCHS", "i386 x86_64"); REMOVE_SETTING(scummvmSimulator_Debug, "TARGETED_DEVICE_FAMILY"); @@ -934,7 +934,7 @@ void XcodeProvider::setupBuildConfiguration() { // Warning: This assumes we have all configurations with a Debug & Release pair for (std::vector::iterator config = _buildConfiguration._objects.begin(); config != _buildConfiguration._objects.end(); config++) { - Object *configList = new Object(this, "XCConfigurationList_" + (*config)->_name, (*config)->_name, "XCConfigurationList", "", "Build configuration list for " + (*config)->_refType + " \"" + (*config)->_name + "\""); + Object *configList = new Object(this, "XCConfigurationList_" + (*config)->_name, (*config)->_name, "XCConfigurationList", "", "Build configuration list for " + (*config)->_refType + " \"" + (*config)->_name + "\""); Property buildConfigs; buildConfigs._flags = SettingsAsList; @@ -959,7 +959,7 @@ void XcodeProvider::setupBuildConfiguration() { void XcodeProvider::setupDefines(const BuildSetup &setup) { for (StringList::const_iterator i = setup.defines.begin(); i != setup.defines.end(); ++i) { - if (*i == "HAVE_NASM") // Not supported on Mac (TODO: change how it's handled in main class or add it only in MSVC/CodeBlocks providers?) + if (*i == "HAVE_NASM") // Not supported on Mac (TODO: change how it's handled in main class or add it only in MSVC/CodeBlocks providers?) continue; ADD_DEFINE(_defines, *i); @@ -995,7 +995,7 @@ std::string XcodeProvider::getHash(std::string key) { #endif } -bool isSeparator (char s) { return (s == '-'); } +bool isSeparator(char s) { return (s == '-'); } std::string XcodeProvider::newHash() const { std::string hash = createUUID(); @@ -1018,10 +1018,10 @@ std::string replace(std::string input, const std::string find, std::string repla std::string::size_type findLen = find.length(); std::string::size_type replaceLen = replaceStr.length(); - if (findLen == 0 ) + if (findLen == 0) return input; - for (;(pos = input.find(find, pos)) != std::string::npos;) { + for (; (pos = input.find(find, pos)) != std::string::npos;) { input.replace(pos, findLen, replaceStr); pos += replaceLen; } @@ -1107,9 +1107,9 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti output += (setting._flags & SettingsNoValue) ? "" : " = " + quote; - for(unsigned int i = 0; i < setting._entries.size(); ++i) { + for (unsigned int i = 0; i < setting._entries.size(); ++i) { std::string value = setting._entries.at(i)._value; - if(i) + if (i) output += " "; output += value; diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index 00ed9ff573..7a1e540df1 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -62,9 +62,8 @@ private: std::string _filePath; std::string _sourceTree; - FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "") : - _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) - { + FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "") + : _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) { } }; @@ -107,7 +106,7 @@ private: typedef std::pair SettingPair; typedef std::vector OrderedSettingList; - static bool OrderSortPredicate(const SettingPair& s1, const SettingPair& s2) { + static bool OrderSortPredicate(const SettingPair &s1, const SettingPair &s2) { return s1.second._order < s2.second._order; } @@ -160,12 +159,12 @@ private: // be overkill since we only have to generate a single project struct Object { public: - std::string _id; // Unique identifier for this object - std::string _name; // Name (may not be unique - for ex. configuration entries) - std::string _refType; // Type of object this references (if any) - std::string _comment; // Main comment (empty for no comment) + std::string _id; // Unique identifier for this object + std::string _name; // Name (may not be unique - for ex. configuration entries) + std::string _refType; // Type of object this references (if any) + std::string _comment; // Main comment (empty for no comment) - PropertyList _properties; // List of object properties, including output configuration + PropertyList _properties; // List of object properties, including output configuration // Constructs an object and add a default type property Object(XcodeProvider *objectParent, std::string objectId, std::string objectName, std::string objectType, std::string objectRefType = "", std::string objectComment = "") @@ -175,7 +174,7 @@ private: assert(!objectName.empty()); assert(!objectType.empty()); - addProperty("isa", objectType, "", SettingsNoQuote|SettingsNoValue); + addProperty("isa", objectType, "", SettingsNoQuote | SettingsNoValue); } // Add a simple Property with just a name and a value @@ -209,7 +208,7 @@ private: return output; } - // Slight hack, to allow Group access to parent. + // Slight hack, to allow Group access to parent. protected: XcodeProvider *_parent; private: @@ -271,7 +270,7 @@ private: void addChildFile(const std::string &name); void addChildByHash(const std::string &hash, const std::string &name); // Should be passed the hash for the entry - void addChildGroup(const Group* group); + void addChildGroup(const Group *group); void ensureChildExists(const std::string &name); Group *getChildGroup(const std::string &name); std::string getHashRef() const { return _parent->getHash(_id); } -- cgit v1.2.3 From 3ad5ad57e2fdac80cd4c79da958cd5122b941c60 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:09:12 +0100 Subject: DEVTOOLS: Use default copy constructor. The formerly user supplied copy constructor was not identical to the default generated, but the output of create_project for xcode is unchanged. --- devtools/create_project/xcode.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index 7a1e540df1..3f037ebfc4 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -131,12 +131,6 @@ private: _settings[name] = setting; } - // Copy constructor - Property(const Property &rhs) { - _settings = rhs._settings; - _flags = rhs._flags; - } - OrderedSettingList getOrderedSettingList() { OrderedSettingList list; -- cgit v1.2.3 From c9d7299e6586fa7baa5badffc6f0c07d6d91c679 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:13:48 +0100 Subject: DEVTOOLS: Cleanup code. --- devtools/create_project/xcode.cpp | 2 +- devtools/create_project/xcode.h | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 27cf88e837..534b67f409 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -1042,7 +1042,7 @@ std::string XcodeProvider::writeProperty(const std::string &variable, Property & if (settings.size() > 1 || (prop._flags & SettingsSingleItem)) output += (flags & SettingsSingleItem ? " " : "\t\t\t\t"); - output += writeSetting((*setting).first, (*setting).second); + output += writeSetting(setting->first, setting->second); // The combination of SettingsAsList, and SettingsSingleItem should use "," and not ";" (i.e children // in PBXGroup, so we special case that case here. diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index 3f037ebfc4..e6295ccf7b 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -120,15 +120,11 @@ private: // Constructs a simple Property explicit Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) { - Setting setting(value, comment, _flags, indent); - - _settings[name] = setting; + _settings[name] = Setting(value, comment, _flags, indent); } Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) { - Setting setting(values, _flags, indent); - - _settings[name] = setting; + _settings[name] = Setting(values, _flags, indent); } OrderedSettingList getOrderedSettingList() { @@ -188,10 +184,10 @@ private: // Write each property for (PropertyList::iterator property = _properties.begin(); property != _properties.end(); ++property) { - if ((*property).first == "isa") + if (property->first == "isa") continue; - output += _parent->writeProperty((*property).first, (*property).second, flags); + output += _parent->writeProperty(property->first, property->second, flags); } if (flags & SettingsAsList) @@ -212,8 +208,7 @@ private: assert(!_properties["isa"]._settings.empty()); SettingList::iterator it = _properties["isa"]._settings.begin(); - - return (*it).first; + return it->first; } }; -- cgit v1.2.3 From d09c3e28a641dee96df51a6297e11932cc118253 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:25:38 +0100 Subject: DEVTOOLS: Remove 'explicit' keyword from multi parameter constructors. This does not make sense in C++98. For C++11 this only prevents Foo x = {...} initialization, which we can't use anyway. --- devtools/create_project/xcode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index e6295ccf7b..cadd1898a7 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -86,16 +86,16 @@ private: int _indent; int _order; - explicit Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) { + Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) { _entries.push_back(Entry(value, comment)); } - explicit Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) { + Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) { for (unsigned int i = 0; i < values.size(); i++) _entries.push_back(Entry(values[i], "")); } - explicit Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : _entries(ents), _flags(flgs), _indent(idt), _order(ord) {} + Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : _entries(ents), _flags(flgs), _indent(idt), _order(ord) {} void addEntry(std::string value, std::string comment = "") { _entries.push_back(Entry(value, comment)); @@ -119,7 +119,7 @@ private: Property() : _flags(0), _hasOrder(false) {} // Constructs a simple Property - explicit Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) { + Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) { _settings[name] = Setting(value, comment, _flags, indent); } -- cgit v1.2.3 From 70a4047a78181a055787baf5b4f6a54e7aa67201 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:31:46 +0100 Subject: DEVTOOLS: Adjust enum constant names to match our conventions. --- devtools/create_project/xcode.cpp | 236 +++++++++++++++++++------------------- devtools/create_project/xcode.h | 16 +-- 2 files changed, 126 insertions(+), 126 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 534b67f409..ed3ba0f8cc 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -42,19 +42,19 @@ namespace CreateProjectTool { defines.push_back(name); #define ADD_SETTING(config, key, value) \ - config._settings[key] = Setting(value, "", SettingsNoQuote); + config._settings[key] = Setting(value, "", kSettingsNoQuote); #define ADD_SETTING_ORDER(config, key, value, order) \ - config._settings[key] = Setting(value, "", SettingsNoQuote, 0, order); + config._settings[key] = Setting(value, "", kSettingsNoQuote, 0, order); #define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \ - config._settings[key] = Setting("", comment, SettingsNoValue, 0, order); + config._settings[key] = Setting("", comment, kSettingsNoValue, 0, order); #define ADD_SETTING_QUOTE(config, key, value) \ config._settings[key] = Setting(value); #define ADD_SETTING_QUOTE_VAR(config, key, value) \ - config._settings[key] = Setting(value, "", SettingsQuoteVariable); + config._settings[key] = Setting(value, "", kSettingsQuoteVariable); #define ADD_SETTING_LIST(config, key, values, flags, indent) \ config._settings[key] = Setting(values, flags, indent); @@ -64,20 +64,20 @@ namespace CreateProjectTool { #define ADD_BUILD_FILE(id, name, fileRefId, comment) { \ Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); \ - buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue); \ + buildFile->addProperty("fileRef", fileRefId, name, kSettingsNoValue); \ _buildFile.add(buildFile); \ - _buildFile._flags = SettingsSingleItem; \ + _buildFile._flags = kSettingsSingleItem; \ } #define ADD_FILE_REFERENCE(id, name, properties) { \ Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); \ - if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", SettingsNoValue); \ - if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); \ - if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", SettingsNoValue|SettingsQuoteVariable); \ - if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", SettingsNoValue|SettingsQuoteVariable); \ - if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", SettingsNoValue); \ + if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", kSettingsNoValue); \ + if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", kSettingsNoValue|kSettingsQuoteVariable); \ + if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", kSettingsNoValue|kSettingsQuoteVariable); \ + if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", kSettingsNoValue|kSettingsQuoteVariable); \ + if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", kSettingsNoValue); \ _fileReference.add(fileRef); \ - _fileReference._flags = SettingsSingleItem; \ + _fileReference._flags = kSettingsSingleItem; \ } bool producesObjectFileOnOSX(const std::string &fileName) { @@ -93,11 +93,11 @@ bool producesObjectFileOnOSX(const std::string &fileName) { } XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) { - addProperty("name", _name, "", SettingsNoValue | SettingsQuoteVariable); - addProperty("sourceTree", "", "", SettingsNoValue | SettingsQuoteVariable); + addProperty("name", _name, "", kSettingsNoValue | kSettingsQuoteVariable); + addProperty("sourceTree", "", "", kSettingsNoValue | kSettingsQuoteVariable); if (path != "") { - addProperty("path", path, "", SettingsNoValue | SettingsQuoteVariable); + addProperty("path", path, "", kSettingsNoValue | kSettingsQuoteVariable); } _childOrder = 0; _treeName = uniqueName; @@ -117,16 +117,16 @@ void XcodeProvider::Group::addChildInternal(const std::string &id, const std::st if (_properties.find("children") == _properties.end()) { Property children; children._hasOrder = true; - children._flags = SettingsAsList; + children._flags = kSettingsAsList; _properties["children"] = children; } - _properties["children"]._settings[id] = Setting("", comment + " in Sources", SettingsNoValue, 0, _childOrder++); + _properties["children"]._settings[id] = Setting("", comment + " in Sources", kSettingsNoValue, 0, _childOrder++); if (_childOrder == 1) { // Force children to use () even when there is only 1 child. // Also this enforces the use of "," after the single item, instead of ; (see writeProperty) - _properties["children"]._flags |= SettingsSingleItem; + _properties["children"]._flags |= kSettingsSingleItem; } else { - _properties["children"]._flags ^= SettingsSingleItem; + _properties["children"]._flags ^= kSettingsSingleItem; } } @@ -180,31 +180,31 @@ XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path) void XcodeProvider::addFileReference(const std::string &id, const std::string &name, FileProperty properties) { Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); - if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", SettingsNoValue); - if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", SettingsNoValue | SettingsQuoteVariable); - if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", SettingsNoValue | SettingsQuoteVariable); - if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", SettingsNoValue | SettingsQuoteVariable); - if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", SettingsNoValue); + if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", kSettingsNoValue); + if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", kSettingsNoValue | kSettingsQuoteVariable); + if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", kSettingsNoValue | kSettingsQuoteVariable); + if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", kSettingsNoValue | kSettingsQuoteVariable); + if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", kSettingsNoValue); _fileReference.add(fileRef); - _fileReference._flags = SettingsSingleItem; + _fileReference._flags = kSettingsSingleItem; } void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) { Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); - fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", SettingsNoValue | SettingsQuoteVariable); - fileRef->addProperty("includeInIndex", "0", "", SettingsNoValue); - fileRef->addProperty("path", name, "", SettingsNoValue | SettingsQuoteVariable); - fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", SettingsNoValue); + fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", kSettingsNoValue | kSettingsQuoteVariable); + fileRef->addProperty("includeInIndex", "0", "", kSettingsNoValue); + fileRef->addProperty("path", name, "", kSettingsNoValue | kSettingsQuoteVariable); + fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", kSettingsNoValue); _fileReference.add(fileRef); - _fileReference._flags = SettingsSingleItem; + _fileReference._flags = kSettingsSingleItem; } void XcodeProvider::addBuildFile(const std::string &id, const std::string &name, const std::string &fileRefId, const std::string &comment) { Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); - buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue); + buildFile->addProperty("fileRef", fileRefId, name, kSettingsNoValue); _buildFile.add(buildFile); - _buildFile._flags = SettingsSingleItem; + _buildFile._flags = kSettingsSingleItem; } XcodeProvider::XcodeProvider(StringList &global_warnings, std::map &project_warnings, const int version) @@ -274,10 +274,10 @@ void XcodeProvider::ouputMainProjectFile(const BuildSetup &setup) { // Header project << "// !$*UTF8*$!\n" "{\n" - "\t" << writeSetting("archiveVersion", "1", "", SettingsNoQuote) << ";\n" + "\t" << writeSetting("archiveVersion", "1", "", kSettingsNoQuote) << ";\n" "\tclasses = {\n" "\t};\n" - "\t" << writeSetting("objectVersion", "46", "", SettingsNoQuote) << ";\n" + "\t" << writeSetting("objectVersion", "46", "", kSettingsNoQuote) << ";\n" "\tobjects = {\n"; ////////////////////////////////////////////////////////////////////////// @@ -297,7 +297,7 @@ void XcodeProvider::ouputMainProjectFile(const BuildSetup &setup) { ////////////////////////////////////////////////////////////////////////// // Footer project << "\t};\n" - "\t" << writeSetting("rootObject", getHash("PBXProject"), "Project object", SettingsNoQuote) << ";\n" + "\t" << writeSetting("rootObject", getHash("PBXProject"), "Project object", kSettingsNoQuote) << ";\n" "}\n"; } @@ -350,7 +350,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { Property children; children._hasOrder = true; - children._flags = SettingsAsList; + children._flags = kSettingsAsList; // Setup framework file properties std::map properties; @@ -393,13 +393,13 @@ void XcodeProvider::setupFrameworksBuildPhase() { // iPhone Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[IOS_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); - framework_iPhone->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); - framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + framework_iPhone->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue); + framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue); // List of frameworks Property iPhone_files; iPhone_files._hasOrder = true; - iPhone_files._flags = SettingsAsList; + iPhone_files._flags = kSettingsAsList; ValueList frameworks_iPhone; frameworks_iPhone.push_back("CoreAudio.framework"); @@ -431,13 +431,13 @@ void XcodeProvider::setupFrameworksBuildPhase() { // ScummVM-OS X Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[OSX_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); - framework_OSX->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); - framework_OSX->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + framework_OSX->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue); + framework_OSX->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue); // List of frameworks Property osx_files; osx_files._hasOrder = true; - osx_files._flags = SettingsAsList; + osx_files._flags = kSettingsAsList; ValueList frameworks_osx; frameworks_osx.push_back("CoreFoundation.framework"); @@ -473,13 +473,13 @@ void XcodeProvider::setupFrameworksBuildPhase() { // Simulator Object *framework_simulator = new Object(this, "PBXFrameworksBuildPhase_" + _targets[SIM_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); - framework_simulator->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); - framework_simulator->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + framework_simulator->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue); + framework_simulator->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue); // List of frameworks Property simulator_files; simulator_files._hasOrder = true; - simulator_files._flags = SettingsAsList; + simulator_files._flags = kSettingsAsList; ValueList frameworks_simulator; frameworks_simulator.push_back("CoreAudio.framework"); @@ -520,26 +520,26 @@ void XcodeProvider::setupNativeTarget() { #endif Object *target = new Object(this, "PBXNativeTarget_" + _targets[i], "PBXNativeTarget", "PBXNativeTarget", "", _targets[i]); - target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", SettingsNoValue); + target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", kSettingsNoValue); Property buildPhases; buildPhases._hasOrder = true; - buildPhases._flags = SettingsAsList; - buildPhases._settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", SettingsNoValue, 0, 0); - buildPhases._settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", SettingsNoValue, 0, 1); - buildPhases._settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", SettingsNoValue, 0, 2); + buildPhases._flags = kSettingsAsList; + buildPhases._settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", kSettingsNoValue, 0, 0); + buildPhases._settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", kSettingsNoValue, 0, 1); + buildPhases._settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", kSettingsNoValue, 0, 2); target->_properties["buildPhases"] = buildPhases; - target->addProperty("buildRules", "", "", SettingsNoValue | SettingsAsList); + target->addProperty("buildRules", "", "", kSettingsNoValue | kSettingsAsList); - target->addProperty("dependencies", "", "", SettingsNoValue | SettingsAsList); + target->addProperty("dependencies", "", "", kSettingsNoValue | kSettingsAsList); - target->addProperty("name", _targets[i], "", SettingsNoValue | SettingsQuoteVariable); - target->addProperty("productName", PROJECT_NAME, "", SettingsNoValue); + target->addProperty("name", _targets[i], "", kSettingsNoValue | kSettingsQuoteVariable); + target->addProperty("productName", PROJECT_NAME, "", kSettingsNoValue); addProductFileReference("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i], PROJECT_DESCRIPTION ".app"); productsGroup->addChildByHash(getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app"); - target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", SettingsNoValue); - target->addProperty("productType", "com.apple.product-type.application", "", SettingsNoValue | SettingsQuoteVariable); + target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", kSettingsNoValue); + target->addProperty("productType", "com.apple.product-type.application", "", kSettingsNoValue | kSettingsQuoteVariable); _nativeTarget.add(target); } @@ -552,38 +552,38 @@ void XcodeProvider::setupProject() { Object *project = new Object(this, "PBXProject", "PBXProject", "PBXProject", "", "Project object"); - project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"" PROJECT_NAME "\"", SettingsNoValue); - project->addProperty("compatibilityVersion", "Xcode 3.2", "", SettingsNoValue | SettingsQuoteVariable); - project->addProperty("developmentRegion", "English", "", SettingsNoValue); - project->addProperty("hasScannedForEncodings", "1", "", SettingsNoValue); + project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"" PROJECT_NAME "\"", kSettingsNoValue); + project->addProperty("compatibilityVersion", "Xcode 3.2", "", kSettingsNoValue | kSettingsQuoteVariable); + project->addProperty("developmentRegion", "English", "", kSettingsNoValue); + project->addProperty("hasScannedForEncodings", "1", "", kSettingsNoValue); // List of known regions Property regions; - regions._flags = SettingsAsList; + regions._flags = kSettingsAsList; ADD_SETTING_ORDER_NOVALUE(regions, "English", "", 0); ADD_SETTING_ORDER_NOVALUE(regions, "Japanese", "", 1); ADD_SETTING_ORDER_NOVALUE(regions, "French", "", 2); ADD_SETTING_ORDER_NOVALUE(regions, "German", "", 3); project->_properties["knownRegions"] = regions; - project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", SettingsNoValue); - project->addProperty("projectDirPath", _projectRoot, "", SettingsNoValue | SettingsQuoteVariable); - project->addProperty("projectRoot", "", "", SettingsNoValue | SettingsQuoteVariable); + project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", kSettingsNoValue); + project->addProperty("projectDirPath", _projectRoot, "", kSettingsNoValue | kSettingsQuoteVariable); + project->addProperty("projectRoot", "", "", kSettingsNoValue | kSettingsQuoteVariable); // List of targets Property targets; - targets._flags = SettingsAsList; + targets._flags = kSettingsAsList; #ifdef ENABLE_IOS - targets._settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], SettingsNoValue, 0, 0); + targets._settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], kSettingsNoValue, 0, 0); #endif - targets._settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], SettingsNoValue, 0, 1); + targets._settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], kSettingsNoValue, 0, 1); #ifdef ENABLE_IOS - targets._settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], SettingsNoValue, 0, 2); + targets._settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], kSettingsNoValue, 0, 2); #endif project->_properties["targets"] = targets; #ifndef ENABLE_IOS // Force list even when there is only a single target - project->_properties["targets"]._flags |= SettingsSingleItem; + project->_properties["targets"]._flags |= kSettingsSingleItem; #endif _project.add(project); @@ -615,12 +615,12 @@ void XcodeProvider::setupResourcesBuildPhase() { for (unsigned int i = 0; i < _targets.size(); i++) { Object *resource = new Object(this, "PBXResourcesBuildPhase_" + _targets[i], "PBXResourcesBuildPhase", "PBXResourcesBuildPhase", "", "Resources"); - resource->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); + resource->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue); // Add default files Property files; files._hasOrder = true; - files._flags = SettingsAsList; + files._flags = kSettingsAsList; ValueList files_list; files_list.push_back("scummclassic.zip"); @@ -651,7 +651,7 @@ void XcodeProvider::setupResourcesBuildPhase() { // Add custom files depending on the target if (_targets[i] == PROJECT_DESCRIPTION "-OS X") { - files._settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", SettingsNoValue, 0, 6); + files._settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", kSettingsNoValue, 0, 6); // Remove 2 iphone icon files files._settings.erase(getHash("PBXResources_Default.png")); @@ -660,7 +660,7 @@ void XcodeProvider::setupResourcesBuildPhase() { resource->_properties["files"] = files; - resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue); _resourcesBuildPhase.add(resource); } @@ -676,11 +676,11 @@ void XcodeProvider::setupSourcesBuildPhase() { for (unsigned int i = 0; i < _targets.size(); i++) { Object *source = new Object(this, "PBXSourcesBuildPhase_" + _targets[i], "PBXSourcesBuildPhase", "PBXSourcesBuildPhase", "", "Sources"); - source->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); + source->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue); Property files; files._hasOrder = true; - files._flags = SettingsAsList; + files._flags = kSettingsAsList; int order = 0; for (std::vector::iterator file = _buildFile._objects.begin(); file != _buildFile._objects.end(); ++file) { @@ -693,7 +693,7 @@ void XcodeProvider::setupSourcesBuildPhase() { source->_properties["files"] = files; - source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); + source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue); _sourcesBuildPhase.add(source); } @@ -703,7 +703,7 @@ void XcodeProvider::setupSourcesBuildPhase() { void XcodeProvider::setupBuildConfiguration() { _buildConfiguration._comment = "XCBuildConfiguration"; - _buildConfiguration._flags = SettingsAsList; + _buildConfiguration._flags = kSettingsAsList; ///**************************************** // * iPhone @@ -721,7 +721,7 @@ void XcodeProvider::setupBuildConfiguration() { ValueList iPhone_FrameworkSearchPaths; iPhone_FrameworkSearchPaths.push_back("$(inherited)"); iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\""); - ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, SettingsAsList, 5); + ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, kSettingsAsList, 5); ADD_SETTING(iPhone_Debug, "GCC_DYNAMIC_NO_PIC", "NO"); ADD_SETTING(iPhone_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO"); ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO"); @@ -734,12 +734,12 @@ void XcodeProvider::setupBuildConfiguration() { iPhone_HeaderSearchPaths.push_back("$(SRCROOT)/engines/"); iPhone_HeaderSearchPaths.push_back("$(SRCROOT)"); iPhone_HeaderSearchPaths.push_back("include/"); - ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, SettingsAsList | SettingsQuoteVariable, 5); + ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, kSettingsAsList | kSettingsQuoteVariable, 5); ADD_SETTING(iPhone_Debug, "INFOPLIST_FILE", "Info.plist"); ValueList iPhone_LibPaths; iPhone_LibPaths.push_back("$(inherited)"); iPhone_LibPaths.push_back("\"$(SRCROOT)/lib\""); - ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, SettingsAsList, 5); + ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, kSettingsAsList, 5); ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES"); ADD_SETTING(iPhone_Debug, "PREBINDING", "NO"); ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); @@ -748,7 +748,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos4.0"); ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2"); - iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + iPhone_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue); iPhone_Debug_Object->_properties["buildSettings"] = iPhone_Debug; // Release @@ -759,7 +759,7 @@ void XcodeProvider::setupBuildConfiguration() { REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC"); ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app"); - iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + iPhone_Release_Object->addProperty("name", "Release", "", kSettingsNoValue); iPhone_Release_Object->_properties["buildSettings"] = iPhone_Release; _buildConfiguration.add(iPhone_Debug_Object); @@ -787,7 +787,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_DEFINE(scummvm_defines, "IPHONE"); ADD_DEFINE(scummvm_defines, "XCODE"); ADD_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); - ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote | SettingsAsList, 5); + ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO"); ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES"); @@ -796,7 +796,7 @@ void XcodeProvider::setupBuildConfiguration() { scummvm_HeaderPaths.push_back("include/"); scummvm_HeaderPaths.push_back("$(SRCROOT)/engines/"); scummvm_HeaderPaths.push_back("$(SRCROOT)"); - ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsQuoteVariable | SettingsAsList, 5); + ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, kSettingsQuoteVariable | kSettingsAsList, 5); ADD_SETTING_QUOTE(scummvm_Debug, "LIBRARY_SEARCH_PATHS", ""); ADD_SETTING(scummvm_Debug, "ONLY_ACTIVE_ARCH", "YES"); ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", ""); @@ -804,7 +804,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(scummvm_Debug, "PREBINDING", "NO"); ADD_SETTING(scummvm_Debug, "SDKROOT", "macosx"); - scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + scummvm_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue); scummvm_Debug_Object->_properties["buildSettings"] = scummvm_Debug; // Release @@ -815,7 +815,7 @@ void XcodeProvider::setupBuildConfiguration() { REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE"); REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH"); - scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + scummvm_Release_Object->addProperty("name", "Release", "", kSettingsNoValue); scummvm_Release_Object->_properties["buildSettings"] = scummvm_Release; _buildConfiguration.add(scummvm_Debug_Object); @@ -844,7 +844,7 @@ void XcodeProvider::setupBuildConfiguration() { ValueList scummvmOSX_defines(_defines); ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND"); ADD_DEFINE(scummvmOSX_defines, "MACOSX"); - ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote | SettingsAsList, 5); + ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_VERSION", ""); ValueList scummvmOSX_HeaderPaths; scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL"); @@ -853,14 +853,14 @@ void XcodeProvider::setupBuildConfiguration() { scummvmOSX_HeaderPaths.push_back("include/"); scummvmOSX_HeaderPaths.push_back("$(SRCROOT)/engines/"); scummvmOSX_HeaderPaths.push_back("$(SRCROOT)"); - ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, SettingsQuoteVariable | SettingsAsList, 5); + ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, kSettingsQuoteVariable | kSettingsAsList, 5); ADD_SETTING_QUOTE(scummvmOSX_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/macosx/Info.plist"); ValueList scummvmOSX_LibPaths; scummvmOSX_LibPaths.push_back("/sw/lib"); scummvmOSX_LibPaths.push_back("/opt/local/lib"); scummvmOSX_LibPaths.push_back("\"$(inherited)\""); scummvmOSX_LibPaths.push_back("\"\\\\\\\"$(SRCROOT)/lib\\\\\\\"\""); // mmmh, all those slashes, it's almost Christmas \o/ - ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, SettingsNoQuote | SettingsAsList, 5); + ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING_QUOTE(scummvmOSX_Debug, "OTHER_CFLAGS", ""); ValueList scummvmOSX_LdFlags; scummvmOSX_LdFlags.push_back("-lSDLmain"); @@ -875,11 +875,11 @@ void XcodeProvider::setupBuildConfiguration() { scummvmOSX_LdFlags.push_back("-lFLAC"); scummvmOSX_LdFlags.push_back("-lSDL"); scummvmOSX_LdFlags.push_back("-lz"); - ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, SettingsAsList, 5); + ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, kSettingsAsList, 5); ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO"); ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); - scummvmOSX_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + scummvmOSX_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue); scummvmOSX_Debug_Object->_properties["buildSettings"] = scummvmOSX_Debug; // Release @@ -890,7 +890,7 @@ void XcodeProvider::setupBuildConfiguration() { REMOVE_SETTING(scummvmOSX_Release, "GCC_OPTIMIZATION_LEVEL"); ADD_SETTING(scummvmOSX_Release, "WRAPPER_EXTENSION", "app"); - scummvmOSX_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + scummvmOSX_Release_Object->addProperty("name", "Release", "", kSettingsNoValue); scummvmOSX_Release_Object->_properties["buildSettings"] = scummvmOSX_Release; _buildConfiguration.add(scummvmOSX_Debug_Object); @@ -904,12 +904,12 @@ void XcodeProvider::setupBuildConfiguration() { Object *scummvmSimulator_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Debug", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); Property scummvmSimulator_Debug(iPhone_Debug); ADD_SETTING_QUOTE(scummvmSimulator_Debug, "FRAMEWORK_SEARCH_PATHS", "$(inherited)"); - ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote | SettingsAsList, 5); + ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING(scummvmSimulator_Debug, "SDKROOT", "iphonesimulator3.2"); ADD_SETTING_QUOTE(scummvmSimulator_Debug, "VALID_ARCHS", "i386 x86_64"); REMOVE_SETTING(scummvmSimulator_Debug, "TARGETED_DEVICE_FAMILY"); - scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue); scummvmSimulator_Debug_Object->_properties["buildSettings"] = scummvmSimulator_Debug; // Release @@ -920,7 +920,7 @@ void XcodeProvider::setupBuildConfiguration() { REMOVE_SETTING(scummvmSimulator_Release, "GCC_DYNAMIC_NO_PIC"); ADD_SETTING(scummvmSimulator_Release, "WRAPPER_EXTENSION", "app"); - scummvmSimulator_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + scummvmSimulator_Release_Object->addProperty("name", "Release", "", kSettingsNoValue); scummvmSimulator_Release_Object->_properties["buildSettings"] = scummvmSimulator_Release; _buildConfiguration.add(scummvmSimulator_Debug_Object); @@ -929,7 +929,7 @@ void XcodeProvider::setupBuildConfiguration() { ////////////////////////////////////////////////////////////////////////// // Configuration List _configurationList._comment = "XCConfigurationList"; - _configurationList._flags = SettingsAsList; + _configurationList._flags = kSettingsAsList; #endif // Warning: This assumes we have all configurations with a Debug & Release pair for (std::vector::iterator config = _buildConfiguration._objects.begin(); config != _buildConfiguration._objects.end(); config++) { @@ -937,15 +937,15 @@ void XcodeProvider::setupBuildConfiguration() { Object *configList = new Object(this, "XCConfigurationList_" + (*config)->_name, (*config)->_name, "XCConfigurationList", "", "Build configuration list for " + (*config)->_refType + " \"" + (*config)->_name + "\""); Property buildConfigs; - buildConfigs._flags = SettingsAsList; + buildConfigs._flags = kSettingsAsList; - buildConfigs._settings[getHash((*config)->_id)] = Setting("", "Debug", SettingsNoValue, 0, 0); - buildConfigs._settings[getHash((*(++config))->_id)] = Setting("", "Release", SettingsNoValue, 0, 1); + buildConfigs._settings[getHash((*config)->_id)] = Setting("", "Debug", kSettingsNoValue, 0, 0); + buildConfigs._settings[getHash((*(++config))->_id)] = Setting("", "Release", kSettingsNoValue, 0, 1); configList->_properties["buildConfigurations"] = buildConfigs; - configList->addProperty("defaultConfigurationIsVisible", "0", "", SettingsNoValue); - configList->addProperty("defaultConfigurationName", "Release", "", SettingsNoValue); + configList->addProperty("defaultConfigurationIsVisible", "0", "", kSettingsNoValue); + configList->addProperty("defaultConfigurationName", "Release", "", kSettingsNoValue); _configurationList.add(configList); } @@ -1032,30 +1032,30 @@ std::string replace(std::string input, const std::string find, std::string repla std::string XcodeProvider::writeProperty(const std::string &variable, Property &prop, int flags) const { std::string output; - output += (flags & SettingsSingleItem ? "" : "\t\t\t") + variable + " = "; + output += (flags & kSettingsSingleItem ? "" : "\t\t\t") + variable + " = "; - if (prop._settings.size() > 1 || (prop._flags & SettingsSingleItem)) - output += (prop._flags & SettingsAsList) ? "(\n" : "{\n"; + if (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem)) + output += (prop._flags & kSettingsAsList) ? "(\n" : "{\n"; OrderedSettingList settings = prop.getOrderedSettingList(); for (OrderedSettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting) { - if (settings.size() > 1 || (prop._flags & SettingsSingleItem)) - output += (flags & SettingsSingleItem ? " " : "\t\t\t\t"); + if (settings.size() > 1 || (prop._flags & kSettingsSingleItem)) + output += (flags & kSettingsSingleItem ? " " : "\t\t\t\t"); output += writeSetting(setting->first, setting->second); - // The combination of SettingsAsList, and SettingsSingleItem should use "," and not ";" (i.e children + // The combination of kSettingsAsList, and kSettingsSingleItem should use "," and not ";" (i.e children // in PBXGroup, so we special case that case here. - if ((prop._flags & SettingsAsList) && (prop._settings.size() > 1 || (prop._flags & SettingsSingleItem))) { + if ((prop._flags & kSettingsAsList) && (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))) { output += (prop._settings.size() > 0) ? ",\n" : "\n"; } else { output += ";"; - output += (flags & SettingsSingleItem ? " " : "\n"); + output += (flags & kSettingsSingleItem ? " " : "\n"); } } - if (prop._settings.size() > 1 || (prop._flags & SettingsSingleItem)) - output += (prop._flags & SettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n"; + if (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem)) + output += (prop._flags & kSettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n"; return output; } @@ -1068,7 +1068,7 @@ std::string XcodeProvider::writeSetting(const std::string &variable, std::string // XCode project generator pbuilder_pbx.cpp, writeSettings() (under LGPL 2.1) std::string XcodeProvider::writeSetting(const std::string &variable, const Setting &setting) const { std::string output; - const std::string quote = (setting._flags & SettingsNoQuote) ? "" : "\""; + const std::string quote = (setting._flags & kSettingsNoQuote) ? "" : "\""; const std::string escape_quote = quote.empty() ? "" : "\\" + quote; std::string newline = "\n"; @@ -1077,12 +1077,12 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti newline += "\t"; // Setup variable - std::string var = (setting._flags & SettingsQuoteVariable) ? "\"" + variable + "\"" : variable; + std::string var = (setting._flags & kSettingsQuoteVariable) ? "\"" + variable + "\"" : variable; // Output a list - if (setting._flags & SettingsAsList) { + if (setting._flags & kSettingsAsList) { - output += var + ((setting._flags & SettingsNoValue) ? "(" : " = (") + newline; + output += var + ((setting._flags & kSettingsNoValue) ? "(" : " = (") + newline; for (unsigned int i = 0, count = 0; i < setting._entries.size(); ++i) { @@ -1101,11 +1101,11 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti } // Add closing ")" on new line newline.resize(newline.size() - 1); - output += (setting._flags & SettingsNoValue) ? "\t\t\t)" : "," + newline + ")"; + output += (setting._flags & kSettingsNoValue) ? "\t\t\t)" : "," + newline + ")"; } else { output += var; - output += (setting._flags & SettingsNoValue) ? "" : " = " + quote; + output += (setting._flags & kSettingsNoValue) ? "" : " = " + quote; for (unsigned int i = 0; i < setting._entries.size(); ++i) { std::string value = setting._entries.at(i)._value; @@ -1118,7 +1118,7 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti output += " /* " + comment + " */"; } - output += (setting._flags & SettingsNoValue) ? "" : quote; + output += (setting._flags & kSettingsNoValue) ? "" : quote; } return output; } diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index cadd1898a7..d48f11cb19 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -47,11 +47,11 @@ protected: const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix); private: enum { - SettingsAsList = 0x01, - SettingsSingleItem = 0x02, - SettingsNoQuote = 0x04, - SettingsQuoteVariable = 0x08, - SettingsNoValue = 0x10 + kSettingsAsList = 0x01, + kSettingsSingleItem = 0x02, + kSettingsNoQuote = 0x04, + kSettingsQuoteVariable = 0x08, + kSettingsNoValue = 0x10 }; // File properties @@ -164,7 +164,7 @@ private: assert(!objectName.empty()); assert(!objectType.empty()); - addProperty("isa", objectType, "", SettingsNoQuote | SettingsNoValue); + addProperty("isa", objectType, "", kSettingsNoQuote | kSettingsNoValue); } // Add a simple Property with just a name and a value @@ -176,7 +176,7 @@ private: std::string output; output = "\t\t" + _parent->getHash(_id) + (_comment.empty() ? "" : " /* " + _comment + " */") + " = {"; - if (flags & SettingsAsList) + if (flags & kSettingsAsList) output += "\n"; // Special case: always output the isa property first @@ -190,7 +190,7 @@ private: output += _parent->writeProperty(property->first, property->second, flags); } - if (flags & SettingsAsList) + if (flags & kSettingsAsList) output += "\t\t"; output += "};\n"; -- cgit v1.2.3 From c09a9aa1bf2e84186d5bd7256670a7b361d95f0f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:35:05 +0100 Subject: DEVTOOLS: Replace macro by function call. --- devtools/create_project/xcode.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index ed3ba0f8cc..c5c433c82e 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -69,17 +69,6 @@ namespace CreateProjectTool { _buildFile._flags = kSettingsSingleItem; \ } -#define ADD_FILE_REFERENCE(id, name, properties) { \ - Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); \ - if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", kSettingsNoValue); \ - if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", kSettingsNoValue|kSettingsQuoteVariable); \ - if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", kSettingsNoValue|kSettingsQuoteVariable); \ - if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", kSettingsNoValue|kSettingsQuoteVariable); \ - if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", kSettingsNoValue); \ - _fileReference.add(fileRef); \ - _fileReference._flags = kSettingsSingleItem; \ -} - bool producesObjectFileOnOSX(const std::string &fileName) { std::string n, ext; splitFilename(fileName, n, ext); @@ -420,7 +409,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { ADD_SETTING_ORDER_NOVALUE(iPhone_files, getHash(id), comment, order++); ADD_BUILD_FILE(id, *framework, getHash(*framework), comment); - ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); + addFileReference(*framework, *framework, properties[*framework]); } framework_iPhone->_properties["files"] = iPhone_files; @@ -462,7 +451,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { ADD_SETTING_ORDER_NOVALUE(osx_files, getHash(id), comment, order++); ADD_BUILD_FILE(id, *framework, getHash(*framework), comment); - ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); + addFileReference(*framework, *framework, properties[*framework]); } framework_OSX->_properties["files"] = osx_files; @@ -497,7 +486,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { ADD_SETTING_ORDER_NOVALUE(simulator_files, getHash(id), comment, order++); ADD_BUILD_FILE(id, *framework, getHash(*framework), comment); - ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); + addFileReference(*framework, *framework, properties[*framework]); } framework_simulator->_properties["files"] = simulator_files; @@ -646,7 +635,7 @@ void XcodeProvider::setupResourcesBuildPhase() { ADD_SETTING_ORDER_NOVALUE(files, getHash(id), comment, order++); // TODO Fix crash when adding build file for data //ADD_BUILD_FILE(id, *file, comment); - ADD_FILE_REFERENCE(*file, *file, properties[*file]); + addFileReference(*file, *file, properties[*file]); } // Add custom files depending on the target -- cgit v1.2.3 From 2ef9ced7a9a8a2d95f0b017292cca37f681ef4ea Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:44:02 +0100 Subject: DEVTOOLS: Silence compiler warnings in create_access. --- devtools/create_access/amazon_resources.cpp | 2 +- devtools/create_access/amazon_resources.h | 2 +- devtools/create_access/create_access_dat.cpp | 4 ++-- devtools/create_access/martian_resources.cpp | 2 +- devtools/create_access/martian_resources.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'devtools') diff --git a/devtools/create_access/amazon_resources.cpp b/devtools/create_access/amazon_resources.cpp index 50b8f334fb..8156894b0d 100644 --- a/devtools/create_access/amazon_resources.cpp +++ b/devtools/create_access/amazon_resources.cpp @@ -754,4 +754,4 @@ const char *const IQLABELS_ENG[9] = { const char *const CANT_GET_THERE_ENG = "YOU CAN'T GET THERE FROM HERE."; -}; +} // End of namespace Amazon diff --git a/devtools/create_access/amazon_resources.h b/devtools/create_access/amazon_resources.h index fa281f8f7b..aae27ce3ba 100644 --- a/devtools/create_access/amazon_resources.h +++ b/devtools/create_access/amazon_resources.h @@ -57,6 +57,6 @@ extern const char *const HELPLVLTXT_ENG[3]; extern const char *const IQLABELS_ENG[9]; extern const char *const CANT_GET_THERE_ENG; -}; +} // End of namespace Amazon #endif diff --git a/devtools/create_access/create_access_dat.cpp b/devtools/create_access/create_access_dat.cpp index 0e57f76395..af9ab026c0 100644 --- a/devtools/create_access/create_access_dat.cpp +++ b/devtools/create_access/create_access_dat.cpp @@ -160,7 +160,7 @@ void writeMartianCommonData() { } } -bool processExecutable(int idx, const char *name) { +bool processExecutable(int exeIdx, const char *name) { uint dataSegmentOffset; uint filenamesOffset, numFilenames; uint charsStart, charsEnd; @@ -291,7 +291,7 @@ bool processExecutable(int idx, const char *name) { // Write out header entry uint outputOffset = outputFile.size(); - outputFile.seek(8 + idx * 8); + outputFile.seek(8 + exeIdx * 8); outputFile.writeByte(gameId); outputFile.writeByte(discType); outputFile.writeByte(demoType); diff --git a/devtools/create_access/martian_resources.cpp b/devtools/create_access/martian_resources.cpp index 2a726a78ea..f631ce7e31 100644 --- a/devtools/create_access/martian_resources.cpp +++ b/devtools/create_access/martian_resources.cpp @@ -179,4 +179,4 @@ const char *const INVENTORY_NAMES_ENG[55] = { "MONKEY WRENCH", "BIG DICK CARD", "BRA", "BOLT", nullptr }; -}; +} // End of namespace Amazon diff --git a/devtools/create_access/martian_resources.h b/devtools/create_access/martian_resources.h index c3dfc2a7c2..f80f4c1cf4 100644 --- a/devtools/create_access/martian_resources.h +++ b/devtools/create_access/martian_resources.h @@ -47,6 +47,6 @@ extern const char *const HELPLVLTXT_ENG[3]; extern const char *const IQLABELS_ENG[9]; extern const char *const CANT_GET_THERE_ENG; -}; +} // End of namespace Amazon #endif -- cgit v1.2.3 From 410b5f3d342e1e2e4b06c8c7ae219212d2e5426f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:46:06 +0100 Subject: DEVTOOLS: Silence compiler warning in convbdf. --- devtools/convbdf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools') diff --git a/devtools/convbdf.cpp b/devtools/convbdf.cpp index 21c8af8234..6852fc2f9a 100644 --- a/devtools/convbdf.cpp +++ b/devtools/convbdf.cpp @@ -392,7 +392,7 @@ int main(int argc, char *argv[]) { for (int y = 0; y < box.height; ++y) { printf("// |"); - unsigned char data; + unsigned char data = 0; for (int x = 0; x < box.width; ++x) { if (!(x % 8)) data = *bitmap++; -- cgit v1.2.3 From 84ac8fa7354c4adfa7e2f8914cd564bc7f3927d6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 06:50:32 +0100 Subject: DEVTOOLS: A few formatting fixes. --- devtools/convbdf.cpp | 2 +- devtools/create_project/create_project.h | 4 ++-- devtools/create_translations/create_translations.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'devtools') diff --git a/devtools/convbdf.cpp b/devtools/convbdf.cpp index 6852fc2f9a..59ea5cc4e5 100644 --- a/devtools/convbdf.cpp +++ b/devtools/convbdf.cpp @@ -21,7 +21,7 @@ */ #ifndef __has_feature // Optional of course. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#define __has_feature(x) 0 // Compatibility with non-clang compilers. #endif #include diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index 459342a67d..1a28946315 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -23,8 +23,8 @@ #ifndef TOOLS_CREATE_PROJECT_H #define TOOLS_CREATE_PROJECT_H -#ifndef __has_feature // Optional of course. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#ifndef __has_feature // Optional of course. +#define __has_feature(x) 0 // Compatibility with non-clang compilers. #endif #include diff --git a/devtools/create_translations/create_translations.h b/devtools/create_translations/create_translations.h index 34a79913ac..e87e3923c3 100644 --- a/devtools/create_translations/create_translations.h +++ b/devtools/create_translations/create_translations.h @@ -26,10 +26,10 @@ typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned int uint32; -typedef signed short int16; +typedef signed short int16; -#ifndef __has_feature // Optional of course. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#ifndef __has_feature // Optional of course. +#define __has_feature(x) 0 // Compatibility with non-clang compilers. #endif #endif /* CREATE_TRANSLATIONS_H */ -- cgit v1.2.3 From 8392fe4f058d56d5a16ef5faad76e440ffa13400 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Dec 2015 07:02:02 +0100 Subject: DEVTOOLS: More formatting fixes in create_amazon. Powered by astyle. --- devtools/create_access/amazon_resources.cpp | 4 ++-- devtools/create_access/create_access_dat.cpp | 18 +++++++++--------- devtools/create_access/create_access_dat.h | 6 ++---- devtools/create_access/martian_resources.cpp | 4 ++-- 4 files changed, 15 insertions(+), 17 deletions(-) (limited to 'devtools') diff --git a/devtools/create_access/amazon_resources.cpp b/devtools/create_access/amazon_resources.cpp index 8156894b0d..f4b642ffbc 100644 --- a/devtools/create_access/amazon_resources.cpp +++ b/devtools/create_access/amazon_resources.cpp @@ -267,7 +267,7 @@ const byte *const CURSORS[AMAZON_NUM_CURSORS] = { }; const uint CURSOR_SIZES[AMAZON_NUM_CURSORS] = { sizeof(MOUSE0), sizeof(MOUSE1), sizeof(MOUSE2), sizeof(MOUSE3), sizeof(CURSEYE), - sizeof(CURSHAND), sizeof(CURSGET), sizeof(CURSCLIMB), sizeof(CURSTALK), sizeof(CURSHELP) + sizeof(CURSHAND), sizeof(CURSGET), sizeof(CURSCLIMB), sizeof(CURSTALK), sizeof(CURSHELP) }; @@ -731,7 +731,7 @@ const int COMBO_TABLE[85][4] = { }; const char *const NO_HELP_MESSAGE_ENG = -"WE ARE UNABLE TO PROVIDE YOU WITH ANY MORE HINTS. YOUR IQ \ + "WE ARE UNABLE TO PROVIDE YOU WITH ANY MORE HINTS. YOUR IQ \ HAS DECREASED SO FAR THAT WE CAN NO LONGER PUT THE HINTS IN TERMS \ YOU CAN UNDERSTAND."; const char *const NO_HINTS_MESSAGE_ENG = "THE HELP SYSTEM HAS BEEN TURNED OFF FOR THIS GAME."; diff --git a/devtools/create_access/create_access_dat.cpp b/devtools/create_access/create_access_dat.cpp index af9ab026c0..a1591ef6e5 100644 --- a/devtools/create_access/create_access_dat.cpp +++ b/devtools/create_access/create_access_dat.cpp @@ -46,7 +46,7 @@ * Series of index entries identifying each game: * 1 byte - Game type: 1 = Amazon, 2 = Martian Memorandum, 3 = Noctropolis * 1 byte - disc type: 0 = Floppy, 1 = CD, 2 = Common data shared across - * all variations of the given game + * all variations of the given game * 1 byte - Is Demo: 0 = Full game, 1 = Demo * 1 byte - Language (Common::Language) * 4 bytes - File offset for the data for the game @@ -98,7 +98,7 @@ void writeHeader(int numExecutables) { // Write out version number outputFile.writeWord(VERSION_NUMBER); - + // Write out the number of entries the data file will contain outputFile.writeWord(numExecutables); @@ -109,8 +109,8 @@ void writeHeader(int numExecutables) { void writeAmazonCommonData() { // Write out the header entry outputFile.seek(8); - outputFile.writeByte(1); // Amazon - outputFile.writeByte(2); // Common data + outputFile.writeByte(1); // Amazon + outputFile.writeByte(2); // Common data outputFile.writeByte(0); outputFile.writeByte(0); outputFile.writeLong(outputFile.size()); @@ -144,8 +144,8 @@ void writeAmazonCommonData() { void writeMartianCommonData() { // Write out the header entry outputFile.seek(16); - outputFile.writeByte(2); // Martian - outputFile.writeByte(2); // Common data + outputFile.writeByte(2); // Martian + outputFile.writeByte(2); // Common data outputFile.writeByte(0); outputFile.writeByte(0); outputFile.writeLong(outputFile.size()); @@ -304,7 +304,7 @@ bool processExecutable(int exeIdx, const char *name) { for (uint idx = 0; idx < numFilenames; ++idx) { exeFile.seek(filenamesOffset + idx * 2); uint nameOffset = exeFile.readWord(); - + exeFile.seek(dataSegmentOffset + nameOffset); outputFile.writeString(exeFile); } @@ -319,7 +319,7 @@ bool processExecutable(int exeIdx, const char *name) { charOffsets.push_back(exeFile.readWord()); outputFile.writeWord(charOffsets.size()); - charOffsets.push_back(charsEnd); + charOffsets.push_back(charsEnd); for (uint idx = 0; idx < charOffsets.size() - 1; ++idx) { if (charOffsets[idx] == 0) { outputFile.writeWord(0); @@ -353,7 +353,7 @@ bool processExecutable(int exeIdx, const char *name) { travelPos.push_back(Common::Point(xp, yp)); } - outputFile.writeWord(numRooms); + outputFile.writeWord(numRooms); for (uint idx = 0; idx < numRooms; ++idx) { uint dataSize = 0; diff --git a/devtools/create_access/create_access_dat.h b/devtools/create_access/create_access_dat.h index 8b2af6b48b..4976edec46 100644 --- a/devtools/create_access/create_access_dat.h +++ b/devtools/create_access/create_access_dat.h @@ -166,11 +166,9 @@ public: uint32 result = pos(); fseek(_f, currentPos, SEEK_SET); return result; - } - else if (_memPtr) { + } else if (_memPtr) { return _size; - } - else { + } else { return 0; } } diff --git a/devtools/create_access/martian_resources.cpp b/devtools/create_access/martian_resources.cpp index f631ce7e31..381b79a073 100644 --- a/devtools/create_access/martian_resources.cpp +++ b/devtools/create_access/martian_resources.cpp @@ -118,8 +118,8 @@ const byte MOUSE3[] = { 0, 0 }; -const byte *const CURSORS[MARTIAN_NUM_CURSORS] = { - MOUSE0, MOUSE1, MOUSE2, MOUSE3 +const byte *const CURSORS[MARTIAN_NUM_CURSORS] = { + MOUSE0, MOUSE1, MOUSE2, MOUSE3 }; const uint CURSOR_SIZES[MARTIAN_NUM_CURSORS] = { sizeof(MOUSE0), sizeof(MOUSE1), sizeof(MOUSE2), sizeof(MOUSE3) -- cgit v1.2.3