Client::makeScreenshot: remove device param

We already have the device param as class member
This commit is contained in:
Loic Blot 2017-06-19 00:00:55 +02:00
parent 4faaadc8d5
commit 8f2e60a961
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987
5 changed files with 6 additions and 8 deletions

View File

@ -1740,9 +1740,9 @@ float Client::getCurRate()
m_con.getLocalStat(con::CUR_DL_RATE)); 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(); irr::video::IImage* const raw_image = driver->createScreenShot();
if (!raw_image) if (!raw_image)

View File

@ -507,7 +507,7 @@ public:
LocalClientState getState() { return m_state; } LocalClientState getState() { return m_state; }
void makeScreenshot(IrrlichtDevice *device); void makeScreenshot();
inline void pushToChatQueue(const std::wstring &input) inline void pushToChatQueue(const std::wstring &input)
{ {
@ -529,8 +529,6 @@ public:
void showGameFog(const bool show = true); void showGameFog(const bool show = true);
void showGameDebug(const bool show = true); void showGameDebug(const bool show = true);
IrrlichtDevice *getDevice() const { return m_device; }
const Address getServerAddress() const Address getServerAddress()
{ {
return m_con.GetPeerAddress(PEER_ID_SERVER); return m_con.GetPeerAddress(PEER_ID_SERVER);

View File

@ -2524,7 +2524,7 @@ void Game::processKeyInput()
} else if (wasKeyDown(KeyType::CINEMATIC)) { } else if (wasKeyDown(KeyType::CINEMATIC)) {
toggleCinematic(); toggleCinematic();
} else if (wasKeyDown(KeyType::SCREENSHOT)) { } else if (wasKeyDown(KeyType::SCREENSHOT)) {
client->makeScreenshot(device); client->makeScreenshot();
} else if (wasKeyDown(KeyType::TOGGLE_HUD)) { } else if (wasKeyDown(KeyType::TOGGLE_HUD)) {
toggleHud(); toggleHud();
} else if (wasKeyDown(KeyType::MINIMAP)) { } else if (wasKeyDown(KeyType::MINIMAP)) {

View File

@ -3282,7 +3282,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
return true; return true;
} else if (m_client != NULL && event.KeyInput.PressedDown && } else if (m_client != NULL && event.KeyInput.PressedDown &&
(kp == getKeySetting("keymap_screenshot"))) { (kp == getKeySetting("keymap_screenshot"))) {
m_client->makeScreenshot(m_device); m_client->makeScreenshot();
} }
if (event.KeyInput.PressedDown && if (event.KeyInput.PressedDown &&
(event.KeyInput.Key==KEY_RETURN || (event.KeyInput.Key==KEY_RETURN ||

View File

@ -327,7 +327,7 @@ int ModApiClient::l_get_node_def(lua_State *L)
int ModApiClient::l_take_screenshot(lua_State *L) int ModApiClient::l_take_screenshot(lua_State *L)
{ {
Client *client = getClient(L); Client *client = getClient(L);
client->makeScreenshot(client->getDevice()); client->makeScreenshot();
return 0; return 0;
} }