From 7480ac9754b79277551237a4efce2862834921a0 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Sun, 19 Apr 2026 19:40:50 +0100 Subject: [PATCH] Update postEffectVis.cpp PFXVis few fixes of bugs and what not also allow it to update the names for multiple targets, these would probably need to be multiple windows Furthermore we can support up to 16 inputs and 4 colour targets, but the pfxvis is limited to 4 inputs and 1 output --- Engine/source/postFx/postEffectVis.cpp | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Engine/source/postFx/postEffectVis.cpp b/Engine/source/postFx/postEffectVis.cpp index 471727a3b..69bca92ca 100644 --- a/Engine/source/postFx/postEffectVis.cpp +++ b/Engine/source/postFx/postEffectVis.cpp @@ -103,7 +103,7 @@ void PostEffectVis::open( PostEffect *pfx ) // Only allocate window/bitmaps for input textures that are actually used. if ( i > Target ) { - if ( pfx->mTextureAsset[i-1].notNull() && pfx->mTextureAsset[i - 1]->getImageFile() == StringTable->EmptyString()) + if ( pfx->mTextureAsset[i-1].isNull()) { window.window[i] = NULL; window.bmp[i] = NULL; @@ -197,7 +197,7 @@ void PostEffectVis::onStartOfFrame() if ( !itr->bmp[i] || itr->pfx->getRenderTime() == PFXTexGenOnDemand ) continue; - itr->bmp[i]->setBitmap( NULL ); + itr->bmp[i]->setBitmap( ""); _setDefaultCaption( *itr, i ); } } @@ -225,32 +225,32 @@ void PostEffectVis::onPFXProcessed( PostEffect *pfx ) { pBmpCtrl = itr->bmp[Target]; pWinCtrl = itr->window[Target]; + String caption; - GFXTextureObject *tex; + for (U32 c = 0; c < PostEffect::NumMRTTargets; c++) + { + GFXTextureObject* tex; - if ( pfx->mTargetTex[0]) - tex = pfx->mTargetTex[0]; - else - tex = PFXMGR->getBackBufferTex(); + if (pfx->mTargetTex[c]) + tex = pfx->mTargetTex[c]; + else + tex = PFXMGR->getBackBufferTex(); - pBmpCtrl->setBitmapHandle( tex ); + pBmpCtrl->setBitmapHandle(tex); - char caption[256]; - char name[256]; - - if ( pfx->getName() == NULL || dStrlen( pfx->getName() ) == 0 ) - dSprintf( name, 256, "(none)" ); - else - dSprintf( name, 256, "%s", pfx->getName() ); + if (pfx->getName() == NULL || dStrlen(pfx->getName()) == 0) + caption += "(none)"; + else + caption += String::ToString(pfx->getName()); - if ( tex ) - dSprintf( caption, 256, "%s[%i] target - %s [ %ix%i ]", name, pfx->getId(), pfx->mTargetName[0].c_str(), tex->getWidth(), tex->getHeight()); - else - dSprintf( caption, 256, "%s[%i] target", name, pfx->getId() ); - - - pWinCtrl->setDataField( StringTable->insert("text"), NULL, caption ); + if (tex) + caption += String::ToString("[%i] target - %s [ %ix%i ]", pfx->getId(), pfx->mTargetName[c].c_str(), tex->getWidth(), tex->getHeight()); + else + caption += String::ToString("[%i] target", pfx->getId()); + } + + pWinCtrl->setDataField( StringTable->insert("text"), NULL, caption.c_str() ); } for ( U32 i = Input1; i < TexCount; i++ )