Add default icon when a .rpx is loaded or the .wuhb contains no icon

This commit is contained in:
Maschell 2022-08-25 17:14:26 +02:00
parent 9b04ae206b
commit 85fb2c141e
4 changed files with 5475 additions and 1 deletions

View File

@ -22,6 +22,7 @@ WUT_ROOT := $(DEVKITPRO)/wut
TARGET := RPXLoadingModule TARGET := RPXLoadingModule
BUILD := build BUILD := build
SOURCES := src \ SOURCES := src \
src/data \
src/utils src/utils
DATA := data DATA := data
INCLUDES := src INCLUDES := src

View File

@ -1,4 +1,5 @@
#include "RPXLoading.h" #include "RPXLoading.h"
#include "data/defaultIcon.h"
#include "globals.h" #include "globals.h"
#include "utils/FileReader.h" #include "utils/FileReader.h"
#include "utils/StringTools.h" #include "utils/StringTools.h"
@ -172,6 +173,7 @@ RPXLoaderStatus RL_PrepareLaunchFromSD(const char *bundle_path) {
memcpy(gReplacementInfo.rpxReplacementInfo.iconCache, buffer, cpySize); memcpy(gReplacementInfo.rpxReplacementInfo.iconCache, buffer, cpySize);
free(buffer); free(buffer);
} else { } else {
memcpy(gReplacementInfo.rpxReplacementInfo.iconCache, defaultIconTexTGA, ICON_SIZE);
DEBUG_FUNCTION_LINE_ERR("Failed to read iconTex.tga"); DEBUG_FUNCTION_LINE_ERR("Failed to read iconTex.tga");
} }
@ -182,7 +184,7 @@ RPXLoaderStatus RL_PrepareLaunchFromSD(const char *bundle_path) {
} }
} else { } else {
if (!gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted) { if (!gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted) {
memset(gReplacementInfo.rpxReplacementInfo.iconCache, 0, sizeof(gReplacementInfo.rpxReplacementInfo.iconCache)); memcpy(gReplacementInfo.rpxReplacementInfo.iconCache, defaultIconTexTGA, ICON_SIZE);
} }
} }

5468
src/data/defaultIcon.c Normal file

File diff suppressed because it is too large Load Diff

3
src/data/defaultIcon.h Normal file
View File

@ -0,0 +1,3 @@
#include <stdint.h>
extern uint8_t defaultIconTexTGA[];