[Scummvm-devel] setFocusRectangle() and 192x128...
    Max Horn 
    max at quendi.de
       
    Sat Dec  8 09:00:17 CET 2007
    
    
  
Am 07.12.2007 um 22:06 schrieb Gregory Montoir:
>
> Hi,
>
> I'm about to add or modify setFocusRectangle() in queen and touche
> engines but I wonder where the rect dimensions (192,128) that
> scumm/sky/sword2 engines use are taken from (I suppose it's from  
> the NDS
> video resolution, but asking doesn't hurt)....
That seems to be the reason for it. Better code would take into  
account the actual dimension of the actors/text which is supposed to  
be focused.
>
> system.h mentions this about setFocusRectangle :
>
> * The backend is responsible for clipping the rectangle and  
> deciding how
> best to
> * zoom the screen to show any shape and size rectangle the engine  
> provides.
>
> Which just doesn't seem to match with the existing code in the NDS
> backend (the "any size" part, at least the rect width/height aren't
> considered when centering).
Then it should be fixed.
>
> Should we add another 2 methods to OSystem (ie.
> getFocusRectangleWidth/Height instead of hard coding 192/128) ;
No, definitely not.
> or is it
> really safe to pass any rectangle dimension ?
Do it. That's how it is documented. If backends don't implement this  
spec correctly, they are buggy and need to be fixed.
Cheers,
Max
    
    
More information about the Scummvm-devel
mailing list