Attempt to avoid framerate bug when paused
This commit is contained in:
parent
1c04cc5be7
commit
f2a4863425
22
rc.c
22
rc.c
|
@ -952,7 +952,9 @@ int main (int argc, char **argv) {
|
||||||
void tick(void) {
|
void tick(void) {
|
||||||
sprite_t *s;
|
sprite_t *s;
|
||||||
|
|
||||||
SDL_framerateDelay(&manager);
|
if (!paused) {
|
||||||
|
SDL_framerateDelay(&manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (paused) return;
|
if (paused) return;
|
||||||
|
@ -5263,7 +5265,9 @@ void drawlevel(void) {
|
||||||
// update screen
|
// update screen
|
||||||
//SDL_GL_SwapBuffers();
|
//SDL_GL_SwapBuffers();
|
||||||
SDL_UpdateRect(screen, 0,0,640,480);
|
SDL_UpdateRect(screen, 0,0,640,480);
|
||||||
SDL_framerateDelay(&manager);
|
if (!paused) {
|
||||||
|
SDL_framerateDelay(&manager);
|
||||||
|
}
|
||||||
|
|
||||||
// remove players
|
// remove players
|
||||||
if (curlevelnum != INTRO_LEVELNUM) {
|
if (curlevelnum != INTRO_LEVELNUM) {
|
||||||
|
@ -5362,7 +5366,7 @@ void drawlevel(void) {
|
||||||
// update screen
|
// update screen
|
||||||
//SDL_GL_SwapBuffers();
|
//SDL_GL_SwapBuffers();
|
||||||
SDL_UpdateRect(screen, 0,0,640,480);
|
SDL_UpdateRect(screen, 0,0,640,480);
|
||||||
SDL_framerateDelay(&manager);
|
if (!paused) SDL_framerateDelay(&manager);
|
||||||
|
|
||||||
// remove players
|
// remove players
|
||||||
if (curlevelnum != INTRO_LEVELNUM) {
|
if (curlevelnum != INTRO_LEVELNUM) {
|
||||||
|
@ -5460,7 +5464,7 @@ void drawlevel(void) {
|
||||||
// update screen
|
// update screen
|
||||||
//SDL_GL_SwapBuffers();
|
//SDL_GL_SwapBuffers();
|
||||||
SDL_UpdateRect(screen, 0,0,640,480);
|
SDL_UpdateRect(screen, 0,0,640,480);
|
||||||
SDL_framerateDelay(&manager);
|
if (!paused) SDL_framerateDelay(&manager);
|
||||||
|
|
||||||
|
|
||||||
// remove players
|
// remove players
|
||||||
|
@ -5559,7 +5563,7 @@ void drawlevel(void) {
|
||||||
// update screen
|
// update screen
|
||||||
//SDL_GL_SwapBuffers();
|
//SDL_GL_SwapBuffers();
|
||||||
SDL_UpdateRect(screen, 0,0,640,480);
|
SDL_UpdateRect(screen, 0,0,640,480);
|
||||||
SDL_framerateDelay(&manager);
|
if (!paused) SDL_framerateDelay(&manager);
|
||||||
|
|
||||||
// remove players
|
// remove players
|
||||||
if (curlevelnum != INTRO_LEVELNUM) {
|
if (curlevelnum != INTRO_LEVELNUM) {
|
||||||
|
@ -8921,8 +8925,10 @@ void togglefullscreen(void) {
|
||||||
|
|
||||||
// redraw background
|
// redraw background
|
||||||
SDL_BlitSurface(temps, NULL, screen, NULL);
|
SDL_BlitSurface(temps, NULL, screen, NULL);
|
||||||
/* redo framerate manager */
|
if (!paused) {
|
||||||
SDL_setFramerate(&manager, WANTFPS);
|
/* redo framerate manager */
|
||||||
|
SDL_setFramerate(&manager, WANTFPS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void initsdl(void) {
|
void initsdl(void) {
|
||||||
|
@ -11543,7 +11549,7 @@ void checkhiscores(sprite_t *who){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_framerateDelay(&manager);
|
if (!paused) SDL_framerateDelay(&manager);
|
||||||
SDL_UpdateRect(screen, 0,0,640,480);
|
SDL_UpdateRect(screen, 0,0,640,480);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue