From b1ddd2f45a1bda72fc8d246d98da537f8b076f60 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 9 Jul 2023 20:34:09 +0300 Subject: [PATCH] Allow filter names to be translated --- od-win32/resources/resource.h | 1 + od-win32/resources/winuae.rc | 1 + od-win32/win32gui.cpp | 22 +++++++++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 49e93010..16426b5a 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -430,6 +430,7 @@ #define IDS_BOARDID 435 #define IDS_ASSOCIATEEXTENSION 436 #define IDS_GAMEPORTS_CUSTOM 437 +#define IDS_FILTER_LABELS 438 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index f8cbcd11..3a221891 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -2232,6 +2232,7 @@ BEGIN IDS_BOARDID "ID" IDS_ASSOCIATEEXTENSION "Extension" IDS_GAMEPORTS_CUSTOM "Custom" + IDS_FILTER_LABELS "Null\nScale2X\nhq2x\nhq3x\nhq4x\nSuperEagle\nSuper2xSaI\n2xSaI\nPAL\n" END #endif // English (United Kingdom) resources diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index d57ba1fc..adf5d76f 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -20128,7 +20128,7 @@ static void setfiltermult (HWND hDlg) static void values_to_hw3ddlg (HWND hDlg, bool initdialog) { - TCHAR txt[100], tmp[100]; + TCHAR txt[200], tmp[200], tmp2[200]; int i, j, fltnum; struct uae_filter *uf; int fxidx, fxcnt; @@ -20252,21 +20252,37 @@ static void values_to_hw3ddlg (HWND hDlg, bool initdialog) xSendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_SETCURSEL, v, 0); xSendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_RESETCONTENT, 0, 0L); - WIN32GUI_LoadUIString (IDS_NONE, tmp, MAX_DPATH); + WIN32GUI_LoadUIString (IDS_NONE, tmp, sizeof(tmp) / sizeof(TCHAR)); xSendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp); + WIN32GUI_LoadUIString(IDS_FILTER_LABELS, tmp2, sizeof(tmp2) / sizeof(TCHAR)); + uf = NULL; fltnum = 0; i = 0; j = 1; + TCHAR *fl = tmp2; while (uaefilters[i].name) { if (filter_nativertg >= 2 && uaefilters[i].type > 1) { i++; + while(*fl != '\n' && *fl != 0) { + fl++; + } continue; } - xSendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)uaefilters[i].name); + TCHAR *fle = fl; + while (*fle != '\n' && *fle != 0) { + fle++; + } + TCHAR endch = *fle; + *fle = 0; + xSendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)fl); if (uaefilters[i].type == workprefs.gf[filter_nativertg].gfx_filter) { uf = &uaefilters[i]; fltnum = j; } + fl = fle; + if (endch != 0) { + fl++; + } j++; i++; } -- 2.47.3