From dd36ea269fb3364e0b1c7d324e8e9a42ddad610f Mon Sep 17 00:00:00 2001 From: "admin@omencraft.com" Date: Sat, 5 Nov 2011 00:23:32 +0000 Subject: Updated denotch map converter to work in windows. Still has memory leak though. git-svn-id: http://mc-server.googlecode.com/svn/trunk@61 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- converter/source/main.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'converter/source/main.cpp') diff --git a/converter/source/main.cpp b/converter/source/main.cpp index 7f415d896..0cf3248b9 100644 --- a/converter/source/main.cpp +++ b/converter/source/main.cpp @@ -3,7 +3,11 @@ #include "cTimer.h" #include "cQuicksort.h" #include "cDeNotch.h" +#ifdef _WIN32 +#include "dirent.h" +#else #include +#endif int main () { @@ -22,12 +26,15 @@ int main () { //string* dir_array; int dir_num_files = 0; int ctr = 0; - +#ifdef _WIN32 + if(dp = opendir("region\\")){ +#else if(dp = opendir("region/")){ - while(entry = readdir(dp)){ +#endif + while(entry = readdir(dp)){ entrys = entry->d_name; found = entrys.find(".mcr"); - if ( (found!=std::string::npos) && (entry->d_type==8) ) { + if ( (found!=std::string::npos) ) { str2 = entrys.substr (2,sizeof(entrys)); filexPos = str2.substr (0,(int)str2.find(".")); str3 = str2.substr ((int)str2.find(".")+1, sizeof(str2)); -- cgit v1.2.3