--------------------------------------------- CAPTURE SCREEN -----------------------------------------------
| 295 | } |
| 296 | //--------------------------------------------- CAPTURE SCREEN ----------------------------------------------- |
| 297 | BOOL STORMAPI _SDrawCaptureScreen(const char *pszOutput) |
| 298 | { |
| 299 | if ( !pszOutput ) |
| 300 | return FALSE; |
| 301 | |
| 302 | Util::Path newScreenFilename(pszOutput); |
| 303 | |
| 304 | if ( !screenshotFmt.empty() ) // If an extension replacement was specified |
| 305 | newScreenFilename.replace_extension(screenshotFmt); |
| 306 | |
| 307 | // Save the screenshot in w-mode |
| 308 | if ( wmode && pBits && isCorrectVersion ) |
| 309 | { |
| 310 | // Create compatible palette |
| 311 | PALETTEENTRY pal[256]; |
| 312 | for ( int i = 0; i < 256; ++i ) |
| 313 | { |
| 314 | pal[i].peRed = wmodebmp.bmiColors[i].rgbRed; |
| 315 | pal[i].peGreen = wmodebmp.bmiColors[i].rgbGreen; |
| 316 | pal[i].peBlue = wmodebmp.bmiColors[i].rgbBlue; |
| 317 | pal[i].peFlags = 0; |
| 318 | } |
| 319 | return SBmpSaveImage(newScreenFilename.string().c_str(), pal, pBits, BW::BWDATA::GameScreenBuffer.width(), BW::BWDATA::GameScreenBuffer.height()); |
| 320 | } |
| 321 | // Call the old fxn |
| 322 | auto SDrawCaptureScreenProc = _SDrawCaptureScreenOld ? _SDrawCaptureScreenOld : &SDrawCaptureScreen; |
| 323 | return SDrawCaptureScreenProc(newScreenFilename.string().c_str()); |
| 324 | } |
| 325 | |
| 326 | //----------------------------------------------- ON GAME END ------------------------------------------------ |
| 327 | BOOL __stdcall _SNetLeaveGame(int type) |