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