Commit 99754f54 authored by James Johns's avatar James Johns

Remove windows specific code when compiling on other platforms

Code introduced in commit b9b16259
broke compatability with Linux. Moving these changes to #ifdefs keeps
its functionality without breaking portability.
parent d9e1812d
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
#include "duelclient.h" #include "duelclient.h"
#include "netserver.h" #include "netserver.h"
#include "single_mode.h" #include "single_mode.h"
#include <io.h>
#ifndef WIN32 #ifdef _WIN32
#include <io.h>
#else
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#endif #endif
...@@ -22,9 +23,12 @@ namespace ygo { ...@@ -22,9 +23,12 @@ namespace ygo {
Game* mainGame; Game* mainGame;
bool Game::Initialize() { bool Game::Initialize() {
#ifdef _WIN32
_finddata_t fdata; _finddata_t fdata;
long fhandle; long fhandle;
char fpath[1000] = "./expansions/"; char fpath[1000] = "./expansions/";
char fpath[1000] = "expansions\\";
#endif
srand(time(0)); srand(time(0));
LoadConfig(); LoadConfig();
irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters(); irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters();
...@@ -60,6 +64,7 @@ bool Game::Initialize() { ...@@ -60,6 +64,7 @@ bool Game::Initialize() {
return false; return false;
if(!dataManager.LoadStrings("strings.conf")) if(!dataManager.LoadStrings("strings.conf"))
return false; return false;
#ifdef _WIN32
fhandle = _findfirst("./expansions/*.cdb", &fdata); fhandle = _findfirst("./expansions/*.cdb", &fdata);
if(fhandle != -1) { if(fhandle != -1) {
strcat(fpath, fdata.name); strcat(fpath, fdata.name);
...@@ -71,6 +76,7 @@ bool Game::Initialize() { ...@@ -71,6 +76,7 @@ bool Game::Initialize() {
} }
_findclose(fhandle); _findclose(fhandle);
} }
#endif
env = device->getGUIEnvironment(); env = device->getGUIEnvironment();
numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 16); numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 16);
adFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 12); adFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 12);
......
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