improvements for compressing and decompressing
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@574 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
8ce6b5aceb
commit
0ba37abfdb
|
@ -309,7 +309,6 @@ bool DecompressBlobToFile(const char* infile, const char* outfile, CompressCB ca
|
||||||
fwrite(buffer, header.block_size, 1, f);
|
fwrite(buffer, header.block_size, 1, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete reader;
|
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -320,6 +319,9 @@ bool DecompressBlobToFile(const char* infile, const char* outfile, CompressCB ca
|
||||||
ftruncate(fileno(f), header.data_size);
|
ftruncate(fileno(f), header.data_size);
|
||||||
#endif
|
#endif
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
delete reader;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -548,14 +548,17 @@ void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event)) {
|
||||||
|
|
||||||
wxString path;
|
wxString path;
|
||||||
|
|
||||||
|
std::string FileName;
|
||||||
|
SplitPath(iso->GetFileName(), NULL, &FileName, NULL);
|
||||||
|
|
||||||
if (iso->IsCompressed())
|
if (iso->IsCompressed())
|
||||||
{
|
{
|
||||||
path = wxFileSelector(
|
path = wxFileSelector(
|
||||||
_T("Save decompressed ISO"),
|
_T("Save decompressed ISO"),
|
||||||
wxEmptyString, wxEmptyString, wxEmptyString,
|
wxEmptyString, FileName.c_str(), wxEmptyString,
|
||||||
wxString::Format
|
wxString::Format
|
||||||
(
|
(
|
||||||
_T("All GC/Wii ISO files (gcz)|*.gcz|All files (%s)|%s"),
|
_T("All GC/Wii ISO files (gcm)|*.gcm|All files (%s)|%s"),
|
||||||
wxFileSelectorDefaultWildcardStr,
|
wxFileSelectorDefaultWildcardStr,
|
||||||
wxFileSelectorDefaultWildcardStr
|
wxFileSelectorDefaultWildcardStr
|
||||||
),
|
),
|
||||||
|
@ -571,7 +574,7 @@ void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event)) {
|
||||||
{
|
{
|
||||||
path = wxFileSelector(
|
path = wxFileSelector(
|
||||||
_T("Save compressed ISO"),
|
_T("Save compressed ISO"),
|
||||||
wxEmptyString, wxEmptyString, wxEmptyString,
|
wxEmptyString, FileName.c_str(), wxEmptyString,
|
||||||
wxString::Format
|
wxString::Format
|
||||||
(
|
(
|
||||||
_T("All compressed GC/Wii ISO files (gcz)|*.gcz|All files (%s)|%s"),
|
_T("All compressed GC/Wii ISO files (gcz)|*.gcz|All files (%s)|%s"),
|
||||||
|
|
Loading…
Reference in New Issue