Пример #1
0
void draw_walk(int state) 
{
    // obtain the lock so no other thread can interrupt us
    pend(draw_lock);

    int i;
    for (i = 0; i < 4; i++) 
    {
        goto_line(street_loc[1] + walk_loc[i][1] - 1, 
                  street_loc[0] + walk_loc[i][0] - 1); 
        set_light_color(state);
        printf("C");
    }

    reset_color();
    hide_cursor();

    // we're done, release the lock
    post(draw_lock);
}
Пример #2
0
void draw_lights(void) 
{
    // obtain the lock so no other thread can interrupt us
    pend(draw_lock);
   
    char light_arrows[6][6] = {
        "\u2193", // down
        "\u2191", // up
        "\u2192", // right
        "\u2191", // up
        "\u2193", // down
        "\u2190"  // left
    };

    int i = 0;
    for (i = 0; i < 6; i++) 
    {
        // goto light x,y
        goto_line(street_loc[1]+light_loc[i][1]-1, street_loc[0]+light_loc[i][0]-1); 
        
        if (manual_mode && i == selected_light) set_color_bold(BG_BLUE);

        // set it to proper color
        set_light_color(lights[i]); 

        // draw the arrow for this light
        printf(light_arrows[i]);

        reset_color();
    }

    reset_color();
    hide_cursor();

    // we're done, release the lock
    post(draw_lock);
}
Пример #3
0
Sconce::Sconce(UUID id) : Thing("sconce", id)
{
    set_light_color(sf::Color(160, 128, 112, 255));
    set_max_light_strength(48);
}