aboutsummaryrefslogtreecommitdiff
path: root/src/serverlist.h
Commit message (Expand)AuthorAge
* Fixes for compiling with a newer (system) jsoncpp (#4429)Rogier-52016-08-10
* Send real port to server listShadowNinja2015-01-23
* Serverlist: announce mg_name from map_meta.txt instead of minetest.confKahrl2014-11-10
* Fix serverlist code style, const-correctness, and typesShadowNinja2014-06-30
* Remove a lot of superfluous ifndef USE_CURL checkssapier2014-06-19
* Send long announce as POST, show OS in useragentproller2014-01-07
* Masterserver updateproller2013-10-18
* Masterserver mods announse, ipv6, better curl errorsproller2013-07-13
* Masterserver: report gameid, uptime, cosmetic fixes on server web pageproller2013-03-30
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* new auto masterserverproller2013-02-22
* Add a list of servers to the "Multiplayer" tabJeija2013-01-21
h Floor, Boston, MA 02110-1301 USA. */ #include "content_cso.h" #include <IBillboardSceneNode.h> #include "tile.h" #include "environment.h" #include "gamedef.h" #include "log.h" static void setBillboardTextureMatrix(scene::IBillboardSceneNode *bill, float txs, float tys, int col, int row) { video::SMaterial& material = bill->getMaterial(0); core::matrix4& matrix = material.getTextureMatrix(0); matrix.setTextureTranslate(txs*col, tys*row); matrix.setTextureScale(txs, tys); } class SmokePuffCSO: public ClientSimpleObject { float m_age; scene::IBillboardSceneNode *m_spritenode; public: SmokePuffCSO(scene::ISceneManager *smgr, ClientEnvironment *env, v3f pos, v2f size): m_age(0), m_spritenode(NULL) { infostream<<"SmokePuffCSO: constructing"<<std::endl; m_spritenode = smgr->addBillboardSceneNode( NULL, v2f(1,1), pos, -1); m_spritenode->setMaterialTexture(0, env->getGameDef()->tsrc()->getTextureRaw("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); m_spritenode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL); m_spritenode->setMaterialFlag(video::EMF_FOG_ENABLE, true); m_spritenode->setColor(video::SColor(255,0,0,0)); 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){} video::SColor color(255,light,light,light); m_spritenode->setColor(color); } virtual ~SmokePuffCSO() { infostream<<"SmokePuffCSO: destructing"<<std::endl; m_spritenode->remove(); } void step(float dtime) { m_age += dtime; if(m_age > 1.0){ m_to_be_removed = true; } } }; ClientSimpleObject* createSmokePuff(scene::ISceneManager *smgr, ClientEnvironment *env, v3f pos, v2f size) { return new SmokePuffCSO(smgr, env, pos, size); }