Change screenshot colorformat properly

master
BlockMen 2014-09-03 19:20:06 +02:00
parent b2102bfe49
commit 8948907431
1 changed files with 20 additions and 13 deletions

View File

@ -2068,10 +2068,15 @@ 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);
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, 256, "%s" DIR_DELIM "screenshot_%u.png",
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)) {
@ -2085,6 +2090,8 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
}
image->drop();
}
raw_image->drop();
}
}
else if(input->wasKeyDown(getKeySetting("keymap_toggle_hud")))
{