Changeset 1512
- Timestamp:
- Jun 23, 2012, 11:13:45 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/neercs/Makefile.am
r1505 r1512 18 18 neercs_DEPENDENCIES = $(top_builddir)/src/liblol.a 19 19 20 if USE_CACA 20 21 all-local: neercs$(EXEEXT) 21 22 test $(MAKE_FSELF) = no || make_fself neercs$(EXEEXT) neercs.self 23 endif 22 24 23 25 CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ -
trunk/orbital/Lolnament.h
r1510 r1512 2 2 // Orbital 3 3 // 4 // Copyright: (c) 012 Benjamin Huet <huet.benjamin@gmail.com>4 // Copyright: (c) 2012 Benjamin Huet <huet.benjamin@gmail.com> 5 5 // (c) 2012 Sam Hocevar <sam@hocevar.net> 6 6 // … … 246 246 { 247 247 vec3 point_diff = m_point_list[i].m_base_pos - m_influence_point_list[j].m_position; 248 point_diff = vec3( abs(point_diff.x), abs(point_diff.y),abs(point_diff.z));248 point_diff = vec3(std::abs(point_diff.x), std::abs(point_diff.y), std::abs(point_diff.z)); 249 249 250 250 new_blend = min(1.0f - min(1.0f, max(0.0f, point_diff.z - DEF_INF_MAX) / DEF_INF_BLEND), -
trunk/orbital/generated/gun-scanner.cpp
r1425 r1512 453 453 #endif 454 454 455 #include <cstdlib> 456 using std::exit; 457 using std::malloc; 458 using std::realloc; 459 using std::free; 460 455 461 #include "core.h" 456 462 #include "loldebug.h" … … 472 478 #define YY_NO_UNISTD_H 473 479 #define YY_USER_ACTION yylloc->columns(yyleng); 474 #line 4 75"generated/gun-scanner.cpp"480 #line 481 "generated/gun-scanner.cpp" 475 481 476 482 #define INITIAL 0 … … 577 583 register int yy_act; 578 584 579 #line 38"gun-scanner.l"585 #line 44 "gun-scanner.l" 580 586 581 587 … … 585 591 586 592 587 #line 5 88"generated/gun-scanner.cpp"593 #line 594 "generated/gun-scanner.cpp" 588 594 589 595 if ( !(yy_init) ) … … 666 672 case 1: 667 673 YY_RULE_SETUP 668 #line 45"gun-scanner.l"674 #line 51 "gun-scanner.l" 669 675 { return token::T_AI; } 670 676 YY_BREAK 671 677 case 2: 672 678 YY_RULE_SETUP 673 #line 46"gun-scanner.l"679 #line 52 "gun-scanner.l" 674 680 { return token::T_PAI; } 675 681 YY_BREAK 676 682 case 3: 677 683 YY_RULE_SETUP 678 #line 47"gun-scanner.l"684 #line 53 "gun-scanner.l" 679 685 { return token::T_CA; } 680 686 YY_BREAK 681 687 case 4: 682 688 YY_RULE_SETUP 683 #line 48"gun-scanner.l"689 #line 54 "gun-scanner.l" 684 690 { return token::T_SA; } 685 691 YY_BREAK 686 692 case 5: 687 693 YY_RULE_SETUP 688 #line 49"gun-scanner.l"694 #line 55 "gun-scanner.l" 689 695 { return token::T_TIM; } 690 696 YY_BREAK 691 697 case 6: 692 698 YY_RULE_SETUP 693 #line 5 0"gun-scanner.l"699 #line 56 "gun-scanner.l" 694 700 { return token::T_SO; } 695 701 YY_BREAK 696 702 case 7: 697 703 YY_RULE_SETUP 698 #line 5 1"gun-scanner.l"704 #line 57 "gun-scanner.l" 699 705 { return token::T_RD; } 700 706 YY_BREAK 701 707 case 8: 702 708 YY_RULE_SETUP 703 #line 5 2"gun-scanner.l"709 #line 58 "gun-scanner.l" 704 710 { return token::T_SPD; } 705 711 YY_BREAK 706 712 case 9: 707 713 YY_RULE_SETUP 708 #line 5 3"gun-scanner.l"714 #line 59 "gun-scanner.l" 709 715 { return token::T_MODA; } 710 716 YY_BREAK 711 717 case 10: 712 718 YY_RULE_SETUP 713 #line 54"gun-scanner.l"719 #line 60 "gun-scanner.l" 714 720 { return token::T_MODB; } 715 721 YY_BREAK 716 722 case 11: 717 723 YY_RULE_SETUP 718 #line 55"gun-scanner.l"724 #line 61 "gun-scanner.l" 719 725 { return token::T_FFB; } 720 726 YY_BREAK 721 727 case 12: 722 728 YY_RULE_SETUP 723 #line 56"gun-scanner.l"729 #line 62 "gun-scanner.l" 724 730 { return token::T_FFP; } 725 731 YY_BREAK 726 732 case 13: 727 733 YY_RULE_SETUP 728 #line 57"gun-scanner.l"734 #line 63 "gun-scanner.l" 729 735 { return token::T_FB; } 730 736 YY_BREAK 731 737 case 14: 732 738 YY_RULE_SETUP 733 #line 58"gun-scanner.l"739 #line 64 "gun-scanner.l" 734 740 { return token::T_FP; } 735 741 YY_BREAK 736 742 case 15: 737 743 YY_RULE_SETUP 738 #line 59"gun-scanner.l"744 #line 65 "gun-scanner.l" 739 745 { return token::T_SK; } 740 746 YY_BREAK 741 747 case 16: 742 748 YY_RULE_SETUP 743 #line 6 0"gun-scanner.l"749 #line 66 "gun-scanner.l" 744 750 { return token::T_LOOP; } 745 751 YY_BREAK 746 752 case 17: 747 753 YY_RULE_SETUP 748 #line 6 2"gun-scanner.l"749 { 750 yylval->fval = atof(yytext); return token::NUMBER; }754 #line 68 "gun-scanner.l" 755 { 756 yylval->fval = std::atof(yytext); return token::NUMBER; } 751 757 YY_BREAK 752 758 case 18: 753 759 YY_RULE_SETUP 754 #line 64"gun-scanner.l"760 #line 70 "gun-scanner.l" 755 761 { return token_type('-'); } 756 762 YY_BREAK 757 763 case 19: 758 764 YY_RULE_SETUP 759 #line 65"gun-scanner.l"765 #line 71 "gun-scanner.l" 760 766 { return token_type(','); } 761 767 YY_BREAK … … 763 769 /* rule 20 can match eol */ 764 770 YY_RULE_SETUP 765 #line 66"gun-scanner.l"771 #line 72 "gun-scanner.l" 766 772 { /* ignore everything else */ } 767 773 YY_BREAK 768 774 case 21: 769 775 YY_RULE_SETUP 770 #line 68"gun-scanner.l"776 #line 74 "gun-scanner.l" 771 777 ECHO; 772 778 YY_BREAK 773 #line 7 74"generated/gun-scanner.cpp"779 #line 780 "generated/gun-scanner.cpp" 774 780 case YY_STATE_EOF(INITIAL): 775 781 yyterminate(); … … 1672 1678 #define YYTABLES_NAME "yytables" 1673 1679 1674 #line 68"gun-scanner.l"1680 #line 74 "gun-scanner.l" 1675 1681 1676 1682 -
trunk/orbital/gun-scanner.l
r1425 r1512 11 11 # include "config.h" 12 12 #endif 13 14 #include <cstdlib> 15 using std::exit; 16 using std::malloc; 17 using std::realloc; 18 using std::free; 13 19 14 20 #include "core.h" … … 61 67 62 68 [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? { 63 yylval->fval = atof(yytext); return token::NUMBER; }69 yylval->fval = std::atof(yytext); return token::NUMBER; } 64 70 - { return token_type('-'); } 65 71 , { return token_type(','); } -
trunk/orbital/orbital.cpp
r1509 r1512 37 37 #include "loldebug.h" 38 38 39 using namespace std;40 39 using namespace lol; 41 40 -
trunk/orbital/player.h
r1510 r1512 106 106 m_damped_stick.x = m_damped_stick.x + (seconds / (seconds + 0.18f)) * (rightleft - m_damped_stick.x); 107 107 m_damped_stick.z = m_damped_stick.z + (seconds / (seconds + 0.18f)) * (updown - m_damped_stick.z); 108 vec3 applied_stick = vec3( abs(m_damped_stick.x), 0.0f, m_damped_stick.z);109 vec3 offset = vec3(((m_damped_stick.x < 0.0f)?( abs(m_damped_stick.x) * 30.f):(0.f)), 0.0f, 0.0f);108 vec3 applied_stick = vec3(std::abs(m_damped_stick.x), 0.0f, m_damped_stick.z); 109 vec3 offset = vec3(((m_damped_stick.x < 0.0f)?(std::abs(m_damped_stick.x) * 30.f):(0.f)), 0.0f, 0.0f); 110 110 111 111 for (int i = 0; i < m_options.Count(); i++) … … 132 132 vec3 target_pos = m_position + pos[i] + (move_pos[i] - pos[i]) * applied_stick + offset; 133 133 m_options[i].m1 = m_options[i].m1 + (seconds / (seconds + 0.1f)) * (target_pos - m_options[i].m1); 134 m_options[i].m2[0] = rot[i][0] + (((m_damped_stick.x < 0.0f)?(20.0f):(-20.0f)) - rot[i][0]) * abs(m_damped_stick.x);134 m_options[i].m2[0] = rot[i][0] + (((m_damped_stick.x < 0.0f)?(20.0f):(-20.0f)) - rot[i][0]) * std::abs(m_damped_stick.x); 135 135 136 136 if (m_damped_stick.x < 0.3f && m_damped_stick.x > -0.3f) -
trunk/orbital/snake.h
r1510 r1512 94 94 } 95 95 96 float test = sin f(m_steer) * 200.f + 60.f;96 float test = sin(m_steer) * 200.f + 60.f; 97 97 m_rotation *= quat::rotate(seconds * test, vec3(0, 1, 0)); 98 98 -
trunk/src/Makefile.am
r1510 r1512 15 15 lol/unit.h lol/debug.h \ 16 16 lol/math/vector.h lol/math/half.h lol/math/real.h lol/math/remez.h \ 17 lol/math/trig.h \ 17 18 \ 18 19 generated/location.hh generated/position.hh generated/stack.hh \ … … 36 37 thread/threadbase.h thread/thread.h \ 37 38 \ 38 math/vector.cpp math/real.cpp math/half.cpp math/trig.cpp math/trig.h\39 math/vector.cpp math/real.cpp math/half.cpp math/trig.cpp \ 39 40 \ 40 41 input/input.cpp input/input.h \ -
trunk/src/core.h
r1510 r1512 2 2 // Lol Engine 3 3 // 4 // Copyright: (c) 2010-201 1Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 69 69 // Base types 70 70 #include "lol/debug.h" 71 #include "math/trig.h"72 71 #include "lol/math/half.h" 73 72 #include "lol/math/real.h" 74 73 #include "lol/math/vector.h" 74 #include "lol/math/trig.h" 75 75 #include "numeric.h" 76 76 #include "timer.h" -
trunk/src/easymesh/easymesh-scanner.l
r1510 r1512 15 15 # include "config.h" 16 16 #endif 17 18 #include <cstdlib> 19 using std::exit; 20 using std::malloc; 21 using std::realloc; 22 using std::free; 17 23 18 24 #include "core.h" … … 78 84 79 85 #[0-9a-f]{3} { 80 uint32_t tmp = st rtol(yytext + 1, NULL, 16);86 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); 81 87 yylval->u32val = 0x11000000u * (tmp >> 8) 82 88 | 0x00110000u * ((tmp >> 4) & 0xf) … … 85 91 return token::COLOR; } 86 92 #[0-9a-f]{4} { 87 uint32_t tmp = st rtol(yytext + 1, NULL, 16);93 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); 88 94 yylval->u32val = 0x11000000u * (tmp >> 12) 89 95 | 0x00110000u * ((tmp >> 8) & 0xf) … … 93 99 #[0-9a-f]{6} { 94 100 yylval->u32val = 0xffu 95 | 0x100u * (uint32_t)st rtol(yytext + 1, NULL, 16);101 | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16); 96 102 return token::COLOR; } 97 103 #[0-9a-f]{8} { 98 yylval->u32val = (uint32_t)st rtol(yytext + 1, NULL, 16);104 yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16); 99 105 return token::COLOR; } 100 106 [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? { 101 yylval->fval = atof(yytext); return token::NUMBER; }107 yylval->fval = std::atof(yytext); return token::NUMBER; } 102 108 - { return token_type('-'); } 103 109 "[" { return token_type('['); } -
trunk/src/easymesh/easymesh.cpp
r1510 r1512 353 353 354 354 vec3 d = size * 0.5f; 355 float const pi = std::acos(-1.0f);355 float const pi = acos(-1.0f); 356 356 357 357 Array<vec2> table; 358 358 for (int i = 0; i <= ndivisions; i++) 359 table.Push(vec2(s td::sin(pi * 2 / ndivisions * i) + 1e-5f,360 std::cos(pi * 2 / ndivisions * i) + 1e-5f));359 table.Push(vec2(sin(pi * 2 / ndivisions * i) + 1e-5f, 360 cos(pi * 2 / ndivisions * i) + 1e-5f)); 361 361 362 362 for (int j = 0; j <= ndivisions / 2; j++) -
trunk/src/generated/easymesh-scanner.cpp
r1510 r1512 475 475 #endif 476 476 477 #include <cstdlib> 478 using std::exit; 479 using std::malloc; 480 using std::realloc; 481 using std::free; 482 477 483 #include "core.h" 478 484 #include "easymesh/easymesh-compiler.h" … … 490 496 #define YY_NO_UNISTD_H 491 497 #define YY_USER_ACTION yylloc->columns(yyleng); 492 #line 49 3"generated/easymesh-scanner.cpp"498 #line 499 "generated/easymesh-scanner.cpp" 493 499 494 500 #define INITIAL 0 … … 595 601 register int yy_act; 596 602 597 #line 38"easymesh/easymesh-scanner.l"603 #line 44 "easymesh/easymesh-scanner.l" 598 604 599 605 … … 603 609 604 610 605 #line 6 06"generated/easymesh-scanner.cpp"611 #line 612 "generated/easymesh-scanner.cpp" 606 612 607 613 if ( !(yy_init) ) … … 684 690 case 1: 685 691 YY_RULE_SETUP 686 #line 45"easymesh/easymesh-scanner.l"692 #line 51 "easymesh/easymesh-scanner.l" 687 693 { return token::T_COLOR; } 688 694 YY_BREAK 689 695 case 2: 690 696 YY_RULE_SETUP 691 #line 46"easymesh/easymesh-scanner.l"697 #line 52 "easymesh/easymesh-scanner.l" 692 698 { return token::T_BGCOLOR; } 693 699 YY_BREAK 694 700 case 3: 695 701 YY_RULE_SETUP 696 #line 48"easymesh/easymesh-scanner.l"702 #line 54 "easymesh/easymesh-scanner.l" 697 703 { return token::T_CHAMFER; } 698 704 YY_BREAK 699 705 case 4: 700 706 YY_RULE_SETUP 701 #line 49"easymesh/easymesh-scanner.l"707 #line 55 "easymesh/easymesh-scanner.l" 702 708 { return token::T_TRANSLATEX; } 703 709 YY_BREAK 704 710 case 5: 705 711 YY_RULE_SETUP 706 #line 5 0"easymesh/easymesh-scanner.l"712 #line 56 "easymesh/easymesh-scanner.l" 707 713 { return token::T_TRANSLATEY; } 708 714 YY_BREAK 709 715 case 6: 710 716 YY_RULE_SETUP 711 #line 5 1"easymesh/easymesh-scanner.l"717 #line 57 "easymesh/easymesh-scanner.l" 712 718 { return token::T_TRANSLATEZ; } 713 719 YY_BREAK 714 720 case 7: 715 721 YY_RULE_SETUP 716 #line 5 2"easymesh/easymesh-scanner.l"722 #line 58 "easymesh/easymesh-scanner.l" 717 723 { return token::T_TRANSLATE; } 718 724 YY_BREAK 719 725 case 8: 720 726 YY_RULE_SETUP 721 #line 5 3"easymesh/easymesh-scanner.l"727 #line 59 "easymesh/easymesh-scanner.l" 722 728 { return token::T_ROTATEX; } 723 729 YY_BREAK 724 730 case 9: 725 731 YY_RULE_SETUP 726 #line 54"easymesh/easymesh-scanner.l"732 #line 60 "easymesh/easymesh-scanner.l" 727 733 { return token::T_ROTATEY; } 728 734 YY_BREAK 729 735 case 10: 730 736 YY_RULE_SETUP 731 #line 55"easymesh/easymesh-scanner.l"737 #line 61 "easymesh/easymesh-scanner.l" 732 738 { return token::T_ROTATEZ; } 733 739 YY_BREAK 734 740 case 11: 735 741 YY_RULE_SETUP 736 #line 56"easymesh/easymesh-scanner.l"742 #line 62 "easymesh/easymesh-scanner.l" 737 743 { return token::T_TAPERX; } 738 744 YY_BREAK 739 745 case 12: 740 746 YY_RULE_SETUP 741 #line 57"easymesh/easymesh-scanner.l"747 #line 63 "easymesh/easymesh-scanner.l" 742 748 { return token::T_TAPERY; } 743 749 YY_BREAK 744 750 case 13: 745 751 YY_RULE_SETUP 746 #line 58"easymesh/easymesh-scanner.l"752 #line 64 "easymesh/easymesh-scanner.l" 747 753 { return token::T_TAPERZ; } 748 754 YY_BREAK 749 755 case 14: 750 756 YY_RULE_SETUP 751 #line 59"easymesh/easymesh-scanner.l"757 #line 65 "easymesh/easymesh-scanner.l" 752 758 { return token::T_SCALEX; } 753 759 YY_BREAK 754 760 case 15: 755 761 YY_RULE_SETUP 756 #line 6 0"easymesh/easymesh-scanner.l"762 #line 66 "easymesh/easymesh-scanner.l" 757 763 { return token::T_SCALEY; } 758 764 YY_BREAK 759 765 case 16: 760 766 YY_RULE_SETUP 761 #line 6 1"easymesh/easymesh-scanner.l"767 #line 67 "easymesh/easymesh-scanner.l" 762 768 { return token::T_SCALEZ; } 763 769 YY_BREAK 764 770 case 17: 765 771 YY_RULE_SETUP 766 #line 6 2"easymesh/easymesh-scanner.l"772 #line 68 "easymesh/easymesh-scanner.l" 767 773 { return token::T_SCALE; } 768 774 YY_BREAK 769 775 case 18: 770 776 YY_RULE_SETUP 771 #line 6 3"easymesh/easymesh-scanner.l"777 #line 69 "easymesh/easymesh-scanner.l" 772 778 { return token::T_MIRRORX; } 773 779 YY_BREAK 774 780 case 19: 775 781 YY_RULE_SETUP 776 #line 64"easymesh/easymesh-scanner.l"782 #line 70 "easymesh/easymesh-scanner.l" 777 783 { return token::T_MIRRORY; } 778 784 YY_BREAK 779 785 case 20: 780 786 YY_RULE_SETUP 781 #line 65"easymesh/easymesh-scanner.l"787 #line 71 "easymesh/easymesh-scanner.l" 782 788 { return token::T_MIRRORZ; } 783 789 YY_BREAK 784 790 case 21: 785 791 YY_RULE_SETUP 786 #line 67"easymesh/easymesh-scanner.l"792 #line 73 "easymesh/easymesh-scanner.l" 787 793 { return token::T_CYLINDER; } 788 794 YY_BREAK 789 795 case 22: 790 796 YY_RULE_SETUP 791 #line 68"easymesh/easymesh-scanner.l"797 #line 74 "easymesh/easymesh-scanner.l" 792 798 { return token::T_BOX; } 793 799 YY_BREAK 794 800 case 23: 795 801 YY_RULE_SETUP 796 #line 69"easymesh/easymesh-scanner.l"802 #line 75 "easymesh/easymesh-scanner.l" 797 803 { return token::T_SMOOTHCHAMFBOX; } 798 804 YY_BREAK 799 805 case 24: 800 806 YY_RULE_SETUP 801 #line 7 0"easymesh/easymesh-scanner.l"807 #line 76 "easymesh/easymesh-scanner.l" 802 808 { return token::T_FLATCHAMFBOX; } 803 809 YY_BREAK 804 810 case 25: 805 811 YY_RULE_SETUP 806 #line 7 1"easymesh/easymesh-scanner.l"812 #line 77 "easymesh/easymesh-scanner.l" 807 813 { return token::T_SPHERE; } 808 814 YY_BREAK 809 815 case 26: 810 816 YY_RULE_SETUP 811 #line 7 2"easymesh/easymesh-scanner.l"817 #line 78 "easymesh/easymesh-scanner.l" 812 818 { return token::T_STAR; } 813 819 YY_BREAK 814 820 case 27: 815 821 YY_RULE_SETUP 816 #line 7 3"easymesh/easymesh-scanner.l"822 #line 79 "easymesh/easymesh-scanner.l" 817 823 { return token::T_EXPANDEDSTAR; } 818 824 YY_BREAK 819 825 case 28: 820 826 YY_RULE_SETUP 821 #line 74"easymesh/easymesh-scanner.l"827 #line 80 "easymesh/easymesh-scanner.l" 822 828 { return token::T_DISC; } 823 829 YY_BREAK 824 830 case 29: 825 831 YY_RULE_SETUP 826 #line 75"easymesh/easymesh-scanner.l"832 #line 81 "easymesh/easymesh-scanner.l" 827 833 { return token::T_TRIANGLE; } 828 834 YY_BREAK 829 835 case 30: 830 836 YY_RULE_SETUP 831 #line 76"easymesh/easymesh-scanner.l"837 #line 82 "easymesh/easymesh-scanner.l" 832 838 { return token::T_QUAD; } 833 839 YY_BREAK 834 840 case 31: 835 841 YY_RULE_SETUP 836 #line 77"easymesh/easymesh-scanner.l"842 #line 83 "easymesh/easymesh-scanner.l" 837 843 { return token::T_COG; } 838 844 YY_BREAK 839 845 case 32: 840 846 YY_RULE_SETUP 841 #line 79"easymesh/easymesh-scanner.l"842 { 843 uint32_t tmp = st rtol(yytext + 1, NULL, 16);847 #line 85 "easymesh/easymesh-scanner.l" 848 { 849 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); 844 850 yylval->u32val = 0x11000000u * (tmp >> 8) 845 851 | 0x00110000u * ((tmp >> 4) & 0xf) … … 850 856 case 33: 851 857 YY_RULE_SETUP 852 #line 86"easymesh/easymesh-scanner.l"853 { 854 uint32_t tmp = st rtol(yytext + 1, NULL, 16);858 #line 92 "easymesh/easymesh-scanner.l" 859 { 860 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); 855 861 yylval->u32val = 0x11000000u * (tmp >> 12) 856 862 | 0x00110000u * ((tmp >> 8) & 0xf) … … 861 867 case 34: 862 868 YY_RULE_SETUP 863 #line 9 3"easymesh/easymesh-scanner.l"869 #line 99 "easymesh/easymesh-scanner.l" 864 870 { 865 871 yylval->u32val = 0xffu 866 | 0x100u * (uint32_t)st rtol(yytext + 1, NULL, 16);872 | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16); 867 873 return token::COLOR; } 868 874 YY_BREAK 869 875 case 35: 870 876 YY_RULE_SETUP 871 #line 97"easymesh/easymesh-scanner.l"872 { 873 yylval->u32val = (uint32_t)st rtol(yytext + 1, NULL, 16);877 #line 103 "easymesh/easymesh-scanner.l" 878 { 879 yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16); 874 880 return token::COLOR; } 875 881 YY_BREAK 876 882 case 36: 877 883 YY_RULE_SETUP 878 #line 10 0"easymesh/easymesh-scanner.l"879 { 880 yylval->fval = atof(yytext); return token::NUMBER; }884 #line 106 "easymesh/easymesh-scanner.l" 885 { 886 yylval->fval = std::atof(yytext); return token::NUMBER; } 881 887 YY_BREAK 882 888 case 37: 883 889 YY_RULE_SETUP 884 #line 10 2"easymesh/easymesh-scanner.l"890 #line 108 "easymesh/easymesh-scanner.l" 885 891 { return token_type('-'); } 886 892 YY_BREAK 887 893 case 38: 888 894 YY_RULE_SETUP 889 #line 10 3"easymesh/easymesh-scanner.l"895 #line 109 "easymesh/easymesh-scanner.l" 890 896 { return token_type('['); } 891 897 YY_BREAK 892 898 case 39: 893 899 YY_RULE_SETUP 894 #line 1 04"easymesh/easymesh-scanner.l"900 #line 110 "easymesh/easymesh-scanner.l" 895 901 { return token_type(']'); } 896 902 YY_BREAK 897 903 case 40: 898 904 YY_RULE_SETUP 899 #line 1 05"easymesh/easymesh-scanner.l"905 #line 111 "easymesh/easymesh-scanner.l" 900 906 { /* ignore this */ } 901 907 YY_BREAK … … 903 909 /* rule 41 can match eol */ 904 910 YY_RULE_SETUP 905 #line 1 06"easymesh/easymesh-scanner.l"911 #line 112 "easymesh/easymesh-scanner.l" 906 912 { /* ignore this */ } 907 913 YY_BREAK 908 914 case 42: 909 915 YY_RULE_SETUP 910 #line 1 07"easymesh/easymesh-scanner.l"916 #line 113 "easymesh/easymesh-scanner.l" 911 917 { return token::T_ERROR; } 912 918 YY_BREAK 913 919 case 43: 914 920 YY_RULE_SETUP 915 #line 1 09"easymesh/easymesh-scanner.l"921 #line 115 "easymesh/easymesh-scanner.l" 916 922 ECHO; 917 923 YY_BREAK 918 #line 9 19"generated/easymesh-scanner.cpp"924 #line 925 "generated/easymesh-scanner.cpp" 919 925 case YY_STATE_EOF(INITIAL): 920 926 yyterminate(); … … 1817 1823 #define YYTABLES_NAME "yytables" 1818 1824 1819 #line 1 09"easymesh/easymesh-scanner.l"1825 #line 115 "easymesh/easymesh-scanner.l" 1820 1826 1821 1827 -
trunk/src/gpu/vertexbuffer.cpp
r1480 r1512 234 234 if (FAILED(g_d3ddevice->SetVertexDeclaration(NULL))) 235 235 Abort(); 236 #el se236 #elif !defined __CELLOS_LV2__ 237 237 /* FIXME: we need to unbind what we bound */ 238 238 //glDisableVertexAttribArray(m_attrib); … … 245 245 /* Or: */ 246 246 //glDisableVertexAttribArray(m_attrib); 247 #else 247 248 /* Or even: */ 248 249 //glDisableClientState(GL_VERTEX_ARRAY); -
trunk/src/math/vector.cpp
r1401 r1512 341 341 angle *= (M_PI / 180.0f); 342 342 343 float st = s td::sin(angle);344 float ct = std::cos(angle);343 float st = sin(angle); 344 float ct = cos(angle); 345 345 346 346 mat2 ret; … … 359 359 angle *= (M_PI / 180.0f); 360 360 361 float st = s td::sin(angle);362 float ct = std::cos(angle);361 float st = sin(angle); 362 float ct = cos(angle); 363 363 364 364 float len = std::sqrt(x * x + y * y + z * z); … … 478 478 angle *= (M_PI / 360.0f); 479 479 480 vec3 tmp = normalize(v) * s td::sin(angle);481 482 return quat( std::cos(angle), tmp.x, tmp.y, tmp.z);480 vec3 tmp = normalize(v) * sin(angle); 481 482 return quat(cos(angle), tmp.x, tmp.y, tmp.z); 483 483 } 484 484 … … 490 490 template<> vec3 vec3::toeuler(quat const &q) 491 491 { 492 using std::atan2;493 using std::asin;494 495 492 float n = norm(q); 496 493 … … 509 506 static inline mat3 mat3_fromeuler_generic(vec3 const &v, int i, int j, int k) 510 507 { 511 using std::sin;512 using std::cos;513 508 mat3 ret; 514 509 … … 579 574 static inline quat quat_fromeuler_generic(vec3 const &v, int i, int j, int k) 580 575 { 581 using std::sin;582 using std::cos;583 584 576 vec3 half_angles = (M_PI / 360.0f) * v; 585 577 float s0 = sin(half_angles[0]), c0 = cos(half_angles[0]); -
trunk/test/tutorial/03_fractal.cpp
r1426 r1512 20 20 #include "loldebug.h" 21 21 22 using namespace std;23 22 using namespace lol; 24 23 … … 237 236 if (m_translate != 0.0) 238 237 { 239 m_translate *= pow(2.0, -seconds * 5.0);238 m_translate *= std::pow(2.0, -seconds * 5.0); 240 239 if (m_translate.norm() / m_radius < 1e-4) 241 240 m_translate = 0.0; … … 252 251 else if (m_zoom_speed) 253 252 { 254 m_zoom_speed *= pow(2.0, -seconds * 5.0);253 m_zoom_speed *= std::pow(2.0, -seconds * 5.0); 255 254 if (abs(m_zoom_speed) < 1e-5 || m_drag) 256 255 m_zoom_speed = 0.0; … … 262 261 dcmplx oldcenter = m_center; 263 262 double oldradius = m_radius; 264 double zoom = pow(2.0, seconds * 1e3f * m_zoom_speed);263 double zoom = std::pow(2.0, seconds * 1e3f * m_zoom_speed); 265 264 if (m_radius * zoom > 8.0) 266 265 { -
trunk/test/unit/trig.cpp
r1165 r1512 2 2 // Lol Engine 3 3 // 4 // Copyright: (c) 2010-201 1Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 26 26 { 27 27 using std::fabs; 28 using std::sin;29 28 30 29 for (int i = -10000; i < 10000; i++) … … 34 33 double a = __builtin_sin(f); 35 34 #else 36 double a = s in(f);35 double a = std::sin(f); 37 36 #endif 38 37 double b = lol_sin(f); … … 47 46 double a = __builtin_sin(f); 48 47 #else 49 double a = s in(f);48 double a = std::sin(f); 50 49 #endif 51 50 double b = lol_sin(f); … … 58 57 { 59 58 using std::fabs; 60 using std::cos;61 59 62 60 for (int i = -10000; i < 10000; i++) … … 66 64 double a = __builtin_cos(f); 67 65 #else 68 double a = cos(f);66 double a = std::cos(f); 69 67 #endif 70 68 double b = lol_cos(f); … … 79 77 double a = __builtin_cos(f); 80 78 #else 81 double a = cos(f);79 double a = std::cos(f); 82 80 #endif 83 81 double b = lol_cos(f); … … 90 88 { 91 89 using std::fabs; 92 using std::sin;93 using std::cos;94 90 95 91 for (int i = -10000; i < 10000; i++) … … 100 96 double a2 = __builtin_cos(f); 101 97 #else 102 double a1 = s in(f);103 double a2 = cos(f);98 double a1 = std::sin(f); 99 double a2 = std::cos(f); 104 100 #endif 105 101 double b1, b2; … … 117 113 double a2 = __builtin_cos(f); 118 114 #else 119 double a1 = s in(f);120 double a2 = cos(f);115 double a1 = std::sin(f); 116 double a2 = std::cos(f); 121 117 #endif 122 118 double b1, b2; … … 131 127 { 132 128 using std::fabs; 133 using std::tan;134 129 135 130 for (int i = -100000; i < 100000; i++) … … 139 134 double a = __builtin_tan(f); 140 135 #else 141 double a = tan(f);136 double a = std::tan(f); 142 137 #endif 143 138 double b = lol_tan(f); … … 157 152 double a = __builtin_tan(f); 158 153 #else 159 double a = tan(f);154 double a = std::tan(f); 160 155 #endif 161 156 double b = lol_tan(f); -
trunk/test/xolotl/xolotl.cpp
r1310 r1512 18 18 #include "loldebug.h" 19 19 20 using namespace std;21 20 using namespace lol; 22 21 … … 71 70 new DebugFps(5, 5); 72 71 73 Cell<3> c;72 Cell<3> c; 74 73 app.Run(); 75 74 -
trunk/win32/lolcore.vcxproj
r1510 r1512 175 175 <ClInclude Include="..\src\lol\math\real.h" /> 176 176 <ClInclude Include="..\src\lol\math\remez.h" /> 177 <ClInclude Include="..\src\lol\math\trig.h" /> 177 178 <ClInclude Include="..\src\lol\math\vector.h" /> 178 179 <ClInclude Include="..\src\lol\unit.h" /> 179 180 <ClInclude Include="..\src\map.h" /> 180 <ClInclude Include="..\src\math\trig.h" />181 181 <ClInclude Include="..\src\numeric.h" /> 182 182 <ClInclude Include="..\src\platform.h" /> -
trunk/win32/lolcore.vcxproj.filters
r1510 r1512 262 262 <Filter>src\platform\sdl</Filter> 263 263 </ClInclude> 264 <ClInclude Include="..\src\math\trig.h">265 <Filter>src\math</Filter>266 </ClInclude>267 264 <ClInclude Include="..\src\lol\math\half.h"> 268 265 <Filter>src\lol\math</Filter> … … 272 269 </ClInclude> 273 270 <ClInclude Include="..\src\lol\math\remez.h"> 271 <Filter>src\lol\math</Filter> 272 </ClInclude> 273 <ClInclude Include="..\src\lol\math\trig.h"> 274 274 <Filter>src\lol\math</Filter> 275 275 </ClInclude>
Note: See TracChangeset
for help on using the changeset viewer.