Skip to content

Commit 136d209

Browse files
Merge remote-tracking branch 'dhewm3/master'
2 parents 0b45549 + 81bfd0c commit 136d209

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

neo/framework/Common.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,13 @@ void Com_UpdateTicNumber() {
247247
int numTics = 1 + timeDiff * 0.06;
248248
com_ticNumber += numTics;
249249

250-
nextTicTime += numTics * com_preciseFrameLengthMS;
250+
// the number of msec per tic can be varied with the timescale cvar
251+
float timescale = com_timescale.GetFloat();
252+
if ( timescale == 1.0f ) {
253+
nextTicTime += numTics * com_preciseFrameLengthMS;
254+
} else {
255+
nextTicTime += numTics * com_preciseFrameLengthMS / timescale;
256+
}
251257
}
252258
}
253259
}
@@ -2601,7 +2607,8 @@ void idCommonLocal::Frame( void ) {
26012607
// set idLib frame number for frame based memory dumps
26022608
idLib::frameNumber = com_frameNumber;
26032609

2604-
if ( GLimp_GetSwapInterval() != 0 && fabsf(60.0f - GLimp_GetDisplayRefresh()) < 1.0f ) {
2610+
if ( com_timescale.GetFloat() == 1.0f && GLimp_GetSwapInterval() != 0
2611+
&& fabsf(60.0f - GLimp_GetDisplayRefresh()) < 1.0f ) {
26052612
// if we're using vsync and the display is running at about 60Hz, start next tic
26062613
// immediately so our internal tic time and vsync don't drift apart
26072614
double now = Sys_MillisecondsPrecise();

neo/renderer/Model_local.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ class idRenderModelMD3 : public idRenderModelStatic {
232232
int dataSize; // just for listing purposes
233233
struct md3Header_s * md3; // only if type == MOD_MESH
234234
int numLods;
235-
236-
int lastFrame;
237-
int lastOldFrame;
238-
float lastBackLerp;
239235
idList<const idMaterial*> shaders; // DG: md3Shader_t::shaderIndex indexes into this array
240236

241237
// DG: added the following so we can generate/store sil edges for shadows

neo/renderer/Model_md3.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ If you have questions concerning this license or the applicable additional terms
3939
***********************************************************************/
4040

4141
// DG: added constructor to make sure all members are initialized
42-
idRenderModelMD3::idRenderModelMD3() : index(-1), dataSize(0), md3(NULL), numLods(0),
43-
lastFrame(-1), lastOldFrame(0), lastBackLerp(0.0f)
42+
idRenderModelMD3::idRenderModelMD3() : index(-1), dataSize(0), md3(NULL), numLods(0)
4443
{}
4544

4645
// DG: added destructor to clean up the newly added silInfos (and md3 which used to leak)
@@ -329,21 +328,10 @@ idRenderModel *idRenderModelMD3::InstantiateDynamicModel( const struct renderEnt
329328
backlerp = ent->shaderParms[SHADERPARM_MD3_BACKLERP];
330329

331330
if ( cachedModel ) {
332-
if ( !r_useCachedDynamicModels.GetBool() || frame != lastFrame
333-
|| oldframe != lastOldFrame || backlerp != lastBackLerp ) {
334-
delete cachedModel;
335-
cachedModel = NULL;
336-
} else {
337-
// if we're still in the same animation frame etc, just use the existing model
338-
return cachedModel;
339-
}
331+
delete cachedModel;
332+
cachedModel = NULL;
340333
}
341334

342-
// DG: remember (old)frame and backlerp for the check above if the cached model can be reused
343-
lastFrame = frame;
344-
lastOldFrame = oldframe;
345-
lastBackLerp = backlerp;
346-
347335
staticModel = new idRenderModelStatic;
348336
staticModel->InitEmpty("_MD3_Snapshot_");
349337
staticModel->bounds.Clear();

0 commit comments

Comments
 (0)