Changeset 1629


Ignore:
Timestamp:
Jul 13, 2012, 1:36:43 AM (8 years ago)
Author:
rez
Message:

testing things...

Location:
trunk/tools/neercs
Files:
2 edited

Legend:

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

    r1628 r1629  
    3333
    3434#include <time.h>
    35 
    3635#include <caca.h>
    3736
     
    7574    caca_set_color_argb(m_caca, 0x444, bg_color);
    7675
    77     int n1 = 8;
    78     int n2 = 6;//w / n1 * h;
     76    int n = 16;
     77    int radius = 48;
     78    int speed = 1;
     79    int z = 1;
    7980
    80     for(int i = 0; i < n1; i++)
     81    for(int i = 0; i < n; i++)
    8182    {
    82         for(int j = 0; j < n2; j++)
    83         {
    84             int p_x = i * w / n1 + w / (n1 * 2);
    85             int p_y = j * h / n2 + h / (n2 * 2);
    86             int r_w = w / (n1 * 2) + w / (n1 * 4) * lol::cos(m_time * 3 + M_PI / n1 * i) + h / (n2 * 4) * lol::sin(m_time * 2 + M_PI / n2 * j);
    87             caca_fill_ellipse(m_caca, p_x, p_y, r_w, r_w, '%');
    88         }
     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);
    8995    }
    90 
    91     int radius = 12;
    92 
    93     int x1 = w / 2 + radius * lol::cos(m_time * 2 - M_PI / 20);
    94     int y1 = h / 2 + radius * lol::sin(m_time * 2 - M_PI / 20);
    95     int x2 = w / 2 + radius * lol::cos(m_time * 2 + M_PI * 2 / 3 - M_PI / 20);
    96     int y2 = h / 2 + radius * lol::sin(m_time * 2 + M_PI * 2 / 3 - M_PI / 20);
    97     int x3 = w / 2 + radius * lol::cos(m_time * 2 + M_PI * 2 / 3 * 2 - M_PI / 20);
    98     int y3 = h / 2 + radius * lol::sin(m_time * 2 + M_PI * 2 / 3 * 2 - M_PI / 20);
    99     caca_set_color_argb(m_caca, 0x642, bg_color);
    100     caca_draw_thin_line(m_caca, x1, y1, x2, y2);
    101     caca_draw_thin_line(m_caca, x2, y2, x3, y3);
    102     caca_draw_thin_line(m_caca, x3, y3, x1, y1);
    103 
    104     x1 = w / 2 + radius * lol::cos(m_time * 2);
    105     y1 = h / 2 + radius * lol::sin(m_time * 2);
    106     x2 = w / 2 + radius * lol::cos(m_time * 2 + M_PI * 2 / 3);
    107     y2 = h / 2 + radius * lol::sin(m_time * 2 + M_PI * 2 / 3);
    108     x3 = w / 2 + radius * lol::cos(m_time * 2 + M_PI * 2 / 3 * 2);
    109     y3 = h / 2 + radius * lol::sin(m_time * 2 + M_PI * 2 / 3 * 2);
    110     caca_set_color_argb(m_caca, 0xea6, bg_color);
    111     caca_draw_thin_line(m_caca, x1, y1, x2, y2);
    112     caca_draw_thin_line(m_caca, x2, y2, x3, y3);
    113     caca_draw_thin_line(m_caca, x3, y3, x1, y1);
    114 
    115     int logo_x = (w - 46) / 2;
    116     int logo_y = h / 2 - 2;
    11796
    11897/*
     
    122101/__/\___\______\______\__| \__\_____________\
    123102*/
     103
     104    int logo_x = (w - 46) / 2;
     105    int logo_y = h / 2 - 2;
    124106
    125107    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);
  • trunk/tools/neercs/video/render.cpp

    r1628 r1629  
    230230{
    231231    screen_size = Video::GetSize();
    232     border = 12 * ratio_2d;
     232    border = 10 * ratio_2d;
     233    border.y = border.x; // enabled to get same border everywhere
    233234    canvas_char = (screen_size - border * 2) / (font_size * ratio_2d);
    234     canvas_size = canvas_char * font_size * ratio_2d.x;
     235    canvas_size = canvas_char * font_size * ratio_2d;
    235236
    236237    border = (screen_size - canvas_size) / 2;
Note: See TracChangeset for help on using the changeset viewer.