Ignore:
Timestamp:
Jul 17, 2012, 12:54:18 AM (10 years ago)
Author:
rez
Message:

glsl letterbox and round corner & some new fancy animation!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/neercs.cpp

    r1629 r1634  
    7272    caca_clear_canvas(m_caca);
    7373
     74    caca_set_color_argb(m_caca, 0x234, bg_color);
     75    for(int i = 0; i < h; i++)
     76    {
     77        float a = M_PI / 180 * i * 16 + m_time * 4;
     78        float b = M_PI / 180 * i * 12;
     79        int x = w / 2  - 15 + h / 3 * lol::cos(a) + h / 4 * lol::sin(b);
     80        caca_put_str(m_caca, x, i, "LOL WUT! NEERCS SI TEH RULEZ!");
     81    }
     82
    7483    caca_set_color_argb(m_caca, 0x444, bg_color);
    75 
    76     int n = 16;
    77     int radius = 48;
    78     int speed = 1;
    79     int z = 1;
    80 
    81     for(int i = 0; i < n; i++)
     84    for(int i = 0; i < w; i++)
    8285    {
    83         //z -= speed;
    84         int r = (radius - i * 4) / z;
    85         int x1 = w / 2 + r * lol::cos(m_time * 2 - M_PI / 20);
    86         int y1 = h / 2 + r * lol::sin(m_time * 2 - M_PI / 20);
    87         int x2 = w / 2 + r * lol::cos(m_time * 2 + M_PI * 2 / 3 - M_PI / 20);
    88         int y2 = h / 2 + r * lol::sin(m_time * 2 + M_PI * 2 / 3 - M_PI / 20);
    89         int x3 = w / 2 + r * lol::cos(m_time * 2 + M_PI * 2 / 3 * 2 - M_PI / 20);
    90         int y3 = h / 2 + r * lol::sin(m_time * 2 + M_PI * 2 / 3 * 2 - M_PI / 20);
    91         caca_set_color_argb(m_caca, 0x642, bg_color);
    92         caca_draw_thin_line(m_caca, x1, y1, x2, y2);
    93         caca_draw_thin_line(m_caca, x2, y2, x3, y3);
    94         caca_draw_thin_line(m_caca, x3, y3, x1, y1);
     86        float a = m_time * 1 + M_PI / 180 * i * 8;
     87        float b = m_time * -2 + M_PI / 180 * i * 5;
     88        int y = h / 2 + h / 4 * lol::cos(a) + h / 4 * lol::sin(b);
     89        caca_draw_line(m_caca, i, y - 1, i, y + 1,'%');
    9590    }
    9691
     
    9893.___  __ ______ ______ ______  ______ ______,
    9994 \° \|  /° __  \° __  \° __  \/° ___//° ___/
    100  /   `  >  ____/  ____/  ,_  <  <____\___  \
    101 /__/\___\______\______\__| \__\_____________\
     95 /   `  >  ____/  ____/  ,_  <_ <____\___  \
     96/__/\___\______\______\__| \__/_____________\
    10297*/
    10398
    104     int logo_x = (w - 46) / 2;
     99    int logo_x = (w - 45) / 2;
    105100    int logo_y = h / 2 - 2;
    106101
    107     caca_set_color_argb(m_caca, hex_color(0.5f + 0.25f * lol::cos(m_time * 3               ),0.5f,0.5f + 0.25f * lol::sin(m_time * 3               )), bg_color);
     102    caca_set_color_argb(m_caca, hex_color(0.5f + 0.375f * lol::cos(m_time * 3               ),0.5f,0.5f + 0.25f * lol::sin(m_time * 3               )), bg_color);
    108103    caca_put_str(m_caca, logo_x, logo_y    ,".___  __ ______ ______ ______  ______ ______,");
    109     caca_set_color_argb(m_caca, hex_color(0.5f + 0.25f * lol::cos(m_time * 3 + M_PI / 4 * 1),0.5f,0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 1)), bg_color);
     104    caca_set_color_argb(m_caca, hex_color(0.5f + 0.375f * lol::cos(m_time * 3 + M_PI / 4 * 1),0.5f,0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 1)), bg_color);
    110105    caca_put_str(m_caca, logo_x, logo_y + 1, " \\° \\|  /° __  \\° __  \\° __  \\/° ___//° ___/");
    111     caca_set_color_argb(m_caca, hex_color(0.5f + 0.25f * lol::cos(m_time * 3 + M_PI / 4 * 2),0.5f,0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 2)), bg_color);
    112     caca_put_str(m_caca, logo_x, logo_y + 2, " /   `  >  ____/  ____/  ,_  <  <____\\___  \\");
    113     caca_set_color_argb(m_caca, hex_color(0.5f + 0.25f * lol::cos(m_time * 3 + M_PI / 4 * 3),0.5f,0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 3)), bg_color);
    114     caca_put_str(m_caca, logo_x, logo_y + 3, "/__/\\___\\______\\______\\__| \\__\\_____________\\");
     106    caca_set_color_argb(m_caca, hex_color(0.5f + 0.375f * lol::cos(m_time * 3 + M_PI / 4 * 2),0.5f,0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 2)), bg_color);
     107    caca_put_str(m_caca, logo_x, logo_y + 2, " /   `  >  ____/  ____/  ,_  <_ <____\\___  \\");
     108    caca_set_color_argb(m_caca, hex_color(0.5f + 0.375f * lol::cos(m_time * 3 + M_PI / 4 * 3),0.5f,0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 3)), bg_color);
     109    caca_put_str(m_caca, logo_x, logo_y + 3, "/__/\\___\\______\\______\\__| \\__/_____________\\");
    115110    caca_set_color_argb(m_caca, 0xdef, bg_color);
    116111    caca_put_str(m_caca, logo_x + 5, logo_y + 5, "ALL YOUR TERMINALS ARE BELONG TO US");
    117112
    118     caca_set_color_ansi(m_caca, 0x666, bg_color);
    119     caca_printf(m_caca, 1, h - 2, "W=%i H=%i", w, h);
    120     //caca_printf(m_caca, 1, h - 2, "2d ratio=%i*%i", ratio_2d.x, ratio_2d.y);
    121     caca_put_str(m_caca, w - 11, h - 2, "CACA RULEZ");
     113    caca_set_color_argb(m_caca, 0x666, bg_color);
     114    caca_put_str(m_caca, w - 10, h - 1, "CACA RULEZ");
     115    caca_printf(m_caca, 0, h - 2, "W=%i", w);
     116    caca_printf(m_caca, 0, h - 1, "H=%i", h);
    122117}
    123118
Note: See TracChangeset for help on using the changeset viewer.