Ejemplo n.º 1
0
void Maped_Playfield_Over_PacMan(BITMAP * playfield)
{
#if 0
    // convert the editbuffer into a displayable map image
    struct GFXLAYOUT * gl = Driver.GfxInfo[CurrentBank].GfxLayout;
    struct ROMDATA * rd = Driver.RomData;
    BITMAP * TempChar = create_bitmap(gl->width, gl->height);
    unsigned char tch;
    int cx,cy;

    GetImageFromSet(gl, 0x10, TempChar);
    ShiftColor(TempChar);

    for(cx = 0; cx < rd->MapData[mapno].width ; cx++)
	for(cy = 0; cy < rd->MapData[mapno].height ; cy++)
	{
	    tch = overbuf[cx + (cy * rd->MapData[mapno].width)];
	    if (tch)
	    {
		blit(TempChar, playfield, 0,0,
			cx*gl->width+1, cy*gl->height+1,
			gl->width, gl->height);
	    }
	}

    destroy_bitmap(TempChar);
#endif
}
Ejemplo n.º 2
0
void Maped_Playfield_HC_PacMan(BITMAP * playfield)
{
#if 0
    int count;
    int x,y;
    struct GFXLAYOUT * gl = Driver.GfxInfo[CurrentBank].GfxLayout;
    BITMAP * TempChar = create_bitmap(gl->width, gl->height);

    GetImageFromSet(gl, 0x14, TempChar);
    ShiftColor(TempChar);

    for (count = 0 ;
         count < Driver.RomData->MapData[mapno].numHardcoded ;
	 count ++)
	{
	    x= Driver.RomData->MapData[mapno].hardcoded[2*count];
	    y= Driver.RomData->MapData[mapno].hardcoded[(2*count)+1];
	    blit(TempChar, playfield, 0,0, (x)*gl->width+1, (y)*gl->height+1, gl->width, gl->height);
	}


    destroy_bitmap(TempChar);
#endif
}
Ejemplo n.º 3
0
void
ColorSwatch::Draw (BRect)
{
	PushState();

	SetDrawingMode (B_OP_COPY);

	rgb_color high (HighColor());
	BRect colorPad (Bounds());
	SetHighColor (ValueAsColor());

	FillRect (colorPad);

	rgb_color light (ShiftColor (ValueAsColor(), 0.4));
	rgb_color dark	(ShiftColor (ValueAsColor(), 1.2));

	BeginLineArray (10);
	AddLine (
		colorPad.LeftTop(),
		colorPad.RightTop() - BPoint (1, 0),
		light);

	AddLine (
		colorPad.LeftTop(),
		colorPad.LeftBottom() - BPoint (0, 1),
		light);

	AddLine (
		colorPad.RightTop() + BPoint (0, 1),
		colorPad.RightBottom(),
		dark);

	AddLine (
		colorPad.RightBottom(),
		colorPad.LeftBottom() + BPoint (1, 0),
		dark);

	light = ShiftColor (ViewColor(), 0.1);
	dark	= ShiftColor (ViewColor(), 1.4);
	colorPad.InsetBy (-1, -1);

	BPoint hless (-1, 0);
	BPoint hmore (1, 0);
	BPoint vless (0, -1);
	BPoint vmore (0, 1);

	if (IsFocus() && Window()->IsActive())
	{
		light = general_info.mark_color;
		dark	= general_info.mark_color;
		hless = hmore = vless = vmore = BPoint (0, 0);
	}
	else
	{
		// A little blue residue clean up
		AddLine (
			colorPad.RightTop(),
			colorPad.RightTop(),
			ViewColor());
		AddLine (
			colorPad.LeftBottom(),
			colorPad.LeftBottom(),
			ViewColor());
	}

	AddLine (
		colorPad.LeftTop(),
		colorPad.RightTop() + hless,
		dark);

	AddLine (
		colorPad.LeftTop(),
		colorPad.LeftBottom() + vless,
		dark);

	AddLine (
		colorPad.RightTop() + vmore,
		colorPad.RightBottom(),
		light);

	AddLine (
		colorPad.RightBottom(),
		colorPad.LeftBottom() + hmore,
		light);

	EndLineArray();
	PopState();
}
Ejemplo n.º 4
0
/*** DoCDelete - perform character deletion
*
*  Delete the character at the current cursor location
*
* Input:
*  fEmacs	- EMACs type delete flag
*
* Output:
*  Returns TRUE on deletion
*
*************************************************************************/
flagType
DoCDelete (
    flagType fEmacs
    ) {

    fl      fl;                             /* file loc to position at      */
    int     x;
    char    *p;
    linebuf tempbuf;
    struct lineAttr rgla[sizeof(linebuf)];
    flagType fColor;

    fl.col = XCUR(pInsCur);
    fl.lin = YCUR(pInsCur);
    /*
     * xCursor is zero. If yCursor is also zero (top of file), we can't move
     * back, so nothing to delete. Otherwise, move to end of previous line, and
     * if emacs & insert mode, join the lines.
     */
    if (fl.col == 0) {
        if (fl.lin == 0) {
            return FALSE;
        } else {
            fl.lin--;
            fl.col = LineLength (fl.lin, pFileHead);
            if (fInsert && fEmacs) {
                DelStream (pFileHead, fl.col, fl.lin, 0, fl.lin + 1);
            }
        }
    } else {
        /*
         * column is non-zero, so back it up one.
         */
        GetLine (fl.lin, tempbuf, pFileHead);
        x = cbLog (tempbuf);
        fl.col = DecCol (fl.col, tempbuf);
        /*
         * we're in the middle of a line. If in insert mode, back up the cursor, and
         * delete the character there.
         */
        if (fInsert) {
            DelBox (pFileHead, fl.col, fl.lin, fl.col, fl.lin);
        } else {
            /*
             * we're in the middle of a line, but not insert mode. Get the text of the
             * line & pointer to character.
             */
            p = pLog (tempbuf, fl.col, TRUE);
            /*
             * If emacs, and we're actually IN text, then replace the character with a
             * space.
             */
            if (fEmacs) {
                if (fl.col+1 <= x && *p != ' ') {
                    *p = ' ';
                    // SetColor (pFileHead, fl.lin, fl.col, 1, fgColor);
                    PutLine (fl.lin, tempbuf, pFileHead);
                }
            }
            /*
             * if we're beyond the end of the line, just position to the end of the line.
             */
            else if (fl.col+1 > x) {
                fl.col = x;
            }
            /*
             * if the first non-blank character is PAST the current position, then just
             * position at the begining of the line.
             */
            else if ((colPhys (tempbuf, whiteskip (tempbuf)) > fl.col)) {
                fl.col = 0;
            }
            /*
             * finaly, when all else fails, back up, and replace the character under the
             * cursor with a space.
             */
            else if (*p != ' ') {
                *pLog (tempbuf,fl.col,TRUE) = ' ';
                if (fColor = GetColor (fl.lin, rgla, pFileHead)) {
                    ShiftColor (rgla, fl.col, -1);
                    ColorToLog (rgla, buf);
                }
                PutLine (fl.lin, tempbuf, pFileHead);
                if (fColor) {
                    PutColor (fl.lin, rgla, pFileHead);
                }
            }
        }
    }
    cursorfl (fl);

    return TRUE;
}