From 1f8dc19fbee566f853720b64b95e52b26b59d044 Mon Sep 17 00:00:00 2001 From: LuisAntonRebollo Date: Sun, 15 Feb 2015 20:27:46 +0100 Subject: [PATCH] Fix non OpenGL builds with old projects. --- Engine/source/materials/customMaterialDefinition.cpp | 2 ++ Engine/source/materials/processedCustomMaterial.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Engine/source/materials/customMaterialDefinition.cpp b/Engine/source/materials/customMaterialDefinition.cpp index bda6a9afe..b0b6dca4c 100644 --- a/Engine/source/materials/customMaterialDefinition.cpp +++ b/Engine/source/materials/customMaterialDefinition.cpp @@ -150,6 +150,8 @@ bool CustomMaterial::onAdd() getName(), samplerName.c_str(), mShaderDataName.c_str() )); Con::errorf(error); + pos = i; + #if TORQUE_OPENGL GFXAssertFatal(0, error); continue; diff --git a/Engine/source/materials/processedCustomMaterial.cpp b/Engine/source/materials/processedCustomMaterial.cpp index f2fd7678c..90994af69 100644 --- a/Engine/source/materials/processedCustomMaterial.cpp +++ b/Engine/source/materials/processedCustomMaterial.cpp @@ -409,14 +409,14 @@ void ProcessedCustomMaterial::setTextureStages( SceneRenderState *state, const S if ( !texObject ) texObject = GFXTexHandle::ZERO; - if ( handles->mRTParamsSC[i]->isValid() && texObject ) + if ( handles->mRTParamsSC[samplerRegister]->isValid() && texObject ) { const Point3I &targetSz = texObject->getSize(); const RectI &targetVp = texTarget->getViewport(); Point4F rtParams; ScreenSpace::RenderTargetParameters(targetSz, targetVp, rtParams); - shaderConsts->set(handles->mRTParamsSC[i], rtParams); + shaderConsts->set(handles->mRTParamsSC[samplerRegister], rtParams); } GFX->setTexture( samplerRegister, texObject );