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/cDeNotch.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'converter/source/cDeNotch.cpp') diff --git a/converter/source/cDeNotch.cpp b/converter/source/cDeNotch.cpp index f76dda5d4..c5001896b 100644 --- a/converter/source/cDeNotch.cpp +++ b/converter/source/cDeNotch.cpp @@ -1,7 +1,6 @@ #include "cDeNotch.h" #include #include -//#include #include #include #include @@ -10,18 +9,13 @@ #include "cTimer.h" #include "cQuicksort.h" #include "cDeNotch.h" +#ifdef _WIN32 +#include "dirent.h" +#else #include +#endif -//int cDeNotch ( std::string, std::string ); - -//std::string mcrSource; -//std::string pakOutput; - - - -//using namespace std; - cDeNotch::cDeNotch ( ) { @@ -35,8 +29,8 @@ int cDeNotch:: Converter ( std::string mcrSource, std::string pakOutput ) { FILE* f = 0; FILE* wf = 0; #ifdef _WIN32 - sprintf_s(SourceFile, 128, "region/%s", mcrSource.c_str() ); //replace hard coded file with file array variable - sprintf_s(OutputFile, 128, "world/%s", pakOutput.c_str() ); //parce x and z from file array variable and place into pak file format + sprintf_s(SourceFile, 128, "region\\%s", mcrSource.c_str() ); //replace hard coded file with file array variable + sprintf_s(OutputFile, 128, "world\\%s", pakOutput.c_str() ); //parce x and z from file array variable and place into pak file format if( fopen_s(&wf, OutputFile, "wb" ) == 0 ) {} else { std::cout << "uhoh!" << std::endl; return false; } //open new pak file for writing #else sprintf(SourceFile, "region/%s", mcrSource.c_str() ); //same as above but for linux -- cgit v1.2.3