Previous 199869 Revisions Next

r21879 Saturday 16th March, 2013 at 01:07:34 UTC by David Haywood
more
[src/mame/video]deco_mlc.c

trunk/src/mame/video/deco_mlc.c
r21878r21879
8080   myclip = clip;
8181   myclip &= dest_bmp.cliprect();
8282
83   
83   if( usey < myclip.min_y )
84      return;
85
86   if( usey > myclip.max_y+1 )
87      return;
88
8489   const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())];
8590   const UINT8 *code_base1 = gfx->get_data(code1 % gfx->elements());
8691   const UINT8 *code_base2 = gfx->get_data(code2 % gfx->elements());
r21878r21879
8893   int sprite_screen_width = (scalex*16+(sx&0xffff))>>16;
8994
9095   sx>>=16;
91   int sy = usey;
9296   if (sprite_screen_width)
9397   {
9498      /* compute sprite increment per screen pixel */
r21878r21879
125129
126130      if( ex>sx )
127131      { /* skip if inner loop doesn't draw anything */
128         int y;
129132
130         /* case 1: no alpha */
133         /* no alpha */
131134         if (alpha == 0xff)
132135         {     
133            y = sy;
136            const UINT8 *source1 = code_base1 + (srcline) * gfx->rowbytes();
137            const UINT8 *source2 = code_base2 + (srcline) * gfx->rowbytes();
138            UINT32 *dest = &dest_bmp.pix32(usey);
134139
135            if( y < myclip.min_y )
136               return;
140            int x, x_index = x_index_base;
137141
138            if( y > myclip.max_y+1 )
139               return;
140
141
142
142            for( x=sx; x<ex; x++ )
143143            {
144               const UINT8 *source1 = code_base1 + (srcline) * gfx->rowbytes();
145               const UINT8 *source2 = code_base2 + (srcline) * gfx->rowbytes();
146               UINT32 *dest = &dest_bmp.pix32(y);
144               int c = source1[x_index>>16];
145               if (use8bpp)
146                  c=(c<<4)|source2[x_index>>16];
147147
148               int x, x_index = x_index_base;
148               if( c != transparent_color ) dest[x] = pal[c];
149149
150               for( x=sx; x<ex; x++ )
151               {
152                  int c = source1[x_index>>16];
153                  if (use8bpp)
154                     c=(c<<4)|source2[x_index>>16];
155
156                  if( c != transparent_color ) dest[x] = pal[c];
157
158                  x_index += dx;
159               }
160            }     
150               x_index += dx;
151            }
161152         }
162
163         /* case 6: alpha blended */
164153         else
165154         {
166            y = sy;
155            const UINT8 *source = code_base1 + (srcline) * gfx->rowbytes();
156            UINT32 *dest = &dest_bmp.pix32(usey);
167157
168            if( y < myclip.min_y )
169               return;
170
171            if( y > myclip.max_y+1 )
172               return;
173
158            int x, x_index = x_index_base;
159            for( x=sx; x<ex; x++ )
174160            {
175               const UINT8 *source = code_base1 + (srcline) * gfx->rowbytes();
176               UINT32 *dest = &dest_bmp.pix32(y);
177
178               int x, x_index = x_index_base;
179               for( x=sx; x<ex; x++ )
180               {
181                  int c = source[x_index>>16];
182                  if( c != transparent_color ) dest[x] = alpha_blend_r32(dest[x], 0, alpha); //pal[c]);
183                  x_index += dx;
184               }
185
186                 
161               int c = source[x_index>>16];
162               if( c != transparent_color ) dest[x] = alpha_blend_r32(dest[x], 0, alpha); //pal[c]);
163               x_index += dx;
187164            }
188
189165         }
190166      }
191167   }
r21878r21879
404380         int dy = (16<<16)/sprite_screen_height;
405381
406382
407
383         
408384         int counter = 0;
409385         for (int y=realybase;y<ey;y++)
410386         {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team