Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Source/Core/Common/Src/CommonPaths.h
- ===================================================================
- --- Source/Core/Common/Src/CommonPaths.h (revision 2684)
- +++ Source/Core/Common/Src/CommonPaths.h (working copy)
- @@ -69,6 +69,7 @@
- #define SCREENSHOTS_DIR "ScreenShots"
- #define DUMP_DIR "Dump"
- #define DUMP_TEXTURES_DIR "Textures"
- +#define DUMP_FRAMES_DIR "Frames"
- #define LOGS_DIR "Logs"
- #define MAIL_LOGS_DIR "Mail"
- @@ -122,7 +123,8 @@
- #define FULL_CONFIG_DIR FULL_USERDATA_DIR CONFIG_DIR DIR_SEP
- #define FULL_CACHE_DIR FULL_USERDATA_DIR CACHE_DIR DIR_SEP
- #define FULL_STATESAVES_DIR FULL_USERDATA_DIR STATESAVES_DIR DIR_SEP
- -#define FULL_SCREENSHOTS_DIR FULL_USERDATA_DIR SCREENSHOTS_DIR DIR_SEP
- +#define FULL_SCREENSHOTS_DIR FULL_USERDATA_DIR SCREENSHOTS_DIR DIR_SEP
- +#define FULL_FRAMES_DIR FULL_USERDATA_DIR DUMP_DIR DIR_SEP DUMP_FRAMES_DIR
- #define FULL_DUMP_DIR FULL_USERDATA_DIR DUMP_DIR DIR_SEP
- #define FULL_DUMP_TEXTURES_DIR FULL_USERDATA_DIR DUMP_DIR DIR_SEP DUMP_TEXTURES_DIR
- #define FULL_LOGS_DIR FULL_USERDATA_DIR LOGS_DIR DIR_SEP
- Index: Source/Core/Core/Src/CoreRerecording.cpp
- ===================================================================
- --- Source/Core/Core/Src/CoreRerecording.cpp (revision 2684)
- +++ Source/Core/Core/Src/CoreRerecording.cpp (working copy)
- @@ -31,7 +31,6 @@
- #include "Timer.h"
- #include "Common.h"
- -#include "ConsoleWindow.h"
- #include "Console.h"
- #include "Core.h"
- Index: Source/Plugins/Plugin_VideoOGL/Src/Config.cpp
- ===================================================================
- --- Source/Plugins/Plugin_VideoOGL/Src/Config.cpp (revision 2684)
- +++ Source/Plugins/Plugin_VideoOGL/Src/Config.cpp (working copy)
- @@ -60,6 +60,7 @@
- iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
- iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
- iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
- + iniFile.Get("Settings", "DumpFrames", &bDumpFrames, 0);
- iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
- iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
- iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false);
- @@ -105,6 +106,7 @@
- iniFile.Set("Settings", "Show", iCompileDLsLevel);
- iniFile.Set("Settings", "DumpTextures", bDumpTextures);
- iniFile.Set("Settings", "DumpEFBTarget", bDumpEFBTarget);
- + iniFile.Set("Settings", "DumpFrames", bDumpFrames);
- iniFile.Set("Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
- iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors);
- iniFile.Set("Settings", "MSAA", iMultisampleMode);
- Index: Source/Plugins/Plugin_VideoOGL/Src/Config.h
- ===================================================================
- --- Source/Plugins/Plugin_VideoOGL/Src/Config.h (revision 2684)
- +++ Source/Plugins/Plugin_VideoOGL/Src/Config.h (working copy)
- @@ -83,6 +83,7 @@
- // Utility
- bool bDumpTextures;
- bool bDumpEFBTarget;
- + bool bDumpFrames;
- // Hacks
- bool bEFBCopyDisable;
- Index: Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp
- ===================================================================
- --- Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp (revision 2684)
- +++ Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp (working copy)
- @@ -54,6 +54,7 @@
- EVT_CHECKBOX(ID_TEXFMTCENTER, ConfigDialog::AdvancedSettingsChanged)
- EVT_CHECKBOX(ID_DUMPTEXTURES, ConfigDialog::AdvancedSettingsChanged)
- EVT_CHECKBOX(ID_DUMPEFBTARGET, ConfigDialog::AdvancedSettingsChanged)
- + EVT_CHECKBOX(ID_DUMPFRAMES, ConfigDialog::AdvancedSettingsChanged)
- EVT_CHECKBOX(ID_DISABLELIGHTING, ConfigDialog::AdvancedSettingsChanged)
- EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged)
- EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged)
- @@ -334,6 +335,13 @@
- m_DumpTextures->SetValue(g_Config.bDumpTextures);
- m_DumpEFBTarget = new wxCheckBox(m_PageAdvanced, ID_DUMPEFBTARGET, wxT("Dump EFB Target"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
- m_DumpEFBTarget->SetValue(g_Config.bDumpEFBTarget);
- + m_DumpFrames = new wxCheckBox(m_PageAdvanced, ID_DUMPFRAMES, wxT("Dump Rendered Frames"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
- + m_DumpFrames->SetToolTip(wxT(
- + "!!WARNING!! This option dumps raw bitmaps of each frame, and will fill up"
- + " your hard drive very quickly. Only turn this on if you have at least"
- + " several gigabytes of space available if you plan to play with it on for"
- + " more than a couple minutes."));
- + m_DumpFrames->SetValue(g_Config.bDumpFrames);
- // Hacks controls
- m_SafeTextureCache = new wxCheckBox(m_PageAdvanced, ID_SAFETEXTURECACHE, wxT("Use Safe texture cache"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
- @@ -394,6 +402,7 @@
- sUtilities = new wxBoxSizer(wxHORIZONTAL);
- sUtilities->Add(m_DumpTextures, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- sUtilities->Add(m_DumpEFBTarget, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- + sUtilities->Add(m_DumpFrames, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- sbUtilities->Add(sUtilities, 1, wxEXPAND);
- // Sizers
- @@ -525,6 +534,9 @@
- case ID_DUMPEFBTARGET:
- g_Config.bDumpEFBTarget = m_DumpEFBTarget->IsChecked();
- break;
- + case ID_DUMPFRAMES:
- + g_Config.bDumpFrames = m_DumpFrames->IsChecked();
- + break;
- case ID_TEXTUREPATH:
- break;
- case ID_CHECKBOX_DISABLECOPYEFB:
- Index: Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h
- ===================================================================
- --- Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h (revision 2684)
- +++ Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h (working copy)
- @@ -106,6 +106,7 @@
- wxCheckBox *m_DstAlphaPass;
- wxCheckBox *m_DumpTextures;
- wxCheckBox *m_DumpEFBTarget;
- + wxCheckBox *m_DumpFrames;
- wxStaticBox * m_StaticBox_EFB;
- wxCheckBox *m_CheckBox_DisableCopyEFB;
- wxRadioButton *m_Radio_CopyEFBToRAM, *m_Radio_CopyEFBToGL;
- @@ -161,6 +162,7 @@
- ID_DUMPTEXTURES,
- ID_DUMPEFBTARGET,
- + ID_DUMPFRAMES,
- ID_TEXTUREPATH,
- ID_CHECKBOX_DISABLECOPYEFB,
- Index: Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
- ===================================================================
- --- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp (revision 2684)
- +++ Source/Plugins/Plugin_VideoOGL/Src/Render.cpp (working copy)
- @@ -19,6 +19,7 @@
- #include <vector>
- #include <cmath>
- +#include <stdio.h>
- #include "GLUtil.h"
- @@ -71,6 +72,9 @@
- static bool s_bFullscreen = false;
- +static bool s_bLastFrameDumped = false;
- +FILE* f_pFrameDump;
- +
- static int nZBufferRender = 0; // if > 0, then use zbuffer render, and count down.
- // 1 for no MSAA. Use s_MSAASamples > 1 to check for MSAA.
- @@ -1094,7 +1098,44 @@
- s_bScreenshot = false;
- s_criticalScreenshot.Leave();
- }
- +
- + // Frame dumps are handled a little differently
- + if (g_Config.bDumpFrames) {
- + s_criticalScreenshot.Enter();
- + char movie_file_name[255];
- + int w = OpenGL_GetBackbufferWidth();
- + int h = OpenGL_GetBackbufferHeight();
- + u8 *data = (u8 *) malloc(3 * w * h);
- + glPixelStorei(GL_PACK_ALIGNMENT, 1);
- + glReadPixels(0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, data);
- + if (glGetError() == GL_NO_ERROR) {
- + if (!s_bLastFrameDumped) {
- + sprintf(movie_file_name, "%s/framedump.raw", FULL_FRAMES_DIR);
- + f_pFrameDump = fopen(movie_file_name, "wb");
- + if (f_pFrameDump == NULL) {
- + PanicAlert("Error opening framedump.raw for writing.");
- + } else {
- + char msg [255];
- + sprintf(msg, "Dumping Frames to \"%s\" (%dx%d RGB24)", movie_file_name, w, h);
- + OSD::AddMessage(msg, 2000);
- + }
- + }
- + if (f_pFrameDump != NULL) {
- + fwrite(data, w * 3, h, f_pFrameDump);
- + fflush(f_pFrameDump);
- + }
- + s_bLastFrameDumped = true;
- + }
- + free(data);
- + s_criticalScreenshot.Leave();
- + } else {
- + if(s_bLastFrameDumped && f_pFrameDump != NULL) {
- + fclose(f_pFrameDump);
- + }
- + s_bLastFrameDumped = false;
- + }
- +
- // Place messages on the picture, then copy it to the screen
- SwapBuffers();
- s_bNativeResolution = g_Config.bNativeResolution;
- @@ -1329,6 +1370,20 @@
- glReadPixels(0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, data);
- if (glGetError() != GL_NO_ERROR)
- return false;
- + FlipImageData(data, w, h);
- +#if defined(HAVE_WX) && HAVE_WX
- + wxImage a(w, h, data);
- + a.SaveFile(wxString::FromAscii(filename), wxBITMAP_TYPE_BMP);
- + bool result = true;
- +#else
- + bool result = SaveTGA(filename, w, h, data);
- + free(data);
- +#endif
- + return result;
- +}
- +
- +void Renderer::FlipImageData(u8 *data, int w, int h)
- +{
- // Flip image upside down. Damn OpenGL.
- for (int y = 0; y < h / 2; y++)
- {
- @@ -1339,16 +1394,6 @@
- std::swap(data[(y * w + x) * 3 + 2], data[((h - 1 - y) * w + x) * 3 + 2]);
- }
- }
- -
- -#if defined(HAVE_WX) && HAVE_WX
- - wxImage a(w, h, data);
- - a.SaveFile(wxString::FromAscii(filename), wxBITMAP_TYPE_BMP);
- - bool result = true;
- -#else
- - bool result = SaveTGA(filename, w, h, data);
- - free(data);
- -#endif
- - return result;
- }
- //////////////////////////////////////////////////////////////////////////////////////
- Index: Source/Plugins/Plugin_VideoOGL/Src/Render.h
- ===================================================================
- --- Source/Plugins/Plugin_VideoOGL/Src/Render.h (revision 2684)
- +++ Source/Plugins/Plugin_VideoOGL/Src/Render.h (working copy)
- @@ -100,6 +100,7 @@
- static void RenderText(const char* pstr, int left, int top, u32 color);
- static void DrawDebugText();
- static void SetScreenshot(const char *filename);
- + static void FlipImageData(u8 *data, int w, int h);
- static bool SaveRenderTarget(const char *filename, int w, int h);
- // Finish up the current frame, print some stats
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement