Changeset 1622


Ignore:
Timestamp:
Jul 10, 2012, 7:28:24 PM (8 years ago)
Author:
rez
Message:

updated logo (again) + better text canvas size (unfinished)

Location:
trunk/tools/neercs
Files:
3 edited

Legend:

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

    r1620 r1622  
    117117
    118118/*
    119  ___  __ ______ ______ ______  ______ ______
    120  \  \|  /  ____Y  ____Y  __  \/  ___// ___/
    121  /   `  >  ____>  ____>  ,_  <  <____\___  \
     119.___  __ ______ ______ ______  ______ ______,
     120 \° \|  /° __  \° __  \° __  \/° ___//° ___/
     121 /   `  >  ____/  ____/  ,_  <  <____\___  \
    122122/__/\___\______\______\__| \__\_____________\
    123123*/
    124124
    125125    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);
    126     caca_put_str(m_caca, logo_x, logo_y    ," ___  __ ______ ______ ______  ______ ______");
     126    caca_put_str(m_caca, logo_x, logo_y    ,".___  __ ______ ______ ______  ______ ______,");
    127127    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);
    128     caca_put_str(m_caca, logo_x, logo_y + 1, " \\  \\|  /  ____Y  ____Y  __  \\/  ___// ___/");
     128    caca_put_str(m_caca, logo_x, logo_y + 1, " \\° \\|  /° __  \\° __  \\° __  \\/° ___//° ___/");
    129129    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);
    130     caca_put_str(m_caca, logo_x, logo_y + 2, " /   `  >  ____>  ____>  ,_  <  <____\\___  \\");
     130    caca_put_str(m_caca, logo_x, logo_y + 2, " /   `  >  ____/  ____/  ,_  <  <____\\___  \\");
    131131    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);
    132132    caca_put_str(m_caca, logo_x, logo_y + 3, "/__/\\___\\______\\______\\__| \\__\\_____________\\");
     
    136136    caca_set_color_ansi(m_caca, 0x666, bg_color);
    137137    caca_printf(m_caca, 1, h - 2, "W=%i H=%i", w, h);
     138    //caca_printf(m_caca, 1, h - 2, "2d ratio=%i*%i", ratio_2d.x, ratio_2d.y);
    138139    caca_put_str(m_caca, w - 13, h - 2, "CACA RULEZ");
    139140}
  • trunk/tools/neercs/video/postfx.lolfx

    r1620 r1622  
    3333vec3 get_color(in sampler2D tex,in vec2 p)
    3434        {
    35         //return (p.x<-1.0||p.x>0.0||p.y<-1.0||p.y>0.0)?vec3(0.0,0.0,0.0):texture2D(tex,p).xyz;
     35        //return (p.x<-1.0||p.x>0.0||p.y<-1.0||p.y>0.0)?vec3(0.0,0.0,0.0):texture2D(tex,p).xyz; /* old code */
    3636        return texture2D(tex,clamp(p,-1.0,0.0)).xyz;
    3737        }
     
    4242        }
    4343
    44 float round_square(in vec2 rect,in float r)
     44float rounded_square(in vec2 rect,in float r)
    4545        {
    4646        vec2 b=rect-vec2(r);
     
    5353        vec2 rect=screen_size*0.49;
    5454        float r=screen_size.x*0.1;
    55         float f=1.0-clamp(round_square(rect,r),0.0,1.0);
     55        float f=1.0-clamp(rounded_square(rect,r),0.0,1.0);
    5656        return c*f;
    5757        }
  • trunk/tools/neercs/video/render.cpp

    r1606 r1622  
    8181float beat_value = 0;      // value
    8282float beat_speed = 2.0f;   // speed
    83 /* corner variable */
    84 const int corner_n = 10;   // m_polygon number
    85 int corner_w = 24;         // radius
    86 int corner_vtx[corner_n*6];// vertex array
    8783/* window variable */
    8884int window_m;              // margin
     
    9187ivec2 map_size(256,256);   // texture map size
    9288ivec2 font_size(8,8);      // font size
    93 vec2 car_size(1.0f/map_size.x*font_size.x, 1.0f/map_size.y*font_size.y);
     89ivec2 text_size(80,25);    // text size
     90ivec2 blit_top(0,0);       // text blit top position
     91ivec2 blit_bottom(0,0);    // text blit bottom position
    9492int shell_vtx[8];          // vertex array
    9593float shell_tex[] = {1.0f, 0.96875f, 1.0f, 1.0f, 0.78125f, 1.0f, 0.78125f, 0.96875f};
     
    170168        glVertex2i(x+w, y+h);
    171169    glEnd();
    172 }
    173 
    174 void corner()
    175 {
    176     float vertex[6+corner_n*2];
    177     vertex[0] = 0;
    178     vertex[1] = 0;
    179     for (int i = 1; i < corner_n + 1; i++)
    180     {
    181         int j = i*2;
    182         float a = PID*90.0f/(corner_n-1)*(i-1);
    183         vertex[j  ] = corner_w-corner_w*cosf(a);
    184         vertex[j+1] = corner_w-corner_w*sinf(a);
    185     }
    186     for (int i = 0; i < corner_n; i++)
    187     {
    188         int j = i*6;
    189         int k = i*2;
    190         corner_vtx[j  ] = (int)vertex[0];
    191         corner_vtx[j+1] = (int)vertex[1];
    192         corner_vtx[j+2] = (int)vertex[2+k];
    193         corner_vtx[j+3] = (int)vertex[3+k];
    194         corner_vtx[j+4] = (int)vertex[4+k];
    195         corner_vtx[j+5] = (int)vertex[5+k];
    196     }
    197170}
    198171
     
    263236{
    264237    screen_size = Video::GetSize();
    265     corner_w = 16*ratio_2d.x;
    266     corner();
    267     window_m=12*ratio_2d.x;
    268     window_vtx[0]=font_size.x*ratio_2d.x/2.0f;
    269     window_vtx[1]=font_size.y*ratio_2d.y/2.0f;
    270     window_vtx[2]=font_size.x*ratio_2d.x/2.0f;
    271     window_vtx[3]=-font_size.y*ratio_2d.y/2.0f;
    272     window_vtx[4]=-font_size.x*ratio_2d.x/2.0f;
    273     window_vtx[5]=-font_size.y*ratio_2d.y/2.0f;
    274     window_vtx[6]=-font_size.x*ratio_2d.x/2.0f;
    275     window_vtx[7]=font_size.y*ratio_2d.y/2.0f;
    276     shell_vtx[0]=window_m+58*ratio_2d.x;
    277     shell_vtx[1]=window_m+(font_size.y+1)*ratio_2d.y;
    278     shell_vtx[2]=window_m+58*ratio_2d.x;
    279     shell_vtx[3]=window_m+ratio_2d.y;
    280     shell_vtx[4]=window_m+2*ratio_2d.x;
    281     shell_vtx[5]=window_m+ratio_2d.y;
    282     shell_vtx[6]=window_m+2*ratio_2d.x;
    283     shell_vtx[7]=window_m+(font_size.y+1)*ratio_2d.y;
     238
     239    window_m = 12 * ratio_2d.x;
     240    window_vtx[0] = font_size.x * ratio_2d.x / 2.0f;
     241    window_vtx[1] = font_size.y * ratio_2d.y / 2.0f;
     242    window_vtx[2] = font_size.x * ratio_2d.x / 2.0f;
     243    window_vtx[3] = -font_size.y * ratio_2d.y / 2.0f;
     244    window_vtx[4] = -font_size.x * ratio_2d.x / 2.0f;
     245    window_vtx[5] = -font_size.y * ratio_2d.y / 2.0f;
     246    window_vtx[6] = -font_size.x * ratio_2d.x / 2.0f;
     247    window_vtx[7] = font_size.y * ratio_2d.y / 2.0f;
     248    shell_vtx[0] = window_m + 58 * ratio_2d.x;
     249    shell_vtx[1] = window_m + (font_size.y + 1) * ratio_2d.y;
     250    shell_vtx[2] = window_m + 58 * ratio_2d.x;
     251    shell_vtx[3] = window_m + ratio_2d.y;
     252    shell_vtx[4] = window_m + 2 * ratio_2d.x;
     253    shell_vtx[5] = window_m + ratio_2d.y;
     254    shell_vtx[6] = window_m + 2 * ratio_2d.x;
     255    shell_vtx[7] = window_m + (font_size.y + 1) * ratio_2d.y;
     256
     257    blit_top = ivec2(window_m, window_m + font_size.y * ratio_2d.y) + ratio_2d * 2;
     258    blit_bottom = screen_size - ivec2(window_m * 2, window_m * 2 + font_size.y * ratio_2d.y) + ratio_2d * 2;
     259
     260    //caca_set_canvas_size(m_caca,20,10);
     261
    284262    InitDraw();
    285263    return true;
     
    407385    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    408386
    409     ivec2 border_top = ivec2(window_m, window_m + font_size.y * ratio_2d.y)
    410                      + ratio_2d * 2;
    411     ivec2 border_bottom = ivec2(window_m * 2, window_m * 2 + font_size.y * ratio_2d.y)
    412                         + ratio_2d * 2;
    413     text_render->Blit(border_top, screen_size - border_bottom);
     387    text_render->Blit(blit_top, blit_bottom);
    414388
    415389    //if(m_polygon) glEnable(GL_LINE_SMOOTH); else glDisable(GL_LINE_SMOOTH);
     
    461435    glTexCoordPointer(2, GL_FLOAT, 0, shell_tex);
    462436    glDrawArrays(GL_QUADS, 0, 4);
    463     // draw corner
    464     glDisable(GL_TEXTURE_2D);
    465     glDisable(GL_BLEND);
    466     glVertexPointer(2, GL_INT, 0, corner_vtx);
    467     glLoadIdentity();
    468     glColor3f(1.0f, 1.0f, 1.0f);
    469     glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
    470     glTranslated(screen_size.x, 0, 0);
    471     glRotated(90.0f, 0, 0, 1.0f);
    472     glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
    473     glTranslated(screen_size.y, 0, 0);
    474     glRotated(90.0f, 0, 0, 1.0f);
    475     glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
    476     glTranslated(screen_size.x, 0, 0);
    477     glRotated(90.0f, 0, 0, 1.0f);
    478     glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
    479437    glEnable(GL_BLEND);
    480438}
Note: See TracChangeset for help on using the changeset viewer.