From eee726bd32ae268b10af8bc5a0518d181090a5bf Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Sat, 10 Oct 2009 23:46:42 +0000 Subject: [PATCH] Removed duplicated code. --- client/CBitmapHandler.cpp | 23 +++-------------------- hch/CLodHandler.h | 5 +++-- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/client/CBitmapHandler.cpp b/client/CBitmapHandler.cpp index 6b6e5bd4d..d2892fe75 100644 --- a/client/CBitmapHandler.cpp +++ b/client/CBitmapHandler.cpp @@ -230,26 +230,9 @@ SDL_Surface * BitmapHandler::loadBitmap(std::string fname, bool setKey) } } } - bitmap_handler_mx.lock(); - bitmaph->LOD.seekg(e->offset, std::ios::beg); - if (e->size==0) //file is not compressed - { - pcx = new unsigned char[e->realSize]; - bitmaph->LOD.read((char*)pcx, e->realSize); - bitmap_handler_mx.unlock(); - } - else - { - unsigned char * pcd = new unsigned char[e->size]; - bitmaph->LOD.read((char*)pcd, e->size); - bitmap_handler_mx.unlock(); - int res=bitmaph->infs2(pcd,e->size,e->realSize,pcx); - if(res!=0) - { - tlog2<<"an error "<giveFile(e->nameStr, NULL); + CPCXConv cp; cp.openPCX((char*)pcx, e->realSize); SDL_Surface * ret = cp.getSurface(); diff --git a/hch/CLodHandler.h b/hch/CLodHandler.h index b40ba1a61..5761145ee 100644 --- a/hch/CLodHandler.h +++ b/hch/CLodHandler.h @@ -60,13 +60,14 @@ struct Entry class DLL_EXPORT CLodHandler { -public: std::ifstream LOD; - nodrze entries; unsigned int totalFiles; boost::mutex *mutex; std::string myDir; //load files from this dir instead of .lod file +public: + nodrze entries; + CLodHandler(); ~CLodHandler(); int readNormalNr (const unsigned char* bufor, int bytCon, bool cyclic=false); //lod header reading helper