X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fcontent_cso.cpp;h=0790024fc9623f0319ac3523ae5c9d96452f4851;hb=d1df09841d0eac7a88f638676b80ec848522cca5;hp=73d5f2b480f47d3e181f9cabc55a02c4ba70b8b4;hpb=22e186b4aa88b585e71500c4e9a03bf69b0b6191;p=dragonfireclient.git diff --git a/src/content_cso.cpp b/src/content_cso.cpp index 73d5f2b48..0790024fc 100644 --- a/src/content_cso.cpp +++ b/src/content_cso.cpp @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "content_cso.h" #include -#include "tile.h" +#include "client/tile.h" #include "environment.h" #include "gamedef.h" #include "log.h" @@ -50,7 +50,7 @@ class SmokePuffCSO: public ClientSimpleObject m_spritenode = smgr->addBillboardSceneNode( NULL, v2f(1,1), pos, -1); m_spritenode->setMaterialTexture(0, - env->getGameDef()->tsrc()->getTextureRaw("smoke_puff.png")); + env->getGameDef()->tsrc()->getTextureForMesh("smoke_puff.png")); m_spritenode->setMaterialFlag(video::EMF_LIGHTING, false); m_spritenode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); //m_spritenode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF); @@ -60,13 +60,12 @@ class SmokePuffCSO: public ClientSimpleObject m_spritenode->setVisible(true); m_spritenode->setSize(size); /* Update brightness */ - u8 light = 64; - try{ - MapNode n = env->getMap().getNode(floatToInt(pos, BS)); - light = decode_light(n.getLightBlend(env->getDayNightRatio(), - env->getGameDef()->ndef())); - } - catch(InvalidPositionException &e){} + u8 light; + bool pos_ok; + MapNode n = env->getMap().getNodeNoEx(floatToInt(pos, BS), &pos_ok); + light = pos_ok ? decode_light(n.getLightBlend(env->getDayNightRatio(), + env->getGameDef()->ndef())) + : 64; video::SColor color(255,light,light,light); m_spritenode->setColor(color); }