fix improper dir sep when loading sample on Win

This commit is contained in:
tildearrow 2022-02-01 03:20:15 -05:00
parent f75803c3b2
commit df97142157
2 changed files with 7 additions and 1 deletions

View file

@ -4833,7 +4833,7 @@ bool DivEngine::addSampleFromFile(const char* path) {
sf_close(f); sf_close(f);
DivSample* sample=new DivSample; DivSample* sample=new DivSample;
int sampleCount=(int)song.sample.size(); int sampleCount=(int)song.sample.size();
const char* sName=strrchr(path,'/'); const char* sName=strrchr(path,DIR_SEPARATOR);
if (sName==NULL) { if (sName==NULL) {
sName=path; sName=path;
} else { } else {

View file

@ -9,6 +9,12 @@
typedef SSIZE_T ssize_t; typedef SSIZE_T ssize_t;
#endif #endif
#ifdef _WIN32
#define DIR_SEPARATOR '\\'
#else
#define DIR_SEPARATOR '/'
#endif
typedef std::string String; typedef std::string String;
#define MIN(a,b) (((a)<(b))?(a):(b)) #define MIN(a,b) (((a)<(b))?(a):(b))