@@ -933,12 +933,12 @@ bool nodePlacementPrediction(Client &client,
933
933
static inline void create_formspec_menu (GUIFormSpecMenu** cur_formspec,
934
934
InventoryManager *invmgr, IGameDef *gamedef,
935
935
IWritableTextureSource* tsrc, IrrlichtDevice * device,
936
- IFormSource* fs_src, TextDest* txt_dest
936
+ IFormSource* fs_src, TextDest* txt_dest, Client* client
937
937
) {
938
938
939
939
if (*cur_formspec == 0 ) {
940
940
*cur_formspec = new GUIFormSpecMenu (device, guiroot, -1 , &g_menumgr,
941
- invmgr, gamedef, tsrc, fs_src, txt_dest, cur_formspec );
941
+ invmgr, gamedef, tsrc, fs_src, txt_dest, cur_formspec, client );
942
942
(*cur_formspec)->doPause = false ;
943
943
(*cur_formspec)->drop ();
944
944
}
@@ -972,7 +972,7 @@ static void show_chat_menu(GUIFormSpecMenu** cur_formspec,
972
972
FormspecFormSource* fs_src = new FormspecFormSource (formspec);
973
973
LocalFormspecHandler* txt_dst = new LocalFormspecHandler (" MT_CHAT_MENU" , client);
974
974
975
- create_formspec_menu (cur_formspec, invmgr, gamedef, tsrc, device, fs_src, txt_dst);
975
+ create_formspec_menu (cur_formspec, invmgr, gamedef, tsrc, device, fs_src, txt_dst, NULL );
976
976
}
977
977
978
978
static void show_deathscreen (GUIFormSpecMenu** cur_formspec,
@@ -993,7 +993,7 @@ static void show_deathscreen(GUIFormSpecMenu** cur_formspec,
993
993
FormspecFormSource* fs_src = new FormspecFormSource (formspec);
994
994
LocalFormspecHandler* txt_dst = new LocalFormspecHandler (" MT_DEATH_SCREEN" , client);
995
995
996
- create_formspec_menu (cur_formspec, invmgr, gamedef, tsrc, device, fs_src, txt_dst);
996
+ create_formspec_menu (cur_formspec, invmgr, gamedef, tsrc, device, fs_src, txt_dst, NULL );
997
997
}
998
998
999
999
/* *****************************************************************************/
@@ -1060,7 +1060,7 @@ static void show_pause_menu(GUIFormSpecMenu** cur_formspec,
1060
1060
FormspecFormSource* fs_src = new FormspecFormSource (os.str ());
1061
1061
LocalFormspecHandler* txt_dst = new LocalFormspecHandler (" MT_PAUSE_MENU" );
1062
1062
1063
- create_formspec_menu (cur_formspec, invmgr, gamedef, tsrc, device, fs_src, txt_dst);
1063
+ create_formspec_menu (cur_formspec, invmgr, gamedef, tsrc, device, fs_src, txt_dst, NULL );
1064
1064
1065
1065
(*cur_formspec)->doPause = true ;
1066
1066
}
@@ -1966,7 +1966,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
1966
1966
PlayerInventoryFormSource* fs_src = new PlayerInventoryFormSource (&client);
1967
1967
TextDest* txt_dst = new TextDestPlayerInventory (&client);
1968
1968
1969
- create_formspec_menu (¤t_formspec, &client, gamedef, tsrc, device, fs_src, txt_dst);
1969
+ create_formspec_menu (¤t_formspec, &client, gamedef, tsrc, device, fs_src, txt_dst, &client );
1970
1970
1971
1971
InventoryLocation inventoryloc;
1972
1972
inventoryloc.setCurrentPlayer ();
@@ -2070,30 +2070,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
2070
2070
}
2071
2071
else if (input->wasKeyDown (getKeySetting (" keymap_screenshot" )))
2072
2072
{
2073
- irr::video::IImage* const raw_image = driver->createScreenShot ();
2074
- if (raw_image) {
2075
- irr::video::IImage* const image = driver->createImage (video::ECF_R8G8B8,
2076
- raw_image->getDimension ());
2077
-
2078
- if (image) {
2079
- raw_image->copyTo (image);
2080
- irr::c8 filename[256 ];
2081
- snprintf (filename, sizeof (filename), " %s" DIR_DELIM " screenshot_%u.png" ,
2082
- g_settings->get (" screenshot_path" ).c_str (),
2083
- device->getTimer ()->getRealTime ());
2084
- if (driver->writeImageToFile (image, filename)) {
2085
- std::wstringstream sstr;
2086
- sstr << " Saved screenshot to '" << filename << " '" ;
2087
- infostream << " Saved screenshot to '" << filename << " '" << std::endl;
2088
- statustext = sstr.str ();
2089
- statustext_time = 0 ;
2090
- } else {
2091
- infostream << " Failed to save screenshot '" << filename << " '" << std::endl;
2092
- }
2093
- image->drop ();
2094
- }
2095
- raw_image->drop ();
2096
- }
2073
+ client.makeScreenshot (device);
2097
2074
}
2098
2075
else if (input->wasKeyDown (getKeySetting (" keymap_toggle_hud" )))
2099
2076
{
@@ -2483,7 +2460,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
2483
2460
new TextDestPlayerInventory (&client,*(event.show_formspec .formname ));
2484
2461
2485
2462
create_formspec_menu (¤t_formspec, &client, gamedef,
2486
- tsrc, device, fs_src, txt_dst);
2463
+ tsrc, device, fs_src, txt_dst, &client );
2487
2464
2488
2465
delete (event.show_formspec .formspec );
2489
2466
delete (event.show_formspec .formname );
@@ -3033,7 +3010,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
3033
3010
TextDest* txt_dst = new TextDestNodeMetadata (nodepos, &client);
3034
3011
3035
3012
create_formspec_menu (¤t_formspec, &client, gamedef,
3036
- tsrc, device, fs_src, txt_dst);
3013
+ tsrc, device, fs_src, txt_dst, &client );
3037
3014
3038
3015
current_formspec->setFormSpec (meta->getString (" formspec" ), inventoryloc);
3039
3016
}
0 commit comments