Commit 071377b3 authored by salix5's avatar salix5

expansions

parent f98d197e
...@@ -23,11 +23,6 @@ namespace ygo { ...@@ -23,11 +23,6 @@ namespace ygo {
Game* mainGame; Game* mainGame;
bool Game::Initialize() { bool Game::Initialize() {
#ifdef _WIN32
_finddata_t fdata;
long fhandle;
char fpath[1000] = "./expansions/";
#endif
srand(time(0)); srand(time(0));
LoadConfig(); LoadConfig();
irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters(); irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters();
...@@ -64,16 +59,17 @@ bool Game::Initialize() { ...@@ -64,16 +59,17 @@ bool Game::Initialize() {
if(!dataManager.LoadStrings("strings.conf")) if(!dataManager.LoadStrings("strings.conf"))
return false; return false;
#ifdef _WIN32 #ifdef _WIN32
fhandle = _findfirst("./expansions/*.cdb", &fdata); char fpath[1000];
if(fhandle != -1) { WIN32_FIND_DATAW fdataw;
strcat(fpath, fdata.name); HANDLE fh = FindFirstFileW(L"./expansions/*.cdb", &fdataw);
dataManager.LoadDB(fpath); if(fh != INVALID_HANDLE_VALUE) {
while(_findnext(fhandle, &fdata) != -1) { do {
strcpy(fpath, "./expansions/"); if(!(fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
strcat(fpath, fdata.name); sprintf(fpath, "./expansions/%ls", fdataw.cFileName);
dataManager.LoadDB(fpath); dataManager.LoadDB(fpath);
} }
_findclose(fhandle); } while(FindNextFileW(fh, &fdataw));
FindClose(fh);
} }
#else #else
DIR * dir; DIR * dir;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment