示例#1
0
文件: c4_debug.c 项目: BSzili/refkeen
void OverheadRefresh (void)
{
	id0_unsigned_t	x,y,endx,endy,sx,sy;
	id0_unsigned_t	tile;


	if (++screenpage == 3)
		screenpage = 0;

	bufferofs = screenloc[screenpage];

	endx = maporgx+VIEWTILEX;
	endy = maporgy+VIEWTILEY;

	for (y=maporgy;y<endy;y++)
		for (x=maporgx;x<endx;x++)
		{
			sx = (x-maporgx)*2;
			sy = (y-maporgy)*16;

			switch (viewtype)
			{
			case mapview:
				tile = *(mapsegs[0]+farmapylookup[y]+x);
				break;

			case tilemapview:
				tile = tilemap[x][y];
				break;

			case actoratview:
				tile = (id0_unsigned_t)actorat[x][y];
				break;

			case visview:
				tile = spotvis[x][y];
				break;

			case mapseg2:
				tile = *(mapsegs[2]+farmapylookup[y]+x);
				if (tile < 256)
					tile = *(mapsegs[0]+farmapylookup[y]+x);
			break;

			}

			if (tile<NUMTILE16)
				LatchDrawTile(sx,sy,tile);
			else
			{
				LatchDrawChar(sx,sy,NUMBERCHARS+((tile&0xf000)>>12));
				LatchDrawChar(sx+1,sy,NUMBERCHARS+((tile&0x0f00)>>8));
				LatchDrawChar(sx,sy+8,NUMBERCHARS+((tile&0x00f0)>>4));
				LatchDrawChar(sx+1,sy+8,NUMBERCHARS+(tile&0x000f));
			}
		}

	VW_SetScreen (bufferofs,0);
	displayofs = bufferofs;
}
示例#2
0
void OverheadRefresh (void)
{
    unsigned        x,y,endx,endy,sx,sy;
    unsigned        tile;


    endx = maporgx+VIEWTILEX;
    endy = maporgy+VIEWTILEY;

    for (y=maporgy;y<endy;y++)
    {
        for (x=maporgx;x<endx;x++)
        {
            sx = (x-maporgx)*16;
            sy = (y-maporgy)*16;

            switch (viewtype)
            {
#if 0
                case mapview:
                    tile = *(mapsegs[0]+farmapylookup[y]+x);
                    break;

                case tilemapview:
                    tile = tilemap[x][y];
                    break;

                case visview:
                    tile = spotvis[x][y];
                    break;
#endif
                case actoratview:
                    tile = (unsigned)actorat[x][y];
                    break;
            }

            if (tile<MAXWALLTILES)
                LatchDrawTile(sx,sy,tile);
            else
            {
                LatchDrawChar(sx,sy,NUMBERCHARS+((tile&0xf000)>>12));
                LatchDrawChar(sx+8,sy,NUMBERCHARS+((tile&0x0f00)>>8));
                LatchDrawChar(sx,sy+8,NUMBERCHARS+((tile&0x00f0)>>4));
                LatchDrawChar(sx+8,sy+8,NUMBERCHARS+(tile&0x000f));
            }
        }
    }
}