Client::makeScreenshot: remove device param
authorLoic Blot <loic.blot@unix-experience.fr>
Sun, 18 Jun 2017 22:00:55 +0000 (00:00 +0200)
committerLoic Blot <loic.blot@unix-experience.fr>
Sun, 18 Jun 2017 22:00:55 +0000 (00:00 +0200)
    We already have the device param as class member

src/client.cpp
src/client.h
src/game.cpp
src/guiFormSpecMenu.cpp
src/script/lua_api/l_client.cpp

index aa6a5d30d1ce64516a3372baa5dfd801f550b6a3..9892e08cd7f9d0310eee0fc103242afb2fe33202 100644 (file)
@@ -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)
index 7bfa26c0d3c635b322644212343108b45f03075e..ab47cfa44b3cf9a048f0fe051b17276485b9c6e1 100644 (file)
@@ -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);
index fc6df462dfeba27dacb983a66f47d4e9d86b2f87..325557723dd44868627fb2fd3337113a0b30a81b 100644 (file)
@@ -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)) {
index c6a917d123f899abd5fc0ff85af70373d2d712ab..d721c917a8d9175eb9795a3403461dae8448b5bb 100644 (file)
@@ -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 ||
index b4dfe91749574131ebba29bee2b6e83cb7f4aee8..84eafd3f084ea9149f9eff77ed54ec8074b8bc2e 100644 (file)
@@ -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;
 }