|
From: Bartek T. <ba...@ba...> - 2007-03-23 14:16:49
|
That bug is already fixed in svn trunk and will be included in 2.0.1 release.
Bartek
2007/3/23, Kenny Simpson <ke...@pe...>:
>
>
>
> This fixes a bug where we want to draw a subregion from the larger image.
> I just dropped the error checking, but I'm not sure if it is correct or
> not.
>
> ---
> ./core/src/org/microemu/device/j2se/J2SEDisplayGraphics.java.orig
> 2007-03-22 17:23:59.000000000 -0700
> +++
> ./core/src/org/microemu/device/j2se/J2SEDisplayGraphics.java
> 2007-03-22 17:30:07.000000000 -0700
> @@ -429,19 +429,19 @@
> if (rgbData == null)
> throw new NullPointerException();
>
> - int l = rgbData.length;
> -
> - if (width <= 0 || height <= 0 || offset < 0 || offset >= l ||
> - (scanlength < 0 && scanlength * (height-1) < 0) ||
> - (scanlength >= 0 && scanlength * (height-1) + width-1
> >= l))
> - throw new
> ArrayIndexOutOfBoundsException();
> -
> - int [] rgb = new int[l - offset];
> + int area = width * height;
> +
> + int [] rgb = new int[area];
> // this way we dont create yet another array in createImage
> int transparencyMask = processAlpha? 0 : 0xff000000;
> -
> - for(int i = 0; offset < l; offset++, i++)
> - rgb[i] = rgbData[offset] | transparencyMask;
> +
> + int i = 0;
> + for(int iy = 0; iy < height; ++iy) {
> + for (int ix = 0; ix < width; ++ix) {
> + rgb[i++] =
> rgbData[offset + ix] | transparencyMask;
> + }
> + offset += scanlength;
> + }
>
> // help gc
> rgbData = null;
>
>
> -Kenny
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Microemulator-users mailing list
> Mic...@li...
> https://lists.sourceforge.net/lists/listinfo/microemulator-users
>
>
|