diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..56cc685 --- /dev/null +++ b/.clang-format @@ -0,0 +1,67 @@ +# Generated from CLion C/C++ Code Style settings +BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: Consecutive +AlignConsecutiveMacros: AcrossEmptyLinesAndComments +AlignOperands: Align +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Always +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Always +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterReturnType: None +AlwaysBreakTemplateDeclarations: Yes +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: true +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +ColumnLimit: 0 +CompactNamespaces: false +ContinuationIndentWidth: 8 +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 4 +KeepEmptyLinesAtTheStartOfBlocks: true +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: All +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PointerAlignment: Right +ReflowComments: false +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +TabWidth: 4 +UseTab: Never diff --git a/src/Application.cpp b/src/Application.cpp index 9f47639..8d84bea 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -14,29 +14,29 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . ****************************************************************************/ +#include "Application.h" +#include "common/common.h" +#include "resources/Resources.h" +#include "system/memory.h" +#include "utils/AsyncExecutor.h" +#include "utils/logger.h" #include #include #include -#include -#include -#include "Application.h" -#include "common/common.h" #include #include #include -#include "resources/Resources.h" +#include #include -#include "system/memory.h" -#include "utils/logger.h" -#include "utils/AsyncExecutor.h" +#include #include Application *Application::applicationInstance = nullptr; -bool Application::exitApplication = false; -bool Application::quitRequest = false; +bool Application::exitApplication = false; +bool Application::quitRequest = false; Application::Application() - : CThread(CThread::eAttributeAffCore1 | CThread::eAttributePinnedAff, 0, 0x800000), bgMusic(nullptr), video(nullptr), mainWindow(nullptr), fontSystem(nullptr), exitCode(0) { + : CThread(CThread::eAttributeAffCore1 | CThread::eAttributePinnedAff, 0, 0x800000), bgMusic(nullptr), video(nullptr), mainWindow(nullptr), fontSystem(nullptr), exitCode(0) { controller[0] = new VPadController(GuiTrigger::CHANNEL_1); controller[1] = new WPadController(GuiTrigger::CHANNEL_2); controller[2] = new WPadController(GuiTrigger::CHANNEL_3); @@ -62,7 +62,7 @@ Application::~Application() { DEBUG_FUNCTION_LINE("Destroy controller"); - for (auto &i: controller) { + for (auto &i : controller) { delete i; } @@ -88,15 +88,13 @@ int32_t Application::exec() { } void Application::quit(int32_t code) { - exitCode = code; + exitCode = code; exitApplication = true; - quitRequest = true; + quitRequest = true; } void Application::fadeOut() { - GuiImage fadeOut(video->getTvWidth(), video->getTvHeight(), (GX2Color) { - 0, 0, 0, 255 - }); + GuiImage fadeOut(video->getTvWidth(), video->getTvHeight(), (GX2Color){0, 0, 0, 255}); for (int32_t i = 0; i < 255; i += 10) { if (i > 255) @@ -138,7 +136,7 @@ bool Application::procUI() { switch (ProcUIProcessMessages(true)) { case PROCUI_STATUS_EXITING: { DEBUG_FUNCTION_LINE("PROCUI_STATUS_EXITING"); - exitCode = EXIT_SUCCESS; + exitCode = EXIT_SUCCESS; exitApplication = true; break; } @@ -185,7 +183,6 @@ bool Application::procUI() { DEBUG_FUNCTION_LINE("Initialize main window"); mainWindow = new MainWindow(video->getTvWidth(), video->getTvHeight()); } - } executeProcess = true; } @@ -212,7 +209,7 @@ void Application::executeThread() { mainWindow->process(); //! Read out inputs - for (auto &i: controller) { + for (auto &i : controller) { if (!i->update(video->getTvWidth(), video->getTvHeight())) continue; diff --git a/src/Application.h b/src/Application.h index 2102f54..bae0cb2 100644 --- a/src/Application.h +++ b/src/Application.h @@ -18,8 +18,8 @@ #define _APPLICATION_H #include "menu/MainWindow.h" -#include