Reset delta time when ending a transition.
This commit is contained in:
parent
3b8001d265
commit
f0868c7a29
|
@ -103,8 +103,15 @@ int main(int argc, char *argv[])
|
||||||
while (td >= LOGIC_RATE)
|
while (td >= LOGIC_RATE)
|
||||||
{
|
{
|
||||||
app.delegate.logic();
|
app.delegate.logic();
|
||||||
|
|
||||||
td -= LOGIC_RATE;
|
td -= LOGIC_RATE;
|
||||||
|
|
||||||
|
if (app.resetTimeDelta)
|
||||||
|
{
|
||||||
|
td = 0;
|
||||||
|
then = SDL_GetTicks();
|
||||||
|
}
|
||||||
|
|
||||||
game.stats[STAT_TIME]++;
|
game.stats[STAT_TIME]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -443,6 +443,7 @@ typedef struct {
|
||||||
} Mouse;
|
} Mouse;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
int resetTimeDelta;
|
||||||
char saveDir[MAX_FILENAME_LENGTH];
|
char saveDir[MAX_FILENAME_LENGTH];
|
||||||
int winWidth;
|
int winWidth;
|
||||||
int winHeight;
|
int winHeight;
|
||||||
|
|
|
@ -43,4 +43,6 @@ void endSectionTransition(void)
|
||||||
{
|
{
|
||||||
SDL_Delay(elasped);
|
SDL_Delay(elasped);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.resetTimeDelta = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,3 +24,5 @@ extern void prepareScene(void);
|
||||||
extern void presentScene(void);
|
extern void presentScene(void);
|
||||||
extern void clearInput(void);
|
extern void clearInput(void);
|
||||||
extern void expireTexts(int all);
|
extern void expireTexts(int all);
|
||||||
|
|
||||||
|
extern App app;
|
||||||
|
|
Loading…
Reference in New Issue