mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-14 14:20:39 +00:00
14 lines
531 B
C
14 lines
531 B
C
#include "../include/wgt.h"
|
|
|
|
void wclip (short x, short y, short x2, short y2)
|
|
{
|
|
tx = x; /* Upper x limit */
|
|
ty = y; /* Upper y limit */
|
|
bx = x2; /* Lower x limit */
|
|
by = y2; /* Lower y limit */
|
|
/* Stay within screen bounds, no negatives */
|
|
if (tx < 0) tx = 0;
|
|
if (ty < 0) ty = 0;
|
|
if (bx >= WGT_SYS.xres) bx = WGT_SYS.xres - 1;
|
|
if (by >= WGT_SYS.yres) by = WGT_SYS.yres - 1;
|
|
}
|