diff options
author | 2016-02-21 11:48:45 +0100 | |
---|---|---|
committer | 2016-02-21 11:48:45 +0100 | |
commit | cc24a339d8c0517259084b5c178d784626ba965c (patch) | |
tree | 9868e9687b5802ae0a3733712a3bbeb3bc75c953 /src/emu/render.h | |
parent | b5daabda5495dea5c50e17961ecfed2ea8619d76 (diff) |
Merge remote-tracking branch 'refs/remotes/mamedev/master'
Second attempt
Diffstat (limited to 'src/emu/render.h')
-rw-r--r-- | src/emu/render.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/emu/render.h b/src/emu/render.h index df8896b712b..6d55c75ada9 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -49,6 +49,7 @@ //#include "osdepend.h" #include <math.h> +#include <mutex> //************************************************************************** @@ -61,7 +62,9 @@ enum BLENDMODE_NONE = 0, // no blending BLENDMODE_ALPHA, // standard alpha blend BLENDMODE_RGB_MULTIPLY, // apply source alpha to source pix, then multiply RGB values - BLENDMODE_ADD // apply source alpha to source pix, then add to destination + BLENDMODE_ADD, // apply source alpha to source pix, then add to destination + + BLENDMODE_COUNT }; @@ -104,6 +107,9 @@ const UINT32 PRIMFLAG_TYPE_MASK = 3 << PRIMFLAG_TYPE_SHIFT; const UINT32 PRIMFLAG_TYPE_LINE = 0 << PRIMFLAG_TYPE_SHIFT; const UINT32 PRIMFLAG_TYPE_QUAD = 1 << PRIMFLAG_TYPE_SHIFT; +const int PRIMFLAG_PACKABLE_SHIFT = 21; +const UINT32 PRIMFLAG_PACKABLE = 1 << PRIMFLAG_PACKABLE_SHIFT; + //************************************************************************** // MACROS //************************************************************************** @@ -322,6 +328,7 @@ public: // getters render_primitive *next() const { return m_next; } + bool packable(const INT32 pack_size) const { return (flags & PRIMFLAG_PACKABLE) && texture.base != nullptr && texture.width <= pack_size && texture.height <= pack_size; } // reset to prepare for re-use void reset(); @@ -358,8 +365,8 @@ public: render_primitive *first() const { return m_primlist.first(); } // lock management - void acquire_lock() { osd_lock_acquire(m_lock); } - void release_lock() { osd_lock_release(m_lock); } + void acquire_lock() { m_lock.lock(); } + void release_lock() { m_lock.unlock(); } // reference management void add_reference(void *refptr); @@ -388,7 +395,7 @@ private: fixed_allocator<render_primitive> m_primitive_allocator;// allocator for primitives fixed_allocator<reference> m_reference_allocator; // allocator for references - osd_lock * m_lock; // lock to protect list accesses + std::recursive_mutex m_lock; // lock to protect list accesses }; @@ -429,7 +436,7 @@ public: private: // internal helpers - void get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist); + void get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist, UINT32 flags = 0); const rgb_t *get_adjusted_palette(render_container &container); static const int MAX_TEXTURE_SCALES = 16; |