summaryrefslogtreecommitdiff
path: root/src/cguittfont
Commit message (Collapse)AuthorAge
* Add colored text (not only colored chat).Ekdohibs2016-05-31
| | | | | Add documentation, move files to a proper place and avoid memory leaks. Make it work with most kind of texts, and allow backgrounds too.
* Fix build if BUILD_SHARED_LIBS defaults to "ON"Ferdinand Thiessen2015-12-03
| | | | | | openSUSE sets that option to ON. Fixes #3420.
* Clean up and tweak build systemShadowNinja2015-03-27
| | | | | | | | | | | | | | | | * Combine client and server man pages. * Update unit test options and available databases in man page. * Add `--worldname` to man page. * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`. * Disable server build by default on all operating systems. * Make `ENABLE_FREETYPE` not fail if FreeType isn't found. * Enable LevelDB, Redis, and FreeType detection by default. * Remove the `VERSION_PATCH_ORIG` hack. * Add option to search for and use system JSONCPP. * Remove broken LuaJIT version detection. * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`. * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`. * Clean up style of CMake files.
* Suppress CGUITTFONT build warningsCraig Robbins2015-02-13
|
* Fix FTBFS on GNU/Hurd platformMarkus Koschany2015-02-11
| | | | | Minetest fails to build on GNU/Hurd due to a name clash with OSX/Apple, both are defining the __MACH__ keyword. This commit fixes the issue.
* Fix warnings in CGUITTFont.cppCraig Robbins2015-02-06
|
* Suppress 4 gcc 4.9.2 warnings in CGUITTFont.cppngosang2015-02-05
|
* Fix endian.h include for FreeBSDDmitry Marakasov2014-12-30
|
* OS X compatibility fixesMartin Doege2014-06-29
|
* Fix Windows buildsfan52014-06-23
|
* Fix labels and vertlabels on some systems.RealBadAngel2014-06-20
|
* Fix build on big endian architectures.Matthew Bekkema2014-06-20
|
* Fix newline not handled to to interpreting it as invisible charsapier2014-06-19
|
* Fix all warnings reported by clangSfan52014-04-15
|
* BUILD: fix cmake list parsinghasufell2014-01-05
| | | | because cmake is unable to parse it's own lists properly
* BUILD: prefer pkg-config for freetype2 detectionhasufell2014-01-05
| | | | | | | | | | | This can solve numerous problems such as: http://www.cmake.org/Bug/view.php?id=13959 http://www.cmake.org/Bug/view.php?id=14601 If pkg-config or freetype2.pc is not found, then fall back to the FindFreetype.cmake module logic. Restrict to UNIX since I only tested it here.
* Add alpha setting to font shadowBlockMen2013-12-14
|
* Add configurable font shadow.Ilya Zhuravlev2013-12-12
|
* Fix win32/msvc i18n (quite UGLY version, blame Microsoft)sapier2013-11-11
|
* Add Freetype supportIlya Zhuravlev2013-02-14
> core::map<std::string, Factory2>::Node *n; n = m_names.find(name); if(n == NULL) { // If factory is not found, just return. errorstream<<"WARNING: NodeMetadata: No factory for name=\"" <<name<<"\""<<std::endl; return NULL; } // Try to load the metadata. If it fails, just return. try { Factory2 f2 = n->getValue(); NodeMetadata *meta = (*f2)(gamedef); return meta; } catch(SerializationError &e) { errorstream<<"NodeMetadata: SerializationError " <<"while creating name=\""<<name<<"\""<<std::endl; return NULL; } } NodeMetadata* NodeMetadata::deSerialize(std::istream &is, IGameDef *gamedef) { // Read id u8 buf[2]; is.read((char*)buf, 2); s16 id = readS16(buf); // Read data std::string data = deSerializeString(is); // Find factory function core::map<u16, Factory>::Node *n; n = m_types.find(id); if(n == NULL) { // If factory is not found, just return. infostream<<"WARNING: NodeMetadata: No factory for typeId=" <<id<<std::endl; return NULL; } // Try to load the metadata. If it fails, just return. try { std::istringstream iss(data, std::ios_base::binary); Factory f = n->getValue(); NodeMetadata *meta = (*f)(iss, gamedef); return meta; } catch(SerializationError &e) { infostream<<"WARNING: NodeMetadata: ignoring SerializationError"<<std::endl; return NULL; } } void NodeMetadata::serialize(std::ostream &os) { u8 buf[2]; writeU16(buf, typeId()); os.write((char*)buf, 2); std::ostringstream oss(std::ios_base::binary); serializeBody(oss); os<<serializeString(oss.str()); } void NodeMetadata::registerType(u16 id, const std::string &name, Factory f, Factory2 f2) { { // typeId core::map<u16, Factory>::Node *n; n = m_types.find(id); if(!n) m_types.insert(id, f); } { // typeName core::map<std::string, Factory2>::Node *n; n = m_names.find(name); if(!n) m_names.insert(name, f2); } } /* NodeMetadataList */ void NodeMetadataList::serialize(std::ostream &os) { u8 buf[6]; u16 version = 1; writeU16(buf, version); os.write((char*)buf, 2); u16 count = m_data.size(); writeU16(buf, count); os.write((char*)buf, 2); for(core::map<v3s16, NodeMetadata*>::Iterator i = m_data.getIterator(); i.atEnd()==false; i++) { v3s16 p = i.getNode()->getKey(); NodeMetadata *data = i.getNode()->getValue(); u16 p16 = p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X; writeU16(buf, p16); os.write((char*)buf, 2); data->serialize(os); } } void NodeMetadataList::deSerialize(std::istream &is, IGameDef *gamedef) { m_data.clear(); u8 buf[6]; is.read((char*)buf, 2); u16 version = readU16(buf); if(version > 1) { infostream<<__FUNCTION_NAME<<": version "<<version<<" not supported" <<std::endl; throw SerializationError("NodeMetadataList::deSerialize"); } is.read((char*)buf, 2); u16 count = readU16(buf); for(u16 i=0; i<count; i++) { is.read((char*)buf, 2); u16 p16 = readU16(buf); v3s16 p(0,0,0); p.Z += p16 / MAP_BLOCKSIZE / MAP_BLOCKSIZE; p16 -= p.Z * MAP_BLOCKSIZE * MAP_BLOCKSIZE; p.Y += p16 / MAP_BLOCKSIZE; p16 -= p.Y * MAP_BLOCKSIZE; p.X += p16; NodeMetadata *data = NodeMetadata::deSerialize(is, gamedef); if(data == NULL) continue; if(m_data.find(p)) { infostream<<"WARNING: NodeMetadataList::deSerialize(): " <<"already set data at position" <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring." <<std::endl; delete data; continue; } m_data.insert(p, data); } } NodeMetadataList::~NodeMetadataList() { for(core::map<v3s16, NodeMetadata*>::Iterator i = m_data.getIterator(); i.atEnd()==false; i++) { delete i.getNode()->getValue(); } } NodeMetadata* NodeMetadataList::get(v3s16 p) { core::map<v3s16, NodeMetadata*>::Node *n; n = m_data.find(p); if(n == NULL) return NULL; return n->getValue(); } void NodeMetadataList::remove(v3s16 p) { NodeMetadata *olddata = get(p); if(olddata) { delete olddata; m_data.remove(p); } } void NodeMetadataList::set(v3s16 p, NodeMetadata *d) { remove(p); m_data.insert(p, d); } bool NodeMetadataList::step(float dtime) { bool something_changed = false; for(core::map<v3s16, NodeMetadata*>::Iterator i = m_data.getIterator(); i.atEnd()==false; i++) { v3s16 p = i.getNode()->getKey(); NodeMetadata *meta = i.getNode()->getValue(); bool changed = meta->step(dtime); if(changed) something_changed = true; } return something_changed; }