mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 01:33:45 +01:00
Add Frame Dumping for Windows
This commit is contained in:
1 parent
2d838f7f33
commit
1fc6191c85
13 files changed
+446
-25
No files matched your search
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "Common/KeyMap.h"
|
||||
|
||||
#include "Core/AVIDump.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/CoreParameter.h"
|
||||
@@ -70,8 +71,11 @@
|
||||
#include "Windows/MainWindow.h"
|
||||
#endif
|
||||
|
||||
AVIDump avi;
|
||||
|
||||
static bool frameStep_;
|
||||
static int lastNumFlips;
|
||||
static bool startDumping;
|
||||
|
||||
static void __EmuScreenVblank()
|
||||
{
|
||||
@@ -81,6 +85,21 @@ static void __EmuScreenVblank()
|
||||
Core_EnableStepping(true);
|
||||
lastNumFlips = gpuStats.numFlips;
|
||||
}
|
||||
|
||||
if (g_Config.bDumpFrames && !startDumping)
|
||||
{
|
||||
avi.Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight);
|
||||
startDumping = true;
|
||||
}
|
||||
if (g_Config.bDumpFrames && startDumping)
|
||||
{
|
||||
avi.AddFrame();
|
||||
}
|
||||
else if (!g_Config.bDumpFrames && startDumping)
|
||||
{
|
||||
avi.Stop();
|
||||
startDumping = false;
|
||||
}
|
||||
}
|
||||
|
||||
EmuScreen::EmuScreen(const std::string &filename)
|
||||
@@ -90,6 +109,7 @@ EmuScreen::EmuScreen(const std::string &filename)
|
||||
__DisplayListenVblank(__EmuScreenVblank);
|
||||
frameStep_ = false;
|
||||
lastNumFlips = gpuStats.numFlips;
|
||||
startDumping = false;
|
||||
}
|
||||
|
||||
void EmuScreen::bootGame(const std::string &filename) {
|
||||
@@ -227,6 +247,11 @@ EmuScreen::~EmuScreen() {
|
||||
// If we were invalid, it would already be shutdown.
|
||||
PSP_Shutdown();
|
||||
}
|
||||
if (g_Config.bDumpFrames && startDumping)
|
||||
{
|
||||
avi.Stop();
|
||||
startDumping = false;
|
||||
}
|
||||
}
|
||||
|
||||
void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
|
||||
Reference in new issue
Block a user