2012-02-22 14:33:29 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 17:47:58 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2014-02-18 01:34:18 +00:00
|
|
|
*
|
2012-02-22 14:33:29 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-02-18 01:34:18 +00:00
|
|
|
*
|
2012-02-22 14:33:29 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2012-02-22 14:33:29 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/rendermode.h"
|
|
|
|
|
2012-02-29 10:43:21 +00:00
|
|
|
#include "common/gui_options.h"
|
2012-02-22 14:33:29 +00:00
|
|
|
#include "common/str.h"
|
|
|
|
#include "common/translation.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Common {
|
|
|
|
|
|
|
|
|
|
|
|
const RenderModeDescription g_renderModes[] = {
|
2023-03-26 15:42:20 +00:00
|
|
|
// I18N: Hercules is a graphics card name, Green is color
|
2012-02-22 14:33:29 +00:00
|
|
|
{ "hercGreen", _s("Hercules Green"), kRenderHercG },
|
2023-03-26 15:42:20 +00:00
|
|
|
// I18N: Hercules is a graphics card name, Amber is color
|
2012-02-22 14:33:29 +00:00
|
|
|
{ "hercAmber", _s("Hercules Amber"), kRenderHercA },
|
|
|
|
{ "cga", "CGA", kRenderCGA },
|
2023-03-26 15:42:20 +00:00
|
|
|
// I18N: Composite is a video mode of RGB composite channels
|
2022-07-07 23:01:46 +00:00
|
|
|
{ "cgaComp", "CGA Composite", kRenderCGAComp },
|
2022-07-10 20:36:21 +00:00
|
|
|
// I18N: CGA black-and-white
|
|
|
|
{ "cgaBW", "CGA b/w", kRenderCGA_BW },
|
2012-02-22 14:33:29 +00:00
|
|
|
{ "ega", "EGA", kRenderEGA },
|
|
|
|
{ "vga", "VGA", kRenderVGA },
|
|
|
|
{ "amiga", "Amiga", kRenderAmiga },
|
2016-01-21 22:23:40 +00:00
|
|
|
{ "fmtowns", "FM-TOWNS", kRenderFMTowns },
|
2016-01-21 22:28:15 +00:00
|
|
|
{ "pc9821", _s("PC-9821 (256 Colors)"), kRenderPC9821 },
|
|
|
|
{ "pc9801", _s("PC-9801 (16 Colors)"), kRenderPC9801 },
|
2016-01-21 22:21:10 +00:00
|
|
|
{ "2gs", "Apple IIgs", kRenderApple2GS },
|
|
|
|
{ "atari", "Atari ST", kRenderAtariST },
|
2016-02-05 11:38:28 +00:00
|
|
|
{ "macintosh", "Macintosh", kRenderMacintosh },
|
2021-07-13 07:51:01 +00:00
|
|
|
// I18N: Macintosh black-and-white
|
2021-07-10 13:21:00 +00:00
|
|
|
{ "macintoshbw", _s("Macintosh b/w"), kRenderMacintoshBW },
|
2022-12-29 12:25:38 +00:00
|
|
|
{ "cpc", "Amstrad CPC", kRenderCPC },
|
2022-12-23 19:27:17 +00:00
|
|
|
{ "zx", "ZX Spectrum", kRenderZX },
|
2023-01-02 11:01:26 +00:00
|
|
|
{ "c64", "Commodore 64", kRenderC64 },
|
2018-04-05 18:25:28 +00:00
|
|
|
{nullptr, nullptr, kRenderDefault}
|
2012-02-22 14:33:29 +00:00
|
|
|
};
|
|
|
|
|
2012-02-29 10:43:21 +00:00
|
|
|
struct RenderGUIOMapping {
|
|
|
|
RenderMode id;
|
|
|
|
const char *guio;
|
|
|
|
};
|
|
|
|
|
|
|
|
// TODO: Merge s_renderGUIOMapping into g_renderModes? the kRenderDefault
|
|
|
|
// could be used to indicate "any" mode when passed to renderMode2GUIO (if
|
|
|
|
// we wanted to merge allRenderModesGUIOs back into)
|
|
|
|
static const RenderGUIOMapping s_renderGUIOMapping[] = {
|
2021-11-14 15:16:56 +00:00
|
|
|
{ kRenderHercG, GUIO_RENDERHERCGREEN },
|
|
|
|
{ kRenderHercA, GUIO_RENDERHERCAMBER },
|
|
|
|
{ kRenderCGA, GUIO_RENDERCGA },
|
|
|
|
{ kRenderEGA, GUIO_RENDEREGA },
|
|
|
|
{ kRenderVGA, GUIO_RENDERVGA },
|
|
|
|
{ kRenderAmiga, GUIO_RENDERAMIGA },
|
|
|
|
{ kRenderFMTowns, GUIO_RENDERFMTOWNS },
|
|
|
|
{ kRenderPC9821, GUIO_RENDERPC9821 },
|
|
|
|
{ kRenderPC9801, GUIO_RENDERPC9801 },
|
|
|
|
{ kRenderApple2GS, GUIO_RENDERAPPLE2GS },
|
|
|
|
{ kRenderAtariST, GUIO_RENDERATARIST },
|
|
|
|
{ kRenderMacintosh, GUIO_RENDERMACINTOSH },
|
2022-07-07 23:01:46 +00:00
|
|
|
{ kRenderMacintoshBW, GUIO_RENDERMACINTOSHBW },
|
|
|
|
{ kRenderCGAComp, GUIO_RENDERCGACOMP },
|
2023-03-05 13:53:48 +00:00
|
|
|
{ kRenderCGA_BW, GUIO_RENDERCGABW },
|
|
|
|
{ kRenderCPC, GUIO_RENDERCPC },
|
|
|
|
{ kRenderZX, GUIO_RENDERZX },
|
|
|
|
{ kRenderC64, GUIO_RENDERC64 }
|
2012-02-29 10:43:21 +00:00
|
|
|
};
|
|
|
|
|
2012-02-22 14:33:29 +00:00
|
|
|
DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Hercules Green", "lowres")
|
|
|
|
DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Hercules Amber", "lowres")
|
|
|
|
|
|
|
|
RenderMode parseRenderMode(const String &str) {
|
|
|
|
if (str.empty())
|
|
|
|
return kRenderDefault;
|
|
|
|
|
|
|
|
const RenderModeDescription *l = g_renderModes;
|
|
|
|
for (; l->code; ++l) {
|
|
|
|
if (str.equalsIgnoreCase(l->code))
|
|
|
|
return l->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
return kRenderDefault;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *getRenderModeCode(RenderMode id) {
|
|
|
|
const RenderModeDescription *l = g_renderModes;
|
|
|
|
for (; l->code; ++l) {
|
|
|
|
if (l->id == id)
|
|
|
|
return l->code;
|
|
|
|
}
|
2018-04-05 18:25:28 +00:00
|
|
|
return nullptr;
|
2012-02-22 14:33:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *getRenderModeDescription(RenderMode id) {
|
|
|
|
const RenderModeDescription *l = g_renderModes;
|
|
|
|
for (; l->code; ++l) {
|
|
|
|
if (l->id == id)
|
|
|
|
return l->description;
|
|
|
|
}
|
2018-04-05 18:25:28 +00:00
|
|
|
return nullptr;
|
2012-02-22 14:33:29 +00:00
|
|
|
}
|
|
|
|
|
2012-02-29 10:43:21 +00:00
|
|
|
String renderMode2GUIO(RenderMode id) {
|
2012-03-17 10:55:51 +00:00
|
|
|
String res;
|
2012-02-29 10:43:21 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < ARRAYSIZE(s_renderGUIOMapping); i++) {
|
|
|
|
if (id == s_renderGUIOMapping[i].id)
|
|
|
|
res += s_renderGUIOMapping[i].guio;
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
String allRenderModesGUIOs() {
|
2012-03-17 10:55:51 +00:00
|
|
|
String res;
|
2012-02-29 10:43:21 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < ARRAYSIZE(s_renderGUIOMapping); i++) {
|
|
|
|
res += s_renderGUIOMapping[i].guio;
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
2012-02-22 14:33:29 +00:00
|
|
|
|
|
|
|
} // End of namespace Common
|