summaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
Commit message (Expand)AuthorAge
* Move object nametags to cameraRealBadAngel2016-02-18
* v2d & aabbox3d<f32> & sky cleanupsnerzhul2016-02-11
* Don't pass non-const references to collision methodsest312016-01-29
* Revert "Add support for using arbitrary meshes as items"Sapier2015-12-29
* Add support for using arbitrary meshes as itemsSapier2015-12-29
* Add support for limiting rotation of automatic face movement dir entitysSapier2015-12-19
* Add option to give every object a nametagBlockMen2015-12-15
* Add option to disable backface culling for modelsBlockMen2015-10-25
* Fix enforcing of nametag hidingest312015-10-15
* Rename macros with two leading underscoresShadowNinja2015-10-14
* Use warningstream for log messages with WARNINGShadowNinja2015-10-14
* Change i++ to ++iDavid Jones2015-08-25
* Fix issues with light of attached CAOsRealBadAngel2015-07-23
* Use UTF-8 instead of narrowest312015-07-08
* Fix some issues with animations, and allow non-looped animations to be definedMirceaKitsune2015-06-22
* Small CAO improvementsest312015-06-20
* Generic CAO cleanups and renames for clarificationest312015-06-20
* Make attached objects visible in 3rd person viewest312015-06-20
* Don't ignore nametag attribute change message for newer versionsest312015-05-21
* Enforce hiding nametagest312015-05-18
* Make nametags white againest312015-05-18
* Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler war...kwolekr2015-05-16
* Generalize core.get/set_nametag_color into core.get/set_nametag_attributesTeTpaAka2015-05-15
* Add get and set functions for the nametag colorTeTpaAka2015-05-15
* Move globals from main.cpp to more sane locationsCraig Robbins2015-04-01
* Move texture_min_size even further down the pipe. Now, textures are JIT-upsca...Aaron Suen2015-03-31
* For usages of assert() that are meant to persist in Release builds (when NDEB...Craig Robbins2015-03-07
* Replace std::list to std::vector into tile.cpp (m_texture_trash) and move til...Loic Blot2015-03-05
* Use skin font for usernames (fixes #2363)BlockMen2015-02-21
* SAO work: ActiveObject types & SAO cleanup * Replace u8 types with ActiveObje...Loic Blot2015-02-17
* Fix entitiy WieldMeshSceneNode not freed due to additional grabgregorycu2015-01-17
* Use std::string::empty() instead of size() where applicableAnton2014-12-12
* Implement WieldMeshSceneNode which improves wield mesh renderingKahrl2014-11-08
* Split settings into seperate source and header filesShadowNinja2014-09-21
* Fix client crash on deletion of an object the clients localplayer is attached tosapier2014-07-06
* Fix memory leaks in GenericCAO, ShaderSource and Player classessapier2014-07-02
* Make sure none of the irrlicht member objects of GenericCAO are deleted prior...sapier2014-06-29
* Fix GenericCAO fails to grabing member animated mesh node to prevent it do be...sapier2014-06-27
* Speedup attachement handling by replacing vector search by direct array acces...sapier2014-06-23
* Add support for interlaced polarized 3d screenssapier2014-05-18
* Split declaration of GenericCAO from implementationsapier2014-05-17
* Fix player:set_animation() in third person viewBlockMen2014-05-03
* Fix all warnings reported by clangSfan52014-04-15
* Use integers instead of float valuesBlockMen2014-04-12
* Add player:set_eye_offset() by @MirceaKitsune and clean upBlockMen2014-04-12
* Add third person viewBlockMen2014-04-12
* Fix rendering glitches when far from the center of the mapNovatux2014-03-04
* Create new instance of mesh every time it's required (Solves #703)Perttu Ahola2014-01-06
* Fix a bug in GenericCAO GENERIC_CMD_UPDATE_POSITION parsing.Ilya Zhuravlev2013-12-13
* Add sneak and sneak_glitch to set_physics_override()PilzAdam2013-12-03
me == "C") return "C"; if (shortname == "") return ""; static std::string last_raw_value = ""; static std::string last_full_name = ""; static bool first_use = true; if (last_raw_value == shortname) { return last_full_name.c_str(); } if (first_use) { EnumSystemLocalesA(UpdateLocaleCallback, LCID_SUPPORTED | LCID_ALTERNATE_SORTS); first_use = false; } last_raw_value = shortname; if (glb_supported_locales.find(utf8_to_wide(shortname)) != glb_supported_locales.end()) { last_full_name = wide_to_utf8( glb_supported_locales[utf8_to_wide(shortname)]); return last_full_name.c_str(); } /* empty string is system default */ errorstream << "MSVC_LocaleLookup: unsupported locale: \"" << shortname << "\" switching to system default!" << std::endl; return ""; } #endif /******************************************************************************/ void init_gettext(const char *path, const std::string &configured_language, int argc, char *argv[]) { #if USE_GETTEXT // First, try to set user override environment if (!configured_language.empty()) { #ifndef _WIN32 // Add user specified locale to environment setenv("LANGUAGE", configured_language.c_str(), 1); // Reload locale with changed environment setlocale(LC_ALL, ""); #elif defined(_MSC_VER) std::string current_language; const char *env_lang = getenv("LANGUAGE"); if (env_lang) current_language = env_lang; _putenv(("LANGUAGE=" + configured_language).c_str()); SetEnvironmentVariableA("LANGUAGE", configured_language.c_str()); #ifndef SERVER // Hack to force gettext to see the right environment if (current_language != configured_language) { errorstream << "MSVC localization workaround active. " "Restarting " PROJECT_NAME_C " in a new environment!" << std::endl; std::string parameters; for (unsigned int i = 1; i < argc; i++) { if (!parameters.empty()) parameters += ' '; parameters += argv[i]; } const char *ptr_parameters = NULL; if (!parameters.empty()) ptr_parameters = parameters.c_str(); // Allow calling without an extension std::string app_name = argv[0]; if (app_name.compare(app_name.size() - 4, 4, ".exe") != 0) app_name += ".exe"; STARTUPINFO startup_info = {0}; PROCESS_INFORMATION process_info = {0}; bool success = CreateProcess(app_name.c_str(), (char *)ptr_parameters, NULL, NULL, false, DETACHED_PROCESS | CREATE_UNICODE_ENVIRONMENT, NULL, NULL, &startup_info, &process_info); if (success) { exit(0); // NOTREACHED } else { char buffer[1024]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), buffer, sizeof(buffer) - 1, NULL); errorstream << "*******************************************************" << std::endl; errorstream << "CMD: " << app_name << std::endl; errorstream << "Failed to restart with current locale: " << std::endl; errorstream << buffer; errorstream << "Expect language to be broken!" << std::endl; errorstream << "*******************************************************" << std::endl; } } #else errorstream << "*******************************************************" << std::endl; errorstream << "Can't apply locale workaround for server!" << std::endl; errorstream << "Expect language to be broken!" << std::endl; errorstream << "*******************************************************" << std::endl; #endif setlocale(LC_ALL, configured_language.c_str()); #else // Mingw _putenv(("LANGUAGE=" + configured_language).c_str()); setlocale(LC_ALL, ""); #endif // ifndef _WIN32 } else { /* set current system default locale */ setlocale(LC_ALL, ""); } #if defined(_WIN32) if (getenv("LANGUAGE") != 0) { setlocale(LC_ALL, getenv("LANGUAGE")); } #ifdef _MSC_VER else if (getenv("LANG") != 0) { setlocale(LC_ALL, getenv("LANG")); } #endif #endif static std::string name = lowercase(PROJECT_NAME); bindtextdomain(name.c_str(), path); textdomain(name.c_str()); #if defined(_WIN32) // Set character encoding for Win32 char *tdomain = textdomain( (char *) NULL ); if( tdomain == NULL ) { errorstream << "Warning: domainname parameter is the null pointer" << ", default domain is not set" << std::endl; tdomain = (char *) "messages"; } /* char *codeset = */bind_textdomain_codeset( tdomain, "UTF-8" ); //errorstream << "Gettext debug: domainname = " << tdomain << "; codeset = "<< codeset << std::endl; #endif // defined(_WIN32) #else /* set current system default locale */ setlocale(LC_ALL, ""); #endif // if USE_GETTEXT /* no matter what locale is used we need number format to be "C" */ /* to ensure formspec parameters are evaluated correct! */ setlocale(LC_NUMERIC, "C"); infostream << "Message locale is now set to: " << setlocale(LC_ALL, 0) << std::endl; }