aboutsummaryrefslogtreecommitdiff
path: root/src/framework
diff options
context:
space:
mode:
authorsilver1ce <none@none>2010-02-27 15:25:14 +0200
committersilver1ce <none@none>2010-02-27 15:25:14 +0200
commitfcaa318fb36aca077ca9ba5bfe2707ae0fcbd377 (patch)
tree81007144350a78785d58a9797aac0385edb25589 /src/framework
parent1815d19b85c8b6685850e761a49e1c0d2d7f366b (diff)
Update visibility system
*visibility updates and ai relocations processed simultaneously for each grid *these operations now are not synchronized for different grids *some changes into structure of visibility notifiers --HG-- branch : trunk
Diffstat (limited to 'src/framework')
-rw-r--r--src/framework/GameSystem/NGrid.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/framework/GameSystem/NGrid.h b/src/framework/GameSystem/NGrid.h
index de3f4ccf56d..3810286e123 100644
--- a/src/framework/GameSystem/NGrid.h
+++ b/src/framework/GameSystem/NGrid.h
@@ -27,14 +27,19 @@
#include "GameSystem/Grid.h"
#include "GameSystem/GridReference.h"
#include "Timer.h"
+#include "Util.h"
+
+#define DEFAULT_VISIBILITY_NOTIFY_PERIOD 1000
class GridInfo
{
public:
GridInfo()
- : i_timer(0), i_unloadActiveLockCount(0), i_unloadExplicitLock(false), i_unloadReferenceLock(false) {}
+ : i_timer(0), i_unloadActiveLockCount(0), i_unloadExplicitLock(false), i_unloadReferenceLock(false),
+ vis_Update(0, irand(0,DEFAULT_VISIBILITY_NOTIFY_PERIOD)) {}
GridInfo(time_t expiry, bool unload = true )
- : i_timer(expiry), i_unloadActiveLockCount(0), i_unloadExplicitLock(!unload), i_unloadReferenceLock(false) {}
+ : i_timer(expiry), i_unloadActiveLockCount(0), i_unloadExplicitLock(!unload), i_unloadReferenceLock(false),
+ vis_Update(0, irand(0,DEFAULT_VISIBILITY_NOTIFY_PERIOD)) {}
const TimeTracker& getTimeTracker() const { return i_timer; }
bool getUnloadLock() const { return i_unloadActiveLockCount || i_unloadExplicitLock || i_unloadReferenceLock; }
void setUnloadExplicitLock( bool on ) { i_unloadExplicitLock = on; }
@@ -45,9 +50,11 @@ public:
void setTimer(const TimeTracker& pTimer) { i_timer = pTimer; }
void ResetTimeTracker(time_t interval) { i_timer.Reset(interval); }
void UpdateTimeTracker(time_t diff) { i_timer.Update(diff); }
-
+ PeriodicTimer& getRelocationTimer() { return vis_Update; }
private:
TimeTracker i_timer;
+ PeriodicTimer vis_Update;
+
uint16 i_unloadActiveLockCount : 16; // lock from active object spawn points (prevent clone loading)
bool i_unloadExplicitLock : 1; // explicit manual lock or config setting
bool i_unloadReferenceLock : 1; // lock from instance map copy