diff --git a/media/360/background.png b/media/360/background.png new file mode 100644 index 0000000000..30e33f6e0f Binary files /dev/null and b/media/360/background.png differ diff --git a/media/360/hd/rarch_main.xui b/media/360/hd/rarch_main.xui index 6681155678..026c432539 100644 --- a/media/360/hd/rarch_main.xui +++ b/media/360/hd/rarch_main.xui @@ -8,9 +8,27 @@ XuiScene1 824.000061 496.000061 -226.769989,123.938545,0.000000 +225.000000,122.000000,0.000000 RetroArchMain + + +XuiBackground +1280.000000 +720.000000 +-225.000000,-122.000000,0.000000 +16 +../background.png + + + + +Panel +824.000000 +496.000000 +XuiScene_WhitePanel + + XuiTxtTitle @@ -366,6 +384,100 @@ XuiButton_two_col + + +control_ListItem +226.000000 +45.000000 +7.000000,22.000000,0.000000 +5 +false +XuiButton +0.000000,10.000000,0.000000 + + + + +control_ListItem +226.000000 +45.000000 +7.000000,22.000000,0.000000 +5 +false +XuiButton +0.000000,10.000000,0.000000 + + + + +control_ListItem +226.000000 +45.000000 +7.000000,22.000000,0.000000 +5 +false +XuiButton +0.000000,10.000000,0.000000 + + + + +control_ListItem +226.000000 +45.000000 +7.000000,22.000000,0.000000 +5 +false +XuiButton +0.000000,10.000000,0.000000 + + + + +control_ListItem +254.000000 +40.000000 +7.000000,26.000000,0.000000 +5 +false +XuiButton_two_col + + + + +control_ListItem +226.000000 +45.000000 +7.000000,22.000000,0.000000 +5 +false +XuiButton +0.000000,10.000000,0.000000 + + + + +control_ListItem +254.000000 +40.000000 +7.000000,26.000000,0.000000 +5 +false +XuiButton_two_col + + + + +control_ListItem +226.000000 +45.000000 +7.000000,22.000000,0.000000 +5 +false +XuiButton +0.000000,10.000000,0.000000 + + diff --git a/media/360/rarch_scene_skin.xui b/media/360/rarch_scene_skin.xui index c6717ee1e9..722b5c96d7 100644 --- a/media/360/rarch_scene_skin.xui +++ b/media/360/rarch_scene_skin.xui @@ -17956,4 +17956,351 @@ + + +XuiControl_PanelGlow +1024.000000 +516.000000 + + + +figGlow_BL +40.000000 +40.000000 +-40.000000,516.000000,0.000000 +9 + + +0xff0f0f80 + + + + +3 +0xffebebeb + + +true +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + +0.500000,0.500000,0.000000 +270.000000 + + +true +4,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,0,12.000000,0.000000,12.000000,0.000000,12.000000,12.000000,0,12.000000,12.000000,12.000000,12.000000,0.000000,12.000000,0,0.000000,12.000000,0.000000,12.000000,0.000000,0.000000,0, + + + + +figGlow_L +20.000000 +516.000000 +-20.000000,0.000000,0.000000 +11 + + +0xff0f0f80 + + + + +2 +0xffebebeb + + +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + +180.000000 + + +true +4,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,0,12.000000,0.000000,12.000000,0.000000,12.000000,12.000000,0,12.000000,12.000000,12.000000,12.000000,0.000000,12.000000,0,0.000000,12.000000,0.000000,12.000000,0.000000,0.000000,0, + + + + +figGlow_TL +40.000000 +40.000000 +-40.000000,-40.000000,0.000000 +3 + + +0xff0f0f80 + + + + +3 +0xffebebeb + + +true +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + +0.500000,0.500000,0.000000 +180.000000 + + +true +4,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,0,12.000000,0.000000,12.000000,0.000000,12.000000,12.000000,0,12.000000,12.000000,12.000000,12.000000,0.000000,12.000000,0,0.000000,12.000000,0.000000,12.000000,0.000000,0.000000,0, + + + + +figGlow_T +1024.000000 +20.000000 +0.000000,-20.000000,0.000000 +7 + + +0xff0f0f80 + + + + +2 +0x00000000 + + +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + +90.000000 +1 + + +true +4,0.000000,0.000000,0.000000,0.000000,580.000000,0.000000,0,580.000000,0.000000,580.000000,0.000000,580.000000,41.000000,0,580.000000,41.000000,580.000000,41.000000,0.000000,41.000000,0,0.000000,41.000000,0.000000,41.000000,0.000000,0.000000,0, + + + + +figGlow_TR +40.000000 +40.000000 +1024.000000,-40.000000,0.000000 +6 + + +0xff0f0f80 + + + + +3 +0xffebebeb + + +true +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + +0.500000,0.500000,0.000000 +90.000000 + + +true +4,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,0,12.000000,0.000000,12.000000,0.000000,12.000000,12.000000,0,12.000000,12.000000,12.000000,12.000000,0.000000,12.000000,0,0.000000,12.000000,0.000000,12.000000,0.000000,0.000000,0, + + + + +figGlow_BR +40.000000 +40.000000 +1024.000000,516.000000,0.000000 +12 + + +0xff0f0f80 + + + + +3 +0xffebebeb + + +true +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + +0.500000,0.500000,0.000000 + + +true +4,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,0,12.000000,0.000000,12.000000,0.000000,12.000000,12.000000,0,12.000000,12.000000,12.000000,12.000000,0.000000,12.000000,0,0.000000,12.000000,0.000000,12.000000,0.000000,0.000000,0, + + + + +figGlow_B +1024.000000 +20.000000 +0.000000,516.000000,0.000000 +13 + + +0xff0f0f80 + + + + +2 +0x00000000 + + +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + +270.000000 +1 + + +true +4,0.000000,0.000000,0.000000,0.000000,580.000000,0.000000,0,580.000000,0.000000,580.000000,0.000000,580.000000,41.000000,0,580.000000,41.000000,580.000000,41.000000,0.000000,41.000000,0,0.000000,41.000000,0.000000,41.000000,0.000000,0.000000,0, + + + + +figGlow_R +20.000000 +516.000000 +1024.000000,0.000000,0.000000 +14 + + +0xff0f0f80 + + + + +2 +0xffebebeb + + +2 +0x64000000 +0x00000000 +0.000000 +1.000000 + + + + +true +4,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,0,12.000000,0.000000,12.000000,0.000000,12.000000,12.000000,0,12.000000,12.000000,12.000000,12.000000,0.000000,12.000000,0,0.000000,12.000000,0.000000,12.000000,0.000000,0.000000,0, + + + + + +XuiScene_WhitePanel +525.000000 +454.000031 + + + +PanelGlow +525.000000 +454.000000 +15 +XuiControl_PanelGlow + + + + +Panel +525.000000 +454.000000 +15 + + +0xff000000 + + + + +0xff968d96 + + +2 +0xffebebeb +0xff0f0f0f +0.000000 +1.000000 + + +1 + + +true +4,0.000000,0.000000,0.000000,0.000000,177.000000,0.000000,0,177.000000,0.000000,177.000000,0.000000,177.000000,132.000000,0,177.000000,132.000000,177.000000,132.000000,0.000000,132.000000,0,0.000000,132.000000,0.000000,132.000000,0.000000,0.000000,0, + + + + +Border +525.000000 +454.000000 +15 + + +1.000000 +0xff444444 + + + + +0 +0xffffffff + + +1 +0x00000000 +0.000000 + + +1 + + +true +4,0.000000,0.000000,0.000000,0.000000,736.000000,0.000000,0,736.000000,0.000000,736.000000,0.000000,736.000000,405.000000,0,736.000000,405.000000,736.000000,405.000000,0.000000,405.000000,0,0.000000,405.000000,0.000000,405.000000,0.000000,0.000000,0, + + + diff --git a/media/360/sd/rarch_main.xui b/media/360/sd/rarch_main.xui index 5f9cf2546a..464fd3a4a8 100644 --- a/media/360/sd/rarch_main.xui +++ b/media/360/sd/rarch_main.xui @@ -11,6 +11,24 @@ 57.279999,51.040001,0.000000 RetroArchMain + + +XuiBackground +640.007507 +479.917419 +-57.347713,-50.961960,0.000000 +4 +../background.png + + + + +Panel +499.135925 +354.303986 +XuiScene_WhitePanel + + XuiTxtTitle @@ -294,6 +312,18 @@ XuiButton_two_col + + +control_ListItem +226.000000 +45.000000 +7.000000,22.000000,0.000000 +5 +false +XuiButton +0.000000,10.000000,0.000000 + + diff --git a/menu/disp/rmenu_xui.cpp b/menu/disp/rmenu_xui.cpp index 539cdd6793..84dcf6dd1a 100644 --- a/menu/disp/rmenu_xui.cpp +++ b/menu/disp/rmenu_xui.cpp @@ -28,7 +28,6 @@ #include "../../gfx/gfx_context.h" #include "../../settings_data.h" -#include "../../message_queue.h" #include "../../general.h" #include "../../gfx/d3d/d3d.h" @@ -49,10 +48,10 @@ HXUIOBJ m_menulist; HXUIOBJ m_menutitle; HXUIOBJ m_menutitlebottom; +HXUIOBJ m_background; HXUIOBJ m_back; HXUIOBJ root_menu; HXUIOBJ current_menu; -HXUIFONT m_menufont; static msg_queue_t *xui_msg_queue; class CRetroArch : public CXuiModule @@ -146,7 +145,7 @@ HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) GetChildById(L"XuiMenuList", &m_menulist); GetChildById(L"XuiTxtTitle", &m_menutitle); GetChildById(L"XuiTxtBottom", &m_menutitlebottom); - XuiCreateFont(L"Arial Unicode MS", 14, XUI_FONT_STYLE_NORMAL, 0, &m_menufont); + GetChildById(L"XuiBackground", &m_background); if (XuiHandleIsValid(m_menutitlebottom)) { @@ -159,6 +158,106 @@ HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) return 0; } +HRESULT XuiTextureLoader(IXuiDevice *pDevice, LPCWSTR szFileName, XUIImageInfo *pImageInfo, IDirect3DTexture9 **ppTex) +{ + CONST BYTE *pbTextureData = 0; + UINT cbTextureData = 0; + HXUIRESOURCE hResource = 0; + BOOL bIsMemoryResource = FALSE; + HRESULT hr; + + + hr = XuiResourceOpenNoLoc(szFileName, &hResource, &bIsMemoryResource); + if (FAILED(hr)) + return hr; + + if (bIsMemoryResource) + { + hr = XuiResourceGetBuffer(hResource, &pbTextureData); + if (FAILED(hr)) + goto cleanup; + cbTextureData = XuiResourceGetTotalSize(hResource); + } + else + { + hr = XuiResourceRead(hResource, NULL, 0, &cbTextureData); + if (FAILED(hr)) + goto cleanup; + + pbTextureData = (BYTE *)XuiAlloc(cbTextureData); + if (pbTextureData == 0) + { + hr = E_OUTOFMEMORY; + goto cleanup; + } + + hr = XuiResourceRead(hResource, (BYTE*)pbTextureData, cbTextureData, &cbTextureData); + if (FAILED(hr)) + goto cleanup; + + XuiResourceClose(hResource); + hResource = 0; + + } + + //Format specific code to initialize pImageInfo and create our texture + D3DXIMAGE_INFO pSrc; + + // Cast our d3d device into our IDirect3DDevice9* interface + IDirect3DDevice9 * d3dDevice = (IDirect3DDevice9*)pDevice->GetD3DDevice(); + if( d3dDevice == NULL ) + goto cleanup; + + // Create our texture based on our conditions + hr = D3DXCreateTextureFromFileInMemoryEx( + d3dDevice, + pbTextureData, + cbTextureData, + D3DX_DEFAULT_NONPOW2, + D3DX_DEFAULT_NONPOW2, + 1, + D3DUSAGE_CPU_CACHED_MEMORY, + D3DFMT_LIN_A8R8G8B8, + D3DPOOL_DEFAULT, + D3DX_FILTER_NONE, + D3DX_FILTER_NONE, + 0, + &pSrc, + NULL, + ppTex + ); + + if(hr != D3DXERR_INVALIDDATA ) + { + pImageInfo->Depth = pSrc.Depth; + pImageInfo->Format = pSrc.Format; + pImageInfo->Height = pSrc.Height; + pImageInfo->ImageFileFormat = pSrc.ImageFileFormat; + pImageInfo->MipLevels = pSrc.MipLevels; + pImageInfo->ResourceType = pSrc.ResourceType; + pImageInfo->Width = pSrc.Width; + } + else + RARCH_ERR("D3DXERR_INVALIDDATA Encountered\n"); + +cleanup: + + if (bIsMemoryResource && hResource != 0) + { + XuiResourceReleaseBuffer(hResource, pbTextureData); + } + else + { + XuiFree((LPVOID)pbTextureData); + } + + if (hResource != 0) + { + XuiResourceClose(hResource); + } + return hr; +} + static void* rmenu_xui_init(void) { HRESULT hr; @@ -185,8 +284,8 @@ static void* rmenu_xui_init(void) video_info.rgb32 = false; d3d_make_d3dpp(d3d, &video_info, &d3dpp); - - hr = app.InitShared(d3d->dev, &d3dpp, XuiPNGTextureLoader); + + hr = app.InitShared(d3d->dev, &d3dpp, (PFN_XUITEXTURELOADER)XuiTextureLoader); if (FAILED(hr)) { @@ -350,6 +449,10 @@ static void blit_line(int x, int y, const char *message, bool green) static void rmenu_xui_render_background(void) { + if (g_extern.content_is_init) + XuiElementSetShow(m_background, FALSE); + else + XuiElementSetShow(m_background, TRUE); } static void rmenu_xui_render_messagebox(const char *message) @@ -363,7 +466,7 @@ static void rmenu_xui_set_list_text(int index, const wchar_t* leftText, const wc HXUIOBJ hVisual = NULL, hControl = NULL, hTextLeft = NULL, hTextRight = NULL, hRightEdge = NULL; LPCWSTR currText; float width, height; - XUIRect* pRect; + XUIRect pRect; D3DXVECTOR3 textPos, rightEdgePos; hControl = XuiListGetItemControl(m_menulist, index); @@ -378,9 +481,8 @@ static void rmenu_xui_set_list_text(int index, const wchar_t* leftText, const wc XuiElementGetBounds(hTextLeft, &width, &height); if (!currText || wcscmp(currText, leftText) || width <= 5) { - pRect = new XUIRect(); - XuiMeasureText(m_menufont, leftText, -1, XUI_FONT_STYLE_NO_WORDWRAP, 0, pRect); - XuiElementSetBounds(hTextLeft, pRect->GetWidth(), height); + XuiTextElementMeasureText(hTextLeft, leftText, &pRect); + XuiElementSetBounds(hTextLeft, pRect.GetWidth(), height); } XuiTextElementSetText(hTextLeft, leftText); XuiElementGetChildById(hVisual, L"RightText", &hTextRight); @@ -390,15 +492,14 @@ static void rmenu_xui_set_list_text(int index, const wchar_t* leftText, const wc XuiElementGetBounds(hTextRight, &width, &height); if (!currText || wcscmp(currText, rightText) || width <= 5) { - pRect = new XUIRect(); - XuiMeasureText(m_menufont, rightText, -1, XUI_FONT_STYLE_NO_WORDWRAP, 0, pRect); - XuiElementSetBounds(hTextRight, pRect->GetWidth(), height); + XuiTextElementMeasureText(hTextRight, rightText, &pRect); + XuiElementSetBounds(hTextRight, pRect.GetWidth(), height); XuiElementGetPosition(hTextLeft, &textPos); XuiElementGetChildById(hVisual, L"graphic_CapRight", &hRightEdge); XuiElementGetPosition(hRightEdge, &rightEdgePos); - textPos.x = rightEdgePos.x - (pRect->GetWidth() + textPos.x); + textPos.x = rightEdgePos.x - (pRect.GetWidth() + textPos.x); XuiElementSetPosition(hTextRight, &textPos); } XuiTextElementSetText(hTextRight, rightText); @@ -532,7 +633,9 @@ static void rmenu_xui_list_delete(void *data, size_t idx, { (void)data; (void)idx; - XuiListDeleteItems(m_menulist, 0, list_size); + int x = XuiListGetItemCount( m_menulist ); + if( list_size > x ) list_size = x; + if( list_size > 0 ) XuiListDeleteItems(m_menulist, 0, list_size); } static void rmenu_xui_list_clear(void *data) diff --git a/msvc/RetroArch-360/RetroArch-360.vcxproj b/msvc/RetroArch-360/RetroArch-360.vcxproj index e924d146b8..8af4778d1e 100644 --- a/msvc/RetroArch-360/RetroArch-360.vcxproj +++ b/msvc/RetroArch-360/RetroArch-360.vcxproj @@ -120,7 +120,7 @@ true $(OutDir)$(ProjectName).pdb - xapilibd.lib;d3d9d.lib;d3dx9d.lib;xgraphicsd.lib;xboxkrnl.lib;xnetd.lib;xaudiod2.lib;xactd3.lib;x3daudiod.lib;xmcored.lib;xbdm.lib;vcompd.lib;xuirun.lib;xuirender.lib;$(TargetDir)libretro_xdk360.lib;%(AdditionalDependencies) + xapilibd.lib;d3d9d.lib;d3dx9d.lib;xgraphicsd.lib;xboxkrnl.lib;xnetd.lib;xaudiod2.lib;xactd3.lib;x3daudiod.lib;xmcored.lib;xbdm.lib;vcompd.lib;xuirund.lib;xuirenderd.lib;$(TargetDir)libretro_xdk360.lib;%(AdditionalDependencies) 524288 @@ -434,7 +434,12 @@ xui2bin /D /NOLOGO "%(RelativeDir)rarch_main.xui" "$(OutDir)media\hd\rarch_main.xur" + + + Document + + - + \ No newline at end of file diff --git a/msvc/RetroArch-360/RetroArch-360.vcxproj.filters b/msvc/RetroArch-360/RetroArch-360.vcxproj.filters index c15e73bc9f..cfaa1156b5 100644 --- a/msvc/RetroArch-360/RetroArch-360.vcxproj.filters +++ b/msvc/RetroArch-360/RetroArch-360.vcxproj.filters @@ -36,5 +36,8 @@ Source Files\media + + Source Files\media + \ No newline at end of file