| 202 | } |
| 203 | |
| 204 | void 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 |
no test coverage detected