diff --git a/mainwindow.cpp b/mainwindow.cpp index cb9d19b..e1afe8c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -10,8 +10,8 @@ #include #include #ifdef _WIN32 +#define NOMINMAX //Windows API breaks STL, shit. #include -#undef min //Windows API breaks STL, shit. #endif MainWindow::MainWindow(QWidget *parent) : diff --git a/songlist.cpp b/songlist.cpp index 357f778..0f60351 100644 --- a/songlist.cpp +++ b/songlist.cpp @@ -36,7 +36,6 @@ bool SongList::LoadFile(thDatWrapper *datw, bool ignoreAnUint) QBuffer *buf=new QBuffer(arr,nullptr); buf->open(QIODevice::ReadOnly); LoadFile(buf,ignoreAnUint); - //TODO: load musiccmt.txt delete buf; delete arr; LoadComment(datw); diff --git a/thdatwrapper.cpp b/thdatwrapper.cpp index f606d41..c47b9e8 100644 --- a/thdatwrapper.cpp +++ b/thdatwrapper.cpp @@ -8,6 +8,12 @@ thDatWrapper::thDatWrapper(const char *datpath,unsigned ver) datf=thtk_io_open_file(datpath,"rb",&e); thtk_error_free(&e); dat=thdat_open(ver,datf,&e); + if(!dat) + //just try the latest supported version instead + { + thtk_error_free(&e); + dat=thdat_open(16,datf,&e); + } thtk_error_free(&e); } ssize_t thDatWrapper::getFileSize(const char *path)