sdcafiine_plugin/src/main.cpp

38 lines
1.0 KiB
C++
Raw Normal View History

2021-04-06 16:58:19 +02:00
#include "modpackSelector.h"
2022-02-04 15:05:17 +01:00
#include "utils/logger.h"
#include <content_redirection/redirection.h>
2021-04-06 16:58:19 +02:00
#include <coreinit/title.h>
2022-02-04 15:05:17 +01:00
#include <wups.h>
2021-04-06 16:58:19 +02:00
WUPS_PLUGIN_NAME("SDCafiine");
WUPS_PLUGIN_DESCRIPTION("SDCafiine");
2021-04-06 16:58:19 +02:00
WUPS_PLUGIN_VERSION("0.1");
WUPS_PLUGIN_AUTHOR("Maschell");
WUPS_PLUGIN_LICENSE("GPL");
2021-10-02 11:43:15 +02:00
WUPS_USE_WUT_DEVOPTAB();
2021-04-06 16:58:19 +02:00
CRLayerHandle contentLayerHandle __attribute__((section(".data"))) = 0;
INITIALIZE_PLUGIN() {
// But then use libcontentredirection instead.
ContentRedirectionStatus error;
if ((error = ContentRedirection_InitLibrary()) != CONTENT_REDIRECTION_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Failed to init ContentRedirection. Error %d", error);
OSFatal("Failed to init ContentRedirection.");
}
}
2021-04-06 16:58:19 +02:00
/* Entry point */
ON_APPLICATION_START() {
initLogging();
2021-04-06 16:58:19 +02:00
HandleMultiModPacks(OSGetTitleID());
}
2022-02-04 15:05:17 +01:00
ON_APPLICATION_ENDS() {
if (contentLayerHandle != 0) {
ContentRedirection_RemoveFSLayer(contentLayerHandle);
contentLayerHandle = 0;
}
deinitLogging();
2021-04-06 16:58:19 +02:00
}