MakeScrRect Function (ROM Call 0x42D)

AMS 2.00 or higher graph.h

SCR_RECT *MakeScrRect (short x0, short y0, short x1, short y1, SCR_RECT *s);

Puts four coordinates into a SCR_RECT and returns a pointer to it.

MakeScrRect is used to create a SCR_RECT from four screen coordinates.

For example, it can be used to convert a WIN_RECT to a SCR_RECT like this (s is a SCR_RECT, and rect is a WIN_RECT):

MakeScrRect (rect.x0, rect.y0, rect.x1, rect.y1, &s);
In GNU C (like TIGCC is), it is generally faster to use this cast constructors instead of calling MakeScrRect:
s = (SCR_RECT){{x0, y0, x1, y1}};


See also: SetWinClip, MakeWinRect