Skip to content

Commit

Permalink
Merge pull request #1201 from BeamNG/fix_old_projects
Browse files Browse the repository at this point in the history
Fix non OpenGL builds with old projects.
  • Loading branch information
LuisAntonRebollo committed Feb 15, 2015
2 parents 1d501ea + 1f8dc19 commit 128cca1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Engine/source/materials/customMaterialDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/materials/processedCustomMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 128cca1

Please sign in to comment.