Subversion Repositories Kolibri OS

Rev

Rev 8557 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8557 Rev 9097
Line 1... Line 1...
1
// WL_DRAW.C
1
// WL_DRAW.C
Line 2... Line 2...
2
 
2
 
-
 
3
#include "wl_def.h"
3
#include "wl_def.h"
4
#include 
Line 4... Line 5...
4
#pragma hdrstop
5
#pragma hdrstop
5
 
6
 
6
#include "wl_cloudsky.h"
7
#include "wl_cloudsky.h"
Line 1071... Line 1072...
1071
// calculate tics since last refresh for adaptive timing
1072
// calculate tics since last refresh for adaptive timing
1072
//
1073
//
1073
    if (lasttimecount > (int32_t) GetTimeCount())
1074
    if (lasttimecount > (int32_t) GetTimeCount())
1074
        lasttimecount = GetTimeCount();    // if the game was paused a LONG time
1075
        lasttimecount = GetTimeCount();    // if the game was paused a LONG time
Line 1075... Line 1076...
1075
 
1076
 
1076
    uint32_t curtime = SDL_GetTicks();
1077
    uint32_t curtime =  uSDL_GetTicks();
1077
    tics = (curtime * 7) / 100 - lasttimecount;
1078
    tics = (curtime * 7) / 100 - lasttimecount;
1078
    if(!tics)
1079
    if(!tics)
1079
    {
1080
    {
1080
        // wait until end of current tic
1081
        // wait until end of current tic
1081
        SDL_Delay(((lasttimecount + 1) * 100) / 7 - curtime);
1082
        uSDL_Delay(((lasttimecount + 1) * 100) / 7 - curtime);
1082
        tics = 1;
1083
        tics = 1;
Line 1083... Line 1084...
1083
    }
1084
    }