Changeset 1622
- Timestamp:
- Jul 10, 2012, 7:28:24 PM (11 years ago)
- Location:
- trunk/tools/neercs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/neercs.cpp
r1620 r1622 117 117 118 118 /* 119 ___ __ ______ ______ ______ ______ ______ 120 \ \| / ____Y ____Y __ \/ ___//___/121 / ` > ____ > ____>,_ < <____\___ \119 .___ __ ______ ______ ______ ______ ______, 120 \° \| /° __ \° __ \° __ \/° ___//° ___/ 121 / ` > ____/ ____/ ,_ < <____\___ \ 122 122 /__/\___\______\______\__| \__\_____________\ 123 123 */ 124 124 125 125 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 ,".___ __ ______ ______ ______ ______ ______,"); 127 127 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, " \\° \\| /° __ \\° __ \\° __ \\/° ___//° ___/"); 129 129 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, " / ` > ____/ ____/ ,_ < <____\\___ \\"); 131 131 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); 132 132 caca_put_str(m_caca, logo_x, logo_y + 3, "/__/\\___\\______\\______\\__| \\__\\_____________\\"); … … 136 136 caca_set_color_ansi(m_caca, 0x666, bg_color); 137 137 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); 138 139 caca_put_str(m_caca, w - 13, h - 2, "CACA RULEZ"); 139 140 } -
trunk/tools/neercs/video/postfx.lolfx
r1620 r1622 33 33 vec3 get_color(in sampler2D tex,in vec2 p) 34 34 { 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 */ 36 36 return texture2D(tex,clamp(p,-1.0,0.0)).xyz; 37 37 } … … 42 42 } 43 43 44 float round _square(in vec2 rect,in float r)44 float rounded_square(in vec2 rect,in float r) 45 45 { 46 46 vec2 b=rect-vec2(r); … … 53 53 vec2 rect=screen_size*0.49; 54 54 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); 56 56 return c*f; 57 57 } -
trunk/tools/neercs/video/render.cpp
r1606 r1622 81 81 float beat_value = 0; // value 82 82 float beat_speed = 2.0f; // speed 83 /* corner variable */84 const int corner_n = 10; // m_polygon number85 int corner_w = 24; // radius86 int corner_vtx[corner_n*6];// vertex array87 83 /* window variable */ 88 84 int window_m; // margin … … 91 87 ivec2 map_size(256,256); // texture map size 92 88 ivec2 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); 89 ivec2 text_size(80,25); // text size 90 ivec2 blit_top(0,0); // text blit top position 91 ivec2 blit_bottom(0,0); // text blit bottom position 94 92 int shell_vtx[8]; // vertex array 95 93 float shell_tex[] = {1.0f, 0.96875f, 1.0f, 1.0f, 0.78125f, 1.0f, 0.78125f, 0.96875f}; … … 170 168 glVertex2i(x+w, y+h); 171 169 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 }197 170 } 198 171 … … 263 236 { 264 237 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 284 262 InitDraw(); 285 263 return true; … … 407 385 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 408 386 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); 414 388 415 389 //if(m_polygon) glEnable(GL_LINE_SMOOTH); else glDisable(GL_LINE_SMOOTH); … … 461 435 glTexCoordPointer(2, GL_FLOAT, 0, shell_tex); 462 436 glDrawArrays(GL_QUADS, 0, 4); 463 // draw corner464 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);479 437 glEnable(GL_BLEND); 480 438 }
Note: See TracChangeset
for help on using the changeset viewer.