dolphin/Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.cpp
rice1964 d616f132d7 Debugger for DX9 plugin.
Debugger panel is displayed only if Dolphin is started with /d option.
Dump features are not implemented.
Pause/Resume buttons works, only if the plugin is built in DEBUG or DEBUGFAST configuration, not in RELEASE. These features are really only for devs, not for regular gamers.

You will be able to pause frame by frame, or by n frames, or by n primitive flushes. Other pausing options are not implemented yet.

When other pausing and dumping features are implemented, debugging will be much easier.

I have changed the DX9 project setting to use unicode character set in order to use wxWidge tools. If this causes Dolphin building problems for you, check your project setting.txt




git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4154 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-09-02 06:33:41 +00:00

114 lines
3.0 KiB
C++

#include <shlobj.h>
#include <xstring>
#include <string>
#include "ShellUtil.h"
namespace W32Util
{
std::string BrowseForFolder(HWND parent, char *title)
{
BROWSEINFOA info;
memset(&info,0,sizeof(info));
info.hwndOwner = parent;
info.lpszTitle = title;
info.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS;
//info.pszDisplayName
LPCITEMIDLIST idList = SHBrowseForFolderA(&info);
char temp[MAX_PATH];
SHGetPathFromIDListA(idList, temp);
if (strlen(temp))
{
return temp;
}
else
return "";
}
//---------------------------------------------------------------------------------------------------
// function WinBrowseForFileName
//---------------------------------------------------------------------------------------------------
bool BrowseForFileName (bool _bLoad, HWND _hParent, const char *_pTitle,
const char *_pInitialFolder, const char *_pFilter, const char *_pExtension,
std::string& _strFileName)
{
char szFile [MAX_PATH+1] = {0};
char szFileTitle [MAX_PATH+1] = {0};
OPENFILENAMEA ofn;
ZeroMemory (&ofn,sizeof (ofn));
ofn.lStructSize = sizeof (OPENFILENAME);
ofn.lpstrInitialDir = _pInitialFolder;
ofn.lpstrFilter = _pFilter;
ofn.nMaxFile = sizeof (szFile);
ofn.lpstrFile = szFile;
ofn.lpstrFileTitle = szFileTitle;
ofn.nMaxFileTitle = sizeof (szFileTitle);
ofn.lpstrDefExt = _pExtension;
ofn.hwndOwner = _hParent;
ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_HIDEREADONLY;
if (_strFileName.size () != 0)
ofn.lpstrFile = (char *)_strFileName.c_str();
if (((_bLoad) ? GetOpenFileNameA(&ofn) : GetSaveFileNameA(&ofn)))
{
_strFileName = ofn.lpstrFile;
return true;
}
return false;
}
std::vector<std::string> BrowseForFileNameMultiSelect(bool _bLoad, HWND _hParent, const char *_pTitle,
const char *_pInitialFolder,const char *_pFilter,const char *_pExtension)
{
char szFile [MAX_PATH+1+2048*2];
char szFileTitle [MAX_PATH+1];
strcpy (szFile,"");
strcpy (szFileTitle,"");
OPENFILENAMEA ofn;
ZeroMemory (&ofn,sizeof (ofn));
ofn.lStructSize = sizeof (OPENFILENAME);
ofn.lpstrInitialDir = _pInitialFolder;
ofn.lpstrFilter = _pFilter;
ofn.nMaxFile = sizeof (szFile);
ofn.lpstrFile = szFile;
ofn.lpstrFileTitle = szFileTitle;
ofn.nMaxFileTitle = sizeof (szFileTitle);
ofn.lpstrDefExt = _pExtension;
ofn.hwndOwner = _hParent;
ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT ;
std::vector<std::string> files;
if (((_bLoad)?GetOpenFileNameA (&ofn):GetSaveFileNameA (&ofn)))
{
std::string directory = ofn.lpstrFile;
char *temp = ofn.lpstrFile;
char *oldtemp = temp;
temp+=strlen(temp)+1;
if (*temp==0)
{
//we only got one file
files.push_back(std::string(oldtemp));
}
else
{
while (*temp)
{
files.push_back(directory+"\\"+std::string(temp));
temp+=strlen(temp)+1;
}
}
return files;
}
return std::vector<std::string>(); // empty vector;
}
} // namespace