Skip to content

Commit

Permalink
color change
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpndable committed Mar 21, 2023
1 parent fc110df commit 0ae18c1
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 15 deletions.
Binary file modified github/main.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified github/menu.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/arrow-highlighted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/battery-charging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/battery-fill.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/battery-line.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/charging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/progress-bar-empty.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/rule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/settings-bar-empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/slot-dot-selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/slot-dots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static SDL_Surface* settings_brightness;
static SDL_Surface* settings_volume;
static SDL_Surface* settings_mute;

static SDL_Color gold = {GOLD_TRIAD};
static SDL_Color pink = {PINK_TRIAD};
static SDL_Color bronze = {BRONZE_TRIAD};
static SDL_Color white = {WHITE_TRIAD};
static SDL_Color gray = {GRAY_TRIAD};
Expand Down Expand Up @@ -558,7 +558,7 @@ void GFX_blitMenu(SDL_Surface* surface, char* name, char* path, char* unique, in
trimSortingMeta(&display_name);

// bar
SDL_FillRect(surface, &(SDL_Rect){0,Screen.main.list.y+(row*Screen.main.list.row_height),Screen.width,Screen.main.list.row_height}, SDL_MapRGB(surface->format, GOLD_TRIAD));
SDL_FillRect(surface, &(SDL_Rect){0,Screen.main.list.y+(row*Screen.main.list.row_height),Screen.width,Screen.main.list.row_height}, SDL_MapRGB(surface->format, PINK_TRIAD));

// shadow
text = TTF_RenderUTF8_Blended(font_l, display_name, shadow50);
Expand Down Expand Up @@ -624,7 +624,7 @@ int GFX_scrollMenu(SDL_Surface* surface, char* name, char* path, char* unique, i
}

// bar
SDL_FillRect(surface, &(SDL_Rect){0,Screen.main.list.y+(row*Screen.main.list.row_height),Screen.width,Screen.main.list.row_height}, SDL_MapRGB(surface->format, GOLD_TRIAD));
SDL_FillRect(surface, &(SDL_Rect){0,Screen.main.list.y+(row*Screen.main.list.row_height),Screen.width,Screen.main.list.row_height}, SDL_MapRGB(surface->format, PINK_TRIAD));

// shadow
SDL_BlitSurface(text, &(SDL_Rect){scroll_ox,0,max_width,text->h}, surface, &(SDL_Rect){Screen.main.list.ox+Screen.font.shadow.ox,Screen.main.list.y+(row*Screen.main.list.row_height)+Screen.main.list.oy+Screen.font.shadow.oy});
Expand Down Expand Up @@ -686,7 +686,7 @@ void GFX_blitBodyCopy(SDL_Surface* surface, char* str, int ox, int oy, int width


if (len) {
text = TTF_RenderUTF8_Blended(font_l, line, gold);
text = TTF_RenderUTF8_Blended(font_l, line, pink);
int x = ox;
x += (width - text->w) / 2;
SDL_BlitSurface(text, NULL, surface, &(SDL_Rect){x,y});
Expand All @@ -706,7 +706,7 @@ int GFX_blitText(SDL_Surface* surface, char* str, int size, int x, int y, int wi

TTF_Font* font = size==0?font_s:(size==1?font_m:font_l);
int oy = size=0?Screen.font.small_oy:(size==1?Screen.font.medium_oy:Screen.font.large_oy);
text = TTF_RenderUTF8_Blended(font, str, has_shadow?shadow_color:(color==-1?disabled:(color?gold:white)));
text = TTF_RenderUTF8_Blended(font, str, has_shadow?shadow_color:(color==-1?disabled:(color?pink:white)));
int w = text->w;

if (width>0) x += (width - w) / 2;
Expand All @@ -715,7 +715,7 @@ int GFX_blitText(SDL_Surface* surface, char* str, int size, int x, int y, int wi
if (has_shadow) {
SDL_BlitSurface(text, NULL, surface, &(SDL_Rect){x+Screen.font.shadow.ox,y+Screen.font.shadow.oy});
SDL_FreeSurface(text);
text = TTF_RenderUTF8_Blended(font, str, color==-1?gray:(color?gold:white));
text = TTF_RenderUTF8_Blended(font, str, color==-1?gray:(color?pink:white));
}

// SDL_FillRect(surface, &(SDL_Rect){x,y,text->w,text->h}, white_rgb); // TODO: tmp
Expand All @@ -727,7 +727,7 @@ int GFX_blitText(SDL_Surface* surface, char* str, int size, int x, int y, int wi

SDL_Surface* GFX_getText(char* text, int size, int color) {
TTF_Font* font = size==0?font_s:(size==1?font_m:font_l);
return TTF_RenderUTF8_Blended(font, text, color?gold:white);
return TTF_RenderUTF8_Blended(font, text, color?pink:white);
}

void GFX_blitBattery(SDL_Surface* surface, int x, int y) {
Expand Down
4 changes: 2 additions & 2 deletions src/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#define MINUI_R3 SDLK_UNDEFINED
#define MINUI_POWER SDLK_POWER

#define GOLD_TRIAD 0xd2,0xb4,0x6c
#define BRONZE_TRIAD 0x9f,0x89,0x52
#define PINK_TRIAD 0xd4,0x98,0xab
#define BRONZE_TRIAD 0xa1,0x74,0x82
#define WHITE_TRIAD 0xff,0xff,0xff
#define GRAY_TRIAD 0x66,0x66,0x66
#define SHADOW25_TRIAD 0xa1,0x87,0x47
Expand Down
6 changes: 3 additions & 3 deletions src/libmmenu/mmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ MenuReturnStatus ShowMenu(char* rom_path, char* save_path_template, SDL_Surface*

Input_reset();

int gold_rgb = SDL_MapRGB(screen->format, GOLD_TRIAD);
int pink_rgb = SDL_MapRGB(screen->format, PINK_TRIAD);
int gray_rgb = SDL_MapRGB(screen->format, DISABLED_TRIAD);
SDL_Color gold = (SDL_Color){GOLD_TRIAD};
SDL_Color pink = (SDL_Color){PINK_TRIAD};
SDL_Color white = (SDL_Color){WHITE_TRIAD};

int status = kStatusContinue;
Expand Down Expand Up @@ -662,7 +662,7 @@ MenuReturnStatus ShowMenu(char* rom_path, char* save_path_template, SDL_Surface*
int disabled = !state_support && (i==kItemSave || i==kItemLoad);
int color = disabled ? -1 : 1; // gray or gold
if (i==selected) {
int bg_color_rgb = disabled ? gray_rgb : gold_rgb;
int bg_color_rgb = disabled ? gray_rgb : pink_rgb;
SDL_FillRect(screen, &(SDL_Rect){Screen.menu.window.x,Screen.menu.list.y+(i*Screen.menu.list.line_height)-((Screen.menu.list.row_height-Screen.menu.list.line_height)/2),Screen.menu.window.width,Screen.menu.list.row_height}, bg_color_rgb);
if (!disabled) color = 0; // white
}
Expand Down
6 changes: 3 additions & 3 deletions src/say/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <sys/mman.h>
#include <unistd.h>

#define GOLD_TRIAD 0xd2,0xb4,0x6c
#define PINK_TRIAD 0xd4,0x98,0xab
#define kTextBoxMaxRows 8
#define kTextLineLength 256
#define kLineHeight 48
Expand Down Expand Up @@ -64,7 +64,7 @@ int main(int argc , char* argv[]) {

int width = 640;
int height = 480;
SDL_Color gold = {GOLD_TRIAD};
SDL_Color pink = {PINK_TRIAD};
SDL_Surface* text;
char* rows[kTextBoxMaxRows];
int row_count = 0;
Expand Down Expand Up @@ -94,7 +94,7 @@ int main(int argc , char* argv[]) {
}

if (len) {
text = TTF_RenderUTF8_Blended(font, line, gold);
text = TTF_RenderUTF8_Blended(font, line, pink);
int x = (width - text->w) / 2;
blit(fb0_map,width,height,text->pixels,text->w,text->h,x,y);
SDL_FreeSurface(text);
Expand Down

0 comments on commit 0ae18c1

Please sign in to comment.