Changes in order to compile SDL build under VS2013, removed duplicated code, it exists in strconv (nw)

This commit is contained in:
Miodrag Milanovic 2015-03-31 09:48:28 +02:00
parent 6b264f7e55
commit c44d434416
4 changed files with 5 additions and 44 deletions

View File

@ -51,7 +51,7 @@ inline UINT32 pixel_ycc_to_rgb_pal(const UINT16 *pixel, const rgb_t *palette)
#define FUNC_DEF(source) op(const source &src, const rgb_t *palbase) const
#define FUNCTOR(name, x...) \
#define FUNCTOR(name, x) \
template<typename _source, typename _dest> \
struct name { _dest FUNC_DEF(_source) { x } };

View File

@ -129,7 +129,7 @@ struct sdl_scale_mode
#if (!SDLMAME_SDL2)
int m_extra_flags; /* Texture/surface flags */
#else
const char *sdl_scale_mode; /* what to use as a hint ? */
const char *sdl_scale_mode_hint; /* what to use as a hint ? */
#endif
int pixel_format; /* Pixel/Overlay format */
void (*yuv_blit)(const UINT16 *bitmap, UINT8 *ptr, const int pitch, const UINT32 *lookup, const int width, const int height);
@ -435,7 +435,7 @@ int sdl_info::create()
// create renderer
/* set hints ... */
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, sm->sdl_scale_mode);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, sm->sdl_scale_mode_hint);
if (video_config.waitvsync)

View File

@ -633,44 +633,3 @@ void sdl_osd_interface::init(running_machine &machine)
SDL_EnableUNICODE(SDL_TRUE);
#endif
}
#ifdef SDLMAME_WIN32
//============================================================
// wstring_from_utf8
//============================================================
WCHAR *wstring_from_utf8(const char *utf8string)
{
int char_count;
WCHAR *result;
// convert MAME string (UTF-8) to UTF-16
char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0);
result = (WCHAR *)osd_malloc_array(char_count * sizeof(*result));
if (result != NULL)
MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count);
return result;
}
//============================================================
// utf8_from_wstring
//============================================================
char *utf8_from_wstring(const WCHAR *wstring)
{
int char_count;
char *result;
// convert UTF-16 to MAME string (UTF-8)
char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, NULL, 0, NULL, NULL);
result = (char *)osd_malloc_array(char_count * sizeof(*result));
if (result != NULL)
WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, NULL, NULL);
return result;
}
#endif

View File

@ -20,7 +20,9 @@
// standard C headers
#include <math.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
// MAME headers