(Xbox 1) Menu changes

This commit is contained in:
twinaphex 2012-08-03 00:23:09 +02:00
parent 35ad0644a9
commit d28ebe7644
5 changed files with 14 additions and 17 deletions

View File

@ -28,10 +28,12 @@ void xfonts_render_msg_pre(xdk_d3d_video_t *d3d)
d3d->d3d_render_device->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &d3d->pBackBuffer); d3d->d3d_render_device->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &d3d->pBackBuffer);
} }
void xfonts_render_msg_place(xdk_d3d_video_t *d3d, float x, float y, float scale, const wchar_t *msg, ...) void xfonts_render_msg_place(xdk_d3d_video_t *d3d, float x, float y, float scale, const char *msg)
{ {
d3d->debug_font->TextOut(d3d->pFrontBuffer, msg, (unsigned)-1, x, y); wchar_t str[256];
d3d->debug_font->TextOut(d3d->pBackBuffer, msg, (unsigned)-1, x, y); convert_char_to_wchar(str, msg, sizeof(str));
d3d->debug_font->TextOut(d3d->pFrontBuffer, str, (unsigned)-1, x, y);
d3d->debug_font->TextOut(d3d->pBackBuffer, str, (unsigned)-1, x, y);
} }
void xfonts_render_msg_post(xdk_d3d_video_t *d3d) void xfonts_render_msg_post(xdk_d3d_video_t *d3d)

View File

@ -19,7 +19,7 @@
void xfonts_deinit_font(void); void xfonts_deinit_font(void);
void xfonts_render_msg_pre(xdk_d3d_video_t *d3d); void xfonts_render_msg_pre(xdk_d3d_video_t *d3d);
void xfonts_render_msg_place(xdk_d3d_video_t *d3d, float x, float y, float scale, const wchar_t *msg, ...); void xfonts_render_msg_place(xdk_d3d_video_t *d3d, float x, float y, float scale, const char *msg);
void xfonts_render_msg_post(xdk_d3d_video_t *d3d); void xfonts_render_msg_post(xdk_d3d_video_t *d3d);
#endif #endif

View File

@ -8,7 +8,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#else #else
#if defined(_MSC_VER) && !defined(__cplusplus) #if defined(_MSC_VER) && !defined(SN_TARGET_PS3) && !defined(__cplusplus)
#define bool unsigned char #define bool unsigned char
#define true 1 #define true 1
#define false 0 #define false 0

View File

@ -47,7 +47,7 @@ int m_menuMainRomListPos_y;
// Backbuffer width, height // Backbuffer width, height
int width; int width;
int height; int height;
wchar_t m_title[128]; char m_title[128];
static uint64_t old_state = 0; static uint64_t old_state = 0;
@ -115,16 +115,14 @@ static void browser_render(filebrowser_t *b, float current_x, float current_y, f
currentY = currentY + ySpacing; currentY = currentY + ySpacing;
const char *rom_basename = fname_tmp; const char *rom_basename = fname_tmp;
wchar_t rom_basename_w[256];
//check if this is the currently selected file //check if this is the currently selected file
const char *current_pathname = filebrowser_get_current_path(b); const char *current_pathname = filebrowser_get_current_path(b);
if(strcmp(current_pathname, b->current_dir.list->elems[i].data) == 0) if(strcmp(current_pathname, b->current_dir.list->elems[i].data) == 0)
d3d_surface_render(&m_menuMainRomSelectPanel, currentX, currentY, ROM_PANEL_WIDTH, ROM_PANEL_HEIGHT); d3d_surface_render(&m_menuMainRomSelectPanel, currentX, currentY, ROM_PANEL_WIDTH, ROM_PANEL_HEIGHT);
convert_char_to_wchar(rom_basename_w, rom_basename, sizeof(rom_basename_w));
xfonts_render_msg_pre(d3d); xfonts_render_msg_pre(d3d);
xfonts_render_msg_place(d3d, currentX, currentY, 0 /* scale */, rom_basename_w); xfonts_render_msg_place(d3d, currentX, currentY, 0 /* scale */, rom_basename);
xfonts_render_msg_post(d3d); xfonts_render_msg_post(d3d);
} }
} }
@ -185,9 +183,7 @@ int menu_init(void)
struct retro_system_info info; struct retro_system_info info;
retro_get_system_info(&info); retro_get_system_info(&info);
const char *id = info.library_name ? info.library_name : "Unknown"; const char *id = info.library_name ? info.library_name : "Unknown";
char core_text[256]; snprintf(m_title, sizeof(m_title), "Libretro core: %s %s", id, info.library_version);
snprintf(core_text, sizeof(core_text), "Libretro core: %s %s", id, info.library_version);
convert_char_to_wchar(m_title, core_text, sizeof(m_title));
// Set file cache size // Set file cache size
XSetFileCacheSize(8 * 1024 * 1024); XSetFileCacheSize(8 * 1024 * 1024);

View File

@ -455,20 +455,19 @@ static bool xdk_d3d_frame(void *data, const void *frame,
char buf[128], buf2[128], buf_fps_last[128]; char buf[128], buf2[128], buf_fps_last[128];
bool ret = false; bool ret = false;
snprintf(buf, sizeof(buf), "%.2f MB free / %.2f MB total", stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f)); snprintf(buf, sizeof(buf), "%.2f MB free / %.2f MB total", stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
convert_char_to_wchar(strw_buffer, buf, sizeof(strw_buffer)); xfonts_render_msg_place(d3d, font_x + 30, font_y + 50, 0 /* scale */, buf);
xfonts_render_msg_place(d3d, font_x + 30, font_y + 50, 0 /* scale */, strw_buffer);
if(ret = gfx_window_title(buf2, sizeof(buf2)) || sizeof(buf_fps_last)) if(ret = gfx_window_title(buf2, sizeof(buf2)) || sizeof(buf_fps_last))
{ {
if(ret) if(ret)
{ {
snprintf(buf_fps_last, sizeof(buf_fps_last), buf2); snprintf(buf_fps_last, sizeof(buf_fps_last), buf2);
xfonts_render_msg_place(d3d, font_x + 30, font_y + 70, 0 /* scale */, buf_fps_last);
convert_char_to_wchar(strw_buffer, buf2, sizeof(strw_buffer)); convert_char_to_wchar(strw_buffer, buf2, sizeof(strw_buffer));
} }
else if(buf_fps_last) else if(buf_fps_last)
convert_char_to_wchar(strw_buffer, buf_fps_last, sizeof(strw_buffer)); xfonts_render_msg_place(d3d, font_x + 30, font_y + 70, 0 /* scale */, buf2);
xfonts_render_msg_place(d3d, font_x + 30, font_y + 70, 0 /* scale */, strw_buffer);
xfonts_render_msg_post(d3d); xfonts_render_msg_post(d3d);
} }
} }