Changeset 1460


Ignore:
Timestamp:
Jun 12, 2012, 1:03:41 PM (8 years ago)
Author:
sam
Message:

neercs: remove a few extraneous variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/neercs/video/render.cpp

    r1459 r1460  
    4646
    4747bool done = false;
    48 
    49 Timer *timer;
    5048
    5149//char *param=GetCommandLine();
     
    6765ivec2 screen_size;         // screen size
    6866int window_color = 32;     // color depth
    69 float screen_r;            // color red
    70 float screen_g;            // color green
    71 float screen_b;            // color blue
     67vec3 screen_color;         // screen color
    7268/* object variable */
    7369float main_angle;          // main angle
     
    8480int liner_count;           // counter
    8581/* text variable */
    86 char *name = "cacaShell";
     82char const *name = "cacaShell";
    8783std::string txt("");
    8884/* fs_quad variable */
     
    125121int dos_h;                 // height
    126122int dos_m;                 // margin
    127 float dos_r;               // red value
    128 float dos_g;               // green value
    129 float dos_b;               // blue value
     123vec3 dos_color;            // color value
    130124int dos_vtx[8];            // vertex array
    131125int shell_vtx[8];          // vertex array
     
    292286    part_angle = main_angle;
    293287    dos_flag = true;
    294     dos_r = CR*48;
    295     dos_g = CR*56;
    296     dos_b = CR*64;
    297     screen_r = dos_r;
    298     screen_g = dos_g;
    299     screen_b = dos_b;
     288    dos_color = CR * vec3(48, 56, 64);
     289    screen_color = dos_color;
    300290    txt = "\rCopyright \x05e 2012 cacaShell v0.1\r ";
    301291    calc_txt();
     
    320310    beat_speed = 2.0f;
    321311    /*-------------------------*/
    322     glClearColor(screen_r, screen_g, screen_b, 1.0f);
     312    glClearColor(screen_color.r, screen_color.g, screen_color.b, 1.0f);
    323313}
    324314
     
    334324    tex_map = new TileSet("neercs/video/resource/map.png", ivec2(256, 256), ivec2(1));
    335325    // initialize some variable
    336     timer = new Timer();
    337326    screen();
    338327    /*-PATACODE----------------------------------------------------------------*/
     
    395384}
    396385
    397 int CreateGLWindow(char* title)
     386int CreateGLWindow(char const *title)
    398387{
    399388    screen_size = Video::GetSize();
     
    458447    // timer
    459448    if(!pause)
    460         main_angle += timer->Get() * 100.0f * PID;
     449        main_angle += seconds * 100.0f * PID;
    461450    if(sync_flag)
    462451    {
     
    504493    {
    505494        fbo_back->Bind();
    506         fbo_back->Clear(vec4(screen_r, screen_g, screen_b, 0.0f), 1.0f);
     495        fbo_back->Clear(vec4(screen_color, 0.0f), 1.0f);
    507496    }
    508497    else
     
    538527        rectangle(screen_size.x-1*ratio_2d-dos_m, dos_m+10*ratio_2d, 1*ratio_2d, screen_size.y-10*ratio_2d-dos_m*2);
    539528        rectangle(dos_m+1*ratio_2d, screen_size.y-1*ratio_2d-dos_m, screen_size.x-2*ratio_2d-dos_m*2, 1*ratio_2d);
    540         glColor3f(dos_r, dos_g, dos_b);
     529        glColor3f(dos_color.r, dos_color.g, dos_color.b);
    541530        rectangle(dos_m+1*ratio_2d, dos_m+1*ratio_2d, 28*ratio_2d, 8*ratio_2d);
    542531        rectangle(dos_m+(int)(30.5f*ratio_2d), dos_m+2*ratio_2d, screen_size.x-(int)(58.5f*ratio_2d)-dos_m*2, 2*ratio_2d);
     
    548537        rectangle(screen_size.x-(int)(22.5f*ratio_2d)-dos_m, dos_m+3*ratio_2d, 7*ratio_2d, 6*ratio_2d);
    549538        rectangle(screen_size.x-(int)(12.5f*ratio_2d)-dos_m, dos_m+1*ratio_2d, 7*ratio_2d, 6*ratio_2d);
    550         glColor3f(dos_r, dos_g, dos_b);
     539        glColor3f(dos_color.r, dos_color.g, dos_color.b);
    551540        rectangle(screen_size.x-(int)(10.5f*ratio_2d)-dos_m, dos_m+2*ratio_2d, 7*ratio_2d, 7*ratio_2d);
    552541        glColor3f(1.0f, 1.0f, 1.0f);
    553542        rectangle(screen_size.x-(int)(9.5f*ratio_2d)-dos_m, dos_m+3*ratio_2d, 5*ratio_2d, 5*ratio_2d);
    554543        rectangle(screen_size.x-8*ratio_2d-dos_m, screen_size.y-9*ratio_2d-dos_m, 7*ratio_2d, 8*ratio_2d);
    555         glColor3f(dos_r, dos_g, dos_b);
     544        glColor3f(dos_color.r, dos_color.g, dos_color.b);
    556545        rectangle(screen_size.x-7*ratio_2d-dos_m, screen_size.y-8*ratio_2d-dos_m, 6*ratio_2d, 7*ratio_2d);
    557546        glColor3f(1.0f, 1.0f, 1.0f);
     
    583572                float dos_tex[]={l_w+0.03125f, 0.5f-l_h-0.03125f, l_w+0.03125f, 0.5f-l_h, l_w, 0.5f-l_h, l_w, 0.5f-l_h-0.03125f};
    584573                glTexCoordPointer(2, GL_FLOAT, 0, dos_tex);
    585                 if(car==car_cursor) glColor3f(CR*(dos_r+64), CR*(dos_g+48), CR*(dos_b+48));
     574                if(car==car_cursor) glColor3f(CR*(dos_color.r+64), CR*(dos_color.g+48), CR*(dos_color.b+48));
    586575                glDrawArrays(GL_QUADS, 0, 4);
    587576                if(car==car_cursor) glColor3f(1.0f, 1.0f, 1.0f);
Note: See TracChangeset for help on using the changeset viewer.