Changeset 1310


Ignore:
Timestamp:
Apr 29, 2012, 11:55:32 PM (8 years ago)
Author:
sam
Message:

core: tick methods now use seconds, like any sane system.

Location:
trunk
Files:
76 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/debugsprite.cpp

    r1198 r1310  
    4545}
    4646
    47 void DebugSprite::TickGame(float deltams)
     47void DebugSprite::TickGame(float seconds)
    4848{
    49     Entity::TickGame(deltams);
     49    Entity::TickGame(seconds);
    5050
    51     vec3 move = deltams * vec3(Input::GetAxis(0), 0.0f);
    52     data->pos += move * vec3(0.1f * sqrtf(2.0f), .1f, 0.1f);
     51    vec3 move = seconds * vec3(Input::GetAxis(0), 0.0f);
     52    data->pos += move * vec3(100.f * sqrtf(2.0f), 100.f, 100.f);
    5353}
    5454
    55 void DebugSprite::TickDraw(float deltams)
     55void DebugSprite::TickDraw(float seconds)
    5656{
    57     Entity::TickDraw(deltams);
     57    Entity::TickDraw(seconds);
    5858
    5959    ivec3 pos = (ivec3)data->pos;
  • trunk/deushax/debugsprite.h

    r221 r1310  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    2424
    2525protected:
    26     virtual void TickGame(float deltams);
    27     virtual void TickDraw(float deltams);
     26    virtual void TickGame(float seconds);
     27    virtual void TickDraw(float seconds);
    2828
    2929private:
  • trunk/deushax/game.cpp

    r735 r1310  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    4747}
    4848
    49 void Game::TickGame(float deltams)
     49void Game::TickGame(float seconds)
    5050{
    51     Entity::TickGame(deltams);
     51    Entity::TickGame(seconds);
    5252}
    5353
    54 void Game::TickDraw(float deltams)
     54void Game::TickDraw(float seconds)
    5555{
    56     Entity::TickDraw(deltams);
     56    Entity::TickDraw(seconds);
    5757
    5858    data->map->Render(-data->mousex, -data->mousey, 0);
  • trunk/deushax/game.h

    r289 r1310  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    2424protected:
    2525    /* Inherited from Entity */
    26     virtual void TickGame(float deltams);
    27     virtual void TickDraw(float deltams);
     26    virtual void TickGame(float seconds);
     27    virtual void TickDraw(float seconds);
    2828
    2929public:
  • trunk/deushax/mapviewer.cpp

    r735 r1310  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    4747}
    4848
    49 void MapViewer::TickGame(float deltams)
     49void MapViewer::TickGame(float seconds)
    5050{
    51     Entity::TickGame(deltams);
     51    Entity::TickGame(seconds);
    5252}
    5353
    54 void MapViewer::TickDraw(float deltams)
     54void MapViewer::TickDraw(float seconds)
    5555{
    56     Entity::TickDraw(deltams);
     56    Entity::TickDraw(seconds);
    5757
    5858    data->map->Render(-data->povx, -data->povy, 0);
  • trunk/deushax/mapviewer.h

    r289 r1310  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    2424protected:
    2525    /* Inherited from Entity */
    26     virtual void TickGame(float deltams);
    27     virtual void TickDraw(float deltams);
     26    virtual void TickGame(float seconds);
     27    virtual void TickDraw(float seconds);
    2828
    2929public:
  • trunk/monsterz/board.cpp

    r1300 r1310  
    109109    data->whip = Sampler::Register(WAV_WHIP);
    110110
    111     data->emitter = new Emitter(data->tiles, vec3(0, -0.0006f, 0));
     111    data->emitter = new Emitter(data->tiles, vec3(0, -600.f, 0));
    112112    Ticker::Ref(data->emitter);
    113113
     
    138138}
    139139
    140 void Board::TickGame(float deltams)
    141 {
    142     Entity::TickGame(deltams);
     140void Board::TickGame(float seconds)
     141{
     142    Entity::TickGame(seconds);
    143143
    144144    ivec3 buttons = Input::GetMouseButtons();
    145145
    146146    /* Do not whip too often, the sound may become annoying */
    147     data->whipdelay -= deltams;
     147    data->whipdelay -= seconds;
    148148
    149149    /* Get rid of finished mashes */
     
    250250}
    251251
    252 void Board::TickDraw(float deltams)
    253 {
    254     Entity::TickDraw(deltams);
     252void Board::TickDraw(float seconds)
     253{
     254    Entity::TickDraw(seconds);
    255255
    256256    Scene::GetDefault()->AddTile(data->board, 0, m_position, 0, vec2(1.0f));
  • trunk/monsterz/board.h

    r863 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    3636
    3737protected:
    38     virtual void TickGame(float deltams);
    39     virtual void TickDraw(float deltams);
     38    virtual void TickGame(float seconds);
     39    virtual void TickDraw(float seconds);
    4040
    4141    /* Hunt mode */
  • trunk/monsterz/interface.cpp

    r1300 r1310  
    6565}
    6666
    67 void Interface::TickGame(float deltams)
     67void Interface::TickGame(float seconds)
    6868{
    69     WorldEntity::TickGame(deltams);
     69    WorldEntity::TickGame(seconds);
    7070
    7171    switch (data->state)
     
    9191}
    9292
    93 void Interface::TickDraw(float deltams)
     93void Interface::TickDraw(float seconds)
    9494{
    95     WorldEntity::TickDraw(deltams);
     95    WorldEntity::TickDraw(seconds);
    9696
    9797    ivec3 mouse(Input::GetMousePos(), 0);
  • trunk/monsterz/interface.h

    r423 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    3030
    3131protected:
    32     virtual void TickGame(float deltams);
    33     virtual void TickDraw(float deltams);
     32    virtual void TickGame(float seconds);
     33    virtual void TickDraw(float seconds);
    3434
    3535private:
  • trunk/monsterz/mash.cpp

    r863 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    7878}
    7979
    80 void Mash::TickGame(float deltams)
     80void Mash::TickGame(float seconds)
    8181{
    82     Entity::TickGame(deltams);
     82    Entity::TickGame(seconds);
    8383
    8484    switch (data->state)
     
    106106    }
    107107    case MashData::DUH:
    108         if ((data->timer -= deltams) < 0.0f)
     108        if ((data->timer -= seconds) < 0.0f)
    109109        {
    110110            Sampler::PlaySample(data->pop);
     
    143143}
    144144
    145 void Mash::TickDraw(float deltams)
     145void Mash::TickDraw(float seconds)
    146146{
    147     Entity::TickDraw(deltams);
     147    Entity::TickDraw(seconds);
    148148}
    149149
  • trunk/monsterz/mash.h

    r423 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    3434
    3535protected:
    36     virtual void TickGame(float deltams);
    37     virtual void TickDraw(float deltams);
     36    virtual void TickGame(float seconds);
     37    virtual void TickDraw(float seconds);
    3838
    3939private:
  • trunk/monsterz/monsterz.h

    r1030 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    5656static int const MAX_PIECES = 12;
    5757
    58 /* Time step of the eagle, in milliseconds per pixel */
    59 static int const STEP_EAGLE = 10;
     58/* Time step of the eagle, in seconds per pixel */
     59static float const STEP_EAGLE = 0.01f;
    6060/* Number of clouds on screen */
    6161static int const MAX_CLOUDS = 10;
    6262
    6363/* Minimal duration of the idle loop */
    64 static int const DELAY_IDLE = 300;
     64static float const DELAY_IDLE = 0.3f;
    6565/* Minimal delay before a blink */
    66 static int const DELAY_BLINK = 10000;
     66static float const DELAY_BLINK = 10.f;
    6767/* Duration of a blink */
    68 static int const DURATION_BLINK = 200;
     68static float const DURATION_BLINK = 0.2f;
    6969/* Wait time until the next whip sound is allowed */
    70 static int const DELAY_WHIP = 300;
     70static float const DELAY_WHIP = 0.3f;
    7171/* Delay between a monster's surprise face and its explosion */
    72 static int const DELAY_DUH = 200;
     72static float const DELAY_DUH = 0.2f;
    7373/* Duration of the explosion */
    74 static int const DELAY_POP = 500;
     74static float const DELAY_POP = 0.5f;
    7575
    7676#endif // __MONSTERZ_MONSTERZ_H__
  • trunk/monsterz/piece.cpp

    r1198 r1310  
    223223    case PieceData::MOVE:
    224224        data->state = PieceData::UNGRAB;
    225         data->speed = 0.4f;
     225        data->speed = 400.f;
    226226        data->timer = 0.0f;
    227227        data->off = data->off_src = data->off + data->pos - pos;
     
    241241    case PieceData::MOVE:
    242242        data->state = PieceData::MOVE;
    243         data->speed = 0.3f;
     243        data->speed = 300.f;
    244244        data->timer = 0.0f;
    245245        data->pos_src = data->pos;
     
    253253}
    254254
    255 void Piece::TickGame(float deltams)
    256 {
    257     data->timers.blink -= deltams;
     255void Piece::TickGame(float seconds)
     256{
     257    data->timers.blink -= seconds;
    258258    if (data->timers.blink < 0.0f)
    259259        data->timers.blink = RandF(DELAY_BLINK, 2 * DELAY_BLINK);
    260260
    261     data->timers.idle -= deltams;
     261    data->timers.idle -= seconds;
    262262    if (data->timers.idle < 0.0f)
    263263        data->timers.idle = data->timers.idle_max
    264264                          = RandF(DELAY_IDLE, 2 * DELAY_IDLE);
    265265
    266     data->timers.pop -= deltams;
    267 
    268     switch (data->state)
    269     {
    270     case PieceData::IDLE:
    271     case PieceData::GRAB:
    272         break;
    273     case PieceData::UNGRAB:
    274     case PieceData::MOVE:
    275     {
    276         data->timer += deltams;
     266    data->timers.pop -= seconds;
     267
     268    switch (data->state)
     269    {
     270    case PieceData::IDLE:
     271    case PieceData::GRAB:
     272        break;
     273    case PieceData::UNGRAB:
     274    case PieceData::MOVE:
     275    {
     276        data->timer += seconds;
    277277
    278278        ivec2 trip = data->pos_dst - data->pos_src;
     
    299299            data->timer = 0.0f;
    300300        }
    301         if (data->timer > pos_time + 200.0f && data->timer > off_time + 200.0f)
     301        if (data->timer > pos_time + .2f && data->timer > off_time + .2f)
    302302            data->state = PieceData::IDLE;
    303303        break;
     
    314314            {
    315315                float angle = RandF(-1.2f, 1.2f);
    316                 float speed = RandF(0.3f, 0.5f);
     316                float speed = RandF(300.f, 500.f);
    317317                vec3 vel(speed * sinf(angle), speed * cosf(angle), 0.0f);
    318318                data->emitter->AddParticle(pieceid, pos, vel);
     
    326326        break;
    327327    }
    328     Entity::TickGame(deltams);
    329 }
    330 
    331 void Piece::TickDraw(float deltams)
    332 {
    333     Entity::TickDraw(deltams);
     328    Entity::TickGame(seconds);
     329}
     330
     331void Piece::TickDraw(float seconds)
     332{
     333    Entity::TickDraw(seconds);
    334334
    335335    int pieceid = data->pieceid, off = 0;
  • trunk/monsterz/piece.h

    r863 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    5757
    5858protected:
    59     virtual void TickGame(float deltams);
    60     virtual void TickDraw(float deltams);
     59    virtual void TickGame(float seconds);
     60    virtual void TickDraw(float seconds);
    6161
    6262private:
  • trunk/monsterz/score.cpp

    r740 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    5454}
    5555
    56 void Score::TickGame(float deltams)
     56void Score::TickGame(float seconds)
    5757{
    58     Text::TickGame(deltams);
     58    Text::TickGame(seconds);
    5959
    6060    if (data->display != data->score)
    6161    {
    62         data->countdown += deltams;
     62        data->countdown += seconds;
    6363
    64         if (data->countdown > 500.0f)
     64        if (data->countdown > 0.5f)
    6565        {
    6666            int diff = data->score - data->display;
     
    8585}
    8686
    87 void Score::TickDraw(float deltams)
     87void Score::TickDraw(float seconds)
    8888{
    89     Text::TickDraw(deltams);
     89    Text::TickDraw(seconds);
    9090}
    9191
  • trunk/monsterz/score.h

    r740 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    3232
    3333protected:
    34     virtual void TickGame(float deltams);
    35     virtual void TickDraw(float deltams);
     34    virtual void TickGame(float seconds);
     35    virtual void TickDraw(float seconds);
    3636
    3737private:
  • trunk/monsterz/thumbs.cpp

    r1198 r1310  
    5959}
    6060
    61 void Thumbs::TickGame(float deltams)
     61void Thumbs::TickGame(float seconds)
    6262{
    63     Entity::TickGame(deltams);
     63    Entity::TickGame(seconds);
    6464
    6565    for (int n = 0; n < data->npieces; n++)
     
    6767}
    6868
    69 void Thumbs::TickDraw(float deltams)
     69void Thumbs::TickDraw(float seconds)
    7070{
    71     Entity::TickDraw(deltams);
     71    Entity::TickDraw(seconds);
    7272
    7373    for (int n = 0; n < data->npieces; n++)
  • trunk/monsterz/thumbs.h

    r740 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    3434
    3535protected:
    36     virtual void TickGame(float deltams);
    37     virtual void TickDraw(float deltams);
     36    virtual void TickGame(float seconds);
     37    virtual void TickDraw(float seconds);
    3838
    3939private:
  • trunk/monsterz/title.cpp

    r1300 r1310  
    168168    data->period = TitleData::DAY;
    169169    data->nextperiod = TitleData::DAY;
    170     data->timer = RandF(2000.0f, 3000.0f);
     170    data->timer = RandF(2.0f, 3.0f);
    171171    /* Time needed for the eagle to cross the screen */
    172172    data->eagle.duration = (m_bbox[1].x - m_bbox[0].x + 16) * STEP_EAGLE;
     
    177177        data->cloudpos[n] = vec2(RandF((m_bbox[1] - m_bbox[0]).x),
    178178                                 RandF(80) + (m_bbox[1] - m_bbox[0]).y - 300);
    179         data->cloudspeed[n] = vec2(RandF(-0.01f, 0.01f));
     179        data->cloudspeed[n] = vec2(RandF(-10.f, 10.f));
    180180    }
    181181
     
    189189}
    190190
    191 void Title::TickGame(float deltams)
    192 {
    193     Entity::TickGame(deltams);
    194 
    195     data->timer -= deltams;
    196     data->eagle.timer -= deltams;
     191void Title::TickGame(float seconds)
     192{
     193    Entity::TickGame(seconds);
     194
     195    data->timer -= seconds;
     196    data->eagle.timer -= seconds;
    197197
    198198    /* Probability of playing an animation given the current period */
     
    207207    {
    208208        float wrap = m_bbox[1].x - m_bbox[0].x;
    209         data->cloudpos[n].x += deltams * data->cloudspeed[n].x;
     209        data->cloudpos[n].x += seconds * data->cloudspeed[n].x;
    210210        if (data->cloudpos[n].x > wrap)
    211211            data->cloudpos[n].x -= wrap;
     
    243243            data->state = TitleData::EVENT;
    244244            data->nframes = t1[data->animid];
    245             data->timer = data->length = data->nframes * 100.0f;
     245            data->timer = data->length = data->nframes * .1f;
    246246        }
    247247        else if (RandF() < p2[data->period])
     
    284284            data->state = TitleData::ANIM;
    285285            data->nframes = t2[data->animid];
    286             data->timer = data->length = data->nframes * 100.0f;
     286            data->timer = data->length = data->nframes * .1f;
    287287        }
    288288        else
     
    305305}
    306306
    307 void Title::TickDraw(float deltams)
    308 {
    309     Entity::TickDraw(deltams);
     307void Title::TickDraw(float seconds)
     308{
     309    Entity::TickDraw(seconds);
    310310
    311311    /* The background, always here. */
     
    342342    if (data->eagle.timer >= 0.0f)
    343343    {
    344         int eagleid = (int)(data->eagle.timer / 100) % 6;
     344        int eagleid = (int)(data->eagle.timer * 10.f) % 6;
    345345        if (data->period != TitleData::DAY)
    346346            eagleid += 6;
    347         float phase = sinf(data->eagle.timer * (2.0f * M_PI / 100 / 6));
     347        float phase = sinf(data->eagle.timer * (2.0f * M_PI * 10.f / 6));
    348348        int x = (data->eagle.duration - data->eagle.timer) / STEP_EAGLE;
    349349        int y = data->eagle.y + 5.0f * sinf(phase);
  • trunk/monsterz/title.h

    r422 r1310  
    22// Monsterz
    33//
    4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2005-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
     
    3333
    3434protected:
    35     virtual void TickGame(float deltams);
    36     virtual void TickDraw(float deltams);
     35    virtual void TickGame(float seconds);
     36    virtual void TickDraw(float seconds);
    3737
    3838private:
  • trunk/mrpigeon/blueenemy.cpp

    r1300 r1310  
    3030
    3131    m_position = vec3(512, 81, 0);
    32     m_velocity = vec3(-0.15f, 0, 0);
     32    m_velocity = vec3(-150.f, 0, 0);
    3333}
    3434
    35 void BlueEnemy::TickGame(float deltams)
     35void BlueEnemy::TickGame(float seconds)
    3636{
    37     Enemy::TickGame(deltams);
     37    Enemy::TickGame(seconds);
    3838
    39     deltams *= game->GetSpeed();
     39    seconds *= game->GetSpeed();
    4040
    41     enemytime = fmod(deltams + enemytime, 700.0f);;
     41    enemytime = fmod(seconds + enemytime, .7f);;
    4242
    43     m_position += m_velocity * deltams;
     43    m_position += m_velocity * seconds;
    4444}
    4545
    46 void BlueEnemy::TickDraw(float deltams)
     46void BlueEnemy::TickDraw(float seconds)
    4747{
    48     WorldEntity::TickDraw(deltams);
     48    WorldEntity::TickDraw(seconds);
    4949
    5050    /* + 48 because of vertical flip */
    51     Scene::GetDefault()->AddTile(m_position.x > 255 ? enemy_casualblue : enemy_casualblueattack, (int)(enemytime * 6 / 700.0f), m_position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
     51    Scene::GetDefault()->AddTile(m_position.x > 255 ? enemy_casualblue : enemy_casualblueattack, (int)(enemytime * 6 / .7f), m_position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
    5252}
    5353
  • trunk/mrpigeon/blueenemy.h

    r1211 r1310  
     1//
     2// MrPigeon
     3//
     4// Copyright: (c) 2012 Various People
     5//
     6
    17#if !defined __BLUEENEMY_H__
    28#define __BLUEENEMY_H__
     
    1420
    1521protected:
    16     virtual void TickGame(float deltams);
    17     virtual void TickDraw(float deltams);
     22    virtual void TickGame(float seconds);
     23    virtual void TickDraw(float seconds);
    1824
    1925    TileSet *enemy_casualblue,
  • trunk/mrpigeon/enemy.cpp

    r1211 r1310  
    2727}
    2828
    29 void Enemy::TickGame(float deltams)
     29void Enemy::TickGame(float seconds)
    3030{
    31     WorldEntity::TickGame(deltams);
     31    WorldEntity::TickGame(seconds);
    3232
    33     deltams *= game->GetSpeed();
     33    seconds *= game->GetSpeed();
    3434}
    3535
    36 void Enemy::TickDraw(float deltams)
     36void Enemy::TickDraw(float seconds)
    3737{
    38     WorldEntity::TickDraw(deltams);
     38    WorldEntity::TickDraw(seconds);
    3939}
    4040
  • trunk/mrpigeon/enemy.h

    r1211 r1310  
     1//
     2// MrPigeon
     3//
     4// Copyright: (c) 2012 Various People
     5//
     6
    17#if !defined __ENEMY_H__
    28#define __ENEMY_H__
     
    1319    virtual ~Enemy();
    1420
    15     virtual void TickGame(float deltams);
    16     virtual void TickDraw(float deltams);
     21    virtual void TickGame(float seconds);
     22    virtual void TickDraw(float seconds);
    1723
    1824    TileSet *enemy_casualblue,
  • trunk/mrpigeon/mrpigeon.cpp

    r1300 r1310  
    5656}
    5757
    58 void MrPigeon::TickGame(float deltams)
     58void MrPigeon::TickGame(float seconds)
    5959{
    60     WorldEntity::TickGame(deltams);
     60    WorldEntity::TickGame(seconds);
    6161
    62     totaltime += deltams;
     62    totaltime += seconds;
    6363
    64     if (totaltime > 100000.0f)
     64    if (totaltime > 100.0f)
    6565    {
    6666        speed = 1.8f;
     
    6868        active_deco_width = 192;
    6969    }
    70     else if (totaltime > 49000.0f)
     70    else if (totaltime > 49.0f)
    7171    {
    7272        speed = 1.5f;
     
    7474        active_deco_width = 288;
    7575    }
    76     else if (totaltime > 18000.0f)
     76    else if (totaltime > 18.0f)
    7777    {
    7878        speed = 1.2f;
     
    8787    }
    8888
    89     deltams *= GetSpeed();
     89    seconds *= GetSpeed();
    9090
    9191    /* Delete enemies that went past us */
     
    100100
    101101    /* Spawn enemies if necessary */
    102     spawntime += deltams;
    103     if (spawntime > 600.0f)
     102    spawntime += seconds;
     103    if (spawntime > .6f)
    104104    {
    105105        if (RandF(1.0f) < 0.2f)
    106             spawntime -= 300.0f;
    107         spawntime -= 600.0f;
     106            spawntime -= .3f;
     107        spawntime -= .6f;
    108108        for (int i = 0; i < 10; i++)
    109109        {
     
    112112                if (RandF(1.0f) < 0.4f)
    113113                    enemies[i] = new BlueEnemy(this);
    114                 else if (totaltime > 9000.0f && RandF(1.0f) < 0.3f)
     114                else if (totaltime > 9.0f && RandF(1.0f) < 0.3f)
    115115                    enemies[i] = new RedEnemy(this);
    116116
     
    123123
    124124    /* Scroll background etc. */
    125     railtime = fmod(railtime + deltams, 1000.0f);;
    126     backtime = fmod(backtime + deltams, 10000.0f / 288 * active_deco_width);;
     125    railtime = fmod(railtime + seconds, 1.0f);;
     126    backtime = fmod(backtime + seconds, 10.0f / 288 * active_deco_width);;
    127127
    128128    ivec3 buttons = Input::GetMouseButtons();
     
    140140}
    141141
    142 void MrPigeon::TickDraw(float deltams)
     142void MrPigeon::TickDraw(float seconds)
    143143{
    144     WorldEntity::TickDraw(deltams);
     144    WorldEntity::TickDraw(seconds);
    145145
    146146    Video::SetClearColor(vec4(0.0f, 0.0f, 0.0f, 1.0f));
     
    148148    Scene::GetDefault()->AddTile(hud_progress, 0, ivec3(18, 3, 0), 0, vec2(3.0f));
    149149
    150     int n = (int)(totaltime * 372 / 156000.0f);
     150    int n = (int)(totaltime * 372 / 156.0f);
    151151    if (n > 372)
    152152        n = 372;
    153153    Scene::GetDefault()->AddTile(hud_arrow, 0, ivec3(48 + n, 18, 10), 0, vec2(3.0f));
    154154
    155     for (int i = -(int)(backtime * 288 / 5000.0f); i < 512 + active_deco_width; i += active_deco_width)
     155    for (int i = -(int)(backtime * 288 / 5.0f); i < 512 + active_deco_width; i += active_deco_width)
    156156        Scene::GetDefault()->AddTile(active_deco, 0, ivec3(i, 300, 0), 0, vec2(1.0f));
    157157
    158     for (int i = -(int)(railtime * 72 / 1000.0f); i < 512 + 72; i += 72)
     158    for (int i = -(int)(railtime * 72 / 1.0f); i < 512 + 72; i += 72)
    159159        Scene::GetDefault()->AddTile(deco_floorrails, 0, ivec3(i, 57, 0), 0, vec2(1.0f));
    160160}
  • trunk/mrpigeon/mrpigeon.h

    r1211 r1310  
     1//
     2// MrPigeon
     3//
     4// Copyright: (c) 2012 Various People
     5//
     6
    17#if !defined __MRPIGEON_H__
    28#define __MRPIGEON_H__
     
    1420
    1521protected:
    16     virtual void TickGame(float deltams);
    17     virtual void TickDraw(float deltams);
     22    virtual void TickGame(float seconds);
     23    virtual void TickDraw(float seconds);
    1824
    1925    class Player *player;
  • trunk/mrpigeon/player.cpp

    r1300 r1310  
    2323#include "enemy.h"
    2424
    25 #define GRAVITY 0.0007f
    26 #define JUMPVEL 0.43f
    27 
    28 #define LEN_KICKAIR 500.0f
    29 #define LEN_KICKFLOOR 300.0f
     25#define GRAVITY 700.f
     26#define JUMPVEL 430.f
     27
     28#define LEN_KICKAIR .5f
     29#define LEN_KICKFLOOR .3f
    3030
    3131Player::Player(MrPigeon *in_game) :
     
    9595}
    9696
    97 void Player::TickGame(float deltams)
    98 {
    99     WorldEntity::TickGame(deltams);
    100 
    101     deltams *= game->GetSpeed();
    102 
    103     flytime = fmod(deltams + flytime, 400.0f);;
     97void Player::TickGame(float seconds)
     98{
     99    WorldEntity::TickGame(seconds);
     100
     101    seconds *= game->GetSpeed();
     102
     103    flytime = fmod(seconds + flytime, .4f);;
    104104
    105105    vec3 oldvel = m_velocity;
     
    108108    case WALKING:
    109109    case FUNKING:
    110         walktime = fmod(deltams + walktime, 700.0f);;
     110        walktime = fmod(seconds + walktime, .7f);;
    111111        break;
    112112    case KICKFLOOR:
    113         walktime += deltams;
     113        walktime += seconds;
    114114        if (walktime > LEN_KICKFLOOR)
    115115            state = WALKING;
    116116        break;
    117117    case FALLING:
    118         m_velocity.y -= deltams * GRAVITY;
    119         m_position += (oldvel + m_velocity) * (0.5 * deltams);
     118        m_velocity.y -= seconds * GRAVITY;
     119        m_position += (oldvel + m_velocity) * (0.5 * seconds);
    120120        if (m_position.y < 81.0f)
    121121        {
     
    125125        break;
    126126    case JUMPING:
    127         m_velocity.y -= deltams * GRAVITY;
    128         m_position += (oldvel + m_velocity) * (0.5 * deltams);
     127        m_velocity.y -= seconds * GRAVITY;
     128        m_position += (oldvel + m_velocity) * (0.5 * seconds);
    129129        if (m_velocity.y < 0.0f)
    130130            state = FALLING;
    131131        break;
    132132    case KICKAIR:
    133         walktime += deltams;
     133        walktime += seconds;
    134134        if (walktime >= LEN_KICKAIR)
    135135        {
     
    139139        break;
    140140    case DASHDOWN:
    141         m_velocity.y -= deltams * GRAVITY;
    142         m_position += (oldvel + m_velocity) * (0.5 * deltams);
     141        m_velocity.y -= seconds * GRAVITY;
     142        m_position += (oldvel + m_velocity) * (0.5 * seconds);
    143143        if (m_position.y < 81.0f)
    144144        {
     
    153153    case WALKING:
    154154        active_set = player_walk;
    155         active_frame = (int)(walktime * 8 / 700.0f);
     155        active_frame = (int)(walktime * 8 / .7f);
    156156        break;
    157157    case FUNKING:
    158158        active_set = player_walkraisefist;
    159         active_frame = (int)(walktime * 8 / 700.0f);
     159        active_frame = (int)(walktime * 8 / .7f);
    160160        break;
    161161    case KICKFLOOR:
     
    182182}
    183183
    184 void Player::TickDraw(float deltams)
    185 {
    186     WorldEntity::TickDraw(deltams);
    187 
    188     Scene::GetDefault()->AddTile(pigeon_flying, (int)(flytime * 2 / 400.0f), ivec3(81, 147, 5), 0, vec2(3.0f));
     184void Player::TickDraw(float seconds)
     185{
     186    WorldEntity::TickDraw(seconds);
     187
     188    Scene::GetDefault()->AddTile(pigeon_flying, (int)(flytime * 2 / .4f), ivec3(81, 147, 5), 0, vec2(3.0f));
    189189
    190190    Scene::GetDefault()->AddTile(active_set, active_frame, ivec3(m_position), 0, vec2(3.0f));
  • trunk/mrpigeon/player.h

    r1211 r1310  
     1//
     2// MrPigeon
     3//
     4// Copyright: (c) 2012 Various People
     5//
     6
    17#if !defined __PLAYER_H__
    28#define __PLAYER_H__
     
    1521
    1622protected:
    17     virtual void TickGame(float deltams);
    18     virtual void TickDraw(float deltams);
     23    virtual void TickGame(float seconds);
     24    virtual void TickDraw(float seconds);
    1925
    2026    MrPigeon *game;
  • trunk/mrpigeon/redenemy.cpp

    r1300 r1310  
    3131
    3232    m_position = vec3(512, 81, 0);
    33     m_velocity = vec3(-0.15f, 0, 0);
     33    m_velocity = vec3(-150.f, 0, 0);
    3434}
    3535
    36 void RedEnemy::TickGame(float deltams)
     36void RedEnemy::TickGame(float seconds)
    3737{
    38     Enemy::TickGame(deltams);
     38    Enemy::TickGame(seconds);
    3939
    40     deltams *= game->GetSpeed();
     40    seconds *= game->GetSpeed();
    4141
    42     enemytime = fmod(deltams + enemytime, 700.0f);;
     42    enemytime = fmod(seconds + enemytime, .7f);;
    4343
    44     m_position += m_velocity * deltams;
     44    m_position += m_velocity * seconds;
    4545}
    4646
    47 void RedEnemy::TickDraw(float deltams)
     47void RedEnemy::TickDraw(float seconds)
    4848{
    49     WorldEntity::TickDraw(deltams);
     49    WorldEntity::TickDraw(seconds);
    5050
    5151    /* + 48 because of vertical flip */
    52     Scene::GetDefault()->AddTile(enemy_casualred, (int)(enemytime * 6 / 700.0f), m_position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
     52    Scene::GetDefault()->AddTile(enemy_casualred, (int)(enemytime * 6 / .7f), m_position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
    5353}
    5454
  • trunk/mrpigeon/redenemy.h

    r1211 r1310  
     1//
     2// MrPigeon
     3//
     4// Copyright: (c) 2012 Various People
     5//
     6
    17#if !defined __REDENEMY_H__
    28#define __REDENEMY_H__
     
    1420
    1521protected:
    16     virtual void TickGame(float deltams);
    17     virtual void TickDraw(float deltams);
     22    virtual void TickGame(float seconds);
     23    virtual void TickDraw(float seconds);
    1824
    1925    TileSet *enemy_casualred,
  • trunk/orbital/orbital.cpp

    r1308 r1310  
    9292                          vec3(0, 1, 0));
    9393
    94         m_auto_cam_timer = 0.0f;
    95 
    96         m_horizontal_angle = 0;
    97         m_vertical_angle = 0;
    98         m_roll_angle = 0;
     94    m_auto_cam_timer = 0.0f;
     95
     96    m_horizontal_angle = 0;
     97    m_vertical_angle = 0;
     98    m_roll_angle = 0;
    9999
    100100    m_horizontal_angle_speed = 0.0f;
     
    108108}
    109109
    110 void Orbital::TickGame(float deltams)
    111 {
    112     WorldEntity::TickGame(deltams);
    113 
    114         //TEMP : Convert DT to seconds
    115         deltams /= 1000.0f;
    116 
    117         if (Input::GetButtonState(27 /*SDLK_ESCAPE*/))
     110void Orbital::TickGame(float seconds)
     111{
     112    WorldEntity::TickGame(seconds);
     113
     114    if (Input::GetButtonState(27 /*SDLK_ESCAPE*/))
    118115        Ticker::Shutdown();
    119116
    120         if (m_auto_cam_timer > 0.0f)
    121                 m_auto_cam_timer -= deltams;
    122 
    123         //Doing the query with actual values, cause I want to stay SDL-free for now.
    124         int HMovement = Input::GetButtonState(276 /*SDLK_LEFT*/) - Input::GetButtonState(275 /*SDLK_RIGHT*/);
    125         int VMovement = Input::GetButtonState(273 /*SDLK_UP*/) - Input::GetButtonState(274 /*SDLK_DOWN*/);
    126         int RMovement = Input::GetButtonState(256 /*SDLK_KP0*/) - Input::GetButtonState(305 /*SDLK_RCTRL*/);
     117    if (m_auto_cam_timer > 0.0f)
     118        m_auto_cam_timer -= seconds;
     119
     120    //Doing the query with actual values, cause I want to stay SDL-free for now.
     121    int HMovement = Input::GetButtonState(276 /*SDLK_LEFT*/) - Input::GetButtonState(275 /*SDLK_RIGHT*/);
     122    int VMovement = Input::GetButtonState(273 /*SDLK_UP*/) - Input::GetButtonState(274 /*SDLK_DOWN*/);
     123    int RMovement = Input::GetButtonState(256 /*SDLK_KP0*/) - Input::GetButtonState(305 /*SDLK_RCTRL*/);
    127124
    128125    float new_horizontal_angle_speed = 0.0f;
     
    130127    float new_roll_angle_speed = 0.0f;
    131128
    132         if (HMovement != 0 || VMovement != 0 || RMovement != 0)
    133         {
    134                 new_horizontal_angle_speed = ((float)HMovement) * 50.0f;
    135                 new_vertical_angle_speed = ((float)VMovement) * 50.0f;
    136                 new_roll_angle_speed = ((float)RMovement) * 50.0f;
    137                 m_auto_cam_timer = 2.0f;
    138         }
    139         else if (m_auto_cam_timer <= 0.0f)
    140         {
    141                 new_horizontal_angle_speed = 40.0f;
    142                 new_vertical_angle_speed = max<float>(min<float>(-m_vertical_angle, 20.0f), -20.0f);
    143                 new_roll_angle_speed = max<float>(min<float>(-m_roll_angle, 40.0f), -40.0f);
    144         }
    145 
    146         m_horizontal_angle_speed += (new_horizontal_angle_speed - m_horizontal_angle_speed) * (deltams / (deltams + 0.3f));
    147         m_vertical_angle_speed += (new_vertical_angle_speed - m_vertical_angle_speed) * (deltams / (deltams + 0.3f));
    148         m_roll_angle_speed += (new_roll_angle_speed - m_roll_angle_speed) * (deltams / (deltams + 0.3f));
    149 
    150         m_horizontal_angle += m_horizontal_angle_speed * deltams;
    151     m_vertical_angle += new_vertical_angle_speed * deltams;
    152     m_roll_angle += new_roll_angle_speed * deltams;
    153 
    154         if (m_horizontal_angle > 180.0f)
    155                 m_horizontal_angle -= 360.0f;
    156         else if (m_horizontal_angle < -180.0f)
    157                 m_horizontal_angle += 360.0f;
    158         if (m_vertical_angle > 180.0f)
    159                 m_vertical_angle -= 360.0f;
    160         else if (m_vertical_angle < -180.0f)
    161                 m_vertical_angle += 360.0f;
    162         if (m_roll_angle > 180.0f)
    163                 m_roll_angle -= 360.0f;
    164         else if (m_roll_angle < -180.0f)
    165                 m_roll_angle += 360.0f;
     129    if (HMovement != 0 || VMovement != 0 || RMovement != 0)
     130    {
     131        new_horizontal_angle_speed = ((float)HMovement) * 50.0f;
     132        new_vertical_angle_speed = ((float)VMovement) * 50.0f;
     133        new_roll_angle_speed = ((float)RMovement) * 50.0f;
     134        m_auto_cam_timer = 2.0f;
     135    }
     136    else if (m_auto_cam_timer <= 0.0f)
     137    {
     138        new_horizontal_angle_speed = 40.0f;
     139        new_vertical_angle_speed = max<float>(min<float>(-m_vertical_angle, 20.0f), -20.0f);
     140        new_roll_angle_speed = max<float>(min<float>(-m_roll_angle, 40.0f), -40.0f);
     141    }
     142
     143    m_horizontal_angle_speed += (new_horizontal_angle_speed - m_horizontal_angle_speed) * (seconds / (seconds + 0.3f));
     144    m_vertical_angle_speed += (new_vertical_angle_speed - m_vertical_angle_speed) * (seconds / (seconds + 0.3f));
     145    m_roll_angle_speed += (new_roll_angle_speed - m_roll_angle_speed) * (seconds / (seconds + 0.3f));
     146
     147    m_horizontal_angle += m_horizontal_angle_speed * seconds;
     148    m_vertical_angle += new_vertical_angle_speed * seconds;
     149    m_roll_angle += new_roll_angle_speed * seconds;
     150
     151    if (m_horizontal_angle > 180.0f)
     152        m_horizontal_angle -= 360.0f;
     153    else if (m_horizontal_angle < -180.0f)
     154        m_horizontal_angle += 360.0f;
     155    if (m_vertical_angle > 180.0f)
     156        m_vertical_angle -= 360.0f;
     157    else if (m_vertical_angle < -180.0f)
     158        m_vertical_angle += 360.0f;
     159    if (m_roll_angle > 180.0f)
     160        m_roll_angle -= 360.0f;
     161    else if (m_roll_angle < -180.0f)
     162        m_roll_angle += 360.0f;
    166163
    167164    mat4 animH = mat4::rotate(m_horizontal_angle, vec3(0, 1, 0));
     
    175172}
    176173
    177 void Orbital::TickDraw(float deltams)
    178 {
    179     WorldEntity::TickDraw(deltams);
     174void Orbital::TickDraw(float seconds)
     175{
     176    WorldEntity::TickDraw(seconds);
    180177
    181178    if (!m_ready)
  • trunk/orbital/orbital.h

    r1308 r1310  
     1//
     2// Orbital
     3//
     4// Copyright: (c) 2012 Various People
     5//
     6
    17#if !defined __ORBITAL_H__
    28#define __ORBITAL_H__
     
    1521
    1622protected:
    17     virtual void TickGame(float deltams);
    18     virtual void TickDraw(float deltams);
     23    virtual void TickGame(float seconds);
     24    virtual void TickDraw(float seconds);
    1925
    2026private:
     
    2531    float m_roll_angle_speed;
    2632
    27         float m_horizontal_angle;
     33    float m_horizontal_angle;
    2834    float m_vertical_angle;
    2935    float m_roll_angle;
    3036
    31         mat4 m_modelview, m_proj;
     37    mat4 m_modelview, m_proj;
    3238    mat3 m_normalmat;
    3339
  • trunk/orbital/particlesystem.h

    r1296 r1310  
    2121
    2222        for (int i = 0; i < 200; i++)
    23             m_particles.Append(vec3(0), vec3(0), RandF(0.f, 2000.f));
     23            m_particles.Append(vec3(0), vec3(0), RandF(0.f, 2.f));
    2424    }
    2525
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams)
     33    virtual void TickGame(float seconds)
    3434    {
    35         WorldEntity::TickGame(deltams);
     35        WorldEntity::TickGame(seconds);
    3636
    3737        for (int i = 0; i < m_particles.Count(); i++)
    3838        {
    39             m_particles[i].m3 += deltams;
    40             if (m_particles[i].m3 > 2000.f)
     39            m_particles[i].m3 += seconds;
     40            if (m_particles[i].m3 > 2.f)
    4141            {
    4242                m_particles[i].m1 = vec3(RandF(-1.f, 1.f), RandF(-1.f, 1.f), RandF(-1.f, 1.f));
    4343                m_particles[i].m2 = normalize(vec3(RandF(-1.f, 1.f), RandF(-1.f, 1.f), RandF(-1.f, 1.f)));
    44                 m_particles[i].m3 = RandF(0.f, 2000.f);
     44                m_particles[i].m3 = RandF(0.f, 2.f);
    4545            }
    4646
    47             m_particles[i].m1 += deltams * .1f * m_particles[i].m2;
     47            m_particles[i].m1 += seconds * 100.f * m_particles[i].m2;
    4848        }
    4949
    50         m_angle += deltams * 0.1f;
     50        m_angle += seconds * 100.f;
    5151    }
    5252
    53     virtual void TickDraw(float deltams)
     53    virtual void TickDraw(float seconds)
    5454    {
    55         WorldEntity::TickDraw(deltams);
     55        WorldEntity::TickDraw(seconds);
    5656
    5757        if (!m_ready)
  • trunk/src/camera.cpp

    r1307 r1310  
    5353}
    5454
    55 void Camera::TickGame(float deltams)
     55void Camera::TickGame(float seconds)
    5656{
    57     WorldEntity::TickGame(deltams);
     57    WorldEntity::TickGame(seconds);
    5858
    5959    m_view_matrix = mat4::lookat(m_position, m_target, m_up);
     
    6262}
    6363
    64 void Camera::TickDraw(float deltams)
     64void Camera::TickDraw(float seconds)
    6565{
    66     WorldEntity::TickDraw(deltams);
     66    WorldEntity::TickDraw(seconds);
    6767}
    6868
  • trunk/src/camera.h

    r1307 r1310  
    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
     
    3636
    3737protected:
    38     virtual void TickGame(float deltams);
    39     virtual void TickDraw(float deltams);
     38    virtual void TickGame(float seconds);
     39    virtual void TickDraw(float seconds);
    4040
    4141private:
  • trunk/src/debug/fps.cpp

    r1309 r1310  
    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
     
    5656}
    5757
    58 void DebugFps::TickGame(float deltams)
     58void DebugFps::TickGame(float seconds)
    5959{
    60     Entity::TickGame(deltams);
     60    Entity::TickGame(seconds);
    6161
    6262    char buf[1024];
  • trunk/src/debug/fps.h

    r783 r1310  
    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
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams);
     33    virtual void TickGame(float seconds);
    3434
    3535private:
  • trunk/src/debug/quad.cpp

    r1228 r1310  
    9797        for (npoints = 0; npoints < SINE_SIZE && x <= 1.0f; npoints++)
    9898        {
    99             float y = 0.5f + 0.5f * lol_sin(x * 2.0f * M_PI + time * 5e-3f);
     99            float y = 0.5f + 0.5f * lol_sin(x * 2.0f * M_PI + time * 5.f);
    100100            points[npoints * 2] = aa.x + (bb.x - aa.x) * x;
    101101            points[npoints * 2 + 1] = aa.y + (bb.y - aa.y) * y;
    102102
    103             float dy = M_PI * lol_cos(x * 2.0f * M_PI + time * 5e-3f);
     103            float dy = M_PI * lol_cos(x * 2.0f * M_PI + time * 5.f);
    104104            float dx = SINE_SPACE / sqrtf(1.0f + dy * dy);
    105105            x += dx;
     
    120120{
    121121    data->initialised = 0;
    122     data->time = RandF(10000.0f);
     122    data->time = RandF(10.0f);
    123123
    124124    m_drawgroup = DRAWGROUP_HUD;
     
    143143}
    144144
    145 void DebugQuad::TickGame(float deltams)
     145void DebugQuad::TickGame(float seconds)
    146146{
    147     Entity::TickGame(deltams);
    148 
    149     data->time += deltams;
     147    Entity::TickGame(seconds);
     148
     149    data->time += seconds;
    150150}
    151151
    152 void DebugQuad::TickDraw(float deltams)
     152void DebugQuad::TickDraw(float seconds)
    153153{
    154     Entity::TickDraw(deltams);
     154    Entity::TickDraw(seconds);
    155155
    156156    if (!data->initialised && !IsDestroying())
     
    214214    GLfloat texcoords[12];
    215215    mat4 t1 = mat4::translate(0.5f, 0.5f, 0.0f)
    216             * mat4::rotate(0.0254f * data->time, 0.0f, 0.0f, 1.0f)
     216            * mat4::rotate(25.4f * data->time, 0.0f, 0.0f, 1.0f)
    217217            * mat4::translate(-0.5f, -0.5f, 0.0f);
    218218    for (int i = 0; i < 6; i++)
     
    225225    GLfloat colors[18];
    226226    mat4 t2 = mat4::translate(0.5f, 0.5f, 0.5f)
    227             * mat4::rotate(0.0154f * data->time, 0.0f, 0.0f, 1.0f)
    228             * mat4::rotate(0.0211f * data->time, 0.0f, 1.0f, 0.0f)
    229             * mat4::rotate(0.0267f * data->time, 1.0f, 0.0f, 0.0f)
     227            * mat4::rotate(15.4f * data->time, 0.0f, 0.0f, 1.0f)
     228            * mat4::rotate(21.1f * data->time, 0.0f, 1.0f, 0.0f)
     229            * mat4::rotate(26.7f * data->time, 1.0f, 0.0f, 0.0f)
    230230            * mat4::translate(-0.5f, -0.5f, 0.0f);
    231231    for (int i = 0; i < 6; i++)
  • trunk/src/debug/quad.h

    r814 r1310  
    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
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams);
    34     virtual void TickDraw(float deltams);
     33    virtual void TickGame(float seconds);
     34    virtual void TickDraw(float seconds);
    3535
    3636private:
  • trunk/src/debug/record.cpp

    r1110 r1310  
    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
     
    6363}
    6464
    65 void DebugRecord::TickGame(float deltams)
     65void DebugRecord::TickGame(float seconds)
    6666{
    67     Entity::TickGame(deltams);
     67    Entity::TickGame(seconds);
    6868}
    6969
    70 void DebugRecord::TickDraw(float deltams)
     70void DebugRecord::TickDraw(float seconds)
    7171{
    72     Entity::TickDraw(deltams);
     72    Entity::TickDraw(seconds);
    7373
    7474    ivec2 size = Video::GetSize();
  • trunk/src/debug/record.h

    r783 r1310  
    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
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams);
    34     virtual void TickDraw(float deltams);
     33    virtual void TickGame(float seconds);
     34    virtual void TickDraw(float seconds);
    3535
    3636private:
  • trunk/src/debug/sphere.cpp

    r1208 r1310  
    122122}
    123123
    124 void DebugSphere::TickGame(float deltams)
    125 {
    126     Entity::TickGame(deltams);
    127 
    128     data->time += 0.003f * deltams;
     124void DebugSphere::TickGame(float seconds)
     125{
     126    Entity::TickGame(seconds);
     127
     128    data->time += 3.f * seconds;
    129129    while (data->time > 6.0 * M_PI)
    130130        data->time -= 6.0 * M_PI;
    131131}
    132132
    133 void DebugSphere::TickDraw(float deltams)
    134 {
    135     Entity::TickDraw(deltams);
     133void DebugSphere::TickDraw(float seconds)
     134{
     135    Entity::TickDraw(seconds);
    136136
    137137    if (IsDestroying())
  • trunk/src/debug/sphere.h

    r783 r1310  
    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
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams);
    34     virtual void TickDraw(float deltams);
     33    virtual void TickGame(float seconds);
     34    virtual void TickDraw(float seconds);
    3535
    3636private:
  • trunk/src/debug/stats.cpp

    r1110 r1310  
    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
     
    4747}
    4848
    49 void DebugStats::TickGame(float deltams)
     49void DebugStats::TickGame(float seconds)
    5050{
    51     Entity::TickGame(deltams);
     51    Entity::TickGame(seconds);
    5252
    5353    fprintf(data->fp, "%i %f %f %f %f\n",
  • trunk/src/debug/stats.h

    r783 r1310  
    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
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams);
     33    virtual void TickGame(float seconds);
    3434
    3535private:
  • trunk/src/emitter.cpp

    r1198 r1310  
    5151}
    5252
    53 void Emitter::TickGame(float deltams)
     53void Emitter::TickGame(float seconds)
    5454{
    5555    for (int i = 0; i < data->nparticles; i++)
    5656    {
    5757        vec3 oldvelocity = data->velocities[i];
    58         data->velocities[i] += deltams * data->gravity;
    59         data->positions[i] += deltams * 0.5f
     58        data->velocities[i] += seconds * data->gravity;
     59        data->positions[i] += seconds * 0.5f
    6060                                      * (oldvelocity + data->velocities[i]);
    6161        if (data->positions[i].y < -100)
     
    6868    }
    6969
    70     Entity::TickGame(deltams);
     70    Entity::TickGame(seconds);
    7171}
    7272
    73 void Emitter::TickDraw(float deltams)
     73void Emitter::TickDraw(float seconds)
    7474{
    75     Entity::TickDraw(deltams);
     75    Entity::TickDraw(seconds);
    7676
    7777    for (int i = 0; i < data->nparticles; i++)
  • trunk/src/emitter.h

    r790 r1310  
    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
     
    3434
    3535protected:
    36     virtual void TickGame(float deltams);
    37     virtual void TickDraw(float deltams);
     36    virtual void TickGame(float seconds);
     37    virtual void TickDraw(float seconds);
    3838
    3939private:
  • trunk/src/entity.cpp

    r1110 r1310  
    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
     
    5151}
    5252
    53 void Entity::TickGame(float deltams)
     53void Entity::TickGame(float seconds)
    5454{
    5555#if !LOL_RELEASE
     
    6060}
    6161
    62 void Entity::TickDraw(float deltams)
     62void Entity::TickDraw(float seconds)
    6363{
    6464#if !LOL_RELEASE
  • trunk/src/entity.h

    r1110 r1310  
    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
     
    3939    inline int IsDestroying() { return m_destroy; }
    4040
    41     virtual void TickGame(float deltams);
    42     virtual void TickDraw(float deltams);
     41    virtual void TickGame(float seconds);
     42    virtual void TickDraw(float seconds);
    4343
    4444    enum
  • trunk/src/font.cpp

    r1198 r1310  
    6060}
    6161
    62 void Font::TickDraw(float deltams)
     62void Font::TickDraw(float seconds)
    6363{
    64     Entity::TickDraw(deltams);
     64    Entity::TickDraw(seconds);
    6565}
    6666
  • trunk/src/font.h

    r1198 r1310  
    3333    /* Inherited from Entity */
    3434    virtual char const *GetName();
    35     virtual void TickDraw(float deltams);
     35    virtual void TickDraw(float seconds);
    3636
    3737public:
  • trunk/src/gradient.cpp

    r1300 r1310  
    5252}
    5353
    54 void Gradient::TickGame(float deltams)
    55 {
    56     Entity::TickGame(deltams);
    57 }
    58 
    59 void Gradient::TickDraw(float deltams)
    60 {
    61     Entity::TickDraw(deltams);
     54void Gradient::TickGame(float seconds)
     55{
     56    Entity::TickGame(seconds);
     57}
     58
     59void Gradient::TickDraw(float seconds)
     60{
     61    Entity::TickDraw(seconds);
    6262
    6363    float const vertex[] = {   0.0f,   0.0f, 0.0f,
  • trunk/src/gradient.h

    r860 r1310  
    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
     
    3333
    3434protected:
    35     virtual void TickGame(float deltams);
    36     virtual void TickDraw(float deltams);
     35    virtual void TickGame(float seconds);
     36    virtual void TickDraw(float seconds);
    3737
    3838private:
  • trunk/src/input.h

    r1308 r1310  
    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
     
    3131    static ivec2 GetMousePos();
    3232    static ivec3 GetMouseButtons();
    33         //BH : Added this, is a v0.1 Alpha version.
     33    //BH : Added this, is a v0.1 Alpha version.
    3434    static int GetButtonState(int button);
    3535
  • trunk/src/platform/ps3/ps3input.cpp

    r1110 r1310  
    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
     
    8282}
    8383
    84 void Ps3Input::TickGame(float deltams)
     84void Ps3Input::TickGame(float seconds)
    8585{
    86     Entity::TickGame(deltams);
     86    Entity::TickGame(seconds);
    8787
    8888#if defined __CELLOS_LV2__
     
    108108            int x = data->pad_data[i].button[CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_X];
    109109            int y = data->pad_data[i].button[CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_X + 1];
    110             vec2 delta(4e-3f * (abs(x - 127) < 16 ? 0 : x - 127),
    111                        -4e-3f * (abs(y - 127) < 16 ? 0 : y - 127));
    112             data->mousepos += delta * deltams;
     110            vec2 delta(4.f * (abs(x - 127) < 16 ? 0 : x - 127),
     111                       -4.f * (abs(y - 127) < 16 ? 0 : y - 127));
     112            data->mousepos += delta * seconds;
    113113            Input::SetMousePos((ivec2)data->mousepos);
    114114        }
  • trunk/src/platform/ps3/ps3input.h

    r865 r1310  
    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
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams);
     33    virtual void TickGame(float seconds);
    3434
    3535private:
  • trunk/src/platform/sdl/sdlinput.cpp

    r1171 r1310  
    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
     
    3232
    3333private:
    34     void Tick(float deltams);
     34    void Tick(float seconds);
    3535
    3636    static ivec2 GetMousePos();
     
    5151}
    5252
    53 void SdlInput::TickGame(float deltams)
     53void SdlInput::TickGame(float seconds)
    5454{
    55     Entity::TickGame(deltams);
     55    Entity::TickGame(seconds);
    5656
    5757#if !defined _WIN32
    58     data->Tick(deltams);
     58    data->Tick(seconds);
    5959#endif
    6060}
    6161
    62 void SdlInput::TickDraw(float deltams)
     62void SdlInput::TickDraw(float seconds)
    6363{
    64     Entity::TickDraw(deltams);
     64    Entity::TickDraw(seconds);
    6565
    6666#if defined _WIN32
    67     data->Tick(deltams);
     67    data->Tick(seconds);
    6868#endif
    6969}
    7070
    71 void SdlInputData::Tick(float deltams)
     71void SdlInputData::Tick(float seconds)
    7272{
    7373#if defined USE_SDL
     
    8787#if 0
    8888        case SDL_KEYDOWN:
    89             Input::KeyPressed(event.key.keysym.sym, deltams);
     89            Input::KeyPressed(event.key.keysym.sym, seconds);
    9090            break;
    9191#endif
     
    110110    for (int i = 0; i < 256; i++)
    111111        if (keystate[i])
    112             Input::KeyPressed(i, deltams);
     112            Input::KeyPressed(i, seconds);
    113113#endif
    114114#endif
  • trunk/src/platform/sdl/sdlinput.h

    r1171 r1310  
    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
     
    3131
    3232protected:
    33     virtual void TickGame(float deltams);
    34     virtual void TickDraw(float deltams);
     33    virtual void TickGame(float seconds);
     34    virtual void TickDraw(float seconds);
    3535
    3636private:
  • trunk/src/sample.cpp

    r950 r1310  
    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
     
    7878}
    7979
    80 void Sample::TickGame(float deltams)
     80void Sample::TickGame(float seconds)
    8181{
    82     Entity::TickGame(deltams);
     82    Entity::TickGame(seconds);
    8383}
    8484
  • trunk/src/sample.h

    r748 r1310  
    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
     
    3636    /* Inherited from Entity */
    3737    virtual char const *GetName();
    38     virtual void TickGame(float deltams);
     38    virtual void TickGame(float seconds);
    3939
    4040public:
  • trunk/src/sprite.cpp

    r1300 r1310  
    4242}
    4343
    44 void Sprite::TickGame(float deltams)
     44void Sprite::TickGame(float seconds)
    4545{
    46     Entity::TickGame(deltams);
     46    Entity::TickGame(seconds);
    4747}
    4848
    49 void Sprite::TickDraw(float deltams)
     49void Sprite::TickDraw(float seconds)
    5050{
    51     Entity::TickDraw(deltams);
     51    Entity::TickDraw(seconds);
    5252
    5353    Scene::GetDefault()->AddTile(data->tileset, data->id, m_position,
  • trunk/src/sprite.h

    r862 r1310  
    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
     
    3232
    3333protected:
    34     virtual void TickGame(float deltams);
    35     virtual void TickDraw(float deltams);
     34    virtual void TickGame(float seconds);
     35    virtual void TickDraw(float seconds);
    3636
    3737private:
  • trunk/src/text.cpp

    r1110 r1310  
    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
     
    8181}
    8282
    83 void Text::TickDraw(float deltams)
     83void Text::TickDraw(float seconds)
    8484{
    85     Entity::TickDraw(deltams);
     85    Entity::TickDraw(seconds);
    8686
    8787    if (data->text)
  • trunk/src/text.h

    r866 r1310  
    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
     
    4343
    4444protected:
    45     virtual void TickDraw(float deltams);
     45    virtual void TickDraw(float seconds);
    4646
    4747private:
  • trunk/src/ticker.cpp

    r1309 r1310  
    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
     
    3333        todolist(0), autolist(0),
    3434        nentities(0),
    35         frame(0), recording(0), deltams(0), bias(0), fps(0),
     35        frame(0), recording(0), deltatime(0), bias(0), fps(0),
    3636        quit(0), quitframe(0), quitdelay(20), panic(0)
    3737    {
     
    6969    int frame, recording;
    7070    Timer timer;
    71     float deltams, bias, fps;
     71    float deltatime, bias, fps;
    7272
    7373    /* Background threads */
     
    182182        data->frame++;
    183183
    184         /* If recording with fixed framerate, set deltams to a fixed value */
     184        /* If recording with fixed framerate, set deltatime to a fixed value */
    185185        if (data->recording && data->fps)
    186186        {
    187             data->deltams = 1000.0f / data->fps;
     187            data->deltatime = 1.f / data->fps;
    188188        }
    189189        else
    190190        {
    191             data->deltams = 1000.0f * data->timer.Get();
    192             data->bias += data->deltams;
     191            data->deltatime = data->timer.Get();
     192            data->bias += data->deltatime;
    193193        }
    194194
     
    279279                    e->m_tickstate = Entity::STATE_PRETICK_GAME;
    280280#endif
    281                     e->TickGame(data->deltams);
     281                    e->TickGame(data->deltatime);
    282282#if !LOL_RELEASE
    283283                    if (e->m_tickstate != Entity::STATE_POSTTICK_GAME)
     
    369369                e->m_tickstate = Entity::STATE_PRETICK_DRAW;
    370370#endif
    371                 e->TickDraw(data->deltams);
     371                e->TickDraw(data->deltatime);
    372372#if !LOL_RELEASE
    373373                if (e->m_tickstate != Entity::STATE_POSTTICK_DRAW)
     
    392392    /* If framerate is fixed, force wait time to 1/FPS. Otherwise, set wait
    393393     * time to 0. */
    394     float framems = data->fps ? 1000.0f / data->fps : 0.0f;
    395 
    396     if (framems > data->bias + 200.0f)
    397         framems = data->bias + 200.0f; // Don't go below 5 fps
    398     if (framems > data->bias)
    399         data->timer.Wait(1e-3f * (framems - data->bias));
     394    float frametime = data->fps ? 1.f / data->fps : 0.f;
     395
     396    if (frametime > data->bias + .2f)
     397        frametime = data->bias + .2f; // Don't go below 5 fps
     398    if (frametime > data->bias)
     399        data->timer.Wait(frametime - data->bias);
    400400
    401401    /* If recording, do not try to compensate for lag. */
    402402    if (!data->recording)
    403         data->bias -= framems;
     403        data->bias -= frametime;
    404404}
    405405
  • trunk/src/tileset.cpp

    r1241 r1310  
    112112}
    113113
    114 void TileSet::TickDraw(float deltams)
    115 {
    116     Entity::TickDraw(deltams);
     114void TileSet::TickDraw(float seconds)
     115{
     116    Entity::TickDraw(seconds);
    117117
    118118    if (IsDestroying())
  • trunk/src/tileset.h

    r1233 r1310  
    3838    /* Inherited from Entity */
    3939    virtual char const *GetName();
    40     virtual void TickDraw(float deltams);
     40    virtual void TickDraw(float seconds);
    4141
    4242public:
  • trunk/src/world.cpp

    r1110 r1310  
    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
     
    5757}
    5858
    59 void World::TickGame(float deltams)
     59void World::TickGame(float seconds)
    6060{
    61     Entity::TickGame(deltams);
     61    Entity::TickGame(seconds);
    6262}
    6363
    64 void World::TickDraw(float deltams)
     64void World::TickDraw(float seconds)
    6565{
    66     Entity::TickDraw(deltams);
     66    Entity::TickDraw(seconds);
    6767}
    6868
  • trunk/src/world.h

    r748 r1310  
    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
     
    3333    /* Inherited from Entity */
    3434    virtual char const *GetName();
    35     virtual void TickGame(float deltams);
    36     virtual void TickDraw(float deltams);
     35    virtual void TickGame(float seconds);
     36    virtual void TickDraw(float seconds);
    3737
    3838public:
  • trunk/src/worldentity.cpp

    r1300 r1310  
    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
     
    4747}
    4848
    49 void WorldEntity::TickGame(float deltams)
     49void WorldEntity::TickGame(float seconds)
    5050{
    51     Entity::TickGame(deltams);
     51    Entity::TickGame(seconds);
    5252}
    5353
    54 void WorldEntity::TickDraw(float deltams)
     54void WorldEntity::TickDraw(float seconds)
    5555{
    56     Entity::TickDraw(deltams);
     56    Entity::TickDraw(seconds);
    5757}
    5858
  • trunk/src/worldentity.h

    r1300 r1310  
    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
     
    4040    virtual char const *GetName();
    4141
    42     virtual void TickGame(float deltams);
    43     virtual void TickDraw(float deltams);
     42    virtual void TickGame(float seconds);
     43    virtual void TickDraw(float seconds);
    4444};
    4545
  • trunk/test/tutorial/01_triangle.cpp

    r1269 r1310  
    4343    }
    4444
    45     virtual void TickDraw(float deltams)
     45    virtual void TickDraw(float seconds)
    4646    {
    47         WorldEntity::TickDraw(deltams);
     47        WorldEntity::TickDraw(seconds);
    4848
    4949        if (!m_ready)
  • trunk/test/tutorial/02_cube.cpp

    r1269 r1310  
    22// Lol Engine - Cube tutorial
    33//
    4 // Copyright: (c) 2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2011-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
     
    6262    }
    6363
    64     virtual void TickGame(float deltams)
     64    virtual void TickGame(float seconds)
    6565    {
    66         WorldEntity::TickGame(deltams);
     66        WorldEntity::TickGame(seconds);
    6767
    68         m_angle += deltams / 1000.0f * 45.0f;
     68        m_angle += seconds * 45.0f;
    6969
    7070        mat4 anim = mat4::rotate(m_angle, vec3(0, 1, 0));
     
    7676    }
    7777
    78     virtual void TickDraw(float deltams)
     78    virtual void TickDraw(float seconds)
    7979    {
    80         WorldEntity::TickDraw(deltams);
     80        WorldEntity::TickDraw(seconds);
    8181
    8282        if (!m_ready)
  • trunk/test/tutorial/03_fractal.cpp

    r1300 r1310  
    22// Lol Engine - Fractal tutorial
    33//
    4 // Copyright: (c) 2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2011-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
     
    101101        //m_center = f64cmplx(0.001643721971153, 0.822467633298876);
    102102        m_center = f64cmplx(-0.65823419062254, 0.50221777363480);
    103         m_zoom_speed = -0.000025;
     103        m_zoom_speed = -0.025;
    104104#else
    105105        m_center = -0.75;
     
    202202    }
    203203
    204     virtual void TickGame(float deltams)
     204    virtual void TickGame(float seconds)
    205205    {
    206         WorldEntity::TickGame(deltams);
     206        WorldEntity::TickGame(seconds);
    207207
    208208        int prev_frame = m_frame;
     
    235235            if (m_translate != 0.0)
    236236            {
    237                 m_translate *= pow(2.0, -deltams * 0.005);
     237                m_translate *= pow(2.0, -seconds * 5.0);
    238238                if (m_translate.norm() / m_radius < 1e-4)
    239239                    m_translate = 0.0;
     
    243243        if ((buttons[0] || buttons[2]) && m_mousepos.x != -1)
    244244        {
    245             double zoom = buttons[0] ? -0.0005 : 0.0005;
    246             m_zoom_speed += deltams * zoom;
    247             if (m_zoom_speed / zoom > 5)
    248                 m_zoom_speed = 5 * zoom;
     245            double zoom = buttons[0] ? -0.5 : 0.5;
     246            m_zoom_speed += seconds * zoom;
     247            if (m_zoom_speed / zoom > 5e-3f)
     248                m_zoom_speed = 5e-3f * zoom;
    249249        }
    250250        else if (m_zoom_speed)
    251251        {
    252             m_zoom_speed *= pow(2.0, -deltams * 0.005);
     252            m_zoom_speed *= pow(2.0, -seconds * 5.0);
    253253            if (abs(m_zoom_speed) < 1e-5 || m_drag)
    254254                m_zoom_speed = 0.0;
     
    260260            f64cmplx oldcenter = m_center;
    261261            double oldradius = m_radius;
    262             double zoom = pow(2.0, deltams * m_zoom_speed);
     262            double zoom = pow(2.0, seconds * 1e3f * m_zoom_speed);
    263263            if (m_radius * zoom > 8.0)
    264264            {
     
    426426    }
    427427
    428     virtual void TickDraw(float deltams)
     428    virtual void TickDraw(float seconds)
    429429    {
    430         WorldEntity::TickDraw(deltams);
     430        WorldEntity::TickDraw(seconds);
    431431
    432432        static float const vertices[] =
  • trunk/test/xolotl/xolotl.cpp

    r1050 r1310  
    33//
    44// Copyright: (c) 2011 Soren Renner
    5 //            (c) 2011 Sam Hocevar <sam@hocevar.net>
     5//            (c) 2011-2012 Sam Hocevar <sam@hocevar.net>
    66//   This program is free software; you can redistribute it and/or
    77//   modify it under the terms of the Do What The Fuck You Want To
     
    5050    virtual char const *GetName() { return "Xolotl"; }
    5151
    52     virtual void TickGame(float deltams)
     52    virtual void TickGame(float seconds)
    5353    {
    5454
    5555    }
    5656
    57     virtual void TickDraw(float deltams)
     57    virtual void TickDraw(float seconds)
    5858    {
    5959
Note: See TracChangeset for help on using the changeset viewer.