Classes | |
struct | Flags |
Public Member Functions | |
Game () | |
~Game () | |
bool | startup (bool *kill, InputHandler *input, RenderingEngine *rendering_engine, const GameStartData &game_params, std::string &error_message, bool *reconnect, ChatBackend *chat_backend) |
void | run () |
void | shutdown () |
Protected Member Functions | |
bool | init (const std::string &map_dir, const std::string &address, u16 port, const SubgameSpec &gamespec) |
bool | initSound () |
bool | createSingleplayerServer (const std::string &map_dir, const SubgameSpec &gamespec, u16 port) |
void | copyServerClientCache () |
bool | createClient (const GameStartData &start_data) |
bool | initGui () |
bool | connectToServer (const GameStartData &start_data, bool *connect_ok, bool *aborted) |
bool | getServerContent (bool *aborted) |
void | updateInteractTimers (f32 dtime) |
bool | checkConnection () |
void | processQueues () |
void | updateProfilers (const RunStats &stats, const FpsControl &draw_times, f32 dtime) |
void | updateDebugState () |
void | updateStats (RunStats *stats, const FpsControl &draw_times, f32 dtime) |
void | updateProfilerGraphs (ProfilerGraph *graph) |
void | processUserInput (f32 dtime) |
void | processKeyInput () |
void | processItemSelection (u16 *new_playeritem) |
bool | shouldShowTouchControls () |
void | dropSelectedItem (bool single_item=false) |
void | openConsole (float scale, const wchar_t *line=NULL) |
void | toggleFreeMove () |
void | toggleFreeMoveAlt () |
void | togglePitchMove () |
void | toggleFast () |
void | toggleNoClip () |
void | toggleCinematic () |
void | toggleBlockBounds () |
void | toggleAutoforward () |
void | toggleMinimap (bool shift_pressed) |
void | toggleFog () |
void | toggleDebug () |
void | toggleUpdateCamera () |
void | increaseViewRange () |
void | decreaseViewRange () |
void | toggleFullViewRange () |
void | checkZoomEnabled () |
void | updateCameraDirection (CameraOrientation *cam, float dtime) |
void | updateCameraOrientation (CameraOrientation *cam, float dtime) |
void | updatePlayerControl (const CameraOrientation &cam) |
void | updatePauseState () |
void | step (f32 dtime) |
void | processClientEvents (CameraOrientation *cam) |
void | updateCamera (f32 dtime) |
void | updateSound (f32 dtime) |
void | processPlayerInteraction (f32 dtime, bool show_hud) |
PointedThing | updatePointedThing (const core::line3d< f32 > &shootline, bool liquids_pointable, const std::optional< Pointabilities > &pointabilities, bool look_for_object, const v3s16 &camera_offset) |
void | handlePointingAtNothing (const ItemStack &playerItem) |
void | handlePointingAtNode (const PointedThing &pointed, const ItemStack &selected_item, const ItemStack &hand_item, f32 dtime) |
void | handlePointingAtObject (const PointedThing &pointed, const ItemStack &playeritem, const v3f &player_position, bool show_debug) |
void | handleDigging (const PointedThing &pointed, const v3s16 &nodepos, const ItemStack &selected_item, const ItemStack &hand_item, f32 dtime) |
void | updateFrame (ProfilerGraph *graph, RunStats *stats, f32 dtime, const CameraOrientation &cam) |
void | updateClouds (float dtime) |
void | updateShadows () |
void | drawScene (ProfilerGraph *graph, RunStats *stats) |
void | showOverlayMessage (const char *msg, float dtime, int percent, float *indef_pos=nullptr) |
bool | fogEnabled () |
void | readSettings () |
bool | isKeyDown (GameKeyType k) |
bool | wasKeyDown (GameKeyType k) |
bool | wasKeyPressed (GameKeyType k) |
bool | wasKeyReleased (GameKeyType k) |
Static Protected Member Functions | |
static void | settingChangedCallback (const std::string &setting_name, void *data) |
Static Private Attributes | |
static const ClientEventHandler | clientEventHandler [CLIENTEVENT_MAX] |
Game::Game | ( | ) |
References g_settings, readSettings(), Settings::registerChangedCallback(), and settingChangedCallback().
Game::~Game | ( | ) |
References camera, clearTextureNameCache(), client, Settings::deregisterAllChangedCallbacks(), draw_control, eventmgr, RenderingEngine::finalize(), g_settings, hud, itemdef_manager, m_rendering_engine, nodedef_manager, quicktune, server, shader_src, sound_manager, soundmaker, and texture_src.
|
inlineprotected |
References error_message, errorstream, fmtgettext(), and reconnect_requested.
Referenced by getServerContent(), and run().
|
protected |
References PlayerFovSpec::fov, Player::getFov(), LocalPlayer::getZoomFOV(), m_game_ui, and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References GameStartData::address, GameStartData::allow_login_or_register, IPv6AddressBytes::bytes, InputHandler::cancelPressed(), InputHandler::clear(), Client, device, draw_control, FrameMarker::end(), error_message, errorstream, eventmgr, fmtgettext(), g_settings, GAME_CONNECTION_TIMEOUT, GAME_FALLBACK_TIMEOUT, Settings::getBool(), Address::getPort(), infostream, input, Address::isAny(), Address::isIPv6(), Address::isValid(), itemdef_manager, LC_Init, FpsControl::limit(), m_rendering_engine, N_, GameStartData::name, nodedef_manager, GameStartData::password, reconnect_requested, FpsControl::reset(), Address::Resolve(), RenderingEngine::run(), Address::serializeString(), Address::setAddress(), Address::setPort(), shader_src, showOverlayMessage(), simple_singleplayer_mode, GameParams::socket_port, sound_manager, FrameMarker::started(), step(), texture_src, warningstream, and BaseException::what().
Referenced by createClient().
|
protected |
References clientMediaUpdateCacheCopy(), and infostream.
Referenced by createSingleplayerServer().
|
protected |
References IWritableShaderSource::addShaderConstantSetterFactory(), camera, clouds, connectToServer(), crack_animation_length, device, draw_control, driver, error_message, errorstream, g_version_hash, getServerContent(), IWritableTextureSource::getTexture(), hud, LocalPlayer::hurt_tilt_strength, LocalPlayer::hurt_tilt_timer, initGui(), Player::inventory, m_cache_enable_clouds, m_rendering_engine, mapper, N_, ShadowRenderer::preInit(), shader_src, showOverlayMessage(), simple_singleplayer_mode, sky, smgr, texture_src, and utf8_to_wide().
Referenced by startup().
|
protected |
References InputHandler::cancelPressed(), InputHandler::clear(), copyServerClientCache(), device, error_message, errorstream, fmtgettext(), g_settings, Settings::get(), Settings::getBool(), input, Address::isIPv6(), FpsControl::limit(), m_rendering_engine, m_shutdown_progress, N_, FpsControl::reset(), Address::Resolve(), RenderingEngine::run(), runInThread(), Address::serializeString(), Server, Address::setAddress(), showOverlayMessage(), simple_singleplayer_mode, warningstream, and BaseException::what().
Referenced by init().
|
protected |
References fwgettext(), g_settings, Settings::getS16(), itos(), m_game_ui, Settings::set(), GameUI::showStatusText(), and sky.
Referenced by processKeyInput().
|
protected |
References BS, camera, CAMERA_MODE_FIRST, CAMERA_MODE_THIRD_FRONT, GameRunData::damage_flash, ProfilerGraph::draw(), RenderingEngine::draw_scene(), RunStats::drawtime, driver, GameRunData::fog_range, FOG_RANGE_ALL, fogEnabled(), g_fontengine, g_profiler, g_touchcontrols, Camera::getCameraMode(), FontEngine::getFont(), Profiler::graphAdd(), HUD_FLAG_CROSSHAIR_VISIBLE, HUD_FLAG_WIELDITEM_VISIBLE, Player::hud_flags, isTouchCrosshairDisabled(), GameUI::m_flags, m_game_ui, m_rendering_engine, PRECISION_MICRO, runData, sky, TimeTaker::stop(), and ZoneScoped.
Referenced by updateFrame().
|
protected |
References IDropAction::count, MoveAction::from_i, MoveAction::from_inv, MoveAction::from_list, and InventoryLocation::setCurrentPlayer().
Referenced by processKeyInput().
|
inlineprotected |
References m_cache_enable_fog, and sky.
Referenced by drawScene().
|
private |
|
protected |
References InputHandler::cancelPressed(), checkConnection(), InputHandler::clear(), device, RenderingEngine::draw_load_screen(), FrameMarker::end(), error_message, errorstream, g_settings, Settings::getBool(), guienv, infostream, input, LC_Init, FpsControl::limit(), m_rendering_engine, FpsControl::reset(), RenderingEngine::run(), FrameMarker::started(), step(), texture_src, utf8_to_wide(), and wstrgettext().
Referenced by createClient().
|
private |
|
private |
References m_game_formspec, and GameFormSpec::showDeathFormspecLegacy().
|
private |
|
private |
References Player::addHud(), HudElement::align, HudElement::dir, HudElement::item, m_hud_server_to_client, HudElement::name, HudElement::number, HudElement::offset, HudElement::pos, HudElement::scale, HudElement::size, HudElement::style, HudElement::text, HudElement::text2, HudElement::type, HudElement::world_pos, and HudElement::z_index.
|
private |
References CASE_SET, dir(), Player::getHud(), HUD_STAT_ALIGN, HUD_STAT_DIR, HUD_STAT_ITEM, HUD_STAT_NAME, HUD_STAT_NUMBER, HUD_STAT_OFFSET, HUD_STAT_POS, HUD_STAT_SCALE, HUD_STAT_SIZE, HUD_STAT_STYLE, HUD_STAT_TEXT, HUD_STAT_TEXT2, HUD_STAT_WORLD_POS, HUD_STAT_Z_INDEX, ClientEvent::hudchange, HudElementStat_END, ClientEventHudChange::id, m_hud_server_to_client, and ClientEventHudChange::stat.
|
private |
References ClientEvent::hudrm, ClientEvent::id, m_hud_server_to_client, and Player::removeHud().
|
private |
References FATAL_ERROR.
|
private |
|
private |
References ClientEvent::amount, GameRunData::damage_flash, ClientEvent::effect, LocalPlayer::getCAO(), GenericCAO::getProperties(), ObjectProperties::hp_max, LocalPlayer::hurt_tilt_strength, LocalPlayer::hurt_tilt_timer, MYMIN, MtEvent::PLAYER_DAMAGE, ClientEvent::player_damage, PLAYER_MAX_HP_DEFAULT, rangelim, and runData.
|
private |
References CameraOrientation::camera_pitch, and CameraOrientation::camera_yaw.
|
private |
References ClientEvent::moon_params, MoonParams::scale, sky, MoonParams::texture, texture_src, MoonParams::tonemap, and MoonParams::visible.
|
private |
References SkyboxParams::bgcolor, SkyboxParams::body_orbit_tilt, SkyboxParams::clouds, draw_control, SkyboxParams::fog_color, SkyboxParams::fog_distance, SkyboxParams::fog_moon_tint, SkyboxParams::fog_start, SkyboxParams::fog_sun_tint, SkyboxParams::fog_tint_type, g_settings, Settings::getFloat(), Settings::getS16(), infostream, rangelim, ClientEvent::set_sky, sky, SkyboxParams::sky_color, texture_src, SkyboxParams::textures, SkyboxParams::type, and MapDrawControl::wanted_range.
|
private |
|
private |
|
private |
References ClientEvent::formname, ClientEvent::formspec, m_game_formspec, ClientEvent::show_formspec, and GameFormSpec::showFormSpec().
|
private |
References ClientEvent::formname, ClientEvent::formspec, m_game_formspec, ClientEvent::show_formspec, and GameFormSpec::showLocalFormSpec().
|
protected |
References GameRunData::btn_down_for_dig, camera, crack_animation_length, GameRunData::dig_index, GameRunData::dig_instantly, GameRunData::dig_time, GameRunData::dig_time_complete, DigParams::diggable, GameRunData::digging, GameRunData::digging_blocked, g_settings, SoundSpec::gain, NodeDefManager::get(), Settings::getBool(), getDigParams(), NodeDefManager::getId(), Map::getNode(), ItemStack::getToolCapabilities(), infostream, INTERACT_DIGGING_COMPLETED, INTERACT_START_DIGGING, itemdef_manager, m_cache_enable_particles, SoundMaker::m_player_leftpunch_sound, m_repeat_dig_time, DigParams::main_group, SoundSpec::name, nodedef_manager, GameRunData::nodig_delay_timer, runData, Camera::setDigging(), soundmaker, DigParams::time, and ItemStack::wear.
Referenced by handlePointingAtNode().
|
protected |
References camera, KeyType::DIG, GameRunData::digging_blocked, NodeDefManager::get(), ItemStack::getDefinition(), Map::getNode(), Map::getNodeMetadata(), SimpleMetadata::getString(), handleDigging(), infostream, isKeyDown(), itemdef_manager, m_game_ui, SoundMaker::m_player_rightpunch_sound, m_repeat_place_time, ContentFeatures::name, PointedThing::node_abovesurface, PointedThing::node_undersurface, nodedef_manager, nodePlacement(), GameRunData::nodig_delay_timer, KeyType::PLACE, GameRunData::repeat_place_timer, runData, Camera::setDigging(), GameUI::setInfoText(), soundmaker, unescape_translate(), utf8_to_wide(), and wasKeyPressed().
Referenced by processPlayerInteraction().
|
protected |
References infostream, INTERACT_ACTIVATE, POINTEDTHING_NOTHING, and PointedThing::type.
Referenced by processPlayerInteraction().
|
protected |
References ClientActiveObject::debugInfoText(), KeyType::DIG, dir(), ClientActiveObject::directReportPunch(), ClientActiveObject::getPosition(), infostream, ClientActiveObject::infoText(), INTERACT_PLACE, INTERACT_START_DIGGING, isKeyDown(), m_game_ui, object_hit_delay, GameRunData::object_hit_delay_timer, KeyType::PLACE, GameRunData::punching, runData, GameRunData::selected_object, GameUI::setInfoText(), GameRunData::time_from_last_punch, unescape_translate(), utf8_to_wide(), wasKeyDown(), and wasKeyPressed().
Referenced by processPlayerInteraction().
|
protected |
References fwgettext(), g_settings, Settings::getS16(), itos(), m_game_ui, Settings::set(), GameUI::showStatusText(), and sky.
Referenced by processKeyInput().
|
protected |
References createItemDefManager(), createNodeDefManager(), createShaderSource(), createSingleplayerServer(), createTextureSource(), eventmgr, initSound(), itemdef_manager, N_, nodedef_manager, quicktune, shader_src, showOverlayMessage(), and texture_src.
Referenced by startup().
|
protected |
References ChatBackend::applySettings(), chat_backend, ChatBackend::clearRecentChat(), device, g_menumgr, g_touchcontrols, gui_chat_console, guienv, GameUI::init(), isTouchCrosshairDisabled(), m_game_ui, TouchControls::setUseCrosshair(), shouldShowTouchControls(), and texture_src.
Referenced by createClient().
|
protected |
References createOpenALSoundManager(), eventmgr, g_settings, g_sound_manager_singleton, Settings::getBool(), infostream, nodedef_manager, SoundMaker::registerReceiver(), sound_manager, and soundmaker.
Referenced by init().
|
inlineprotected |
References input, and InputHandler::isKeyDown().
Referenced by handlePointingAtNode(), handlePointingAtObject(), nodePlacement(), processKeyInput(), processPlayerInteraction(), and updatePlayerControl().
|
inlineprivate |
References camera, CAMERA_MODE_FIRST, Camera::getCameraMode(), and m_touch_use_crosshair.
Referenced by drawScene(), initGui(), processPlayerInteraction(), and updateCamera().
|
private |
References BS, ContentFeatures::buildable_to, CPT2_4DIR, CPT2_COLOR, CPT2_COLORED_4DIR, CPT2_COLORED_FACEDIR, CPT2_COLORED_WALLMOUNTED, CPT2_FACEDIR, CPT2_WALLMOUNTED, dir(), ContentFeatures::drawtype, errorstream, facedir_dirs, floatToInt(), g_settings, NodeDefManager::get(), Settings::getBool(), MapNode::getFaceDir(), NodeDefManager::getId(), Map::getNode(), MapNode::getParam2(), LocalPlayer::getStandingNodePos(), SimpleMetadata::getString(), MapNode::getWallMountedDir(), ContentFeatures::groups, input, INTERACT_PLACE, isKeyDown(), InputHandler::isRandom(), itemgroup_get(), m_game_formspec, SoundMaker::m_player_rightpunch_sound, ItemStack::metadata, MYMAX, mystoi(), ItemDefinition::name, NDT_SIGNLIKE, NDT_TORCHLIKE, ItemDefinition::node_placement_prediction, nodedef_manager, p(), ContentFeatures::param_type_2, ItemDefinition::place_param2, ContentFeatures::rightclickable, MapNode::setParam2(), GameFormSpec::showNodeFormspec(), KeyType::SNEAK, ItemDefinition::sound_place, ItemDefinition::sound_place_failed, soundmaker, verbosestream, ContentFeatures::walkable, and ItemDefinition::wallmounted_rotate_vertical.
Referenced by handlePointingAtNode().
|
protected |
References gui_chat_console, porting::hasPhysicalKeyboardAndroid(), and porting::showTextInputDialog().
Referenced by processKeyInput().
|
private |
References paused_animated_nodes, pauseNodeAnimation(), and smgr.
Referenced by updatePauseState().
|
protected |
References CLIENTEVENT_MAX, clientEventHandler, FATAL_ERROR_IF, and ClientEventHandler::handler.
Referenced by run().
|
protected |
References dir(), g_touchcontrols, TouchControls::getHotbarSelection(), Player::getMaxHotbarItemcount(), InputHandler::getMouseWheel(), Player::getWieldIndex(), KeyType::HOTBAR_NEXT, KeyType::HOTBAR_PREV, input, m_enable_hotbar_mouse_wheel, m_invert_hotbar_mouse_wheel, MYMIN, KeyType::SLOT_1, and wasKeyDown().
Referenced by processUserInput().
|
protected |
References KeyType::AUTOFORWARD, KeyType::BACKWARD, InputHandler::cancelPressed(), KeyType::CHAT, checkZoomEnabled(), KeyType::CINEMATIC, KeyType::CMD, KeyType::CMD_LOCAL, KeyType::CONSOLE, QuicktuneShortcutter::dec(), KeyType::DEC_VOLUME, KeyType::DECREASE_VIEWING_RANGE, decreaseViewRange(), KeyType::DROP, dropSelectedItem(), KeyType::FASTMOVE, KeyType::FREEMOVE, fwgettext(), g_settings, Settings::getBool(), Settings::getFloat(), QuicktuneShortcutter::getMessage(), gui_chat_console, QuicktuneShortcutter::hasMessage(), QuicktuneShortcutter::inc(), KeyType::INC_VOLUME, KeyType::INCREASE_VIEWING_RANGE, increaseViewRange(), input, KeyType::INVENTORY, isKeyDown(), KeyType::JUMP, GameRunData::jump_timer_up, m_game_formspec, m_game_ui, KeyType::MINIMAP, KeyType::MUTE, myround(), QuicktuneShortcutter::next(), KeyType::NOCLIP, openConsole(), KeyType::PITCHMOVE, QuicktuneShortcutter::prev(), quicktune, KeyType::QUICKTUNE_DEC, KeyType::QUICKTUNE_INC, KeyType::QUICKTUNE_NEXT, KeyType::QUICKTUNE_PREV, KeyType::RANGESELECT, GameRunData::reset_jump_timer, runData, KeyType::SCREENSHOT, Settings::setBool(), Settings::setFloat(), GameFormSpec::showPauseMenu(), GameFormSpec::showPlayerInventory(), GameUI::showStatusText(), GameUI::showTranslatedStatusText(), KeyType::SNEAK, KeyType::TOGGLE_BLOCK_BOUNDS, KeyType::TOGGLE_CHAT, KeyType::TOGGLE_DEBUG, KeyType::TOGGLE_FOG, KeyType::TOGGLE_HUD, KeyType::TOGGLE_PROFILER, KeyType::TOGGLE_UPDATE_CAMERA, toggleAutoforward(), toggleBlockBounds(), GameUI::toggleChat(), toggleCinematic(), toggleDebug(), toggleFast(), toggleFog(), toggleFreeMove(), toggleFreeMoveAlt(), toggleFullViewRange(), GameUI::toggleHud(), toggleMinimap(), toggleNoClip(), togglePitchMove(), GameUI::toggleProfiler(), toggleUpdateCamera(), utf8_to_wide(), wasKeyDown(), wasKeyPressed(), and KeyType::ZOOM.
Referenced by processUserInput().
|
protected |
References TouchControls::applyContextControls(), BS, GameRunData::btn_down_for_dig, camera, CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT, InputHandler::clearWasKeyPressed(), JoystickController::clearWasKeyPressed(), InputHandler::clearWasKeyReleased(), JoystickController::clearWasKeyReleased(), Player::control, KeyType::DIG, PlayerControl::dig, GameRunData::dig_instantly, GameRunData::dig_time, GameRunData::digging, GameRunData::digging_blocked, PointedThing::dump(), g_settings, g_touchcontrols, Settings::getBool(), Camera::getCameraMode(), ItemStack::getDefinition(), Camera::getDirection(), Camera::getHeadPosition(), TouchInteraction::getMode(), Camera::getOffset(), Camera::getPosition(), LocalPlayer::getPosition(), TouchControls::getShootline(), getToolRange(), Player::getWieldedItem(), handlePointingAtNode(), handlePointingAtNothing(), handlePointingAtObject(), hud, HUD_FLAG_BASIC_DEBUG, Player::hud_flags, infostream, input, INTERACT_STOP_DIGGING, INTERACT_USE, intToFloat(), isKeyDown(), isTouchCrosshairDisabled(), itemdef_manager, InputHandler::joystick, ItemDefinition::liquids_pointable, GameUI::m_flags, m_game_ui, SoundMaker::m_player_leftpunch_sound, SoundMaker::m_player_leftpunch_sound2, PointedThing::node_undersurface, GameRunData::nodig_delay_timer, KeyType::PLACE, PlayerControl::place, ItemDefinition::pointabilities, GameRunData::pointed_old, POINTEDTHING_NODE, POINTEDTHING_NOTHING, POINTEDTHING_OBJECT, GameRunData::punching, GameRunData::repeat_place_timer, runData, Camera::setDigging(), ItemDefinition::sound_use, ItemDefinition::sound_use_air, soundmaker, ItemDefinition::touch_interaction, PointedThing::type, updatePointedThing(), Hud::updateSelectionMesh(), ItemDefinition::usable, wasKeyDown(), wasKeyPressed(), and wasKeyReleased().
Referenced by run().
|
protected |
References IWritableShaderSource::processQueue(), IWritableTextureSource::processQueue(), shader_src, and texture_src.
Referenced by run().
|
protected |
References InputHandler::clear(), device, g_touchcontrols, gui_chat_console, guienv, TouchControls::hide(), infostream, input, isMenuActive(), GameRunData::jump_timer_down, GameRunData::jump_timer_up, m_cache_doubletap_jump, m_game_focused, m_game_formspec, GameRunData::new_playeritem, processItemSelection(), processKeyInput(), InputHandler::releaseAllKeys(), runData, shouldShowTouchControls(), TouchControls::show(), InputHandler::step(), TouchControls::step(), and texture_src.
Referenced by run().
|
protected |
References g_settings, Settings::get(), Settings::getBool(), Settings::getFloat(), LL_MAX, LL_NONE, m_cache_cam_smoothing, m_cache_disable_escape_sequences, m_cache_doubletap_jump, m_cache_enable_clouds, m_cache_enable_fog, m_cache_enable_free_move, m_cache_enable_joysticks, m_cache_enable_noclip, m_cache_enable_particles, m_cache_joystick_frustum_sensitivity, m_cache_mouse_sensitivity, m_chat_log_buf, m_does_lost_focus_pause_game, m_enable_hotbar_mouse_wheel, m_invert_hotbar_mouse_wheel, m_invert_mouse, m_repeat_dig_time, m_repeat_place_time, rangelim, CaptureLogOutput::setLogLevel(), Logger::stringToLevel(), and warningstream.
Referenced by Game().
|
private |
References paused_animated_nodes.
Referenced by updatePauseState().
void Game::run | ( | ) |
References RenderingEngine::autosaveScreensizeAndCo(), CameraOrientation::camera_pitch, CameraOrientation::camera_yaw, checkConnection(), GameUI::clearInfoText(), client_display_info, device, dynamic_info_send_timer, FrameMarker::end(), g_gamecallback, g_menumgr, g_profiler, g_settings, Settings::getBool(), Settings::getFloat(), Settings::getU16(), Profiler::graphPop(), GameFormSpec::handleCallbacks(), isMenuActive(), kill, FpsControl::limit(), m_cache_cam_smoothing, m_does_lost_focus_pause_game, GameUI::m_flags, m_game_formspec, m_game_ui, m_is_paused, m_rendering_engine, m_touch_simulate_aux1, MainMenuManager::pausesGame(), processClientEvents(), processPlayerInteraction(), processQueues(), processUserInput(), FpsControl::reset(), RenderingEngine::run(), GameFormSpec::showPauseMenu(), MainGameCallback::shutdown_requested, FrameMarker::started(), step(), updateCamera(), updateCameraDirection(), updateDebugState(), updateFrame(), updateInteractTimers(), updatePauseState(), updatePlayerControl(), updateProfilerGraphs(), updateProfilers(), updateSound(), updateStats(), and ZoneScoped.
Referenced by the_game().
|
staticprotected |
|
protected |
References device, g_settings, Settings::get(), RenderingEngine::getLastPointerType(), is_yes(), and Touch.
Referenced by initGui(), and processUserInput().
|
protected |
References RenderingEngine::draw_load_screen(), guienv, m_rendering_engine, texture_src, and wstrgettext().
Referenced by connectToServer(), createClient(), createSingleplayerServer(), init(), and shutdown().
void Game::shutdown | ( | ) |
References ChatBackend::addMessage(), chat_backend, GameUI::clearText(), client, clouds, MainMenuManager::deleteFront(), device, g_menumgr, g_touchcontrols, gui_chat_console, TouchControls::hide(), m_game_ui, m_rendering_engine, m_shutdown_progress, MainMenuManager::menuCount(), N_, IWritableShaderSource::processQueue(), IWritableTextureSource::processQueue(), FpsControl::reset(), RenderingEngine::run(), runInThread(), server, shader_src, showOverlayMessage(), sky, sleep_ms, sound_manager, soundmaker, and texture_src.
Referenced by the_game().
bool Game::startup | ( | bool * | kill, |
InputHandler * | input, | ||
RenderingEngine * | rendering_engine, | ||
const GameStartData & | game_params, | ||
std::string & | error_message, | ||
bool * | reconnect, | ||
ChatBackend * | chat_backend ) |
References GameStartData::address, chat_backend, Translations::clear(), createClient(), device, driver, error_message, g_client_translations, g_settings, GameParams::game_spec, RenderingEngine::get_raw_device(), RenderingEngine::get_scene_manager(), Settings::getBool(), hud, init(), GameFormSpec::init(), GameUI::initFlags(), RenderingEngine::initialize(), input, GameStartData::isSinglePlayer(), InputHandler::keycache, kill, m_first_loop_after_window_activation, m_game_formspec, m_game_ui, m_rendering_engine, m_touch_use_crosshair, WorldSpec::path, KeyCache::populate(), reconnect_requested, runData, simple_singleplayer_mode, smgr, GameParams::socket_port, GameRunData::time_from_last_punch, and GameStartData::world_spec.
Referenced by the_game().
|
inlineprotected |
References device, g_menumgr, g_settings, Settings::getFloat(), m_is_paused, MainMenuManager::pausesGame(), and ZoneScoped.
Referenced by connectToServer(), getServerContent(), and run().
|
protected |
References bool_to_cstr(), g_settings, Settings::getBool(), m_game_ui, Settings::set(), and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References Hud::BLOCK_BOUNDS_CURRENT, Hud::BLOCK_BOUNDS_NEAR, Hud::BLOCK_BOUNDS_OFF, hud, HUD_FLAG_BASIC_DEBUG, Player::hud_flags, m_game_ui, GameUI::showTranslatedStatusText(), and Hud::toggleBlockBounds().
Referenced by processKeyInput().
|
protected |
References bool_to_cstr(), g_settings, Settings::getBool(), m_game_ui, Settings::set(), and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References draw_control, HUD_FLAG_BASIC_DEBUG, Player::hud_flags, GameUI::m_flags, m_game_ui, MapDrawControl::show_wireframe, and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References bool_to_cstr(), g_settings, Settings::getBool(), m_game_ui, m_touch_simulate_aux1, Settings::set(), and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References g_settings, Settings::getBool(), m_game_ui, Settings::setBool(), GameUI::showTranslatedStatusText(), and sky.
Referenced by processKeyInput().
|
protected |
References bool_to_cstr(), g_settings, Settings::getBool(), m_game_ui, Settings::set(), and GameUI::showTranslatedStatusText().
Referenced by processKeyInput(), and toggleFreeMoveAlt().
|
protected |
References GameRunData::jump_timer_down, GameRunData::jump_timer_down_before, GameRunData::jump_timer_up, m_cache_doubletap_jump, GameRunData::reset_jump_timer, runData, and toggleFreeMove().
Referenced by processKeyInput().
|
protected |
References draw_control, m_game_ui, MapDrawControl::range_all, GameUI::showTranslatedStatusText(), and sky.
Referenced by processKeyInput().
|
protected |
References g_settings, Settings::getBool(), Minimap::getModeDef(), Minimap::getModeIndex(), Hud::hasElementOfType(), hud, HUD_ELEM_MINIMAP, HUD_FLAG_MINIMAP_RADAR_VISIBLE, HUD_FLAG_MINIMAP_VISIBLE, MinimapModeDef::label, GameUI::m_flags, m_game_ui, mapper, MINIMAP_TYPE_RADAR, Minimap::nextMode(), GameUI::showStatusText(), GameUI::showTranslatedStatusText(), Minimap::toggleMinimapShape(), MinimapModeDef::type, and utf8_to_wide().
Referenced by processKeyInput().
|
protected |
References bool_to_cstr(), g_settings, Settings::getBool(), m_game_ui, Settings::set(), and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References bool_to_cstr(), g_settings, Settings::getBool(), m_game_ui, Settings::set(), and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References Game::Flags::disable_camera_update, m_flags, m_game_ui, and GameUI::showTranslatedStatusText().
Referenced by processKeyInput().
|
protected |
References camera, KeyType::CAMERA_MODE, CAMERA_MODE_FIRST, clouds, Game::Flags::disable_camera_update, ToolCapabilities::full_punch_interval, g_touchcontrols, Camera::getCameraMode(), LocalPlayer::getCAO(), Camera::getDirection(), Camera::getFovMax(), Camera::getOffset(), Camera::getPosition(), ItemStack::getToolCapabilities(), Player::getWieldedItem(), isTouchCrosshairDisabled(), itemdef_manager, LocalPlayer::light_color, m_camera_offset_changed, m_flags, MYMIN, runData, GenericCAO::setChildrenVisible(), TouchControls::setUseCrosshair(), Camera::step(), GameRunData::time_from_last_punch, Camera::toggleCameraMode(), Camera::update(), GenericCAO::updateMeshCulling(), and wasKeyPressed().
Referenced by run().
|
protected |
References device, driver, g_touchcontrols, input, isMenuActive(), InputHandler::isRandom(), m_first_loop_after_window_activation, InputHandler::setMousePos(), and updateCameraOrientation().
Referenced by run().
|
protected |
References camera, CAMERA_MODE_THIRD_FRONT, CameraOrientation::camera_pitch, CameraOrientation::camera_yaw, driver, g_touchcontrols, JoystickController::getAxisWithoutDead(), Camera::getCameraMode(), InputHandler::getMousePos(), TouchControls::getPitchChange(), getSensitivityScaleFactor(), TouchControls::getYawChange(), input, JA_FRUSTUM_HORIZONTAL, JA_FRUSTUM_VERTICAL, InputHandler::joystick, m_cache_enable_joysticks, m_cache_joystick_frustum_sensitivity, m_cache_mouse_sensitivity, m_invert_mouse, rangelim, and InputHandler::setMousePos().
Referenced by updateCameraDirection().
|
private |
References ChatBackend::addMessage(), ChatBackend::addUnparsedMessage(), chat_backend, ChatBackend::getRecentBuffer(), ChatBackend::getRecentChat(), LL_ERROR, LL_INFO, LL_TRACE, LL_VERBOSE, LL_WARNING, m_cache_disable_escape_sequences, m_chat_log_buf, m_game_ui, ChatBuffer::resetLinesModified(), GameUI::setChatText(), ChatBackend::step(), CaptureLogOutput::take(), GameUI::updateChatSize(), and utf8_to_wide().
Referenced by updateFrame().
|
protected |
References BS, camera, clouds, GameRunData::fog_range, Camera::getCameraNode(), Camera::getOffset(), runData, and sky.
Referenced by updateFrame().
|
protected |
References MapDrawControl::allow_noclip, Game::Flags::disable_camera_update, Hud::disableBlockBounds(), GameFormSpec::disableDebugView(), draw_control, hud, HUD_FLAG_BASIC_DEBUG, Player::hud_flags, m_cache_enable_noclip, m_flags, GameUI::m_flags, m_game_formspec, m_game_ui, and MapDrawControl::show_wireframe.
Referenced by run().
|
protected |
References MapDrawControl::allow_noclip, Profiler::avg(), BS, camera, clouds, GameRunData::damage_flash, device, draw_control, drawScene(), floatToInt(), GameRunData::fog_range, FOG_RANGE_ALL, g_profiler, RenderingEngine::get_shadow_renderer(), Camera::getCameraMode(), Camera::getDirection(), LocalPlayer::getPitch(), LocalPlayer::getPosition(), Player::getWieldedItem(), Player::getWieldIndex(), LocalPlayer::getYaw(), gui_chat_console, LocalPlayer::hurt_tilt_strength, LocalPlayer::hurt_tilt_timer, m_cache_enable_free_move, m_camera_offset_changed, GameUI::m_flags, m_game_formspec, m_game_ui, m_is_paused, mapper, MYMIN, GameRunData::new_playeritem, GameRunData::pointed_old, MapDrawControl::range_all, runData, Minimap::setAngle(), Minimap::setPos(), sky, TimeTaker::stop(), GameRunData::time_of_day_smooth, GameRunData::touch_blocks_timer, GameFormSpec::update(), GameUI::update(), GameRunData::update_draw_list_last_cam_dir, GameRunData::update_draw_list_timer, updateChat(), updateClouds(), updateShadows(), MapDrawControl::wanted_range, Camera::wield(), and ZoneScoped.
Referenced by run().
|
inlineprotected |
References GameRunData::nodig_delay_timer, GameRunData::object_hit_delay_timer, runData, and GameRunData::time_from_last_punch.
Referenced by run().
|
protected |
References g_menumgr, m_is_paused, ISoundManager::pauseAll(), pauseAnimation(), MainMenuManager::pausesGame(), ISoundManager::resumeAll(), resumeAnimation(), simple_singleplayer_mode, and sound_manager.
Referenced by run().
|
protected |
References KeyType::AUX1, PlayerControl::aux1, KeyType::BACKWARD, CameraOrientation::camera_pitch, CameraOrientation::camera_yaw, PlayerSettings::continuous_forward, KeyType::DIG, KeyType::FORWARD, g_touchcontrols, LocalPlayer::getAutojump(), InputHandler::getJoystickDirection(), InputHandler::getJoystickSpeed(), LocalPlayer::getPlayerSettings(), input, LocalPlayer::isDead(), isKeyDown(), KeyType::JUMP, KeyType::LEFT, m_touch_simulate_aux1, PlayerControl::movement_direction, PlayerControl::movement_speed, KeyType::PLACE, KeyType::RIGHT, PlayerControl::setMovementFromKeys(), KeyType::SNEAK, and KeyType::ZOOM.
Referenced by run().
|
protected |
Returns the object or node the player is pointing at. Also updates the selected thing in the Hud.
[in] | shootline | the shootline, starting from the camera position. This also gives the maximal distance of the search. |
[in] | liquids_pointable | if false, liquids are ignored |
[in] | pointabilities | item specific pointable overriding |
[in] | look_for_object | if false, objects are ignored |
[in] | camera_offset | offset of the camera |
[out] | selected_object | the selected object or NULL if not found |
References BS, Environment::continueRaycast(), dir(), ClientActiveObject::doShowSelectionBox(), final_color_blend(), floatToInt(), g_6dirs, g_settings, Settings::getBool(), ClientEnvironment::getClientMap(), getInteriorLight(), MapNode::getNeighbors(), Map::getNode(), Map::getNodeDefManager(), ClientActiveObject::getPosition(), GenericCAO::getProperties(), GenericCAO::getSceneNode(), ClientActiveObject::getSelectionBox(), Hud::getSelectionBoxes(), MapNode::getSelectionBoxes(), Hud::getSelectionPos(), hud, PointedThing::intersection_normal, intToFloat(), PointedThing::node_undersurface, PointedThing::object_id, p(), POINTEDTHING_NODE, POINTEDTHING_OBJECT, Hud::pointing_at_object, PointedThing::raw_intersection_normal, ObjectProperties::rotate_selectionbox, runData, GameRunData::selected_object, Hud::setSelectedFaceNormal(), Hud::setSelectionMeshColor(), Hud::setSelectionPos(), Hud::setSelectionRotation(), and PointedThing::type.
Referenced by processPlayerInteraction().
|
inlineprotected |
References g_profiler, Profiler::graphPop(), and ProfilerGraph::put().
Referenced by run().
|
protected |
References Profiler::avg(), FpsControl::busy_time, Profiler::clear(), RunStats::drawtime, driver, g_profiler, g_settings, Settings::getFloat(), Profiler::graphAdd(), Profiler::graphSet(), infostream, m_game_ui, Profiler::print(), profiler_interval, FpsControl::sleep_time, IntervalLimiter::step(), and GameUI::updateProfiler().
Referenced by run().
|
protected |
References camera, RenderingEngine::get_shadow_renderer(), ShadowRenderer::getDirectionalLight(), getWickedTimeOfDay(), m_camera_offset_changed, runData, DirectionalLight::setDirection(), ShadowRenderer::setShadowIntensity(), ShadowRenderer::setShadowTint(), ShadowRenderer::setTimeOfDay(), sky, GameRunData::time_of_day_smooth, and DirectionalLight::update_frustum().
Referenced by updateFrame().
|
protected |
References BS, camera, device, NodeDefManager::get(), Camera::getCameraNode(), Camera::getDirection(), LocalPlayer::getFootstepNodePos(), Map::getNode(), Camera::getOffset(), LocalPlayer::getParent(), Player::getSpeed(), ClientActiveObject::getVelocity(), intToFloat(), SoundMaker::m_player_step_sound, LocalPlayer::makes_footstep_sound, SoundMaker::makes_footstep_sound, nodedef_manager, ContentFeatures::sound_footstep, sound_manager, sound_volume_control(), soundmaker, SoundMaker::step(), and ISoundManager::updateListener().
Referenced by run().
|
protected |
References Jitter::avg, RunStats::busy_time_jitter, Jitter::counter, RunStats::dtime_jitter, FpsControl::getBusyMs(), Jitter::max, Jitter::max_fraction, Jitter::max_sample, Jitter::min, and Jitter::min_sample.
Referenced by run().
|
inlineprotected |
References input, and InputHandler::wasKeyDown().
Referenced by handlePointingAtObject(), processItemSelection(), processKeyInput(), and processPlayerInteraction().
|
inlineprotected |
References input, and InputHandler::wasKeyPressed().
Referenced by handlePointingAtNode(), handlePointingAtObject(), processKeyInput(), processPlayerInteraction(), and updateCamera().
|
inlineprotected |
References input, and InputHandler::wasKeyReleased().
Referenced by processPlayerInteraction().
|
private |
|
private |
Referenced by initGui(), shutdown(), startup(), and updateChat().
|
private |
Referenced by ~Game(), and shutdown().
|
private |
Referenced by run().
|
staticprivate |
Referenced by processClientEvents().
|
private |
Referenced by createClient(), handleClientEvent_CloudParams(), shutdown(), updateCamera(), updateClouds(), and updateFrame().
|
private |
Referenced by createClient(), and handleDigging().
|
private |
|
private |
Referenced by ~Game(), connectToServer(), createClient(), handleClientEvent_SetSky(), toggleDebug(), toggleFullViewRange(), updateDebugState(), and updateFrame().
|
private |
Referenced by createClient(), drawScene(), startup(), updateCameraDirection(), updateCameraOrientation(), and updateProfilers().
|
private |
Referenced by run().
|
private |
Referenced by checkConnection(), connectToServer(), createClient(), createSingleplayerServer(), getServerContent(), and startup().
|
private |
Referenced by ~Game(), connectToServer(), init(), and initSound().
|
private |
Referenced by initGui(), openConsole(), processKeyInput(), processUserInput(), shutdown(), and updateFrame().
|
private |
Referenced by ~Game(), createClient(), processPlayerInteraction(), startup(), toggleBlockBounds(), toggleMinimap(), updateDebugState(), and updatePointedThing().
|
private |
Referenced by connectToServer(), createSingleplayerServer(), getServerContent(), isKeyDown(), nodePlacement(), processItemSelection(), processKeyInput(), processPlayerInteraction(), processUserInput(), startup(), updateCameraDirection(), updateCameraOrientation(), updatePlayerControl(), wasKeyDown(), wasKeyPressed(), and wasKeyReleased().
|
private |
Referenced by ~Game(), connectToServer(), handleDigging(), handlePointingAtNode(), init(), processPlayerInteraction(), and updateCamera().
|
private |
Referenced by readSettings(), and run().
|
private |
Referenced by readSettings(), and updateChat().
|
private |
Referenced by processUserInput(), readSettings(), and toggleFreeMoveAlt().
|
private |
Referenced by createClient(), and readSettings().
|
private |
Referenced by fogEnabled(), and readSettings().
|
private |
Referenced by readSettings(), and updateFrame().
|
private |
Referenced by readSettings(), and updateCameraOrientation().
|
private |
Referenced by readSettings(), and updateDebugState().
|
private |
Referenced by handleDigging(), and readSettings().
|
private |
Referenced by readSettings(), and updateCameraOrientation().
|
private |
Referenced by readSettings(), and updateCameraOrientation().
|
private |
Referenced by updateCamera(), updateFrame(), and updateShadows().
|
private |
Referenced by readSettings(), and updateChat().
|
private |
Referenced by readSettings(), and run().
|
private |
Referenced by processItemSelection(), and readSettings().
|
private |
Referenced by startup(), and updateCameraDirection().
|
private |
Referenced by toggleUpdateCamera(), updateCamera(), and updateDebugState().
|
private |
Referenced by processUserInput().
|
private |
|
private |
Referenced by checkZoomEnabled(), decreaseViewRange(), drawScene(), handlePointingAtNode(), handlePointingAtObject(), increaseViewRange(), initGui(), processKeyInput(), processPlayerInteraction(), run(), shutdown(), startup(), toggleAutoforward(), toggleBlockBounds(), toggleCinematic(), toggleDebug(), toggleFast(), toggleFog(), toggleFreeMove(), toggleFullViewRange(), toggleMinimap(), toggleNoClip(), togglePitchMove(), toggleUpdateCamera(), updateChat(), updateDebugState(), updateFrame(), and updateProfilers().
|
private |
Referenced by handleClientEvent_HudAdd(), handleClientEvent_HudChange(), and handleClientEvent_HudRemove().
|
private |
Referenced by processItemSelection(), and readSettings().
|
private |
Referenced by readSettings(), and updateCameraOrientation().
|
private |
Referenced by run(), step(), updateFrame(), and updatePauseState().
|
private |
Referenced by ~Game(), connectToServer(), createClient(), createSingleplayerServer(), drawScene(), getServerContent(), run(), showOverlayMessage(), shutdown(), and startup().
|
private |
Referenced by handleDigging(), and readSettings().
|
private |
Referenced by handlePointingAtNode(), and readSettings().
|
private |
Referenced by createSingleplayerServer(), and shutdown().
|
private |
Referenced by run(), toggleFast(), and updatePlayerControl().
|
private |
Referenced by isTouchCrosshairDisabled(), and startup().
|
private |
Referenced by createClient(), toggleMinimap(), and updateFrame().
|
private |
Referenced by ~Game(), connectToServer(), handleDigging(), handlePointingAtNode(), init(), initSound(), nodePlacement(), and updateSound().
|
private |
Referenced by pauseAnimation(), and resumeAnimation().
|
private |
Referenced by updateProfilers().
|
private |
Referenced by ~Game(), init(), and processKeyInput().
|
private |
Referenced by checkConnection(), connectToServer(), and startup().
|
private |
Referenced by drawScene(), handleClientEvent_PlayerDamage(), handleDigging(), handlePointingAtNode(), handlePointingAtObject(), processKeyInput(), processPlayerInteraction(), processUserInput(), startup(), toggleFreeMoveAlt(), updateCamera(), updateClouds(), updateFrame(), updateInteractTimers(), updatePointedThing(), and updateShadows().
|
private |
Referenced by ~Game(), and shutdown().
|
private |
Referenced by ~Game(), connectToServer(), createClient(), init(), processQueues(), and shutdown().
|
private |
Referenced by connectToServer(), createClient(), createSingleplayerServer(), startup(), and updatePauseState().
|
private |
Referenced by createClient(), decreaseViewRange(), drawScene(), fogEnabled(), handleClientEvent_SetMoon(), handleClientEvent_SetSky(), handleClientEvent_SetStars(), handleClientEvent_SetSun(), increaseViewRange(), shutdown(), toggleFog(), toggleFullViewRange(), updateClouds(), updateFrame(), and updateShadows().
|
private |
Referenced by createClient(), pauseAnimation(), and startup().
|
private |
Referenced by ~Game(), connectToServer(), initSound(), shutdown(), updatePauseState(), and updateSound().
|
private |
Referenced by ~Game(), handleDigging(), handlePointingAtNode(), initSound(), nodePlacement(), processPlayerInteraction(), shutdown(), and updateSound().
|
private |