Valeriy Zamarayev (DHL UA) wrote:
I'm developing a game which is now in alpha testing stage and I'm
trying to test it with all emulators, simulators, and devices I have access to.

The problem appeared with Tungsten W emulator. This is I believe the
only OS4 handheld which supports the high density feature.

The problem is that during animation images are often mangled after some
period of play, they are a kind of "rotated", the sprites are shifted to
the right, and pixels from the right border appear at the left border of
the sprite. It's quite random, because sometimes bitmaps are drawn correctly,
sometimes not.

The sprites are drawn both with WinDrawBitmap() and WinCopyRectangle()
from an offscreen window. And both get mangled.

This is just a hunch, but what about bitmaps being allocated at positions
that aren't four-byte aligned?  I vaguely recall some sort of bug that
requires some data (bitmaps?) to be aligned on four byte boundaries, but
the allocator only guarantees two-byte alignment on older versions of
the OS.  I could be remembering this wrong, though.  (I'm mentioning it
mainly in the hopes of jogging the memory of someone who can actually
recall what I'm talking about, assuming it's not totally wacko.)

How are you creating your bitmaps and offscreen windows?  Are you
using the built-in functions, or are you using the BitmapRsrc code
from the knowledge base?  Are you using WinCreateOffscreenWindow()
or creating a bitmap and then doing WinCreateBitmapWindow()?
Whichever you're using, it might be worth trying the opposite approach.

Interestingly, this sounds not entirely dissimilar to a bug we've seen
on Sony OS 4 devices where sometimes even bitmaps created by
Constructor are drawn garbled when you use the proprietary Sony API
to draw them (HRWinDrawBitmap(), I think) or sometimes the machine
even crashes.  Since both do 320x320 on OS 4, I wonder if there could
even be common code (or at least issues that affect both).

At any rate, it does sound like a difficult problem.  Good luck in
debugging it.

  - Logan

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to