Merge pull request #1336 from Swizzy/master

XUI Fixes
This commit is contained in:
Twinaphex 2015-01-13 01:02:35 +01:00
commit 5c60218d5a
8 changed files with 726 additions and 147 deletions

View File

@ -8,11 +8,6 @@ static void renderchain_set_vertices(void *data, unsigned pass, unsigned width,
static void renderchain_clear(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
#ifdef _XBOX360
for (int i = 0; i < 4; i++)
d3d_set_stream_source(d3d->dev, i, NULL, 0, 0);
#endif
d3d_texture_free(d3d->tex);
d3d_vertex_buffer_free(d3d->vertex_buf);

BIN
media/360/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -8,9 +8,27 @@
<Id>XuiScene1</Id>
<Width>824.000061</Width>
<Height>496.000061</Height>
<Position>226.769989,123.938545,0.000000</Position>
<Position>225.000000,122.000000,0.000000</Position>
<ClassOverride>RetroArchMain</ClassOverride>
</Properties>
<XuiImage>
<Properties>
<Id>XuiBackground</Id>
<Width>1280.000000</Width>
<Height>720.000000</Height>
<Position>-225.000000,-122.000000,0.000000</Position>
<SizeMode>16</SizeMode>
<ImagePath>../background.png</ImagePath>
</Properties>
</XuiImage>
<XuiControl>
<Properties>
<Id>Panel</Id>
<Width>824.000000</Width>
<Height>496.000000</Height>
<Visual>XuiScene_WhitePanel</Visual>
</Properties>
</XuiControl>
<XuiText>
<Properties>
<Id>XuiTxtTitle</Id>
@ -366,6 +384,100 @@
<Visual>XuiButton_two_col</Visual>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>254.000000</Width>
<Height>40.000000</Height>
<Position>7.000000,26.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton_two_col</Visual>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>254.000000</Width>
<Height>40.000000</Height>
<Position>7.000000,26.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton_two_col</Visual>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiText>
<Properties>

View File

@ -17956,4 +17956,351 @@
</Timeline>
</Timelines>
</XuiVisual>
<XuiVisual>
<Properties>
<Id>XuiControl_PanelGlow</Id>
<Width>1024.000000</Width>
<Height>516.000000</Height>
</Properties>
<XuiFigure>
<Properties>
<Id>figGlow_BL</Id>
<Width>40.000000</Width>
<Height>40.000000</Height>
<Position>-40.000000,516.000000,0.000000</Position>
<Anchor>9</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>3</FillType>
<FillColor>0xffebebeb</FillColor>
<Gradient>
<Properties>
<Radial>true</Radial>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<Translation>0.500000,0.500000,0.000000</Translation>
<Rotation>270.000000</Rotation>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>figGlow_L</Id>
<Width>20.000000</Width>
<Height>516.000000</Height>
<Position>-20.000000,0.000000,0.000000</Position>
<Anchor>11</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>2</FillType>
<FillColor>0xffebebeb</FillColor>
<Gradient>
<Properties>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<Rotation>180.000000</Rotation>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>figGlow_TL</Id>
<Width>40.000000</Width>
<Height>40.000000</Height>
<Position>-40.000000,-40.000000,0.000000</Position>
<Anchor>3</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>3</FillType>
<FillColor>0xffebebeb</FillColor>
<Gradient>
<Properties>
<Radial>true</Radial>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<Translation>0.500000,0.500000,0.000000</Translation>
<Rotation>180.000000</Rotation>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>figGlow_T</Id>
<Width>1024.000000</Width>
<Height>20.000000</Height>
<Position>0.000000,-20.000000,0.000000</Position>
<Anchor>7</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>2</FillType>
<FillColor>0x00000000</FillColor>
<Gradient>
<Properties>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<Rotation>90.000000</Rotation>
<TransformVersion>1</TransformVersion>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>figGlow_TR</Id>
<Width>40.000000</Width>
<Height>40.000000</Height>
<Position>1024.000000,-40.000000,0.000000</Position>
<Anchor>6</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>3</FillType>
<FillColor>0xffebebeb</FillColor>
<Gradient>
<Properties>
<Radial>true</Radial>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<Translation>0.500000,0.500000,0.000000</Translation>
<Rotation>90.000000</Rotation>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>figGlow_BR</Id>
<Width>40.000000</Width>
<Height>40.000000</Height>
<Position>1024.000000,516.000000,0.000000</Position>
<Anchor>12</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>3</FillType>
<FillColor>0xffebebeb</FillColor>
<Gradient>
<Properties>
<Radial>true</Radial>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<Translation>0.500000,0.500000,0.000000</Translation>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>figGlow_B</Id>
<Width>1024.000000</Width>
<Height>20.000000</Height>
<Position>0.000000,516.000000,0.000000</Position>
<Anchor>13</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>2</FillType>
<FillColor>0x00000000</FillColor>
<Gradient>
<Properties>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<Rotation>270.000000</Rotation>
<TransformVersion>1</TransformVersion>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>figGlow_R</Id>
<Width>20.000000</Width>
<Height>516.000000</Height>
<Position>1024.000000,0.000000,0.000000</Position>
<Anchor>14</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff0f0f80</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>2</FillType>
<FillColor>0xffebebeb</FillColor>
<Gradient>
<Properties>
<NumStops>2</NumStops>
<StopColor index="0">0x64000000</StopColor>
<StopColor index="1">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
</XuiVisual>
<XuiVisual>
<Properties>
<Id>XuiScene_WhitePanel</Id>
<Width>525.000000</Width>
<Height>454.000031</Height>
</Properties>
<XuiControl>
<Properties>
<Id>PanelGlow</Id>
<Width>525.000000</Width>
<Height>454.000000</Height>
<Anchor>15</Anchor>
<Visual>XuiControl_PanelGlow</Visual>
</Properties>
</XuiControl>
<XuiFigure>
<Properties>
<Id>Panel</Id>
<Width>525.000000</Width>
<Height>454.000000</Height>
<Anchor>15</Anchor>
<Stroke>
<Properties>
<StrokeColor>0xff000000</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillColor>0xff968d96</FillColor>
<Gradient>
<Properties>
<NumStops>2</NumStops>
<StopColor index="0">0xffebebeb</StopColor>
<StopColor index="1">0xff0f0f0f</StopColor>
<StopPos index="0">0.000000</StopPos>
<StopPos index="1">1.000000</StopPos>
</Properties>
</Gradient>
<TransformVersion>1</TransformVersion>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
<XuiFigure>
<Properties>
<Id>Border</Id>
<Width>525.000000</Width>
<Height>454.000000</Height>
<Anchor>15</Anchor>
<Stroke>
<Properties>
<StrokeWidth>1.000000</StrokeWidth>
<StrokeColor>0xff444444</StrokeColor>
</Properties>
</Stroke>
<Fill>
<Properties>
<FillType>0</FillType>
<FillColor>0xffffffff</FillColor>
<Gradient>
<Properties>
<NumStops>1</NumStops>
<StopColor index="0">0x00000000</StopColor>
<StopPos index="0">0.000000</StopPos>
</Properties>
</Gradient>
<TransformVersion>1</TransformVersion>
</Properties>
</Fill>
<Closed>true</Closed>
<Points>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,</Points>
</Properties>
</XuiFigure>
</XuiVisual>
</XuiCanvas>

View File

@ -11,6 +11,24 @@
<Position>57.279999,51.040001,0.000000</Position>
<ClassOverride>RetroArchMain</ClassOverride>
</Properties>
<XuiImage>
<Properties>
<Id>XuiBackground</Id>
<Width>640.007507</Width>
<Height>479.917419</Height>
<Position>-57.347713,-50.961960,0.000000</Position>
<SizeMode>4</SizeMode>
<ImagePath>../background.png</ImagePath>
</Properties>
</XuiImage>
<XuiControl>
<Properties>
<Id>Panel</Id>
<Width>499.135925</Width>
<Height>354.303986</Height>
<Visual>XuiScene_WhitePanel</Visual>
</Properties>
</XuiControl>
<XuiText>
<Properties>
<Id>XuiTxtTitle</Id>
@ -294,6 +312,18 @@
<Visual>XuiButton_two_col</Visual>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiText>
<Properties>

View File

@ -48,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
@ -145,16 +145,119 @@ 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);
char str[PATH_MAX_LENGTH];
snprintf(str, sizeof(str), "%s - %s", PACKAGE_VERSION, g_extern.title_buf);
mbstowcs(strw_buffer, str, sizeof(strw_buffer) / sizeof(wchar_t));
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
if (XuiHandleIsValid(m_menutitlebottom))
{
char str[PATH_MAX_LENGTH];
snprintf(str, sizeof(str), "%s - %s", PACKAGE_VERSION, g_extern.title_buf);
mbstowcs(strw_buffer, str, sizeof(strw_buffer) / sizeof(wchar_t));
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
}
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;
@ -181,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))
{
@ -346,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)
@ -354,151 +461,129 @@ static void rmenu_xui_render_messagebox(const char *message)
msg_queue_push(xui_msg_queue, message, 2, 1);
}
static void rmenu_xui_set_list_text(int index, const wchar_t* leftText, const wchar_t* rightText)
{
HXUIOBJ hVisual = NULL, hControl = NULL, hTextLeft = NULL, hTextRight = NULL, hRightEdge = NULL;
LPCWSTR currText;
float width, height;
XUIRect pRect;
D3DXVECTOR3 textPos, rightEdgePos;
hControl = XuiListGetItemControl(m_menulist, index);
if (XuiHandleIsValid(hControl))
XuiControlGetVisual(hControl, &hVisual);
if(XuiHandleIsValid(hVisual))
{
XuiElementGetChildById(hVisual, L"LeftText", &hTextLeft);
if(XuiHandleIsValid(hTextLeft))
{
currText = XuiTextElementGetText(hTextLeft);
XuiElementGetBounds(hTextLeft, &width, &height);
if (!currText || wcscmp(currText, leftText) || width <= 5)
{
XuiTextElementMeasureText(hTextLeft, leftText, &pRect);
XuiElementSetBounds(hTextLeft, pRect.GetWidth(), height);
}
XuiTextElementSetText(hTextLeft, leftText);
XuiElementGetChildById(hVisual, L"RightText", &hTextRight);
if(XuiHandleIsValid(hTextRight))
{
currText = XuiTextElementGetText(hTextRight);
XuiElementGetBounds(hTextRight, &width, &height);
if (!currText || wcscmp(currText, rightText) || width <= 5)
{
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);
XuiElementSetPosition(hTextRight, &textPos);
}
XuiTextElementSetText(hTextRight, rightText);
}
}
}
}
static void rmenu_xui_render(void)
{
size_t begin, end;
char title[256];
const char *dir = NULL;
const char *label = NULL;
unsigned menu_type = 0;
size_t end, i;
char title[PATH_MAX_LENGTH];
const char *dir = NULL, *label = NULL;
unsigned menu_type = 0;
(void)begin;
if (!driver.menu || driver.menu->need_refresh &&
g_extern.is_menu && !driver.menu->msg_force)
return;
if (!driver.menu || driver.menu->need_refresh &&
g_extern.is_menu && !driver.menu->msg_force)
return;
rmenu_xui_render_background();
end = menu_list_get_size(driver.menu->menu_list);
menu_list_get_last_stack(driver.menu->menu_list, &dir, &label, &menu_type);
rmenu_xui_render_background();
if (XuiHandleIsValid(m_menutitle))
{
get_title(label, dir, menu_type, title, sizeof(title));
mbstowcs(strw_buffer, title, sizeof(strw_buffer) / sizeof(wchar_t));
XuiTextElementSetText(m_menutitle, strw_buffer);
menu_ticker_line(title, RXUI_TERM_WIDTH - 3, g_extern.frame_count / 15, title, true);
}
menu_list_get_last_stack(driver.menu->menu_list, &dir,
&label, &menu_type);
if (XuiHandleIsValid(m_menutitle))
{
const char *core_name = g_extern.menu.info.library_name;
if (!core_name)
core_name = g_extern.system.info.library_name;
if (!core_name)
core_name = "No Core";
get_title(label, dir, menu_type, title, sizeof(title));
const char *core_version = g_extern.menu.info.library_version;
if (!core_version)
core_version = g_extern.system.info.library_version;
if (!core_version)
core_version = "";
mbstowcs(strw_buffer, title, sizeof(strw_buffer) / sizeof(wchar_t));
XuiTextElementSetText(m_menutitle, strw_buffer);
snprintf(title, sizeof(title), "%s - %s %s",
PACKAGE_VERSION, core_name, core_version);
char title_buf[256];
menu_ticker_line(title_buf, RXUI_TERM_WIDTH - 3,
g_extern.frame_count / 15, title, true);
blit_line(RXUI_TERM_START_X + 15, 15, title_buf, true);
mbstowcs(strw_buffer, title, sizeof(strw_buffer) / sizeof(wchar_t));
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
}
char title_msg[64];
const char *core_name = g_extern.menu.info.library_name;
if (!core_name)
core_name = g_extern.system.info.library_name;
if (!core_name)
core_name = "No Core";
end = menu_list_get_size(driver.menu->menu_list);
for (i = 0; i < end; i++)
{
wchar_t msg_left[PATH_MAX_LENGTH], msg_right[PATH_MAX_LENGTH];
char type_str[PATH_MAX_LENGTH], entry_title_buf[PATH_MAX_LENGTH], path_buf[PATH_MAX_LENGTH];
const char *path = NULL, *entry_label = NULL;
unsigned type = 0, w = 0;
const char *core_version = g_extern.menu.info.library_version;
if (!core_version)
core_version = g_extern.system.info.library_version;
if (!core_version)
core_version = "";
menu_list_get_at_offset(driver.menu->menu_list->selection_buf, i, &path,
&entry_label, &type);
snprintf(title_msg, sizeof(title_msg), "%s - %s %s",
PACKAGE_VERSION, core_name, core_version);
mbstowcs(strw_buffer, title_msg, sizeof(strw_buffer) / sizeof(wchar_t));
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
disp_set_label(driver.menu->menu_list->selection_buf,
&w, type, i, label,
type_str, sizeof(type_str),
entry_label, path,
path_buf, sizeof(path_buf));
unsigned x, y;
size_t i;
mbstowcs(msg_left, path_buf, sizeof(msg_left) / sizeof(wchar_t));
mbstowcs(msg_right, type_str, sizeof(msg_right) / sizeof(wchar_t));
rmenu_xui_set_list_text(i, msg_left, msg_right);
}
XuiListSetCurSelVisible(m_menulist, driver.menu->selection_ptr);
x = RXUI_TERM_START_X;
y = RXUI_TERM_START_Y;
for (i = 0; i < end; i++/*, y += FONT_HEIGHT_STRIDE */)
{
char type_str[PATH_MAX_LENGTH],entry_title_buf[PATH_MAX_LENGTH], path_buf[PATH_MAX_LENGTH];
const char *path = NULL, *entry_label = NULL;
unsigned type = 0, w = 0;
bool selected = false;
(void)entry_title_buf;
menu_list_get_at_offset(driver.menu->menu_list->selection_buf, i, &path,
&entry_label, &type);
disp_set_label(driver.menu->menu_list->selection_buf,
&w, type, i, label,
type_str, sizeof(type_str),
entry_label, path,
path_buf, sizeof(path_buf));
selected = (i == driver.menu->selection_ptr);
#if 0
if ((type == MENU_FILE_PLAIN || type == MENU_FILE_DIRECTORY))
menu_ticker_line(entry_title_buf, RXUI_TERM_WIDTH - (w + 1 + 2), g_extern.frame_count / 15, path, selected);
else
menu_ticker_line(type_str_buf, w, g_extern.frame_count / 15, type_str, selected);
#endif
HXUIOBJ hVisual = NULL;
HXUIOBJ hControl = XuiListGetItemControl(m_menulist, i);
if (XuiHandleIsValid(hControl))
XuiControlGetVisual(hControl, &hVisual);
if(XuiHandleIsValid(hVisual))
{
HXUIOBJ hTextLeft = NULL, hTextRight = NULL;
XuiElementGetChildById(hVisual, L"LeftText", &hTextLeft);
XuiElementGetChildById(hVisual, L"RightText", &hTextRight);
wchar_t msg_w[256];
if(XuiHandleIsValid(hTextLeft))
{
mbstowcs(msg_w, path_buf, sizeof(msg_w) / sizeof(wchar_t));
LPCWSTR currText = XuiTextElementGetText(hTextLeft);
XuiTextElementSetText(hTextLeft, msg_w);
float width, height;
XuiElementGetBounds(hTextLeft, &width, &height);
if (!currText || wcscmp(currText, msg_w) || width <= 1)
{
XUIRect* pRect = new XUIRect();
XuiMeasureText(m_menufont, msg_w, -1, XUI_FONT_STYLE_NO_WORDWRAP, 0, pRect);
if (width < pRect->GetWidth())
XuiElementSetBounds(hTextLeft, pRect->GetWidth(), height);
}
}
if(XuiHandleIsValid(hTextRight))
{
mbstowcs(msg_w, type_str, sizeof(msg_w) / sizeof(wchar_t));
LPCWSTR currText = XuiTextElementGetText(hTextRight);
XuiTextElementSetText(hTextRight, msg_w);
float width, height;
XuiElementGetBounds(hTextRight, &width, &height);
if (!currText || wcscmp(currText, msg_w) || width <= 1) // Check if we need to adjust width
{
XUIRect* pRect = new XUIRect();
XuiMeasureText(m_menufont, msg_w, -1, XUI_FONT_STYLE_NO_WORDWRAP, 0, pRect);
XuiElementSetBounds(hTextRight, pRect->GetWidth(), height);
D3DXVECTOR3 textPos, rPos;
XuiElementGetPosition(hTextLeft, &textPos);
HXUIOBJ hRightEdge = NULL;
XuiElementGetChildById(hVisual, L"graphic_CapRight", &hRightEdge);
XuiElementGetPosition(hRightEdge, &rPos);
textPos.x = rPos.x - (pRect->GetWidth() + textPos.x);
XuiElementSetPosition(hTextRight, &textPos);
}
}
}
}
XuiListSetCurSelVisible(m_menulist, driver.menu->selection_ptr);
if (driver.menu->keyboard.display)
{
char msg[1024];
const char *str = *driver.menu->keyboard.buffer;
if (!str)
str = "";
snprintf(msg, sizeof(msg), "%s\n%s", driver.menu->keyboard.label, str);
rmenu_xui_render_messagebox(msg);
}
if (driver.menu->keyboard.display)
{
char msg[1024];
const char *str = *driver.menu->keyboard.buffer;
if (!str)
str = "";
snprintf(msg, sizeof(msg), "%s\n%s", driver.menu->keyboard.label, str);
rmenu_xui_render_messagebox(msg);
}
}
static void rmenu_xui_populate_entries(void *data, const char *path,
@ -548,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)

View File

@ -120,7 +120,7 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
<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;xuirun.lib;xuirender.lib;$(TargetDir)libretro_xdk360.lib;%(AdditionalDependencies)</AdditionalDependencies>
<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)</AdditionalDependencies>
<StackCommitSize>524288</StackCommitSize>
</Link>
<Deploy>
@ -434,7 +434,12 @@
<Command Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_main.xui" "$(OutDir)media\hd\rarch_main.xur"</Command>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\media\360\background.png">
<FileType>Document</FileType>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -36,5 +36,8 @@
<CustomBuild Include="..\..\media\360\rarch_scene_skin.xui">
<Filter>Source Files\media</Filter>
</CustomBuild>
<CustomBuild Include="..\..\media\360\background.png">
<Filter>Source Files\media</Filter>
</CustomBuild>
</ItemGroup>
</Project>