diff --git a/CDefHandler.cpp b/CDefHandler.cpp index 977a5c8d2..5c51bca41 100644 Binary files a/CDefHandler.cpp and b/CDefHandler.cpp differ diff --git a/CLodHandler.cpp b/CLodHandler.cpp index d7dd08265..b334c4046 100644 --- a/CLodHandler.cpp +++ b/CLodHandler.cpp @@ -39,7 +39,7 @@ void CPCXConv::fromFile(std::string path) void CPCXConv::saveBMP(std::string path) { std::ofstream os; - os.open(path.c_str()); + os.open(path.c_str(), std::ios::binary); os.write((char*)bmp,bmps); os.close(); } @@ -76,7 +76,7 @@ void CPCXConv::convert() bh.y=maxy; add=(int)(4*(((float)1)-(((float)maxx/(float)4)-((int)((float)maxx/(float)4))))); if (add==4) - add=2; + add=0; if (format==Epcxformat::PCX8B) { bh._c1=0x436; diff --git a/CMT.cpp b/CMT.cpp index aee265a2f..c774400a8 100644 --- a/CMT.cpp +++ b/CMT.cpp @@ -26,6 +26,7 @@ #include "CMusicHandler.h" #include "CSemiLodHandler.h" #include "CLodHandler.h" +#include "CDefHandler.h" #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include # include @@ -269,11 +270,20 @@ int _tmain(int argc, _TCHAR* argv[]) //CLodHandler * clod = new CLodHandler; //clod->loadLod("h3abp_bm.lod"); - CLodHandler * test = new CLodHandler; - test->init(std::string("h3abp_bm.lod")); + //CLodHandler * test = new CLodHandler; + //test->init(std::string("h3abp_bm.lod")); - CLodHandler * bitmapLod = new CLodHandler; - test->init(std::string("newH3sprite.lod")); + CDefHandler * tdef = new CDefHandler; + tdef->openDef(std::string("H3sprite.lod\\IOKAY.DEF")); + tdef->getSprite(0); + + //CLodHandler * bitmapLod = new CLodHandler; + //bitmapLod->init(std::string("newH3bitmap.lod")); + + CPCXConv * tconv = new CPCXConv; + tconv->fromFile(std::string("newh3bitmap\\ADOPBPNL.PCX")); + tconv->convert(); + tconv->saveBMP(std::string("tesciczekConva.bmp")); //////////////////////////////////////////////////////////////////////////////// lod testing end