MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / Debug_Buckets_recursive

Method Debug_Buckets_recursive

CrySystem/ScriptObjectScript.cpp:102–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101
102DWORD CScriptObjectScript::Debug_Buckets_recursive( IScriptObject *pCurrent, string &sPath, std::set<const void *> &setVisited,
103 const DWORD dwMinBucket )
104{
105 assert(pCurrent);
106
107 DWORD dwTableElementCount=0;
108
109 pCurrent->BeginIteration();
110
111 while(pCurrent->MoveNext())
112 {
113 char *szKeyName;
114
115 dwTableElementCount++;
116
117 if(!pCurrent->GetCurrentKey(szKeyName))
118 szKeyName="NO";
119
120 ScriptVarType type=pCurrent->GetCurrentType();
121
122 if(type==svtObject) // svtNull,svtFunction,svtString,svtNumber,svtUserData,svtObject
123 {
124 const void *pVis;
125
126 pCurrent->GetCurrentPtr(pVis);
127
128 if(setVisited.count(pVis)!=0)
129 continue;
130
131 setVisited.insert(pVis);
132
133 {
134 IScriptObject *pNewObject = m_pScriptSystem->CreateEmptyObject();
135
136 pCurrent->GetCurrent(pNewObject);
137
138#if defined(LINUX)
139 string s = sPath+string("/")+szKeyName;
140 DWORD dwSubTableCount = Debug_Buckets_recursive(pNewObject,s,setVisited,dwMinBucket);
141#else
142 DWORD dwSubTableCount = Debug_Buckets_recursive(pNewObject,sPath+string("/")+szKeyName,setVisited,dwMinBucket);
143#endif
144 pNewObject->Release();
145
146 if(dwSubTableCount>=dwMinBucket)
147 {
148 GetISystem()->GetILog()->Log(" %8d '%s/%s'\n",dwSubTableCount,sPath.c_str(),szKeyName);
149 }
150 else dwTableElementCount+=dwSubTableCount;
151 }
152 }
153/* else if(type==svtFunction) // svtNull,svtFunction,svtString,svtNumber,svtUserData,svtObject
154 {
155 unsigned int *pCode=0;
156 int iSize=0;
157
158 if(pCurrent->GetCurrentFuncData(pCode,iSize))
159 if(pCode)

Callers

nothing calls this directly

Calls 15

BeginIterationMethod · 0.80
GetCurrentTypeMethod · 0.80
GetCurrentPtrMethod · 0.80
CreateEmptyObjectMethod · 0.80
GetILogMethod · 0.80
EndIterationMethod · 0.80
GetISystemFunction · 0.70
stringClass · 0.50
MoveNextMethod · 0.45
GetCurrentKeyMethod · 0.45
countMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected