Commit c0dc3a5b authored by David Skywalker's avatar David Skywalker
Browse files

Merge branch 'newui'

parents d61f8f95 9f03fa03
Pipeline #56863 passed with stages
in 9 minutes and 56 seconds
......@@ -6,6 +6,8 @@
*.orig
*.rej
*.log
# gimp dumps
*.raw
# editors
.vscode
.venv
\ No newline at end of file
......@@ -27,6 +27,8 @@ SOURCES_C := \
$(CORE_DIR)/libretro/gfx/software.c \
$(CORE_DIR)/libretro/assets/ui_keyboard_bg.c \
$(CORE_DIR)/libretro/assets/ui_keyboard_en.c \
$(CORE_DIR)/libretro/assets/ui_keyboard_es.c \
$(CORE_DIR)/libretro/assets/ui_keyboard_fr.c \
$(CORE_DIR)/libretro/assets/font.c \
$(CORE_DIR)/libretro/retro_strings.c \
$(CORE_DIR)/libretro/retro_utils.c \
......
......@@ -50,6 +50,9 @@ extern const int ui_keyboard_bg_size;
extern const unsigned char ui_keyboard_en[];
extern const int ui_keyboard_en_size;
extern const unsigned char ui_keyboard_es[];
extern const unsigned char ui_keyboard_fr[];
//--------------------------------------------------------------------
#define FNT_MIN_CHAR 32
......
This diff is collapsed.
This diff is collapsed.
......@@ -192,8 +192,37 @@ void retro_show_statusbar()
BIT_SET(ui_status, UI_STATUSBAR);
}
void retro_ui_prepare(void)
{
// convert KeyboardOnScreen to current video/color-depth
convert_image(
keyboard_surface,
(const unsigned int *) ui_keyboard_bg,
IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH
);
unsigned int * ui_keyboard_lang = (unsigned int *) ui_keyboard_en;
if (retro_computer_cfg.lang == 2) {
ui_keyboard_lang = (unsigned int *) ui_keyboard_es;
} else if(retro_computer_cfg.lang == 1) {
ui_keyboard_lang = (unsigned int *) ui_keyboard_fr;
}
// convert raw keyboard to current video/color-depth
// and blit to keyboard_surface to optimize draw KoS
convert_image(
keyboard_lang,
(const unsigned int *) ui_keyboard_lang,
IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH
);
draw_image_transparent(keyboard_surface, keyboard_lang, 0, 0, IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH);
}
//////////////// PUBLIC
void retro_ui_update_text()
{
retro_ui_prepare();
char model[16];
switch (retro_computer_cfg.model)
{
......@@ -225,12 +254,8 @@ void retro_ui_update_text()
ui_string,
RGB2COLOR(0x63, 0x63, 0x63)
);
}
//////////////// PUBLIC
void retro_ui_init(void)
{
// prepare pointer to surface data
......@@ -238,24 +263,9 @@ void retro_ui_init(void)
keyboard_lang = bmp + ((IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH) * EMULATION_SCALE);
ui_surface = bmp + ((IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH) * EMULATION_SCALE * 2);
// convert KeyboardOnScreen to current video/color-depth
convert_image(
keyboard_surface,
(const unsigned int *) ui_keyboard_bg,
IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH
);
// convert raw keyboard to current video/color-depth
// and blit to keyboard_surface to optimize draw KoS
convert_image(
keyboard_lang,
(const unsigned int *) ui_keyboard_en,
IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH
);
draw_image_transparent(keyboard_surface, keyboard_lang, 0, 0, IMG_KEYBOARD_HEIGHT * IMG_KEYBOARD_WIDTH);
// init KoS
keyboard_init();
retro_ui_prepare();
retro_ui_update_text();
// Micro UI init
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment