Add fill patterns to rsrc. Add mono fill, but commented until it can be debugged.

This commit is contained in:
Thomas Cherryhomes 2019-02-01 14:31:40 -06:00
parent f865bef335
commit 0b77f5bf80
3 changed files with 168 additions and 13 deletions

View File

@ -165,4 +165,84 @@ resource 'BNDL' (128, purgeable) {
0, 128 0, 128
} }
} }
}; };
data 'ppat' (128) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 AA55 AA55 AA55 AA55 0000 0000" /* ....ªUªUªUªU.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 AA55" /* .........V....ªU */
$"AA55 AA55 AA55 0000 0000 0000 0001 0000" /* ªUªUªU.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};
data 'ppat' (129) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 9224 4992 2449 9224 0000 0000" /* ....$I$I$.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 9224" /* .........V....$ */
$"4992 2449 9224 0000 0000 0000 0001 0000" /* I$I$.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};
data 'ppat' (130) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 DD77 DD77 DD77 DD77 0000 0000" /* ....ÝwÝwÝwÝw.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 DD77" /* .........V....Ýw */
$"DD77 DD77 DD77 0000 0000 0000 0001 0000" /* ÝwÝwÝw.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};
data 'ppat' (131) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 AAAA AAAA AAAA AAAA 0000 0000" /* ....ªªªªªªªª.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 AAAA" /* .........V....ªª */
$"AAAA AAAA AAAA 0000 0000 0000 0001 0000" /* ªªªªªª.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};
data 'ppat' (132) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 FF00 FF00 FF00 FF00 0000 0000" /* ....ÿ.ÿ.ÿ.ÿ..... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 FF00" /* .........V....ÿ. */
$"FF00 FF00 FF00 0000 0000 0000 0001 0000" /* ÿ.ÿ.ÿ........... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};
data 'ppat' (133) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 8822 8822 8822 8822 0000 0000" /* ....ˆ"ˆ"ˆ"ˆ".... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 8822" /* .........V....ˆ" */
$"8822 8822 8822 0000 0000 0000 0001 0000" /* ˆ"ˆ"ˆ".......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};
data 'ppat' (134) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 0022 0088 0022 0088 0000 0000" /* .....".ˆ.".ˆ.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 0022" /* .........V....." */
$"0088 0022 0088 0000 0000 0000 0001 0000" /* .ˆ.".ˆ.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};
data 'ppat' (135) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....ÿÿ */
$"0000 0000 00DD 0077 00BD 00ED 0000 0000" /* .....Ý.w.½.í.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /*............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 00DD" /* .........V.....Ý */
$"0077 00BD 00ED 0000 0000 0000 0001 0000" /* .w.½.í.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* ÿÿÿÿÿÿ........ */
};

View File

@ -82,7 +82,7 @@ void screen_init(void)
TEInit(); TEInit();
InitDialogs(NULL); InitDialogs(NULL);
InitCursor(); InitCursor();
/* Attach Apple Event handler callbacks */ /* Attach Apple Event handler callbacks */
Gestalt('sysv',&sysv); Gestalt('sysv',&sysv);
if (sysv>0x6FF) if (sysv>0x6FF)
@ -146,13 +146,9 @@ void screen_init(void)
is_mono=true; is_mono=true;
if (is_mono==true) if (is_mono==true)
{ win = NewWindow(NULL, &windowRect, "\pPLATOTerm", true, 0, (WindowPtr)-1, false, 0);
win = NewWindow(NULL, &windowRect, "\pPLATOTerm", true, 0, (WindowPtr)-1, false, 0);
}
else else
{ win = NewCWindow(NULL, &windowRect, "\pColor PLATOTerm", true, 0, (WindowPtr)-1, false, 0);
win = NewCWindow(NULL, &windowRect, "\pColor PLATOTerm", true, 0, (WindowPtr)-1, false, 0);
}
SetPort(win); SetPort(win);
@ -606,6 +602,83 @@ unsigned char screen_pixel_colors_same(RGBColor* firstColor, RGBColor* secondCol
* screen_paint - Called to paint at location. * screen_paint - Called to paint at location.
*/ */
void screen_paint(padPt* Coord) void screen_paint(padPt* Coord)
{
if (is_mono==1)
screen_mono_paint(Coord);
else
screen_color_paint(Coord);
}
/**
* color_screen_paint - Called to paint at location.
*/
void screen_mono_paint(padPt* Coord)
{
static unsigned short xStack[512];
static unsigned short yStack[512];
int x=screen_scale_x(Coord->x);
int y=screen_scale_y(Coord->y);
unsigned char stackentry = 1;
unsigned short spanAbove, spanBelow;
unsigned char oldColor=GetPixel(x,y);
if (oldColor==1)
return;
do
{
unsigned short startx;
while (x > 0 && GetPixel(x-1,y)==oldColor)
--x;
spanAbove = spanBelow = false;
startx=x;
while(GetPixel(x,y)==oldColor)
{
if (y < (512))
{
unsigned char belowColor=GetPixel(x,y);
if (!spanBelow && belowColor==oldColor)
{
xStack[stackentry] = x;
yStack[stackentry] = y+1;
++stackentry;
spanBelow = true;
}
else if (spanBelow && belowColor!=oldColor)
spanBelow = false;
}
if (y > 0)
{
unsigned char aboveColor=GetPixel(x,y);
if (!spanAbove && aboveColor==oldColor)
{
xStack[stackentry] = x;
yStack[stackentry] = y-1;
++stackentry;
spanAbove = true;
}
else if (spanAbove && aboveColor!=oldColor)
spanAbove = false;
}
++x;
}
MoveTo(startx,y);
LineTo(x-1,y);
--stackentry;
x = xStack[stackentry];
y = yStack[stackentry];
}
while (stackentry);
}
/**
* color_screen_paint - Called to paint at location.
*/
void screen_color_paint(padPt* Coord)
{ {
static unsigned short xStack[512]; static unsigned short xStack[512];
static unsigned short yStack[512]; static unsigned short yStack[512];
@ -615,9 +688,6 @@ void screen_paint(padPt* Coord)
unsigned short spanAbove, spanBelow; unsigned short spanAbove, spanBelow;
RGBColor oldColor; RGBColor oldColor;
if (is_mono==1)
return;
GetCPixel(x,y,&oldColor); GetCPixel(x,y,&oldColor);
if ((oldColor.red == current_foreground.red) && if ((oldColor.red == current_foreground.red) &&

View File

@ -119,9 +119,14 @@ void screen_foreground(padRGB* theColor);
void screen_background(padRGB* theColor); void screen_background(padRGB* theColor);
/** /**
* screen_paint - Called to paint at location. * color_screen_paint - Called to paint at location.
*/ */
void screen_paint(padPt* Coord); void screen_color_paint(padPt* Coord);
/**
* mono_screen_paint - Called to paint at location.
*/
void screen_mono_paint(padPt* Coord);
/** /**
* screen_show_status(msg) * screen_show_status(msg)