// Draw a border
void listview_border(
	Class *cl,
	struct RastPort *rp,
	UWORD *pens,	
	struct IBox *box,
	ULONG state,
	short single)
{
	SetAPen(rp,pens[(state==IDS_SELECTED)?SHADOWPEN:SHINEPEN]);
	Move(rp,box->Left+box->Width-((single)?1:2),box->Top);
	Draw(rp,box->Left,box->Top);
	Draw(rp,box->Left,box->Top+box->Height-1);
	if (!single)
	{
		Move(rp,box->Left+1,box->Top+box->Height-2);
		Draw(rp,box->Left+1,box->Top+1);
	}

	SetAPen(rp,pens[(state==IDS_SELECTED)?SHINEPEN:SHADOWPEN]);
	Move(rp,box->Left+1,box->Top+box->Height-1);
	Draw(rp,box->Left+box->Width-1,box->Top+box->Height-1);
	Draw(rp,box->Left+box->Width-1,box->Top);
	if (!single)
	{
		Move(rp,box->Left+box->Width-2,box->Top+box->Height-2);
		Draw(rp,box->Left+box->Width-2,box->Top+1);
	}
}
Beispiel #2
0
// Draw a 3D box
void __asm __saveds L_DrawBox(
	register __a0 struct RastPort *rp,
	register __a1 struct Rectangle *rect,
	register __a2 struct DrawInfo *info,
	register __d0 BOOL recessed)
{
	UBYTE shine,shadow;

	// Get pens we need
	if (recessed)
	{
		shine=info->dri_Pens[SHADOWPEN];
		shadow=info->dri_Pens[SHINEPEN];
	}
	else
	{
		shine=info->dri_Pens[SHINEPEN];
		shadow=info->dri_Pens[SHADOWPEN];
	}

	// Do shine lines
	SetAPen(rp,shine);
	Move(rp,rect->MinX,rect->MaxY);
	Draw(rp,rect->MinX,rect->MinY);
	Draw(rp,rect->MaxX-1,rect->MinY);

	// Do shadow lines
	SetAPen(rp,shadow);
	Move(rp,rect->MaxX,rect->MinY);
	Draw(rp,rect->MaxX,rect->MaxY);
	Draw(rp,rect->MinX+1,rect->MaxY);
}
Beispiel #3
0
VOID TableClass::Render (struct RenderMessage &rmsg)
{
  if(Flags & FLG_Layouted)
  {
    struct RastPort *rp = rmsg.RPort;
    BOOL oldborder = rmsg.TableBorder, target;

    LONG old_backgroundcol = rmsg.Colours[Col_Background];
    class SuperClass *oldbackground = rmsg.BackgroundObj;
    if(BackgroundRGB != -1 || Picture)
    {
      SetCol(rmsg.Colours[Col_Background], BackgroundCol);
      rmsg.BackgroundObj = this;
    }

    if((target = (rmsg.TargetObj == (class SuperClass *)this)))
      rmsg.TargetObj = NULL;

    if(!rmsg.TargetObj)
    {
      if(rmsg.BackgroundObj == (class BackFillClass *)this)
        DrawBackground(rmsg, Left+BorderSize-rmsg.OffsetX, Top+BorderSize-rmsg.OffsetY, Left+BorderSize+Width-1+((Columns+1)*Spacing)-rmsg.OffsetX, Bottom-BorderSize-rmsg.OffsetY, 0, 0);

      if(BorderSize)
      {
        ULONG width = Width+((Columns+1)*Spacing)+2*BorderSize;
        LONG  x1 = Left-rmsg.OffsetX, x2 = Left+width-rmsg.OffsetX-1,
            y1 = Top-rmsg.OffsetY, y2 = Bottom-rmsg.OffsetY;

        SetAPen(rp, rmsg.Colours[Col_Halfshadow]);
        RectFill(rp, x1+BorderSize, y2-BorderSize+1, x2, y2);
        RectFill(rp, x2-BorderSize+1, y1+BorderSize, x2, y2);
        SetAPen(rp, rmsg.Colours[Col_Halfshine]);
        RectFill(rp, x1, y1, x2-BorderSize, y1+BorderSize-1);
        RectFill(rp, x1, y1+BorderSize, x1+BorderSize-1, y2-BorderSize);

        DrawCorner(rp, x1, y2-BorderSize+1, BorderSize, rmsg.Colours[Col_Halfshine], rmsg.Colours[Col_Halfshadow]);
        DrawCorner(rp, x2-BorderSize+1, y1, BorderSize, rmsg.Colours[Col_Halfshine], rmsg.Colours[Col_Halfshadow]);
      }
    }

    rmsg.TableBorder = BorderSize;

    struct ChildsList *first = FirstChild;
    while(first)
    {
      ((class TRClass *)first->Obj)->TRRender(rmsg);
      first = first->Next;
    }

    rmsg.TableBorder = oldborder;
    rmsg.BackgroundObj = (class BackFillClass *)oldbackground;
    rmsg.Colours[Col_Background] = old_backgroundcol;

    if(target)
      rmsg.TargetObj = this;
  }
}
Beispiel #4
0
void rect (long xMin, long yMin, long xMax, long yMax, unsigned long pen)
{
  unsigned long saved_pen;

  saved_pen = RastPort->FgPen;
  SetAPen (RastPort, pen);
  RectFill (RastPort, xMin, yMin, xMax, yMax);
  SetAPen (RastPort, saved_pen);
}
Beispiel #5
0
static void vsid_clear_window(void)
{
    ULONG vsid_pen;

    vsid_pen = GetAPen(vsid_window->RPort);
    SetAPen(vsid_window->RPort, GetBPen(vsid_window->RPort));
    RectFill(vsid_window->RPort, 25, 30, 350, 150);
    SetAPen(vsid_window->RPort, vsid_pen);
}
Beispiel #6
0
static VOID DrawGhosted(struct TB_Element *tool, struct Toolbar_Data *data, Object *obj, BOOL selected)
{
  switch(data->GhostEffect)
  {
    case GHOST_LIGHT:
    case GHOST_HEAVY:
    {
      DrawButton(tool, data, obj, selected, !data->ToolImages);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[2];

        if(data->GhostEffect == GHOST_LIGHT)
        {
          ditherData[0] = 0x8888;
          ditherData[1] = 0x2222;
        }
        else
        {
          ditherData[0] = 0x5555;
          ditherData[1] = 0xAAAA;
        }

        SetAPen(rport, _pens(obj)[MPEN_SHADOW]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX, tool->DstY, tool->DstX+data->ButtonWidth-1, tool->DstY + data->ButtonHeight-1);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_SUPERLIGHT:
    {
      DrawButton(tool, data, obj, selected, THREE_D);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[] = {0x5555, 0xAAAA};
        SetAPen(rport, _pens(obj)[MPEN_HALFSHINE]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX+2, tool->DstY+2, tool->DstX+data->ButtonWidth-3, tool->DstY+1+data->InnerSpace+data->IconHeight);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_BITMAP:
//    case GHOST_DIMMED:
    {
      DrawButton(tool, data, obj, selected, THREE_D);
    }
    break;
  }
}
Beispiel #7
0
void doGoats(struct RastPort *r)
{
	LONG	ptr = numGoats-1;
	LONG	i,n,newX,newY,startDir,tmpDir;
	LONG	flag = 0;

	while (ptr >= 0) {
		if (goatQ[ptr] ) {
			flag = 1;
			x = goats[ptr].x;
			y = goats[ptr].y;
			SetAPen(r, backgroundClr);
			WritePixel(r, x, y);
			startDir = tmpDir  = (LONG)RangeRand(8);
			while (1) {
				n = neighbor(r, tmpDir);
				if (n != grassClr || n == -1) {
					tmpDir = (tmpDir+1) % 8;
					if (tmpDir == startDir) {
						goatQ[ptr] = 0;
						break;
					}
				}
				else {
					goats[ptr].x = newX = tx;
					goats[ptr].y = newY = ty;
					++grassEaten[ptr];
					if (grassEaten[ptr] >= reproduction) {
						grassEaten[ptr] = 0;
						i = 0;
						while(goatQ[i] != 0 && i < numGoats)
							++i;
						if (i != numGoats) {
							goats[i].x = newX;
							goats[i].y = newY;
							goatQ[i] = 1;
							grassEaten[i] = 0;
						}
					}
					SetAPen(r,goatClr);
					WritePixel(r,newX,newY);
					break;
				}
			}
		}
		--ptr;
	}
	if (!flag) {
		goatQ[0] = 1;
		goats[0].x = (LONG)RangeRand(Width-1);
		goats[0].y = (LONG)RangeRand(Height-1);
		grassEaten[0] = 0;
	}
}
Beispiel #8
0
VOID TableClass::DrawCorner(struct RastPort *rport, LONG x, LONG y, UWORD width, UBYTE col1, UBYTE col2)
{
  LONG y2 = y+width-1;
  while(width--)
  {
    SetAPen(rport, col1);
    RectFill(rport, x, y, x+width, y);
    y++;
    if(y2 >= y)
    {
      SetAPen(rport, col2);
      RectFill(rport, x+width, y, x+width, y2);
    }
  }
}
Beispiel #9
0
void doHerders(struct RastPort *r)
{
	LONG	ptr = numHerders-1;
	LONG	i,n,newX,newY,startDir,tmpDir;
	LONG	flag = 0;
	
	while( ptr >= 0 ) {
		if( herderQ[ptr] ) {
			flag = 1;
			x = herders[ptr].x;
			y = herders[ptr].y;
			SetAPen(r, grassClr);
			WritePixel(r, x, y);
			startDir = tmpDir  = (LONG)RangeRand(8);
			while (1) {
				n = neighbor(r, tmpDir);
				if (n == grassClr || n == -1) {
					tmpDir = (tmpDir+1) % 8;
					if (tmpDir == startDir) {
						herderQ[ptr] = 0;
						break;
					}
				}
				else {
					herders[ptr].x = newX = tx;
					herders[ptr].y = newY = ty;
					i = 0;
					while(herderQ[i] && i < numHerders)
						++i;
					if (i != numHerders) {
						herders[i].x = newX;
						herders[i].y = newY;
						herderQ[i] = 1;
					}
					SetAPen(r,herderClr);
					WritePixel(r,newX,newY);
					break;
				}
			}
		}
		--ptr;
	}
	if (!flag) {
		herderQ[0] = 1;
		herders[0].x = (LONG)RangeRand(Width-1);
		herders[0].y = (LONG)RangeRand(Height-1);
	}
}
Beispiel #10
0
ULONG ERASE_Gadget(piClass *cl,piObject *o,Msg msg)
{
	UWORD x,y,w,h;
	piObject *wo;
	struct Node_Window *nw;
	struct Node_Gadget *ng;

	piGetAttr(o,OBJ_Node,(ULONG *)&ng);
	piGetAttr(o,OBJ_Window,(ULONG *)&wo);
	if(wo)
	{
		piGetAttr(wo,OBJ_Node,(ULONG *)&nw);
		if(nw) if(nw->nw_Window)
		{
//			if(!ng->ng_RelX)
 x=piCX(o);// else x=nw->nw_Width-ng->ng_X;
//			if(!ng->ng_RelY)
 y=piCY(o);// else y=nw->nw_Height-ng->ng_Y;
//			if(!ng->ng_RelWidth)
 w=piCW(o);// else w=nw->nw_Width-nw->nw_Window->BorderRight+ng->ng_Width-x;
//			if(!ng->ng_RelHeight)
 h=piCH(o);// else h=nw->nw_Height-nw->nw_Window->BorderBottom+ng->ng_Height-y;

			SetAPen(nw->nw_Window->RPort,DrawInfo->dri_Pens[BACKGROUNDPEN]);
			SetDrMd(nw->nw_Window->RPort,JAM1);
			RectFill(nw->nw_Window->RPort,x,y,x+w,y+h);
			piShowGrid(o);
		}
	}
	return TRUE;
}
Beispiel #11
0
static VOID LowerFrame(struct RastPort *rport, UWORD MinX, UWORD MinY, UWORD MaxX,
                       UWORD MaxY, UWORD color)
{
  SetAPen(rport, color);
  RectFill(rport, MinX, MaxY, MaxX, MaxY);
  RectFill(rport, MaxX, MinY, MaxX, MaxY);
}
Beispiel #12
0
VOID test_bltmask(struct Window *w)
{
/*    ULONG mask[] = {
	0xAAAAAAAA,
	0xAAAAAAAA,
	0xFFFFFFFF,
	0xFFFFFFFF,
	0xAAAAAAAA,
	0xAAAAAAAA
    };
*/    
    /* Fill a area to blit from */
    
    SetAPen(w->RPort, 1);
    
    RectFill(w->RPort, SRC_X, SRC_Y, SRC_X + MASK_WIDTH - 1, SRC_Y + MASK_HEIGHT);
    
    /* Blit from source area */
/*    BltMaskBitMapRastPort(w->RPort
    	, SRC_X, SRC_Y
	, DEST_X, DEST_Y
	, MASK_WIDTH, MASK_HEIGHT
	, 0x00C0
	, (PLANEPTR) mask
   );
*/
				
    return;
}
Beispiel #13
0
VOID test_flood(struct Window *w)
{

    struct TmpRas tmpras;
    BYTE *buffer;
    
D(bug("Window layer: %p\n", w->WLayer));    

    buffer = AllocRaster(w->WLayer->Width, w->WLayer->Height);
D(bug("buffer: %p\n", buffer));    
    if (!buffer)
    	return;
	
    InitTmpRas(&tmpras, buffer, RASSIZE(w->WLayer->Width, w->WLayer->Height));
    w->RPort->TmpRas = &tmpras;
    
    SetOutlinePen(w->RPort, 1);
    SetAPen(w->RPort, 1);
    
    SetDrPt(w->RPort, ~0L);
    
    Move(w->RPort, 50, 50);
    Draw(w->RPort, 100, 100);
    Draw(w->RPort, 50,  100);
    Draw(w->RPort, 50, 50);
    
D(bug("Calling Flood()\n"));    
    Flood(w->RPort, 0, 70, 80);   /* outline mode */

    w->RPort->TmpRas = NULL;
    
}
Beispiel #14
0
/*** Display cursor of project p ***/
void inv_curs(Project p, BYTE state)
{
	if(p->ccp.select)
	{
		/* Just draw a simple vert bart for selection */
		WORD y = p->ycurs - BASEL;
		RectFill(RP,p->xcurs, y, p->xcurs+1, y+YSIZE-1);
	}	else {
		UBYTE thechar, oldmask = RP->Mask;
		/* Fully highlight character */
		RP->Mask = gui.selmask;
		if(state) SetABPenDrMd(RP,pen.fgfill,pen.bgfill,JAM2);

		if(state != 0 && p->cursmode) {
			/* Draw the replacement cursor */
			SetAPen(RP, pen.bgfill);
			RectFill(RP,p->xcurs, p->ycurs, p->xcurs+XSIZE-1, p->ycurs-BASEL+YSIZE-1);
		} else {
			/* Normal cursor */
			thechar = (p->nbc < p->edited->size ? p->edited->stream[p->nbc] : ' ');
			if(thechar == '\t') thechar = ' ';
			Move(RP,p->xcurs,p->ycurs); Text(RP,&thechar,1);
		}
		SetABPenDrMd(RP,pen.fg,pen.bg,JAM2);
		RP->Mask = oldmask;
	}
}
Beispiel #15
0
void piShowGrid(piObject *o)
{
	ULONG x,y,xs,ys,xo,yo,wo,ho;
	struct Node_Window *nw;
	piObject *wobj;

	if(GUI.gui_GridShow)
	{
		piGetAttr(o,GA_Left,&xo);
		piGetAttr(o,GA_Top,&yo);
		piGetAttr(o,GA_Width,&wo);
		piGetAttr(o,GA_Height,&ho);
		piGetAttr(o,OBJ_Window,(ULONG *)&wobj);
		piGetAttr(wobj,OBJ_Node,(ULONG *)&nw);
		xs=xo/GUI.gui_Grid[0];
		ys=yo/GUI.gui_Grid[1];

		SetDrMd(nw->nw_Window->RPort,JAM1);
		SetAPen(nw->nw_Window->RPort,DrawInfo->dri_Pens[SHADOWPEN]);
		for(x=xs*GUI.gui_Grid[0];x<xo+wo+1;x+=GUI.gui_Grid[0])
		{
			for(y=ys*GUI.gui_Grid[1];y<yo+ho+1;y+=GUI.gui_Grid[1])
			{
				WritePixel(nw->nw_Window->RPort,nw->nw_Window->BorderLeft+x,nw->nw_Window->BorderTop+y);
			}
		}
	}
}
Beispiel #16
0
VOID DrawLine (struct RastPort *RP, PrefObject *mP, LONG Size, LONG Index)
{
	LONG	Col;

	Line[Index].X = RangeRand (Size * 2) - Size;
	Line[Index].Y = RangeRand (Size * 2) - Size;
	Line[Index].X2 = RangeRand (Size * 2) - Size;
	Line[Index].Y2 = RangeRand (Size * 2) - Size;
	Col = RangeRand (Colors);

	SetAPen (RP, Col);
	Move (RP, HalfWidth + Line[Index].X, HalfHeight + Line[Index].Y);
	Draw (RP, HalfWidth + Line[Index].X2, HalfHeight + Line[Index].Y2);
	Move (RP, HalfWidth - Line[Index].X, HalfHeight + Line[Index].Y);
	Draw (RP, HalfWidth - Line[Index].X2, HalfHeight + Line[Index].Y2);
	Move (RP, HalfWidth + Line[Index].X, HalfHeight - Line[Index].Y);
	Draw (RP, HalfWidth + Line[Index].X2, HalfHeight - Line[Index].Y2);
	Move (RP, HalfWidth - Line[Index].X, HalfHeight - Line[Index].Y);
	Draw (RP, HalfWidth - Line[Index].X2, HalfHeight - Line[Index].Y2);
	Move (RP, HalfWidth + Line[Index].Y, HalfHeight + Line[Index].X);
	Draw (RP, HalfWidth + Line[Index].Y2, HalfHeight + Line[Index].X2);
	Move (RP, HalfWidth - Line[Index].Y, HalfHeight + Line[Index].X);
	Draw (RP, HalfWidth - Line[Index].Y2, HalfHeight + Line[Index].X2);
	Move (RP, HalfWidth + Line[Index].Y, HalfHeight - Line[Index].X);
	Draw (RP, HalfWidth + Line[Index].Y2, HalfHeight - Line[Index].X2);
	Move (RP, HalfWidth - Line[Index].Y, HalfHeight - Line[Index].X);
	Draw (RP, HalfWidth - Line[Index].Y2, HalfHeight - Line[Index].X2);
}
Beispiel #17
0
static void
Standard_SetHighColor(struct RastPort *rp, ULONG color)
{
	struct colorPen *cp = GetColorPen(color);

	SetAPen(rp, cp->cp_Pen);
}
Beispiel #18
0
void
ShowClipValues(struct Window *nw)
{
    char buf[50];
    struct Gadget *gd;

    SetAPen(nw->RPort, 5);
    SetBPen(nw->RPort, amii_otherBPen);
    SetDrMd(nw->RPort, JAM2);

    sprintf(buf, "%d ", mxsize);
    gd = &ClipXSIZE;
    Move(nw->RPort, gd->LeftEdge + (nw->Width + gd->Width) + 8,
         gd->TopEdge + nw->RPort->TxBaseline);
    Text(nw->RPort, buf, strlen(buf));

    sprintf(buf, "%d ", mysize);
    gd = &ClipYSIZE;
    Move(nw->RPort, gd->LeftEdge + (nw->Width + gd->Width) + 8,
         gd->TopEdge + nw->RPort->TxBaseline);
    Text(nw->RPort, buf, strlen(buf));

    sprintf(buf, "%d ", xclipbord);
    gd = &ClipXCLIP;
    Move(nw->RPort, gd->LeftEdge + (nw->Width + gd->Width) + 8,
         gd->TopEdge + nw->RPort->TxBaseline);
    Text(nw->RPort, buf, strlen(buf));

    sprintf(buf, "%d ", yclipbord);
    gd = &ClipYCLIP;
    Move(nw->RPort, gd->LeftEdge + (nw->Width + gd->Width) + 8,
         gd->TopEdge + nw->RPort->TxBaseline);
    Text(nw->RPort, buf, strlen(buf));
}
Beispiel #19
0
void NoDitherScreenPixelPlot(struct Window *win, short Col, short x, short y)
{

 SetAPen(win->RPort, Col);
 WritePixel(win->RPort, x, y);

} /* NoDitherScreenPixelPlot() */
Beispiel #20
0
ULONG ERASE_Frame(piClass *cl,piObject *o,Msg msg)
{
	UWORD x,y,w,h;
	piObject *wo;
	struct Node_Window *nw;

	piGetAttr(o,OBJ_Window,(ULONG *)&wo);
	if(wo)
	{
		piGetAttr(wo,OBJ_Node,(ULONG *)&nw);
		if(nw) if(nw->nw_Window)
		{
			x=piCX(o);
			y=piCY(o);
			w=piCW(o);
			h=piCH(o);

			SetAPen(nw->nw_Window->RPort,DrawInfo->dri_Pens[BACKGROUNDPEN]);
			SetDrMd(nw->nw_Window->RPort,JAM1);
			RectFill(nw->nw_Window->RPort,x,y,x+w,y+h);
			piShowGrid(o);
		}
	}
	return TRUE;
}
Beispiel #21
0
ULONG TAPEDECK_RENDER_Gadget(piClass *cl,piObject *o,Msg msg)
{
	UWORD x,y,w,h;
	struct Node_Gadget *ng;
	struct Node_Window *nw;
	struct Gadget *g,*ga;
	BOOL fill=FALSE;

	piGetAttr(o,OBJ_Node,(ULONG *)&ng);
	piGetAttr(ng->ng_Window,OBJ_Node,(ULONG *)&nw);

	x=piCX(o);
	y=piCY(o);
	w=piCW(o);
	h=piCH(o);

	SetAPen(nw->nw_Window->RPort,DrawInfo->dri_Pens[BACKGROUNDPEN]);
	SetDrMd(nw->nw_Window->RPort,JAM1);
	RectFill(nw->nw_Window->RPort,x,y,x+w,y+h);

	g=CreateContext(&g);
	if(ga=(struct Gadget *)piDoMethod(o,OM_CREATE,g))
	{
		AddGList(nw->nw_Window,ga,-1,-1,NULL);
		RefreshGList(g,nw->nw_Window,NULL,-1);
		RemoveGList(nw->nw_Window,ga,-1);
	}
	piDoMethod(o,OM_DELETE);
	g->NextGadget=NULL;
	FreeGadgets(g);

	if(ng->ng_Selected && GUI.gui_Mode==MODE_GADGET)
	{
		SetAPen(nw->nw_Window->RPort,1);
		SetDrMd(nw->nw_Window->RPort,COMPLEMENT);
		if(CurrentGadget==o) fill=TRUE;
		DrawRect(nw->nw_Window->RPort,x,y,fill);
		DrawRect(nw->nw_Window->RPort,x+w-5,y,fill);
		DrawRect(nw->nw_Window->RPort,x+w-5,y+h-5,fill);
		DrawRect(nw->nw_Window->RPort,x,y+h-5,fill);
		DrawRect(nw->nw_Window->RPort,x+(w/2)-2,y,fill);
		DrawRect(nw->nw_Window->RPort,x+(w/2)-2,y+h-5,fill);
		DrawRect(nw->nw_Window->RPort,x,y+(h/2)-2,fill);
		DrawRect(nw->nw_Window->RPort,x+w-5,y+(h/2)-2,fill);
	}
	return TRUE;
}
Beispiel #22
0
VOID DrawSeparator (struct RastPort *rp, WORD X, WORD Y, WORD Width, WORD Height, struct InstData *data)
{
  ENTER();

  if(Width > 3*Height)
  {
    SetAPen(rp, data->separatorshadow);
    RectFill(rp, X, Y, X+Width-2, Y);
    RectFill(rp, X, Y, X, Y+Height);

    SetAPen(rp, data->separatorshine);
    RectFill(rp, X+1, Y+Height, X+Width-1, Y+Height);
    RectFill(rp, X+Width-1, Y, X+Width-1, Y+Height);
  }

  LEAVE();
}
Beispiel #23
0
static void WhitePrint(struct RastPort *RPort, char *String, UWORD height, struct GfxBase * GfxBase)
{
        SetAPen(RPort, 1);
        SetBPen(RPort, 2);
        SetDrMd(RPort, JAM2);
        Move(RPort,20,height);
        Text(RPort, String, strlen(String));
}
Beispiel #24
0
Draw_Dot(short dotcode,short dotx,short doty)
{
 dotread=ReadPixel(rastport,dotx,doty);
 if(dotread!=DOTCOLOR && dotread!=ENERGCOLOR)
 {
  if(dotcode&ENERGIZER)
  {
   SetAPen(rastport,ENERGCOLOR);
   for(tx=-1;tx<2;tx++) for(ty=-1;ty<2;ty++)
    WritePixel(rastport,dotx+tx,doty+ty);                   /* BIG dot! */
   SetAPen(rastport,DOTCOLOR);
  }
  else 
   WritePixel(rastport,dotx,doty);
  numdots++;
 }
 return 0;
}
Beispiel #25
0
void CopyWNotice()
{
    int x, y;
    x = ( screenBox.w - PMapX( 48 ) - CW_WIDTH ) / 2;
    y = ( screenBox.h - CW_HEIGHT ) / 2;

    SetOPen( &screenRP, 1 );
    SetAPen( &screenRP, 3 );
    RectFill( &screenRP, x, y, x + CW_WIDTH - 1, y + CW_HEIGHT - 1 );

    BNDRYOFF( &screenRP );
    SetAPen( &screenRP, 0 );
    //FIXME: SetDrMd( &screenRP, JAM1 );

    CopyWText( x + 6, y + 30 );

    SetAPen( &screenRP, 1 );
    CopyWText( x + 5, y + 29 );
}
Beispiel #26
0
static IPTR mLampDraw(struct IClass *cl, Object *obj, struct MUIP_Draw *msg)
{
    struct lampData *data = INST_DATA(cl,obj);
    IPTR            res;

    res = DoSuperMethodA(cl,obj,(APTR)msg);

    if(hasFlag(msg->flags, (MADF_DRAWOBJECT|MADF_DRAWUPDATE)))
    {
        WORD l, t, r, b;

        /* Don't ask or modify ! */

        l = _mleft(obj);
        r = _mright(obj);
        t = _mtop(obj)+(_mheight(obj)+data->delta)/2-1;
        b = t-data->delta;

        if (r-l>2)
        {
            l += 1;
            r -= 1;
        }

        if (b-t>2)
        {
            t += 1;
            b -= 1;
        }

        SetAPen(_rp(obj), MUIPEN(isFlagSet(data->flags, FLG_LampDisabled) ? data->disabled : data->enabled));
        RectFill(_rp(obj),l,t,r,b);

        SetAPen(_rp(obj),MUIPEN(data->detail));
        Move(_rp(obj),l,t);
        Draw(_rp(obj),r,t);
        Draw(_rp(obj),r,b);
        Draw(_rp(obj),l,b);
        Draw(_rp(obj),l,t);
    }

    return res;
}
Beispiel #27
0
/*>ClearWindow(struct Window *wind)
   --------------------------------
   Clears the specified RastPort with a rectfill
   06.04.92 Original
*/
ClearWindow(struct Window *wind)
{
   SetAPen(wind->RPort,0);
   RectFill(wind->RPort,
            wind->BorderLeft,
            wind->BorderTop,
            wind->Width  - wind->BorderRight,
            wind->Height - wind->BorderBottom);
   return(0);
}
Beispiel #28
0
void cardRender( Card theCard, struct RastPort *Rast, long xPos, long yPos )
{
    SetDrMd( Rast, JAM2 );
    if( theCard )
    {
        if( cardFaceUp( theCard ))
        {
            SetAPen( Rast, 2 );
            RectFill( Rast, xPos, yPos, xPos+CARD_WIDTH-1,
                     yPos+CARD_HEIGHT-1 );
            SetBPen( Rast, 2 );
            switch( cardSuit( theCard ))
            {
            case HEARTS:
            case DIAMONDS:
                SetAPen( Rast, 6 );
                break;
            default:
                SetAPen( Rast, 1 );
                break;
            }
            SuitImages[cardSuit( theCard )].PlaneOnOff = 0x2;
            DrawImage( Rast, &SuitImages[cardSuit( theCard )],
                      xPos + Rast->TxWidth + 3, yPos + 3 );
            DrawImage( Rast, &SuitImages[cardSuit( theCard )],
                      xPos + CARD_WIDTH - Rast->TxWidth - 10,
                      yPos + CARD_HEIGHT - Rast->TxHeight - 2 );
            gfxMove( Rast, xPos + 2, yPos + Rast->TxBaseline + 3 );
            Text( Rast, RankToStr[cardRank( theCard )], 1 );
            gfxMove( Rast, xPos + CARD_WIDTH - Rast->TxWidth - 3,
                 yPos + CARD_HEIGHT - Rast->TxHeight + Rast->TxBaseline - 2 );
            Text( Rast, RankToStr[cardRank( theCard )], 1 );
        }
        else
        {
            SetAPen( Rast, 7 );
            RectFill( Rast, xPos, yPos, xPos+CARD_WIDTH-1,
                     yPos+CARD_HEIGHT-1 );
        }
    }
    else
    {
        SetAPen( Rast, 0 );
        RectFill( Rast, xPos, yPos, xPos+CARD_WIDTH-1, yPos+CARD_HEIGHT-1 );
    }
    SetAPen( Rast, 1 );
    gfxMove( Rast, xPos, yPos );
    Draw( Rast, xPos+CARD_WIDTH-1, yPos );
    Draw( Rast, xPos+CARD_WIDTH-1, yPos+CARD_HEIGHT-1 );
    Draw( Rast, xPos, yPos+CARD_HEIGHT-1 );
    Draw( Rast, xPos, yPos );
    SetAPen( Rast, 5 );
    WritePixel( Rast, xPos, yPos );
    WritePixel( Rast, xPos+CARD_WIDTH-1, yPos );
    WritePixel( Rast, xPos, yPos+CARD_HEIGHT-1 );
    WritePixel( Rast, xPos+CARD_WIDTH-1, yPos+CARD_HEIGHT-1 );
}
Beispiel #29
0
PrintScore()
{
  sprintf(statline,"%7d",score);

  SetAPen(statport,1);

  Move(statport,scoreoff+1,9);

  Text(statport,statline,strlen(statline));

  return 0;
}
Beispiel #30
0
IPTR MenuBarLabelClass__IM_DRAW(Class *cl, struct Image *im, struct impDraw *msg)
{
    struct MenuBarLabelData *data = INST_DATA(cl, im);

    if (data->dri)
    {
        struct RastPort *rp = msg->imp_RPort;
        WORD x1, y1, x2, y2;

        if (!rp) return (IPTR)0;

        SetDrMd(rp, JAM1);

        x1 = im->LeftEdge + msg->imp_Offset.X;
        y1 = im->TopEdge  + msg->imp_Offset.Y;
        x2 = x1 + im->Width  - 1;
        y2 = y1 + im->Height - 1;


        if (MENUS_AMIGALOOK)
        {
            SetAPen(rp, data->dri->dri_Pens[BARDETAILPEN]);
            RectFill(rp, x1, y1, x2, y2);
        }
        else
        {
            /* Will only work if imageheight = 2 */
            SetAPen(rp, data->dri->dri_Pens[SHADOWPEN]);
            RectFill(rp, x1, y1, x2 - 1, y1);
            WritePixel(rp, x1, y2);

            SetAPen(rp, data->dri->dri_Pens[SHINEPEN]);
            RectFill(rp, x1 + 1, y2, x2, y2);
            WritePixel(rp, x2, y1);
        }

    } /* if (data->dri) */

    return (IPTR)0;
}