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/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 75e8384..f052ab0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,8 +6,16 @@ on:
- master
jobs:
+ clang-format:
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: clang-format
+ run: |
+ docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src
build-binary:
runs-on: ubuntu-18.04
+ needs: clang-format
steps:
- uses: actions/checkout@v2
- name: build binary
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index f907f7e..78d88b5 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -3,8 +3,16 @@ name: CI-PR
on: [pull_request]
jobs:
+ clang-format:
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: clang-format
+ run: |
+ docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src
build-binary:
runs-on: ubuntu-18.04
+ needs: clang-format
steps:
- uses: actions/checkout@v2
- name: build binary
diff --git a/src/Application.cpp b/src/Application.cpp
index 3fd94ac..907df52 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 "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 "utils/logger.h"
-#include "utils/AsyncExecutor.h"
+#include
+#include
+#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 248e819..e2e587f 100644
--- a/src/Application.h
+++ b/src/Application.h
@@ -18,8 +18,8 @@
#define _APPLICATION_H
#include "menu/MainWindow.h"
-#include
#include "system/CThread.h"
+#include
// forward declaration
class FreeTypeGX;
@@ -77,7 +77,6 @@ class Application : public CThread {
GuiController *controller[5]{};
int exitCode;
BOOL sFromHBL = FALSE;
-
};
#endif //_APPLICATION_H
diff --git a/src/common/common.h b/src/common/common.h
index 727b29d..f2171a8 100644
--- a/src/common/common.h
+++ b/src/common/common.h
@@ -1,16 +1,15 @@
#ifndef COMMON_H
-#define COMMON_H
+#define COMMON_H
#ifdef __cplusplus
extern "C" {
#endif
-#define LAUNCHIINE_VERSION "v0.1"
-#define META_PATH "/meta"
+#define LAUNCHIINE_VERSION "v0.1"
+#define META_PATH "/meta"
#ifdef __cplusplus
}
#endif
-#endif /* COMMON_H */
-
+#endif /* COMMON_H */
diff --git a/src/entry.cpp b/src/entry.cpp
index 07d3650..b0cffbe 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -1,18 +1,18 @@
+#include "Application.h"
#include "common/common.h"
+#include "utils/logger.h"
#include
-#include
#include
-#include "utils/logger.h"
-#include "Application.h"
+#include
int32_t main(int32_t argc, char **argv) {
bool moduleInit;
bool cafeInit = false;
- bool udpInit = false;
+ bool udpInit = false;
if (!(moduleInit = WHBLogModuleInit())) {
cafeInit = WHBLogCafeInit();
- udpInit = WHBLogUdpInit();
+ udpInit = WHBLogUdpInit();
}
DEBUG_FUNCTION_LINE("Starting launchiine " LAUNCHIINE_VERSION "");
diff --git a/src/fs/CFile.cpp b/src/fs/CFile.cpp
index fa84541..34796cd 100644
--- a/src/fs/CFile.cpp
+++ b/src/fs/CFile.cpp
@@ -1,15 +1,15 @@
+#include
#include
-#include
#include
+#include
#include
-#include
CFile::CFile() {
- iFd = -1;
+ iFd = -1;
mem_file = nullptr;
filesize = 0;
- pos = 0;
+ pos = 0;
}
CFile::CFile(const std::string &filepath, eOpenTypes mode) {
@@ -35,7 +35,7 @@ int32_t CFile::open(const std::string &filepath, eOpenTypes mode) {
switch (mode) {
default:
- case ReadOnly: // file must exist
+ case ReadOnly: // file must exist
openMode = O_RDONLY;
break;
case WriteOnly: // file will be created / zerod
@@ -77,10 +77,10 @@ void CFile::close() {
if (iFd >= 0)
::close(iFd);
- iFd = -1;
+ iFd = -1;
mem_file = nullptr;
filesize = 0;
- pos = 0;
+ pos = 0;
}
int32_t CFile::read(uint8_t *ptr, size_t size) {
@@ -127,7 +127,7 @@ int32_t CFile::write(const uint8_t *ptr, size_t size) {
}
int32_t CFile::seek(long int offset, int32_t origin) {
- int32_t ret = 0;
+ int32_t ret = 0;
int64_t newPos = pos;
if (origin == SEEK_SET) {
@@ -158,7 +158,7 @@ int32_t CFile::seek(long int offset, int32_t origin) {
int32_t CFile::fwrite(const char *format, ...) {
char tmp[512];
- tmp[0] = 0;
+ tmp[0] = 0;
int32_t result = -1;
va_list va;
@@ -171,5 +171,3 @@ int32_t CFile::fwrite(const char *format, ...) {
return result;
}
-
-
diff --git a/src/fs/CFile.hpp b/src/fs/CFile.hpp
index 6c0421b..2bc9dfc 100644
--- a/src/fs/CFile.hpp
+++ b/src/fs/CFile.hpp
@@ -1,10 +1,10 @@
#ifndef CFILE_HPP_
#define CFILE_HPP_
+#include
#include
-#include
#include
-#include
+#include
#include
#include
diff --git a/src/fs/DirList.cpp b/src/fs/DirList.cpp
index d48ce2d..048d120 100644
--- a/src/fs/DirList.cpp
+++ b/src/fs/DirList.cpp
@@ -24,22 +24,22 @@
* DirList Class
* for WiiXplorer 2010
***************************************************************************/
+#include
#include
#include
#include
#include
#include
-#include
-#include
#include
+#include
#include
#include
DirList::DirList() {
- Flags = 0;
+ Flags = 0;
Filter = 0;
- Depth = 0;
+ Depth = 0;
}
DirList::DirList(const std::string &path, const char *filter, uint32_t flags, uint32_t maxDepth) {
@@ -55,9 +55,9 @@ BOOL DirList::LoadPath(const std::string &folder, const char *filter, uint32_t f
if (folder.empty())
return false;
- Flags = flags;
+ Flags = flags;
Filter = filter;
- Depth = maxDepth;
+ Depth = maxDepth;
std::string folderpath(folder);
uint32_t length = folderpath.size();
@@ -82,14 +82,14 @@ BOOL DirList::InternalLoadPath(std::string &folderpath) {
return false;
struct dirent *dirent = nullptr;
- DIR *dir = nullptr;
+ DIR *dir = nullptr;
dir = opendir(folderpath.c_str());
if (dir == nullptr)
return false;
while ((dirent = readdir(dir)) != 0) {
- BOOL isDir = dirent->d_type & DT_DIR;
+ BOOL isDir = dirent->d_type & DT_DIR;
const char *filename = dirent->d_name;
if (isDir) {
diff --git a/src/fs/DirList.h b/src/fs/DirList.h
index 8c3eba6..3cc62e1 100644
--- a/src/fs/DirList.h
+++ b/src/fs/DirList.h
@@ -27,8 +27,8 @@
#ifndef ___DIRLIST_H_
#define ___DIRLIST_H_
-#include
#include
+#include
#include
typedef struct {
@@ -93,10 +93,11 @@ class DirList {
//! Enum for search/filter flags
enum {
- Files = 0x01,
- Dirs = 0x02,
+ Files = 0x01,
+ Dirs = 0x02,
CheckSubfolders = 0x08,
};
+
protected:
// Internal parser
BOOL InternalLoadPath(std::string &path);
diff --git a/src/fs/FSUtils.cpp b/src/fs/FSUtils.cpp
index e3ddc44..fd799c0 100644
--- a/src/fs/FSUtils.cpp
+++ b/src/fs/FSUtils.cpp
@@ -1,11 +1,11 @@
-#include
-#include
-#include
-#include
-#include
#include "fs/FSUtils.h"
#include "fs/CFile.hpp"
#include "utils/logger.h"
+#include
+#include
+#include
+#include
+#include
int32_t FSUtils::LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_t *size) {
//! always initialze input
@@ -27,8 +27,8 @@ int32_t FSUtils::LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_
}
uint32_t blocksize = 0x4000;
- uint32_t done = 0;
- int32_t readBytes = 0;
+ uint32_t done = 0;
+ int32_t readBytes = 0;
while (done < filesize) {
if (done + blocksize > filesize) {
@@ -139,4 +139,3 @@ int32_t FSUtils::saveBufferToFile(const char *path, void *buffer, uint32_t size)
file.close();
return written;
}
-
diff --git a/src/game/GameList.cpp b/src/game/GameList.cpp
index 48ac91d..251482d 100644
--- a/src/game/GameList.cpp
+++ b/src/game/GameList.cpp
@@ -1,14 +1,14 @@
#include
-#include
-#include
+#include
#include
#include
#include
-#include
+#include
+#include
-#include "utils/AsyncExecutor.h"
#include "GameList.h"
#include "common/common.h"
+#include "utils/AsyncExecutor.h"
#include "fs/FSUtils.h"
#include "utils/logger.h"
@@ -24,7 +24,7 @@ GameList::~GameList() {
void GameList::clear() {
lock();
- for (auto const &x: fullGameList) {
+ for (auto const &x : fullGameList) {
if (x != nullptr) {
if (x->imageData != nullptr) {
AsyncExecutor::pushForDelete(x->imageData);
@@ -55,7 +55,7 @@ gameInfo *GameList::getGameInfo(uint64_t titleId) {
int32_t GameList::readGameList() {
// Clear list
- for (auto const &x: fullGameList) {
+ for (auto const &x : fullGameList) {
delete x;
}
@@ -92,10 +92,10 @@ int32_t GameList::readGameList() {
MCP_APP_TYPE_ACCOUNT_APPS,
};
- for (auto appType: menuAppTypes) {
+ for (auto appType : menuAppTypes) {
uint32_t titleCountByType = 0;
- MCPError err = MCP_TitleListByAppType(mcp, appType, &titleCountByType, titles.data() + realTitleCount,
- (titles.size() - realTitleCount) * sizeof(decltype(titles)::value_type));
+ MCPError err = MCP_TitleListByAppType(mcp, appType, &titleCountByType, titles.data() + realTitleCount,
+ (titles.size() - realTitleCount) * sizeof(decltype(titles)::value_type));
if (err < 0) {
MCP_Close(mcp);
return 0;
@@ -106,12 +106,12 @@ int32_t GameList::readGameList() {
titles.resize(realTitleCount);
}
- for (auto title_candidate: titles) {
- auto *newGameInfo = new gameInfo;
- newGameInfo->titleId = title_candidate.titleId;
- newGameInfo->appType = title_candidate.appType;
- newGameInfo->gamePath = title_candidate.path;
- newGameInfo->name = "";
+ for (auto title_candidate : titles) {
+ auto *newGameInfo = new gameInfo;
+ newGameInfo->titleId = title_candidate.titleId;
+ newGameInfo->appType = title_candidate.appType;
+ newGameInfo->gamePath = title_candidate.path;
+ newGameInfo->name = "";
newGameInfo->imageData = nullptr;
DCFlushRange(newGameInfo, sizeof(gameInfo));
@@ -141,11 +141,11 @@ int32_t GameList::readGameList() {
if (header->imageData == nullptr) {
std::string filepath = "fs:" + header->gamePath + META_PATH + "/iconTex.tga";
- uint8_t *buffer = nullptr;
- uint32_t bufferSize = 0;
- int iResult = FSUtils::LoadFileToMem(filepath.c_str(), &buffer, &bufferSize);
+ uint8_t *buffer = nullptr;
+ uint32_t bufferSize = 0;
+ int iResult = FSUtils::LoadFileToMem(filepath.c_str(), &buffer, &bufferSize);
if (iResult > 0) {
- auto *imageData = new GuiImageData(buffer, bufferSize, GX2_TEX_CLAMP_MODE_MIRROR);
+ auto *imageData = new GuiImageData(buffer, bufferSize, GX2_TEX_CLAMP_MODE_MIRROR);
header->imageData = imageData;
//! free original image buffer which is converted to texture now and not needed anymore
@@ -173,7 +173,7 @@ void GameList::updateTitleInfo() {
auto acp = ACPGetTitleMetaXml(newHeader->titleId, meta);
if (acp >= 0) {
newHeader->name = meta->shortname_en;
- hasChanged = true;
+ hasChanged = true;
}
free(meta);
}
@@ -181,14 +181,14 @@ void GameList::updateTitleInfo() {
if (newHeader->imageData == nullptr) {
std::string filepath = "fs:" + newHeader->gamePath + META_PATH + "/iconTex.tga";
- uint8_t *buffer = nullptr;
- uint32_t bufferSize = 0;
- int iResult = FSUtils::LoadFileToMem(filepath.c_str(), &buffer, &bufferSize);
+ uint8_t *buffer = nullptr;
+ uint32_t bufferSize = 0;
+ int iResult = FSUtils::LoadFileToMem(filepath.c_str(), &buffer, &bufferSize);
if (iResult > 0) {
- auto *imageData = new GuiImageData(buffer, bufferSize, GX2_TEX_CLAMP_MODE_MIRROR);
+ auto *imageData = new GuiImageData(buffer, bufferSize, GX2_TEX_CLAMP_MODE_MIRROR);
newHeader->imageData = imageData;
- hasChanged = true;
+ hasChanged = true;
//! free original image buffer which is converted to texture now and not needed anymore
free(buffer);
diff --git a/src/game/GameList.h b/src/game/GameList.h
index 96921ae..3f1a8ba 100644
--- a/src/game/GameList.h
+++ b/src/game/GameList.h
@@ -1,13 +1,13 @@
#ifndef GAME_LIST_H_
#define GAME_LIST_H_
-#include
-#include
-#include
-#include
#include
-#include
+#include
#include
+#include
+#include
+#include
+#include
typedef struct _gameInfo {
uint64_t titleId;
diff --git a/src/gui/GameIcon.cpp b/src/gui/GameIcon.cpp
index 7d558c4..6b3572b 100644
--- a/src/gui/GameIcon.cpp
+++ b/src/gui/GameIcon.cpp
@@ -1,42 +1,42 @@
#include "GameIcon.h"
-#include "GameIconModel.h"
#include "Application.h"
+#include "GameIconModel.h"
+#include "utils/logger.h"
+#include "utils/utils.h"
#include
#include
#include
-#include "utils/utils.h"
-#include "utils/logger.h"
static const float cfIconMirrorScale = 1.15f;
static const float cfIconMirrorAlpha = 0.45f;
GameIcon::GameIcon(GuiImageData *preloadImage)
- : GuiImage(preloadImage) {
- bSelected = false;
- bRenderStroke = true;
- bRenderReflection = false;
- bIconLast = false;
- strokeFractalEnable = 1;
- strokeBlurBorder = 0.0f;
- distanceFadeout = 0.0f;
- rotationX = 0.0f;
- reflectionAlpha = 0.4f;
- strokeWidth = 2.35f;
- colorIntensity = glm::vec4(1.0f);
- colorIntensityMirror = colorIntensity;
- alphaFadeOutNorm = glm::vec4(0.0f);
- alphaFadeOutRefl = glm::vec4(-1.0f, 0.0f, 0.9f, 1.0f);
+ : GuiImage(preloadImage) {
+ bSelected = false;
+ bRenderStroke = true;
+ bRenderReflection = false;
+ bIconLast = false;
+ strokeFractalEnable = 1;
+ strokeBlurBorder = 0.0f;
+ distanceFadeout = 0.0f;
+ rotationX = 0.0f;
+ reflectionAlpha = 0.4f;
+ strokeWidth = 2.35f;
+ colorIntensity = glm::vec4(1.0f);
+ colorIntensityMirror = colorIntensity;
+ alphaFadeOutNorm = glm::vec4(0.0f);
+ alphaFadeOutRefl = glm::vec4(-1.0f, 0.0f, 0.9f, 1.0f);
selectionBlurOuterColorIntensity = glm::vec4(0.09411764f * 1.15f, 0.56862745f * 1.15f, 0.96862745098f * 1.15f, 1.0f);
- selectionBlurOuterSize = 1.65f;
- selectionBlurOuterBorderSize = 0.5f;
+ selectionBlurOuterSize = 1.65f;
+ selectionBlurOuterBorderSize = 0.5f;
selectionBlurInnerColorIntensity = glm::vec4(0.46666667f, 0.90588235f, 1.0f, 1.0f);
- selectionBlurInnerSize = 1.45f;
- selectionBlurInnerBorderSize = 0.95f;
+ selectionBlurInnerSize = 1.45f;
+ selectionBlurInnerBorderSize = 0.95f;
vtxCount = sizeof(cfGameIconPosVtxs) / (Shader3D::cuVertexAttrSize);
//! texture and vertex coordinates
- posVtxs = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, sizeof(cfGameIconPosVtxs));
+ posVtxs = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, sizeof(cfGameIconPosVtxs));
texCoords = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, sizeof(cfGameIconTexCoords));
if (posVtxs) {
@@ -68,7 +68,7 @@ GameIcon::GameIcon(GuiImageData *preloadImage)
strokeTexCoords = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, cuGameIconStrokeVtxCount * Shader::cuTexCoordAttrSize);
if (strokeTexCoords) {
for (size_t i = 0, n = 0; i < cuGameIconStrokeVtxCount; n += 2, i += 3) {
- strokeTexCoords[n] = (1.0f + strokePosVtxs[i]) * 0.5f;
+ strokeTexCoords[n] = (1.0f + strokePosVtxs[i]) * 0.5f;
strokeTexCoords[n + 1] = 1.0f - (1.0f + strokePosVtxs[i + 1]) * 0.5f;
}
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, strokeTexCoords, cuGameIconStrokeVtxCount * Shader::cuTexCoordAttrSize);
@@ -118,9 +118,9 @@ bool GameIcon::checkRayIntersection(const glm::vec3 &rayOrigin, const glm::vec3
//! since we always face the camera we can just check the AABB intersection
//! otherwise an OOB intersection would be required
- float currPosX = getCenterX() * Application::instance()->getVideo()->getWidthScaleFactor() * 2.0f;
- float currPosY = getCenterY() * Application::instance()->getVideo()->getHeightScaleFactor() * 2.0f;
- float currPosZ = getDepth() * Application::instance()->getVideo()->getDepthScaleFactor() * 2.0f;
+ float currPosX = getCenterX() * Application::instance()->getVideo()->getWidthScaleFactor() * 2.0f;
+ float currPosY = getCenterY() * Application::instance()->getVideo()->getHeightScaleFactor() * 2.0f;
+ float currPosZ = getDepth() * Application::instance()->getVideo()->getDepthScaleFactor() * 2.0f;
float currScaleX = getScaleX() * (float) getWidth() * Application::instance()->getVideo()->getWidthScaleFactor();
float currScaleY = getScaleY() * (float) getHeight() * Application::instance()->getVideo()->getHeightScaleFactor();
float currScaleZ = getScaleZ() * (float) getWidth() * Application::instance()->getVideo()->getDepthScaleFactor();
@@ -159,12 +159,12 @@ void GameIcon::draw(CVideo *pVideo, const glm::mat4 &projectionMtx, const glm::m
return;
}
//! first setup 2D GUI positions
- float currPosX = getCenterX() * pVideo->getWidthScaleFactor() * 2.0f;
- float currPosY = getCenterY() * pVideo->getHeightScaleFactor() * 2.0f;
- float currPosZ = getDepth() * pVideo->getDepthScaleFactor() * 2.0f;
- float currScaleX = getScaleX() * (float) getWidth() * pVideo->getWidthScaleFactor();
- float currScaleY = getScaleY() * (float) getHeight() * pVideo->getHeightScaleFactor();
- float currScaleZ = getScaleZ() * (float) getWidth() * pVideo->getDepthScaleFactor();
+ float currPosX = getCenterX() * pVideo->getWidthScaleFactor() * 2.0f;
+ float currPosY = getCenterY() * pVideo->getHeightScaleFactor() * 2.0f;
+ float currPosZ = getDepth() * pVideo->getDepthScaleFactor() * 2.0f;
+ float currScaleX = getScaleX() * (float) getWidth() * pVideo->getWidthScaleFactor();
+ float currScaleY = getScaleY() * (float) getHeight() * pVideo->getHeightScaleFactor();
+ float currScaleZ = getScaleZ() * (float) getWidth() * pVideo->getDepthScaleFactor();
float strokeScaleX = pVideo->getWidthScaleFactor() * strokeWidth * 0.25f + cfIconMirrorScale;
float strokeScaleY = pVideo->getHeightScaleFactor() * strokeWidth * 0.25f + cfIconMirrorScale;
@@ -182,10 +182,10 @@ void GameIcon::draw(CVideo *pVideo, const glm::mat4 &projectionMtx, const glm::m
m_iconView = glm::rotate(m_iconView, DegToRad(rotationX), glm::vec3(1.0f, 0.0f, 0.0f));
m_iconView = glm::scale(m_iconView, glm::vec3(currScaleX, -currScaleY, currScaleZ));
- colorIntensity[3] = reflectionAlpha * getAlpha();
+ colorIntensity[3] = reflectionAlpha * getAlpha();
selectionBlurOuterColorIntensity[3] = colorIntensity[3] * 0.7f;
selectionBlurInnerColorIntensity[3] = colorIntensity[3] * 0.7f;
- alphaFadeOut = &alphaFadeOutRefl;
+ alphaFadeOut = &alphaFadeOutRefl;
GX2SetCullOnlyControl(GX2_FRONT_FACE_CCW, GX2_ENABLE, GX2_DISABLE);
} else {
@@ -194,10 +194,10 @@ void GameIcon::draw(CVideo *pVideo, const glm::mat4 &projectionMtx, const glm::m
m_iconView = glm::rotate(m_iconView, DegToRad(rotationX), glm::vec3(1.0f, 0.0f, 0.0f));
m_iconView = glm::scale(m_iconView, glm::vec3(currScaleX, currScaleY, currScaleZ));
- colorIntensity[3] = getAlpha();
+ colorIntensity[3] = getAlpha();
selectionBlurOuterColorIntensity[3] = colorIntensity[3];
selectionBlurInnerColorIntensity[3] = colorIntensity[3];
- alphaFadeOut = &alphaFadeOutNorm;
+ alphaFadeOut = &alphaFadeOutNorm;
}
m_mirrorView = glm::scale(m_iconView, glm::vec3(cfIconMirrorScale, cfIconMirrorScale, cfIconMirrorScale));
diff --git a/src/gui/GameIcon.h b/src/gui/GameIcon.h
index 02ba2af..999f758 100644
--- a/src/gui/GameIcon.h
+++ b/src/gui/GameIcon.h
@@ -15,8 +15,8 @@ class GameIcon : public GuiImage {
}
void setColorIntensity(const glm::vec4 &color) {
- colorIntensity = color;
- colorIntensityMirror = colorIntensity;
+ colorIntensity = color;
+ colorIntensityMirror = colorIntensity;
selectionBlurOuterColorIntensity = color * glm::vec4(0.09411764f * 1.15f, 0.56862745f * 1.15f, 0.96862745098f * 1.15f, 1.0f);
selectionBlurInnerColorIntensity = color * glm::vec4(0.46666667f, 0.90588235f, 1.0f, 1.0f);
}
diff --git a/src/gui/GameIconModel.h b/src/gui/GameIconModel.h
index f408409..92a0ac1 100644
--- a/src/gui/GameIconModel.h
+++ b/src/gui/GameIconModel.h
@@ -1,6 +1,7 @@
#ifndef ICON_MODEL_H_
#define ICON_MODEL_H_
+// clang-format off
static const float cfGameIconPosVtxs[] = {
-0.844501f, -0.861263f, 0.050154f, -0.802664f, -0.8797f, 0.054004f, -0.809968f, -0.828995f, 0.061777f, -0.864233f, -0.822169f, 0.054004f,
-0.802664f, -0.8797f, 0.054004f, -0.726455f, -0.89991f, 0.058224f, -0.730326f, -0.842312f, 0.067487f, -0.809968f, -0.828995f, 0.061777f,
diff --git a/src/gui/GuiIconGrid.cpp b/src/gui/GuiIconGrid.cpp
index e76c3ac..4f89ac4 100644
--- a/src/gui/GuiIconGrid.cpp
+++ b/src/gui/GuiIconGrid.cpp
@@ -14,37 +14,37 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
****************************************************************************/
-#include