Beispiel #1
0
Datei: xs.c Projekt: npe9/harvey
void
drawboard(void)
{
    int i, j;

    border(screen, insetrect(rboard, -2), 2, display->black, ZP);
    draw(screen, Rect(rboard.min.x, rboard.min.y-2, rboard.max.x, rboard.min.y),
         display->white, nil, ZP);
    for(i=0; i<NY; i++)
        for(j=0; j<NX; j++)
            if(board[i][j])
                drawsq(screen, Pt(rboard.min.x+j*pcsz, rboard.min.y+i*pcsz), board[i][j]-16);
    score(0);
    if (suspended)
        draw(screen, screen->r, display->white, whitemask, ZP);
}
Beispiel #2
0
void map::draw(game *g, WINDOW* w)
{
    int t = 0;
    int light = g->u.sight_range(g->light_level());
    for  (int realx = g->u.posx - SEEX; realx <= g->u.posx + SEEX; realx++) {
        for (int realy = g->u.posy - SEEY; realy <= g->u.posy + SEEY; realy++) {
            if (rl_dist(g->u.posx, g->u.posy, realx, realy) > light) {
                if (g->u.has_disease(DI_BOOMERED))
                    mvwputch(w, realx+SEEX - g->u.posx, realy+SEEY - g->u.posy, c_magenta,'#');
                else
                    mvwputch(w, realx+SEEX - g->u.posx, realy+SEEY - g->u.posy, c_dkgray, '#');
            } else if (sees(g->u.posx, g->u.posy, realx, realy, light, t))
                drawsq(w, g->u, realx, realy, false, true);
        }
    }
    mvwputch(w, SEEY, SEEX, g->u.color(), '@');
}