Skip to content

Commit

Permalink
Client::makeScreenshot: remove device param
Browse files Browse the repository at this point in the history
    We already have the device param as class member
  • Loading branch information
nerzhul committed Jun 18, 2017
1 parent 4faaadc commit 8f2e60a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/client.cpp
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions src/client.h
Expand Up @@ -507,7 +507,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef

LocalClientState getState() { return m_state; }

void makeScreenshot(IrrlichtDevice *device);
void makeScreenshot();

inline void pushToChatQueue(const std::wstring &input)
{
Expand All @@ -529,8 +529,6 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
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);
Expand Down
2 changes: 1 addition & 1 deletion src/game.cpp
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/guiFormSpecMenu.cpp
Expand Up @@ -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 ||
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_client.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8f2e60a

Please sign in to comment.