diff --git a/CGameInfo.h b/CGameInfo.h index 7462f71c8..f076625b3 100644 --- a/CGameInfo.h +++ b/CGameInfo.h @@ -13,6 +13,7 @@ #include "CSemiLodHandler.h" #include "CDefObjInfoHandler.h" #include "CLodHandler.h" +#include "CTownHandler.h" #include "CGeneralTextHandler.h" #include "SDL.h" #include @@ -36,6 +37,7 @@ public: CMusicHandler * mush; CSemiLodHandler * sspriteh; CDefObjInfoHandler * dobjinfo; + CTownHandler * townh; CLodHandler * spriteh; CLodHandler * bitmaph; CGeneralTextHandler * generaltexth; diff --git a/CLodHandler.cpp b/CLodHandler.cpp index cb16a2596..fa65cec6f 100644 --- a/CLodHandler.cpp +++ b/CLodHandler.cpp @@ -33,7 +33,7 @@ void CPCXConv::fromFile(std::string path) { std::ifstream * is = new std::ifstream(); is -> open(path.c_str(),std::ios::binary); - is->seekg(0,std::ios::end); // na koniec + is->seekg(0,std::ios::end); // to the end pcxs = is->tellg(); // read length is->seekg(0,std::ios::beg); // wracamy na poczatek pcx = new unsigned char[pcxs]; // allocate memory @@ -688,64 +688,13 @@ void CLodHandler::extract(std::string FName) std::cout<<"LOD Extraction error"<<" "<neutralColor = p;//gray //colors initialized + cgi->townh = new CTownHandler; + cgi->townh->loadNames(); THC std::cout<<"Loading .lods: "< nr is absolute Options(){inited=showed=false;}; ~Options(); }; diff --git a/SDL_Extensions.cpp b/SDL_Extensions.cpp index 7fa98244e..d6eac2aa9 100644 --- a/SDL_Extensions.cpp +++ b/SDL_Extensions.cpp @@ -21,7 +21,13 @@ SDL_Rect genRect(int hh, int ww, int xx, int yy) ret.y=yy; return ret; } -void blitAt(SDL_Surface * src, int x, int y, SDL_Surface * dst=ekran) +void blitAtWR(SDL_Surface * src, int x, int y, SDL_Surface * dst) +{ + SDL_Rect pom = genRect(src->h,src->w,x,y); + SDL_BlitSurface(src,NULL,dst,&pom); + SDL_UpdateRect(dst,x,y,src->w,src->h); +} +void blitAt(SDL_Surface * src, int x, int y, SDL_Surface * dst) { SDL_Rect pom = genRect(src->h,src->w,x,y); SDL_BlitSurface(src,NULL,dst,&pom); diff --git a/SDL_Extensions.h b/SDL_Extensions.h index 0cccb260d..36bd6d769 100644 --- a/SDL_Extensions.h +++ b/SDL_Extensions.h @@ -6,6 +6,7 @@ extern SDL_Surface * ekran; extern SDL_Color tytulowy, tlo, zwykly ; +void blitAtWR(SDL_Surface * src, int x, int y, SDL_Surface * dst=ekran); namespace CSDL_Ext { void SDL_PutPixel(SDL_Surface *ekran, int x, int y, Uint8 R, Uint8 G, Uint8 B, int myC=0, Uint8 A = 255); //myC influences the start of reading pixels diff --git a/nodrze.h b/nodrze.h index efc3b5a92..5259941db 100644 --- a/nodrze.h +++ b/nodrze.h @@ -7,6 +7,7 @@ #include #include +#include #define LOGUJ ; #define CLOG ; @@ -112,6 +113,7 @@ public: //print all elements postorder void wypiszObficie(std::ostream & strum); //wypisuje dane o kazdym wezle -- wymaga operatora >> dla zawartosci //prints info about all nodes - >> operator for T needed + std::vector vectorize(); //returns vector with all nodrze elements T * znajdz (T co, bool iter = true); // wyszukuje zadany element //search for T int size(); //ilosc elementow @@ -132,6 +134,13 @@ public: template friend Y* operator%(nodrze & drzewko, X co); // search and return pointer void push_back(T co){(*this)+=co;}; // add }; +template std::vector nodrze::vectorize() +{ + std::vector ret; + for (int i=0; i void nodrze::wypisuj(wezel * w, std::ostream & strum) { if (w==NIL) return;