mirror of
https://github.com/holub/mame
synced 2025-07-04 09:28:51 +03:00
Changes in order to compile SDL build under VS2013, removed duplicated code, it exists in strconv (nw)
This commit is contained in:
parent
6b264f7e55
commit
c44d434416
@ -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 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> \
|
template<typename _source, typename _dest> \
|
||||||
struct name { _dest FUNC_DEF(_source) { x } };
|
struct name { _dest FUNC_DEF(_source) { x } };
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ struct sdl_scale_mode
|
|||||||
#if (!SDLMAME_SDL2)
|
#if (!SDLMAME_SDL2)
|
||||||
int m_extra_flags; /* Texture/surface flags */
|
int m_extra_flags; /* Texture/surface flags */
|
||||||
#else
|
#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
|
#endif
|
||||||
int pixel_format; /* Pixel/Overlay format */
|
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);
|
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
|
// create renderer
|
||||||
|
|
||||||
/* set hints ... */
|
/* 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)
|
if (video_config.waitvsync)
|
||||||
|
@ -633,44 +633,3 @@ void sdl_osd_interface::init(running_machine &machine)
|
|||||||
SDL_EnableUNICODE(SDL_TRUE);
|
SDL_EnableUNICODE(SDL_TRUE);
|
||||||
#endif
|
#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
|
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
|
|
||||||
// standard C headers
|
// standard C headers
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#ifndef _MSC_VER
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// MAME headers
|
// MAME headers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user