summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/render.cpp16
-rw-r--r--src/emu/render.h11
-rw-r--r--src/emu/screen.cpp4
3 files changed, 22 insertions, 9 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index d06c617d0c6..8c743e9a6a6 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -323,7 +323,8 @@ render_texture::render_texture()
m_next(nullptr),
m_bitmap(nullptr),
m_format(TEXFORMAT_ARGB32),
- m_osddata(~0L),
+ m_id(~0ULL),
+ m_old_id(~0ULL),
m_scaler(nullptr),
m_param(nullptr),
m_curseq(0)
@@ -357,7 +358,8 @@ void render_texture::reset(render_manager &manager, texture_scaler_func scaler,
m_scaler = scaler;
m_param = param;
}
- m_osddata = ~0L;
+ m_old_id = m_id;
+ m_id = ~0L;
}
@@ -447,7 +449,10 @@ void render_texture::get_scaled(u32 dwidth, u32 dheight, render_texinfo &texinfo
if (dwidth < 1) dwidth = 1;
if (dheight < 1) dheight = 1;
- texinfo.osddata = m_osddata;
+ texinfo.unique_id = m_id;
+ texinfo.old_id = m_old_id;
+ if (m_old_id != ~0ULL)
+ m_old_id = ~0ULL;
// are we scaler-free? if so, just return the source bitmap
if (m_scaler == nullptr || (m_bitmap != nullptr && swidth == dwidth && sheight == dheight))
@@ -617,8 +622,10 @@ void render_container::set_overlay(bitmap_argb32 *bitmap)
m_overlaybitmap = bitmap;
if (m_overlaybitmap != nullptr)
{
+ printf("Allocating overlay\n");
m_overlaytexture = m_manager.texture_alloc(render_container::overlay_scale);
m_overlaytexture->set_bitmap(*bitmap, bitmap->cliprect(), TEXFORMAT_ARGB32);
+ printf("Done allocating overlay\n");
}
}
@@ -2964,6 +2971,7 @@ render_manager::render_manager(running_machine &machine)
: m_machine(machine),
m_ui_target(nullptr),
m_live_textures(0),
+ m_texture_id(0),
m_ui_container(global_alloc(render_container(*this)))
{
// register callbacks
@@ -3128,6 +3136,8 @@ render_texture *render_manager::texture_alloc(texture_scaler_func scaler, void *
// allocate a new texture and reset it
render_texture *tex = m_texture_allocator.alloc();
tex->reset(*this, scaler, param);
+ tex->set_id(m_texture_id);
+ m_texture_id++;
m_live_textures++;
return tex;
}
diff --git a/src/emu/render.h b/src/emu/render.h
index d65a1111851..6819fb6efed 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -215,7 +215,8 @@ struct render_texinfo
u32 width; // width of the image
u32 height; // height of the image
u32 seqid; // sequence ID
- u64 osddata; // aux data to pass to osd
+ u64 unique_id; // unique identifier to pass to osd
+ u64 old_id; // previously allocated id, if applicable
const rgb_t * palette; // palette for PALETTE16 textures, bcg lookup table for RGB32/YUY16
};
@@ -441,8 +442,8 @@ public:
// configure the texture bitmap
void set_bitmap(bitmap_t &bitmap, const rectangle &sbounds, texture_format format);
- // set any necessary aux data
- void set_osd_data(u64 data) { m_osddata = data; }
+ // set a unique identifier
+ void set_id(u64 id) { m_old_id = m_id; m_id = id; }
// generic high-quality bitmap scaler
static void hq_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param);
@@ -467,7 +468,8 @@ private:
bitmap_t * m_bitmap; // pointer to the original bitmap
rectangle m_sbounds; // source bounds within the bitmap
texture_format m_format; // format of the texture data
- u64 m_osddata; // aux data to pass to osd
+ u64 m_id; // unique id to pass to osd
+ u64 m_old_id; // previous id, if applicable
// scaling state (ARGB32 only)
texture_scaler_func m_scaler; // scaling callback
@@ -1181,6 +1183,7 @@ private:
// texture lists
u32 m_live_textures; // number of live textures
+ u64 m_texture_id; // rolling texture ID counter
fixed_allocator<render_texture> m_texture_allocator;// texture allocator
// containers for the UI and for screens
diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp
index edfc92e62a9..2afbb31ce4c 100644
--- a/src/emu/screen.cpp
+++ b/src/emu/screen.cpp
@@ -764,9 +764,9 @@ void screen_device::device_start()
// allocate raw textures
m_texture[0] = machine().render().texture_alloc();
- m_texture[0]->set_osd_data(u64((m_unique_id << 1) | 0));
+ m_texture[0]->set_id(u64(m_unique_id) << 57);
m_texture[1] = machine().render().texture_alloc();
- m_texture[1]->set_osd_data(u64((m_unique_id << 1) | 1));
+ m_texture[1]->set_id((u64(m_unique_id) << 57) | 1);
// configure the default cliparea
render_container::user_settings settings;