I have a game in which at one level the sheep can explode with mines. Explosion animation is controlled using png, which contains an array of 4x4 images in a 512x515 PNG file ... see below.

Then I animate the explosion using the following code:
exp_bitmap_number_to_draw = (int)(time_since_death / 100); if (exp_bitmap_number_to_draw < 16) { explosion_dst_rect.left = b2sx(sheep_x[i]) - sheep_radius * 5; explosion_dst_rect.right = b2sx(sheep_x[i]) + sheep_radius * 5; explosion_dst_rect.bottom = b2sy(sheep_y[i]) + sheep_radius * 5; explosion_dst_rect.top = b2sy(sheep_y[i]) - sheep_radius * 5; explosion_src_rect.left = 128 * (exp_bitmap_number_to_draw % 4); explosion_src_rect.top = 128 * (exp_bitmap_number_to_draw / 4); explosion_src_rect.right = explosion_src_rect.left + 128; explosion_src_rect.bottom = explosion_src_rect.top + 128; canvas.drawBitmap(explosion_bitmap, explosion_src_rect, explosion_dst_rect, null); }
Where explosion_src_rect is Rect and extension_ext is RectF. b2sx () and b2sy () are functions that are converted from the absolute coordinates of the sheep in the "playing field" to the coordinates on the screen - it's just adding an offset.
The code works fine on several phones I've tried, including S and Galaxy S II communications. But now a friend tried the code on the samsung galaxy tab 8.9 and found that the explosions appeared goofey. He sent me this partial screen capture:

Any idea what could be causing this?
source share