Hi Mathias !
Well maybe you are interested in sharing some code ! I also
optimized the drawImage call by rescticting it to only the rectangle that
includes all the modifications, but the extreme cases (suppose at sprite at
top left corner and another at lower right), it will still be slow, and the
player might see the glitch...
Anyways, I forward your mail along with this response to the lists,
to keep the thread :)
Max.
> -----Message d'origine-----
> De: Mattias Bergander [SMTP:[EMAIL PROTECTED]]
> Date: Monday, February 22, 1999 11:41 AM
> �: [EMAIL PROTECTED]
> Objet: Re: A mail I sent to Sun about animations...
>
> On 22 Feb, Maxime Poulin wrote:
>
> Hi!
> I'm very interested in this! I would really like to follow this! I'm
> currently playing around writing a game framework and some games with
> it (in my free time) and i've pretty much come to exactly the same
> conclusions as you!
>
> > - The drawImage() call uses 60% of precess time. We used OptimizeIt and
> > JavaProbe to track it. That time is spent in the
> > ImageRepresentation.drawImage() method. We decompiled
> ImageRepresentation
> > with mocha to find out that ImageRepresentation.drawImage was playing
> around
> > with observers and image format before calling a native method.
>
> In my game frame work I can repaint only those areas that have changed.
> This greatly reduces the time for drawImage. Unforunatley in many
> (most) games most often the entire screen changes... So in one game
> where the view is following a sprite the background and other sprites
> change all the time => no such optimization possible... :-(. So what I
> do is to turn on this optimization (dirty rectangles) when the sprite
> the view is following is not moving.
>
> There must be something really bad happneing in the drawImage method
> because it simply shouldn't take that long to paint an image that
> really isn't that big! Mine currently is 500x500 pixels. I've heard
> something similar with performance of drawImage and really big images
> being VERY slow in java. Perhaps it is in the bug parade? I think Sun
> can optimize the image drawing and i remember having read something
> about it not being that hard to do! Just some time needed...
>
> > We had some time to study the BufferedImage class in JDK 1.2 and
> > make some tests with it. Unfortunately, we were unable to obtain better
> > performance from it. Actually, the performance was worst, but as I said,
> we
> > are still concentrating on JDK 1.1.
>
> I've come to the same conclusion... :-(
>
> --
> Disclaimer: Any errors in spelling, tact, or fact are transmission errors.
> | Mattias Bergander aka Pulsar |
> | [EMAIL PROTECTED] |
> | WWW: surf.to/pulsar |
�����������������������
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/