MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / DumpScreenShot

Method DumpScreenShot

Source/SysPSP/Graphics/GraphicsContext.cpp:528–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526//
527//*****************************************************************************
528void IGraphicsContext::DumpScreenShot()
529{
530 IO::Filename dumpdir;
531
532// Do not combine more than one dir for release, since pic will be saved in ms0:/PICTURE/
533#ifndef DAEDALUS_SILENT
534 IO::Path::Combine(dumpdir, g_ROM.settings.GameName.c_str(), gScreenDumpRootPath);
535#else
536 IO::Path::Assign(dumpdir, g_ROM.settings.GameName.c_str());
537#endif
538
539 IO::Filename filepath;
540 Dump_GetDumpDirectory(filepath, dumpdir);
541
542 IO::Filename unique_filename;
543 u32 count = 0;
544 do
545 {
546 IO::Filename test_name;
547
548 sprintf(test_name, gScreenDumpDumpPathFormat, count++);
549 IO::Path::Combine( unique_filename, filepath, test_name );
550
551 } while( IO::File::Exists( unique_filename ) );
552
553 u32 display_width = 0;
554 u32 display_height= 0;
555
556 u32 frame_width = 480;
557 u32 frame_height= 272;
558
559 if ( PSP_TV_CABLE > 0 ) // Tv Out
560 {
561 frame_width = 720;
562 frame_height= 480;
563 }
564
565 ViewportType( &display_width, &display_height );
566
567#ifdef DAEDALUS_ENABLE_ASSERTS
568 DAEDALUS_ASSERT( display_width != 0 && display_height != 0, "Unhandled viewport type" );
569#endif
570 s32 display_x( (frame_width - display_width)/2 );
571 s32 display_y( (frame_height - display_height)/2 );
572
573 SaveScreenshot( unique_filename, display_x, display_y, display_width, display_height );
574}
575
576//*****************************************************************************
577//

Callers 1

RunMethod · 0.45

Calls 5

AssignFunction · 0.85
Dump_GetDumpDirectoryFunction · 0.85
CombineFunction · 0.50
ExistsFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected