diff options
Diffstat (limited to 'src/osd/sdl')
| -rw-r--r-- | src/osd/sdl/blit13.h | 62 | ||||
| -rw-r--r-- | src/osd/sdl/draw13.c | 110 | ||||
| -rw-r--r-- | src/osd/sdl/drawbgfx.c | 33 | ||||
| -rw-r--r-- | src/osd/sdl/drawogl.c | 82 | ||||
| -rw-r--r-- | src/osd/sdl/drawsdl.c | 6 | ||||
| -rw-r--r-- | src/osd/sdl/sdl.mak | 8 | ||||
| -rw-r--r-- | src/osd/sdl/video.h | 10 | ||||
| -rw-r--r-- | src/osd/sdl/window.c | 18 | ||||
| -rw-r--r-- | src/osd/sdl/window.h | 36 |
9 files changed, 174 insertions, 191 deletions
diff --git a/src/osd/sdl/blit13.h b/src/osd/sdl/blit13.h index ad935941036..3fd229e93da 100644 --- a/src/osd/sdl/blit13.h +++ b/src/osd/sdl/blit13.h @@ -35,7 +35,6 @@ inline UINT32 ycc_to_rgb(const UINT8 y, const UINT8 cb, const UINT8 cr) inline UINT32 pixel_ycc_to_rgb(const UINT16 *pixel) { - const UINT32 p = *(UINT32 *)((FPTR) pixel & ~3); return ycc_to_rgb((*pixel >> 8) & 0xff, (p) & 0xff, (p>>16) & 0xff); } @@ -53,17 +52,17 @@ 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...) \ - template<typename _source, typename _dest> \ - struct name { _dest FUNC_DEF(_source) { x } }; + template<typename _source, typename _dest> \ + struct name { _dest FUNC_DEF(_source) { x } }; FUNCTOR(op_argb32_argb32, return src; ) FUNCTOR(op_rgb32_argb32, return src | 0xff000000; ) FUNCTOR(op_pal16_argb32, return 0xff000000 |palbase[src]; ) FUNCTOR(op_pal16_rgb32, return palbase[src]; ) FUNCTOR(op_rgb32pal_argb32, - return palbase[0x200 + (((src) >> 16) & 0xff) ] | - palbase[0x100 + (((src) >> 8) & 0xff) ] | - palbase[((src) & 0xff) ] | 0xff000000; ) + return palbase[0x200 + (((src) >> 16) & 0xff) ] | + palbase[0x100 + (((src) >> 8) & 0xff) ] | + palbase[((src) & 0xff) ] | 0xff000000; ) FUNCTOR(op_pal16a_argb32, return palbase[src]; ) @@ -74,21 +73,21 @@ FUNCTOR(op_rgb15_argb32, FUNCTOR(op_rgb15pal_argb32, return 0xff000000 | palbase[0x40 + ((src >> 10) & 0x1f)] | - palbase[0x20 + ((src >> 5) & 0x1f)] | palbase[0x00 + ((src >> 0) & 0x1f)]; ) + palbase[0x20 + ((src >> 5) & 0x1f)] | palbase[0x00 + ((src >> 0) & 0x1f)]; ) FUNCTOR(op_argb32_rgb32, return premult32(src); ) FUNCTOR(op_pal16a_rgb32, return premult32(palbase[src]); ) FUNCTOR(op_pal16_argb1555, return (palbase[src]&0xf80000) >> 9 | - (palbase[src]&0x00f800) >> 6 | - (palbase[src]&0x0000f8) >> 3 | 0x8000; ) + (palbase[src]&0x00f800) >> 6 | + (palbase[src]&0x0000f8) >> 3 | 0x8000; ) FUNCTOR(op_rgb15_argb1555, return src | 0x8000; ) FUNCTOR(op_rgb15pal_argb1555, return (palbase[src >> 10] & 0xf8) << 7 | - (palbase[(src >> 5) & 0x1f] & 0xf8) << 2 | - (palbase[src & 0x1f] & 0xf8) >> 3 | 0x8000; ) + (palbase[(src >> 5) & 0x1f] & 0xf8) << 2 | + (palbase[src & 0x1f] & 0xf8) >> 3 | 0x8000; ) FUNCTOR(op_yuv16_uyvy, return src; ) FUNCTOR(op_yuv16pal_uyvy, return (palbase[(src >> 8) & 0xff] << 8) | (src & 0x00ff); ) @@ -106,11 +105,11 @@ FUNCTOR(op_yuv16pal_yuy2, FUNCTOR(op_yuv16_argb32, return (UINT64) ycc_to_rgb((src >> 8) & 0xff, src & 0xff , (src>>16) & 0xff) - | ((UINT64)ycc_to_rgb((src >> 24) & 0xff, src & 0xff , (src>>16) & 0xff) << 32); ) + | ((UINT64)ycc_to_rgb((src >> 24) & 0xff, src & 0xff , (src>>16) & 0xff) << 32); ) FUNCTOR(op_yuv16pal_argb32, return (UINT64)ycc_to_rgb(palbase[(src >> 8) & 0xff], src & 0xff , (src>>16) & 0xff) - | ((UINT64)ycc_to_rgb(palbase[(src >> 24) & 0xff], src & 0xff , (src>>16) & 0xff) << 32);) + | ((UINT64)ycc_to_rgb(palbase[(src >> 24) & 0xff], src & 0xff , (src>>16) & 0xff) << 32);) FUNCTOR(op_yuv16_argb32rot, return pixel_ycc_to_rgb(&src) ; ) @@ -121,7 +120,6 @@ FUNCTOR(op_yuv16pal_argb32rot, return pixel_ycc_to_rgb_pal(&src, palbase); ) //============================================================ struct blit_base { - blit_base(int dest_bpp, bool is_rot, bool is_passthrough) : m_dest_bpp(dest_bpp), m_is_rot(is_rot), m_is_passthrough(is_passthrough) { } @@ -137,24 +135,24 @@ template<typename _src_type, typename _dest_type, typename _op, int _len_div> struct blit_texcopy : public blit_base { blit_texcopy() : blit_base(sizeof(_dest_type) / _len_div, false, false) { } - void texop(const texture_info *texture, const render_texinfo *texsource) const - { - ATTR_UNUSED const rgb_t *palbase = texsource->palette; - int x, y; - /* loop over Y */ - for (y = 0; y < texsource->height; y++) { - _src_type *src = (_src_type *)texsource->base + y * texsource->rowpixels / (_len_div); - _dest_type *dst = (_dest_type *)((UINT8 *)texture->m_pixels + y * texture->m_pitch); - x = texsource->width / (_len_div); - while (x > 0) { - *dst++ = m_op.op(*src, palbase); - src++; - x--; - } - } - } + void texop(const texture_info *texture, const render_texinfo *texsource) const + { + ATTR_UNUSED const rgb_t *palbase = texsource->palette; + int x, y; + /* loop over Y */ + for (y = 0; y < texsource->height; y++) { + _src_type *src = (_src_type *)texsource->base + y * texsource->rowpixels / (_len_div); + _dest_type *dst = (_dest_type *)((UINT8 *)texture->m_pixels + y * texture->m_pitch); + x = texsource->width / (_len_div); + while (x > 0) { + *dst++ = m_op.op(*src, palbase); + src++; + x--; + } + } + } private: - _op m_op; + _op m_op; }; #define TEXCOPYA(a, b, c, d) \ @@ -187,7 +185,7 @@ struct blit_texrot : public blit_base } } private: - _op m_op; + _op m_op; }; #define TEXROTA(a, b, c) \ diff --git a/src/osd/sdl/draw13.c b/src/osd/sdl/draw13.c index d75e2ca0b2b..fdb02c010e5 100644 --- a/src/osd/sdl/draw13.c +++ b/src/osd/sdl/draw13.c @@ -49,12 +49,12 @@ enum static inline bool is_opaque(const float &a) { - return (a >= 1.0f); + return (a >= 1.0f); } static inline bool is_transparent(const float &a) { - return (a < 0.0001f); + return (a < 0.0001f); } //============================================================ @@ -64,11 +64,11 @@ static inline bool is_transparent(const float &a) struct quad_setup_data { - quad_setup_data() - : dudx(0), dvdx(0), dudy(0), dvdy(0), startu(0), startv(0), - rotwidth(0), rotheight(0) - {} - void compute(const render_primitive &prim, const int prescale); + quad_setup_data() + : dudx(0), dvdx(0), dudy(0), dvdy(0), startu(0), startv(0), + rotwidth(0), rotheight(0) + {} + void compute(const render_primitive &prim, const int prescale); INT32 dudx, dvdx, dudy, dvdy; INT32 startu, startv; @@ -85,16 +85,16 @@ struct copy_info_t; /* texture_info holds information about a texture */ class texture_info { - friend class simple_list<texture_info>; + friend class simple_list<texture_info>; public: - texture_info(SDL_Renderer *renderer, const render_texinfo &texsource, const quad_setup_data &setup, const UINT32 flags); - ~texture_info(); + texture_info(SDL_Renderer *renderer, const render_texinfo &texsource, const quad_setup_data &setup, const UINT32 flags); + ~texture_info(); - void set_data(const render_texinfo &texsource, const UINT32 flags); - void render_quad(const render_primitive *prim, const int x, const int y); - bool matches(const render_primitive &prim, const quad_setup_data &setup); + void set_data(const render_texinfo &texsource, const UINT32 flags); + void render_quad(const render_primitive *prim, const int x, const int y); + bool matches(const render_primitive &prim, const quad_setup_data &setup); - copy_info_t *compute_size_type(); + copy_info_t *compute_size_type(); void *m_pixels; // pixels for the texture int m_pitch; @@ -105,31 +105,31 @@ public: osd_ticks_t m_last_access; int raw_width() const { return m_texinfo.width; } - int raw_height() const { return m_texinfo.height; } + int raw_height() const { return m_texinfo.height; } - texture_info *next() { return m_next; } - const render_texinfo &texinfo() const { return m_texinfo; } - render_texinfo &texinfo() { return m_texinfo; } + texture_info *next() { return m_next; } + const render_texinfo &texinfo() const { return m_texinfo; } + render_texinfo &texinfo() { return m_texinfo; } - const HashT hash() const { return m_hash; } - const UINT32 flags() const { return m_flags; } - // FIXME: - const bool is_pixels_owned() const; + const HashT hash() const { return m_hash; } + const UINT32 flags() const { return m_flags; } + // FIXME: + const bool is_pixels_owned() const; private: - Uint32 m_sdl_access; - SDL_Renderer * m_sdl_renderer; - render_texinfo m_texinfo; // copy of the texture info - HashT m_hash; // hash value for the texture (must be >= pointer size) - UINT32 m_flags; // rendering flags + Uint32 m_sdl_access; + SDL_Renderer * m_sdl_renderer; + render_texinfo m_texinfo; // copy of the texture info + HashT m_hash; // hash value for the texture (must be >= pointer size) + UINT32 m_flags; // rendering flags - SDL_Texture * m_texture_id; - bool m_is_rotated; + SDL_Texture * m_texture_id; + bool m_is_rotated; - int m_format; // texture format - SDL_BlendMode m_sdl_blendmode; + int m_format; // texture format + SDL_BlendMode m_sdl_blendmode; - texture_info * m_next; // next texture in the list + texture_info * m_next; // next texture in the list }; //============================================================ @@ -142,13 +142,13 @@ private: class sdl_info13 : public osd_renderer { public: - sdl_info13(osd_window *w) - : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_sdl_renderer(NULL), - m_last_hofs(0), m_last_vofs(0), - m_width(0), m_height(0), - m_blitwidth(0), m_blitheight(0), - m_last_blit_time(0), m_last_blit_pixels(0) - {} + sdl_info13(osd_window *w) + : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_sdl_renderer(NULL), + m_last_hofs(0), m_last_vofs(0), + m_width(0), m_height(0), + m_blitwidth(0), m_blitheight(0), + m_last_blit_time(0), m_last_blit_pixels(0) + {} /* virtual */ int create(); /* virtual */ int draw(const int update); @@ -168,12 +168,12 @@ public: } private: - void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y); + void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y); - texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup); - texture_info *texture_update(const render_primitive &prim); + texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup); + texture_info *texture_update(const render_primitive &prim); - void destroy_all_textures(); + void destroy_all_textures(); INT32 m_blittimer; @@ -190,11 +190,11 @@ private: float m_last_hofs; float m_last_vofs; - int m_width; - int m_height; + int m_width; + int m_height; - int m_blitwidth; - int m_blitheight; + int m_blitwidth; + int m_blitheight; // Stats INT64 m_last_blit_time; @@ -204,7 +204,7 @@ private: struct copy_info_t { int src_fmt; Uint32 dst_fmt; - const blit_base *blitter; + const blit_base *blitter; Uint32 bm_mask; const char *srcname; const char *dstname; @@ -241,7 +241,7 @@ static void drawsdl2_exit(void); static copy_info_t blit_info_default[] = { /* no rotation */ - ENTRY(ARGB32, ARGB8888, argb32_argb32), + ENTRY(ARGB32, ARGB8888, argb32_argb32), ENTRY_LR(ARGB32, RGB888, argb32_rgb32), /* Entry primarily for directfb */ ENTRY_BM(ARGB32, RGB888, argb32_rgb32, SDL_BLENDMODE_ADD), @@ -249,12 +249,12 @@ static copy_info_t blit_info_default[] = ENTRY_BM(ARGB32, RGB888, argb32_rgb32, SDL_BLENDMODE_NONE), ENTRY(RGB32, ARGB8888, rgb32_argb32), - ENTRY(RGB32, RGB888, rgb32_rgb32), + ENTRY(RGB32, RGB888, rgb32_rgb32), ENTRY(RGB32_PALETTED, ARGB8888, rgb32pal_argb32), ENTRY(RGB32_PALETTED, RGB888, rgb32pal_argb32), - ENTRY(YUY16, UYVY, yuv16_uyvy), + ENTRY(YUY16, UYVY, yuv16_uyvy), ENTRY(YUY16, YUY2, yuv16_yuy2), ENTRY(YUY16, YVYU, yuv16_yvyu), ENTRY(YUY16, ARGB8888, yuv16_argb32), @@ -269,7 +269,7 @@ static copy_info_t blit_info_default[] = ENTRY(PALETTE16, ARGB8888, pal16_argb32), ENTRY(PALETTE16, RGB888, pal16_argb32), - ENTRY(RGB15, RGB555, rgb15_rgb555), + ENTRY(RGB15, RGB555, rgb15_rgb555), ENTRY(RGB15, ARGB1555, rgb15_argb1555), ENTRY(RGB15, ARGB8888, rgb15_argb32), ENTRY(RGB15, RGB888, rgb15_argb32), @@ -647,7 +647,6 @@ void sdl_info13::destroy() int sdl_info13::xy_to_render_target(int x, int y, int *xt, int *yt) { - *xt = x - m_last_hofs; *yt = y - m_last_vofs; if (*xt<0 || *xt >= m_blitwidth) @@ -830,8 +829,8 @@ copy_info_t *texture_info::compute_size_type() // FIXME: const bool texture_info::is_pixels_owned() const { // do we own / allocated it ? - return ((m_sdl_access == SDL_TEXTUREACCESS_STATIC) - && (m_copyinfo->blitter->m_is_passthrough)); + return ((m_sdl_access == SDL_TEXTUREACCESS_STATIC) + && (m_copyinfo->blitter->m_is_passthrough)); } //============================================================ @@ -1098,4 +1097,3 @@ texture_info * sdl_info13::texture_update(const render_primitive &prim) } return texture; } - diff --git a/src/osd/sdl/drawbgfx.c b/src/osd/sdl/drawbgfx.c index a2dc7fe5649..638bf09a5f1 100644 --- a/src/osd/sdl/drawbgfx.c +++ b/src/osd/sdl/drawbgfx.c @@ -33,7 +33,7 @@ #include "osdsdl.h" #include "window.h" -#include <bgfxplatform.h> +#include <bgfxplatform.h> #include <bgfx.h> //============================================================ @@ -73,12 +73,12 @@ static void drawbgfx_exit(void); class sdl_info_bgfx : public osd_renderer { public: - sdl_info_bgfx(osd_window *w) - : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_renderer(NULL), - m_blitwidth(0), m_blitheight(0), - m_last_hofs(0), m_last_vofs(0), - m_last_blit_time(0), m_last_blit_pixels(0) - {} + sdl_info_bgfx(osd_window *w) + : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_renderer(NULL), + m_blitwidth(0), m_blitheight(0), + m_last_hofs(0), m_last_vofs(0), + m_last_blit_time(0), m_last_blit_pixels(0) + {} /* virtual */ int create(); /* virtual */ int draw(const int update); @@ -97,18 +97,18 @@ public: return &window().target()->get_primitives(); } - // void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y); + // void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y); - //texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup); - //texture_info *texture_update(const render_primitive &prim); + //texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup); + //texture_info *texture_update(const render_primitive &prim); INT32 m_blittimer; SDL_Renderer * m_renderer; //simple_list<texture_info> m_texlist; // list of active textures - int m_blitwidth; - int m_blitheight; + int m_blitwidth; + int m_blitheight; float m_last_hofs; float m_last_vofs; @@ -139,7 +139,7 @@ int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks) // fill in the callbacks callbacks->exit = drawbgfx_exit; callbacks->create = drawbgfx_create; - + return 0; } @@ -159,7 +159,7 @@ int sdl_info_bgfx::create() bgfx::sdlSetWindow(window().sdl_window()); bgfx::init(); bgfx::reset(width, height, BGFX_RESET_VSYNC); - + // Enable debug text. bgfx::setDebug(BGFX_DEBUG_STATS);// BGFX_DEBUG_TEXT); osd_printf_verbose("Leave drawsdl2_window_create\n"); @@ -187,7 +187,6 @@ int sdl_info_bgfx::xy_to_render_target(int x, int y, int *xt, int *yt) int sdl_info_bgfx::draw(int update) { - //if (has_flags(FI_CHANGED) || (window().width() != m_last_width) || (window().height() != m_last_height)) // do something //clear_flags(FI_CHANGED); @@ -207,10 +206,10 @@ int sdl_info_bgfx::draw(int update) window().m_primlist->acquire_lock(); window().m_primlist->release_lock(); - // Advance to next frame. Rendering thread will be kicked to + // Advance to next frame. Rendering thread will be kicked to // process submitted rendering primitives. bgfx::frame(); - + return 0; } diff --git a/src/osd/sdl/drawogl.c b/src/osd/sdl/drawogl.c index 09bcf9479eb..e2178fe73e8 100644 --- a/src/osd/sdl/drawogl.c +++ b/src/osd/sdl/drawogl.c @@ -202,7 +202,7 @@ class texture_info { public: texture_info() - : hash(0), flags(0), rawwidth(0), rawheight(0), + : hash(0), flags(0), rawwidth(0), rawheight(0), rawwidth_create(0), rawheight_create(0), type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0), texture(0), texTarget(0), texpow2(0), mpass_dest_idx(0), pbo(0), data(NULL), @@ -337,15 +337,15 @@ private: void texture_all_disable(); INT32 m_blittimer; - int m_width; - int m_height; - int m_blitwidth; - int m_blitheight; + int m_width; + int m_height; + int m_blitwidth; + int m_blitheight; #if (SDLMAME_SDL2) SDL_GLContext m_gl_context_id; #ifdef OSD_WINDOWS - HDC m_hdc; + HDC m_hdc; #endif #else #endif @@ -792,43 +792,42 @@ void sdl_info_ogl::initialize_gl() void setupPixelFormat(HDC hDC) { - PIXELFORMATDESCRIPTOR pfd = { - sizeof(PIXELFORMATDESCRIPTOR), /* size */ - 1, /* version */ - PFD_SUPPORT_OPENGL | - PFD_DRAW_TO_WINDOW | - PFD_DOUBLEBUFFER, /* support double-buffering */ - PFD_TYPE_RGBA, /* color type */ - 32, /* prefered color depth */ - 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ - 0, /* no alpha buffer */ - 0, /* alpha bits (ignored) */ - 0, /* no accumulation buffer */ - 0, 0, 0, 0, /* accum bits (ignored) */ - 16, /* depth buffer */ - 0, /* no stencil buffer */ - 0, /* no auxiliary buffers */ - PFD_MAIN_PLANE, /* main layer */ - 0, /* reserved */ - 0, 0, 0, /* no layer, visible, damage masks */ - }; - int pixelFormat; - - pixelFormat = ChoosePixelFormat(hDC, &pfd); - if (pixelFormat == 0) { - osd_printf_error("ChoosePixelFormat failed.\n"); - exit(1); - } - - if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE) { - osd_printf_error("SetPixelFormat failed.\n"); - exit(1); - } + PIXELFORMATDESCRIPTOR pfd = { + sizeof(PIXELFORMATDESCRIPTOR), /* size */ + 1, /* version */ + PFD_SUPPORT_OPENGL | + PFD_DRAW_TO_WINDOW | + PFD_DOUBLEBUFFER, /* support double-buffering */ + PFD_TYPE_RGBA, /* color type */ + 32, /* prefered color depth */ + 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ + 0, /* no alpha buffer */ + 0, /* alpha bits (ignored) */ + 0, /* no accumulation buffer */ + 0, 0, 0, 0, /* accum bits (ignored) */ + 16, /* depth buffer */ + 0, /* no stencil buffer */ + 0, /* no auxiliary buffers */ + PFD_MAIN_PLANE, /* main layer */ + 0, /* reserved */ + 0, 0, 0, /* no layer, visible, damage masks */ + }; + int pixelFormat; + + pixelFormat = ChoosePixelFormat(hDC, &pfd); + if (pixelFormat == 0) { + osd_printf_error("ChoosePixelFormat failed.\n"); + exit(1); + } + + if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE) { + osd_printf_error("SetPixelFormat failed.\n"); + exit(1); + } } #endif int sdl_info_ogl::create() { - #if (SDLMAME_SDL2) // create renderer #ifdef OSD_WINDOWS @@ -889,7 +888,6 @@ int sdl_info_ogl::create() void sdl_info_ogl::destroy() { - // free the memory in the window destroy_all_textures(); @@ -912,7 +910,6 @@ void sdl_info_ogl::destroy() int sdl_info_ogl::xy_to_render_target(int x, int y, int *xt, int *yt) { - *xt = x - m_last_hofs; *yt = y - m_last_vofs; if (*xt<0 || *xt >= m_blitwidth) @@ -3136,6 +3133,3 @@ void sdl_info_ogl::texture_all_disable() pfn_glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, 0); } } - - - diff --git a/src/osd/sdl/drawsdl.c b/src/osd/sdl/drawsdl.c index 1c626696ce4..45ac54fa64b 100644 --- a/src/osd/sdl/drawsdl.c +++ b/src/osd/sdl/drawsdl.c @@ -434,11 +434,10 @@ static void drawsdl_show_info(struct SDL_RendererInfo *render_info) int sdl_info::create() { - #if (SDLMAME_SDL2) const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; - // create renderer + // create renderer /* set hints ... */ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, sm->sdl_scale_mode); @@ -500,7 +499,6 @@ int sdl_info::create() void sdl_info::destroy() { - // free the memory in the window destroy_all_textures(); @@ -726,7 +724,7 @@ int sdl_info::draw(int update) float fh = (float) mameheight / (float) blitheight; // FIXME: this could be a lot easier if we get the primlist here! - // Bounds would be set fit for purpose and done! + // Bounds would be set fit for purpose and done! for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next()) { diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index 5fe16406090..83a4bdc6d37 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -365,8 +365,8 @@ SDL_NETWORK = pcap INCPATH += -I$(3RDPARTY)/winpcap/Include # enable UNICODE -DEFS += -Dmain=utf8_main -DUNICODE -D_UNICODE -LDFLAGS += -municode +DEFS += -Dmain=utf8_main -DUNICODE -D_UNICODE +LDFLAGS += -municode # Qt ifndef NO_USE_QTDEBUG @@ -734,7 +734,7 @@ ifeq ($(SDL_LIBVER),sdl2) LIBS += -lSDL2 -limm32 -lversion -lole32 -loleaut32 -lws2_32 -static BASELIBS += -lSDL2 -limm32 -lversion -lole32 -loleaut32 -lws2_32 -static else -LIBS += -lSDL -lws2_32 -static +LIBS += -lSDL -lws2_32 -static BASELIBS += -lSDL -lws2_32 -static endif LIBS += -luser32 -lgdi32 -lddraw -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi @@ -809,7 +809,7 @@ OSDOBJS += \ ifdef USE_BGFX DEFS += -DUSE_BGFX -OSDOBJS += $(SDLOBJ)/drawbgfx.o +OSDOBJS += $(SDLOBJ)/drawbgfx.o INCPATH += -I$(3RDPARTY)/bgfx/include -I$(3RDPARTY)/bx/include USE_DISPATCH_GL = 0 BGFX_LIB = $(OBJ)/libbgfx.a diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h index fc601eb48ce..8f3acb8460d 100644 --- a/src/osd/sdl/video.h +++ b/src/osd/sdl/video.h @@ -66,7 +66,7 @@ public: sdl_monitor_info() : m_next(NULL), m_handle(0), m_aspect(0.0f) - {} + {} sdl_monitor_info(const UINT64 handle, const char *monitor_device, float aspect) : m_next(NULL), m_handle(handle), m_aspect(aspect) { @@ -84,25 +84,25 @@ public: void set_aspect(const float aspect) { m_aspect = aspect; } // STATIC - static void init(); + static void init(); static void exit(); static sdl_monitor_info *pick_monitor(sdl_options &options, int index); #if !defined(SDLMAME_WIN32) && !(SDLMAME_SDL2) static void add_primary_monitor(void *data); #endif - sdl_monitor_info * next() { return m_next; } // pointer to next monitor in list + sdl_monitor_info * next() { return m_next; } // pointer to next monitor in list // STATIC static sdl_monitor_info *primary_monitor; static sdl_monitor_info *list; - sdl_monitor_info * m_next; // pointer to next monitor in list + sdl_monitor_info * m_next; // pointer to next monitor in list private: void refresh(); UINT64 m_handle; // handle to the monitor - SDL_Rect m_dimensions; + SDL_Rect m_dimensions; char m_name[64]; float m_aspect; // computed/configured aspect ratio of the physical device }; diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c index dae4ef5dc18..71054ce32b3 100644 --- a/src/osd/sdl/window.c +++ b/src/osd/sdl/window.c @@ -1013,9 +1013,6 @@ void sdl_window_info::update() // if we're visible and running and not in the middle of a resize, draw if (m_target != NULL) { - - - int tempwidth, tempheight; // see if the games video mode has changed @@ -1044,7 +1041,6 @@ void sdl_window_info::update() if (osd_event_wait(m_rendered_event, event_wait_ticks)) { - // ensure the target bounds are up-to-date, and then get the primitives render_primitive_list &primlist = *m_renderer->get_primitives(); @@ -1150,11 +1146,11 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt ) SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to - * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension. - * - * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 ); - * - */ + * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension. + * + * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 ); + * + */ window->m_extra_flags = SDL_WINDOW_OPENGL; } else @@ -1173,7 +1169,7 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt ) window->monitor()->position_size().x, window->monitor()->position_size().y, tempwidth, tempheight, window->m_extra_flags); //window().sdl_window() = SDL_CreateWindow(window().m_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - // width, height, m_extra_flags); + // width, height, m_extra_flags); if ( window->m_sdl_window == NULL ) { @@ -1235,7 +1231,7 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt ) #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN)) SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0); #endif - // load_gl_lib(window->machine()); + // load_gl_lib(window->machine()); } // create the SDL surface (which creates the window in windowed mode) diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h index 8c10c9130e8..3c0c7278210 100644 --- a/src/osd/sdl/window.h +++ b/src/osd/sdl/window.h @@ -53,7 +53,7 @@ public: #endif m_prescale(1), m_primlist(NULL) - {} + {} virtual ~osd_window() { } virtual render_target *target() = 0; @@ -81,18 +81,18 @@ public: virtual win_monitor_info *winwindow_video_window_monitor(const RECT *proposed) = 0; // window handle and info - HWND m_hwnd; - HDC m_dc; // only used by GDI renderer! + HWND m_hwnd; + HDC m_dc; // only used by GDI renderer! // FIXME: this is the same as win_window_list->m_hwnd, i.e. first window. // During modularization, this should be passed in differently - HWND m_focus_hwnd; + HWND m_focus_hwnd; - int m_resize_state; + int m_resize_state; #endif - osd_window_config m_win_config; - int m_prescale; - render_primitive_list *m_primlist; + osd_window_config m_win_config; + int m_prescale; + render_primitive_list *m_primlist; }; class osd_renderer @@ -100,13 +100,13 @@ class osd_renderer public: /* Generic flags */ - static const int FLAG_NONE = 0x0000; - static const int FLAG_NEEDS_OPENGL = 0x0001; - static const int FLAG_HAS_VECTOR_SCREEN = 0x0002; + static const int FLAG_NONE = 0x0000; + static const int FLAG_NEEDS_OPENGL = 0x0001; + static const int FLAG_HAS_VECTOR_SCREEN = 0x0002; /* SDL 1.2 flags */ - static const int FLAG_NEEDS_DOUBLEBUF = 0x0100; - static const int FLAG_NEEDS_ASYNCBLIT = 0x0200; + static const int FLAG_NEEDS_DOUBLEBUF = 0x0100; + static const int FLAG_NEEDS_ASYNCBLIT = 0x0200; osd_renderer(osd_window *window, const int flags) : m_window(window), m_flags(flags) { } @@ -139,11 +139,11 @@ public: protected: /* Internal flags */ - static const int FI_CHANGED = 0x010000; + static const int FI_CHANGED = 0x010000; private: - osd_window *m_window; + osd_window *m_window; int m_flags; }; @@ -161,7 +161,7 @@ public: m_resize_height(0), m_last_resize(0), #endif - m_minwidth(0), m_minheight(0), + m_minwidth(0), m_minheight(0), m_rendered_event(0), m_target(0), #if (SDLMAME_SDL2) m_sdl_window(NULL), @@ -256,7 +256,7 @@ private: SDL_Surface *m_sdlsurf; #endif - int m_extra_flags; + int m_extra_flags; void set_renderer(osd_renderer *renderer) { @@ -281,7 +281,7 @@ private: sdl_monitor_info * m_monitor; int m_fullscreen; int m_index; - osd_renderer * m_renderer; + osd_renderer * m_renderer; // static callbacks ... |
