MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / init

Method init

Engine/source/util/sampler.cpp:167–194  ·  view source on GitHub ↗

Open the file and emit a row with the names of all enabled keys.

Source from the content-addressed store, hash-verified

165
166 /// Open the file and emit a row with the names of all enabled keys.
167 virtual bool init( const char* fileName )
168 {
169 if( !mStream.open( fileName, Torque::FS::File::Write ) )
170 {
171 Con::errorf( "CSVSamplerBackend::init -- could not open '%s' for writing", fileName );
172 return false;
173 }
174
175 Con::printf( "CSVSamplerBackend::init -- writing samples to '%s'", fileName );
176
177 bool first = true;
178 for( U32 i = 0; i < gSampleKeys.size(); ++ i )
179 {
180 SampleKey& key = gSampleKeys[ i ];
181 if( key.mEnabled )
182 {
183 if( !first )
184 mStream.write( 1, "," );
185
186 mRecords.push_back( SampleRecord( i + 1 ) );
187 mStream.write( dStrlen( key.mName ), key.mName );
188 first = false;
189 }
190 }
191
192 newline();
193 return true;
194 }
195
196 virtual void beginFrame()
197 {

Callers

nothing calls this directly

Calls 8

printfFunction · 0.85
SampleRecordClass · 0.85
openMethod · 0.65
errorfFunction · 0.50
dStrlenFunction · 0.50
sizeMethod · 0.45
writeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected