Changeset 1512


Ignore:
Timestamp:
Jun 23, 2012, 11:13:45 AM (11 years ago)
Author:
sam
Message:

build: fix the PS3 port by using our trig.h everywhere instead of stdlib
functions; also remove a lot of idiotic "using namespace std" from the
codebase.

Location:
trunk
Files:
1 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/neercs/Makefile.am

    r1505 r1512  
    1818neercs_DEPENDENCIES = $(top_builddir)/src/liblol.a
    1919
     20if USE_CACA
    2021all-local: neercs$(EXEEXT)
    2122        test $(MAKE_FSELF) = no || make_fself neercs$(EXEEXT) neercs.self
     23endif
    2224
    2325CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \
  • trunk/orbital/Lolnament.h

    r1510 r1512  
    22// Orbital
    33//
    4 // Copyright: (c) 012 Benjamin Huet <huet.benjamin@gmail.com>
     4// Copyright: (c) 2012 Benjamin Huet <huet.benjamin@gmail.com>
    55//            (c) 2012 Sam Hocevar <sam@hocevar.net>
    66//
     
    246246                                        {
    247247                                                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));
    249249
    250250                                                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  
    453453#endif
    454454
     455#include <cstdlib>
     456using std::exit;
     457using std::malloc;
     458using std::realloc;
     459using std::free;
     460
    455461#include "core.h"
    456462#include "loldebug.h"
     
    472478#define YY_NO_UNISTD_H
    473479#define YY_USER_ACTION yylloc->columns(yyleng);
    474 #line 475 "generated/gun-scanner.cpp"
     480#line 481 "generated/gun-scanner.cpp"
    475481
    476482#define INITIAL 0
     
    577583        register int yy_act;
    578584   
    579 #line 38 "gun-scanner.l"
     585#line 44 "gun-scanner.l"
    580586
    581587
     
    585591
    586592
    587 #line 588 "generated/gun-scanner.cpp"
     593#line 594 "generated/gun-scanner.cpp"
    588594
    589595        if ( !(yy_init) )
     
    666672case 1:
    667673YY_RULE_SETUP
    668 #line 45 "gun-scanner.l"
     674#line 51 "gun-scanner.l"
    669675{ return token::T_AI; }
    670676        YY_BREAK
    671677case 2:
    672678YY_RULE_SETUP
    673 #line 46 "gun-scanner.l"
     679#line 52 "gun-scanner.l"
    674680{ return token::T_PAI; }
    675681        YY_BREAK
    676682case 3:
    677683YY_RULE_SETUP
    678 #line 47 "gun-scanner.l"
     684#line 53 "gun-scanner.l"
    679685{ return token::T_CA; }
    680686        YY_BREAK
    681687case 4:
    682688YY_RULE_SETUP
    683 #line 48 "gun-scanner.l"
     689#line 54 "gun-scanner.l"
    684690{ return token::T_SA; }
    685691        YY_BREAK
    686692case 5:
    687693YY_RULE_SETUP
    688 #line 49 "gun-scanner.l"
     694#line 55 "gun-scanner.l"
    689695{ return token::T_TIM; }
    690696        YY_BREAK
    691697case 6:
    692698YY_RULE_SETUP
    693 #line 50 "gun-scanner.l"
     699#line 56 "gun-scanner.l"
    694700{ return token::T_SO; }
    695701        YY_BREAK
    696702case 7:
    697703YY_RULE_SETUP
    698 #line 51 "gun-scanner.l"
     704#line 57 "gun-scanner.l"
    699705{ return token::T_RD; }
    700706        YY_BREAK
    701707case 8:
    702708YY_RULE_SETUP
    703 #line 52 "gun-scanner.l"
     709#line 58 "gun-scanner.l"
    704710{ return token::T_SPD; }
    705711        YY_BREAK
    706712case 9:
    707713YY_RULE_SETUP
    708 #line 53 "gun-scanner.l"
     714#line 59 "gun-scanner.l"
    709715{ return token::T_MODA; }
    710716        YY_BREAK
    711717case 10:
    712718YY_RULE_SETUP
    713 #line 54 "gun-scanner.l"
     719#line 60 "gun-scanner.l"
    714720{ return token::T_MODB; }
    715721        YY_BREAK
    716722case 11:
    717723YY_RULE_SETUP
    718 #line 55 "gun-scanner.l"
     724#line 61 "gun-scanner.l"
    719725{ return token::T_FFB; }
    720726        YY_BREAK
    721727case 12:
    722728YY_RULE_SETUP
    723 #line 56 "gun-scanner.l"
     729#line 62 "gun-scanner.l"
    724730{ return token::T_FFP; }
    725731        YY_BREAK
    726732case 13:
    727733YY_RULE_SETUP
    728 #line 57 "gun-scanner.l"
     734#line 63 "gun-scanner.l"
    729735{ return token::T_FB; }
    730736        YY_BREAK
    731737case 14:
    732738YY_RULE_SETUP
    733 #line 58 "gun-scanner.l"
     739#line 64 "gun-scanner.l"
    734740{ return token::T_FP; }
    735741        YY_BREAK
    736742case 15:
    737743YY_RULE_SETUP
    738 #line 59 "gun-scanner.l"
     744#line 65 "gun-scanner.l"
    739745{ return token::T_SK; }
    740746        YY_BREAK
    741747case 16:
    742748YY_RULE_SETUP
    743 #line 60 "gun-scanner.l"
     749#line 66 "gun-scanner.l"
    744750{ return token::T_LOOP; }
    745751        YY_BREAK
    746752case 17:
    747753YY_RULE_SETUP
    748 #line 62 "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; }
    751757        YY_BREAK
    752758case 18:
    753759YY_RULE_SETUP
    754 #line 64 "gun-scanner.l"
     760#line 70 "gun-scanner.l"
    755761{ return token_type('-'); }
    756762        YY_BREAK
    757763case 19:
    758764YY_RULE_SETUP
    759 #line 65 "gun-scanner.l"
     765#line 71 "gun-scanner.l"
    760766{ return token_type(','); }
    761767        YY_BREAK
     
    763769/* rule 20 can match eol */
    764770YY_RULE_SETUP
    765 #line 66 "gun-scanner.l"
     771#line 72 "gun-scanner.l"
    766772{ /* ignore everything else */ }
    767773        YY_BREAK
    768774case 21:
    769775YY_RULE_SETUP
    770 #line 68 "gun-scanner.l"
     776#line 74 "gun-scanner.l"
    771777ECHO;
    772778        YY_BREAK
    773 #line 774 "generated/gun-scanner.cpp"
     779#line 780 "generated/gun-scanner.cpp"
    774780case YY_STATE_EOF(INITIAL):
    775781        yyterminate();
     
    16721678#define YYTABLES_NAME "yytables"
    16731679
    1674 #line 68 "gun-scanner.l"
     1680#line 74 "gun-scanner.l"
    16751681
    16761682
  • trunk/orbital/gun-scanner.l

    r1425 r1512  
    1111#   include "config.h"
    1212#endif
     13
     14#include <cstdlib>
     15using std::exit;
     16using std::malloc;
     17using std::realloc;
     18using std::free;
    1319
    1420#include "core.h"
     
    6167
    6268[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? {
    63         yylval->fval = atof(yytext); return token::NUMBER; }
     69        yylval->fval = std::atof(yytext); return token::NUMBER; }
    6470-     { return token_type('-'); }
    6571,     { return token_type(','); }
  • trunk/orbital/orbital.cpp

    r1509 r1512  
    3737#include "loldebug.h"
    3838
    39 using namespace std;
    4039using namespace lol;
    4140
  • trunk/orbital/player.h

    r1510 r1512  
    106106        m_damped_stick.x = m_damped_stick.x + (seconds / (seconds + 0.18f)) * (rightleft - m_damped_stick.x);
    107107        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);
    110110
    111111        for (int i = 0; i < m_options.Count(); i++)
     
    132132            vec3 target_pos = m_position + pos[i] + (move_pos[i] - pos[i]) * applied_stick + offset;
    133133            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);
    135135
    136136            if (m_damped_stick.x < 0.3f && m_damped_stick.x > -0.3f)
  • trunk/orbital/snake.h

    r1510 r1512  
    9494        }
    9595
    96         float test = sinf(m_steer) * 200.f + 60.f;
     96        float test = sin(m_steer) * 200.f + 60.f;
    9797        m_rotation *= quat::rotate(seconds * test, vec3(0, 1, 0));
    9898
  • trunk/src/Makefile.am

    r1510 r1512  
    1515    lol/unit.h lol/debug.h \
    1616    lol/math/vector.h lol/math/half.h lol/math/real.h lol/math/remez.h \
     17    lol/math/trig.h \
    1718    \
    1819    generated/location.hh generated/position.hh generated/stack.hh \
     
    3637    thread/threadbase.h thread/thread.h \
    3738    \
    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 \
    3940    \
    4041    input/input.cpp input/input.h \
  • trunk/src/core.h

    r1510 r1512  
    22// Lol Engine
    33//
    4 // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
    55//   This program is free software; you can redistribute it and/or
    66//   modify it under the terms of the Do What The Fuck You Want To
     
    6969// Base types
    7070#include "lol/debug.h"
    71 #include "math/trig.h"
    7271#include "lol/math/half.h"
    7372#include "lol/math/real.h"
    7473#include "lol/math/vector.h"
     74#include "lol/math/trig.h"
    7575#include "numeric.h"
    7676#include "timer.h"
  • trunk/src/easymesh/easymesh-scanner.l

    r1510 r1512  
    1515#   include "config.h"
    1616#endif
     17
     18#include <cstdlib>
     19using std::exit;
     20using std::malloc;
     21using std::realloc;
     22using std::free;
    1723
    1824#include "core.h"
     
    7884
    7985#[0-9a-f]{3} {
    80         uint32_t tmp = strtol(yytext + 1, NULL, 16);
     86        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
    8187        yylval->u32val = 0x11000000u * (tmp >> 8)
    8288                       | 0x00110000u * ((tmp >> 4) & 0xf)
     
    8591        return token::COLOR; }
    8692#[0-9a-f]{4} {
    87         uint32_t tmp = strtol(yytext + 1, NULL, 16);
     93        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
    8894        yylval->u32val = 0x11000000u * (tmp >> 12)
    8995                       | 0x00110000u * ((tmp >> 8) & 0xf)
     
    9399#[0-9a-f]{6} {
    94100        yylval->u32val = 0xffu
    95                        | 0x100u * (uint32_t)strtol(yytext + 1, NULL, 16);
     101                       | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);
    96102        return token::COLOR; }
    97103#[0-9a-f]{8} {
    98         yylval->u32val = (uint32_t)strtol(yytext + 1, NULL, 16);
     104        yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
    99105        return token::COLOR; }
    100106[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? {
    101         yylval->fval = atof(yytext); return token::NUMBER; }
     107        yylval->fval = std::atof(yytext); return token::NUMBER; }
    102108-     { return token_type('-'); }
    103109"["   { return token_type('['); }
  • trunk/src/easymesh/easymesh.cpp

    r1510 r1512  
    353353
    354354    vec3 d = size * 0.5f;
    355     float const pi = std::acos(-1.0f);
     355    float const pi = acos(-1.0f);
    356356
    357357    Array<vec2> table;
    358358    for (int i = 0; i <= ndivisions; i++)
    359         table.Push(vec2(std::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));
    361361
    362362    for (int j = 0; j <= ndivisions / 2; j++)
  • trunk/src/generated/easymesh-scanner.cpp

    r1510 r1512  
    475475#endif
    476476
     477#include <cstdlib>
     478using std::exit;
     479using std::malloc;
     480using std::realloc;
     481using std::free;
     482
    477483#include "core.h"
    478484#include "easymesh/easymesh-compiler.h"
     
    490496#define YY_NO_UNISTD_H
    491497#define YY_USER_ACTION yylloc->columns(yyleng);
    492 #line 493 "generated/easymesh-scanner.cpp"
     498#line 499 "generated/easymesh-scanner.cpp"
    493499
    494500#define INITIAL 0
     
    595601        register int yy_act;
    596602   
    597 #line 38 "easymesh/easymesh-scanner.l"
     603#line 44 "easymesh/easymesh-scanner.l"
    598604
    599605
     
    603609
    604610
    605 #line 606 "generated/easymesh-scanner.cpp"
     611#line 612 "generated/easymesh-scanner.cpp"
    606612
    607613        if ( !(yy_init) )
     
    684690case 1:
    685691YY_RULE_SETUP
    686 #line 45 "easymesh/easymesh-scanner.l"
     692#line 51 "easymesh/easymesh-scanner.l"
    687693{ return token::T_COLOR; }
    688694        YY_BREAK
    689695case 2:
    690696YY_RULE_SETUP
    691 #line 46 "easymesh/easymesh-scanner.l"
     697#line 52 "easymesh/easymesh-scanner.l"
    692698{ return token::T_BGCOLOR; }
    693699        YY_BREAK
    694700case 3:
    695701YY_RULE_SETUP
    696 #line 48 "easymesh/easymesh-scanner.l"
     702#line 54 "easymesh/easymesh-scanner.l"
    697703{ return token::T_CHAMFER; }
    698704        YY_BREAK
    699705case 4:
    700706YY_RULE_SETUP
    701 #line 49 "easymesh/easymesh-scanner.l"
     707#line 55 "easymesh/easymesh-scanner.l"
    702708{ return token::T_TRANSLATEX; }
    703709        YY_BREAK
    704710case 5:
    705711YY_RULE_SETUP
    706 #line 50 "easymesh/easymesh-scanner.l"
     712#line 56 "easymesh/easymesh-scanner.l"
    707713{ return token::T_TRANSLATEY; }
    708714        YY_BREAK
    709715case 6:
    710716YY_RULE_SETUP
    711 #line 51 "easymesh/easymesh-scanner.l"
     717#line 57 "easymesh/easymesh-scanner.l"
    712718{ return token::T_TRANSLATEZ; }
    713719        YY_BREAK
    714720case 7:
    715721YY_RULE_SETUP
    716 #line 52 "easymesh/easymesh-scanner.l"
     722#line 58 "easymesh/easymesh-scanner.l"
    717723{ return token::T_TRANSLATE; }
    718724        YY_BREAK
    719725case 8:
    720726YY_RULE_SETUP
    721 #line 53 "easymesh/easymesh-scanner.l"
     727#line 59 "easymesh/easymesh-scanner.l"
    722728{ return token::T_ROTATEX; }
    723729        YY_BREAK
    724730case 9:
    725731YY_RULE_SETUP
    726 #line 54 "easymesh/easymesh-scanner.l"
     732#line 60 "easymesh/easymesh-scanner.l"
    727733{ return token::T_ROTATEY; }
    728734        YY_BREAK
    729735case 10:
    730736YY_RULE_SETUP
    731 #line 55 "easymesh/easymesh-scanner.l"
     737#line 61 "easymesh/easymesh-scanner.l"
    732738{ return token::T_ROTATEZ; }
    733739        YY_BREAK
    734740case 11:
    735741YY_RULE_SETUP
    736 #line 56 "easymesh/easymesh-scanner.l"
     742#line 62 "easymesh/easymesh-scanner.l"
    737743{ return token::T_TAPERX; }
    738744        YY_BREAK
    739745case 12:
    740746YY_RULE_SETUP
    741 #line 57 "easymesh/easymesh-scanner.l"
     747#line 63 "easymesh/easymesh-scanner.l"
    742748{ return token::T_TAPERY; }
    743749        YY_BREAK
    744750case 13:
    745751YY_RULE_SETUP
    746 #line 58 "easymesh/easymesh-scanner.l"
     752#line 64 "easymesh/easymesh-scanner.l"
    747753{ return token::T_TAPERZ; }
    748754        YY_BREAK
    749755case 14:
    750756YY_RULE_SETUP
    751 #line 59 "easymesh/easymesh-scanner.l"
     757#line 65 "easymesh/easymesh-scanner.l"
    752758{ return token::T_SCALEX; }
    753759        YY_BREAK
    754760case 15:
    755761YY_RULE_SETUP
    756 #line 60 "easymesh/easymesh-scanner.l"
     762#line 66 "easymesh/easymesh-scanner.l"
    757763{ return token::T_SCALEY; }
    758764        YY_BREAK
    759765case 16:
    760766YY_RULE_SETUP
    761 #line 61 "easymesh/easymesh-scanner.l"
     767#line 67 "easymesh/easymesh-scanner.l"
    762768{ return token::T_SCALEZ; }
    763769        YY_BREAK
    764770case 17:
    765771YY_RULE_SETUP
    766 #line 62 "easymesh/easymesh-scanner.l"
     772#line 68 "easymesh/easymesh-scanner.l"
    767773{ return token::T_SCALE; }
    768774        YY_BREAK
    769775case 18:
    770776YY_RULE_SETUP
    771 #line 63 "easymesh/easymesh-scanner.l"
     777#line 69 "easymesh/easymesh-scanner.l"
    772778{ return token::T_MIRRORX; }
    773779        YY_BREAK
    774780case 19:
    775781YY_RULE_SETUP
    776 #line 64 "easymesh/easymesh-scanner.l"
     782#line 70 "easymesh/easymesh-scanner.l"
    777783{ return token::T_MIRRORY; }
    778784        YY_BREAK
    779785case 20:
    780786YY_RULE_SETUP
    781 #line 65 "easymesh/easymesh-scanner.l"
     787#line 71 "easymesh/easymesh-scanner.l"
    782788{ return token::T_MIRRORZ; }
    783789        YY_BREAK
    784790case 21:
    785791YY_RULE_SETUP
    786 #line 67 "easymesh/easymesh-scanner.l"
     792#line 73 "easymesh/easymesh-scanner.l"
    787793{ return token::T_CYLINDER; }
    788794        YY_BREAK
    789795case 22:
    790796YY_RULE_SETUP
    791 #line 68 "easymesh/easymesh-scanner.l"
     797#line 74 "easymesh/easymesh-scanner.l"
    792798{ return token::T_BOX; }
    793799        YY_BREAK
    794800case 23:
    795801YY_RULE_SETUP
    796 #line 69 "easymesh/easymesh-scanner.l"
     802#line 75 "easymesh/easymesh-scanner.l"
    797803{ return token::T_SMOOTHCHAMFBOX; }
    798804        YY_BREAK
    799805case 24:
    800806YY_RULE_SETUP
    801 #line 70 "easymesh/easymesh-scanner.l"
     807#line 76 "easymesh/easymesh-scanner.l"
    802808{ return token::T_FLATCHAMFBOX; }
    803809        YY_BREAK
    804810case 25:
    805811YY_RULE_SETUP
    806 #line 71 "easymesh/easymesh-scanner.l"
     812#line 77 "easymesh/easymesh-scanner.l"
    807813{ return token::T_SPHERE; }
    808814        YY_BREAK
    809815case 26:
    810816YY_RULE_SETUP
    811 #line 72 "easymesh/easymesh-scanner.l"
     817#line 78 "easymesh/easymesh-scanner.l"
    812818{ return token::T_STAR; }
    813819        YY_BREAK
    814820case 27:
    815821YY_RULE_SETUP
    816 #line 73 "easymesh/easymesh-scanner.l"
     822#line 79 "easymesh/easymesh-scanner.l"
    817823{ return token::T_EXPANDEDSTAR; }
    818824        YY_BREAK
    819825case 28:
    820826YY_RULE_SETUP
    821 #line 74 "easymesh/easymesh-scanner.l"
     827#line 80 "easymesh/easymesh-scanner.l"
    822828{ return token::T_DISC; }
    823829        YY_BREAK
    824830case 29:
    825831YY_RULE_SETUP
    826 #line 75 "easymesh/easymesh-scanner.l"
     832#line 81 "easymesh/easymesh-scanner.l"
    827833{ return token::T_TRIANGLE; }
    828834        YY_BREAK
    829835case 30:
    830836YY_RULE_SETUP
    831 #line 76 "easymesh/easymesh-scanner.l"
     837#line 82 "easymesh/easymesh-scanner.l"
    832838{ return token::T_QUAD; }
    833839        YY_BREAK
    834840case 31:
    835841YY_RULE_SETUP
    836 #line 77 "easymesh/easymesh-scanner.l"
     842#line 83 "easymesh/easymesh-scanner.l"
    837843{ return token::T_COG; }
    838844        YY_BREAK
    839845case 32:
    840846YY_RULE_SETUP
    841 #line 79 "easymesh/easymesh-scanner.l"
    842 {
    843         uint32_t tmp = strtol(yytext + 1, NULL, 16);
     847#line 85 "easymesh/easymesh-scanner.l"
     848{
     849        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
    844850        yylval->u32val = 0x11000000u * (tmp >> 8)
    845851                       | 0x00110000u * ((tmp >> 4) & 0xf)
     
    850856case 33:
    851857YY_RULE_SETUP
    852 #line 86 "easymesh/easymesh-scanner.l"
    853 {
    854         uint32_t tmp = strtol(yytext + 1, NULL, 16);
     858#line 92 "easymesh/easymesh-scanner.l"
     859{
     860        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
    855861        yylval->u32val = 0x11000000u * (tmp >> 12)
    856862                       | 0x00110000u * ((tmp >> 8) & 0xf)
     
    861867case 34:
    862868YY_RULE_SETUP
    863 #line 93 "easymesh/easymesh-scanner.l"
     869#line 99 "easymesh/easymesh-scanner.l"
    864870{
    865871        yylval->u32val = 0xffu
    866                        | 0x100u * (uint32_t)strtol(yytext + 1, NULL, 16);
     872                       | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);
    867873        return token::COLOR; }
    868874        YY_BREAK
    869875case 35:
    870876YY_RULE_SETUP
    871 #line 97 "easymesh/easymesh-scanner.l"
    872 {
    873         yylval->u32val = (uint32_t)strtol(yytext + 1, NULL, 16);
     877#line 103 "easymesh/easymesh-scanner.l"
     878{
     879        yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
    874880        return token::COLOR; }
    875881        YY_BREAK
    876882case 36:
    877883YY_RULE_SETUP
    878 #line 100 "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; }
    881887        YY_BREAK
    882888case 37:
    883889YY_RULE_SETUP
    884 #line 102 "easymesh/easymesh-scanner.l"
     890#line 108 "easymesh/easymesh-scanner.l"
    885891{ return token_type('-'); }
    886892        YY_BREAK
    887893case 38:
    888894YY_RULE_SETUP
    889 #line 103 "easymesh/easymesh-scanner.l"
     895#line 109 "easymesh/easymesh-scanner.l"
    890896{ return token_type('['); }
    891897        YY_BREAK
    892898case 39:
    893899YY_RULE_SETUP
    894 #line 104 "easymesh/easymesh-scanner.l"
     900#line 110 "easymesh/easymesh-scanner.l"
    895901{ return token_type(']'); }
    896902        YY_BREAK
    897903case 40:
    898904YY_RULE_SETUP
    899 #line 105 "easymesh/easymesh-scanner.l"
     905#line 111 "easymesh/easymesh-scanner.l"
    900906{ /* ignore this */ }
    901907        YY_BREAK
     
    903909/* rule 41 can match eol */
    904910YY_RULE_SETUP
    905 #line 106 "easymesh/easymesh-scanner.l"
     911#line 112 "easymesh/easymesh-scanner.l"
    906912{ /* ignore this */ }
    907913        YY_BREAK
    908914case 42:
    909915YY_RULE_SETUP
    910 #line 107 "easymesh/easymesh-scanner.l"
     916#line 113 "easymesh/easymesh-scanner.l"
    911917{ return token::T_ERROR; }
    912918        YY_BREAK
    913919case 43:
    914920YY_RULE_SETUP
    915 #line 109 "easymesh/easymesh-scanner.l"
     921#line 115 "easymesh/easymesh-scanner.l"
    916922ECHO;
    917923        YY_BREAK
    918 #line 919 "generated/easymesh-scanner.cpp"
     924#line 925 "generated/easymesh-scanner.cpp"
    919925case YY_STATE_EOF(INITIAL):
    920926        yyterminate();
     
    18171823#define YYTABLES_NAME "yytables"
    18181824
    1819 #line 109 "easymesh/easymesh-scanner.l"
     1825#line 115 "easymesh/easymesh-scanner.l"
    18201826
    18211827
  • trunk/src/gpu/vertexbuffer.cpp

    r1480 r1512  
    234234    if (FAILED(g_d3ddevice->SetVertexDeclaration(NULL)))
    235235        Abort();
    236 #else
     236#elif !defined __CELLOS_LV2__
    237237    /* FIXME: we need to unbind what we bound */
    238238    //glDisableVertexAttribArray(m_attrib);
     
    245245    /* Or: */
    246246    //glDisableVertexAttribArray(m_attrib);
     247#else
    247248    /* Or even: */
    248249    //glDisableClientState(GL_VERTEX_ARRAY);
  • trunk/src/math/vector.cpp

    r1401 r1512  
    341341    angle *= (M_PI / 180.0f);
    342342
    343     float st = std::sin(angle);
    344     float ct = std::cos(angle);
     343    float st = sin(angle);
     344    float ct = cos(angle);
    345345
    346346    mat2 ret;
     
    359359    angle *= (M_PI / 180.0f);
    360360
    361     float st = std::sin(angle);
    362     float ct = std::cos(angle);
     361    float st = sin(angle);
     362    float ct = cos(angle);
    363363
    364364    float len = std::sqrt(x * x + y * y + z * z);
     
    478478    angle *= (M_PI / 360.0f);
    479479
    480     vec3 tmp = normalize(v) * std::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);
    483483}
    484484
     
    490490template<> vec3 vec3::toeuler(quat const &q)
    491491{
    492     using std::atan2;
    493     using std::asin;
    494 
    495492    float n = norm(q);
    496493
     
    509506static inline mat3 mat3_fromeuler_generic(vec3 const &v, int i, int j, int k)
    510507{
    511     using std::sin;
    512     using std::cos;
    513508    mat3 ret;
    514509
     
    579574static inline quat quat_fromeuler_generic(vec3 const &v, int i, int j, int k)
    580575{
    581     using std::sin;
    582     using std::cos;
    583 
    584576    vec3 half_angles = (M_PI / 360.0f) * v;
    585577    float s0 = sin(half_angles[0]), c0 = cos(half_angles[0]);
  • trunk/test/tutorial/03_fractal.cpp

    r1426 r1512  
    2020#include "loldebug.h"
    2121
    22 using namespace std;
    2322using namespace lol;
    2423
     
    237236            if (m_translate != 0.0)
    238237            {
    239                 m_translate *= pow(2.0, -seconds * 5.0);
     238                m_translate *= std::pow(2.0, -seconds * 5.0);
    240239                if (m_translate.norm() / m_radius < 1e-4)
    241240                    m_translate = 0.0;
     
    252251        else if (m_zoom_speed)
    253252        {
    254             m_zoom_speed *= pow(2.0, -seconds * 5.0);
     253            m_zoom_speed *= std::pow(2.0, -seconds * 5.0);
    255254            if (abs(m_zoom_speed) < 1e-5 || m_drag)
    256255                m_zoom_speed = 0.0;
     
    262261            dcmplx oldcenter = m_center;
    263262            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);
    265264            if (m_radius * zoom > 8.0)
    266265            {
  • trunk/test/unit/trig.cpp

    r1165 r1512  
    22// Lol Engine
    33//
    4 // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
    55//   This program is free software; you can redistribute it and/or
    66//   modify it under the terms of the Do What The Fuck You Want To
     
    2626    {
    2727        using std::fabs;
    28         using std::sin;
    2928
    3029        for (int i = -10000; i < 10000; i++)
     
    3433            double a = __builtin_sin(f);
    3534#else
    36             double a = sin(f);
     35            double a = std::sin(f);
    3736#endif
    3837            double b = lol_sin(f);
     
    4746            double a = __builtin_sin(f);
    4847#else
    49             double a = sin(f);
     48            double a = std::sin(f);
    5049#endif
    5150            double b = lol_sin(f);
     
    5857    {
    5958        using std::fabs;
    60         using std::cos;
    6159
    6260        for (int i = -10000; i < 10000; i++)
     
    6664            double a = __builtin_cos(f);
    6765#else
    68             double a = cos(f);
     66            double a = std::cos(f);
    6967#endif
    7068            double b = lol_cos(f);
     
    7977            double a = __builtin_cos(f);
    8078#else
    81             double a = cos(f);
     79            double a = std::cos(f);
    8280#endif
    8381            double b = lol_cos(f);
     
    9088    {
    9189        using std::fabs;
    92         using std::sin;
    93         using std::cos;
    9490
    9591        for (int i = -10000; i < 10000; i++)
     
    10096            double a2 = __builtin_cos(f);
    10197#else
    102             double a1 = sin(f);
    103             double a2 = cos(f);
     98            double a1 = std::sin(f);
     99            double a2 = std::cos(f);
    104100#endif
    105101            double b1, b2;
     
    117113            double a2 = __builtin_cos(f);
    118114#else
    119             double a1 = sin(f);
    120             double a2 = cos(f);
     115            double a1 = std::sin(f);
     116            double a2 = std::cos(f);
    121117#endif
    122118            double b1, b2;
     
    131127    {
    132128        using std::fabs;
    133         using std::tan;
    134129
    135130        for (int i = -100000; i < 100000; i++)
     
    139134            double a = __builtin_tan(f);
    140135#else
    141             double a = tan(f);
     136            double a = std::tan(f);
    142137#endif
    143138            double b = lol_tan(f);
     
    157152            double a = __builtin_tan(f);
    158153#else
    159             double a = tan(f);
     154            double a = std::tan(f);
    160155#endif
    161156            double b = lol_tan(f);
  • trunk/test/xolotl/xolotl.cpp

    r1310 r1512  
    1818#include "loldebug.h"
    1919
    20 using namespace std;
    2120using namespace lol;
    2221
     
    7170    new DebugFps(5, 5);
    7271
    73 Cell<3> c;
     72    Cell<3> c;
    7473    app.Run();
    7574
  • trunk/win32/lolcore.vcxproj

    r1510 r1512  
    175175    <ClInclude Include="..\src\lol\math\real.h" />
    176176    <ClInclude Include="..\src\lol\math\remez.h" />
     177    <ClInclude Include="..\src\lol\math\trig.h" />
    177178    <ClInclude Include="..\src\lol\math\vector.h" />
    178179    <ClInclude Include="..\src\lol\unit.h" />
    179180    <ClInclude Include="..\src\map.h" />
    180     <ClInclude Include="..\src\math\trig.h" />
    181181    <ClInclude Include="..\src\numeric.h" />
    182182    <ClInclude Include="..\src\platform.h" />
  • trunk/win32/lolcore.vcxproj.filters

    r1510 r1512  
    262262      <Filter>src\platform\sdl</Filter>
    263263    </ClInclude>
    264     <ClInclude Include="..\src\math\trig.h">
    265       <Filter>src\math</Filter>
    266     </ClInclude>
    267264    <ClInclude Include="..\src\lol\math\half.h">
    268265      <Filter>src\lol\math</Filter>
     
    272269    </ClInclude>
    273270    <ClInclude Include="..\src\lol\math\remez.h">
     271      <Filter>src\lol\math</Filter>
     272    </ClInclude>
     273    <ClInclude Include="..\src\lol\math\trig.h">
    274274      <Filter>src\lol\math</Filter>
    275275    </ClInclude>
Note: See TracChangeset for help on using the changeset viewer.