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

Method onPFXProcessed

Engine/source/postFx/postEffectVis.cpp:204–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void PostEffectVis::onPFXProcessed( PostEffect *pfx )
205{
206 // If we have no windows we can early out before even testing
207 // isAwake so we avoid creating the content control unnecessarily.
208 if ( mWindows.empty() )
209 return;
210
211 if ( !_getContentControl()->isAwake() )
212 return;
213
214 VisVector::iterator itr = mWindows.begin();
215 for ( ; itr != mWindows.end(); itr++ )
216 {
217 if ( itr->pfx == pfx )
218 {
219 GuiBitmapCtrl *pBmpCtrl = NULL;
220 GuiWindowCtrl *pWinCtrl = NULL;
221
222 if ( itr->bmp[Target] != NULL )
223 {
224 pBmpCtrl = itr->bmp[Target];
225 pWinCtrl = itr->window[Target];
226
227 GFXTextureObject *tex;
228
229 if ( pfx->mTargetTex )
230 tex = pfx->mTargetTex;
231 else
232 tex = PFXMGR->getBackBufferTex();
233
234 pBmpCtrl->setBitmapHandle( tex );
235
236 char caption[256];
237 char name[256];
238
239 if ( pfx->getName() == NULL || dStrlen( pfx->getName() ) == 0 )
240 dSprintf( name, 256, "(none)" );
241 else
242 dSprintf( name, 256, "%s", pfx->getName() );
243
244
245 if ( tex )
246 dSprintf( caption, 256, "%s[%i] target - %s [ %ix%i ]", name, pfx->getId(), pfx->mTargetName.c_str(), tex->getWidth(), tex->getHeight() );
247 else
248 dSprintf( caption, 256, "%s[%i] target", name, pfx->getId() );
249
250
251 pWinCtrl->setDataField( StringTable->insert("text"), NULL, caption );
252 }
253
254 for ( U32 i = Input1; i < TexCount; i++ )
255 {
256 if ( itr->bmp[i] == NULL )
257 continue;
258
259 pBmpCtrl = itr->bmp[i];
260 pWinCtrl = itr->window[i];
261

Callers 1

processMethod · 0.80

Calls 14

dSprintfFunction · 0.85
getBackBufferTexMethod · 0.80
getIdMethod · 0.65
dStrlenFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setBitmapHandleMethod · 0.45
getNameMethod · 0.45
c_strMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected