Enumerations | |
| enum | AndroidDialogType { TEXT_INPUT , SELECTION_INPUT } |
| enum | AndroidDialogState { DIALOG_SHOWN , DIALOG_INPUTTED , DIALOG_CANCELED } |
Functions | |
| volatile std::sig_atomic_t * | signal_handler_killstatus () |
| template<typename... Args> | |
| static void | ignore (Args &&...) |
| static void | signal_handler (int sig) |
| void | signal_handler_init () |
| static std::optional< std::string > | getUserPathEnvVar () |
| std::string | getDataPath (const char *subpath) |
| static void | pathRemoveFile (char *path, char delim) |
| static bool | detectMSVCBuildDir (const std::string &path) |
| static std::string | detectSystemInfo () |
| const std::string & | get_sysinfo () |
| u32 | getMemorySizeMB () |
| static bool | getCurrentWorkingDir (char *buf, size_t len) |
| static bool | getExecPathFromProcfs (char *buf, size_t buflen) |
| bool | getCurrentExecPath (char *buf, size_t len) |
| static const char * | getHomeOrFail () |
| bool | setSystemPaths () |
| static void | migrateCachePath () |
| static void | createCacheDirTag () |
| void | initializePaths () |
| bool | secure_rand_fill_buf (void *buf, size_t len) |
| void | osSpecificInit () |
| void | attachOrCreateConsole () |
| int | mt_snprintf (char *buf, const size_t buf_size, const char *fmt,...) |
| snprintf wrapper but always providing support for positional arguments (%1) | |
| static bool | open_uri (const std::string &uri) |
| bool | open_url (const std::string &url) |
| Opens URL in default web browser. | |
| bool | open_directory (const std::string &path) |
| Opens a directory in the default file manager. | |
| void | os_get_clock (struct timespec *ts) |
| u64 | getTimeS () |
| u64 | getTimeMs () |
| u64 | getTimeUs () |
| u64 | getTimeNs () |
| u64 | getTime (TimePrecision prec) |
| u64 | getDeltaMs (u64 old_time_ms, u64 new_time_ms) |
| Delta calculation function arguments. | |
| void | preciseSleepUs (u64 sleep_time) |
| const char * | getPlatformName () |
| static void | TrackFreedMemory (size_t amount) |
| static void | TriggerMemoryTrim () |
| void | cleanupAndroid () |
| std::string | getLanguageAndroid () |
| static std::string | readJavaString (jstring j_str) |
| void | showTextInputDialog (const std::string &hint, const std::string ¤t, int editType) |
| Show a text input dialog in Java. | |
| void | showComboBoxDialog (const std::string *optionList, s32 listSize, s32 selectedIdx) |
| Show a selection dialog in Java. | |
| void | openURIAndroid (const char *url) |
| void | shareFileAndroid (const std::string &path) |
| Opens a share intent to the file at path. | |
| void | setPlayingNowNotification (bool show) |
| Shows/hides notification that the game is running. | |
| AndroidDialogType | getLastInputDialogType () |
| AndroidDialogState | getInputDialogState () |
| std::string | getInputDialogMessage () |
| int | getInputDialogSelection () |
| float | getDisplayDensity () |
| v2u32 | getDisplaySize () |
| bool | hasPhysicalKeyboardAndroid () |
Variables | |
| static volatile std::sig_atomic_t | g_killed = false |
| std::string | path_share = "UNINITIALIZED" |
| std::string | path_user = "UNINITIALIZED" |
| std::string | path_locale = "UNINITIALIZED" |
| std::string | path_cache = "UNINITIALIZED" |
| JNIEnv * | jnienv = nullptr |
| jobject | activity |
| jclass | activityClass |
| void porting::attachOrCreateConsole | ( | ) |
References attachOrCreateConsole().
Referenced by attachOrCreateConsole(), and main().
| void porting::cleanupAndroid | ( | ) |
References cleanupAndroid(), DIR_DELIM, path_user, and warningstream.
Referenced by cleanupAndroid(), and SDL_Main().
|
static |
References fs::CreateAllDirs(), createCacheDirTag(), DIR_DELIM, open_ofstream(), path_cache, and fs::PathExists().
Referenced by createCacheDirTag(), and initializePaths().
|
static |
References detectMSVCBuildDir(), and removeStringEnd().
Referenced by detectMSVCBuildDir(), and initializePaths().
|
static |
References detectSystemInfo().
Referenced by detectSystemInfo(), and get_sysinfo().
| const std::string & porting::get_sysinfo | ( | ) |
References detectSystemInfo(), and get_sysinfo().
Referenced by default_user_agent(), get_sysinfo(), and print_version().
|
nodiscard |
References getCurrentExecPath().
Referenced by getCurrentExecPath(), initializePaths(), and use_debugger().
|
static |
References getCurrentWorkingDir().
Referenced by getCurrentWorkingDir(), and initializePaths().
|
nodiscard |
References DIR_DELIM, getDataPath(), and path_share.
Referenced by getDataPath(), initializePaths(), and set_default_settings().
|
inline |
Delta calculation function arguments.
| old_time_ms | old time for delta calculation |
| new_time_ms | new time for delta calculation |
References getDeltaMs().
Referenced by GUIScene::draw(), drawItemStack(), GUIFormSpecMenu::drawMenu(), getDeltaMs(), ClientMediaDownloader::initialStep(), PointerAction::isRelated(), and TouchControls::step().
| float porting::getDisplayDensity | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, getDisplayDensity(), and jnienv.
Referenced by getDisplayDensity(), RenderingEngine::getDisplayDensity(), and set_default_settings().
| v2u32 porting::getDisplaySize | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, getDisplaySize(), and jnienv.
Referenced by getDisplaySize(), and set_default_settings().
|
static |
References getExecPathFromProcfs().
Referenced by getExecPathFromProcfs(), and initializePaths().
|
inlinestatic |
References FATAL_ERROR_IF, and getHomeOrFail().
Referenced by getHomeOrFail(), and setSystemPaths().
| std::string porting::getInputDialogMessage | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, getInputDialogMessage(), jnienv, and readJavaString().
Referenced by getInputDialogMessage().
| int porting::getInputDialogSelection | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, getInputDialogSelection(), and jnienv.
Referenced by getInputDialogSelection().
| AndroidDialogState porting::getInputDialogState | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, getInputDialogState(), and jnienv.
Referenced by getInputDialogState().
| std::string porting::getLanguageAndroid | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, getLanguageAndroid(), jnienv, and readJavaString().
Referenced by getLanguageAndroid().
| AndroidDialogType porting::getLastInputDialogType | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, getLastInputDialogType(), and jnienv.
Referenced by getLastInputDialogType().
| u32 porting::getMemorySizeMB | ( | ) |
References getMemorySizeMB().
Referenced by getMemorySizeMB(), EmergeManager::initThreads(), and TestUtilities::testGetMemorySize().
|
inline |
References getPlatformName().
Referenced by ScriptApiBase::ScriptApiBase(), getPlatformName(), and print_version().
|
inline |
References FATAL_ERROR, getTime(), getTimeMs(), getTimeNs(), getTimeS(), getTimeUs(), PRECISION_MICRO, PRECISION_MILLI, PRECISION_NANO, and PRECISION_SECONDS.
Referenced by ScopeProfiler::ScopeProfiler(), getTime(), TimeTaker::getTimerTime(), TimeTaker::start(), ScopeProfiler::stop(), and TimeTaker::stop().
|
inline |
References getTimeMs(), and os_get_clock().
Referenced by Profiler::Profiler(), Client::afterContentReceived(), TouchControls::applyContextControls(), Database_SQLite3::busyHandler(), Profiler::clear(), GUIAnimatedImage::draw(), GUIChatConsole::draw(), GUIScene::draw(), drawItemStack(), GUIFormSpecMenu::drawMenu(), GUIButton::drawSprite(), PointerAction::fromEvent(), Profiler::getElapsedMs(), Logger::getLogTimestamp(), getTime(), getTimeMs(), con::ConnectionReceiveThread::handlePacketType_Control(), ClientMediaDownloader::initialStep(), con::Peer::isTimedOut(), ServerModManager::loadMods(), GUIButton::OnEvent(), GUITable::OnEvent(), GUIChatConsole::openConsole(), Client::ReceiveAll(), con::ConnectionReceiveThread::run(), con::ConnectionSendThread::run(), CurlFetchThread::run(), sound::OpenALSoundManager::run(), run_tests(), run_tests(), TestBase::runTest(), con::ConnectionSendThread::sendAsPacketReliable(), MyEventReceiver::setKeyDown(), GUIButton::setPressed(), Client::showUpdateProgressTexture(), TouchControls::step(), AsyncEngine::stepAutoscale(), AsyncEngine::stepStuckWarning(), TestConnection::testConnectSendReceive(), TestBase::testModule(), ServerMap::transformLiquids(), TouchControls::translateEvent(), ClientEnvironment::updateFrameTime(), MyEventReceiver::WasKeyDown(), and GUIChatConsole::weblinkClick().
|
inline |
References getTimeNs(), and os_get_clock().
Referenced by getTime(), and getTimeNs().
|
inline |
References getTimeS(), and os_get_clock().
Referenced by getTime(), getTimeS(), migrate_map_database(), sound::OpenALSoundManager::printPlayingSounds(), recompress_map_database(), con::ConnectionReceiveThread::RateLimitHelper::tick(), and RemoteClient::uptime().
|
inline |
References getTimeUs(), and os_get_clock().
Referenced by getTime(), getTimeUs(), init_common(), ModApiBase::l_deprecated_function(), ModApiUtil::l_get_us_time(), ModApiUtil::l_get_us_time_sscsm(), FpsControl::limit(), preciseSleepUs(), Server::Receive(), FpsControl::reset(), ServerThread::run(), ServerMap::save(), ServerEnvironment::step(), and Map::timerUpdate().
|
static |
References getUserPathEnvVar(), and warningstream.
Referenced by getUserPathEnvVar(), and setSystemPaths().
| bool porting::hasPhysicalKeyboardAndroid | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, hasPhysicalKeyboardAndroid(), and jnienv.
Referenced by hasPhysicalKeyboardAndroid(), Game::openConsole(), and GUIModalMenu::preprocessEvent().
|
static |
References ignore().
Referenced by ignore(), and signal_handler().
| void porting::initializePaths | ( | ) |
References createCacheDirTag(), detectMSVCBuildDir(), DIR_DELIM, DIR_DELIM_CHAR, errorstream, FATAL_ERROR, getCurrentExecPath(), getCurrentWorkingDir(), getDataPath(), getExecPathFromProcfs(), infostream, initializePaths(), migrateCachePath(), path_cache, path_locale, path_share, path_user, fs::PathExists(), pathRemoveFile(), sanity_check, setSystemPaths(), and warningstream.
Referenced by initializePaths(), and main().
|
static |
References DIR_DELIM, errorstream, migrateCachePath(), path_cache, path_user, fs::PathExists(), fs::RecursiveDelete(), and fs::Rename().
Referenced by initializePaths(), and migrateCachePath().
| int porting::mt_snprintf | ( | char * | buf, |
| const size_t | buf_size, | ||
| const char * | fmt, | ||
| ... ) |
snprintf wrapper but always providing support for positional arguments (%1)
References mt_snprintf().
Referenced by Minimap::addMode(), analyze_block(), ProfilerGraph::draw(), fmtgettext(), TextureSource::generateArrayTexture(), getFloatSerializationType(), TestBase::getTestTempFile(), guiScalingResizeCached(), mt_snprintf(), percent(), Profiler::print(), print_hexdump(), script_error(), ScriptApiBase::stackDump(), and TestConnection::testConnectSendReceive().
| bool porting::open_directory | ( | const std::string & | path | ) |
Opens a directory in the default file manager.
The directory must exist.
| path | Path to directory |
References fs::AbsolutePath(), errorstream, fs::IsDir(), open_directory(), and open_uri().
Referenced by ModApiMainMenu::l_open_dir(), and open_directory().
|
static |
References errorstream, open_uri(), openURIAndroid(), and verbosestream.
Referenced by open_directory(), open_uri(), and open_url().
| bool porting::open_url | ( | const std::string & | url | ) |
Opens URL in default web browser.
Must begin with http:// or https://, and not contain any new lines
| url | The URL |
References errorstream, open_uri(), open_url(), and str_starts_with().
Referenced by ModApiMainMenu::l_open_url(), GUIFormSpecMenu::OnEvent(), GUIHyperText::OnEvent(), GUIOpenURLMenu::OnEvent(), open_url(), and GUIChatConsole::weblinkClick().
| void porting::openURIAndroid | ( | const char * | url | ) |
References activity, activityClass, FATAL_ERROR_IF, jnienv, and openURIAndroid().
Referenced by open_uri(), and openURIAndroid().
|
inline |
References os_get_clock().
Referenced by getTimeMs(), getTimeNs(), getTimeS(), getTimeUs(), and os_get_clock().
| void porting::osSpecificInit | ( | ) |
References osSpecificInit().
Referenced by main(), and osSpecificInit().
|
static |
References pathRemoveFile().
Referenced by initializePaths(), and pathRemoveFile().
|
inline |
References getTimeUs(), preciseSleepUs(), SLEEP_ACCURACY_US, and sleep_us.
Referenced by FpsControl::limit(), and preciseSleepUs().
|
static |
References jnienv, and readJavaString().
Referenced by getInputDialogMessage(), getLanguageAndroid(), and readJavaString().
|
nodiscard |
References secure_rand_fill_buf().
Referenced by GUIDGenerator::GUIDGenerator(), LuaSecureRandom::fillRandBuf(), init_common(), mpz_fill_random(), secure_rand_fill_buf(), and srp_create_salted_verification_key().
| void porting::setPlayingNowNotification | ( | bool | show | ) |
Shows/hides notification that the game is running.
| show | whether to show/hide the notification |
References activity, activityClass, FATAL_ERROR_IF, jnienv, and setPlayingNowNotification().
Referenced by Game::run(), and setPlayingNowNotification().
| bool porting::setSystemPaths | ( | ) |
References DIR_DELIM, getHomeOrFail(), getUserPathEnvVar(), path_share, path_user, and setSystemPaths().
Referenced by initializePaths(), and setSystemPaths().
| void porting::shareFileAndroid | ( | const std::string & | path | ) |
Opens a share intent to the file at path.
| path |
References activity, activityClass, FATAL_ERROR_IF, jnienv, and shareFileAndroid().
Referenced by ModApiMainMenu::l_share_file(), and shareFileAndroid().
| void porting::showComboBoxDialog | ( | const std::string * | optionList, |
| s32 | listSize, | ||
| s32 | selectedIdx ) |
Show a selection dialog in Java.
| optionList | The list of options |
| listSize | Size of the list |
| selectedIdx | Selected index |
References activity, activityClass, FATAL_ERROR_IF, jnienv, and showComboBoxDialog().
Referenced by GUIModalMenu::preprocessEvent(), and showComboBoxDialog().
| void porting::showTextInputDialog | ( | const std::string & | hint, |
| const std::string & | current, | ||
| int | editType ) |
Show a text input dialog in Java.
| hint | Hint to be shown |
| current | Initial value to be displayed |
| editType | Type of the text field (1 = multi-line text input; 2 = single-line text input; 3 = password field) |
References activity, activityClass, FATAL_ERROR_IF, jnienv, and showTextInputDialog().
Referenced by Game::openConsole(), GUIModalMenu::preprocessEvent(), and showTextInputDialog().
|
static |
References g_killed, ignore(), and signal_handler().
Referenced by signal_handler(), and signal_handler_init().
| void porting::signal_handler_init | ( | ) |
References signal_handler(), and signal_handler_init().
Referenced by main(), and signal_handler_init().
|
nodiscard |
References g_killed, and signal_handler_killstatus().
Referenced by ClientLauncher::launch_game(), ClientLauncher::main_menu(), migrate_map_database(), recompress_map_database(), ClientLauncher::run(), run_dedicated_server(), and signal_handler_killstatus().
|
inlinestatic |
References TrackFreedMemory().
Referenced by TrackFreedMemory().
|
inlinestatic |
References TriggerMemoryTrim().
Referenced by TriggerMemoryTrim().
| jobject porting::activity |
Referenced by getDisplayDensity(), getDisplaySize(), getInputDialogMessage(), getInputDialogSelection(), getInputDialogState(), getLanguageAndroid(), getLastInputDialogType(), hasPhysicalKeyboardAndroid(), openURIAndroid(), setPlayingNowNotification(), shareFileAndroid(), showComboBoxDialog(), and showTextInputDialog().
| jclass porting::activityClass |
Referenced by getDisplayDensity(), getDisplaySize(), getInputDialogMessage(), getInputDialogSelection(), getInputDialogState(), getLanguageAndroid(), getLastInputDialogType(), hasPhysicalKeyboardAndroid(), openURIAndroid(), setPlayingNowNotification(), shareFileAndroid(), showComboBoxDialog(), and showTextInputDialog().
|
static |
Referenced by signal_handler(), and signal_handler_killstatus().
| JNIEnv* porting::jnienv = nullptr |
Referenced by getDisplayDensity(), getDisplaySize(), getInputDialogMessage(), getInputDialogSelection(), getInputDialogState(), getLanguageAndroid(), getLastInputDialogType(), hasPhysicalKeyboardAndroid(), openURIAndroid(), readJavaString(), setPlayingNowNotification(), shareFileAndroid(), showComboBoxDialog(), and showTextInputDialog().
| std::string porting::path_cache = "UNINITIALIZED" |
| std::string porting::path_locale = "UNINITIALIZED" |
Referenced by init_common(), and initializePaths().
| std::string porting::path_share = "UNINITIALIZED" |
Referenced by RenderingEngine::RenderingEngine(), MenuMusicFetcher::addThePaths(), SoundFallbackPathProvider::addThePaths(), ClientLauncher::config_guienv(), findSubgame(), getAvailableGamePaths(), Client::getBuiltinLuaPath(), Server::getBuiltinLuaPath(), Client::getClientModsLuaPath(), getDataPath(), getShaderPath(), ButtonLayout::getTexture(), getTexturePath(), initializePaths(), ModApiUtil::l_get_builtin_path(), ModApiMainMenu::l_get_modpaths(), ModApiMainMenu::l_get_texturepath_share(), GUIEngine::loadMainMenuScript(), MainMenuScripting::mayModifyPath(), setSystemPaths(), and RenderingEngine::setWindowIcon().
| std::string porting::path_user = "UNINITIALIZED" |
Referenced by Client::Client(), Server::Server(), MenuMusicFetcher::addThePaths(), SoundFallbackPathProvider::addThePaths(), auto_select_world(), cleanupAndroid(), create_userdata_path(), Server::fillMediaCache(), findSubgame(), getAvailableGamePaths(), getAvailableWorlds(), init_log_streams(), initializePaths(), ModApiMainMenu::l_create_world(), ModApiMainMenu::l_get_clientmodpath(), ModApiMainMenu::l_get_gamepath(), ModApiMainMenu::l_get_modpath(), ModApiMainMenu::l_get_modpaths(), ModApiMainMenu::l_get_texturepath(), ModApiMainMenu::l_get_user_path(), ModApiUtil::l_get_user_path(), Client::loadMods(), MainMenuScripting::mayModifyPath(), migrateCachePath(), Client::migrateModStorage(), read_config_file(), setSystemPaths(), and takeScreenshot().