Re: [AD] al_put/draw_pixel() speed

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sat, Aug 8, 2009 at 7:14 PM, Trent Gamblin<trent@xxxxxxxxxx> wrote:
> I really don't like the way it's implemented now but I don't know if there's a better
> way.
>
I'm messing around with it. I'll post my suggestions later. But is
this code correct?

  557  for (i = 0; i < created_bitmaps._size; i++) {
  558       ALLEGRO_BITMAP_D3D **bptr = (ALLEGRO_BITMAP_D3D
**)_al_vector_ref(&created_bitmaps, i);
  559       ALLEGRO_BITMAP_D3D *bmp = *bptr;
  560       ALLEGRO_BITMAP *al_bmp = (ALLEGRO_BITMAP *)bmp;
  561       if (bmp->display == disp)
  562 	      //d3d_sync_bitmap_memory(al_bmp);
  563 	      if (!al_bmp->preserve_texture) {
  564 	      	bmp->modified = false;
  565 	      }
  566 	      else if (!bmp->is_backbuffer && bmp->modified &&
!(al_bmp->flags & ALLEGRO_MEMORY_BITMAP)) {
  567 	         _al_d3d_sync_bitmap(al_bmp);
  568 		 bmp->modified = false;
  569 	      }
  570    }

Does the comment on line 562 go with the condition on 561? Either way,
it confusing as written.

--
Matthew Leverton




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/