From 53691113d4aa587e62aa6da4edcad9dbd4f44743 Mon Sep 17 00:00:00 2001 From: plagman Date: Thu, 15 Oct 2009 16:02:55 +0000 Subject: [PATCH] Don't do interpolations if they're already being done. This would cause problems when using showview inside EVENT_DISPLAYROOMS. git-svn-id: https://svn.eduke32.com/eduke32@1531 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 11 +++++++++++ polymer/eduke32/source/duke3d.h | 1 + polymer/eduke32/source/global.c | 1 + 3 files changed, 13 insertions(+) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index c827cad5f..17c11c648 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -66,6 +66,11 @@ void G_DoInterpolations(int32_t smoothratio) //Stick at beginning of draws { int32_t i=g_numInterpolations-1, j = 0, odelta, ndelta = 0; + if (g_interpolationLock++) + { + return; + } + for (; i>=0; i--) { bakipos[i] = *curipos[i]; @@ -79,6 +84,12 @@ void G_DoInterpolations(int32_t smoothratio) //Stick at beginning of draws inline void G_RestoreInterpolations(void) //Stick at end of drawscreen { int32_t i=g_numInterpolations-1; + + if (--g_interpolationLock) + { + return; + } + for (; i>=0; i--) *curipos[i] = bakipos[i]; } diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 0fa9080d2..0391cf1b1 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -699,6 +699,7 @@ extern int32_t everyothertime; extern int32_t mymaxlag, otherminlag, bufferjitter; extern int32_t g_numInterpolations, startofdynamicinterpolations; +extern int32_t g_interpolationLock; extern int32_t oldipos[MAXINTERPOLATIONS]; extern int32_t bakipos[MAXINTERPOLATIONS]; extern int32_t *curipos[MAXINTERPOLATIONS]; diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index 372d25614..a928b0712 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -172,6 +172,7 @@ int32_t mymaxlag, otherminlag, bufferjitter = 1; int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128]; int32_t cloudtotalclock = 0,totalmemory = 0; int32_t g_numInterpolations = 0, startofdynamicinterpolations = 0; +int32_t g_interpolationLock = 0; int32_t oldipos[MAXINTERPOLATIONS]; int32_t bakipos[MAXINTERPOLATIONS]; int32_t *curipos[MAXINTERPOLATIONS];