mirror of
https://github.com/wiiu-env/launchiine.git
synced 2024-11-29 13:04:19 +01:00
Add .clang-format
This commit is contained in:
parent
69c3327ad5
commit
b4cecf10e8
67
.clang-format
Normal file
67
.clang-format
Normal file
@ -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
|
@ -14,21 +14,21 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
#include "Application.h"
|
||||||
|
#include "common/common.h"
|
||||||
|
#include "resources/Resources.h"
|
||||||
|
#include "system/memory.h"
|
||||||
|
#include "utils/AsyncExecutor.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
#include <coreinit/core.h>
|
#include <coreinit/core.h>
|
||||||
#include <coreinit/foreground.h>
|
#include <coreinit/foreground.h>
|
||||||
#include <coreinit/title.h>
|
#include <coreinit/title.h>
|
||||||
#include <proc_ui/procui.h>
|
|
||||||
#include <sysapp/launch.h>
|
|
||||||
#include "Application.h"
|
|
||||||
#include "common/common.h"
|
|
||||||
#include <gui/FreeTypeGX.h>
|
#include <gui/FreeTypeGX.h>
|
||||||
#include <gui/VPadController.h>
|
#include <gui/VPadController.h>
|
||||||
#include <gui/WPadController.h>
|
#include <gui/WPadController.h>
|
||||||
#include "resources/Resources.h"
|
#include <proc_ui/procui.h>
|
||||||
#include <sounds/SoundHandler.hpp>
|
#include <sounds/SoundHandler.hpp>
|
||||||
#include "system/memory.h"
|
#include <sysapp/launch.h>
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "utils/AsyncExecutor.h"
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
Application *Application::applicationInstance = nullptr;
|
Application *Application::applicationInstance = nullptr;
|
||||||
@ -62,7 +62,7 @@ Application::~Application() {
|
|||||||
|
|
||||||
DEBUG_FUNCTION_LINE("Destroy controller");
|
DEBUG_FUNCTION_LINE("Destroy controller");
|
||||||
|
|
||||||
for (auto &i: controller) {
|
for (auto &i : controller) {
|
||||||
delete i;
|
delete i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,9 +94,7 @@ void Application::quit(int32_t code) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Application::fadeOut() {
|
void Application::fadeOut() {
|
||||||
GuiImage fadeOut(video->getTvWidth(), video->getTvHeight(), (GX2Color) {
|
GuiImage fadeOut(video->getTvWidth(), video->getTvHeight(), (GX2Color){0, 0, 0, 255});
|
||||||
0, 0, 0, 255
|
|
||||||
});
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < 255; i += 10) {
|
for (int32_t i = 0; i < 255; i += 10) {
|
||||||
if (i > 255)
|
if (i > 255)
|
||||||
@ -185,7 +183,6 @@ bool Application::procUI() {
|
|||||||
DEBUG_FUNCTION_LINE("Initialize main window");
|
DEBUG_FUNCTION_LINE("Initialize main window");
|
||||||
mainWindow = new MainWindow(video->getTvWidth(), video->getTvHeight());
|
mainWindow = new MainWindow(video->getTvWidth(), video->getTvHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
executeProcess = true;
|
executeProcess = true;
|
||||||
}
|
}
|
||||||
@ -212,7 +209,7 @@ void Application::executeThread() {
|
|||||||
mainWindow->process();
|
mainWindow->process();
|
||||||
|
|
||||||
//! Read out inputs
|
//! Read out inputs
|
||||||
for (auto &i: controller) {
|
for (auto &i : controller) {
|
||||||
if (!i->update(video->getTvWidth(), video->getTvHeight()))
|
if (!i->update(video->getTvWidth(), video->getTvHeight()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
#define _APPLICATION_H
|
#define _APPLICATION_H
|
||||||
|
|
||||||
#include "menu/MainWindow.h"
|
#include "menu/MainWindow.h"
|
||||||
#include <video/CVideo.h>
|
|
||||||
#include "system/CThread.h"
|
#include "system/CThread.h"
|
||||||
|
#include <video/CVideo.h>
|
||||||
|
|
||||||
// forward declaration
|
// forward declaration
|
||||||
class FreeTypeGX;
|
class FreeTypeGX;
|
||||||
@ -77,7 +77,6 @@ private:
|
|||||||
GuiController *controller[5]{};
|
GuiController *controller[5]{};
|
||||||
int exitCode;
|
int exitCode;
|
||||||
BOOL sFromHBL = FALSE;
|
BOOL sFromHBL = FALSE;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_APPLICATION_H
|
#endif //_APPLICATION_H
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#include "utils/logger.h"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include "utils/logger.h"
|
|
||||||
|
|
||||||
#include "StorageUtils.h"
|
#include "StorageUtils.h"
|
||||||
|
|
||||||
|
@ -13,4 +13,3 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* COMMON_H */
|
#endif /* COMMON_H */
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "common/common.h"
|
|
||||||
#include <whb/log_cafe.h>
|
|
||||||
#include <whb/log_udp.h>
|
|
||||||
#include <whb/log_module.h>
|
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "StorageUtils.h"
|
#include "StorageUtils.h"
|
||||||
|
#include "common/common.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
|
#include <whb/log_cafe.h>
|
||||||
|
#include <whb/log_module.h>
|
||||||
|
#include <whb/log_udp.h>
|
||||||
|
|
||||||
int32_t main(int32_t argc, char **argv) {
|
int32_t main(int32_t argc, char **argv) {
|
||||||
bool moduleInit;
|
bool moduleInit;
|
||||||
|
@ -24,14 +24,14 @@
|
|||||||
* DirList Class
|
* DirList Class
|
||||||
* for WiiXplorer 2010
|
* for WiiXplorer 2010
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
#include <algorithm>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <algorithm>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/dirent.h>
|
#include <sys/dirent.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <fs/DirList.h>
|
#include <fs/DirList.h>
|
||||||
#include <utils/StringTools.h>
|
#include <utils/StringTools.h>
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
#ifndef ___DIRLIST_H_
|
#ifndef ___DIRLIST_H_
|
||||||
#define ___DIRLIST_H_
|
#define ___DIRLIST_H_
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
#include <wut_types.h>
|
#include <wut_types.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -97,6 +97,7 @@ public:
|
|||||||
Dirs = 0x02,
|
Dirs = 0x02,
|
||||||
CheckSubfolders = 0x08,
|
CheckSubfolders = 0x08,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Internal parser
|
// Internal parser
|
||||||
BOOL InternalLoadPath(std::string &path);
|
BOOL InternalLoadPath(std::string &path);
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include <malloc.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include "fs/FSUtils.h"
|
#include "fs/FSUtils.h"
|
||||||
#include "fs/CFile.hpp"
|
#include "fs/CFile.hpp"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int32_t FSUtils::LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_t *size) {
|
int32_t FSUtils::LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_t *size) {
|
||||||
//! always initialze input
|
//! always initialze input
|
||||||
@ -139,4 +139,3 @@ int32_t FSUtils::saveBufferToFile(const char *path, void *buffer, uint32_t size)
|
|||||||
file.close();
|
file.close();
|
||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <coreinit/cache.h>
|
||||||
#include <string.h>
|
|
||||||
#include <coreinit/mcp.h>
|
#include <coreinit/mcp.h>
|
||||||
#include <nn/acp/nn_acp_types.h>
|
#include <nn/acp/nn_acp_types.h>
|
||||||
#include <nn/acp/title.h>
|
#include <nn/acp/title.h>
|
||||||
#include <coreinit/cache.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "utils/AsyncExecutor.h"
|
|
||||||
#include "GameList.h"
|
#include "GameList.h"
|
||||||
#include "common/common.h"
|
#include "common/common.h"
|
||||||
|
#include "utils/AsyncExecutor.h"
|
||||||
|
|
||||||
#include "fs/FSUtils.h"
|
#include "fs/FSUtils.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
@ -24,7 +24,7 @@ GameList::~GameList() {
|
|||||||
|
|
||||||
void GameList::clear() {
|
void GameList::clear() {
|
||||||
lock();
|
lock();
|
||||||
for (auto const &x: fullGameList) {
|
for (auto const &x : fullGameList) {
|
||||||
if (x != nullptr) {
|
if (x != nullptr) {
|
||||||
if (x->imageData != nullptr) {
|
if (x->imageData != nullptr) {
|
||||||
AsyncExecutor::pushForDelete(x->imageData);
|
AsyncExecutor::pushForDelete(x->imageData);
|
||||||
@ -55,7 +55,7 @@ gameInfo *GameList::getGameInfo(uint64_t titleId) {
|
|||||||
|
|
||||||
int32_t GameList::readGameList() {
|
int32_t GameList::readGameList() {
|
||||||
// Clear list
|
// Clear list
|
||||||
for (auto const &x: fullGameList) {
|
for (auto const &x : fullGameList) {
|
||||||
delete x;
|
delete x;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ int32_t GameList::readGameList() {
|
|||||||
MCP_APP_TYPE_ACCOUNT_APPS,
|
MCP_APP_TYPE_ACCOUNT_APPS,
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto appType: menuAppTypes) {
|
for (auto appType : menuAppTypes) {
|
||||||
uint32_t titleCountByType = 0;
|
uint32_t titleCountByType = 0;
|
||||||
MCPError err = MCP_TitleListByAppType(mcp, appType, &titleCountByType, titles.data() + realTitleCount,
|
MCPError err = MCP_TitleListByAppType(mcp, appType, &titleCountByType, titles.data() + realTitleCount,
|
||||||
(titles.size() - realTitleCount) * sizeof(decltype(titles)::value_type));
|
(titles.size() - realTitleCount) * sizeof(decltype(titles)::value_type));
|
||||||
@ -106,7 +106,7 @@ int32_t GameList::readGameList() {
|
|||||||
titles.resize(realTitleCount);
|
titles.resize(realTitleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto title_candidate: titles) {
|
for (auto title_candidate : titles) {
|
||||||
auto *newGameInfo = new gameInfo;
|
auto *newGameInfo = new gameInfo;
|
||||||
newGameInfo->titleId = title_candidate.titleId;
|
newGameInfo->titleId = title_candidate.titleId;
|
||||||
newGameInfo->appType = title_candidate.appType;
|
newGameInfo->appType = title_candidate.appType;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#ifndef GAME_LIST_H_
|
#ifndef GAME_LIST_H_
|
||||||
#define GAME_LIST_H_
|
#define GAME_LIST_H_
|
||||||
|
|
||||||
#include <vector>
|
#include <coreinit/cache.h>
|
||||||
|
#include <coreinit/mcp.h>
|
||||||
|
#include <gui/GuiImageData.h>
|
||||||
|
#include <gui/sigslot.h>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <coreinit/mcp.h>
|
#include <vector>
|
||||||
#include <coreinit/cache.h>
|
|
||||||
#include <gui/sigslot.h>
|
|
||||||
#include <gui/GuiImageData.h>
|
|
||||||
|
|
||||||
typedef struct _gameInfo {
|
typedef struct _gameInfo {
|
||||||
uint64_t titleId;
|
uint64_t titleId;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "GameIcon.h"
|
#include "GameIcon.h"
|
||||||
#include "GameIconModel.h"
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
#include "GameIconModel.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
|
#include "utils/utils.h"
|
||||||
#include <video/CVideo.h>
|
#include <video/CVideo.h>
|
||||||
#include <video/shaders/Shader3D.h>
|
#include <video/shaders/Shader3D.h>
|
||||||
#include <video/shaders/ShaderFractalColor.h>
|
#include <video/shaders/ShaderFractalColor.h>
|
||||||
#include "utils/utils.h"
|
|
||||||
#include "utils/logger.h"
|
|
||||||
|
|
||||||
static const float cfIconMirrorScale = 1.15f;
|
static const float cfIconMirrorScale = 1.15f;
|
||||||
static const float cfIconMirrorAlpha = 0.45f;
|
static const float cfIconMirrorAlpha = 0.45f;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -14,16 +14,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <map>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <gui/GuiIconGrid.h>
|
|
||||||
#include <gui/GuiController.h>
|
|
||||||
#include <coreinit/cache.h>
|
|
||||||
#include "common/common.h"
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include <video/CVideo.h>
|
#include "common/common.h"
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "gui/GameIcon.h"
|
#include "gui/GameIcon.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
|
#include <algorithm>
|
||||||
|
#include <coreinit/cache.h>
|
||||||
|
#include <gui/GuiController.h>
|
||||||
|
#include <gui/GuiIconGrid.h>
|
||||||
|
#include <map>
|
||||||
|
#include <video/CVideo.h>
|
||||||
|
|
||||||
GuiIconGrid::GuiIconGrid(int32_t w, int32_t h, uint64_t GameIndex, bool sortByName)
|
GuiIconGrid::GuiIconGrid(int32_t w, int32_t h, uint64_t GameIndex, bool sortByName)
|
||||||
: GuiTitleBrowser(w, h, GameIndex),
|
: GuiTitleBrowser(w, h, GameIndex),
|
||||||
@ -126,18 +126,18 @@ GuiIconGrid::GuiIconGrid(int32_t w, int32_t h, uint64_t GameIndex, bool sortByNa
|
|||||||
|
|
||||||
GuiIconGrid::~GuiIconGrid() {
|
GuiIconGrid::~GuiIconGrid() {
|
||||||
containerMutex.lock();
|
containerMutex.lock();
|
||||||
for (auto const &x: gameInfoContainers) {
|
for (auto const &x : gameInfoContainers) {
|
||||||
remove(x.second->button);
|
remove(x.second->button);
|
||||||
delete x.second;
|
delete x.second;
|
||||||
}
|
}
|
||||||
gameInfoContainers.clear();
|
gameInfoContainers.clear();
|
||||||
containerMutex.unlock();
|
containerMutex.unlock();
|
||||||
|
|
||||||
for (auto const &x: emptyButtons) {
|
for (auto const &x : emptyButtons) {
|
||||||
delete x;
|
delete x;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto const &x: emptyIcons) {
|
for (auto const &x : emptyIcons) {
|
||||||
delete x;
|
delete x;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ void GuiIconGrid::setSelectedGame(uint64_t idx) {
|
|||||||
|
|
||||||
containerMutex.lock();
|
containerMutex.lock();
|
||||||
GameInfoContainer *container = nullptr;
|
GameInfoContainer *container = nullptr;
|
||||||
for (auto const &x: gameInfoContainers) {
|
for (auto const &x : gameInfoContainers) {
|
||||||
container = x.second;
|
container = x.second;
|
||||||
if (x.first == idx) {
|
if (x.first == idx) {
|
||||||
container->image->setSelected(true);
|
container->image->setSelected(true);
|
||||||
@ -218,7 +218,7 @@ void GuiIconGrid::OnGameTitleListUpdated(GameList *gameList) {
|
|||||||
gameInfo *info = gameList->at(i);
|
gameInfo *info = gameList->at(i);
|
||||||
GameInfoContainer *container = nullptr;
|
GameInfoContainer *container = nullptr;
|
||||||
|
|
||||||
for (auto const &x: gameInfoContainers) {
|
for (auto const &x : gameInfoContainers) {
|
||||||
if (info->titleId == x.first) {
|
if (info->titleId == x.first) {
|
||||||
container = x.second;
|
container = x.second;
|
||||||
break;
|
break;
|
||||||
@ -268,7 +268,6 @@ void GuiIconGrid::OnLeftClick(GuiButton *button, const GuiController *controller
|
|||||||
setSelectedGame(newTitleId);
|
setSelectedGame(newTitleId);
|
||||||
gameSelectionChanged(this, selectedGame);
|
gameSelectionChanged(this, selectedGame);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiIconGrid::OnRightClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
void GuiIconGrid::OnRightClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||||
@ -379,7 +378,7 @@ void GuiIconGrid::OnGameButtonHeld(GuiButton *button, const GuiController *contr
|
|||||||
if (currentlyHeld == nullptr) {
|
if (currentlyHeld == nullptr) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
// We don't want to drag empty buttons
|
// We don't want to drag empty buttons
|
||||||
for (auto const &x: emptyButtons) {
|
for (auto const &x : emptyButtons) {
|
||||||
if (x == button) {
|
if (x == button) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@ -395,11 +394,9 @@ void GuiIconGrid::OnGameButtonHeld(GuiButton *button, const GuiController *contr
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GuiIconGrid::OnGameButtonPointedOn(GuiButton *button, const GuiController *controller) {
|
void GuiIconGrid::OnGameButtonPointedOn(GuiButton *button, const GuiController *controller) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiIconGrid::OnGameButtonPointedOff(GuiButton *button, const GuiController *controller) {
|
void GuiIconGrid::OnGameButtonPointedOff(GuiButton *button, const GuiController *controller) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiIconGrid::OnDrag(GuiDragListener *element, const GuiController *controller, GuiTrigger *trigger, int32_t dx, int32_t dy) {
|
void GuiIconGrid::OnDrag(GuiDragListener *element, const GuiController *controller, GuiTrigger *trigger, int32_t dx, int32_t dy) {
|
||||||
@ -412,7 +409,7 @@ void GuiIconGrid::OnDrag(GuiDragListener *element, const GuiController *controll
|
|||||||
|
|
||||||
void GuiIconGrid::OnGameButtonClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
void GuiIconGrid::OnGameButtonClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||||
containerMutex.lock();
|
containerMutex.lock();
|
||||||
for (auto const &x: gameInfoContainers) {
|
for (auto const &x : gameInfoContainers) {
|
||||||
if (x.second->button == button) {
|
if (x.second->button == button) {
|
||||||
if (selectedGame == (x.second->info->titleId)) {
|
if (selectedGame == (x.second->info->titleId)) {
|
||||||
if (gameLaunchTimer < 30)
|
if (gameLaunchTimer < 30)
|
||||||
@ -483,7 +480,7 @@ void GuiIconGrid::OnGameTitleUpdated(gameInfo *info) {
|
|||||||
DEBUG_FUNCTION_LINE("Updating infos of %016llX", info->titleId);
|
DEBUG_FUNCTION_LINE("Updating infos of %016llX", info->titleId);
|
||||||
GameInfoContainer *container = nullptr;
|
GameInfoContainer *container = nullptr;
|
||||||
containerMutex.lock();
|
containerMutex.lock();
|
||||||
for (auto const &x: gameInfoContainers) {
|
for (auto const &x : gameInfoContainers) {
|
||||||
if (info->titleId == x.first) {
|
if (info->titleId == x.first) {
|
||||||
container = x.second;
|
container = x.second;
|
||||||
break;
|
break;
|
||||||
@ -514,7 +511,7 @@ void GuiIconGrid::process() {
|
|||||||
std::copy(gameInfoContainers.begin(), gameInfoContainers.end(), std::back_inserter<std::vector<std::pair<uint64_t, GameInfoContainer *>>>(vec));
|
std::copy(gameInfoContainers.begin(), gameInfoContainers.end(), std::back_inserter<std::vector<std::pair<uint64_t, GameInfoContainer *>>>(vec));
|
||||||
containerMutex.unlock();
|
containerMutex.unlock();
|
||||||
uint64_t targetTitleId = 0;
|
uint64_t targetTitleId = 0;
|
||||||
for (auto const &x: vec) {
|
for (auto const &x : vec) {
|
||||||
if (x.second->button == dragTarget) {
|
if (x.second->button == dragTarget) {
|
||||||
targetTitleId = x.first;
|
targetTitleId = x.first;
|
||||||
break;
|
break;
|
||||||
@ -602,14 +599,14 @@ void GuiIconGrid::updateButtonPositions() {
|
|||||||
|
|
||||||
containerMutex.unlock();
|
containerMutex.unlock();
|
||||||
|
|
||||||
for (auto const &x: vec) {
|
for (auto const &x : vec) {
|
||||||
if (x.second->button == currentlyHeld) {
|
if (x.second->button == currentlyHeld) {
|
||||||
currentlyHeldTitleId = x.first;
|
currentlyHeldTitleId = x.first;
|
||||||
}
|
}
|
||||||
remove(x.second->button);
|
remove(x.second->button);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto const &x: emptyButtons) {
|
for (auto const &x : emptyButtons) {
|
||||||
remove(x);
|
remove(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -665,7 +662,7 @@ void GuiIconGrid::updateButtonPositions() {
|
|||||||
uint32_t endPage = startPage;
|
uint32_t endPage = startPage;
|
||||||
|
|
||||||
if (targetLeftPosition != currentLeftPosition) {
|
if (targetLeftPosition != currentLeftPosition) {
|
||||||
for (auto const &x: vec) {
|
for (auto const &x : vec) {
|
||||||
x.second->button->setHoldable(false);
|
x.second->button->setHoldable(false);
|
||||||
}
|
}
|
||||||
endPage++;
|
endPage++;
|
||||||
@ -673,7 +670,7 @@ void GuiIconGrid::updateButtonPositions() {
|
|||||||
endPage = pages;
|
endPage = pages;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (auto const &x: vec) {
|
for (auto const &x : vec) {
|
||||||
x.second->button->setHoldable(true);
|
x.second->button->setHoldable(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include "gui/GuiTitleBrowser.h"
|
|
||||||
#include "gui/GameIcon.h"
|
#include "gui/GameIcon.h"
|
||||||
#include "gui/GuiDragListener.h"
|
#include "gui/GuiDragListener.h"
|
||||||
#include <gui/GuiParticleImage.h>
|
#include "gui/GuiTitleBrowser.h"
|
||||||
#include "utils/AsyncExecutor.h"
|
#include "utils/AsyncExecutor.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
#include <gui/GuiParticleImage.h>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
class GuiIconGrid : public GuiTitleBrowser, public sigslot::has_slots<> {
|
class GuiIconGrid : public GuiTitleBrowser, public sigslot::has_slots<> {
|
||||||
public:
|
public:
|
||||||
@ -173,6 +173,4 @@ private:
|
|||||||
|
|
||||||
std::vector<GuiImage *> emptyIcons;
|
std::vector<GuiImage *> emptyIcons;
|
||||||
std::vector<GuiButton *> emptyButtons;
|
std::vector<GuiButton *> emptyButtons;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
#define _GUIIMAGEASYNC_H_
|
#define _GUIIMAGEASYNC_H_
|
||||||
|
|
||||||
#include <gui/GuiImage.h>
|
#include <gui/GuiImage.h>
|
||||||
#include <system/CThread.h>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#include <system/CThread.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class GuiImageAsync : public GuiImage {
|
class GuiImageAsync : public GuiImage {
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <gui/GuiImageData.h>
|
|
||||||
#include "system/memory.h"
|
#include "system/memory.h"
|
||||||
|
#include <gui/GuiImageData.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "game/GameList.h"
|
||||||
#include <gui/Gui.h>
|
#include <gui/Gui.h>
|
||||||
#include <gui/sigslot.h>
|
#include <gui/sigslot.h>
|
||||||
#include "game/GameList.h"
|
|
||||||
|
|
||||||
class GuiTitleBrowser : public GuiFrame {
|
class GuiTitleBrowser : public GuiFrame {
|
||||||
public:
|
public:
|
||||||
|
@ -1,25 +1,23 @@
|
|||||||
#include "GameSplashScreen.h"
|
#include "GameSplashScreen.h"
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "common/common.h"
|
#include "common/common.h"
|
||||||
#include "fs/FSUtils.h"
|
#include "fs/FSUtils.h"
|
||||||
#include "utils/AsyncExecutor.h"
|
#include "utils/AsyncExecutor.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
|
|
||||||
GameSplashScreen::GameSplashScreen(int32_t w, int32_t h, gameInfo *info, bool onTV) : GuiFrame(w, h),
|
GameSplashScreen::GameSplashScreen(int32_t w, int32_t h, gameInfo *info, bool onTV) : GuiFrame(w, h),
|
||||||
bgImageColor(w, h, (GX2Color) {
|
bgImageColor(w, h, (GX2Color){0, 0, 0, 0}) {
|
||||||
0, 0, 0, 0
|
bgImageColor.setImageColor((GX2Color){
|
||||||
}) {
|
79, 153, 239, 255},
|
||||||
bgImageColor.setImageColor((GX2Color) {
|
0);
|
||||||
79, 153, 239, 255
|
bgImageColor.setImageColor((GX2Color){
|
||||||
}, 0);
|
79, 153, 239, 255},
|
||||||
bgImageColor.setImageColor((GX2Color) {
|
1);
|
||||||
79, 153, 239, 255
|
bgImageColor.setImageColor((GX2Color){
|
||||||
}, 1);
|
59, 159, 223, 255},
|
||||||
bgImageColor.setImageColor((GX2Color) {
|
2);
|
||||||
59, 159, 223, 255
|
bgImageColor.setImageColor((GX2Color){
|
||||||
}, 2);
|
59, 159, 223, 255},
|
||||||
bgImageColor.setImageColor((GX2Color) {
|
3);
|
||||||
59, 159, 223, 255
|
|
||||||
}, 3);
|
|
||||||
append(&bgImageColor);
|
append(&bgImageColor);
|
||||||
this->onTV = onTV;
|
this->onTV = onTV;
|
||||||
this->info = info;
|
this->info = info;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "game/GameList.h"
|
#include "game/GameList.h"
|
||||||
#include <gui/GuiImage.h>
|
|
||||||
#include <gui/GuiFrame.h>
|
#include <gui/GuiFrame.h>
|
||||||
|
#include <gui/GuiImage.h>
|
||||||
|
|
||||||
class GameSplashScreen : public GuiFrame, public sigslot::has_slots<> {
|
class GameSplashScreen : public GuiFrame, public sigslot::has_slots<> {
|
||||||
public:
|
public:
|
||||||
@ -15,6 +15,7 @@ public:
|
|||||||
void draw(CVideo *v) override;
|
void draw(CVideo *v) override;
|
||||||
|
|
||||||
sigslot::signal3<GuiElement *, gameInfo *, bool> gameGameSplashScreenFinished;
|
sigslot::signal3<GuiElement *, gameInfo *, bool> gameGameSplashScreenFinished;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GuiImage bgImageColor;
|
GuiImage bgImageColor;
|
||||||
GuiImageData *splashScreenData = nullptr;
|
GuiImageData *splashScreenData = nullptr;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <nn/swkbd.h>
|
|
||||||
#include "KeyboardHelper.h"
|
#include "KeyboardHelper.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include <coreinit/memdefaultheap.h>
|
#include <coreinit/memdefaultheap.h>
|
||||||
|
#include <nn/swkbd.h>
|
||||||
|
|
||||||
KeyboardHelper::KeyboardHelper() {
|
KeyboardHelper::KeyboardHelper() {
|
||||||
auto *_fsClient = (FSClient *) MEMAllocFromDefaultHeap(sizeof(FSClient));
|
auto *_fsClient = (FSClient *) MEMAllocFromDefaultHeap(sizeof(FSClient));
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <coreinit/filesystem.h>
|
#include <coreinit/filesystem.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class KeyboardHelper {
|
class KeyboardHelper {
|
||||||
public:
|
public:
|
||||||
@ -24,7 +24,6 @@ public:
|
|||||||
std::string getResult();
|
std::string getResult();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void *workMemory = nullptr;
|
void *workMemory = nullptr;
|
||||||
FSClient *fsClient = nullptr;
|
FSClient *fsClient = nullptr;
|
||||||
bool keyboardOpen = false;
|
bool keyboardOpen = false;
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
sigslot::signal1<GuiElement *> settingsButtonClicked;
|
sigslot::signal1<GuiElement *> settingsButtonClicked;
|
||||||
sigslot::signal1<GuiElement *> layoutSwitchClicked;
|
sigslot::signal1<GuiElement *> layoutSwitchClicked;
|
||||||
sigslot::signal1<GuiElement *> gameListFilterClicked;
|
sigslot::signal1<GuiElement *> gameListFilterClicked;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnSettingsButtonClick(GuiButton *button, const GuiController *controller, GuiTrigger *) {
|
void OnSettingsButtonClick(GuiButton *button, const GuiController *controller, GuiTrigger *) {
|
||||||
settingsButtonClicked(this);
|
settingsButtonClicked(this);
|
||||||
|
@ -16,18 +16,18 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "utils/StringTools.h"
|
#include "utils/StringTools.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
|
|
||||||
#include "resources/Resources.h"
|
|
||||||
#include "gui/GuiTitleBrowser.h"
|
|
||||||
#include "gui/GuiIconGrid.h"
|
|
||||||
#include <sysapp/launch.h>
|
|
||||||
#include <future>
|
|
||||||
#include <coreinit/title.h>
|
|
||||||
#include <nn/acp/title.h>
|
|
||||||
#include "utils/AsyncExecutor.h"
|
|
||||||
#include "GameSplashScreen.h"
|
#include "GameSplashScreen.h"
|
||||||
|
#include "gui/GuiIconGrid.h"
|
||||||
|
#include "gui/GuiTitleBrowser.h"
|
||||||
|
#include "resources/Resources.h"
|
||||||
|
#include "utils/AsyncExecutor.h"
|
||||||
|
#include <coreinit/title.h>
|
||||||
|
#include <future>
|
||||||
|
#include <nn/acp/title.h>
|
||||||
|
#include <sysapp/launch.h>
|
||||||
|
|
||||||
MainWindow::MainWindow(int32_t w, int32_t h)
|
MainWindow::MainWindow(int32_t w, int32_t h)
|
||||||
: width(w), height(h), gameClickSound(Resources::GetSound("game_click.mp3")), mainSwitchButtonFrame(nullptr), currentTvFrame(nullptr), currentDrcFrame(nullptr) {
|
: width(w), height(h), gameClickSound(Resources::GetSound("game_click.mp3")), mainSwitchButtonFrame(nullptr), currentTvFrame(nullptr), currentDrcFrame(nullptr) {
|
||||||
@ -43,7 +43,6 @@ MainWindow::MainWindow(int32_t w, int32_t h)
|
|||||||
gameList.titleUpdated.connect(this, &MainWindow::OnGameTitleUpdated);
|
gameList.titleUpdated.connect(this, &MainWindow::OnGameTitleUpdated);
|
||||||
gameList.titleAdded.connect(this, &MainWindow::OnGameTitleAdded);
|
gameList.titleAdded.connect(this, &MainWindow::OnGameTitleAdded);
|
||||||
AsyncExecutor::execute([&] { gameList.load(); });
|
AsyncExecutor::execute([&] { gameList.load(); });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
@ -160,20 +159,20 @@ void MainWindow::update(GuiController *controller) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// //! only update TV elements that are not updated yet because they are on DRC
|
// //! only update TV elements that are not updated yet because they are on DRC
|
||||||
// for(uint32_t i = 0; (i < tvSize) && (i < tvElements.size()); ++i)
|
// for(uint32_t i = 0; (i < tvSize) && (i < tvElements.size()); ++i)
|
||||||
// {
|
// {
|
||||||
// uint32_t n;
|
// uint32_t n;
|
||||||
// for(n = 0; (n < drcSize) && (n < drcElements.size()); n++)
|
// for(n = 0; (n < drcSize) && (n < drcElements.size()); n++)
|
||||||
// {
|
// {
|
||||||
// if(tvElements[i] == drcElements[n])
|
// if(tvElements[i] == drcElements[n])
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// if(n == drcElements.size())
|
// if(n == drcElements.size())
|
||||||
// {
|
// {
|
||||||
// tvElements[i]->update(controller);
|
// tvElements[i]->update(controller);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (controller->chanIdx >= 1 && controller->chanIdx <= 4 && controller->data.validPointer) {
|
if (controller->chanIdx >= 1 && controller->chanIdx <= 4 && controller->data.validPointer) {
|
||||||
int32_t wpadIdx = controller->chanIdx - 1;
|
int32_t wpadIdx = controller->chanIdx - 1;
|
||||||
@ -354,7 +353,6 @@ void MainWindow::OnCloseEffectFinish(GuiElement *element) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::OnSettingsButtonClicked(GuiElement *element) {
|
void MainWindow::OnSettingsButtonClicked(GuiElement *element) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::OnGameSelectionChange(GuiTitleBrowser *element, uint64_t selectedIdx) {
|
void MainWindow::OnGameSelectionChange(GuiTitleBrowser *element, uint64_t selectedIdx) {
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
#ifndef _MAIN_WINDOW_H_
|
#ifndef _MAIN_WINDOW_H_
|
||||||
#define _MAIN_WINDOW_H_
|
#define _MAIN_WINDOW_H_
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <queue>
|
|
||||||
#include <gui/Gui.h>
|
|
||||||
#include "game/GameList.h"
|
|
||||||
#include "KeyboardHelper.h"
|
#include "KeyboardHelper.h"
|
||||||
#include "gui/GuiTitleBrowser.h"
|
|
||||||
#include "MainDrcButtonsFrame.h"
|
#include "MainDrcButtonsFrame.h"
|
||||||
|
#include "game/GameList.h"
|
||||||
|
#include "gui/GuiTitleBrowser.h"
|
||||||
|
#include <gui/Gui.h>
|
||||||
|
#include <queue>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class CVideo;
|
class CVideo;
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
|
#include "Resources.h"
|
||||||
|
#include "filelist.h"
|
||||||
|
#include "fs/FSUtils.h"
|
||||||
|
#include "utils/AsyncExecutor.h"
|
||||||
|
#include <gui/GuiImageData.h>
|
||||||
|
#include <gui/GuiSound.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Resources.h"
|
|
||||||
#include "filelist.h"
|
|
||||||
#include <gui/GuiSound.h>
|
|
||||||
#include <gui/GuiImageData.h>
|
|
||||||
#include "fs/FSUtils.h"
|
|
||||||
#include "utils/AsyncExecutor.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <future>
|
#include <future>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <thread>
|
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
|
||||||
Resources *Resources::instance = nullptr;
|
Resources *Resources::instance = nullptr;
|
||||||
@ -82,7 +82,7 @@ GuiImageData *Resources::GetImageData(const char *filename) {
|
|||||||
if (!instance)
|
if (!instance)
|
||||||
instance = new Resources;
|
instance = new Resources;
|
||||||
|
|
||||||
std::map<std::string, std::pair<uint32_t, GuiImageData *> >::iterator itr = instance->imageDataMap.find(std::string(filename));
|
std::map<std::string, std::pair<uint32_t, GuiImageData *>>::iterator itr = instance->imageDataMap.find(std::string(filename));
|
||||||
if (itr != instance->imageDataMap.end()) {
|
if (itr != instance->imageDataMap.end()) {
|
||||||
itr->second.first++;
|
itr->second.first++;
|
||||||
return itr->second.second;
|
return itr->second.second;
|
||||||
@ -108,7 +108,7 @@ GuiImageData *Resources::GetImageData(const char *filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Resources::RemoveImageData(GuiImageData *image) {
|
void Resources::RemoveImageData(GuiImageData *image) {
|
||||||
std::map<std::string, std::pair<uint32_t, GuiImageData *> >::iterator itr;
|
std::map<std::string, std::pair<uint32_t, GuiImageData *>>::iterator itr;
|
||||||
|
|
||||||
for (itr = instance->imageDataMap.begin(); itr != instance->imageDataMap.end(); itr++) {
|
for (itr = instance->imageDataMap.begin(); itr != instance->imageDataMap.end(); itr++) {
|
||||||
if (itr->second.second == image) {
|
if (itr->second.second == image) {
|
||||||
@ -128,7 +128,7 @@ GuiSound *Resources::GetSound(const char *filename) {
|
|||||||
if (!instance)
|
if (!instance)
|
||||||
instance = new Resources;
|
instance = new Resources;
|
||||||
|
|
||||||
std::map<std::string, std::pair<uint32_t, GuiSound *> >::iterator itr = instance->soundDataMap.find(std::string(filename));
|
std::map<std::string, std::pair<uint32_t, GuiSound *>>::iterator itr = instance->soundDataMap.find(std::string(filename));
|
||||||
if (itr != instance->soundDataMap.end()) {
|
if (itr != instance->soundDataMap.end()) {
|
||||||
itr->second.first++;
|
itr->second.first++;
|
||||||
return itr->second.second;
|
return itr->second.second;
|
||||||
@ -154,7 +154,7 @@ GuiSound *Resources::GetSound(const char *filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Resources::RemoveSound(GuiSound *sound) {
|
void Resources::RemoveSound(GuiSound *sound) {
|
||||||
std::map<std::string, std::pair<uint32_t, GuiSound *> >::iterator itr;
|
std::map<std::string, std::pair<uint32_t, GuiSound *>>::iterator itr;
|
||||||
|
|
||||||
for (itr = instance->soundDataMap.begin(); itr != instance->soundDataMap.end(); itr++) {
|
for (itr = instance->soundDataMap.begin(); itr != instance->soundDataMap.end(); itr++) {
|
||||||
if (itr->second.second == sound) {
|
if (itr->second.second == sound) {
|
||||||
|
@ -33,6 +33,6 @@ private:
|
|||||||
|
|
||||||
~Resources() {}
|
~Resources() {}
|
||||||
|
|
||||||
std::map<std::string, std::pair<uint32_t, GuiImageData *> > imageDataMap;
|
std::map<std::string, std::pair<uint32_t, GuiImageData *>> imageDataMap;
|
||||||
std::map<std::string, std::pair<uint32_t, GuiSound *> > soundDataMap;
|
std::map<std::string, std::pair<uint32_t, GuiSound *>> soundDataMap;
|
||||||
};
|
};
|
@ -23,8 +23,8 @@
|
|||||||
*
|
*
|
||||||
* for WiiXplorer 2010
|
* for WiiXplorer 2010
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include <sounds/BufferCircle.hpp>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <sounds/BufferCircle.hpp>
|
||||||
#include <utils/utils.h>
|
#include <utils/utils.h>
|
||||||
|
|
||||||
BufferCircle::BufferCircle() {
|
BufferCircle::BufferCircle() {
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
#include "fs/CFile.hpp"
|
#include "fs/CFile.hpp"
|
||||||
#include <coreinit/thread.h>
|
#include <coreinit/thread.h>
|
||||||
#include <coreinit/time.h>
|
#include <coreinit/time.h>
|
||||||
#include <sounds/Mp3Decoder.hpp>
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <sounds/Mp3Decoder.hpp>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
#include "fs/CFile.hpp"
|
#include "fs/CFile.hpp"
|
||||||
#include <coreinit/thread.h>
|
#include <coreinit/thread.h>
|
||||||
#include <coreinit/time.h>
|
#include <coreinit/time.h>
|
||||||
#include <sounds/OggDecoder.hpp>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <sounds/OggDecoder.hpp>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static int ogg_read(void *punt, int bytes, int blocks, int *f) {
|
static int ogg_read(void *punt, int bytes, int blocks, int *f) {
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#include <coreinit/cache.h>
|
#include <coreinit/cache.h>
|
||||||
#include <coreinit/thread.h>
|
#include <coreinit/thread.h>
|
||||||
#include <coreinit/time.h>
|
#include <coreinit/time.h>
|
||||||
#include <sounds/SoundDecoder.hpp>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <sounds/SoundDecoder.hpp>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
#ifndef SOUND_DECODER_HPP
|
#ifndef SOUND_DECODER_HPP
|
||||||
#define SOUND_DECODER_HPP
|
#define SOUND_DECODER_HPP
|
||||||
|
|
||||||
#include <sounds/BufferCircle.hpp>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#include <sounds/BufferCircle.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class CFile;
|
class CFile;
|
||||||
|
@ -24,12 +24,12 @@
|
|||||||
* for WiiXplorer 2010
|
* for WiiXplorer 2010
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include <fs/CFile.hpp>
|
#include <fs/CFile.hpp>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <sndcore2/core.h>
|
||||||
#include <sounds/Mp3Decoder.hpp>
|
#include <sounds/Mp3Decoder.hpp>
|
||||||
#include <sounds/OggDecoder.hpp>
|
#include <sounds/OggDecoder.hpp>
|
||||||
#include <sounds/SoundHandler.hpp>
|
#include <sounds/SoundHandler.hpp>
|
||||||
#include <sounds/WavDecoder.hpp>
|
#include <sounds/WavDecoder.hpp>
|
||||||
#include <malloc.h>
|
|
||||||
#include <sndcore2/core.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
SoundHandler *SoundHandler::handlerInstance = NULL;
|
SoundHandler *SoundHandler::handlerInstance = NULL;
|
||||||
|
@ -28,10 +28,10 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <sndcore2/voice.h>
|
||||||
#include <sounds/SoundDecoder.hpp>
|
#include <sounds/SoundDecoder.hpp>
|
||||||
#include <sounds/Voice.h>
|
#include <sounds/Voice.h>
|
||||||
#include <system/CThread.h>
|
#include <system/CThread.h>
|
||||||
#include <sndcore2/voice.h>
|
|
||||||
|
|
||||||
#define MAX_DECODERS 16 // can be increased up to 96
|
#define MAX_DECODERS 16 // can be increased up to 96
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <future>
|
|
||||||
#include <thread>
|
|
||||||
#include <queue>
|
|
||||||
#include <gui/GuiElement.h>
|
|
||||||
#include <coreinit/cache.h>
|
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
#include <coreinit/cache.h>
|
||||||
|
#include <future>
|
||||||
|
#include <gui/GuiElement.h>
|
||||||
|
#include <queue>
|
||||||
|
#include <thread>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class AsyncExecutor {
|
class AsyncExecutor {
|
||||||
public:
|
public:
|
||||||
|
@ -23,17 +23,16 @@
|
|||||||
*
|
*
|
||||||
* for WiiXplorer 2010
|
* for WiiXplorer 2010
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <string.h>
|
||||||
#include <wchar.h>
|
#include <string>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <wut_types.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <utils/StringTools.h>
|
#include <utils/StringTools.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <wchar.h>
|
||||||
|
#include <wut_types.h>
|
||||||
|
|
||||||
|
|
||||||
BOOL StringTools::EndsWith(const std::string &a, const std::string &b) {
|
BOOL StringTools::EndsWith(const std::string &a, const std::string &b) {
|
||||||
@ -214,7 +213,6 @@ bool StringTools::findStringIC(const std::string &strHaystack, const std::string
|
|||||||
auto it = std::search(
|
auto it = std::search(
|
||||||
strHaystack.begin(), strHaystack.end(),
|
strHaystack.begin(), strHaystack.end(),
|
||||||
strNeedle.begin(), strNeedle.end(),
|
strNeedle.begin(), strNeedle.end(),
|
||||||
[](char ch1, char ch2) { return std::toupper(ch1) == std::toupper(ch2); }
|
[](char ch1, char ch2) { return std::toupper(ch1) == std::toupper(ch2); });
|
||||||
);
|
|
||||||
return (it != strHaystack.end());
|
return (it != strHaystack.end());
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,11 @@
|
|||||||
#ifndef __STRING_TOOLS_H
|
#ifndef __STRING_TOOLS_H
|
||||||
#define __STRING_TOOLS_H
|
#define __STRING_TOOLS_H
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <wut_types.h>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <wut_types.h>
|
||||||
|
|
||||||
class StringTools {
|
class StringTools {
|
||||||
public:
|
public:
|
||||||
@ -91,4 +91,3 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __STRING_TOOLS_H */
|
#endif /* __STRING_TOOLS_H */
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <whb/log.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <whb/log.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -10,15 +10,16 @@ extern "C" {
|
|||||||
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
||||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \
|
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) \
|
||||||
WHBLogPrintf("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
do { \
|
||||||
|
WHBLogPrintf("[%23s]%30s@L%04d: " FMT "", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...)do { \
|
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) \
|
||||||
WHBLogWritef("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
do { \
|
||||||
|
WHBLogWritef("[%23s]%30s@L%04d: " FMT "", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include <string.h>
|
#include <malloc.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <malloc.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <utils/logger.h>
|
#include <utils/logger.h>
|
||||||
|
|
||||||
// https://gist.github.com/ccbrown/9722406
|
// https://gist.github.com/ccbrown/9722406
|
||||||
|
@ -9,21 +9,22 @@ extern "C" {
|
|||||||
|
|
||||||
#define LIMIT(x, min, max) \
|
#define LIMIT(x, min, max) \
|
||||||
({ \
|
({ \
|
||||||
typeof( x ) _x = x; \
|
typeof(x) _x = x; \
|
||||||
typeof( min ) _min = min; \
|
typeof(min) _min = min; \
|
||||||
typeof( max ) _max = max; \
|
typeof(max) _max = max; \
|
||||||
( ( ( _x ) < ( _min ) ) ? ( _min ) : ( ( _x ) > ( _max ) ) ? ( _max) : ( _x ) ); \
|
(((_x) < (_min)) ? (_min) : ((_x) > (_max)) ? (_max) \
|
||||||
})
|
: (_x)); \
|
||||||
|
})
|
||||||
|
|
||||||
#define DegToRad(a) ( (a) * 0.01745329252f )
|
#define DegToRad(a) ((a) *0.01745329252f)
|
||||||
#define RadToDeg(a) ( (a) * 57.29577951f )
|
#define RadToDeg(a) ((a) *57.29577951f)
|
||||||
|
|
||||||
#define ALIGN4(x) (((x) + 3) & ~3)
|
#define ALIGN4(x) (((x) + 3) & ~3)
|
||||||
#define ALIGN32(x) (((x) + 31) & ~31)
|
#define ALIGN32(x) (((x) + 31) & ~31)
|
||||||
|
|
||||||
#define le16(i) ((((uint16_t) ((i) & 0xFF)) << 8) | ((uint16_t) (((i) & 0xFF00) >> 8)))
|
#define le16(i) ((((uint16_t) ((i) &0xFF)) << 8) | ((uint16_t) (((i) &0xFF00) >> 8)))
|
||||||
#define le32(i) ((((uint32_t)le16((i) & 0xFFFF)) << 16) | ((uint32_t)le16(((i) & 0xFFFF0000) >> 16)))
|
#define le32(i) ((((uint32_t) le16((i) &0xFFFF)) << 16) | ((uint32_t) le16(((i) &0xFFFF0000) >> 16)))
|
||||||
#define le64(i) ((((uint64_t)le32((i) & 0xFFFFFFFFLL)) << 32) | ((uint64_t)le32(((i) & 0xFFFFFFFF00000000LL) >> 32)))
|
#define le64(i) ((((uint64_t) le32((i) &0xFFFFFFFFLL)) << 32) | ((uint64_t) le32(((i) &0xFFFFFFFF00000000LL) >> 32)))
|
||||||
|
|
||||||
//Needs to have log_init() called beforehand.
|
//Needs to have log_init() called beforehand.
|
||||||
void dumpHex(const void *data, size_t size);
|
void dumpHex(const void *data, size_t size);
|
||||||
|
@ -14,17 +14,17 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
#include "system/memory.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include "system/memory.h"
|
#include <malloc.h>
|
||||||
|
#include <string.h>
|
||||||
#include <video/CVideo.h>
|
#include <video/CVideo.h>
|
||||||
#include <video/shaders/ColorShader.h>
|
#include <video/shaders/ColorShader.h>
|
||||||
#include <video/shaders/FXAAShader.h>
|
#include <video/shaders/FXAAShader.h>
|
||||||
#include <video/shaders/Shader3D.h>
|
#include <video/shaders/Shader3D.h>
|
||||||
#include <video/shaders/ShaderFractalColor.h>
|
#include <video/shaders/ShaderFractalColor.h>
|
||||||
#include <video/shaders/Texture2DShader.h>
|
#include <video/shaders/Texture2DShader.h>
|
||||||
#include <malloc.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
CVideo::CVideo(int32_t forceTvScanMode, int32_t forceDrcScanMode) {
|
CVideo::CVideo(int32_t forceTvScanMode, int32_t forceDrcScanMode) {
|
||||||
tvEnabled = false;
|
tvEnabled = false;
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <video/shaders/ColorShader.h>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <video/shaders/ColorShader.h>
|
||||||
|
|
||||||
static const uint32_t cpVertexShaderProgram[] = {
|
static const uint32_t cpVertexShaderProgram[] = {
|
||||||
0x00000000, 0x00008009, 0x20000000, 0x000078a0,
|
0x00000000, 0x00008009, 0x20000000, 0x000078a0,
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <video/shaders/FXAAShader.h>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <video/shaders/FXAAShader.h>
|
||||||
|
|
||||||
static const uint32_t cpVertexShaderProgram[] = {
|
static const uint32_t cpVertexShaderProgram[] = {
|
||||||
0x00000000, 0x00008009, 0x20000000, 0x000004a0,
|
0x00000000, 0x00008009, 0x20000000, 0x000004a0,
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <video/shaders/Shader3D.h>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <video/shaders/Shader3D.h>
|
||||||
|
|
||||||
static const uint32_t cpVertexShaderProgram[] = {
|
static const uint32_t cpVertexShaderProgram[] = {
|
||||||
0x00000000, 0x00008009, 0x20000000, 0x0000e4a1,
|
0x00000000, 0x00008009, 0x20000000, 0x0000e4a1,
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <video/shaders/ShaderFractalColor.h>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <video/shaders/ShaderFractalColor.h>
|
||||||
|
|
||||||
static const uint32_t cpVertexShaderProgram[] = {
|
static const uint32_t cpVertexShaderProgram[] = {
|
||||||
0x00000000, 0x00008009, 0x20000000, 0x0000eca1,
|
0x00000000, 0x00008009, 0x20000000, 0x0000eca1,
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <video/shaders/Texture2DShader.h>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <video/shaders/Texture2DShader.h>
|
||||||
|
|
||||||
static const uint32_t cpVertexShaderProgram[] = {
|
static const uint32_t cpVertexShaderProgram[] = {
|
||||||
0x00000000, 0x00008009, 0x20000000, 0x000080a0,
|
0x00000000, 0x00008009, 0x20000000, 0x000080a0,
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
#define VERTEX_SHADER_H
|
#define VERTEX_SHADER_H
|
||||||
|
|
||||||
#include <gui/gx2_ext.h>
|
#include <gui/gx2_ext.h>
|
||||||
#include <video/shaders/Shader.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <video/shaders/Shader.h>
|
||||||
|
|
||||||
class VertexShader : public Shader {
|
class VertexShader : public Shader {
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user