Ninja Library - System Function

njUserClipping

Sets the user clipping mode

FORMAT

void njUserClipping( mode ,*p )
Int mode
NJS_POINT2 *p

PARAMETER

 mode  Clipping mode 
 *p  Specifies the clipping range in tile accelerator units 

RETURN

None

DESCRIPTION

Sets the user clipping mode in tile accelerator units.

Modes to be specified is as follows.

 NJD_CLIP_DISABLE  Disables user clip 
 NJD_CLIP_INSIDE  Selects internal drawing 
 NJD_CLIP_OUTSIDE  Selects external drawing 

When drawing picture inside the set tile value, specify NJD_CLIP_INSIDE; when drawing picture outside, specify NJD_CLIP_OUTSIDE.

Specifies the clipping range with two matrices of NJS_POINT2. Value to be specified is in tile accelerator units (32x32).

p[0].x = Minimum X coordinate
p[0].y = Minimum Y coordinate
p[1].x = Maximum X coordinate
p[1].y = Maximum Y coordinate

To disable clipping, specify NJD_CLIP_DISABLE. Since a tile value will not be referenced in this case, specify any value. User clipping can be switched multiple times during 1 rendering process.


EXAMPLE

The following draws (96,96) - (320,320) internally.
NJS_POINT2 p[2];
p[0].x = 3;	/* 3x32 = 96 */
p[0].y = 3;	/* 3x32 = 96 */
p[1].x = 10;	/* 10x32 = 320 */
p[1].y = 10;	/* 10x32 = 320 */
/* Select internal drawing */
njUserClipping(NJD_CLIP_INSIDE,p);
/* Draw a model etc. */
/* Disable clipping */
njUserClipping(NJD_CLIP_DISABLE,p);

njUserClipping
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999