mirror of
https://github.com/minetest/minetest.git
synced 2024-07-07 08:25:28 +02:00
Compare commits
1 Commits
4165e8fb31
...
7c42fadd5a
Author | SHA1 | Date | |
---|---|---|---|
|
7c42fadd5a |
@ -218,7 +218,6 @@ core.register_on_formspec_input(function(formname, fields)
|
|||||||
dialogdata.components = nil
|
dialogdata.components = nil
|
||||||
dialogdata.rightscroll = 0
|
dialogdata.rightscroll = 0
|
||||||
core.show_settings()
|
core.show_settings()
|
||||||
core.reload_graphics()
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -273,9 +273,6 @@ void ClientEnvironment::step(float dtime)
|
|||||||
auto cb_state = [this, dtime, update_lighting, day_night_ratio] (ClientActiveObject *cao) {
|
auto cb_state = [this, dtime, update_lighting, day_night_ratio] (ClientActiveObject *cao) {
|
||||||
// Step object
|
// Step object
|
||||||
cao->step(dtime, this);
|
cao->step(dtime, this);
|
||||||
|
|
||||||
if (m_update_shadows)
|
|
||||||
cao->updateSceneShadows();
|
|
||||||
|
|
||||||
if (update_lighting)
|
if (update_lighting)
|
||||||
cao->updateLight(day_night_ratio);
|
cao->updateLight(day_night_ratio);
|
||||||
@ -299,9 +296,6 @@ void ClientEnvironment::step(float dtime)
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_update_shadows)
|
|
||||||
m_update_shadows = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientEnvironment::addSimpleObject(ClientSimpleObject *simple)
|
void ClientEnvironment::addSimpleObject(ClientSimpleObject *simple)
|
||||||
|
@ -142,14 +142,13 @@ class ClientEnvironment : public Environment
|
|||||||
const std::set<std::string> &getPlayerNames() { return m_player_names; }
|
const std::set<std::string> &getPlayerNames() { return m_player_names; }
|
||||||
void addPlayerName(const std::string &name) { m_player_names.insert(name); }
|
void addPlayerName(const std::string &name) { m_player_names.insert(name); }
|
||||||
void removePlayerName(const std::string &name) { m_player_names.erase(name); }
|
void removePlayerName(const std::string &name) { m_player_names.erase(name); }
|
||||||
void updateCameraOffset(const v3s16 &camera_offset) { m_camera_offset = camera_offset; }
|
void updateCameraOffset(const v3s16 &camera_offset)
|
||||||
void requestUpdateShadows() { m_update_shadows = true; }
|
{ m_camera_offset = camera_offset; }
|
||||||
v3s16 getCameraOffset() const { return m_camera_offset; }
|
v3s16 getCameraOffset() const { return m_camera_offset; }
|
||||||
|
|
||||||
void updateFrameTime(bool is_paused);
|
void updateFrameTime(bool is_paused);
|
||||||
u64 getFrameTime() const { return m_frame_time; }
|
u64 getFrameTime() const { return m_frame_time; }
|
||||||
u64 getFrameTimeDelta() const { return m_frame_dtime; }
|
u64 getFrameTimeDelta() const { return m_frame_dtime; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ClientMap *m_map;
|
ClientMap *m_map;
|
||||||
@ -163,7 +162,6 @@ class ClientEnvironment : public Environment
|
|||||||
IntervalLimiter m_active_object_light_update_interval;
|
IntervalLimiter m_active_object_light_update_interval;
|
||||||
std::set<std::string> m_player_names;
|
std::set<std::string> m_player_names;
|
||||||
v3s16 m_camera_offset;
|
v3s16 m_camera_offset;
|
||||||
bool m_update_shadows = false;
|
|
||||||
u64 m_frame_time = 0;
|
u64 m_frame_time = 0;
|
||||||
u64 m_frame_dtime = 0;
|
u64 m_frame_dtime = 0;
|
||||||
u64 m_frame_time_pause_accumulator = 0;
|
u64 m_frame_time_pause_accumulator = 0;
|
||||||
|
@ -62,7 +62,6 @@ class ClientActiveObject : public ActiveObject
|
|||||||
virtual void updateAttachments() {};
|
virtual void updateAttachments() {};
|
||||||
|
|
||||||
virtual bool doShowSelectionBox() { return true; }
|
virtual bool doShowSelectionBox() { return true; }
|
||||||
virtual void updateSceneShadows() {}
|
|
||||||
|
|
||||||
// Step object in time
|
// Step object in time
|
||||||
virtual void step(float dtime, ClientEnvironment *env) {}
|
virtual void step(float dtime, ClientEnvironment *env) {}
|
||||||
|
@ -604,17 +604,6 @@ void GenericCAO::removeFromScene(bool permanent)
|
|||||||
m_client->getMinimap()->removeMarker(&m_marker);
|
m_client->getMinimap()->removeMarker(&m_marker);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericCAO::updateSceneShadows()
|
|
||||||
{
|
|
||||||
if (scene::ISceneNode *node = getSceneNode()) {
|
|
||||||
if (m_matrixnode)
|
|
||||||
node->setParent(m_matrixnode);
|
|
||||||
|
|
||||||
if (auto shadow = RenderingEngine::get_shadow_renderer())
|
|
||||||
shadow->addNodeToShadowList(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
|
void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
|
||||||
{
|
{
|
||||||
m_smgr = smgr;
|
m_smgr = smgr;
|
||||||
@ -844,8 +833,6 @@ void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
|
|||||||
if (m_reset_textures_timer < 0)
|
if (m_reset_textures_timer < 0)
|
||||||
updateTextures(m_current_texture_modifier);
|
updateTextures(m_current_texture_modifier);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (scene::ISceneNode *node = getSceneNode()) {
|
if (scene::ISceneNode *node = getSceneNode()) {
|
||||||
if (m_matrixnode)
|
if (m_matrixnode)
|
||||||
node->setParent(m_matrixnode);
|
node->setParent(m_matrixnode);
|
||||||
|
@ -249,7 +249,6 @@ class GenericCAO : public ClientActiveObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateLight(u32 day_night_ratio) override;
|
void updateLight(u32 day_night_ratio) override;
|
||||||
void updateSceneShadows() override;
|
|
||||||
|
|
||||||
void setNodeLight(const video::SColor &light);
|
void setNodeLight(const video::SColor &light);
|
||||||
|
|
||||||
|
@ -739,7 +739,6 @@ class Game {
|
|||||||
void updateCameraOrientation(CameraOrientation *cam, float dtime);
|
void updateCameraOrientation(CameraOrientation *cam, float dtime);
|
||||||
void updatePlayerControl(const CameraOrientation &cam);
|
void updatePlayerControl(const CameraOrientation &cam);
|
||||||
void updatePauseState();
|
void updatePauseState();
|
||||||
void reloadGraphics();
|
|
||||||
void step(f32 dtime);
|
void step(f32 dtime);
|
||||||
void processClientEvents(CameraOrientation *cam);
|
void processClientEvents(CameraOrientation *cam);
|
||||||
void updateCamera(f32 dtime);
|
void updateCamera(f32 dtime);
|
||||||
@ -1127,12 +1126,6 @@ bool Game::startup(bool *kill,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Game::reloadGraphics()
|
|
||||||
{
|
|
||||||
m_rendering_engine->initialize(client, hud);
|
|
||||||
client->getEnv().requestUpdateShadows();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Game::run()
|
void Game::run()
|
||||||
{
|
{
|
||||||
@ -1809,8 +1802,6 @@ bool Game::getServerContent(bool *aborted)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Run
|
Run
|
||||||
@ -1874,15 +1865,9 @@ inline bool Game::handleCallbacks()
|
|||||||
|
|
||||||
if (g_gamecallback->unpause_requested) {
|
if (g_gamecallback->unpause_requested) {
|
||||||
m_is_paused = false;
|
m_is_paused = false;
|
||||||
m_rendering_engine->initialize(client, hud);
|
|
||||||
g_gamecallback->unpause_requested = false;
|
g_gamecallback->unpause_requested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_gamecallback->reload_graphics_requested) {
|
|
||||||
reloadGraphics();
|
|
||||||
g_gamecallback->reload_graphics_requested = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_gamecallback->show_settings_requested) {
|
if (g_gamecallback->show_settings_requested) {
|
||||||
if (client->modsLoaded())
|
if (client->modsLoaded())
|
||||||
{
|
{
|
||||||
@ -1926,9 +1911,7 @@ void Game::updateDebugState()
|
|||||||
m_game_ui->m_flags.show_basic_debug = false;
|
m_game_ui->m_flags.show_basic_debug = false;
|
||||||
} else if (m_game_ui->m_flags.show_minimal_debug) {
|
} else if (m_game_ui->m_flags.show_minimal_debug) {
|
||||||
if (has_basic_debug)
|
if (has_basic_debug)
|
||||||
{
|
|
||||||
m_game_ui->m_flags.show_basic_debug = true;
|
m_game_ui->m_flags.show_basic_debug = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!has_basic_debug)
|
if (!has_basic_debug)
|
||||||
hud->disableBlockBounds();
|
hud->disableBlockBounds();
|
||||||
@ -2540,7 +2523,6 @@ void Game::toggleDebug()
|
|||||||
} else if (!m_game_ui->m_flags.show_profiler_graph && !draw_control->show_wireframe) {
|
} else if (!m_game_ui->m_flags.show_profiler_graph && !draw_control->show_wireframe) {
|
||||||
if (has_basic_debug)
|
if (has_basic_debug)
|
||||||
m_game_ui->m_flags.show_basic_debug = true;
|
m_game_ui->m_flags.show_basic_debug = true;
|
||||||
reloadGraphics();
|
|
||||||
m_game_ui->m_flags.show_profiler_graph = true;
|
m_game_ui->m_flags.show_profiler_graph = true;
|
||||||
m_game_ui->showTranslatedStatusText("Profiler graph shown");
|
m_game_ui->showTranslatedStatusText("Profiler graph shown");
|
||||||
} else if (!draw_control->show_wireframe && client->checkPrivilege("debug")) {
|
} else if (!draw_control->show_wireframe && client->checkPrivilege("debug")) {
|
||||||
|
@ -82,4 +82,4 @@ void createPipeline(const std::string &stereo_mode, IrrlichtDevice *device, Clie
|
|||||||
// fallback to plain renderer
|
// fallback to plain renderer
|
||||||
errorstream << "Invalid rendering mode: " << stereo_mode << std::endl;
|
errorstream << "Invalid rendering mode: " << stereo_mode << std::endl;
|
||||||
populatePlainPipeline(result.pipeline, client);
|
populatePlainPipeline(result.pipeline, client);
|
||||||
}
|
}
|
@ -35,7 +35,6 @@ class IGameCallback
|
|||||||
virtual void changePassword() = 0;
|
virtual void changePassword() = 0;
|
||||||
virtual void changeVolume() = 0;
|
virtual void changeVolume() = 0;
|
||||||
virtual void unpause() = 0;
|
virtual void unpause() = 0;
|
||||||
virtual void reloadGraphics() = 0;
|
|
||||||
virtual void showSettings() = 0;
|
virtual void showSettings() = 0;
|
||||||
virtual void showOpenURLDialog(const std::string &url) = 0;
|
virtual void showOpenURLDialog(const std::string &url) = 0;
|
||||||
virtual void signalKeyConfigChange() = 0;
|
virtual void signalKeyConfigChange() = 0;
|
||||||
@ -155,11 +154,6 @@ class MainGameCallback : public IGameCallback
|
|||||||
unpause_requested = true;
|
unpause_requested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reloadGraphics() override
|
|
||||||
{
|
|
||||||
reload_graphics_requested = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void showSettings() override
|
void showSettings() override
|
||||||
{
|
{
|
||||||
show_settings_requested = true;
|
show_settings_requested = true;
|
||||||
@ -171,7 +165,6 @@ class MainGameCallback : public IGameCallback
|
|||||||
bool keyconfig_requested = false;
|
bool keyconfig_requested = false;
|
||||||
bool shutdown_requested = false;
|
bool shutdown_requested = false;
|
||||||
bool unpause_requested = false;
|
bool unpause_requested = false;
|
||||||
bool reload_graphics_requested = false;
|
|
||||||
bool show_settings_requested = false;
|
bool show_settings_requested = false;
|
||||||
bool keyconfig_changed = false;
|
bool keyconfig_changed = false;
|
||||||
std::string show_open_url_dialog = "";
|
std::string show_open_url_dialog = "";
|
||||||
|
@ -196,12 +196,6 @@ int ModApiClient::l_exit_to_os(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModApiClient::l_reload_graphics(lua_State *L)
|
|
||||||
{
|
|
||||||
g_gamecallback->reloadGraphics();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ModApiClient::l_key_config(lua_State *L)
|
int ModApiClient::l_key_config(lua_State *L)
|
||||||
{
|
{
|
||||||
g_gamecallback->keyConfig();
|
g_gamecallback->keyConfig();
|
||||||
@ -398,7 +392,6 @@ void ModApiClient::Initialize(lua_State *L, int top)
|
|||||||
API_FCT(disconnect);
|
API_FCT(disconnect);
|
||||||
API_FCT(unpause);
|
API_FCT(unpause);
|
||||||
API_FCT(exit_to_os);
|
API_FCT(exit_to_os);
|
||||||
API_FCT(reload_graphics);
|
|
||||||
API_FCT(key_config);
|
API_FCT(key_config);
|
||||||
API_FCT(get_meta);
|
API_FCT(get_meta);
|
||||||
API_FCT(get_server_info);
|
API_FCT(get_server_info);
|
||||||
|
@ -57,9 +57,6 @@ class ModApiClient : public ModApiBase
|
|||||||
// exit_to_os()
|
// exit_to_os()
|
||||||
static int l_exit_to_os(lua_State *L);
|
static int l_exit_to_os(lua_State *L);
|
||||||
|
|
||||||
// reload_graphics()
|
|
||||||
static int l_reload_graphics(lua_State *L);
|
|
||||||
|
|
||||||
// key_config()
|
// key_config()
|
||||||
static int l_key_config(lua_State *L);
|
static int l_key_config(lua_State *L);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user