From 974d27aacce0b3417abde84ccd22c63186fea229 Mon Sep 17 00:00:00 2001 From: mateuszb Date: Wed, 30 Jan 2008 14:19:35 +0000 Subject: [PATCH] small improvements, bugfixes etc. --- CHeroWindow.cpp | 4 ++-- CPlayerInterface.cpp | 4 +++- SDL_Extensions.cpp | 8 +++---- hch/CAmbarCendamo.cpp | 5 ++-- hch/CLodHandler.cpp | 2 +- hch/CVideoHandler.cpp | 2 +- map.cpp | 2 +- mapHandler.cpp | 56 +++++++------------------------------------ 8 files changed, 23 insertions(+), 60 deletions(-) diff --git a/CHeroWindow.cpp b/CHeroWindow.cpp index c7ff52906..44743848e 100644 --- a/CHeroWindow.cpp +++ b/CHeroWindow.cpp @@ -183,7 +183,7 @@ void CHeroWindow::setHero(const CGHeroInstance *hero) portraitArea->text = hero->biography; delete garInt; - garInt = new CGarrisonInt(80, 494, 8, 0, curBack, 13, 482, curHero); + garInt = new CGarrisonInt(80, 493, 8, 0, curBack, 13, 482, curHero); for(int g=0; gbackpack.size(); ++g) { if(ourWindow->backpack[g]==this) //if user wants to put something to backpack diff --git a/CPlayerInterface.cpp b/CPlayerInterface.cpp index 76c23eb87..edb9b086a 100644 --- a/CPlayerInterface.cpp +++ b/CPlayerInterface.cpp @@ -23,6 +23,8 @@ #include using namespace CSDL_Ext; +extern TTF_Font * GEOR16; + class OCM_HLP_CGIN { public: @@ -150,7 +152,7 @@ void CGarrisonSlot::show() char* buf = new char[15]; itoa(count,buf,10); blitAt(CGI->creh->bigImgs[creature->idNumber],pos); - printTo(buf,pos.x+56,pos.y+62,GEOR13,zwykly); + printTo(buf,pos.x+56,pos.y+62,GEOR16,zwykly); if(owner->highlighted==this) blitAt(CGI->creh->bigImgs[-1],pos); updateRect(&pos,ekran); diff --git a/SDL_Extensions.cpp b/SDL_Extensions.cpp index 966895b3c..e8fe90e64 100644 --- a/SDL_Extensions.cpp +++ b/SDL_Extensions.cpp @@ -509,11 +509,11 @@ Uint32 CSDL_Ext::colorToUint32(const SDL_Color * color) { Uint32 ret = 0; ret+=color->unused; - ret*=256; + ret<<=8; //*=256 ret+=color->b; - ret*=256; + ret<<=8; //*=256 ret+=color->g; - ret*=256; + ret<<=8; //*=256 ret+=color->r; return ret; } @@ -733,7 +733,7 @@ int readNormalNr (std::istream &in, int bytCon) { in.read((char*)&byte,1); ret+=byte*amp; - amp*=256; + amp<<=8; } } else return -1; diff --git a/hch/CAmbarCendamo.cpp b/hch/CAmbarCendamo.cpp index 6e6003241..f8cb0d4bb 100644 --- a/hch/CAmbarCendamo.cpp +++ b/hch/CAmbarCendamo.cpp @@ -919,8 +919,6 @@ void CAmbarCendamo::deh3m() spec->artifacts.push_back(NULL); } } - for(int t=spec->artifacts.size(); t<10; ++t) - spec->artifacts.push_back(NULL); } //artifacts else { @@ -944,6 +942,9 @@ void CAmbarCendamo::deh3m() spec->artifWorn[17] = NULL; spec->artifWorn[5] = NULL; } + for(int t=spec->artifacts.size(); t<10; ++t) //it does make sense, even it is not obvious ;] + spec->artifacts.push_back(NULL); + spec->guardRange = readNormalNr(i, 1); ++i; if(spec->guardRange == 0xff) spec->isGuarding = false; diff --git a/hch/CLodHandler.cpp b/hch/CLodHandler.cpp index 797fb0975..f7bab8ac4 100644 --- a/hch/CLodHandler.cpp +++ b/hch/CLodHandler.cpp @@ -16,7 +16,7 @@ int readNormalNr (int pos, int bytCon, unsigned char * str) for (int i=0; iinfo)->myInstance->type==NULL) + continue; + std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; switch(themp->moveDir) { case 1: { - if(((CHeroObjInfo*)themp->info)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) + continue; + std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; switch(themp->moveDir) { case 1: { - if(((CHeroObjInfo*)themp->info)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gginfo)->myInstance->type==NULL) - continue; - std::vector & iv = ((CHeroObjInfo*)themp->info)->myInstance->type->heroClass->moveAnim->ourImages; int gg; for(gg=0; gg