Skip to content

Commit cd7eaa6

Browse files
committed
update
1 parent 0cf40a5 commit cd7eaa6

File tree

8 files changed

+71
-10
lines changed

8 files changed

+71
-10
lines changed

data/leon_luna.png

40.1 KB
Loading

include/menu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum menu_screen_ids
3636
//Textures
3737
enum texture_index
3838
{
39-
leon_jpg_index,
39+
leon_luna_png_index,
4040
bgimg_png_index,
4141
column_1_png_index,
4242
column_2_png_index,

include/menu_gui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
void Draw_AboutMenu_Ani(void);
2-
void Draw_AboutMenu(void);
2+
void Draw_AboutMenu(int l);
33

44
void Draw_UserCheatsMenu_Ani(save_list_t * list);
55
void Draw_UserCheatsMenu(save_list_t * list, int menuSel, u8 alpha);

include/settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define APOLLO_VERSION "0.7.0" //Apollo Vita version (about menu)
1+
#define APOLLO_VERSION "1.0.0" //Apollo PS2 version (about menu)
22

33
#define MENU_TITLE_OFF 30 //Offset of menu title text from menu mini icon
44
#define MENU_ICON_OFF 35 //X Offset to start printing menu mini icon

source/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static int LoadTextures_Menu(void)
223223
//Init Main Menu textures
224224
load_menu_texture(bgimg, png);
225225
load_menu_texture(cheat, png);
226-
// load_menu_texture(leon, jpg);
226+
load_menu_texture(leon_luna, png);
227227

228228
load_menu_texture(circle_loading_bg, png);
229229
load_menu_texture(circle_loading_seek, png);
@@ -549,7 +549,7 @@ int main(int argc, char *argv[])
549549
#ifdef APOLLO_ENABLE_LOGGING
550550
// Calculate FPS and ms/frame
551551
SetFontColor(APP_FONT_COLOR | 0xFF, 0);
552-
DrawFormatString(50, 500, "FPS: %d", (1000 / deltaFrameTicks));
552+
DrawFormatString(50, 400, "FPS: %d", (1000 / deltaFrameTicks));
553553
#endif
554554
// Propagate the updated window to the screen
555555
SDL_RenderPresent(renderer);

source/menu_about.c

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,52 @@
66
#include "menu_gui.h"
77
#include "libfont.h"
88

9+
#define FONT_W 24
10+
#define FONT_H 23
11+
#define STEP_X -2 // horizontal displacement
12+
13+
static int sx = SCREEN_WIDTH;
14+
915
const char * menu_about_strings[] = { "Bucanero", "Developer",
1016
"", "",
1117
"", "",
1218
"Leon ", " Luna",
1319
"2009-2022", "2011-2023",
1420
NULL };
1521

22+
/***********************************************************************
23+
* Draw a string of chars, amplifing y by sin(x)
24+
***********************************************************************/
25+
static void draw_sinetext(int y, const char* string)
26+
{
27+
int x = sx; // every call resets the initial x
28+
int sl = strlen(string);
29+
char tmp[2] = {0, 0};
30+
float amp;
31+
32+
SetFontSize(FONT_W, FONT_H);
33+
for(int i = 0; i < sl; i++)
34+
{
35+
amp = sinf(x // testing sinf() from math.h
36+
* 0.02) // it turns out in num of bends
37+
* 5; // +/- vertical bounds over y
38+
39+
if(x > 0 && x < SCREEN_WIDTH - FONT_W)
40+
{
41+
tmp[0] = string[i];
42+
DrawStringMono(x, y + amp, tmp);
43+
}
44+
45+
x += FONT_W;
46+
}
47+
48+
//* Move string by defined step
49+
sx += STEP_X;
50+
51+
if(sx + (sl * FONT_W) < 0) // horizontal bound, then loop
52+
sx = SCREEN_WIDTH + FONT_W;
53+
}
54+
1655
static void _draw_AboutMenu(u8 alpha)
1756
{
1857
u8 alp2 = ((alpha*2) > 0xFF) ? 0xFF : (alpha * 2);
@@ -48,7 +87,7 @@ static void _draw_AboutMenu(u8 alpha)
4887
SetFontAlign(FONT_ALIGN_LEFT);
4988
}
5089

51-
void Draw_AboutMenu_Ani()
90+
void Draw_AboutMenu_Ani(void)
5291
{
5392
int ani = 0;
5493
for (ani = 0; ani < MENU_ANI_MAX; ani++)
@@ -74,8 +113,20 @@ void Draw_AboutMenu_Ani()
74113
}
75114
}
76115

77-
void Draw_AboutMenu()
116+
static void _draw_LeonLuna(void)
117+
{
118+
DrawTextureCentered(&menu_textures[leon_luna_png_index], SCREEN_WIDTH/2, SCREEN_HEIGHT/2, 0, menu_textures[leon_luna_png_index].width, menu_textures[leon_luna_png_index].height, 0xFFFFFF00 | 0xFF);
119+
// DrawTexture(&menu_textures[help_png_index], 0, 320, 0, SCREEN_WIDTH + 10, 40, 0xFFFFFF00 | 0xFF);
120+
121+
SetFontColor(APP_FONT_COLOR | 0xFF, 0);
122+
draw_sinetext(330, "... in memory of Leon & Luna - may your days be filled with eternal joy ...");
123+
}
124+
125+
void Draw_AboutMenu(int ll)
78126
{
127+
if (ll)
128+
return(_draw_LeonLuna());
129+
79130
DrawHeader(cat_about_png_index, 0, "About", "v" APOLLO_VERSION, APP_FONT_TITLE_COLOR | 0xFF, 0xffffffff, 0);
80131
_draw_AboutMenu(0xFF);
81132
}

source/menu_main.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,24 @@ static void doMainMenu(void)
490490

491491
static void doAboutMenu(void)
492492
{
493+
static int ll = 0;
493494
// Check the pads.
494495
if (ps2PadGetButtonPressed(PAD_CIRCLE))
495496
{
497+
if (ll)
498+
music_callback(!(ll & 0x01));
499+
500+
ll = 0;
496501
SetMenu(MENU_MAIN_SCREEN);
497502
return;
498503
}
504+
else if (!ll && ps2PadGetButtonPressed(PAD_SELECT))
505+
{
506+
ll = (0x02 | apollo_config.music);
507+
music_callback(0);
508+
}
499509

500-
Draw_AboutMenu();
510+
Draw_AboutMenu(ll);
501511
}
502512

503513
static void doOptionsMenu(void)

source/menu_options.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static void _draw_OptionsMenu(u8 alpha)
5656
}
5757
}
5858

59-
void Draw_OptionsMenu_Ani()
59+
void Draw_OptionsMenu_Ani(void)
6060
{
6161
int ani = 0;
6262
for (ani = 0; ani < MENU_ANI_MAX; ani++)
@@ -80,7 +80,7 @@ void Draw_OptionsMenu_Ani()
8080
}
8181
}
8282

83-
void Draw_OptionsMenu()
83+
void Draw_OptionsMenu(void)
8484
{
8585
DrawHeader(cat_opt_png_index, 0, "Settings", NULL, APP_FONT_TITLE_COLOR | 0xFF, 0xffffffff, 0);
8686
_draw_OptionsMenu(0xFF);

0 commit comments

Comments
 (0)