Le 06/09/2010 18:29, Matthieu Fertré a écrit :
> uint l,r,t,b;
> body->GetTestRect(l,r,t,b);
> SetTestRect(l,r,t,b);

In fact I think it's trickier. The test rect for body is always the same 
(see their definition in data/body/movements.xml); this can be verified 
when moving: the rectangle doesn't change when walking. However, it's 
probably true for other sprites.

However, this is still not the rectangle used for display. MustBeDrawn 
tests for Rectanglei(GetPosition(), GetSize()) which is yet different 
from GetTestRect value.

> For this optimisation to be ok, we must be sure, that when we change the
> movement, at least, body internal state is recomputed. And we must be
> sure also, that when characters will be displayed on all computers, it
> will be synchronized, else, it may create some big problems, when a
> character is shooting for instance. (The shoot will be different
> depending each frame of the animation is displayed), and yes, you can
> shoot with an invisible player (but MustBeDraw returns always true for
> the ActiveCharacter).

And anyway, whatever we think, this has to be checked to make sure we 
are taking our wishes for granted.

At least the MeterDistance computation is correct.
For the bitshifting of >>1 instead of /2, it's a pity that it is needed, 
but we are the only one to know that width/height are in fact unsigned.

Let's apply some of it then.

Christophe


_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à