From 42b101b024c45960f8ef216e399606b2cccf1438 Mon Sep 17 00:00:00 2001 From: TwinAphex51224 Date: Tue, 24 Jan 2012 06:11:01 +0100 Subject: [PATCH] (360) Added libsnes core text to SSNES main screen and dehardcoded SSNES version number - ASCII to Unicode messiness inside --- 360/media/ssnes_main.xui | 28 ++++++++++++++++++++++++---- 360/menu.cpp | 15 ++++++++++++++- 360/menu.h | 1 + 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/360/media/ssnes_main.xui b/360/media/ssnes_main.xui index 5dcbd90c53..e72a460681 100644 --- a/360/media/ssnes_main.xui +++ b/360/media/ssnes_main.xui @@ -16,7 +16,7 @@ XuiBtnRomBrowser 215.000000 38.000000 -76.000000,91.000000,0.000000 +79.599976,55.000000,0.000000 XuiBtnQuit XuiBtnSettings ROM Browser @@ -27,7 +27,7 @@ XuiTxtTitle 240.000000 40.000000 -81.453644,55.000000,0.000000 +85.053619,15.399994,0.000000 SSNES 360 0xff0f0f0f 0x800f0f0f @@ -40,7 +40,7 @@ XuiBtnSettings 215.000000 38.000000 -76.000000,142.399994,0.000000 +79.599976,106.399994,0.000000 XuiBtnRomBrowser XuiBtnQuit Settings @@ -51,11 +51,31 @@ XuiBtnQuit 215.000000 38.000000 -76.200012,191.399994,0.000000 +79.799988,155.399994,0.000000 XuiBtnSettings XuiBtnRomBrowser Quit + + +XuiLblCore +124.000000 +28.000000 +16.000000,209.200012,0.000000 +Libsnes core: + + + + +XuiTxtCoreText +224.399963 +34.000000 +138.400024,208.799988,0.000000 +0xff0f0f0f +0x800f0f0f +Arial Unicode MS + + diff --git a/360/menu.cpp b/360/menu.cpp index 3bb91641d7..5d9131fc34 100644 --- a/360/menu.cpp +++ b/360/menu.cpp @@ -50,7 +50,20 @@ HRESULT CMyMainScene::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) GetChildById(L"XuiBtnSettings", &m_settings); GetChildById(L"XuiBtnQuit", &m_quit); GetChildById(L"XuiTxtTitle", &m_title); - m_title.SetText(L"SSNES 0.9.4.1"); + GetChildById(L"XuiTxtCoreText", &m_core); + const char * core_text = snes_library_id(); + char package_version[32]; + sprintf(package_version, "SSNES %s", PACKAGE_VERSION); + DWORD dwNum = MultiByteToWideChar(CP_ACP, 0, core_text, -1, NULL, 0); + DWORD dwNum_package = MultiByteToWideChar(CP_ACP, 0, package_version, -1, NULL, 0); + wchar_t * core_text_utf = new wchar_t[dwNum]; + wchar_t * package_version_utf = new wchar_t[dwNum_package]; + MultiByteToWideChar(CP_ACP, 0, core_text, -1, core_text_utf, dwNum); + MultiByteToWideChar(CP_ACP, 0, package_version, -1, package_version_utf, dwNum_package); + m_core.SetText(core_text_utf); + m_title.SetText(package_version_utf); + delete []core_text_utf; + delete []package_version_utf; return S_OK; } diff --git a/360/menu.h b/360/menu.h index fef3c494df..d8bd6bf6ba 100644 --- a/360/menu.h +++ b/360/menu.h @@ -20,6 +20,7 @@ protected: CXuiControl m_settings; CXuiControl m_quit; CXuiTextElement m_title; + CXuiTextElement m_core; public: HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); HRESULT OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled );