Functions | |
bool * | signal_handler_killstatus () |
void | signal_handler (int sig) |
void | signal_handler_init (void) |
std::string | getDataPath (const char *subpath) |
void | pathRemoveFile (char *path, char delim) |
bool | detectMSVCBuildDir (const std::string &path) |
std::string | get_sysinfo () |
bool | getCurrentWorkingDir (char *buf, size_t len) |
bool | getExecPathFromProcfs (char *buf, size_t buflen) |
bool | getCurrentExecPath (char *buf, size_t len) |
const char * | getHomeOrFail () |
bool | setSystemPaths () |
void | migrateCachePath () |
void | initializePaths () |
bool | secure_rand_fill_buf (void *buf, size_t len) |
void | attachOrCreateConsole () |
int | mt_snprintf (char *buf, const size_t buf_size, const char *fmt,...) |
static bool | open_uri (const std::string &uri) |
bool | open_url (const std::string &url) |
Opens URL in default web browser. More... | |
bool | open_directory (const std::string &path) |
Opens a directory in the default file manager. More... | |
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. More... | |
const char * | getPlatformName () |
jclass | findClass (const std::string &classname) |
void | initAndroid () |
void | cleanupAndroid () |
static std::string | javaStringToUTF8 (jstring js) |
static std::string | getAndroidPath (jclass cls, jobject obj, jmethodID mt_getAbsPath, const char *getter) |
void | initializePathsAndroid () |
Initializes path_* variables for Android. More... | |
void | showInputDialog (const std::string &acceptButton, const std::string &hint, const std::string ¤t, int editType) |
show text input dialog in java More... | |
void | openURIAndroid (const std::string &url) |
int | getInputDialogState () |
WORKAROUND for not working callbacks from java -> c++ get current state of input dialog. More... | |
std::string | getInputDialogValue () |
WORKAROUND for not working callbacks from java -> c++ get text in current input dialog. More... | |
float | getDisplayDensity () |
v2u32 | getDisplaySize () |
Variables | |
bool | g_killed = false |
std::string | path_share = ".." |
std::string | path_user = ".." |
std::string | path_locale = path_share + DIR_DELIM + "locale" |
std::string | path_cache = path_user + DIR_DELIM + "cache" |
android_app * | app_global |
JNIEnv * | jnienv |
jclass | nativeActivity |
void porting::attachOrCreateConsole | ( | ) |
void porting::cleanupAndroid | ( | ) |
References app_global, DIR_DELIM, errorstream, and path_user.
Referenced by android_main().
bool porting::detectMSVCBuildDir | ( | const std::string & | path | ) |
References removeStringEnd().
Referenced by initializePaths().
jclass porting::findClass | ( | const std::string & | classname | ) |
References app_global, and jnienv.
Referenced by initAndroid().
std::string porting::get_sysinfo | ( | ) |
|
static |
References javaStringToUTF8(), and jnienv.
Referenced by initializePathsAndroid().
bool porting::getCurrentExecPath | ( | char * | buf, |
size_t | len | ||
) |
bool porting::getCurrentWorkingDir | ( | char * | buf, |
size_t | len | ||
) |
std::string porting::getDataPath | ( | const char * | subpath | ) |
References DIR_DELIM, and path_share.
Referenced by 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 |
Referenced by GUIModalMenu::DoubleClickDetection(), TouchScreenGUI::doubleTapDetection(), GUIScene::draw(), drawItemStack(), GUIFormSpecMenu::drawMenu(), and TouchScreenGUI::step().
float porting::getDisplayDensity | ( | ) |
References app_global, FATAL_ERROR_IF, jnienv, and nativeActivity.
Referenced by GUIModalMenu::GUIModalMenu(), TouchScreenGUI::TouchScreenGUI(), GUIConfirmRegistration::regenerateGui(), GUIPasswordChange::regenerateGui(), ClientLauncher::run(), and set_default_settings().
v2u32 porting::getDisplaySize | ( | ) |
References app_global, FATAL_ERROR_IF, jnienv, and nativeActivity.
Referenced by set_default_settings().
bool porting::getExecPathFromProcfs | ( | char * | buf, |
size_t | buflen | ||
) |
const char* porting::getHomeOrFail | ( | ) |
References FATAL_ERROR_IF.
Referenced by setSystemPaths().
int porting::getInputDialogState | ( | ) |
WORKAROUND for not working callbacks from java -> c++ get current state of input dialog.
References app_global, FATAL_ERROR_IF, jnienv, and nativeActivity.
std::string porting::getInputDialogValue | ( | ) |
WORKAROUND for not working callbacks from java -> c++ get text in current input dialog.
References app_global, FATAL_ERROR_IF, jnienv, and nativeActivity.
|
inline |
Referenced by ScriptApiBase::ScriptApiBase(), and print_version().
|
inline |
References FATAL_ERROR, getTimeMs(), getTimeNs(), getTimeS(), getTimeUs(), PRECISION_MICRO, PRECISION_MILLI, PRECISION_NANO, and PRECISION_SECONDS.
Referenced by TimeTaker::TimeTaker(), TimeTaker::getTimerTime(), and TimeTaker::stop().
|
inline |
References os_get_clock().
Referenced by Profiler::Profiler(), Client::afterContentReceived(), Database_SQLite3::busyHandler(), Profiler::clear(), GUIModalMenu::DoubleClickDetection(), TouchScreenGUI::doubleTapDetection(), GUIChatConsole::draw(), GUIEditBoxWithScrollBar::draw(), GUIScene::draw(), irr::gui::intlGUIEditBox::draw(), GUIAnimatedImage::draw(), drawItemStack(), GUIFormSpecMenu::drawMenu(), GUIButton::drawSprite(), Profiler::getElapsedMs(), getTime(), JoystickController::handleEvent(), con::ConnectionReceiveThread::handlePacketType_Control(), GUIEditBox::inputChar(), con::Peer::isTimedOut(), ServerModManager::loadMods(), GUITable::OnEvent(), GUIButton::OnEvent(), GUIEditBox::onKeyBack(), GUIEditBox::onKeyDelete(), GameGlobalShaderConstantSetter::onSetConstants(), GUIChatConsole::openConsole(), GUIEditBox::processKey(), GUIEditBox::processMouse(), Client::ReceiveAll(), con::ConnectionSendThread::run(), con::ConnectionReceiveThread::run(), run_tests(), con::ConnectionSendThread::sendAsPacketReliable(), GUIButton::setPressed(), TouchScreenGUI::step(), TestConnection::testConnectSendReceive(), TestBase::testModule(), texture_update_progress(), Map::transformLiquids(), TouchScreenGUI::translateEvent(), and Game::updatePointedThing().
|
inline |
References os_get_clock().
Referenced by getTime(), and ServerMap::save().
|
inline |
References os_get_clock().
Referenced by getTime(), and RemoteClient::uptime().
|
inline |
References os_get_clock().
Referenced by getTime(), ModApiBase::l_deprecated_function(), and ModApiUtil::l_get_us_time().
void porting::initAndroid | ( | ) |
References app_global, errorstream, findClass(), jnienv, nativeActivity, and PROJECT_NAME_C.
Referenced by main().
void porting::initializePaths | ( | ) |
References detectMSVCBuildDir(), DIR_DELIM, DIR_DELIM_CHAR, errorstream, FATAL_ERROR, getCurrentExecPath(), getCurrentWorkingDir(), getDataPath(), getExecPathFromProcfs(), infostream, migrateCachePath(), path_cache, path_locale, path_share, path_user, fs::PathExists(), pathRemoveFile(), PROJECT_NAME, setSystemPaths(), STATIC_LOCALEDIR, and warningstream.
Referenced by main().
void porting::initializePathsAndroid | ( | ) |
Initializes path_* variables for Android.
env | Android JNI environment |
References app_global, DIR_DELIM, getAndroidPath(), jnienv, migrateCachePath(), nativeActivity, path_cache, path_share, path_user, and PROJECT_NAME_C.
Referenced by main().
|
static |
void porting::migrateCachePath | ( | ) |
References DIR_DELIM, errorstream, path_cache, path_user, fs::PathExists(), fs::RecursiveDelete(), and fs::Rename().
Referenced by initializePaths(), and initializePathsAndroid().
int porting::mt_snprintf | ( | char * | buf, |
const size_t | buf_size, | ||
const char * | fmt, | ||
... | |||
) |
Referenced by Minimap::addMode(), analyze_block(), ProfilerGraph::draw(), getFloatSerializationType(), TestBase::getTestTempDirectory(), TestBase::getTestTempFile(), guiScalingResizeCached(), Profiler::print(), print_hexdump(), GUIConfirmRegistration::regenerateGui(), script_error(), Game::showPauseMenu(), 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 errorstream, fs::IsDir(), and open_uri().
Referenced by ModApiMainMenu::l_open_dir().
|
static |
References errorstream, and openURIAndroid().
Referenced by open_directory(), 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, and open_uri().
Referenced by ModApiMainMenu::Initialize(), and ModApiMainMenu::l_open_url().
void porting::openURIAndroid | ( | const std::string & | url | ) |
References app_global, FATAL_ERROR_IF, jnienv, and nativeActivity.
Referenced by open_uri().
|
inline |
Referenced by getTimeMs(), getTimeNs(), getTimeS(), and getTimeUs().
void porting::pathRemoveFile | ( | char * | path, |
char | delim | ||
) |
bool porting::secure_rand_fill_buf | ( | void * | buf, |
size_t | len | ||
) |
Referenced by LuaSecureRandom::fillRandBuf(), and httpfetch_init().
bool porting::setSystemPaths | ( | ) |
References DIR_DELIM, getHomeOrFail(), lowercase(), path_share, path_user, PROJECT_NAME, and STATIC_SHAREDIR.
Referenced by initializePaths().
void porting::showInputDialog | ( | const std::string & | acceptButton, |
const std::string & | hint, | ||
const std::string & | current, | ||
int | editType | ||
) |
show text input dialog in java
acceptButton | text to display on accept button |
hint | hint to show |
current | initial value to display |
editType | type of texfield (1==multiline text input; 2==single line text input; 3=password field) |
References app_global, FATAL_ERROR_IF, jnienv, and nativeActivity.
Referenced by Game::openConsole(), and GUIModalMenu::preprocessEvent().
void porting::signal_handler | ( | int | sig | ) |
References dstream, and g_killed.
Referenced by signal_handler_init().
void porting::signal_handler_init | ( | void | ) |
References signal_handler().
Referenced by main().
bool * porting::signal_handler_killstatus | ( | ) |
References g_killed.
Referenced by ClientLauncher::launch_game(), ClientLauncher::main_menu(), migrate_map_database(), ClientLauncher::run(), and run_dedicated_server().
android_app * porting::app_global |
bool porting::g_killed = false |
Referenced by signal_handler(), and signal_handler_killstatus().
JNIEnv * porting::jnienv |
jclass porting::nativeActivity |
std::string porting::path_locale = path_share + DIR_DELIM + "locale" |
Referenced by init_common(), and initializePaths().
std::string porting::path_share = ".." |
Referenced by RenderingEngine::RenderingEngine(), GameOnDemandSoundFetcher::fetchSounds(), MenuMusicFetcher::fetchSounds(), findSubgame(), getAvailableGameIds(), Client::getBuiltinLuaPath(), Server::getBuiltinLuaPath(), Client::getClientModsLuaPath(), getDataPath(), getShaderPath(), getTexturePath(), initializePaths(), initializePathsAndroid(), ModApiUtil::l_get_builtin_path(), ModApiMainMenu::l_get_texturepath_share(), GUIEngine::loadMainMenuScript(), setSystemPaths(), and RenderingEngine::setWindowIcon().
std::string porting::path_user = ".." |
Referenced by ClientModConfiguration::ClientModConfiguration(), auto_select_world(), cleanupAndroid(), create_userdata_path(), GameOnDemandSoundFetcher::fetchSounds(), MenuMusicFetcher::fetchSounds(), Server::fillMediaCache(), findSubgame(), getAvailableGameIds(), getAvailableWorlds(), Client::getModStoragePath(), init_log_streams(), initializePaths(), initializePathsAndroid(), ModApiMainMenu::l_create_world(), ModApiMainMenu::l_get_clientmodpath(), ModApiMainMenu::l_get_gamepath(), ModApiMainMenu::l_get_modpath(), ModApiMainMenu::l_get_texturepath(), ModApiMainMenu::l_get_user_path(), ModApiUtil::l_get_user_path(), Client::makeScreenshot(), ModApiMainMenu::mayModifyPath(), migrateCachePath(), read_config_file(), ClientLauncher::run(), and setSystemPaths().