mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
new turn off turn on mechanic
This commit is contained in:
parent
59d5cec1f8
commit
d4d5207987
@ -8,6 +8,7 @@ class CRCache:
|
||||
|
||||
def __init__(self, maxCacheItems=10):
|
||||
self.maxCacheItems = maxCacheItems
|
||||
self.storedCacheItems = maxCacheItems
|
||||
self.dict = {}
|
||||
self.fifo = []
|
||||
|
||||
@ -117,3 +118,11 @@ class CRCache:
|
||||
if isinstance(obj, NodePath):
|
||||
assert not obj.isEmpty() and obj.getTopNode() != render.node()
|
||||
return 1
|
||||
|
||||
def turnOff(self):
|
||||
self.flush()
|
||||
self.storedMaxCache = self.maxCacheItems
|
||||
self.maxCacheItems = 0
|
||||
|
||||
def turnOn(self):
|
||||
self.maxCacheItems = self.storedMaxCache
|
||||
|
Loading…
x
Reference in New Issue
Block a user