|
From: Kenny S. <ke...@pe...> - 2007-03-23 14:33:17
|
Excellent, thanks!
-----Original Message-----
From: ba...@gm... on behalf of Bartek Teodorczyk
Sent: Fri 3/23/2007 7:16 AM
To: Kenny Simpson
Cc: mic...@li...
Subject: Re: [Microemulator-users] patch for drawRGB
=20
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 =3D=3D null)
> throw new NullPointerException();
>
> - int l =3D rgbData.length;
> -
> - if (width <=3D 0 || height <=3D 0 || offset < 0 || =
offset >=3D l ||
> - (scanlength < 0 && scanlength * (height-1) < 0) =
||
> - (scanlength >=3D 0 && scanlength * (height-1) + =
width-1
> >=3D l))
> - throw new
> ArrayIndexOutOfBoundsException();
> -
> - int [] rgb =3D new int[l - offset];
> + int area =3D width * height;
> +
> + int [] rgb =3D new int[area];
> // this way we dont create yet another array in =
createImage
> int transparencyMask =3D processAlpha? 0 : 0xff000000;
> -
> - for(int i =3D 0; offset < l; offset++, i++)
> - rgb[i] =3D rgbData[offset] | transparencyMask;
> +
> + int i =3D 0;
> + for(int iy =3D 0; iy < height; ++iy) {
> + for (int ix =3D 0; ix < width; ++ix) =
{
> + rgb[i++] =3D
> rgbData[offset + ix] | transparencyMask;
> + }
> + offset +=3D scanlength;
> + }
>
> // help gc
> rgbData =3D 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=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> _______________________________________________
> Microemulator-users mailing list
> Mic...@li...
> https://lists.sourceforge.net/lists/listinfo/microemulator-users
>
>
|