@@ -150,7 +150,7 @@ void vsystem_spr_device::sprite_attributes::get(uint16_t const *ram)
150
150
151
151
void vsystem_spr_device::common_sprite_drawgfx (bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap)
152
152
{
153
- gfx_element * sprgfx = gfx (0 );
153
+ gfx_element & sprgfx = * gfx (0 );
154
154
uint32_t priority_mask = 0x00 ;
155
155
156
156
m_curr_sprite.oy += m_yoffs;
@@ -164,40 +164,40 @@ void vsystem_spr_device::common_sprite_drawgfx(bitmap_ind16 &bitmap, const recta
164
164
m_curr_sprite.zoomx = 32 - m_curr_sprite.zoomx ;
165
165
m_curr_sprite.zoomy = 32 - m_curr_sprite.zoomy ;
166
166
167
- int ystart, yend, yinc;
167
+ int const ystart = !m_curr_sprite.flipy ? 0 : m_curr_sprite.ysize ;
168
+ int const yend = !m_curr_sprite.flipy ? (m_curr_sprite.ysize + 1 ) : -1 ;
169
+ int const yinc = !m_curr_sprite.flipy ? 1 : -1 ;
168
170
169
- if (!m_curr_sprite.flipy ) { ystart = 0 ; yend = m_curr_sprite.ysize + 1 ; yinc = 1 ; }
170
- else { ystart = m_curr_sprite.ysize ; yend = -1 ; yinc = -1 ; }
171
+ u32 const color = m_curr_sprite.color + m_pal_base;
172
+ u32 const zx = m_curr_sprite.zoomx << 11 ;
173
+ u32 const zy = m_curr_sprite.zoomy << 11 ;
171
174
172
- int ycnt = ystart;
173
- while (ycnt != yend)
175
+ for (int ycnt = ystart; ycnt != yend; ycnt += yinc)
174
176
{
175
- int xstart, xend, xinc;
177
+ int const xstart = !m_curr_sprite.flipx ? 0 : m_curr_sprite.xsize ;
178
+ int const xend = !m_curr_sprite.flipx ? (m_curr_sprite.xsize + 1 ) : -1 ;
179
+ int const xinc = !m_curr_sprite.flipx ? 1 : -1 ;
180
+ auto const yoffs = m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy /2 ;
176
181
177
- if (!m_curr_sprite.flipx ) { xstart = 0 ; xend = m_curr_sprite.xsize + 1 ; xinc = 1 ; }
178
- else { xstart = m_curr_sprite.xsize ; xend = -1 ; xinc = -1 ; }
179
-
180
- int xcnt = xstart;
181
- while (xcnt != xend)
182
+ for (int xcnt = xstart; xcnt != xend; xcnt += xinc)
182
183
{
183
184
uint32_t const startno = m_newtile_cb (m_curr_sprite.map ++);
185
+ auto const xoffs = m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx /2 ;
184
186
if (!m_pri_cb.isnull ())
185
187
{
186
- sprgfx-> prio_zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , priority_bitmap, priority_mask, m_transpen);
187
- sprgfx-> prio_zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 +m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , priority_bitmap, priority_mask, m_transpen);
188
- sprgfx-> prio_zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , -0x200 +m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , priority_bitmap, priority_mask, m_transpen);
189
- sprgfx-> prio_zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 +m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , -0x200 +m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , priority_bitmap, priority_mask, m_transpen);
188
+ sprgfx. prio_zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , xoffs , yoffs , zx, zy , priority_bitmap, priority_mask, m_transpen);
189
+ sprgfx. prio_zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 + xoffs, yoffs , zx, zy , priority_bitmap, priority_mask, m_transpen);
190
+ sprgfx. prio_zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , xoffs, -0x200 + yoffs, zx, zy , priority_bitmap, priority_mask, m_transpen);
191
+ sprgfx. prio_zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 + xoffs , -0x200 + yoffs, zx, zy , priority_bitmap, priority_mask, m_transpen);
190
192
}
191
193
else
192
194
{
193
- sprgfx-> zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , m_transpen);
194
- sprgfx-> zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 +m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , m_transpen);
195
- sprgfx-> zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , -0x200 +m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , m_transpen);
196
- sprgfx-> zoom_transpen (bitmap,cliprect, startno, m_curr_sprite. color + m_pal_base , m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 +m_curr_sprite. ox + xcnt * m_curr_sprite. zoomx / 2 , -0x200 +m_curr_sprite. oy + ycnt * m_curr_sprite. zoomy / 2 , m_curr_sprite. zoomx << 11 , m_curr_sprite. zoomy << 11 , m_transpen);
195
+ sprgfx. zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , xoffs , yoffs , zx, zy , m_transpen);
196
+ sprgfx. zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 + xoffs, yoffs , zx, zy , m_transpen);
197
+ sprgfx. zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , xoffs, -0x200 + yoffs, zx, zy , m_transpen);
198
+ sprgfx. zoom_transpen (bitmap,cliprect, startno, color, m_curr_sprite.flipx , m_curr_sprite.flipy , -0x200 + xoffs , -0x200 + yoffs, zx, zy , m_transpen);
197
199
}
198
- xcnt += xinc;
199
200
}
200
- ycnt += yinc;
201
201
}
202
202
203
203
}
0 commit comments