From f45371e231ff1a71e0c3a364d6d574a27b5b31ec Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 20 Mar 2017 01:21:33 +0100 Subject: [PATCH] - reverted the counter for the vertex angle cache to a simple incrementing global variable. Using I_MSTime is not precise enough, because some camera textures can be done quicker. It was pointless anyway trying to make this multithreading-safe, the entire caching idea here makes no sense if two clippers can simultaneously work on the same level data without changing the memory organization and rendering it ineffective. --- src/gl/scene/gl_clipper.cpp | 5 +++-- src/gl/scene/gl_clipper.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gl/scene/gl_clipper.cpp b/src/gl/scene/gl_clipper.cpp index f82375800..f21cac634 100644 --- a/src/gl/scene/gl_clipper.cpp +++ b/src/gl/scene/gl_clipper.cpp @@ -38,10 +38,11 @@ #include "gl/scene/gl_clipper.h" #include "g_levellocals.h" +unsigned Clipper::starttime; Clipper::Clipper() { - starttime = I_MSTime(); + starttime++; } //----------------------------------------------------------------------------- @@ -94,7 +95,7 @@ void Clipper::Clear() cliphead = NULL; silhouette = NULL; - starttime = I_MSTime(); + starttime++; } //----------------------------------------------------------------------------- diff --git a/src/gl/scene/gl_clipper.h b/src/gl/scene/gl_clipper.h index 49b1d469f..c3897bd56 100644 --- a/src/gl/scene/gl_clipper.h +++ b/src/gl/scene/gl_clipper.h @@ -30,7 +30,7 @@ class ClipNode class Clipper { - unsigned starttime; + static unsigned starttime; FMemArena nodearena; ClipNode * freelist = nullptr;