1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-30 08:24:05 +00:00

GlideNUI-wtl: Add On-screen display tab

This commit is contained in:
zilmar 2020-04-21 10:28:32 +09:30 committed by Sergey Lipskiy
parent ba7a84c2d1
commit d83a06a75e
10 changed files with 98 additions and 31 deletions

Binary file not shown.

View File

@ -194,6 +194,19 @@ void loadDefaultStrings(void)
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_COMPRESS_CACHE_TOOLTIP, "Textures will be compressed so more textures can be held in the cache. The compression ratio varies per texture, but the compression is typically 1/5 of the original size.\n[Recommended: Checked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_CONVERT_16BPP, "Convert textures to 16 bpp"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_CONVERT_16BPP_TOOLTIP, "This option halves the space used by textures in the texture cache and video card memory to improve performance. When reducing the color, GLideN64 tries to perserve the original quality as much as possible. On most textures it's hardly noticeable, but some textures, like skies, can look noticeably worse.\n[Recommended: Unchecked]"));
//On-screen display
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_POSITION, "Position"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_FPS, "Display FPS"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_VI, "Display VI/s"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_PERCENTAGE, "Display percentage"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_INTERNAL_RESOLUTION, "Display internal resolution"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_RENDERING_RESOLUTION, "Display rendering resolution"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_FONT, "Font"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_SIZE, "Size:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_PX, "px"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_COLOR, "Color:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_PREVIEW, "Preview"));
}
LANG_STR GetNextLangString(FILE * file)

View File

@ -200,6 +200,21 @@ enum languageStringID
TEXTURE_COMPRESS_CACHE_TOOLTIP = 5036,
TEXTURE_CONVERT_16BPP = 5037,
TEXTURE_CONVERT_16BPP_TOOLTIP = 5038,
/*********************************************************************************
* On-screen display *
*********************************************************************************/
OSD_POSITION = 6000,
OSD_DISPLAY_FPS = 6001,
OSD_DISPLAY_VI = 6002,
OSD_DISPLAY_PERCENTAGE = 6003,
OSD_DISPLAY_INTERNAL_RESOLUTION = 6004,
OSD_DISPLAY_RENDERING_RESOLUTION = 6005,
OSD_FONT = 6006,
OSD_SIZE = 6007,
OSD_PX = 6008,
OSD_COLOR = 6009,
OSD_PREVIEW = 6010,
};
struct LanguageFile

View File

@ -3,6 +3,7 @@
#include "util.h"
#include "../Config.h"
#include "FontInfo.h"
#include "Language.h"
COsdTab::COsdTab() :
CConfigTab(IDD_TAB_OSD),
@ -45,8 +46,7 @@ BOOL COsdTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
FontList fonts = GetFontFiles();
HTREEITEM hCurrentItem = TVI_ROOT;
for (FontList::const_iterator itr = fonts.begin(); itr != fonts.end(); itr++)
{
for (FontList::const_iterator itr = fonts.begin(); itr != fonts.end(); itr++) {
std::wstring FontFile = ToUTF16(itr->first.c_str());
std::wstring FontName = ToUTF16(itr->second.c_str());
@ -57,19 +57,16 @@ BOOL COsdTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
tv.item.cchTextMax = sizeof(Item) / sizeof(Item[0]);
tv.item.hItem = m_Fonts.GetChildItem(TVI_ROOT);
HTREEITEM hParent = TVI_ROOT;
while (tv.item.hItem)
{
while (tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
if (wcscmp(FontName.c_str(), Item) == 0)
{
if (wcscmp(FontName.c_str(), Item) == 0) {
hParent = tv.item.hItem;
break;
}
tv.item.hItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);
}
if (hParent == TVI_ROOT)
{
if (hParent == TVI_ROOT) {
tv.item.mask = TVIF_TEXT;
tv.item.pszText = (LPWSTR)FontName.c_str();
tv.item.cchTextMax = FontName.length();
@ -84,8 +81,7 @@ BOOL COsdTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
tv.hParent = hParent;
m_Fonts.InsertItem(&tv);
}
if (hCurrentItem != TVI_ROOT)
{
if (hCurrentItem != TVI_ROOT) {
m_Fonts.SelectItem(hCurrentItem);
m_Fonts.SetItemState(hCurrentItem, TVIF_STATE | TVIS_SELECTED, TVIF_STATE | TVIS_SELECTED);
m_Fonts.SetFocus();
@ -95,15 +91,23 @@ BOOL COsdTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
void COsdTab::ApplyLanguage(void)
{
SetDlgItemTextW(IDC_POSITION, wGS(OSD_POSITION).c_str());
SetDlgItemTextW(IDC_CHK_FPS, wGS(OSD_DISPLAY_FPS).c_str());
SetDlgItemTextW(IDC_CHK_VIS, wGS(OSD_DISPLAY_VI).c_str());
SetDlgItemTextW(IDC_CHK_PERCENT, wGS(OSD_DISPLAY_PERCENTAGE).c_str());
SetDlgItemTextW(IDC_INTERNAL_RESOLUTION, wGS(OSD_DISPLAY_INTERNAL_RESOLUTION).c_str());
SetDlgItemTextW(IDC_RENDERING_RESOLUTION, wGS(OSD_DISPLAY_RENDERING_RESOLUTION).c_str());
SetDlgItemTextW(IDC_FONT, wGS(OSD_FONT).c_str());
SetDlgItemTextW(IDC_TXT_SIZE, wGS(OSD_SIZE).c_str());
SetDlgItemTextW(IDC_PX, wGS(OSD_PX).c_str());
SetDlgItemTextW(IDC_COLOR, wGS(OSD_COLOR).c_str());
}
LRESULT COsdTab::OnScroll(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
LONG CtrlId = CWindow((HWND)lParam).GetWindowLong(GWL_ID);
if (CtrlId == IDC_FONT_SIZE_SPIN)
{
m_OsdPreview.SetFontSize(m_FontSizeSpin.GetPos());
}
return 0;
}
@ -212,28 +216,22 @@ void COsdTab::LoadSettings(bool /*blockCustomSettings*/)
tv.item.cchTextMax = sizeof(Item) / sizeof(Item[0]);
tv.item.hItem = m_Fonts.GetChildItem(TVI_ROOT);
HTREEITEM hCurrentItem = NULL;
while (hCurrentItem == NULL && tv.item.hItem)
{
while (hCurrentItem == NULL && tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
HTREEITEM hChild = m_Fonts.GetChildItem(tv.item.hItem);
HTREEITEM NextItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);
if (hCurrentItem == NULL && hChild != NULL)
{
if (hCurrentItem == NULL && hChild != NULL) {
tv.item.hItem = hChild;
while (hCurrentItem == NULL && tv.item.hItem)
{
while (hCurrentItem == NULL && tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
if (Item == CurrentFile)
{
hCurrentItem = tv.item.hItem;
}
tv.item.hItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);
}
}
tv.item.hItem = NextItem;
}
if (hCurrentItem != TVI_ROOT)
{
if (hCurrentItem != TVI_ROOT) {
m_Fonts.SelectItem(hCurrentItem);
m_Fonts.SetItemState(hCurrentItem, TVIF_STATE | TVIS_SELECTED, TVIF_STATE | TVIS_SELECTED);
m_Fonts.SetFocus();
@ -272,19 +270,13 @@ std::wstring COsdTab::GetSelectedFont()
{
HTREEITEM hItem = m_Fonts.GetSelectedItem();
if (hItem == NULL)
{
return L"";
}
HTREEITEM hChild = m_Fonts.GetChildItem(hItem);
if (hChild != NULL)
{
hItem = hChild;
}
wchar_t ItemText[MAX_PATH];
if (!m_Fonts.GetItemText(hItem, ItemText, sizeof(ItemText) / sizeof(ItemText[0])))
{
return L"";
}
return std::wstring(ItemText);
}

Binary file not shown.

View File

@ -1,6 +1,7 @@
#include "wtl-OsdPreview.h"
#include "FontInfo.h"
#include "util.h"
#include "Language.h"
#include <DWrite.h>
#pragma comment(lib, "Dwrite.lib")
@ -61,7 +62,7 @@ LRESULT COsdPreview::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/
HFONT hOldFont = (HFONT)dc.SelectFont(hf);
if (hOldFont)
{
dc.DrawText(L"Preview", -1, rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
dc.DrawText(wGS(OSD_PREVIEW).c_str(), -1, rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
dc.SelectFont(hOldFont);
}
}

View File

@ -174,4 +174,19 @@
#5035# "Textur-Cache komprimieren"
#5036# "Texturen werden komprimiert, damit mehr Texturen im Cache gehalten werden können. Die Kompressionsrate variiert je nach Textur, aber ist normalerweise 1/5 der Originalgröße.\n[Empfehlung: Ausgewählt]"
#5037# "Konvertiere Texturen zu 16Bit"
#5038# "Diese Einstellung halbiert den Speicherbedarf von Texturen im Texture-Cache und VRAM um die Leistung zu steigern. Wenn die Farbtiefe reduziert wird versucht GLideN64 die originale Qualität so gut wie möglich zu erhalten. Bei den meisten Texturen ist es kaum wahrnehmbar, aber einige Texturen, wie z.B. für den Himmel, können schlechter aussehen.\n[Empfehlung: Nicht ausgewählt]"
#5038# "Diese Einstellung halbiert den Speicherbedarf von Texturen im Texture-Cache und VRAM um die Leistung zu steigern. Wenn die Farbtiefe reduziert wird versucht GLideN64 die originale Qualität so gut wie möglich zu erhalten. Bei den meisten Texturen ist es kaum wahrnehmbar, aber einige Texturen, wie z.B. für den Himmel, können schlechter aussehen.\n[Empfehlung: Nicht ausgewählt]"
/*********************************************************************************
* On-screen display *
*********************************************************************************/
#6000# "Position"
#6001# "FPS anzeigen"
#6002# "VI/s anzeigen"
#6003# "Anzeige in Prozent"
#6004# "Interne Auflösung anzeigen"
#6005# "Rendering-Auflösung anzeigen"
#6006# "Schriftart"
#6007# "Größe:"
#6008# "px"
#6009# "Farbe:"
#6010# "Vorschau"

View File

@ -192,4 +192,19 @@
#5035# "Compress texture cache"
#5036# "Textures will be compressed so more textures can be held in the cache. The compression ratio varies per texture, but the compression is typically 1/5 of the original size.\n[Recommended: Checked]"
#5037# "Convert textures to 16 bpp"
#5038# "This option halves the space used by textures in the texture cache and video card memory to improve performance. When reducing the color, GLideN64 tries to perserve the original quality as much as possible. On most textures it's hardly noticeable, but some textures, like skies, can look noticeably worse.\n[Recommended: Unchecked]"
#5038# "This option halves the space used by textures in the texture cache and video card memory to improve performance. When reducing the color, GLideN64 tries to perserve the original quality as much as possible. On most textures it's hardly noticeable, but some textures, like skies, can look noticeably worse.\n[Recommended: Unchecked]"
/*********************************************************************************
* On-screen display *
*********************************************************************************/
#6000# "Position"
#6001# "Display FPS"
#6002# "Display VI/s"
#6003# "Display percentage"
#6004# "Display internal resolution"
#6005# "Display rendering resolution"
#6006# "Font"
#6007# "Size:"
#6008# "px"
#6009# "Color:"
#6010# "Preview"

View File

@ -132,3 +132,11 @@
#5036# "Se comprimirán las texturas para que entren más texturas en la caché. La proporción de compresión cambia según la textura, pero suele ser de 1/5 del tamaño original.\n[Recomendación: Activado]"
#5037# "Convertir texturas a 16 BPP"
#5038# "Esta opción reduce a la mitad el tamaño que utilizan las texturas de la caché de texturas y de la memoria de la tarjeta gráfica para mejorar el rendimiento. A la hora de reducir el color, GlideN64 intentará preservar la calidad original en la medida de lo posible. Es apenas imperceptible en la mayoría de las texturas, pero algunas como los cielos quedarán peor.\n[Recomendación: Desactivado]"
/*********************************************************************************
* On-screen display *
*********************************************************************************/
#6000# "Posición"
#6003# "Mostrar porcentaje"
#6009# "Color:"
#6010# "Demostración"

View File

@ -132,3 +132,11 @@
#5036# "Les textures seront compressées, ainsi plus de textures pourront être mises en cache. Le ratio de compression varie suivant les textures, mais il est en moyenne de 1/5 par rapport à la taille originale.\n[Recommandé : Activé]"
#5037# "Convertir les textures en 16 bits"
#5038# "Cette option réduit de moitié l'espace occupé par les textures dans le cache ainsi que celui de la mémoire de votre carte graphique, cela afin d'améliorer les performances. Quand la taille du codage de la couleur est réduite, GLideN64 essaye de préserver la qualité originale autant que possible. Sur certaines textures c'est difficilement visible, mais sur d'autres, tel le ciel, le rendu peut être mauvais.\n[Recommandé : Désactivé]"
/*********************************************************************************
* On-screen display *
*********************************************************************************/
#6000# "Position"
#6003# "Afficher le pourcentage"
#6009# "Couleur :"
#6010# "Prévisualisation"