Skip to content

Commit 249749d

Browse files
committedDec 23, 2014
Temporarily fix always bright wieldhand with shaders enabled
1 parent 0483f91 commit 249749d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎src/wieldmesh.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,12 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename,
292292
#if (IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR >= 2
293293
material.setFlag(video::EMF_USE_MIP_MAPS, false);
294294
#endif
295-
if (m_enable_shaders)
295+
296+
#if 0
297+
//// TODO(RealBadAngel): Reactivate when shader is added for wield items
298+
if (m_enable_shaders)
296299
material.setTexture(2, tsrc->getTexture("disable_img.png"));
300+
#endif
297301
}
298302

299303
void WieldMeshSceneNode::setItem(const ItemStack &item, IGameDef *gamedef)
@@ -306,10 +310,13 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, IGameDef *gamedef)
306310
const ContentFeatures &f = ndef->get(def.name);
307311
content_t id = ndef->getId(def.name);
308312

313+
#if 0
314+
//// TODO(RealBadAngel): Reactivate when shader is added for wield items
309315
if (m_enable_shaders) {
310316
u32 shader_id = shdrsrc->getShader("nodes_shader", TILE_MATERIAL_BASIC, NDT_NORMAL);
311317
m_material_type = shdrsrc->getShaderInfo(shader_id).material;
312318
}
319+
#endif
313320

314321
// If wield_image is defined, it overrides everything else
315322
if (def.wield_image != "") {
@@ -341,7 +348,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, IGameDef *gamedef)
341348
translateMesh(m_meshnode->getMesh(), v3f(-BS, -BS, -BS));
342349
m_meshnode->setScale(
343350
def.wield_scale * WIELD_SCALE_FACTOR
344-
/ (BS * f.visual_scale));
351+
/ (BS * f.visual_scale));
345352
}
346353
for (u32 i = 0; i < m_meshnode->getMaterialCount(); ++i) {
347354
assert(i < 6);
@@ -357,6 +364,8 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, IGameDef *gamedef)
357364
material.setTexture(0, f.tiles[i].texture);
358365
}
359366
material.MaterialType = m_material_type;
367+
#if 0
368+
//// TODO(RealBadAngel): Reactivate when shader is added for wield items
360369
if (m_enable_shaders) {
361370
if (f.tiles[i].normal_texture) {
362371
if (animated) {
@@ -370,6 +379,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, IGameDef *gamedef)
370379
material.setTexture(2, tsrc->getTexture("disable_img.png"));
371380
}
372381
}
382+
#endif
373383
}
374384
return;
375385
}

0 commit comments

Comments
 (0)
Please sign in to comment.