summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/render.cpp')
-rw-r--r--src/emu/render.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index e25f62a8e13..cbcfd6b16b3 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -442,8 +442,10 @@ void render_texture::hq_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const
// get_scaled - get a scaled bitmap (if we can)
//-------------------------------------------------
-void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist)
+void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist, bool packable)
{
+ texinfo.hash = 0;
+
// source width/height come from the source bounds
int swidth = m_sbounds.width();
int sheight = m_sbounds.height();
@@ -520,6 +522,17 @@ void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t
// palette will be set later
texinfo.seqid = scaled->seqid;
}
+
+ UINT32 hash = 0;
+ if (packable)
+ {
+ //printf("Packable, %d, %d\n", texinfo.width, texinfo.height);
+ }
+ if (packable && texinfo.width <= 128 && texinfo.height <= 128)
+ {
+ hash = reinterpret_cast<UINT64>(texinfo.base) & 0xffffffff;
+ }
+ texinfo.hash = hash;
}
@@ -677,7 +690,7 @@ void render_container::add_char(float x0, float y0, float height, float aspect,
// add it like a quad
item &newitem = add_generic(CONTAINER_ITEM_QUAD, bounds.x0, bounds.y0, bounds.x1, bounds.y1, argb);
newitem.m_texture = texture;
- newitem.m_flags = PRIMFLAG_TEXORIENT(ROT0) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA);
+ newitem.m_flags = PRIMFLAG_TEXORIENT(ROT0) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_PACKABLE;
newitem.m_internal = INTERNAL_FLAG_CHAR;
}
@@ -1751,7 +1764,7 @@ void render_target::add_container_primitives(render_primitive_list &list, const
width = MIN(width, m_maxtexwidth);
height = MIN(height, m_maxtexheight);
- curitem->texture()->get_scaled(width, height, prim->texture, list);
+ curitem->texture()->get_scaled(width, height, prim->texture, list, (curitem->flags() & PRIMFLAG_PACKABLE) ? true : false);
// set the palette
prim->texture.palette = curitem->texture()->get_adjusted_palette(container);
@@ -1854,7 +1867,7 @@ void render_target::add_element_primitives(render_primitive_list &list, const ob
// get the scaled texture and append it
- texture->get_scaled(width, height, prim->texture, list);
+ texture->get_scaled(width, height, prim->texture, list, (prim->flags & PRIMFLAG_PACKABLE) ? true : false);
// compute the clip rect
render_bounds cliprect;