aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-06-19 00:00:55 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-06-19 00:00:55 +0200
commit8f2e60a9619f3db2dea752626e778f753c0714bc (patch)
tree3b2c3733e60138f615a0a9b30131173c0438a8a4
parent4faaadc8d50d6ab7a19d22bd5a760c4b8321a51f (diff)
downloadminetest-8f2e60a9619f3db2dea752626e778f753c0714bc.tar.gz
minetest-8f2e60a9619f3db2dea752626e778f753c0714bc.tar.bz2
minetest-8f2e60a9619f3db2dea752626e778f753c0714bc.zip
Client::makeScreenshot: remove device param
We already have the device param as class member
-rw-r--r--src/client.cpp4
-rw-r--r--src/client.h4
-rw-r--r--src/game.cpp2
-rw-r--r--src/guiFormSpecMenu.cpp2
-rw-r--r--src/script/lua_api/l_client.cpp2
5 files changed, 6 insertions, 8 deletions
diff --git a/src/client.cpp b/src/client.cpp
index aa6a5d30d..9892e08cd 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1740,9 +1740,9 @@ float Client::getCurRate()
m_con.getLocalStat(con::CUR_DL_RATE));
}
-void Client::makeScreenshot(IrrlichtDevice *device)
+void Client::makeScreenshot()
{
- irr::video::IVideoDriver *driver = device->getVideoDriver();
+ irr::video::IVideoDriver *driver = m_device->getVideoDriver();
irr::video::IImage* const raw_image = driver->createScreenShot();
if (!raw_image)
diff --git a/src/client.h b/src/client.h
index 7bfa26c0d..ab47cfa44 100644
--- a/src/client.h
+++ b/src/client.h
@@ -507,7 +507,7 @@ public:
LocalClientState getState() { return m_state; }
- void makeScreenshot(IrrlichtDevice *device);
+ void makeScreenshot();
inline void pushToChatQueue(const std::wstring &input)
{
@@ -529,8 +529,6 @@ public:
void showGameFog(const bool show = true);
void showGameDebug(const bool show = true);
- IrrlichtDevice *getDevice() const { return m_device; }
-
const Address getServerAddress()
{
return m_con.GetPeerAddress(PEER_ID_SERVER);
diff --git a/src/game.cpp b/src/game.cpp
index fc6df462d..325557723 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2524,7 +2524,7 @@ void Game::processKeyInput()
} else if (wasKeyDown(KeyType::CINEMATIC)) {
toggleCinematic();
} else if (wasKeyDown(KeyType::SCREENSHOT)) {
- client->makeScreenshot(device);
+ client->makeScreenshot();
} else if (wasKeyDown(KeyType::TOGGLE_HUD)) {
toggleHud();
} else if (wasKeyDown(KeyType::MINIMAP)) {
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index c6a917d12..d721c917a 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -3282,7 +3282,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
return true;
} else if (m_client != NULL && event.KeyInput.PressedDown &&
(kp == getKeySetting("keymap_screenshot"))) {
- m_client->makeScreenshot(m_device);
+ m_client->makeScreenshot();
}
if (event.KeyInput.PressedDown &&
(event.KeyInput.Key==KEY_RETURN ||
diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp
index b4dfe9174..84eafd3f0 100644
--- a/src/script/lua_api/l_client.cpp
+++ b/src/script/lua_api/l_client.cpp
@@ -327,7 +327,7 @@ int ModApiClient::l_get_node_def(lua_State *L)
int ModApiClient::l_take_screenshot(lua_State *L)
{
Client *client = getClient(L);
- client->makeScreenshot(client->getDevice());
+ client->makeScreenshot();
return 0;
}