This commit is contained in:
BernardoGiordano 2019-03-10 10:15:34 +01:00
parent b91a1684eb
commit b5f98b7a3a
6 changed files with 15 additions and 28 deletions

View file

@ -187,7 +187,7 @@ ifeq ($(OS),Windows_NT)
else
@cd $(SHARKIVE) && python3 joiner.py 3ds
endif
@cd $(SHARKIVE)/$(BUILD) && mv 3ds.json ../../3ds/$(ROMFS)/$(CHEATS)
@cd $(SHARKIVE)/$(BUILD) && mv 3ds.json ../../3ds/$(ROMFS)/$(CHEATS)/$(CHEATS).json
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile $(OUTPUT).3dsx
@bannertool makebanner -i "$(BANNER_IMAGE)" -a "$(BANNER_AUDIO)" -o $(BUILD)/banner.bnr
@bannertool makesmdh -s "$(APP_TITLE)" -l "$(APP_DESCRIPTION)" -p "$(APP_AUTHOR)" -i "$(APP_ICON)" -f "$(ICON_FLAGS)" -o $(BUILD)/icon.icn

View file

@ -45,7 +45,9 @@ SOURCES := source ../common
DATA := data
INCLUDES := include ../common
EXEFS_SRC := exefs_src
ROMFS := romfs
ROMFS := romfs
SHARKIVE := ../sharkive
CHEATS := cheats
#---------------------------------------------------------------------------------
# options for code generation
@ -160,7 +162,13 @@ endif
all: $(BUILD)
$(BUILD):
@[ -d $@ ] || mkdir -p $@ $(BUILD) $(OUTDIR) $(ROMFS)/cheats
@[ -d $@ ] || mkdir -p $@ $(BUILD) $(OUTDIR) $(ROMFS)/$(CHEATS)
ifeq ($(OS),Windows_NT)
@cd $(SHARKIVE) && py -3 joiner.py switch
else
@cd $(SHARKIVE) && python3 joiner.py switch
endif
@cd $(SHARKIVE)/$(BUILD) && mv switch.json ../../switch/$(ROMFS)/$(CHEATS)/$(CHEATS).json
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
@ -168,7 +176,6 @@ clean:
@echo clean ...
@rm -fr $(BUILD) $(OUTDIR)
#---------------------------------------------------------------------------------
else
.PHONY: all

View file

@ -6,7 +6,6 @@ static SDL_Texture* s_star;
static SDL_Texture* s_checkbox;
static SDL_Texture* s_flag;
static SDL_Texture* s_pokeball;
// static Mix_Music* s_click;
static PlFontData fontData, fontExtData;
static std::unordered_map<int, FC_Font*> s_fonts;
@ -58,14 +57,6 @@ bool SDLH_Init(void)
SDLH_LoadImage(&s_checkbox, "romfs:/checkbox.png");
SDL_SetTextureColorMod(s_checkbox, theme().c1.r, theme().c1.g, theme().c1.b);
// const int mix_flags = MIX_INIT_OGG;
// if ((Mix_Init(mix_flags) & mix_flags) != mix_flags)
// {
// fprintf(stderr, "Mix_Init: %s\n", Mix_GetError());
// }
// Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 4096);
// s_click = Mix_LoadMUS("romfs:/click.ogg");
plGetSharedFontByType(&fontData, PlSharedFontType_Standard);
plGetSharedFontByType(&fontExtData, PlSharedFontType_NintendoExt);
@ -80,9 +71,6 @@ void SDLH_Exit(void)
}
TTF_Quit();
// Mix_FreeMusic(s_click);
// Mix_CloseAudio();
// Mix_Quit();
SDL_DestroyTexture(s_flag);
SDL_DestroyTexture(s_star);
SDL_DestroyTexture(s_checkbox);
@ -199,9 +187,4 @@ void SDLH_DrawIcon(std::string icon, int x, int y)
if (t != nullptr) {
SDLH_DrawImage(t, x, y);
}
}
// void SDLH_PlayClick(void)
// {
// Mix_PlayMusic(s_click, 1);
// }
}

View file

@ -96,9 +96,7 @@ std::string Account::username(u128 id)
SDL_Texture* Account::icon(u128 id)
{
std::map<u128, User>::const_iterator got = mUsers.find(id);
// TODO: remove the null check
// the null check in the icon is to handle the bad memory issue that isn't yet fixed
if (got == mUsers.end() || got->second.icon == NULL)
if (got == mUsers.end())
{
User user = getUser(id);
mUsers.insert({id, user});

View file

@ -36,7 +36,7 @@ static const struct Theme defaultTheme = {
COLOR_WHITE
};
static const struct Theme pkmsTheme = {
static const struct Theme pksmTheme = {
{17, 38, 85, 255},
COLOR_HIGHBLUE,
COLOR_DARKBLUE,
@ -51,7 +51,7 @@ static struct Theme currentTheme = defaultTheme;
void theme(int t)
{
switch(t) {
case THEME_PKSM: currentTheme = pkmsTheme; break;
case THEME_PKSM: currentTheme = pksmTheme; break;
default: currentTheme = defaultTheme; break;
}
}

View file

@ -118,7 +118,6 @@ bool io::directoryExists(const std::string& path)
return (stat(path.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode));
}
// https://stackoverflow.com/questions/2256945/removing-a-non-empty-directory-programmatically-in-c-or-c
Result io::deleteFolderRecursively(const std::string& path)
{
Directory dir(path);