Use __SWITCH__ rather than SWITCH
This commit is contained in:
parent
7d5617254a
commit
27d195e118
@ -46,7 +46,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
|
|||||||
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
||||||
$(ARCH) $(DEFINES)
|
$(ARCH) $(DEFINES)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE) -DSWITCH -DVERSION=\"$(APP_VERSION)\"
|
CFLAGS += $(INCLUDE) -D__SWITCH__ -DVERSION=\"$(APP_VERSION)\"
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ typedef union {
|
|||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
|
|
||||||
// when building for pc we need to include nro.h separately
|
// when building for pc we need to include nro.h separately
|
||||||
#ifndef SWITCH
|
#ifndef __SWITCH__
|
||||||
#include "nro.h"
|
#include "nro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ static inline color_t MakeColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
|
|||||||
return clr;
|
return clr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
extern uint8_t* g_framebuf;
|
extern uint8_t* g_framebuf;
|
||||||
extern u32 g_framebuf_width;
|
extern u32 g_framebuf_width;
|
||||||
static inline void DrawPixel(uint32_t x, uint32_t y, color_t clr)
|
static inline void DrawPixel(uint32_t x, uint32_t y, color_t clr)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
#define STR_JP(_str) [SetLanguage_JA] = _str
|
#define STR_JP(_str) [SetLanguage_JA] = _str
|
||||||
#define STR_EN(_str) [SetLanguage_ENUS] = _str, [SetLanguage_ENGB] = _str
|
#define STR_EN(_str) [SetLanguage_ENUS] = _str, [SetLanguage_ENGB] = _str
|
||||||
#define STR_FR(_str) [SetLanguage_FR] = _str, [SetLanguage_FRCA] = _str
|
#define STR_FR(_str) [SetLanguage_FR] = _str, [SetLanguage_FRCA] = _str
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ int menuScan(const char* target) {
|
|||||||
memset(tmp_path, 0, sizeof(tmp_path));
|
memset(tmp_path, 0, sizeof(tmp_path));
|
||||||
snprintf(tmp_path, sizeof(tmp_path)-1, "%s/%s", s_menu[!s_curMenu].dirname, dp->d_name);
|
snprintf(tmp_path, sizeof(tmp_path)-1, "%s/%s", s_menu[!s_curMenu].dirname, dp->d_name);
|
||||||
|
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
fsdev_dir_t* dirSt = (fsdev_dir_t*)dir->dirData->dirStruct;
|
fsdev_dir_t* dirSt = (fsdev_dir_t*)dir->dirData->dirStruct;
|
||||||
FsDirectoryEntry* entry = &dirSt->entry_data[dirSt->index];
|
FsDirectoryEntry* entry = &dirSt->entry_data[dirSt->index];
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ void computeFrontGradient(color_t baseColor, int height) {
|
|||||||
void menuStartup() {
|
void menuStartup() {
|
||||||
const char *path;
|
const char *path;
|
||||||
|
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
path = "sdmc:/switch";
|
path = "sdmc:/switch";
|
||||||
#else
|
#else
|
||||||
path = "switch";
|
path = "switch";
|
||||||
@ -305,7 +305,7 @@ void drawBackBtn(menu_s* menu, bool emptyDir) {
|
|||||||
x_text = 1280 - 90 - 30 - 32;
|
x_text = 1280 - 90 - 30 - 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
if (strcmp( menu->dirname, "sdmc:/") != 0)
|
if (strcmp( menu->dirname, "sdmc:/") != 0)
|
||||||
#else
|
#else
|
||||||
if (strcmp( menu->dirname, "/") != 0)
|
if (strcmp( menu->dirname, "/") != 0)
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#include "text.h"
|
#include "text.h"
|
||||||
|
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
static int s_textLang = SetLanguage_ENUS;
|
static int s_textLang = SetLanguage_ENUS;
|
||||||
#else
|
#else
|
||||||
static int s_textLang = 1;
|
static int s_textLang = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void textInit(void) {
|
void textInit(void) {
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
//u64 LanguageCode=0;
|
//u64 LanguageCode=0;
|
||||||
//s32 Language=0;
|
//s32 Language=0;
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ int textGetLang(void) {
|
|||||||
|
|
||||||
const char* textGetString(StrId id) {
|
const char* textGetString(StrId id) {
|
||||||
const char* str = g_strings[id][s_textLang];
|
const char* str = g_strings[id][s_textLang];
|
||||||
#ifdef SWITCH
|
#ifdef __SWITCH__
|
||||||
if (!str) str = g_strings[id][SetLanguage_ENUS];
|
if (!str) str = g_strings[id][SetLanguage_ENUS];
|
||||||
#else
|
#else
|
||||||
if (!str) str = g_strings[id][1];
|
if (!str) str = g_strings[id][1];
|
||||||
|
Loading…
Reference in New Issue
Block a user