static void _bitmap_drawer(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR tint, float sx, float sy, float sw, float sh, int flags) { ALLEGRO_BITMAP *dest = al_get_target_bitmap(); ALLEGRO_DISPLAY *display = _al_get_bitmap_display(dest); ASSERT(bitmap->parent == NULL); ASSERT(!(flags & (ALLEGRO_FLIP_HORIZONTAL | ALLEGRO_FLIP_VERTICAL))); ASSERT(bitmap != dest && bitmap != dest->parent); /* If destination is memory, do a memory blit */ if (al_get_bitmap_flags(dest) & ALLEGRO_MEMORY_BITMAP || _al_pixel_format_is_compressed(al_get_bitmap_format(dest))) { _al_draw_bitmap_region_memory(bitmap, tint, sx, sy, sw, sh, 0, 0, flags); } else { /* if source is memory or incompatible */ if ((al_get_bitmap_flags(bitmap) & ALLEGRO_MEMORY_BITMAP) || (!al_is_compatible_bitmap(bitmap))) { if (display && display->vt->draw_memory_bitmap_region) { display->vt->draw_memory_bitmap_region(display, bitmap, sx, sy, sw, sh, flags); } else { _al_draw_bitmap_region_memory(bitmap, tint, sx, sy, sw, sh, 0, 0, flags); } } else { /* Compatible display bitmap, use full acceleration */ bitmap->vt->draw_bitmap_region(bitmap, tint, sx, sy, sw, sh, flags); } } }
static mrb_value bitmap_compatible(mrb_state *mrb, mrb_value self) { ALLEGRO_BITMAP *b; Check_Destroyed(mrb, self, bitmap, b); return mrb_bool_value(al_is_compatible_bitmap(b)); }
static int allua_Bitmap_is_compatible(lua_State * L) { ALLUA_bitmap bitmap = allua_check_bitmap(L, 1); lua_pushboolean(L, al_is_compatible_bitmap(bitmap)); return 1; }
/** Checks if a bitmap is compatible with the given display. @return true if compatible. */ bool isCompatible() const { return al_is_compatible_bitmap(get()); }