Skip to content

Commit 8f2e60a

Browse files
committedJun 18, 2017
Client::makeScreenshot: remove device param
We already have the device param as class member
1 parent 4faaadc commit 8f2e60a

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed
 

‎src/client.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1740,9 +1740,9 @@ float Client::getCurRate()
17401740
m_con.getLocalStat(con::CUR_DL_RATE));
17411741
}
17421742

1743-
void Client::makeScreenshot(IrrlichtDevice *device)
1743+
void Client::makeScreenshot()
17441744
{
1745-
irr::video::IVideoDriver *driver = device->getVideoDriver();
1745+
irr::video::IVideoDriver *driver = m_device->getVideoDriver();
17461746
irr::video::IImage* const raw_image = driver->createScreenShot();
17471747

17481748
if (!raw_image)

‎src/client.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
507507

508508
LocalClientState getState() { return m_state; }
509509

510-
void makeScreenshot(IrrlichtDevice *device);
510+
void makeScreenshot();
511511

512512
inline void pushToChatQueue(const std::wstring &input)
513513
{
@@ -529,8 +529,6 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
529529
void showGameFog(const bool show = true);
530530
void showGameDebug(const bool show = true);
531531

532-
IrrlichtDevice *getDevice() const { return m_device; }
533-
534532
const Address getServerAddress()
535533
{
536534
return m_con.GetPeerAddress(PEER_ID_SERVER);

‎src/game.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2524,7 +2524,7 @@ void Game::processKeyInput()
25242524
} else if (wasKeyDown(KeyType::CINEMATIC)) {
25252525
toggleCinematic();
25262526
} else if (wasKeyDown(KeyType::SCREENSHOT)) {
2527-
client->makeScreenshot(device);
2527+
client->makeScreenshot();
25282528
} else if (wasKeyDown(KeyType::TOGGLE_HUD)) {
25292529
toggleHud();
25302530
} else if (wasKeyDown(KeyType::MINIMAP)) {

‎src/guiFormSpecMenu.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3282,7 +3282,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
32823282
return true;
32833283
} else if (m_client != NULL && event.KeyInput.PressedDown &&
32843284
(kp == getKeySetting("keymap_screenshot"))) {
3285-
m_client->makeScreenshot(m_device);
3285+
m_client->makeScreenshot();
32863286
}
32873287
if (event.KeyInput.PressedDown &&
32883288
(event.KeyInput.Key==KEY_RETURN ||

‎src/script/lua_api/l_client.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ int ModApiClient::l_get_node_def(lua_State *L)
327327
int ModApiClient::l_take_screenshot(lua_State *L)
328328
{
329329
Client *client = getClient(L);
330-
client->makeScreenshot(client->getDevice());
330+
client->makeScreenshot();
331331
return 0;
332332
}
333333

0 commit comments

Comments
 (0)