home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kyūkyoku!! X68000 Emulator
/
X68000Book.dat
/
mac
/
OLS
/
X68000
/
Ko-Window
/
kow142s.lzh
/
corlib
/
GposSetFill.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-15
|
1KB
|
43 lines
/* Copyright 1994-1995 H.Ogasawara(COR.) */
#include <sys_doslib.h>
#include <corlib.h>
#include <HS_wlib.h>
#define GH 512
#define GV 512
GposSetFill( wp, dp, c1, c2, x1, y1, x2, y2 )
WindowID wp;
DrawBuf *dp;
{
if( WindowGetGraphicMode() != WindowAttrGraphic16 ){
int ax, ay, rx, ry, rx2, ry2, sx, sy;
WindowGetScreenPosition( wp, &sx, &sy );
WindowGetGraphicOffset( &ax, &ay );
rx= sx+ x1;
ry= sy+ y1;
rx2= sx+ x2+1;
ry2= sy+ y2+1;
if( !(ax <= rx && ax+GH >= rx2 && ay <= ry && ay+GV >= ry2) ){
int x, y, xx2, yy2;
x= ax > rx ? ax-sx : x1;
y= ay > ry ? ay-sy : y1;
xx2= ax+GH > rx2 ? x2+1 : ax+GH-sx;
yy2= ay+GV > ry2 ? y2+1 : ay+GV-sy;
if( x < xx2 && y < yy2 ){
DrawSetLine( dp, x1, y1, x2, y2, c2,
OptionFill );
DrawSetLine( dp+1, x, y, xx2-1, yy2-1, c1,
OptionFill );
return 2;
}
DrawSetLine( dp, x1, y1, x2, y2, c2, OptionFill );
return 1;
}
}
DrawSetLine( dp, x1, y1, x2, y2, c1, OptionFill );
return 1;
}