Skip to content

Commit

Permalink
- synced texture sampler setup fixes from Raze.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Jun 2, 2020
1 parent 83153ef commit 8480a39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/common/audio/music/music.cpp
Expand Up @@ -166,9 +166,9 @@ static bool S_StartMusicPlaying(ZMusic_MusicStream song, bool loop, float rel_vo

//==========================================================================
//
// S_PauseSound
// S_PauseMusic
//
// Stop music and sound effects, during game PAUSE.
// Stop music, during game PAUSE.
//==========================================================================

void S_PauseMusic ()
Expand All @@ -183,9 +183,9 @@ void S_PauseMusic ()

//==========================================================================
//
// S_ResumeSound
// S_ResumeMusic
//
// Resume music and sound effects, after game PAUSE.
// Resume music, after game PAUSE.
//==========================================================================

void S_ResumeMusic ()
Expand Down
9 changes: 5 additions & 4 deletions src/common/textures/hw_material.cpp
Expand Up @@ -40,7 +40,7 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
mShaderIndex = SHADER_Default;
sourcetex = tx;
auto imgtex = tx->GetTexture();
mTextureLayers.Push({ imgtex, scaleflags });
mTextureLayers.Push({ imgtex, scaleflags, -1 });

if (tx->GetUseType() == ETextureType::SWCanvas && static_cast<FWrapperTexture*>(imgtex)->GetColorFormat() == 0)
{
Expand All @@ -52,7 +52,8 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
{
mShaderIndex = tx->GetShaderIndex();
}
// no brightmap for cameratexture
mTextureLayers.Last().clampflags = CLAMP_CAMTEX;
// no additional layers for cameratexture
}
else
{
Expand All @@ -65,15 +66,15 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
{
for (auto &texture : { tx->Normal.get(), tx->Specular.get() })
{
mTextureLayers.Push({ texture, 0 });
mTextureLayers.Push({ texture, 0, -1 });
}
mShaderIndex = SHADER_Specular;
}
else if (tx->Normal.get() && tx->Metallic.get() && tx->Roughness.get() && tx->AmbientOcclusion.get())
{
for (auto &texture : { tx->Normal.get(), tx->Metallic.get(), tx->Roughness.get(), tx->AmbientOcclusion.get() })
{
mTextureLayers.Push({ texture, 0 });
mTextureLayers.Push({ texture, 0, -1 });
}
mShaderIndex = SHADER_PBR;
}
Expand Down

0 comments on commit 8480a39

Please sign in to comment.