aboutsummaryrefslogtreecommitdiff
path: root/src/voxel.cpp
Commit message (Expand)AuthorAge
* Implement propagateSunlight for VoxelManipulatorPerttu Ahola2012-03-27
* Optimize lighting by a tiny bitPerttu Ahola2011-11-29
* GameDef compilesPerttu Ahola2011-11-29
* extended content-type rangePerttu Ahola2011-07-23
* Moved some mapnode content stuff from mapnode.{h,cpp} and digging property st...Perttu Ahola2011-06-17
* partly working chunk-based map generator (doesn't save properly, spawn is pre...Perttu Ahola2011-02-01
* map generation framework under development... not quite operational at this p...Perttu Ahola2011-01-30
* Reworked texture, material, mineral and whatever handlingPerttu Ahola2011-01-26
* removed alternative name "pressure" from param2Perttu Ahola2011-01-25
* Faster lighting at map generation timePerttu Ahola2011-01-24
* commented out old water stuffPerttu Ahola2011-01-24
* old water removed, some fixes here and therePerttu Ahola2011-01-17
* working goodPerttu Ahola2010-12-26
* some work-in-progressPerttu Ahola2010-12-22
* organizing stuff.Perttu Ahola2010-12-21
* framework for modifying texturesPerttu Ahola2010-12-20
* day/night working client sidePerttu Ahola2010-12-19
* before daynight mesh cachePerttu Ahola2010-12-18
* little fixesPerttu Ahola2010-12-14
* working nicelyPerttu Ahola2010-12-13
* starting to separate "material" to "content" and "tile"Perttu Ahola2010-12-12
* removed accidental double flowWaterPerttu Ahola2010-12-11
* commit before some radicallish changes to water behaviorPerttu Ahola2010-12-11
* some work-in-progress water stuffPerttu Ahola2010-12-01
* license stuffPerttu Ahola2010-11-29
* vokselijuttu lisättyPerttu Ahola2010-11-29
class="hl kwd">EventManager() { } void put(MtEvent *e) { std::map<std::string, Dest>::iterator i = m_dest.find(e->getType()); if(i != m_dest.end()){ std::list<FuncSpec> &funcs = i->second.funcs; for(std::list<FuncSpec>::iterator i = funcs.begin(); i != funcs.end(); i++){ (*(i->f))(e, i->d); } } delete e; } void reg(const char *type, event_receive_func f, void *data) { std::map<std::string, Dest>::iterator i = m_dest.find(type); if(i != m_dest.end()){ i->second.funcs.push_back(FuncSpec(f, data)); } else{ std::list<FuncSpec> funcs; Dest dest; dest.funcs.push_back(FuncSpec(f, data)); m_dest[type] = dest; } } void dereg(const char *type, event_receive_func f, void *data) { if(type != NULL){ std::map<std::string, Dest>::iterator i = m_dest.find(type); if(i != m_dest.end()){ std::list<FuncSpec> &funcs = i->second.funcs; std::list<FuncSpec>::iterator j = funcs.begin(); while(j != funcs.end()){ bool remove = (j->f == f && (!data || j->d == data)); if(remove) funcs.erase(j++); else j++; } } } else{ for(std::map<std::string, Dest>::iterator i = m_dest.begin(); i != m_dest.end(); i++){ std::list<FuncSpec> &funcs = i->second.funcs; std::list<FuncSpec>::iterator j = funcs.begin(); while(j != funcs.end()){ bool remove = (j->f == f && (!data || j->d == data)); if(remove) funcs.erase(j++); else j++; } } } } void reg(MtEventReceiver *r, const char *type) { reg(type, EventManager::receiverReceive, r); } void dereg(MtEventReceiver *r, const char *type) { dereg(type, EventManager::receiverReceive, r); } }; #endif