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
}
}
};
};
data 'ppat' (128) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 AA55 AA55 AA55 AA55 0000 0000" /* ....<EFBFBD>U<EFBFBD>U<EFBFBD>U<EFBFBD>U.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 AA55" /* .........V....<EFBFBD>U */
$"AA55 AA55 AA55 0000 0000 0000 0001 0000" /* <20>U<EFBFBD>U<EFBFBD>U.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};
data 'ppat' (129) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 9224 4992 2449 9224 0000 0000" /* ....<EFBFBD>$I<EFBFBD>$I<EFBFBD>$.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 9224" /* .........V....<EFBFBD>$ */
$"4992 2449 9224 0000 0000 0000 0001 0000" /* I<EFBFBD>$I<EFBFBD>$.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};
data 'ppat' (130) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 DD77 DD77 DD77 DD77 0000 0000" /* ....<EFBFBD>w<EFBFBD>w<EFBFBD>w<EFBFBD>w.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 DD77" /* .........V....<EFBFBD>w */
$"DD77 DD77 DD77 0000 0000 0000 0001 0000" /* <20>w<EFBFBD>w<EFBFBD>w.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};
data 'ppat' (131) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 AAAA AAAA AAAA AAAA 0000 0000" /* ....<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 AAAA" /* .........V....<EFBFBD><EFBFBD> */
$"AAAA AAAA AAAA 0000 0000 0000 0001 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};
data 'ppat' (132) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 FF00 FF00 FF00 FF00 0000 0000" /* ....<EFBFBD>.<2E>.<EFBFBD>.<2E>..... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 FF00" /* .........V....<EFBFBD>. */
$"FF00 FF00 FF00 0000 0000 0000 0001 0000" /* <20>.<2E>.<EFBFBD>........... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};
data 'ppat' (133) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 8822 8822 8822 8822 0000 0000" /* ....<EFBFBD>"<EFBFBD>"<EFBFBD>"<EFBFBD>".... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 8822" /* .........V....<EFBFBD>" */
$"8822 8822 8822 0000 0000 0000 0001 0000" /* <20>"<EFBFBD>"<EFBFBD>".......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};
data 'ppat' (134) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 0022 0088 0022 0088 0000 0000" /* .....".<2E>.".<2E>.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"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" /* .<2E>.".<2E>.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};
data 'ppat' (135) {
$"0001 0000 001C 0000 004E 0000 0000 FFFF" /* .........N....<EFBFBD><EFBFBD> */
$"0000 0000 00DD 0077 00BD 00ED 0000 0000" /* .....<EFBFBD>.w.<EFBFBD>.<2E>.... */
$"8001 0000 0000 0008 0008 0000 0000 0000" /* <20>............... */
$"0000 0048 0000 0048 0000 0000 0001 0001" /* ...H...H........ */
$"0001 0000 0000 0000 0056 0000 0000 00DD" /* .........V.....<EFBFBD> */
$"0077 00BD 00ED 0000 0000 0000 0001 0000" /* .w.<EFBFBD>.<2E>.......... */
$"FFFF FFFF FFFF 0001 0000 0000 0000" /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>........ */
};

View File

@@ -82,7 +82,7 @@ void screen_init(void)
TEInit();
InitDialogs(NULL);
InitCursor();
/* Attach Apple Event handler callbacks */
Gestalt('sysv',&sysv);
if (sysv>0x6FF)
@@ -146,13 +146,9 @@ void screen_init(void)
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
{
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);
@@ -606,6 +602,83 @@ unsigned char screen_pixel_colors_same(RGBColor* firstColor, RGBColor* secondCol
* screen_paint - Called to paint at location.
*/
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 yStack[512];
@@ -615,9 +688,6 @@ void screen_paint(padPt* Coord)
unsigned short spanAbove, spanBelow;
RGBColor oldColor;
if (is_mono==1)
return;
GetCPixel(x,y,&oldColor);
if ((oldColor.red == current_foreground.red) &&

View File

@@ -119,9 +119,14 @@ void screen_foreground(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)