Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
VisTableMgrClass.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE__VISTABLEMGRCLASS_H
13#define TT_INCLUDE__VISTABLEMGRCLASS_H
14
15#include "engine_common.h"
16#include "engine_vector.h"
17class CompressedVisTableClass;
18class VisTableClass;
19class VisDecompressionCacheClass
20{
21public:
22 SimpleVecClass<VisTableClass *> Cache; //0
23 MultiListClass<VisTableClass> tablelist; //C
24 int timestamp; //24
25 VisDecompressionCacheClass()
26 {
27 }
28 ~VisDecompressionCacheClass()
29 {
30 }
31 void Reset(int size);
32 VisTableClass *Get_Table(int id);
33 void Add_Table(VisTableClass *table);
34 void Release_Old_Tables();
35};
36class VisTableMgrClass
37{
38public:
39 int count; //0
40 int size; //4
41 SimpleDynVecClass<CompressedVisTableClass *> tables; //8
42 VisDecompressionCacheClass *cache; //18
43 int frames; //1C
44 VisTableMgrClass() : count(0), size(0), frames(0)
45 {
46 cache = new VisDecompressionCacheClass();
47 Reset();
48 }
49 ~VisTableMgrClass()
50 {
51 Reset();
52 if (cache)
53 {
54 cache->Reset(0);
55 delete cache;
56 }
57 }
58 void Reset()
59 {
60 Delete_All_Vis_Tables();
61 tables.Delete_All();
62 size = 1;
63 count = 0;
64 frames = 0;
65 cache->Reset(0);
66 }
67 void Delete_All_Vis_Tables();
68 unsigned int Get_Vis_Table_Size()
69 {
70 return size;
71 }
72 VisTableClass *Get_Vis_Table(int id,bool b);
73 void Save(ChunkSaveClass &csave);
74 void Load(ChunkLoadClass &cload);
75 int Allocate_Vis_Object_ID(int count);
76 int Allocate_Vis_Sector_ID(int count);
77 int Get_Vis_Table_Count()
78 {
79 return count;
80 }
81 bool Has_Vis_Table(int table)
82 {
83 return tables[table] != 0;
84 }
85 void Notify_Frame_Ended();
86 void Set_Optimized_Vis_Object_Count(int count)
87 {
88 size = count;
89 }
90 void Update_Vis_Table(int, VisTableClass *);
91}; //20
92
93#endif