mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-25 02:41:22 +00:00
fixed blended-decal rendering in textured mode
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@38 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
e08e297f3b
commit
0ae156cf51
2 changed files with 36 additions and 33 deletions
1
CHANGES
1
CHANGES
|
@ -5,6 +5,7 @@ that we distribute with the binaries. (see changelog)
|
|||
SPoG
|
||||
- Fixed crash when resetting preferences after startup failure.
|
||||
- Fixed crash on next-leak-spot with build-monitoring enabled.
|
||||
- Fixed doom3/quake4 blended-decal rendering when toggling lighting mode.
|
||||
|
||||
20/03/2006
|
||||
SPoG
|
||||
|
|
|
@ -1093,6 +1093,39 @@ public:
|
|||
}
|
||||
|
||||
realiseLighting();
|
||||
}
|
||||
|
||||
void unrealise()
|
||||
{
|
||||
GlobalTexturesCache().release(m_pTexture);
|
||||
|
||||
if(m_notfound != 0)
|
||||
{
|
||||
GlobalTexturesCache().release(m_notfound);
|
||||
}
|
||||
|
||||
unrealiseLighting();
|
||||
}
|
||||
|
||||
void realiseLighting()
|
||||
{
|
||||
if(m_lightingEnabled)
|
||||
{
|
||||
LoadImageCallback loader = GlobalTexturesCache().defaultLoader();
|
||||
if(!string_empty(m_template.m_heightmapScale.c_str()))
|
||||
{
|
||||
m_heightmapScale = evaluateFloat(m_template.m_heightmapScale, m_template.m_params, m_args);
|
||||
loader = LoadImageCallback(&m_heightmapScale, loadHeightmap);
|
||||
}
|
||||
m_pDiffuse = evaluateTexture(m_template.m_diffuse, m_template.m_params, m_args);
|
||||
m_pBump = evaluateTexture(m_template.m_bump, m_template.m_params, m_args, loader);
|
||||
m_pSpecular = evaluateTexture(m_template.m_specular, m_template.m_params, m_args);
|
||||
m_pLightFalloffImage = evaluateTexture(m_template.m_lightFalloffImage, m_template.m_params, m_args);
|
||||
|
||||
for(ShaderTemplate::MapLayers::const_iterator i = m_template.m_layers.begin(); i != m_template.m_layers.end(); ++i)
|
||||
{
|
||||
m_layers.push_back(evaluateLayer(*i, m_template.m_params, m_args));
|
||||
}
|
||||
|
||||
if(m_layers.size() == 1)
|
||||
{
|
||||
|
@ -1127,39 +1160,6 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void unrealise()
|
||||
{
|
||||
GlobalTexturesCache().release(m_pTexture);
|
||||
|
||||
if(m_notfound != 0)
|
||||
{
|
||||
GlobalTexturesCache().release(m_notfound);
|
||||
}
|
||||
|
||||
unrealiseLighting();
|
||||
}
|
||||
|
||||
void realiseLighting()
|
||||
{
|
||||
if(m_lightingEnabled)
|
||||
{
|
||||
LoadImageCallback loader = GlobalTexturesCache().defaultLoader();
|
||||
if(!string_empty(m_template.m_heightmapScale.c_str()))
|
||||
{
|
||||
m_heightmapScale = evaluateFloat(m_template.m_heightmapScale, m_template.m_params, m_args);
|
||||
loader = LoadImageCallback(&m_heightmapScale, loadHeightmap);
|
||||
}
|
||||
m_pDiffuse = evaluateTexture(m_template.m_diffuse, m_template.m_params, m_args);
|
||||
m_pBump = evaluateTexture(m_template.m_bump, m_template.m_params, m_args, loader);
|
||||
m_pSpecular = evaluateTexture(m_template.m_specular, m_template.m_params, m_args);
|
||||
m_pLightFalloffImage = evaluateTexture(m_template.m_lightFalloffImage, m_template.m_params, m_args);
|
||||
|
||||
for(ShaderTemplate::MapLayers::const_iterator i = m_template.m_layers.begin(); i != m_template.m_layers.end(); ++i)
|
||||
{
|
||||
m_layers.push_back(evaluateLayer(*i, m_template.m_params, m_args));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void unrealiseLighting()
|
||||
|
@ -1177,6 +1177,8 @@ public:
|
|||
GlobalTexturesCache().release((*i).texture());
|
||||
}
|
||||
m_layers.clear();
|
||||
|
||||
m_blendFunc = BlendFunc(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue