Skip to content

Commit

Permalink
remove options
Browse files Browse the repository at this point in the history
margin h/v
  • Loading branch information
bucanero committed Jan 27, 2023
1 parent 730e4df commit 36168e6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 59 deletions.
4 changes: 0 additions & 4 deletions include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ typedef struct
uint8_t music;
uint8_t doSort;
uint8_t doAni;
uint8_t marginH;
uint8_t marginV;
uint8_t update;
uint32_t user_id;
uint64_t idps[2];
Expand All @@ -48,8 +46,6 @@ void owner_callback(int sel);
void music_callback(int sel);
void sort_callback(int sel);
void ani_callback(int sel);
void horm_callback(int sel);
void verm_callback(int sel);
void update_callback(int sel);
void redetect_callback(int sel);
void clearcache_callback(int sel);
Expand Down
23 changes: 10 additions & 13 deletions source/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ void DrawBackground2D(u32 rgba)
{
tiny3d_SetPolygon(TINY3D_QUADS);

tiny3d_VertexPos(-apollo_config.marginH, -apollo_config.marginV, 65535);
tiny3d_VertexPos(0, 0, 65535);
tiny3d_VertexColor(rgba);

tiny3d_VertexPos(847 + apollo_config.marginH, -apollo_config.marginV, 65535);
tiny3d_VertexPos(848, 0, 65535);

tiny3d_VertexPos(847 + apollo_config.marginH, 511 + apollo_config.marginV, 65535);
tiny3d_VertexPos(848, 512, 65535);

tiny3d_VertexPos(-apollo_config.marginH, 511 + apollo_config.marginV, 65535);
tiny3d_VertexPos(0, 512, 65535);
tiny3d_End();
}

Expand Down Expand Up @@ -236,10 +236,7 @@ void DrawHeader(int icon, int xOff, const char * hdrTitle, const char * headerSu

void DrawBackgroundTexture(int x, u8 alpha)
{
if (x == 0)
DrawTexture(&menu_textures[bgimg_png_index], x - apollo_config.marginH, -apollo_config.marginV, 0, 848 - x + (apollo_config.marginH * 2), 512 + (apollo_config.marginV * 2), 0xFFFFFF00 | alpha);
else
DrawTexture(&menu_textures[bgimg_png_index], x, -apollo_config.marginV, 0, 848 - x + apollo_config.marginH, 512 + (apollo_config.marginV * 2), 0xFFFFFF00 | alpha);
DrawTexture(&menu_textures[bgimg_png_index], x, 0, 0, 848 - x, 512, 0xFFFFFF00 | alpha);
}

void DrawTexture(png_texture* tex, int x, int y, int z, int w, int h, u32 rgba)
Expand Down Expand Up @@ -353,24 +350,24 @@ void stop_loading_screen()
static void drawJar(uint8_t idx, int pos_x, int pos_y, const char* text, uint8_t alpha)
{
uint8_t active = (menu_sel + jar_trophy_png_index == idx);
DrawTexture(&menu_textures[idx], pos_x, apollo_config.marginV + pos_y, 0, menu_textures[idx].texture.width * SCREEN_W_ADJ, menu_textures[idx].texture.height * SCREEN_H_ADJ, 0xffffff00 | alpha);
DrawTexture(&menu_textures[idx], pos_x, pos_y, 0, menu_textures[idx].texture.width * SCREEN_W_ADJ, menu_textures[idx].texture.height * SCREEN_H_ADJ, 0xffffff00 | alpha);

//Selected
if (active)
DrawTexture(&menu_textures[idx + JAR_COLUMNS], pos_x, apollo_config.marginV + pos_y, 0, menu_textures[idx + JAR_COLUMNS].texture.width * SCREEN_W_ADJ, menu_textures[idx + JAR_COLUMNS].texture.height * SCREEN_H_ADJ, 0xffffff00 | alpha);
DrawTexture(&menu_textures[idx + JAR_COLUMNS], pos_x, pos_y, 0, menu_textures[idx + JAR_COLUMNS].texture.width * SCREEN_W_ADJ, menu_textures[idx + JAR_COLUMNS].texture.height * SCREEN_H_ADJ, 0xffffff00 | alpha);

SetFontColor(APP_FONT_MENU_COLOR | (alpha == 0xFF ? (active ? 0xFF : 32) : alpha), 0);
DrawStringMono(pos_x + (menu_textures[idx].texture.width * SCREEN_W_ADJ / 2), apollo_config.marginV + pos_y - 25, text);
DrawStringMono(pos_x + (menu_textures[idx].texture.width * SCREEN_W_ADJ / 2), pos_y - 25, text);
}

static void _drawColumn(uint8_t idx, int pos_x, int pos_y, uint8_t alpha)
{
DrawTexture(&menu_textures[idx], pos_x, apollo_config.marginV + pos_y, 0, menu_textures[idx].texture.width * SCREEN_W_ADJ, menu_textures[idx].texture.height * SCREEN_H_ADJ, 0xffffff00 | alpha);
DrawTexture(&menu_textures[idx], pos_x, pos_y, 0, menu_textures[idx].texture.width * SCREEN_W_ADJ, menu_textures[idx].texture.height * SCREEN_H_ADJ, 0xffffff00 | alpha);
}

void drawColumns(uint8_t alpha)
{
// DrawTexture(&menu_textures[bg_water_png_index], bg_water_png_x - apollo_config.marginH, apollo_config.marginV + bg_water_png_y, 0, bg_water_png_w + (apollo_config.marginH * 2), bg_water_png_h, 0xffffff00 | 0xFF);
// DrawTexture(&menu_textures[bg_water_png_index], bg_water_png_x - apollo_config.marginH, bg_water_png_y, 0, bg_water_png_w + (apollo_config.marginH * 2), bg_water_png_h, 0xffffff00 | 0xFF);

//Columns
_drawColumn(column_1_png_index, column_1_png_x, column_1_png_y, alpha);
Expand Down
6 changes: 2 additions & 4 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ app_config_t apollo_config = {
.doSort = 1,
.doAni = 1,
.update = 1,
.marginH = 0,
.marginV = 0,
.user_id = 0,
.idps = {0, 0},
.psid = {0, 0},
Expand Down Expand Up @@ -233,7 +231,7 @@ static void LoadTextures_Menu()

free_mem = (u32*) init_ttf_table((u16*) free_mem);

set_ttf_window(0, 0, 848 + apollo_config.marginH, 512 + apollo_config.marginV, WIN_SKIP_LF);
set_ttf_window(0, 0, 848, 512, WIN_SKIP_LF);
// TTFUnloadFont();

//Init Main Menu textures
Expand Down Expand Up @@ -505,7 +503,7 @@ s32 main(s32 argc, const char* argv[])
if (file_exists(APOLLO_PATH OWNER_XML_FILE) == SUCCESS)
save_xml_owner(APOLLO_PATH OWNER_XML_FILE, NULL);

menu_options[8].options = get_xml_owners(APOLLO_PATH OWNER_XML_FILE);
menu_options[6].options = get_xml_owners(APOLLO_PATH OWNER_XML_FILE);

// Set PFD keys from loaded settings
pfd_util_setup_keys();
Expand Down
12 changes: 6 additions & 6 deletions source/menu_cheats.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void Draw_CheatsMenu_Options_Ani_Exit(void)
rgbVal = 0xD0;
Draw_CheatsMenu_Selection(menu_old_sel[5], (rgbVal << 24) | (rgbVal << 16) | (rgbVal << 8) | 0xFF);

DrawTexture(&menu_textures[edit_shadow_png_index], left - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -apollo_config.marginV, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (apollo_config.marginV * 2), icon_a);
DrawTexture(&menu_textures[edit_shadow_png_index], left - menu_textures[edit_shadow_png_index].texture.width + 1, 0, 0, menu_textures[edit_shadow_png_index].texture.width, 512, icon_a);
DrawHeader(cat_cheats_png_index, left, selected_centry->name, "Options", APP_FONT_TITLE_COLOR | icon_a, 0xffffffff, 1);
/*
int _game_a = (int)(icon_a - (max / 2)) * 2;
Expand Down Expand Up @@ -151,7 +151,7 @@ void Draw_CheatsMenu_Options_Ani(void)
rgbVal = 0xD0;
Draw_CheatsMenu_Selection(menu_sel, (rgbVal << 24) | (rgbVal << 16) | (rgbVal << 8) | 0xFF);

DrawTexture(&menu_textures[edit_shadow_png_index], left - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -apollo_config.marginV, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (apollo_config.marginV * 2), icon_a);
DrawTexture(&menu_textures[edit_shadow_png_index], left - menu_textures[edit_shadow_png_index].texture.width + 1, 0, 0, menu_textures[edit_shadow_png_index].texture.width, 512, icon_a);
DrawHeader(cat_cheats_png_index, left, selected_centry->name, "Options", APP_FONT_TITLE_COLOR | icon_a, 0xffffffff, 1);

u8 game_a = (u8)(icon_a < 0x8F ? 0 : icon_a);
Expand All @@ -171,7 +171,7 @@ void Draw_CheatsMenu_Options(void)

Draw_CheatsMenu_Selection(menu_old_sel[5], 0xD0D0D0FF);

DrawTexture(&menu_textures[edit_shadow_png_index], MENU_SPLIT_OFF - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -apollo_config.marginV, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (apollo_config.marginV * 2), 0x000000FF);
DrawTexture(&menu_textures[edit_shadow_png_index], MENU_SPLIT_OFF - menu_textures[edit_shadow_png_index].texture.width + 1, 0, 0, menu_textures[edit_shadow_png_index].texture.width, 512, 0x000000FF);
DrawHeader(cat_cheats_png_index, MENU_SPLIT_OFF, selected_centry->name, "Options", APP_FONT_TITLE_COLOR | 0xFF, 0xffffffff, 1);

DrawOptions(&selected_centry->options[option_index], 0xFF, 20, menu_sel);
Expand Down Expand Up @@ -270,7 +270,7 @@ void Draw_CheatsMenu_View_Ani_Exit(void)
rgbVal = 0xD0;
Draw_CheatsMenu_Selection(menu_old_sel[5], (rgbVal << 24) | (rgbVal << 16) | (rgbVal << 8) | 0xFF);

DrawTexture(&menu_textures[edit_shadow_png_index], left - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -apollo_config.marginV, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (apollo_config.marginV * 2), icon_a);
DrawTexture(&menu_textures[edit_shadow_png_index], left - menu_textures[edit_shadow_png_index].texture.width + 1, 0, 0, menu_textures[edit_shadow_png_index].texture.width, 512, icon_a);
DrawHeader(cat_cheats_png_index, left, "Details", selected_centry->name, APP_FONT_TITLE_COLOR | icon_a, 0xffffffff, 1);
/*
int _game_a = (int)(icon_a - (max / 2)) * 2;
Expand Down Expand Up @@ -309,7 +309,7 @@ void Draw_CheatsMenu_View_Ani(const char* title)
rgbVal = 0xD0;
Draw_CheatsMenu_Selection(menu_sel, (rgbVal << 24) | (rgbVal << 16) | (rgbVal << 8) | 0xFF);

DrawTexture(&menu_textures[edit_shadow_png_index], left - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -apollo_config.marginV, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (apollo_config.marginV * 2), icon_a);
DrawTexture(&menu_textures[edit_shadow_png_index], left - menu_textures[edit_shadow_png_index].texture.width + 1, 0, 0, menu_textures[edit_shadow_png_index].texture.width, 512, icon_a);
DrawHeader(cat_cheats_png_index, left, title, selected_centry->name, APP_FONT_TITLE_COLOR | icon_a, 0xffffffff, 1);

u8 game_a = (u8)(icon_a < 0x8F ? 0 : icon_a);
Expand All @@ -329,7 +329,7 @@ void Draw_CheatsMenu_View(const char* title)

Draw_CheatsMenu_Selection(menu_old_sel[5], 0xD0D0D0FF);

DrawTexture(&menu_textures[edit_shadow_png_index], MENU_SPLIT_OFF - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -apollo_config.marginV, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (apollo_config.marginV * 2), 0x000000FF);
DrawTexture(&menu_textures[edit_shadow_png_index], MENU_SPLIT_OFF - menu_textures[edit_shadow_png_index].texture.width + 1, 0, 0, menu_textures[edit_shadow_png_index].texture.width, 512, 0x000000FF);
DrawHeader(cat_cheats_png_index, MENU_SPLIT_OFF, title, selected_centry->name, APP_FONT_TITLE_COLOR | 0xFF, 0xffffffff, 1);

int nlines = DrawCodes(selected_centry, 0xFF, 20, MENU_SPLIT_OFF, menu_sel);
Expand Down
4 changes: 2 additions & 2 deletions source/menu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void initMenuOptions()
}

// default account owner
*menu_options[8].value = menu_options_maxsel[8] - 1;
*menu_options[6].value = menu_options_maxsel[6] - 1;
}

static void LoadFileTexture(const char* fname, int idx)
Expand Down Expand Up @@ -458,7 +458,7 @@ static void doOptionsMenu()
else if (paddata[0].BTN_CIRCLE)
{
save_app_settings(&apollo_config);
set_ttf_window(0, 0, 848 + apollo_config.marginH, 512 + apollo_config.marginV, WIN_SKIP_LF);
set_ttf_window(0, 0, 848, 512, WIN_SKIP_LF);
SetMenu(MENU_MAIN_SCREEN);
return;
}
Expand Down
30 changes: 0 additions & 30 deletions source/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ menu_option_t menu_options[] = {
.value = &apollo_config.doSort,
.callback = sort_callback
},
{ .name = "Screen Horizontal Margin",
.options = NULL,
.type = APP_OPTION_INC,
.value = &apollo_config.marginH,
.callback = horm_callback
},
{ .name = "Screen Vertical Margin",
.options = NULL,
.type = APP_OPTION_INC,
.value = &apollo_config.marginV,
.callback = verm_callback
},
{ .name = "\nVersion Update Check",
.options = NULL,
.type = APP_OPTION_BOOL,
Expand Down Expand Up @@ -97,24 +85,6 @@ void ani_callback(int sel)
apollo_config.doAni = !sel;
}

void horm_callback(int sel)
{
if (sel == 255)
sel = 0;
if (sel > 100)
sel = 100;
apollo_config.marginH = sel;
}

void verm_callback(int sel)
{
if (sel == 255)
sel = 0;
if (sel > 100)
sel = 100;
apollo_config.marginV = sel;
}

void clearcache_callback(int sel)
{
LOG("Cleaning folder '%s'...", APOLLO_LOCAL_CACHE);
Expand Down

0 comments on commit 36168e6

Please sign in to comment.