General refactoring and code cleanup.

This commit is contained in:
Leon Styhre 2022-01-16 18:18:28 +01:00
parent 8a6652552f
commit 0c8efee8ad
72 changed files with 513 additions and 523 deletions

View file

@ -39,15 +39,13 @@
#include <pugixml.hpp>
#include <random>
std::string myCollectionsName = "collections";
#define LAST_PLAYED_MAX 50
CollectionSystemsManager::CollectionSystemsManager() noexcept
: mWindow(Window::getInstance())
: mWindow {Window::getInstance()}
{
// clang-format off
CollectionSystemDecl systemDecls[] = {
CollectionSystemDecl systemDecls[] {
// Type Name Long name Theme folder isCustom
{AUTO_ALL_GAMES, "all", "all games", "auto-allgames", false},
{AUTO_LAST_PLAYED, "recent", "last played", "auto-lastplayed", false},
@ -57,8 +55,8 @@ CollectionSystemsManager::CollectionSystemsManager() noexcept
// clang-format on
// Create a map of the collections.
std::vector<CollectionSystemDecl> tempSystemDecl = std::vector<CollectionSystemDecl>(
systemDecls, systemDecls + sizeof(systemDecls) / sizeof(systemDecls[0]));
std::vector<CollectionSystemDecl> tempSystemDecl {std::vector<CollectionSystemDecl>(
systemDecls, systemDecls + sizeof(systemDecls) / sizeof(systemDecls[0]))};
for (std::vector<CollectionSystemDecl>::const_iterator it = tempSystemDecl.cbegin();
it != tempSystemDecl.cend(); ++it)

View file

@ -134,6 +134,8 @@ public:
const bool isEditing() const { return mIsEditingCustom; }
const std::string& getEditingCollection() const { return mEditingCollection; }
inline static std::string myCollectionsName = "collections";
private:
CollectionSystemsManager() noexcept;

View file

@ -31,15 +31,15 @@ FileData::FileData(FileType type,
const std::string& path,
SystemEnvironmentData* envData,
SystemData* system)
: metadata(type == GAME ? GAME_METADATA : FOLDER_METADATA)
, mSourceFileData(nullptr)
, mParent(nullptr)
, mType(type)
, mPath(path)
, mEnvData(envData)
, mSystem(system)
, mOnlyFolders(false)
, mDeletionFlag(false)
: metadata {type == GAME ? GAME_METADATA : FOLDER_METADATA}
, mSourceFileData {nullptr}
, mParent {nullptr}
, mType {type}
, mPath {path}
, mEnvData {envData}
, mSystem {system}
, mOnlyFolders {false}
, mDeletionFlag {false}
{
// Metadata needs at least a name field (since that's what getName() will return).
if (metadata.get("name").empty()) {

View file

@ -21,20 +21,20 @@
#define INCLUDE_UNKNOWN false;
FileFilterIndex::FileFilterIndex()
: mFilterByText(false)
, mTextRemoveSystem(false)
, mFilterByRatings(false)
, mFilterByDeveloper(false)
, mFilterByPublisher(false)
, mFilterByGenre(false)
, mFilterByPlayers(false)
, mFilterByFavorites(false)
, mFilterByCompleted(false)
, mFilterByKidGame(false)
, mFilterByHidden(false)
, mFilterByBroken(false)
, mFilterByController(false)
, mFilterByAltemulator(false)
: mFilterByText {false}
, mTextRemoveSystem {false}
, mFilterByRatings {false}
, mFilterByDeveloper {false}
, mFilterByPublisher {false}
, mFilterByGenre {false}
, mFilterByPlayers {false}
, mFilterByFavorites {false}
, mFilterByCompleted {false}
, mFilterByKidGame {false}
, mFilterByHidden {false}
, mFilterByBroken {false}
, mFilterByController {false}
, mFilterByAltemulator {false}
{
clearAllFilters();
@ -88,9 +88,9 @@ void FileFilterIndex::importIndex(FileFilterIndex* indexToImport)
{&mAltemulatorIndexAllKeys, &(indexToImport->mAltemulatorIndexAllKeys)},
};
std::vector<IndexImportStructure> indexImportDecl = std::vector<IndexImportStructure>(
std::vector<IndexImportStructure> indexImportDecl {std::vector<IndexImportStructure>(
indexStructDecls,
indexStructDecls + sizeof(indexStructDecls) / sizeof(indexStructDecls[0]));
indexStructDecls + sizeof(indexStructDecls) / sizeof(indexStructDecls[0]))};
for (std::vector<IndexImportStructure>::const_iterator indexesIt = indexImportDecl.cbegin();
indexesIt != indexImportDecl.cend(); ++indexesIt) {

View file

@ -17,7 +17,7 @@
namespace FileSorts
{
const FileData::SortType typesArr[] = {
const FileData::SortType typesArr[] {
FileData::SortType(&compareName, "filename, ascending"),
FileData::SortType(&compareNameDescending, "filename, descending"),
@ -48,9 +48,8 @@ namespace FileSorts
FileData::SortType(&compareSystem, "system, ascending"),
FileData::SortType(&compareSystemDescending, "system, descending")};
const std::vector<FileData::SortType> SortTypes(typesArr,
typesArr +
sizeof(typesArr) / sizeof(typesArr[0]));
const std::vector<FileData::SortType> SortTypes {typesArr, typesArr + sizeof(typesArr) /
sizeof(typesArr[0])};
bool compareName(const FileData* file1, const FileData* file2)
{

View file

@ -22,9 +22,9 @@ namespace GamelistFileParser
FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType type)
{
// First, verify that path is within the system's root folder.
FileData* root = system->getRootFolder();
bool contains = false;
std::string relative = Utils::FileSystem::removeCommonPath(path, root->getPath(), contains);
FileData* root {system->getRootFolder()};
bool contains {false};
std::string relative {Utils::FileSystem::removeCommonPath(path, root->getPath(), contains)};
if (!contains) {
LOG(LogError) << "Path \"" << path << "\" is outside system path \""

View file

@ -13,9 +13,9 @@
#include "views/ViewController.h"
MediaViewer::MediaViewer()
: mWindow(Window::getInstance())
, mVideo(nullptr)
, mImage(nullptr)
: mWindow {Window::getInstance()}
, mVideo {nullptr}
, mImage {nullptr}
{
mWindow->setMediaViewer(this);
}

View file

@ -19,7 +19,7 @@ namespace
// clang-format off
// The statistic entries must be placed at the bottom or otherwise there will be problems with
// saving the values in GuiMetaDataEd.
MetaDataDecl gameDecls[] = {
MetaDataDecl gameDecls[] {
// key, type, default, statistic, name in GuiMetaDataEd, prompt in GuiMetaDataEd, shouldScrape
{"name", MD_STRING, "", false, "name", "enter name", true},
{"sortname", MD_STRING, "", false, "sortname", "enter sortname", false},
@ -45,7 +45,7 @@ namespace
{"lastplayed", MD_TIME, "0", true, "last played", "enter last played date", false}
};
MetaDataDecl folderDecls[] = {
MetaDataDecl folderDecls[] {
{"name", MD_STRING, "", false, "name", "enter name", true},
{"desc", MD_MULTILINE_STRING, "", false, "description", "enter description", true},
{"rating", MD_RATING, "0", false, "rating", "enter rating", true},
@ -66,12 +66,12 @@ namespace
};
// clang-format on
const std::vector<MetaDataDecl> gameMDD(gameDecls,
gameDecls + sizeof(gameDecls) / sizeof(gameDecls[0]));
const std::vector<MetaDataDecl> gameMDD {gameDecls,
gameDecls + sizeof(gameDecls) / sizeof(gameDecls[0])};
const std::vector<MetaDataDecl> folderMDD {
folderDecls, folderDecls + sizeof(folderDecls) / sizeof(folderDecls[0])};
const std::vector<MetaDataDecl> folderMDD(folderDecls,
folderDecls +
sizeof(folderDecls) / sizeof(folderDecls[0]));
} // namespace
const std::vector<MetaDataDecl>& getMDDByType(MetaDataListType type)

View file

@ -28,8 +28,6 @@ MiximageGenerator::MiximageGenerator(FileData* game, std::string& resultMessage)
{
}
MiximageGenerator::~MiximageGenerator() {}
void MiximageGenerator::startThread(std::promise<bool>* miximagePromise)
{
mMiximagePromise = miximagePromise;

View file

@ -23,7 +23,6 @@ class MiximageGenerator
{
public:
MiximageGenerator(FileData* game, std::string& resultMessage);
~MiximageGenerator();
void startThread(std::promise<bool>* miximagePromise);

View file

@ -14,7 +14,7 @@
namespace PlatformIds
{
// clang-format off
std::vector<std::string> platformNames = {
std::vector<std::string> platformNames {
"unknown", // Nothing set.
"3do", // 3DO

View file

@ -40,10 +40,10 @@ FindRules::FindRules()
void FindRules::loadFindRules()
{
std::string customSystemsDirectory =
Utils::FileSystem::getHomePath() + "/.emulationstation/custom_systems";
std::string customSystemsDirectory {Utils::FileSystem::getHomePath() +
"/.emulationstation/custom_systems"};
std::string path = customSystemsDirectory + "/es_find_rules.xml";
std::string path {customSystemsDirectory + "/es_find_rules.xml"};
if (Utils::FileSystem::exists(path)) {
LOG(LogInfo) << "Found custom find rules configuration file";

View file

@ -30,22 +30,22 @@
#define FADE_TIME 300
SystemScreensaver::SystemScreensaver()
: mWindow(Window::getInstance())
, mState(STATE_INACTIVE)
, mImageScreensaver(nullptr)
, mVideoScreensaver(nullptr)
, mCurrentGame(nullptr)
, mPreviousGame(nullptr)
, mTimer(0)
, mMediaSwapTime(0)
, mTriggerNextGame(false)
, mHasMediaFiles(false)
, mFallbackScreensaver(false)
, mOpacity(0.0f)
, mDimValue(1.0)
, mRectangleFadeIn(50)
, mTextFadeIn(0)
, mSaturationAmount(1.0)
: mWindow {Window::getInstance()}
, mState {STATE_INACTIVE}
, mImageScreensaver {nullptr}
, mVideoScreensaver {nullptr}
, mCurrentGame {nullptr}
, mPreviousGame {nullptr}
, mTimer {0}
, mMediaSwapTime {0}
, mTriggerNextGame {false}
, mHasMediaFiles {false}
, mFallbackScreensaver {false}
, mOpacity {0.0f}
, mDimValue {1.0}
, mRectangleFadeIn {50}
, mTextFadeIn {0}
, mSaturationAmount {1.0}
{
mWindow->setScreensaver(this);
}

View file

@ -21,15 +21,17 @@ std::string VolumeControl::mixerCard = "default";
#endif
VolumeControl::VolumeControl()
// clang-format off
#if defined(__linux__)
: mixerIndex(0)
, mixerHandle(nullptr)
, mixerElem(nullptr)
, mixerSelemId(nullptr)
: mixerIndex {0}
, mixerHandle {nullptr}
, mixerElem {nullptr}
, mixerSelemId {nullptr}
#elif defined(_WIN64)
: mixerHandle(nullptr)
, endpointVolume(nullptr)
: mixerHandle {nullptr}
, endpointVolume {nullptr}
#endif
// clang-format on
{
init();
}

View file

@ -16,13 +16,13 @@
GuiAlternativeEmulators::GuiAlternativeEmulators(Window* window)
: GuiComponent {window}
, mMenu {window, "ALTERNATIVE EMULATORS"}
, mHasSystems(false)
, mHasSystems {false}
{
addChild(&mMenu);
mMenu.addButton("BACK", "back", [this] { delete this; });
// Horizontal sizes for the system and label entries.
float systemSizeX = mMenu.getSize().x / 3.27f;
float systemSizeX {mMenu.getSize().x / 3.27f};
for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); ++it) {
@ -35,14 +35,14 @@ GuiAlternativeEmulators::GuiAlternativeEmulators(Window* window)
ComponentListRow row;
std::string name = (*it)->getName();
std::shared_ptr<TextComponent> systemText =
std::make_shared<TextComponent>(mWindow, name, Font::get(FONT_SIZE_MEDIUM), 0x777777FF);
std::string name {(*it)->getName()};
std::shared_ptr<TextComponent> systemText {std::make_shared<TextComponent>(
mWindow, name, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)};
systemText->setSize(systemSizeX, systemText->getSize().y);
row.addElement(systemText, false);
std::string configuredLabel = (*it)->getAlternativeEmulator();
std::string configuredLabel {(*it)->getAlternativeEmulator()};
std::string label;
if (configuredLabel == "") {
@ -57,7 +57,7 @@ GuiAlternativeEmulators::GuiAlternativeEmulators(Window* window)
}
}
bool invalidEntry = false;
bool invalidEntry {false};
if (label.empty()) {
label = ViewController::EXCLAMATION_CHAR + " INVALID ENTRY";

View file

@ -20,9 +20,9 @@
#include "views/ViewController.h"
GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::string title)
: GuiSettings(window, title)
, mAddedCustomCollection(false)
, mDeletedCustomCollection(false)
: GuiSettings {window, title}
, mAddedCustomCollection {false}
, mDeletedCustomCollection {false}
{
// Finish editing custom collection.
if (CollectionSystemsManager::getInstance()->isEditing()) {

View file

@ -22,11 +22,11 @@
GuiGamelistFilter::GuiGamelistFilter(Window* window,
SystemData* system,
std::function<void(bool)> filterChangedCallback)
: GuiComponent(window)
, mMenu(window, "FILTER GAMELIST")
, mSystem(system)
, mFiltersChangedCallback(filterChangedCallback)
, mFiltersChanged(false)
: GuiComponent {window}
, mMenu {window, "FILTER GAMELIST"}
, mSystem {system}
, mFiltersChangedCallback {filterChangedCallback}
, mFiltersChanged {false}
{
initializeMenu();
}

View file

@ -26,18 +26,18 @@
#include "views/gamelist/IGamelistView.h"
GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system)
: GuiComponent(window)
, mMenu(window, "OPTIONS")
, mSystem(system)
, mFiltersChanged(false)
, mCancelled(false)
, mIsCustomCollection(false)
, mIsCustomCollectionGroup(false)
, mCustomCollectionSystem(nullptr)
: GuiComponent {window}
, mMenu {window, "OPTIONS"}
, mSystem {system}
, mFiltersChanged {false}
, mCancelled {false}
, mIsCustomCollection {false}
, mIsCustomCollectionGroup {false}
, mCustomCollectionSystem {nullptr}
{
addChild(&mMenu);
FileData* file = getGamelist()->getCursor();
FileData* file {getGamelist()->getCursor()};
// Check if it's a placeholder, which would limit the menu entries presented.
file->isPlaceHolder();
mFromPlaceholder = file->isPlaceHolder();

View file

@ -15,11 +15,11 @@
#include "utils/StringUtil.h"
GuiLaunchScreen::GuiLaunchScreen()
: GuiComponent(Window::getInstance())
, mWindow(Window::getInstance())
, mBackground(mWindow, ":/graphics/frame.svg")
, mGrid(nullptr)
, mMarquee(nullptr)
: GuiComponent {Window::getInstance()}
, mWindow {Window::getInstance()}
, mBackground {mWindow, ":/graphics/frame.svg"}
, mGrid {nullptr}
, mMarquee {nullptr}
{
addChild(&mBackground);
mWindow->setLaunchScreen(this);

View file

@ -13,7 +13,7 @@
#include "components/SwitchComponent.h"
GuiMediaViewerOptions::GuiMediaViewerOptions(Window* window, const std::string& title)
: GuiSettings(window, title)
: GuiSettings {window, title}
{
// Keep videos running when viewing images.
auto keep_video_running = std::make_shared<SwitchComponent>(mWindow);

View file

@ -41,9 +41,9 @@
#include <algorithm>
GuiMenu::GuiMenu(Window* window)
: GuiComponent(window)
, mMenu(window, "MAIN MENU")
, mVersion(window)
: GuiComponent {window}
, mMenu {window, "MAIN MENU"}
, mVersion {window}
{
bool isFullUI = UIModeController::getInstance()->isUIModeFull();

View file

@ -14,10 +14,10 @@
#include "views/ViewController.h"
GuiOfflineGenerator::GuiOfflineGenerator(Window* window, const std::queue<FileData*>& gameQueue)
: GuiComponent(window)
, mGameQueue(gameQueue)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2 {6, 13})
: GuiComponent {window}
, mGameQueue {gameQueue}
, mBackground {window, ":/graphics/frame.svg"}
, mGrid {window, glm::ivec2 {6, 13}}
{
addChild(&mBackground);
addChild(&mGrid);

View file

@ -21,8 +21,8 @@
#include "views/ViewController.h"
GuiScraperMenu::GuiScraperMenu(Window* window, std::string title)
: GuiComponent(window)
, mMenu(window, title)
: GuiComponent {window}
, mMenu {window, title}
{
// Scraper service.
mScraper = std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(),

View file

@ -27,11 +27,11 @@
GuiScraperMulti::GuiScraperMulti(Window* window,
const std::queue<ScraperSearchParams>& searches,
bool approveResults)
: GuiComponent(window)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2 {2, 6})
, mSearchQueue(searches)
, mApproveResults(approveResults)
: GuiComponent {window}
, mBackground {window, ":/graphics/frame.svg"}
, mGrid {window, glm::ivec2 {2, 6}}
, mSearchQueue {searches}
, mApproveResults {approveResults}
{
assert(mSearchQueue.size());

View file

@ -38,14 +38,14 @@
#define FAILED_VERIFICATION_RETRIES 8
GuiScraperSearch::GuiScraperSearch(Window* window, SearchType type, unsigned int scrapeCount)
: GuiComponent(window)
, mGrid(window, glm::ivec2 {5, 3})
, mSearchType(type)
, mScrapeCount(scrapeCount)
, mRefinedSearch(false)
, mFoundGame(false)
, mScrapeRatings(false)
, mBusyAnim(window)
: GuiComponent {window}
, mGrid {window, glm::ivec2 {5, 3}}
, mSearchType {type}
, mScrapeCount {scrapeCount}
, mRefinedSearch {false}
, mFoundGame {false}
, mScrapeRatings {false}
, mBusyAnim {window}
{
addChild(&mGrid);

View file

@ -22,12 +22,12 @@ GuiScraperSingle::GuiScraperSingle(Window* window,
ScraperSearchParams& params,
std::function<void(const ScraperSearchResult&)> doneFunc,
bool& savedMediaAndAborted)
: GuiComponent(window)
, mClose(false)
, mGrid(window, glm::ivec2 {2, 6})
, mBox(window, ":/graphics/frame.svg")
, mSearchParams(params)
, mSavedMediaAndAborted(savedMediaAndAborted)
: GuiComponent {window}
, mClose {false}
, mGrid {window, glm::ivec2 {2, 6}}
, mBox {window, ":/graphics/frame.svg"}
, mSearchParams {params}
, mSavedMediaAndAborted {savedMediaAndAborted}
{
addChild(&mBox);
addChild(&mGrid);

View file

@ -16,8 +16,8 @@
#include "guis/GuiMsgBox.h"
GuiScreensaverOptions::GuiScreensaverOptions(Window* window, const std::string& title)
: GuiSettings(window, title)
, mWindow(window)
: GuiSettings {window, title}
, mWindow {window}
{
// Screensaver timer.
auto screensaver_timer = std::make_shared<SliderComponent>(mWindow, 0.0f, 30.0f, 1.0f, "m");

View file

@ -134,12 +134,12 @@ void thegamesdb_generate_json_scraper_requests(
std::vector<ScraperSearchResult>& results)
{
resources.prepare();
std::string path = "https://api.thegamesdb.net/v1";
bool usingGameID = false;
const std::string apiKey = std::string("apikey=") + resources.getApiKey();
std::string cleanName = params.nameOverride;
std::string path {"https://api.thegamesdb.net/v1"};
bool usingGameID {false};
const std::string apiKey {std::string("apikey=") + resources.getApiKey()};
std::string cleanName {params.nameOverride};
if (!cleanName.empty() && cleanName.substr(0, 3) == "id:") {
std::string gameID = cleanName.substr(3);
std::string gameID {cleanName.substr(3)};
path += "/Games/ByGameID?" + apiKey +
"&fields=players,publishers,genres,overview,last_updated,rating,"
"platform,coop,youtube,os,processor,ram,hdd,video,sound,alternates&id=" +

View file

@ -33,20 +33,20 @@ using namespace rapidjson;
namespace
{
constexpr char GamesDBAPIKey[] =
"445fcbc3f32bb2474bc27016b99eb963d318ee3a608212c543b9a79de1041600";
constexpr char GamesDBAPIKey[] {
"445fcbc3f32bb2474bc27016b99eb963d318ee3a608212c543b9a79de1041600"};
constexpr int MAX_WAIT_MS = 90000;
constexpr int POLL_TIME_MS = 500;
constexpr int MAX_WAIT_ITER = MAX_WAIT_MS / POLL_TIME_MS;
constexpr int MAX_WAIT_MS {90000};
constexpr int POLL_TIME_MS {500};
constexpr int MAX_WAIT_ITER {MAX_WAIT_MS / POLL_TIME_MS};
constexpr char SCRAPER_RESOURCES_DIR[] = "scrapers";
constexpr char DEVELOPERS_JSON_FILE[] = "gamesdb_developers.json";
constexpr char PUBLISHERS_JSON_FILE[] = "gamesdb_publishers.json";
constexpr char GENRES_JSON_FILE[] = "gamesdb_genres.json";
constexpr char DEVELOPERS_ENDPOINT[] = "/Developers";
constexpr char PUBLISHERS_ENDPOINT[] = "/Publishers";
constexpr char GENRES_ENDPOINT[] = "/Genres";
constexpr char SCRAPER_RESOURCES_DIR[] {"scrapers"};
constexpr char DEVELOPERS_JSON_FILE[] {"gamesdb_developers.json"};
constexpr char PUBLISHERS_JSON_FILE[] {"gamesdb_publishers.json"};
constexpr char GENRES_JSON_FILE[] {"gamesdb_genres.json"};
constexpr char DEVELOPERS_ENDPOINT[] {"/Developers"};
constexpr char PUBLISHERS_ENDPOINT[] {"/Publishers"};
constexpr char GENRES_ENDPOINT[] {"/Genres"};
std::string genFilePath(const std::string& file_name)
{

View file

@ -27,11 +27,11 @@ const int logoBuffersLeft[] = {-5, -2, -1};
const int logoBuffersRight[] = {1, 2, 5};
SystemView::SystemView(Window* window)
: IList<SystemViewData, SystemData*>(window, LIST_SCROLL_STYLE_SLOW, LIST_ALWAYS_LOOP)
, mSystemInfo(window, "SYSTEM INFO", Font::get(FONT_SIZE_SMALL), 0x33333300, ALIGN_CENTER)
, mPreviousScrollVelocity(0)
, mUpdatedGameCount(false)
, mViewNeedsReload(true)
: IList<SystemViewData, SystemData*> {window, LIST_SCROLL_STYLE_SLOW, LIST_ALWAYS_LOOP}
, mSystemInfo {window, "SYSTEM INFO", Font::get(FONT_SIZE_SMALL), 0x33333300, ALIGN_CENTER}
, mPreviousScrollVelocity {0}
, mUpdatedGameCount {false}
, mViewNeedsReload {true}
{
mCamOffset = 0;
mExtrasCamOffset = 0;
@ -91,9 +91,9 @@ void SystemView::populate()
// No logo available? Make placeholder.
if (!e.data.logo) {
glm::vec2 resolution = glm::vec2 {static_cast<float>(Renderer::getScreenWidth()),
static_cast<float>(Renderer::getScreenHeight())};
glm::vec3 center = {resolution.x / 2.0f, resolution.y / 2.0f, 1.0f};
glm::vec2 resolution {static_cast<float>(Renderer::getScreenWidth()),
static_cast<float>(Renderer::getScreenHeight())};
glm::vec3 center {resolution.x / 2.0f, resolution.y / 2.0f, 1.0f};
// Placeholder Image.
logoElem = theme->getElement("system", "logoPlaceholderImage", "image");

View file

@ -17,7 +17,7 @@
#include "views/ViewController.h"
UIModeController::UIModeController() noexcept
: mPassKeyCounter(0)
: mPassKeyCounter {0}
{
mPassKeySequence = Settings::getInstance()->getString("UIMode_passkey");
mCurrentUIMode = Settings::getInstance()->getString("UIMode");

View file

@ -33,28 +33,6 @@
#include "views/gamelist/IGamelistView.h"
#include "views/gamelist/VideoGamelistView.h"
#if defined(_MSC_VER) // MSVC compiler.
const std::string ViewController::CONTROLLER_CHAR = Utils::String::wideStringToString(L"\uf11b");
const std::string ViewController::CROSSEDCIRCLE_CHAR = Utils::String::wideStringToString(L"\uf05e");
const std::string ViewController::EXCLAMATION_CHAR = Utils::String::wideStringToString(L"\uf06a");
const std::string ViewController::FAVORITE_CHAR = Utils::String::wideStringToString(L"\uf005");
const std::string ViewController::FILTER_CHAR = Utils::String::wideStringToString(L"\uf0b0");
const std::string ViewController::FOLDER_CHAR = Utils::String::wideStringToString(L"\uf07C");
const std::string ViewController::GEAR_CHAR = Utils::String::wideStringToString(L"\uf013");
const std::string ViewController::KEYBOARD_CHAR = Utils::String::wideStringToString(L"\uf11c");
const std::string ViewController::TICKMARK_CHAR = Utils::String::wideStringToString(L"\uf14A");
#else
const std::string ViewController::CONTROLLER_CHAR = "\uf11b";
const std::string ViewController::CROSSEDCIRCLE_CHAR = "\uf05e";
const std::string ViewController::EXCLAMATION_CHAR = "\uf06a";
const std::string ViewController::FAVORITE_CHAR = "\uf005";
const std::string ViewController::FILTER_CHAR = "\uf0b0";
const std::string ViewController::FOLDER_CHAR = "\uf07C";
const std::string ViewController::GEAR_CHAR = "\uf013";
const std::string ViewController::KEYBOARD_CHAR = "\uf11c";
const std::string ViewController::TICKMARK_CHAR = "\uf14a";
#endif
ViewController* ViewController::getInstance()
{
static ViewController instance;
@ -62,19 +40,19 @@ ViewController* ViewController::getInstance()
}
ViewController::ViewController() noexcept
: GuiComponent(Window::getInstance())
, mNoGamesMessageBox(nullptr)
, mCurrentView(nullptr)
, mPreviousView(nullptr)
, mSkipView(nullptr)
, mGameToLaunch(nullptr)
, mCamera(Renderer::getIdentity())
, mSystemViewTransition(false)
, mWrappedViews(false)
, mFadeOpacity(0)
, mCancelledTransition(false)
, mLockInput(false)
, mNextSystem(false)
: GuiComponent {Window::getInstance()}
, mNoGamesMessageBox {nullptr}
, mCurrentView {nullptr}
, mPreviousView {nullptr}
, mSkipView {nullptr}
, mGameToLaunch {nullptr}
, mCamera {Renderer::getIdentity()}
, mSystemViewTransition {false}
, mWrappedViews {false}
, mFadeOpacity {0}
, mCancelledTransition {false}
, mLockInput {false}
, mNextSystem {false}
{
mState.viewing = NOTHING;
mState.viewstyle = AUTOMATIC;

View file

@ -17,6 +17,7 @@
#include "GuiComponent.h"
#include "guis/GuiMsgBox.h"
#include "renderers/Renderer.h"
#include "utils/StringUtil.h"
#include <vector>
@ -117,15 +118,28 @@ public:
void removeGamelistView(SystemData* system);
// Font Awesome symbols.
static const std::string CONTROLLER_CHAR;
static const std::string CROSSEDCIRCLE_CHAR;
static const std::string EXCLAMATION_CHAR;
static const std::string FAVORITE_CHAR;
static const std::string FILTER_CHAR;
static const std::string FOLDER_CHAR;
static const std::string GEAR_CHAR;
static const std::string KEYBOARD_CHAR;
static const std::string TICKMARK_CHAR;
#if defined(_MSC_VER) // MSVC compiler.
inline static const std::string CONTROLLER_CHAR {Utils::String::wideStringToString(L"\uf11b")};
inline static const std::string CROSSEDCIRCLE_CHAR {
Utils::String::wideStringToString(L"\uf05e")};
inline static const std::string EXCLAMATION_CHAR {Utils::String::wideStringToString(L"\uf06a")};
inline static const std::string FAVORITE_CHAR {Utils::String::wideStringToString(L"\uf005")};
inline static const std::string FILTER_CHAR {Utils::String::wideStringToString(L"\uf0b0")};
inline static const std::string FOLDER_CHAR {Utils::String::wideStringToString(L"\uf07C")};
inline static const std::string GEAR_CHAR {Utils::String::wideStringToString(L"\uf013")};
inline static const std::string KEYBOARD_CHAR {Utils::String::wideStringToString(L"\uf11c")};
inline static const std::string TICKMARK_CHAR {Utils::String::wideStringToString(L"\uf14A")};
#else
inline static const std::string CONTROLLER_CHAR {"\uf11b"};
inline static const std::string CROSSEDCIRCLE_CHAR {"\uf05e"};
inline static const std::string EXCLAMATION_CHAR {"\uf06a"};
inline static const std::string FAVORITE_CHAR {"\uf005"};
inline static const std::string FILTER_CHAR {"\uf0b0"};
inline static const std::string FOLDER_CHAR {"\uf07C"};
inline static const std::string GEAR_CHAR {"\uf013"};
inline static const std::string KEYBOARD_CHAR {"\uf11c"};
inline static const std::string TICKMARK_CHAR {"\uf14a"};
#endif
private:
ViewController() noexcept;

View file

@ -16,8 +16,8 @@
#include "views/ViewController.h"
BasicGamelistView::BasicGamelistView(Window* window, FileData* root)
: ISimpleGamelistView(window, root)
, mList(window)
: ISimpleGamelistView {window, root}
, mList {window}
{
mList.setSize(mSize.x, mSize.y * 0.8f);
mList.setPosition(0.0f, mSize.y * 0.2f);

View file

@ -15,8 +15,8 @@
#include "views/ViewController.h"
IGamelistView::IGamelistView(Window* window, FileData* root)
: GuiComponent(window)
, mRoot(root)
: GuiComponent {window}
, mRoot {root}
{
setSize(static_cast<float>(Renderer::getScreenWidth()),
static_cast<float>(Renderer::getScreenHeight()));

View file

@ -21,11 +21,11 @@
#include "Log.h"
ISimpleGamelistView::ISimpleGamelistView(Window* window, FileData* root)
: IGamelistView(window, root)
, mHeaderText(window)
, mHeaderImage(window)
, mBackground(window)
, mRandomGame(nullptr)
: IGamelistView {window, root}
, mHeaderText {window}
, mHeaderImage {window}
, mBackground {window}
, mRandomGame {nullptr}
{
mHeaderText.setText("Logo Text", false);
mHeaderText.setSize(mSize.x, 0.0f);

View file

@ -17,21 +17,21 @@
#include <algorithm>
GuiComponent::GuiComponent(Window* window)
: mWindow(window)
, mParent(nullptr)
, mOpacity(255)
, mColor(0)
, mSaturation(1.0f)
, mColorShift(0)
, mColorShiftEnd(0)
, mPosition({})
, mOrigin({})
, mRotationOrigin(0.5f, 0.5f)
, mSize({})
, mIsProcessing(false)
, mVisible(true)
, mEnabled(true)
, mTransform(Renderer::getIdentity())
: mWindow {window}
, mParent {nullptr}
, mOpacity {255}
, mColor {0}
, mSaturation {1.0f}
, mColorShift {0}
, mColorShiftEnd {0}
, mPosition {0.0f, 0.0f, 0.0f}
, mOrigin {0.0f, 0.0f}
, mRotationOrigin {0.5f, 0.5f}
, mSize {0.0f, 0.0f}
, mIsProcessing {false}
, mVisible {true}
, mEnabled {true}
, mTransform {Renderer::getIdentity()}
{
for (unsigned char i = 0; i < MAX_ANIMATIONS; ++i)
mAnimationMap[i] = nullptr;

View file

@ -21,7 +21,7 @@ std::vector<unsigned char> ImageIO::loadFromMemoryRGBA32(const unsigned char* da
std::vector<unsigned char> rawData;
width = 0;
height = 0;
FIMEMORY* fiMemory = FreeImage_OpenMemory(const_cast<BYTE*>(data), static_cast<DWORD>(size));
FIMEMORY* fiMemory {FreeImage_OpenMemory(const_cast<BYTE*>(data), static_cast<DWORD>(size))};
if (fiMemory != nullptr) {
// Detect the filetype from data.

View file

@ -13,9 +13,9 @@
#include <pugixml.hpp>
InputConfig::InputConfig(int deviceId, const std::string& deviceName, const std::string& deviceGUID)
: mDeviceId(deviceId)
, mDeviceName(deviceName)
, mDeviceGUID(deviceGUID)
: mDeviceId {deviceId}
, mDeviceName {deviceName}
, mDeviceGUID {deviceGUID}
{
}

View file

@ -28,7 +28,7 @@ void Log::open()
std::ostringstream& Log::get(LogLevel level)
{
time_t t = time(nullptr);
time_t t {time(nullptr)};
struct tm tm;
#if defined(_WIN64)
// Of course Windows does not follow standards and puts the parameters the other way

View file

@ -23,7 +23,7 @@ std::shared_ptr<Sound> Sound::get(const std::string& path)
if (it != sMap.cend())
return it->second;
std::shared_ptr<Sound> sound = std::shared_ptr<Sound>(new Sound(path));
std::shared_ptr<Sound> sound {std::shared_ptr<Sound>(new Sound(path))};
AudioManager::getInstance().registerSound(sound);
sMap[path] = sound;
return sound;

View file

@ -25,31 +25,31 @@
#endif
Window::Window() noexcept
: mScreensaver(nullptr)
, mMediaViewer(nullptr)
, mLaunchScreen(nullptr)
, mInfoPopup(nullptr)
, mListScrollOpacity(0)
, mFrameTimeElapsed(0)
, mFrameCountElapsed(0)
, mAverageDeltaTime(10)
, mTimeSinceLastInput(0)
, mNormalizeNextUpdate(false)
, mAllowSleep(true)
, mSleeping(false)
, mRenderScreensaver(false)
, mRenderMediaViewer(false)
, mRenderLaunchScreen(false)
, mGameLaunchedState(false)
, mAllowTextScrolling(true)
, mAllowFileAnimation(true)
, mCachedBackground(false)
, mInvalidatedCachedBackground(false)
: mScreensaver {nullptr}
, mMediaViewer {nullptr}
, mLaunchScreen {nullptr}
, mInfoPopup {nullptr}
, mListScrollOpacity {0}
, mFrameTimeElapsed {0}
, mFrameCountElapsed {0}
, mAverageDeltaTime {10}
, mTimeSinceLastInput {0}
, mNormalizeNextUpdate {false}
, mAllowSleep {true}
, mSleeping {false}
, mRenderScreensaver {false}
, mRenderMediaViewer {false}
, mRenderLaunchScreen {false}
, mGameLaunchedState {false}
, mAllowTextScrolling {true}
, mAllowFileAnimation {true}
, mCachedBackground {false}
, mInvalidatedCachedBackground {false}
, mInitiateCacheTimer {false}
, mInvalidateCacheTimer {0}
, mVideoPlayerCount(0)
, mTopScale(0.5)
, mChangedThemeSet(false)
, mVideoPlayerCount {0}
, mTopScale {0.5f}
, mChangedThemeSet {false}
{
}

View file

@ -14,11 +14,11 @@ AnimationController::AnimationController(Animation* anim,
int delay,
std::function<void()> finishedCallback,
bool reverse)
: mAnimation(anim)
, mFinishedCallback(finishedCallback)
, mReverse(reverse)
, mTime(-delay)
, mDelay(delay)
: mAnimation {anim}
, mFinishedCallback {finishedCallback}
, mReverse {reverse}
, mTime {-delay}
, mDelay {delay}
{
}

View file

@ -13,8 +13,8 @@
#include "resources/ResourceManager.h"
AnimatedImageComponent::AnimatedImageComponent(Window* window)
: GuiComponent(window)
, mEnabled(false)
: GuiComponent {window}
, mEnabled {false}
{
}

View file

@ -24,7 +24,7 @@ namespace
{
// clang-format off
// The "unknown" controller entry has to be placed last.
GameControllers sControllerDefinitions [] = {
GameControllers sControllerDefinitions [] {
// shortName displayName fileName
{"gamepad_generic", "Gamepad (Generic)", ":/graphics/controllers/gamepad_generic.svg"},
{"gamepad_nintendo_nes", "Gamepad (Nintendo NES)", ":/graphics/controllers/gamepad_nintendo_nes.svg"},

View file

@ -13,7 +13,7 @@
#include "components/TextComponent.h"
// Animation definition.
AnimationFrame BUSY_ANIMATION_FRAMES[] = {
AnimationFrame BUSY_ANIMATION_FRAMES[] {
{":/graphics/busy_0.svg", 300},
{":/graphics/busy_1.svg", 300},
{":/graphics/busy_2.svg", 300},
@ -23,9 +23,9 @@ AnimationFrame BUSY_ANIMATION_FRAMES[] = {
const AnimationDef BUSY_ANIMATION_DEF = {BUSY_ANIMATION_FRAMES, 4, true};
BusyComponent::BusyComponent(Window* window)
: GuiComponent(window)
, mBackground(window, ":/graphics/frame.png")
, mGrid(window, glm::ivec2 {5, 3})
: GuiComponent {window}
, mBackground {window, ":/graphics/frame.png"}
, mGrid {window, glm::ivec2 {5, 3}}
{
mAnimation = std::make_shared<AnimatedImageComponent>(mWindow);
mAnimation->load(&BUSY_ANIMATION_DEF);

View file

@ -21,7 +21,7 @@ ButtonComponent::ButtonComponent(Window* window,
: GuiComponent {window}
, mBox {window, ":/graphics/button.svg"}
, mFont {Font::get(FONT_SIZE_MEDIUM)}
, mPadding {{}}
, mPadding {0.0f, 0.0f, 0.0f, 0.0f}
, mFocused {false}
, mEnabled {true}
, mFlatStyle {flatStyle}

View file

@ -13,9 +13,9 @@
using namespace GridFlags;
ComponentGrid::ComponentGrid(Window* window, const glm::ivec2& gridDimensions)
: GuiComponent(window)
, mGridSize(gridDimensions)
, mCursor(0, 0)
: GuiComponent {window}
, mGridSize {gridDimensions}
, mCursor {0, 0}
{
assert(gridDimensions.x > 0 && gridDimensions.y > 0);
@ -44,8 +44,8 @@ float ComponentGrid::getColWidth(int col)
return mColWidths[col] * mSize.x;
// Calculate automatic width.
float freeWidthPerc = 1;
int between = 0;
float freeWidthPerc {1.0};
int between {0};
for (int x = 0; x < mGridSize.x; ++x) {
freeWidthPerc -= mColWidths[x]; // If it's 0 it won't do anything.
if (mColWidths[x] == 0)

View file

@ -15,8 +15,8 @@
#include "utils/StringUtil.h"
DateTimeComponent::DateTimeComponent(Window* window)
: TextComponent(window)
, mDisplayRelative(false)
: TextComponent {window}
, mDisplayRelative {false}
{
// ISO 8601 date format.
setFormat("%Y-%m-%d");
@ -30,8 +30,8 @@ DateTimeComponent::DateTimeComponent(Window* window,
glm::vec3 pos,
glm::vec2 size,
unsigned int bgcolor)
: TextComponent(window, text, font, color, align, pos, size, bgcolor)
, mDisplayRelative(false)
: TextComponent {window, text, font, color, align, pos, size, bgcolor}
, mDisplayRelative {false}
{
// ISO 8601 date format.
setFormat("%Y-%m-%d");

View file

@ -21,7 +21,7 @@
FlexboxComponent::FlexboxComponent(Window* window, std::vector<FlexboxItem>& items)
: GuiComponent {window}
, mItems(items)
, mItems {items}
, mDirection {DEFAULT_DIRECTION}
, mAlignment {DEFAULT_ALIGNMENT}
, mLines {DEFAULT_LINES}

View file

@ -13,8 +13,8 @@
#include "resources/TextureResource.h"
GridTileComponent::GridTileComponent(Window* window)
: GuiComponent(window)
, mBackground(window, ":/graphics/frame.png")
: GuiComponent {window}
, mBackground {window, ":/graphics/frame.png"}
{
mDefaultProperties.mSize = getDefaultTileSize();
mDefaultProperties.mPadding = glm::vec2 {16.0f * Renderer::getScreenWidthModifier(),

View file

@ -20,7 +20,7 @@
static std::map<std::string, std::string> sIconPathMap {};
HelpComponent::HelpComponent(Window* window)
: GuiComponent(window)
: GuiComponent {window}
{
assignIcons();
}

View file

@ -86,10 +86,10 @@ public:
IList(Window* window,
const ScrollTierList& tierList = LIST_SCROLL_STYLE_QUICK,
const ListLoopType& loopType = LIST_PAUSE_AT_END)
: GuiComponent(window)
, mTierList(tierList)
, mLoopType(loopType)
, mWindow(window)
: GuiComponent {window}
, mTierList {tierList}
, mLoopType {loopType}
, mWindow {window}
{
mCursor = 0;
mScrollTier = 0;

View file

@ -29,22 +29,22 @@ glm::vec2 ImageComponent::getSize() const
}
ImageComponent::ImageComponent(Window* window, bool forceLoad, bool dynamic)
: GuiComponent(window)
, mTargetSize({})
, mFlipX(false)
, mFlipY(false)
, mTargetIsMax(false)
, mTargetIsMin(false)
, mColorShift(0xFFFFFFFF)
, mColorShiftEnd(0xFFFFFFFF)
, mColorGradientHorizontal(true)
, mFadeOpacity(0)
, mFading(false)
, mForceLoad(forceLoad)
, mDynamic(dynamic)
, mRotateByTargetSize(false)
, mTopLeftCrop({})
, mBottomRightCrop(1.0f, 1.0f)
: GuiComponent {window}
, mTargetSize {0, 0}
, mFlipX {false}
, mFlipY {false}
, mTargetIsMax {false}
, mTargetIsMin {false}
, mColorShift {0xFFFFFFFF}
, mColorShiftEnd {0xFFFFFFFF}
, mColorGradientHorizontal {true}
, mFadeOpacity {0}
, mFading {false}
, mForceLoad {forceLoad}
, mDynamic {dynamic}
, mRotateByTargetSize {false}
, mTopLeftCrop {0.0f, 0.0f}
, mBottomRightCrop {1.0f, 1.0f}
{
updateColors();
}

View file

@ -20,10 +20,10 @@
MenuComponent::MenuComponent(Window* window,
std::string title,
const std::shared_ptr<Font>& titleFont)
: GuiComponent(window)
, mBackground(window)
, mGrid(window, glm::ivec2 {2, 4})
, mNeedsSaving(false)
: GuiComponent {window}
, mBackground {window}
, mGrid {window, glm::ivec2 {2, 4}}
, mNeedsSaving {false}
{
addChild(&mBackground);
addChild(&mGrid);

View file

@ -37,8 +37,8 @@ NinePatchComponent::~NinePatchComponent()
void NinePatchComponent::updateColors()
{
const unsigned int edgeColor = Renderer::convertRGBAToABGR(mEdgeColor);
const unsigned int centerColor = Renderer::convertRGBAToABGR(mCenterColor);
const unsigned int edgeColor {Renderer::convertRGBAToABGR(mEdgeColor)};
const unsigned int centerColor {Renderer::convertRGBAToABGR(mCenterColor)};
for (int i = 0; i < 6 * 9; ++i)
mVertices[i].col = edgeColor;

View file

@ -14,13 +14,13 @@
#include "resources/TextureResource.h"
RatingComponent::RatingComponent(Window* window, bool colorizeChanges)
: GuiComponent(window)
, mColorOriginalValue(DEFAULT_COLORSHIFT)
, mColorChangedValue(DEFAULT_COLORSHIFT)
, mColorShift(DEFAULT_COLORSHIFT)
, mColorShiftEnd(DEFAULT_COLORSHIFT)
, mUnfilledColor(DEFAULT_COLORSHIFT)
, mColorizeChanges(colorizeChanges)
: GuiComponent {window}
, mColorOriginalValue {DEFAULT_COLORSHIFT}
, mColorChangedValue {DEFAULT_COLORSHIFT}
, mColorShift {DEFAULT_COLORSHIFT}
, mColorShiftEnd {DEFAULT_COLORSHIFT}
, mUnfilledColor {DEFAULT_COLORSHIFT}
, mColorizeChanges {colorizeChanges}
{
mFilledTexture = TextureResource::get(":/graphics/star_filled.svg", true);
mUnfilledTexture = TextureResource::get(":/graphics/star_unfilled.svg", true);

View file

@ -20,7 +20,7 @@ public:
ScrollIndicatorComponent(std::shared_ptr<ComponentList> componentList,
std::shared_ptr<ImageComponent> scrollUp,
std::shared_ptr<ImageComponent> scrollDown)
: mPreviousScrollState(ComponentList::SCROLL_NONE)
: mPreviousScrollState {ComponentList::SCROLL_NONE}
{
assert(componentList != nullptr && scrollUp != nullptr && scrollDown != nullptr);

View file

@ -11,12 +11,12 @@
#include "resources/Font.h"
SwitchComponent::SwitchComponent(Window* window, bool state)
: GuiComponent(window)
, mImage(window)
, mState(state)
, mOriginalValue(state)
, mColorOriginalValue(DEFAULT_COLORSHIFT)
, mColorChangedValue(DEFAULT_COLORSHIFT)
: GuiComponent {window}
, mImage {window}
, mState {state}
, mOriginalValue {state}
, mColorOriginalValue {DEFAULT_COLORSHIFT}
, mColorChangedValue {DEFAULT_COLORSHIFT}
{
mImage.setImage(":/graphics/off.svg");
mImage.setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight());

View file

@ -19,27 +19,27 @@
#define MEDIA_VIEWER_FADE_IN_TIME 600
VideoComponent::VideoComponent(Window* window)
: GuiComponent(window)
, mWindow(window)
, mStaticImage(window)
, mVideoWidth(0)
, mVideoHeight(0)
, mTargetSize(0, 0)
, mVideoAreaPos(0, 0)
, mVideoAreaSize(0, 0)
, mStartDelayed(false)
, mIsPlaying(false)
, mIsActuallyPlaying(false)
, mPause(false)
, mShowing(false)
, mDisable(false)
, mMediaViewerMode(false)
, mScreensaverActive(false)
, mScreensaverMode(false)
, mGameLaunched(false)
, mBlockPlayer(false)
, mTargetIsMax(false)
, mFadeIn(1.0)
: GuiComponent {window}
, mWindow {window}
, mStaticImage {window}
, mVideoWidth {0}
, mVideoHeight {0}
, mTargetSize {0.0f, 0.0f}
, mVideoAreaPos {0.0f, 0.0f}
, mVideoAreaSize {0.0f, 0.0f}
, mStartDelayed {false}
, mIsPlaying {false}
, mIsActuallyPlaying {false}
, mPause {false}
, mShowing {false}
, mDisable {false}
, mMediaViewerMode {false}
, mScreensaverActive {false}
, mScreensaverMode {false}
, mGameLaunched {false}
, mBlockPlayer {false}
, mTargetIsMax {false}
, mFadeIn {1.0f}
{
// Setup the default configuration.
mConfig.showSnapshotDelay = false;

View file

@ -24,34 +24,34 @@ std::vector<std::string> VideoFFmpegComponent::sHWDecodedVideos;
std::vector<std::string> VideoFFmpegComponent::sSWDecodedVideos;
VideoFFmpegComponent::VideoFFmpegComponent(Window* window)
: VideoComponent(window)
, mFrameProcessingThread(nullptr)
, mFormatContext(nullptr)
, mVideoStream(nullptr)
, mAudioStream(nullptr)
, mVideoCodec(nullptr)
, mAudioCodec(nullptr)
, mHardwareCodec(nullptr)
, mHwContext(nullptr)
, mVideoCodecContext(nullptr)
, mAudioCodecContext(nullptr)
, mVBufferSrcContext(nullptr)
, mVBufferSinkContext(nullptr)
, mVFilterGraph(nullptr)
, mVFilterInputs(nullptr)
, mVFilterOutputs(nullptr)
, mABufferSrcContext(nullptr)
, mABufferSinkContext(nullptr)
, mAFilterGraph(nullptr)
, mAFilterInputs(nullptr)
, mAFilterOutputs(nullptr)
, mVideoTargetQueueSize(0)
, mAudioTargetQueueSize(0)
, mVideoTimeBase(0.0l)
, mAccumulatedTime(0)
, mStartTimeAccumulation(false)
, mDecodedFrame(false)
, mEndOfVideo(false)
: VideoComponent {window}
, mFrameProcessingThread {nullptr}
, mFormatContext {nullptr}
, mVideoStream {nullptr}
, mAudioStream {nullptr}
, mVideoCodec {nullptr}
, mAudioCodec {nullptr}
, mHardwareCodec {nullptr}
, mHwContext {nullptr}
, mVideoCodecContext {nullptr}
, mAudioCodecContext {nullptr}
, mVBufferSrcContext {nullptr}
, mVBufferSinkContext {nullptr}
, mVFilterGraph {nullptr}
, mVFilterInputs {nullptr}
, mVFilterOutputs {nullptr}
, mABufferSrcContext {nullptr}
, mABufferSinkContext {nullptr}
, mAFilterGraph {nullptr}
, mAFilterInputs {nullptr}
, mAFilterOutputs {nullptr}
, mVideoTargetQueueSize {0}
, mAudioTargetQueueSize {0}
, mVideoTimeBase {0.0l}
, mAccumulatedTime {0.0l}
, mStartTimeAccumulation {false}
, mDecodedFrame {false}
, mEndOfVideo {false}
{
}

View file

@ -21,11 +21,11 @@ GuiDetectDevice::GuiDetectDevice(Window* window,
bool firstRun,
bool forcedConfig,
const std::function<void()>& doneCallback)
: GuiComponent(window)
, mFirstRun(firstRun)
, mForcedConfig(forcedConfig)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2 {1, 5})
: GuiComponent {window}
, mFirstRun {firstRun}
, mForcedConfig {forcedConfig}
, mBackground {window, ":/graphics/frame.svg"}
, mGrid {window, glm::ivec2 {1, 5}}
{
mHoldingConfig = nullptr;
mHoldTime = 0;
@ -43,7 +43,7 @@ GuiDetectDevice::GuiDetectDevice(Window* window,
// Device info.
std::stringstream deviceInfo;
int numDevices = InputManager::getInstance().getNumJoysticks();
int numDevices {InputManager::getInstance().getNumJoysticks()};
if (numDevices > 0)
deviceInfo << numDevices << " GAMEPAD" << (numDevices > 1 ? "S" : "") << " DETECTED";

View file

@ -15,17 +15,17 @@
#include <SDL2/SDL_timer.h>
GuiInfoPopup::GuiInfoPopup(Window* window, std::string message, int duration)
: GuiComponent(window)
, mMessage(message)
, mDuration(duration)
, mRunning(true)
: GuiComponent {window}
, mMessage {message}
, mDuration {duration}
, mRunning {true}
{
mFrame = new NinePatchComponent(window);
float maxWidth = Renderer::getScreenWidth() * 0.9f;
float maxHeight = Renderer::getScreenHeight() * 0.2f;
float maxWidth {Renderer::getScreenWidth() * 0.9f};
float maxHeight {Renderer::getScreenHeight() * 0.2f};
std::shared_ptr<TextComponent> s = std::make_shared<TextComponent>(
mWindow, "", Font::get(FONT_SIZE_MINI), 0x444444FF, ALIGN_CENTER);
std::shared_ptr<TextComponent> s {std::make_shared<TextComponent>(
mWindow, "", Font::get(FONT_SIZE_MINI), 0x444444FF, ALIGN_CENTER)};
// We do this to force the text container to resize and return the actual expected popup size.
s->setSize(0.0f, 0.0f);

View file

@ -31,11 +31,11 @@ GuiInputConfig::GuiInputConfig(Window* window,
InputConfig* target,
bool reconfigureAll,
const std::function<void()>& okCallback)
: GuiComponent(window)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2 {1, 7})
, mTargetConfig(target)
, mHoldingInput(false)
: GuiComponent {window}
, mBackground {window, ":/graphics/frame.svg"}
, mGrid {window, glm::ivec2 {1, 7}}
, mTargetConfig {target}
, mHoldingInput {false}
{
// Populate the configuration list with the text and icons applicable to the
// configured controller type.

View file

@ -26,21 +26,21 @@ GuiMsgBox::GuiMsgBox(Window* window,
const std::function<void()>& func3,
bool disableBackButton,
bool deleteOnButtonPress)
: GuiComponent(window)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2 {1, 2})
, mHelpStyle(helpstyle)
, mDisableBackButton(disableBackButton)
, mDeleteOnButtonPress(deleteOnButtonPress)
: GuiComponent {window}
, mBackground {window, ":/graphics/frame.svg"}
, mGrid {window, glm::ivec2 {1, 2}}
, mHelpStyle {helpstyle}
, mDisableBackButton {disableBackButton}
, mDeleteOnButtonPress {deleteOnButtonPress}
{
// Adjust the width relative to the aspect ratio of the screen to make the GUI look coherent
// regardless of screen type. The 1.778 aspect ratio value is the 16:9 reference.
float aspectValue = 1.778f / Renderer::getScreenAspectRatio();
float aspectValue {1.778f / Renderer::getScreenAspectRatio()};
float width =
floorf(glm::clamp(0.60f * aspectValue, 0.60f, 0.80f) * Renderer::getScreenWidth());
float minWidth =
floorf(glm::clamp(0.30f * aspectValue, 0.10f, 0.50f) * Renderer::getScreenWidth());
float width {
floorf(glm::clamp(0.60f * aspectValue, 0.60f, 0.80f) * Renderer::getScreenWidth())};
float minWidth {
floorf(glm::clamp(0.30f * aspectValue, 0.10f, 0.50f) * Renderer::getScreenWidth())};
mMsg = std::make_shared<TextComponent>(mWindow, text, Font::get(FONT_SIZE_MEDIUM), 0x777777FF,
ALIGN_CENTER);

View file

@ -39,7 +39,7 @@
#include "utils/StringUtil.h"
// clang-format off
std::vector<std::vector<const char*>> kbBaseUS{
std::vector<std::vector<const char*>> kbBaseUS {
{"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "DEL"},
{"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "DEL"},
{"¡", "²", "³", "¤", "", "¼", "½", "¾", "", "", "¥", "×", "DEL"},
@ -60,13 +60,13 @@ std::vector<std::vector<const char*>> kbBaseUS{
{"", "æ", "", "©", "", "", "ñ", "µ", "ç", "", "¿", "ALT", "-colspan-"},
{"", "Æ", "", "¢", "", "", "Ñ", "Μ", "Ç", "", "", "ALT", "-colspan-"}};
std::vector<std::vector<const char*>> kbLastRowNormal{
std::vector<std::vector<const char*>> kbLastRowNormal {
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}};
std::vector<std::vector<const char*>> kbLastRowLoad{
std::vector<std::vector<const char*>> kbLastRowLoad {
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},

View file

@ -24,50 +24,50 @@
namespace Renderer
{
static std::stack<Rect> clipStack;
static SDL_Window* sdlWindow = nullptr;
static glm::mat4 mProjectionMatrix;
static int windowWidth = 0;
static int windowHeight = 0;
static int screenWidth = 0;
static int screenHeight = 0;
static int screenOffsetX = 0;
static int screenOffsetY = 0;
static int screenRotate = 0;
static bool initialCursorState = 1;
static SDL_Window* sdlWindow {nullptr};
static glm::mat4 mProjectionMatrix {};
static int windowWidth {0};
static int windowHeight {0};
static int screenWidth {0};
static int screenHeight {0};
static int screenOffsetX {0};
static int screenOffsetY {0};
static int screenRotate {0};
static bool initialCursorState {1};
// Screen resolution modifiers relative to the 1920x1080 reference.
static float screenHeightModifier;
static float screenWidthModifier;
static float screenAspectRatio;
static float screenHeightModifier {0.0f};
static float screenWidthModifier {0.0f};
static float screenAspectRatio {0.0f};
static void setIcon()
{
size_t width = 0;
size_t height = 0;
ResourceData resData =
ResourceManager::getInstance().getFileData(":/graphics/window_icon_256.png");
std::vector<unsigned char> rawData =
ImageIO::loadFromMemoryRGBA32(resData.ptr.get(), resData.length, width, height);
size_t width {0};
size_t height {0};
ResourceData resData {
ResourceManager::getInstance().getFileData(":/graphics/window_icon_256.png")};
std::vector<unsigned char> rawData {
ImageIO::loadFromMemoryRGBA32(resData.ptr.get(), resData.length, width, height)};
if (!rawData.empty()) {
ImageIO::flipPixelsVert(rawData.data(), width, height);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
unsigned int rmask = 0xFF000000;
unsigned int gmask = 0x00FF0000;
unsigned int bmask = 0x0000FF00;
unsigned int amask = 0x000000FF;
unsigned int rmask {0xFF000000};
unsigned int gmask {0x00FF0000};
unsigned int bmask {0x0000FF00};
unsigned int amask {0x000000FF};
#else
unsigned int rmask = 0x000000FF;
unsigned int gmask = 0x0000FF00;
unsigned int bmask = 0x00FF0000;
unsigned int amask = 0xFF000000;
unsigned int rmask {0x000000FF};
unsigned int gmask {0x0000FF00};
unsigned int bmask {0x00FF0000};
unsigned int amask {0xFF000000};
#endif
// Try creating SDL surface from logo data.
SDL_Surface* logoSurface =
SDL_CreateRGBSurfaceFrom(static_cast<void*>(rawData.data()),
static_cast<int>(width), static_cast<int>(height), 32,
static_cast<int>((width * 4)), rmask, gmask, bmask, amask);
SDL_Surface* logoSurface {SDL_CreateRGBSurfaceFrom(
static_cast<void*>(rawData.data()), static_cast<int>(width),
static_cast<int>(height), 32, static_cast<int>((width * 4)), rmask, gmask, bmask,
amask)};
if (logoSurface != nullptr) {
SDL_SetWindowIcon(sdlWindow, logoSurface);
@ -87,7 +87,7 @@ namespace Renderer
initialCursorState = (SDL_ShowCursor(0) != 0);
int displayIndex = Settings::getInstance()->getInt("DisplayIndex");
int displayIndex {Settings::getInstance()->getInt("DisplayIndex")};
// Check that an invalid value has not been manually entered in the es_settings.xml file.
if (displayIndex != 1 && displayIndex != 2 && displayIndex != 3 && displayIndex != 4) {
Settings::getInstance()->setInt("DisplayIndex", 1);

View file

@ -17,14 +17,14 @@
namespace Renderer
{
Renderer::Shader::Shader()
: mProgramID(-1)
, shaderMVPMatrix(-1)
, shaderTextureSize(-1)
, shaderTextureCoord(-1)
, shaderColor(-1)
, shaderSaturation(-1)
, shaderOpacity(-1)
, shaderDimValue(-1)
: mProgramID {0}
, shaderMVPMatrix {0}
, shaderTextureSize {0}
, shaderTextureCoord {0}
, shaderColor {0}
, shaderSaturation {0}
, shaderOpacity {0}
, shaderDimValue {0}
{
}
@ -116,20 +116,20 @@ namespace Renderer
void Renderer::Shader::setModelViewProjectionMatrix(glm::mat4 mvpMatrix)
{
if (shaderMVPMatrix != -1)
if (shaderMVPMatrix != GL_INVALID_VALUE && shaderMVPMatrix != GL_INVALID_OPERATION)
GL_CHECK_ERROR(glUniformMatrix4fv(shaderMVPMatrix, 1, GL_FALSE,
reinterpret_cast<GLfloat*>(&mvpMatrix)));
}
void Renderer::Shader::setTextureSize(std::array<GLfloat, 2> shaderVec2)
{
if (shaderTextureSize != -1)
if (shaderTextureSize != GL_INVALID_VALUE && shaderTextureSize != GL_INVALID_OPERATION)
GL_CHECK_ERROR(glUniform2f(shaderTextureSize, shaderVec2[0], shaderVec2[1]));
}
void Renderer::Shader::setTextureCoordinates(std::array<GLfloat, 4> shaderVec4)
{
if (shaderTextureCoord != -1) {
if (shaderTextureCoord != GL_INVALID_OPERATION) {
glVertexAttrib4f(shaderTextureCoord, shaderVec4[0], shaderVec4[1], shaderVec4[2],
shaderVec4[3]);
}
@ -137,26 +137,26 @@ namespace Renderer
void Renderer::Shader::setColor(std::array<GLfloat, 4> shaderVec4)
{
if (shaderColor != -1)
if (shaderColor != GL_INVALID_OPERATION)
GL_CHECK_ERROR(glUniform4f(shaderColor, shaderVec4[0], shaderVec4[1], shaderVec4[2],
shaderVec4[3]));
}
void Renderer::Shader::setSaturation(GLfloat saturation)
{
if (shaderSaturation != -1)
if (shaderSaturation != GL_INVALID_VALUE && shaderSaturation != GL_INVALID_OPERATION)
GL_CHECK_ERROR(glUniform1f(shaderSaturation, saturation));
}
void Renderer::Shader::setOpacity(GLfloat opacity)
{
if (shaderOpacity != -1)
if (shaderOpacity != GL_INVALID_VALUE && shaderOpacity != GL_INVALID_OPERATION)
GL_CHECK_ERROR(glUniform1f(shaderOpacity, opacity));
}
void Renderer::Shader::setDimValue(GLfloat dimValue)
{
if (shaderDimValue != -1)
if (shaderDimValue != GL_INVALID_VALUE && shaderDimValue != GL_INVALID_OPERATION)
GL_CHECK_ERROR(glUniform1f(shaderDimValue, dimValue));
}

View file

@ -19,7 +19,7 @@ FT_Library Font::sLibrary = nullptr;
std::map<std::pair<std::string, int>, std::weak_ptr<Font>> Font::sFontMap;
Font::FontFace::FontFace(ResourceData&& d, int size)
: data(d)
: data {d}
{
int err =
FT_New_Memory_Face(sLibrary, data.ptr.get(), static_cast<FT_Long>(data.length), 0, &face);

View file

@ -26,7 +26,7 @@
TextureData::TextureData(bool tile)
: mTile {tile}
, mTextureID {0}
, mDataRGBA({})
, mDataRGBA {}
, mFormat {Renderer::Texture::RGBA}
, mWidth {0}
, mHeight {0}

View file

@ -18,8 +18,8 @@ std::set<TextureResource*> TextureResource::sAllTextures;
TextureResource::TextureResource(
const std::string& path, bool tile, bool dynamic, bool linearMagnify, bool forceRasterization)
: mTextureData(nullptr)
, mForceLoad(false)
: mTextureData {nullptr}
, mForceLoad {false}
{
// Create a texture data object for this texture.
if (!path.empty()) {

View file

@ -252,76 +252,76 @@ namespace Utils
};
// Round 1.
ffFunc(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */
ffFunc(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */
ffFunc(c, d, a, b, x[2], S13, 0x242070db); /* 3 */
ffFunc(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */
ffFunc(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */
ffFunc(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */
ffFunc(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */
ffFunc(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */
ffFunc(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */
ffFunc(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */
ffFunc(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
ffFunc(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
ffFunc(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
ffFunc(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
ffFunc(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
ffFunc(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
ffFunc(a, b, c, d, x[0], S11, 0xd76aa478); // 1
ffFunc(d, a, b, c, x[1], S12, 0xe8c7b756); // 2
ffFunc(c, d, a, b, x[2], S13, 0x242070db); // 3
ffFunc(b, c, d, a, x[3], S14, 0xc1bdceee); // 4
ffFunc(a, b, c, d, x[4], S11, 0xf57c0faf); // 5
ffFunc(d, a, b, c, x[5], S12, 0x4787c62a); // 6
ffFunc(c, d, a, b, x[6], S13, 0xa8304613); // 7
ffFunc(b, c, d, a, x[7], S14, 0xfd469501); // 8
ffFunc(a, b, c, d, x[8], S11, 0x698098d8); // 9
ffFunc(d, a, b, c, x[9], S12, 0x8b44f7af); // 10
ffFunc(c, d, a, b, x[10], S13, 0xffff5bb1); // 11
ffFunc(b, c, d, a, x[11], S14, 0x895cd7be); // 12
ffFunc(a, b, c, d, x[12], S11, 0x6b901122); // 13
ffFunc(d, a, b, c, x[13], S12, 0xfd987193); // 14
ffFunc(c, d, a, b, x[14], S13, 0xa679438e); // 15
ffFunc(b, c, d, a, x[15], S14, 0x49b40821); // 16
// Round 2.
ggFunc(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */
ggFunc(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */
ggFunc(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
ggFunc(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */
ggFunc(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */
ggFunc(d, a, b, c, x[10], S22, 0x2441453); /* 22 */
ggFunc(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
ggFunc(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */
ggFunc(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */
ggFunc(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
ggFunc(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */
ggFunc(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */
ggFunc(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
ggFunc(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */
ggFunc(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */
ggFunc(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
ggFunc(a, b, c, d, x[1], S21, 0xf61e2562); // 17
ggFunc(d, a, b, c, x[6], S22, 0xc040b340); // 18
ggFunc(c, d, a, b, x[11], S23, 0x265e5a51); // 19
ggFunc(b, c, d, a, x[0], S24, 0xe9b6c7aa); // 20
ggFunc(a, b, c, d, x[5], S21, 0xd62f105d); // 21
ggFunc(d, a, b, c, x[10], S22, 0x2441453); // 22
ggFunc(c, d, a, b, x[15], S23, 0xd8a1e681); // 23
ggFunc(b, c, d, a, x[4], S24, 0xe7d3fbc8); // 24
ggFunc(a, b, c, d, x[9], S21, 0x21e1cde6); // 25
ggFunc(d, a, b, c, x[14], S22, 0xc33707d6); // 26
ggFunc(c, d, a, b, x[3], S23, 0xf4d50d87); // 27
ggFunc(b, c, d, a, x[8], S24, 0x455a14ed); // 28
ggFunc(a, b, c, d, x[13], S21, 0xa9e3e905); // 29
ggFunc(d, a, b, c, x[2], S22, 0xfcefa3f8); // 30
ggFunc(c, d, a, b, x[7], S23, 0x676f02d9); // 31
ggFunc(b, c, d, a, x[12], S24, 0x8d2a4c8a); // 32
// Round 3.
hhFunc(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */
hhFunc(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */
hhFunc(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
hhFunc(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
hhFunc(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */
hhFunc(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */
hhFunc(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */
hhFunc(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
hhFunc(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
hhFunc(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */
hhFunc(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */
hhFunc(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */
hhFunc(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */
hhFunc(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
hhFunc(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
hhFunc(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */
hhFunc(a, b, c, d, x[5], S31, 0xfffa3942); // 33
hhFunc(d, a, b, c, x[8], S32, 0x8771f681); // 34
hhFunc(c, d, a, b, x[11], S33, 0x6d9d6122); // 35
hhFunc(b, c, d, a, x[14], S34, 0xfde5380c); // 36
hhFunc(a, b, c, d, x[1], S31, 0xa4beea44); // 37
hhFunc(d, a, b, c, x[4], S32, 0x4bdecfa9); // 38
hhFunc(c, d, a, b, x[7], S33, 0xf6bb4b60); // 39
hhFunc(b, c, d, a, x[10], S34, 0xbebfbc70); // 40
hhFunc(a, b, c, d, x[13], S31, 0x289b7ec6); // 41
hhFunc(d, a, b, c, x[0], S32, 0xeaa127fa); // 42
hhFunc(c, d, a, b, x[3], S33, 0xd4ef3085); // 43
hhFunc(b, c, d, a, x[6], S34, 0x4881d05); // 44
hhFunc(a, b, c, d, x[9], S31, 0xd9d4d039); // 45
hhFunc(d, a, b, c, x[12], S32, 0xe6db99e5); // 46
hhFunc(c, d, a, b, x[15], S33, 0x1fa27cf8); // 47
hhFunc(b, c, d, a, x[2], S34, 0xc4ac5665); // 48
// Round 4.
iiFunc(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */
iiFunc(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */
iiFunc(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
iiFunc(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */
iiFunc(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
iiFunc(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */
iiFunc(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
iiFunc(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */
iiFunc(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */
iiFunc(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
iiFunc(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */
iiFunc(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
iiFunc(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */
iiFunc(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
iiFunc(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */
iiFunc(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */
iiFunc(a, b, c, d, x[0], S41, 0xf4292244); // 49
iiFunc(d, a, b, c, x[7], S42, 0x432aff97); // 50
iiFunc(c, d, a, b, x[14], S43, 0xab9423a7); // 51
iiFunc(b, c, d, a, x[5], S44, 0xfc93a039); // 52
iiFunc(a, b, c, d, x[12], S41, 0x655b59c3); // 53
iiFunc(d, a, b, c, x[3], S42, 0x8f0ccc92); // 54
iiFunc(c, d, a, b, x[10], S43, 0xffeff47d); // 55
iiFunc(b, c, d, a, x[1], S44, 0x85845dd1); // 56
iiFunc(a, b, c, d, x[8], S41, 0x6fa87e4f); // 57
iiFunc(d, a, b, c, x[15], S42, 0xfe2ce6e0); // 58
iiFunc(c, d, a, b, x[6], S43, 0xa3014314); // 59
iiFunc(b, c, d, a, x[13], S44, 0x4e0811a1); // 60
iiFunc(a, b, c, d, x[4], S41, 0xf7537e82); // 61
iiFunc(d, a, b, c, x[11], S42, 0xbd3af235); // 62
iiFunc(c, d, a, b, x[2], S43, 0x2ad7d2bb); // 63
iiFunc(b, c, d, a, x[9], S44, 0xeb86d391); // 64
state[0] += a;
state[1] += b;