X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fgame.cpp;h=bae946f28eaa70a3751901b5e25dd18bc5fc5fb2;hb=58e6d25e033c76dc91aaac18fdeda92ac23fe0e1;hp=6ac320af86da2e08490812e75dc92aedc1d92d8b;hpb=b2102bfe49002f1ac10ca8288f5337e9feec7f65;p=oweals%2Fminetest.git diff --git a/src/game.cpp b/src/game.cpp index 6ac320af8..bae946f28 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -407,14 +407,16 @@ PointedThing getPointedThing(Client *client, v3f player_position, mindistance = distance; hilightboxes.clear(); - for(std::vector::const_iterator - i2 = boxes.begin(); - i2 != boxes.end(); i2++) - { - aabb3f box = *i2; - box.MinEdge += npf + v3f(-d,-d,-d) - intToFloat(camera_offset, BS); - box.MaxEdge += npf + v3f(d,d,d) - intToFloat(camera_offset, BS); - hilightboxes.push_back(box); + if (!g_settings->getBool("enable_node_highlighting")) { + for(std::vector::const_iterator + i2 = boxes.begin(); + i2 != boxes.end(); i2++) + { + aabb3f box = *i2; + box.MinEdge += npf + v3f(-d,-d,-d) - intToFloat(camera_offset, BS); + box.MaxEdge += npf + v3f(d,d,d) - intToFloat(camera_offset, BS); + hilightboxes.push_back(box); + } } } } @@ -2068,31 +2070,41 @@ void the_game(bool &kill, bool random_input, InputHandler *input, } else if(input->wasKeyDown(getKeySetting("keymap_screenshot"))) { - irr::video::IImage* const image = driver->createScreenShot(video::ECF_R8G8B8); - if (image) { - irr::c8 filename[256]; - snprintf(filename, 256, "%s" DIR_DELIM "screenshot_%u.png", + irr::video::IImage* const raw_image = driver->createScreenShot(); + if (raw_image) { + irr::video::IImage* const image = driver->createImage(video::ECF_R8G8B8, + raw_image->getDimension()); + + if (image) { + raw_image->copyTo(image); + irr::c8 filename[256]; + snprintf(filename, sizeof(filename), "%s" DIR_DELIM "screenshot_%u.png", g_settings->get("screenshot_path").c_str(), device->getTimer()->getRealTime()); - if (driver->writeImageToFile(image, filename)) { - std::wstringstream sstr; - sstr<<"Saved screenshot to '"<writeImageToFile(image, filename)) { + std::wstringstream sstr; + sstr << "Saved screenshot to '" << filename << "'"; + infostream << "Saved screenshot to '" << filename << "'" << std::endl; + statustext = sstr.str(); + statustext_time = 0; + } else { + infostream << "Failed to save screenshot '" << filename << "'" << std::endl; + } + image->drop(); } - image->drop(); + raw_image->drop(); } } else if(input->wasKeyDown(getKeySetting("keymap_toggle_hud"))) { show_hud = !show_hud; - if(show_hud) + if(show_hud) { statustext = L"HUD shown"; - else + client.setHighlighted(client.getHighlighted(), true); + } else { statustext = L"HUD hidden"; + client.setHighlighted(client.getHighlighted(), false); + } statustext_time = 0; } else if(input->wasKeyDown(getKeySetting("keymap_toggle_chat"))) @@ -2789,7 +2801,8 @@ void the_game(bool &kill, bool random_input, InputHandler *input, if(pointed != pointed_old) { infostream<<"Pointing at "<getBool("enable_node_highlighting")) + client.setHighlighted(pointed.node_undersurface, show_hud); } /*