X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftools%2Fbitmapcode.cpp;h=b5e6cf8d641b14601d5cea362c989f1707dbb01f;hb=e57ec1d198abf22f89385424d891cd432bad06bb;hp=f7eecc15351489e0cd577650e5a7bfae4977d66f;hpb=a711cc7951319aaa592a3c501050ddd9017b01ab;p=xestiaab%2F.git diff --git a/source/tools/bitmapcode.cpp b/source/tools/bitmapcode.cpp index f7eecc1..b5e6cf8 100644 --- a/source/tools/bitmapcode.cpp +++ b/source/tools/bitmapcode.cpp @@ -80,8 +80,18 @@ void CreateCPPFile(wxString dirfilename, wxString PNGFilename, int* counter) // Setup the PNG file reading and cpp file. fstream cppfile, pngfile; + +#if defined(__WIN32__) + pngfile.open(PNGFilename.wc_str(), ios::in | ios::binary ); - cppfile.open(CPPFilename.wc_str(), ios::out | ios::trunc ); + cppfile.open(CPPFilename.wc_str(), ios::out | ios::trunc ); + +# else + + pngfile.open(PNGFilename.c_str(), ios::in | ios::binary ); + cppfile.open(CPPFilename.c_str(), ios::out | ios::trunc ); + +#endif outname.Append(wxString::FromUTF8(DirFilenameOnly.c_str())); outname.Append(wxT("_")); @@ -174,9 +184,7 @@ void CreateHPPFileDir(wxString dirfilename, wxArrayString filelist, wxString HPPFilenameOnly; wxString CPPFilename; -#if defined(__HAIKU__) - -#elif defined(__WIN32__) +#if defined(__WIN32__) wxStringTokenizer HPPFilenameTokens(HPPFilename, wxT("\\")); wxStringTokenizer DirFilenameTokens(dirfilename, wxT("\\")); @@ -212,8 +220,16 @@ void CreateHPPFileDir(wxString dirfilename, wxArrayString filelist, HPPFilename.Append(wxT(".h")); +#if defined(__WIN32__) + hppfile.open(HPPFilename.wc_str(), ios::out | ios::trunc ); - + +#else + + hppfile.open(HPPFilename.c_str(), ios::out | ios::trunc ); + +#endif + hppfile << "#include " << endl << endl; hppfile << "#ifndef " << finaldirname.c_str() << "_H" << endl; hppfile << "#define " << finaldirname.c_str() << "_H" << endl << endl; @@ -333,8 +349,8 @@ int main(int argc, char *argv[]) #else - BitmapFilename.Append(BitmapDirName); - BitmapFilename.Append(wxT("/../bitmaps.h")); + BitmapHeaderFilename.Append(BitmapDirName); + BitmapHeaderFilename.Append(wxT("/../bitmaps.h")); #endif @@ -351,7 +367,7 @@ int main(int argc, char *argv[]) wxString BitmapSubDirFull; bool ContinueProcess = BitmapDir.GetFirst(&BitmapSubDir, wxEmptyString, wxDIR_DEFAULT); - + while (ContinueProcess){ #if defined(__HAIKU__) @@ -369,7 +385,7 @@ int main(int argc, char *argv[]) BitmapSubDirFull.Append(BitmapDirName); BitmapSubDirFull.Append(wxT("/")); - BitmapSubDirFull.Append(BitmapSubDirFull); + BitmapSubDirFull.Append(BitmapSubDir); #endif @@ -418,15 +434,24 @@ int main(int argc, char *argv[]) std::cout << BitmapHeaderFilename.c_str() << std::endl; +#if defined(__WIN32__) + finalhppfile.open(BitmapHeaderFilename.wc_str(), ios::out | ios::trunc); + +#else + + finalhppfile.open(BitmapHeaderFilename.c_str(), ios::out | ios::trunc); + +#endif + finalhppfile << "#include " << endl << endl; finalhppfile << "#ifndef BITMAPS_H" << endl; finalhppfile << "#define BITMAPS_H" << endl << endl; - + for (int bi = 0; bi < dirlist.GetCount(); bi++) { - wxString BitmapSubDirName = wxString::FromUTF8(dirlist[bi]); + wxString BitmapSubDirName = dirlist[bi]; wxString BitmapFilename; wxDir BitmapSubDir(BitmapSubDirName);