Removed all boost::assign::list_of

This commit is contained in:
Tomas Jakobsson 2017-11-03 01:33:08 +01:00
parent c70acc88de
commit ac01e8fcd4
5 changed files with 203 additions and 214 deletions

View file

@ -6,72 +6,72 @@
#include "Settings.h"
#include "SystemData.h"
#include "Util.h"
#include <boost/assign/list_of.hpp>
using namespace PlatformIds;
const std::map<PlatformId, const char*> gamesdb_platformid_map = boost::assign::map_list_of
(THREEDO, "3DO")
(AMIGA, "Amiga")
(AMSTRAD_CPC, "Amstrad CPC")
const std::map<PlatformId, const char*> gamesdb_platformid_map {
{ THREEDO, "3DO" },
{ AMIGA, "Amiga" },
{ AMSTRAD_CPC, "Amstrad CPC" },
// missing apple2
(ARCADE, "Arcade")
{ ARCADE, "Arcade" },
// missing atari 800
(ATARI_2600, "Atari 2600")
(ATARI_5200, "Atari 5200")
(ATARI_7800, "Atari 7800")
(ATARI_JAGUAR, "Atari Jaguar")
(ATARI_JAGUAR_CD, "Atari Jaguar CD")
(ATARI_LYNX, "Atari Lynx")
{ ATARI_2600, "Atari 2600" },
{ ATARI_5200, "Atari 5200" },
{ ATARI_7800, "Atari 7800" },
{ ATARI_JAGUAR, "Atari Jaguar" },
{ ATARI_JAGUAR_CD, "Atari Jaguar CD" },
{ ATARI_LYNX, "Atari Lynx" },
// missing atari ST/STE/Falcon
(ATARI_XE, "Atari XE")
(COLECOVISION, "Colecovision")
(COMMODORE_64, "Commodore 64")
(INTELLIVISION, "Intellivision")
(MAC_OS, "Mac OS")
(XBOX, "Microsoft Xbox")
(XBOX_360, "Microsoft Xbox 360")
(MSX, "MSX")
(NEOGEO, "Neo Geo")
(NEOGEO_POCKET, "Neo Geo Pocket")
(NEOGEO_POCKET_COLOR, "Neo Geo Pocket Color")
(NINTENDO_3DS, "Nintendo 3DS")
(NINTENDO_64, "Nintendo 64")
(NINTENDO_DS, "Nintendo DS")
(FAMICOM_DISK_SYSTEM, "Famicom Disk System")
(NINTENDO_ENTERTAINMENT_SYSTEM, "Nintendo Entertainment System (NES)")
(GAME_BOY, "Nintendo Game Boy")
(GAME_BOY_ADVANCE, "Nintendo Game Boy Advance")
(GAME_BOY_COLOR, "Nintendo Game Boy Color")
(NINTENDO_GAMECUBE, "Nintendo GameCube")
(NINTENDO_WII, "Nintendo Wii")
(NINTENDO_WII_U, "Nintendo Wii U")
(NINTENDO_VIRTUAL_BOY, "Nintendo Virtual Boy")
(NINTENDO_GAME_AND_WATCH, "Game & Watch")
(PC, "PC")
(SEGA_32X, "Sega 32X")
(SEGA_CD, "Sega CD")
(SEGA_DREAMCAST, "Sega Dreamcast")
(SEGA_GAME_GEAR, "Sega Game Gear")
(SEGA_GENESIS, "Sega Genesis")
(SEGA_MASTER_SYSTEM, "Sega Master System")
(SEGA_MEGA_DRIVE, "Sega Mega Drive")
(SEGA_SATURN, "Sega Saturn")
(SEGA_SG1000, "SEGA SG-1000")
(PLAYSTATION, "Sony Playstation")
(PLAYSTATION_2, "Sony Playstation 2")
(PLAYSTATION_3, "Sony Playstation 3")
(PLAYSTATION_4, "Sony Playstation 4")
(PLAYSTATION_VITA, "Sony Playstation Vita")
(PLAYSTATION_PORTABLE, "Sony Playstation Portable")
(SUPER_NINTENDO, "Super Nintendo (SNES)")
(TURBOGRAFX_16, "TurboGrafx 16")
(WONDERSWAN, "WonderSwan")
(WONDERSWAN_COLOR, "WonderSwan Color")
(ZX_SPECTRUM, "Sinclair ZX Spectrum")
(VIDEOPAC_ODYSSEY2, "Magnavox Odyssey 2")
(VECTREX, "Vectrex")
(TRS80_COLOR_COMPUTER, "TRS-80 Color Computer")
(TANDY, "TRS-80 Color Computer");
{ ATARI_XE, "Atari XE" },
{ COLECOVISION, "Colecovision" },
{ COMMODORE_64, "Commodore 64" },
{ INTELLIVISION, "Intellivision" },
{ MAC_OS, "Mac OS" },
{ XBOX, "Microsoft Xbox" },
{ XBOX_360, "Microsoft Xbox 360" },
{ MSX, "MSX" },
{ NEOGEO, "Neo Geo" },
{ NEOGEO_POCKET, "Neo Geo Pocket" },
{ NEOGEO_POCKET_COLOR, "Neo Geo Pocket Color" },
{ NINTENDO_3DS, "Nintendo 3DS" },
{ NINTENDO_64, "Nintendo 64" },
{ NINTENDO_DS, "Nintendo DS" },
{ FAMICOM_DISK_SYSTEM, "Famicom Disk System" },
{ NINTENDO_ENTERTAINMENT_SYSTEM, "Nintendo Entertainment System { NES)" },
{ GAME_BOY, "Nintendo Game Boy" },
{ GAME_BOY_ADVANCE, "Nintendo Game Boy Advance" },
{ GAME_BOY_COLOR, "Nintendo Game Boy Color" },
{ NINTENDO_GAMECUBE, "Nintendo GameCube" },
{ NINTENDO_WII, "Nintendo Wii" },
{ NINTENDO_WII_U, "Nintendo Wii U" },
{ NINTENDO_VIRTUAL_BOY, "Nintendo Virtual Boy" },
{ NINTENDO_GAME_AND_WATCH, "Game & Watch" },
{ PC, "PC" },
{ SEGA_32X, "Sega 32X" },
{ SEGA_CD, "Sega CD" },
{ SEGA_DREAMCAST, "Sega Dreamcast" },
{ SEGA_GAME_GEAR, "Sega Game Gear" },
{ SEGA_GENESIS, "Sega Genesis" },
{ SEGA_MASTER_SYSTEM, "Sega Master System" },
{ SEGA_MEGA_DRIVE, "Sega Mega Drive" },
{ SEGA_SATURN, "Sega Saturn" },
{ SEGA_SG1000, "SEGA SG-1000" },
{ PLAYSTATION, "Sony Playstation" },
{ PLAYSTATION_2, "Sony Playstation 2" },
{ PLAYSTATION_3, "Sony Playstation 3" },
{ PLAYSTATION_4, "Sony Playstation 4" },
{ PLAYSTATION_VITA, "Sony Playstation Vita" },
{ PLAYSTATION_PORTABLE, "Sony Playstation Portable" },
{ SUPER_NINTENDO, "Super Nintendo { SNES)" },
{ TURBOGRAFX_16, "TurboGrafx 16" },
{ WONDERSWAN, "WonderSwan" },
{ WONDERSWAN_COLOR, "WonderSwan Color" },
{ ZX_SPECTRUM, "Sinclair ZX Spectrum" },
{ VIDEOPAC_ODYSSEY2, "Magnavox Odyssey 2" },
{ VECTREX, "Vectrex" },
{ TRS80_COLOR_COMPUTER, "TRS-80 Color Computer" },
{ TANDY, "TRS-80 Color Computer" }
};
void thegamesdb_generate_scraper_requests(const ScraperSearchParams& params, std::queue< std::unique_ptr<ScraperRequest> >& requests,
std::vector<ScraperSearchResult>& results)

View file

@ -6,13 +6,13 @@
#include "platform.h"
#include "Settings.h"
#include "SystemData.h"
#include <boost/assign/list_of.hpp>
#include <boost/filesystem/operations.hpp>
#include <FreeImage.h>
#include <fstream>
const std::map<std::string, generate_scraper_requests_func> scraper_request_funcs = boost::assign::map_list_of
("TheGamesDB", &thegamesdb_generate_scraper_requests);
const std::map<std::string, generate_scraper_requests_func> scraper_request_funcs {
{ "TheGamesDB", &thegamesdb_generate_scraper_requests }
};
std::unique_ptr<ScraperSearchHandle> startScraperSearch(const ScraperSearchParams& params)
{

View file

@ -2,7 +2,6 @@
#include "Log.h"
#include "platform.h"
#include <boost/assign/list_of.hpp>
#include <boost/filesystem/operations.hpp>
#include <pugixml/src/pugixml.hpp>
@ -10,18 +9,19 @@ Settings* Settings::sInstance = NULL;
// these values are NOT saved to es_settings.xml
// since they're set through command-line arguments, and not the in-program settings menu
std::vector<const char*> settings_dont_save = boost::assign::list_of
("Debug")
("DebugGrid")
("DebugText")
("ForceKid")
("ForceKiosk")
("IgnoreGamelist")
("HideConsole")
("ShowExit")
("SplashScreen")
("VSync")
("Windowed");
std::vector<const char*> settings_dont_save {
{ "Debug" },
{ "DebugGrid" },
{ "DebugText" },
{ "ForceKid" },
{ "ForceKiosk" },
{ "IgnoreGamelist" },
{ "HideConsole" },
{ "ShowExit" },
{ "SplashScreen" },
{ "VSync" },
{ "Windowed" }
};
Settings::Settings()
{

View file

@ -5,134 +5,123 @@
#include "Log.h"
#include "platform.h"
#include "Settings.h"
#include <boost/assign/list_of.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/xpressive/xpressive_static.hpp>
// This is a work around for some ambiguity that is introduced in C++11 that boost::assign::map_list_of leave open.
// We use makeMap(actualmap) to implicitly convert the boost::assign::map_list_of's return type to ElementMapType.
// Problem exists with gcc 4.7 and Boost 1.51. Works fine with MSVC2010 without this hack.
typedef std::map<std::string, ThemeData::ElementPropertyType> ElementMapType;
template<typename T>
ElementMapType makeMap(const T& mapInit)
{
ElementMapType m = mapInit;
return m;
}
std::vector<std::string> ThemeData::sSupportedViews { { "system" }, { "basic" }, { "detailed" }, { "video" } };
std::vector<std::string> ThemeData::sSupportedFeatures { { "video" }, { "carousel" }, { "z-index" } };
std::vector<std::string> ThemeData::sSupportedViews = boost::assign::list_of("system")("basic")("detailed")("video");
std::vector<std::string> ThemeData::sSupportedFeatures = boost::assign::list_of("video")("carousel")("z-index");
std::map< std::string, ElementMapType > ThemeData::sElementMap = boost::assign::map_list_of
("image", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("maxSize", NORMALIZED_PAIR)
("origin", NORMALIZED_PAIR)
("rotation", FLOAT)
("rotationOrigin", NORMALIZED_PAIR)
("path", PATH)
("default", PATH)
("tile", BOOLEAN)
("color", COLOR)
("zIndex", FLOAT)))
("text", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("origin", NORMALIZED_PAIR)
("rotation", FLOAT)
("rotationOrigin", NORMALIZED_PAIR)
("text", STRING)
("backgroundColor", COLOR)
("fontPath", PATH)
("fontSize", FLOAT)
("color", COLOR)
("alignment", STRING)
("forceUppercase", BOOLEAN)
("lineSpacing", FLOAT)
("value", STRING)
("zIndex", FLOAT)))
("textlist", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("origin", NORMALIZED_PAIR)
("selectorHeight", FLOAT)
("selectorOffsetY", FLOAT)
("selectorColor", COLOR)
("selectorImagePath", PATH)
("selectorImageTile", BOOLEAN)
("selectedColor", COLOR)
("primaryColor", COLOR)
("secondaryColor", COLOR)
("fontPath", PATH)
("fontSize", FLOAT)
("scrollSound", PATH)
("alignment", STRING)
("horizontalMargin", FLOAT)
("forceUppercase", BOOLEAN)
("lineSpacing", FLOAT)
("zIndex", FLOAT)))
("container", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("origin", NORMALIZED_PAIR)
("zIndex", FLOAT)))
("ninepatch", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("path", PATH)
("zIndex", FLOAT)))
("datetime", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("color", COLOR)
("fontPath", PATH)
("fontSize", FLOAT)
("forceUppercase", BOOLEAN)
("zIndex", FLOAT)))
("rating", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("origin", NORMALIZED_PAIR)
("rotation", FLOAT)
("rotationOrigin", NORMALIZED_PAIR)
("color", COLOR)
("filledPath", PATH)
("unfilledPath", PATH)
("zIndex", FLOAT)))
("sound", makeMap(boost::assign::map_list_of
("path", PATH)))
("helpsystem", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("textColor", COLOR)
("iconColor", COLOR)
("fontPath", PATH)
("fontSize", FLOAT)))
("video", makeMap(boost::assign::map_list_of
("pos", NORMALIZED_PAIR)
("size", NORMALIZED_PAIR)
("maxSize", NORMALIZED_PAIR)
("origin", NORMALIZED_PAIR)
("rotation", FLOAT)
("rotationOrigin", NORMALIZED_PAIR)
("default", PATH)
("delay", FLOAT)
("zIndex", FLOAT)
("showSnapshotNoVideo", BOOLEAN)
("showSnapshotDelay", BOOLEAN)))
("carousel", makeMap(boost::assign::map_list_of
("type", STRING)
("size", NORMALIZED_PAIR)
("pos", NORMALIZED_PAIR)
("origin", NORMALIZED_PAIR)
("color", COLOR)
("logoScale", FLOAT)
("logoRotation", FLOAT)
("logoRotationOrigin", NORMALIZED_PAIR)
("logoSize", NORMALIZED_PAIR)
("logoAlignment", STRING)
("maxLogoCount", FLOAT)
("zIndex", FLOAT)));
std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>> ThemeData::sElementMap {
{ "image", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "maxSize", NORMALIZED_PAIR },
{ "origin", NORMALIZED_PAIR },
{ "rotation", FLOAT },
{ "rotationOrigin", NORMALIZED_PAIR },
{ "path", PATH },
{ "default", PATH },
{ "tile", BOOLEAN },
{ "color", COLOR },
{ "zIndex", FLOAT } } },
{ "text", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "origin", NORMALIZED_PAIR },
{ "rotation", FLOAT },
{ "rotationOrigin", NORMALIZED_PAIR },
{ "text", STRING },
{ "backgroundColor", COLOR },
{ "fontPath", PATH },
{ "fontSize", FLOAT },
{ "color", COLOR },
{ "alignment", STRING },
{ "forceUppercase", BOOLEAN },
{ "lineSpacing", FLOAT },
{ "value", STRING },
{ "zIndex", FLOAT } } },
{ "textlist", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "origin", NORMALIZED_PAIR },
{ "selectorHeight", FLOAT },
{ "selectorOffsetY", FLOAT },
{ "selectorColor", COLOR },
{ "selectorImagePath", PATH },
{ "selectorImageTile", BOOLEAN },
{ "selectedColor", COLOR },
{ "primaryColor", COLOR },
{ "secondaryColor", COLOR },
{ "fontPath", PATH },
{ "fontSize", FLOAT },
{ "scrollSound", PATH },
{ "alignment", STRING },
{ "horizontalMargin", FLOAT },
{ "forceUppercase", BOOLEAN },
{ "lineSpacing", FLOAT },
{ "zIndex", FLOAT } } },
{ "container", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "origin", NORMALIZED_PAIR },
{ "zIndex", FLOAT } } },
{ "ninepatch", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "path", PATH },
{ "zIndex", FLOAT } } },
{ "datetime", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "color", COLOR },
{ "fontPath", PATH },
{ "fontSize", FLOAT },
{ "forceUppercase", BOOLEAN },
{ "zIndex", FLOAT } } },
{ "rating", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "origin", NORMALIZED_PAIR },
{ "rotation", FLOAT },
{ "rotationOrigin", NORMALIZED_PAIR },
{ "color", COLOR },
{ "filledPath", PATH },
{ "unfilledPath", PATH },
{ "zIndex", FLOAT } } },
{ "sound", {
{ "path", PATH } } },
{ "helpsystem", {
{ "pos", NORMALIZED_PAIR },
{ "textColor", COLOR },
{ "iconColor", COLOR },
{ "fontPath", PATH },
{ "fontSize", FLOAT } } },
{ "video", {
{ "pos", NORMALIZED_PAIR },
{ "size", NORMALIZED_PAIR },
{ "maxSize", NORMALIZED_PAIR },
{ "origin", NORMALIZED_PAIR },
{ "rotation", FLOAT },
{ "rotationOrigin", NORMALIZED_PAIR },
{ "default", PATH },
{ "delay", FLOAT },
{ "zIndex", FLOAT },
{ "showSnapshotNoVideo", BOOLEAN },
{ "showSnapshotDelay", BOOLEAN } } },
{ "carousel", {
{ "type", STRING },
{ "size", NORMALIZED_PAIR },
{ "pos", NORMALIZED_PAIR },
{ "origin", NORMALIZED_PAIR },
{ "color", COLOR },
{ "logoScale", FLOAT },
{ "logoRotation", FLOAT },
{ "logoRotationOrigin", NORMALIZED_PAIR },
{ "logoSize", NORMALIZED_PAIR },
{ "logoAlignment", STRING },
{ "maxLogoCount", FLOAT },
{ "zIndex", FLOAT } } }
};
namespace fs = boost::filesystem;

View file

@ -7,7 +7,6 @@
#include "Log.h"
#include "Settings.h"
#include "Util.h"
#include <boost/assign/list_of.hpp>
#define OFFSET_X 12 // move the entire thing right by this amount (px)
#define OFFSET_Y 12 // move the entire thing up by this amount (px)
@ -15,18 +14,19 @@
#define ICON_TEXT_SPACING 8 // space between [icon] and [text] (px)
#define ENTRY_SPACING 16 // space between [text] and next [icon] (px)
static const std::map<std::string, const char*> ICON_PATH_MAP = boost::assign::map_list_of
("up/down", ":/help/dpad_updown.svg")
("left/right", ":/help/dpad_leftright.svg")
("up/down/left/right", ":/help/dpad_all.svg")
("a", ":/help/button_a.svg")
("b", ":/help/button_b.svg")
("x", ":/help/button_x.svg")
("y", ":/help/button_y.svg")
("l", ":/help/button_l.svg")
("r", ":/help/button_r.svg")
("start", ":/help/button_start.svg")
("select", ":/help/button_select.svg");
static const std::map<std::string, const char*> ICON_PATH_MAP {
{ "up/down", ":/help/dpad_updown.svg" },
{ "left/right", ":/help/dpad_leftright.svg" },
{ "up/down/left/right", ":/help/dpad_all.svg" },
{ "a", ":/help/button_a.svg" },
{ "b", ":/help/button_b.svg" },
{ "x", ":/help/button_x.svg" },
{ "y", ":/help/button_y.svg" },
{ "l", ":/help/button_l.svg" },
{ "r", ":/help/button_r.svg" },
{ "start", ":/help/button_start.svg" },
{ "select", ":/help/button_select.svg" }
};
HelpComponent::HelpComponent(Window* window) : GuiComponent(window)
{