git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 6798b1f11af54469b63afc612a0454ed7227679d
parent 2d766982799b03c4333b6784593c903f54d55e45
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 31 Jan 2021 19:17:48 +0200

Use a slider for temperature in the SDL GUI

Diffstat:
MSDL/font.c66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSDL/font.h2++
MSDL/gui.c26++++----------------------
3 files changed, 72 insertions(+), 22 deletions(-)

diff --git a/SDL/font.c b/SDL/font.c @@ -1053,6 +1053,72 @@ uint8_t font[] = { X, _, _, _, X, _, X, _, _, _, X, _, X, X, X, X, X, _, + + /* Slider */ + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, X, X, X, X, + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + X, X, X, X, X, X, + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + X, X, X, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, + + /* Slider, selected */ + _, X, X, X, _, _, + _, X, X, X, _, _, + _, X, X, X, _, _, + _, X, X, X, X, X, + _, X, X, X, _, _, + _, X, X, X, _, _, + _, _, X, _, _, _, + _, _, _, _, _, _, + + _, X, X, X, _, _, + _, X, X, X, _, _, + _, X, X, X, _, _, + X, X, X, X, X, X, + _, X, X, X, _, _, + _, X, X, X, _, _, + _, _, X, _, _, _, + _, _, _, _, _, _, + + _, X, X, X, _, _, + _, X, X, X, _, _, + _, X, X, X, _, _, + X, X, X, X, _, _, + _, X, X, X, _, _, + _, X, X, X, _, _, + _, _, X, _, _, _, + _, _, _, _, _, _, + + /* Slider, tick*/ + _, _, _, _, _, _, + _, _, X, _, _, _, + _, _, X, _, _, _, + X, X, X, X, X, X, + _, _, X, _, _, _, + _, _, X, _, _, _, + _, _, _, _, _, _, + _, _, _, _, _, _, }; const uint8_t font_max = sizeof(font) / GLYPH_HEIGHT / GLYPH_WIDTH + ' '; diff --git a/SDL/font.h b/SDL/font.h @@ -14,5 +14,7 @@ extern const uint8_t font_max; #define CMD_STRING "\x84\x85" #define ELLIPSIS_STRING "\x87" #define MOJIBAKE_STRING "\x88" +#define SLIDER_STRING "\x89\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8F\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8B" +#define SELECTED_SLIDER_STRING "\x8C\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8E" #endif /* font_h */ diff --git a/SDL/gui.c b/SDL/gui.c @@ -519,28 +519,10 @@ const char *current_color_correction_mode(unsigned index) const char *current_color_temperature(unsigned index) { - return (const char *[]){"12000K", - "11450K", - "10900K", - "10350K", - "9800K", - "9250K", - "8700K", - "8150K", - "7600K", - "7050K", - "6500K (White)", - "5950K", - "5400K", - "4850K", - "4300K", - "3750K", - "3200K", - "2650K", - "2100K", - "1550K", - "1000K"} - [configuration.color_temperature]; + static char ret[22]; + strcpy(ret, SLIDER_STRING); + ret[configuration.color_temperature] = SELECTED_SLIDER_STRING[configuration.color_temperature]; + return ret; }

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.