forked from hex007/freej2me
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PlatformGraphics: Make all Nokia's drawPixels methods more robust
Nokia DirectGraphics states that width and height CAN be zero, which would cause problems with MIDP's image handling that expects them to be always bigger than zero. Fortunately, we can just return from these without doing anything, as the resulting "image" wouldn't be visible anyway. Besides that, drawPixels(byte) now properly checks for bounds on TYPE_BYTE_1_GRAY, since previously the set/getDataElements usage allowed for the data array to have its size increased specifically for this format, which is inefficient, and not possible at all now that dataBuffers are being used. So far, none of the Nokia games i've tested have been broken by these changes. In fact, Prince of Persia Harem Adventures on the Nokia 3410 was fixed by them.
- Loading branch information
1 parent
578c2dd
commit 62b0d7a
Showing
1 changed file
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters