Changeset 1858
- Timestamp:
- Sep 2, 2012, 5:35:13 PM (8 years ago)
- Location:
- trunk/tools/neercs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/neercs.cpp
r1856 r1858 89 89 return EXIT_SUCCESS; 90 90 } 91 -
trunk/tools/neercs/term/term.cpp
r1856 r1858 95 95 int logo_y = h / 2 - 2; 96 96 97 caca_set_color_argb(m_caca, 0x 8ac, bg_color);97 caca_set_color_argb(m_caca, 0xbac, bg_color); 98 98 //caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 ), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 )), bg_color); 99 99 caca_put_str(m_caca, logo_x + 3, logo_y ,"__ _________ ______ ______ ______ ______"); … … 104 104 //caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * 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); 105 105 caca_put_str(m_caca, logo_x , logo_y + 3, "/__/\\__/\\_______________/ \\________________\\"); 106 caca_set_color_argb(m_caca, 0x def, bg_color);106 caca_set_color_argb(m_caca, 0x269, bg_color); 107 107 caca_put_str(m_caca, logo_x + 5, logo_y + 5, "ALL YOUR TERMINALS ARE BELONG TO US"); 108 108 109 caca_set_color_argb(m_caca, 0x 666, bg_color);109 caca_set_color_argb(m_caca, 0x777, bg_color); 110 110 caca_printf(m_caca, 2, h - 3, "W=%i", w); 111 111 caca_printf(m_caca, 2, h - 2, "H=%i", h); … … 126 126 int lolcube_y = h - 5 - abs ((h - 5) * lol::sin(m_time * 4)); 127 127 128 caca_set_color_argb(m_caca, hex_color(0. 75f + 0.25f * lol::sin(m_time * 2), 0.75f + 0.25f * lol::cos(m_time * 3), 0.75f + 0.25f * lol::sin(m_time * 5)), bg_color);128 caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::sin(m_time * 2), 0.5f + 0.5f * lol::cos(m_time * 3), 0.5f + 0.5f * lol::sin(m_time * 5)), bg_color); 129 129 caca_put_str(m_caca, lolcube_x + 2, lolcube_y , "_______"); 130 130 caca_put_str(m_caca, lolcube_x + 1, lolcube_y + 1, "/ /|"); … … 134 134 caca_put_str(m_caca, lolcube_x , lolcube_y + 5, "|______|/"); 135 135 136 caca_set_color_argb(m_caca, 0x def, bg_color);136 caca_set_color_argb(m_caca, 0x777, bg_color); 137 137 caca_put_str(m_caca, 0, 0, "rez@lol:~/ sudo -s"); 138 138 caca_put_str(m_caca, 0, 1, "[sudo] password for rez:"); … … 141 141 caca_put_str(m_caca, 0, 4, "root@lol:~/"); 142 142 } 143 -
trunk/tools/neercs/video/copper.lolfx
r1843 r1858 24 24 25 25 vec3 copper=vec3(0.5); 26 26 27 copper.x+=0.5*cos(p.y*float(screen_size.y/64)+time*2.0); 27 28 copper.z+=0.5*sin(p.y*float(screen_size.y/64)+time*2.0); 28 29 29 copper*=0.75+0.375*cos(p.y*float(screen_size. y/6)-time*2.0);30 copper*=0.75+0.375*cos(p.y*float(screen_size.x/8)-time*2.0); 30 31 31 /*32 32 copper.x=float(int(copper.x*8.0)*32)/256.0; 33 33 copper.y=float(int(copper.y*8.0)*32)/256.0; 34 34 copper.z=float(int(copper.z*8.0)*32)/256.0; 35 */36 35 37 gl_FragColor=vec4(( dot(color,color)==1.0)?copper:color,1.0);36 gl_FragColor=vec4((color==1.0)?copper:color,1.0); 38 37 } -
trunk/tools/neercs/video/render.cpp
r1837 r1858 120 120 /* setup variable */ 121 121 bool setup_switch = false; // switch [option/item] 122 int setup_option = 0; // selected option 122 int setup_n = 0; // item/option number 123 int setup_h = 6; // height 124 int setup_cursor = 0; // cursor position 125 int setup_option_i = 0; // selected option 123 126 int setup_option_n = 10; // option number 124 int setup_item = 0; // selected item 127 int setup_option_p = 0; // option position 128 int setup_item_i = 0; // selected item 125 129 int setup_item_n = 8; // item number 130 int setup_item_p = 0; // item position 126 131 int setup_item_key = 0; // item array key 127 int setup_n = 0; // contextual option/item number128 132 ivec2 setup_p(1,1); // position [x,y] 129 ivec3 setup_size(30, 0,12); // size [w,h,split]133 ivec3 setup_size(30,7,12); // size [w,h,split] 130 134 ivec2 setup_color(0x678,0x234); // color [foreground,background] 131 135 char const *setup_text[] = { … … 360 364 for (int i = 0; i < n; i++) 361 365 { 362 int k = !setup_switch ? (i * (setup_item_n + 1)) : (setup_option * (setup_item_n + 1) + 1 + i);366 int k = !setup_switch ? (i * (setup_item_n + 1)) : (setup_option_i * (setup_item_n + 1) + 1 + i); 363 367 if (setup_text[k] == "") return i - 1; 364 368 } … … 531 535 caca_set_canvas_size(m_caca, canvas_char.x, canvas_char.y); 532 536 533 setup_size.y = ((setup_option_n > setup_item_n) ? setup_option_n : setup_item_n) + 1;534 537 setup_p = (canvas_char - setup_size.xy) / 2; 535 536 538 setup_n = calc_item_length(); 537 539 … … 601 603 if (!setup_switch) 602 604 { 603 setup_option--; 604 if (setup_option < 0) setup_option = setup_n; 605 setup_item = 0; 605 if (setup_cursor > 0) 606 { 607 setup_cursor--; 608 } 609 else 610 { 611 if ((setup_option_p > 0) && setup_cursor == 0) setup_option_p--; 612 } 613 if (setup_option_i > 0) 614 { 615 setup_option_i--; 616 } 617 else 618 { 619 setup_option_i = setup_option_n - 1; 620 setup_option_p = setup_option_n - setup_h; 621 setup_cursor = setup_h - 1; 622 } 623 setup_item_i = 0; 606 624 } 607 625 else 608 626 { 609 setup_item --;610 if (setup_item < 0) setup_item= setup_n;627 setup_item_i--; 628 if (setup_item_i < 0) setup_item_i = setup_n; 611 629 } 612 630 } … … 618 636 if (!setup_switch) 619 637 { 620 setup_option++; 621 if (setup_option > setup_n) setup_option = 0; 622 setup_item = 0; 638 if (setup_cursor < setup_h - 1) 639 { 640 setup_cursor++; 641 } 642 else 643 { 644 if ((setup_option_p + setup_h < setup_option_n) && setup_cursor == setup_h - 1) setup_option_p++; 645 } 646 if (setup_option_i < setup_option_n - 1) 647 { 648 setup_option_i++; 649 } 650 else 651 { 652 setup_option_i = 0; 653 setup_option_p = 0; 654 setup_cursor = 0; 655 } 656 setup_item_i = 0; 623 657 } 624 658 else 625 659 { 626 setup_item ++;627 if (setup_item > setup_n) setup_item= 0;660 setup_item_i++; 661 if (setup_item_i > setup_n) setup_item_i = 0; 628 662 } 629 663 } … … 635 669 if (!setup_switch) 636 670 { 637 setup_option = 0; 671 setup_option_i -= setup_cursor; 672 setup_cursor = 0; 673 setup_item_i = 0; 638 674 } 639 675 else 640 676 { 641 setup_item = 0;642 677 } 643 678 } … … 649 684 if (!setup_switch) 650 685 { 651 setup_option = setup_n; 652 setup_item = 0; 686 setup_option_i += setup_h - setup_cursor - 1; 687 setup_cursor = setup_h - 1; 688 setup_item_i = 0; 653 689 } 654 690 else 655 691 { 656 setup_item = setup_n;692 setup_item_i = setup_n; 657 693 } 658 694 } … … 765 801 caca_put_str(m_caca, setup_p.x + setup_size.x / 2 - 3, setup_p.y, "SETUP"); 766 802 /* display option */ 767 for (int i = 0; i < setup_ option_n; i++)803 for (int i = 0; i < setup_h; i++) 768 804 { 769 805 int y = setup_p.y + 1 + i; 770 int k = i* (setup_item_n + 1);771 if (setup_option !=i || setup_switch)806 int k = (setup_option_p + i) * (setup_item_n + 1); 807 if (setup_option_i != setup_option_p + i || setup_switch) 772 808 { 773 809 caca_set_color_argb(m_caca, setup_color.x, setup_color.y); … … 782 818 } 783 819 /* display item */ 784 for (int i = 0; i < setup_ item_n; i++)820 for (int i = 0; i < setup_h; i++) 785 821 { 786 822 int y = setup_p.y + 1 + i; 787 int k = setup_option * (setup_item_n + 1) + 1+ i;788 if (setup_item != i || !setup_switch)823 int k = setup_option_i * (setup_item_n + 1) + 1 + setup_item_p + i; 824 if (setup_item_i != i || !setup_switch) 789 825 { 790 826 caca_set_color_argb(m_caca, setup_color.x, setup_color.y); … … 800 836 /* display variable */ 801 837 int y = setup_p.y + setup_size.y; 802 setup_item_key = setup_option * (setup_item_n + 1) + 1 + setup_item;838 setup_item_key = setup_option_i * (setup_item_n + 1) + 1 + setup_item_i; 803 839 caca_set_color_argb(m_caca, setup_color.y, setup_color.x); 804 840 caca_draw_line(m_caca, setup_p.x, y, setup_p.x + setup_size.x, y,' ');
Note: See TracChangeset
for help on using the changeset viewer.