From ac175895b17a63316746fb90ff8226b46030dcd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Wed, 15 Jul 2009 23:58:47 +0000 Subject: [PATCH] MKinor bugfixes. (cf http://vcmi.antypika.aplus.pl/forum/viewtopic.php?p=2980#2980 ) --- client/CCastleInterface.cpp | 2 +- client/CMT.cpp | 18 +++++++++++++++--- client/GUIClasses.cpp | 15 ++++++++------- config/cr_sounds.txt | 6 ++++-- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/client/CCastleInterface.cpp b/client/CCastleInterface.cpp index 1243ce151..0e7331adc 100644 --- a/client/CCastleInterface.cpp +++ b/client/CCastleInterface.cpp @@ -1445,7 +1445,7 @@ void CFortScreen::draw( CCastleInterface * owner, bool first) } blitAt(icons,positions[i].x+261,positions[i].y+3,bg); - //atttack + //attack printAt(CGI->generaltexth->allTexts[190],positions[i].x+288,positions[i].y+5,GEOR13,zwykly,bg); SDL_itoa(c->attack,buf,10); printToWR(buf,positions[i].x+381,positions[i].y+18,GEOR13,zwykly,bg); diff --git a/client/CMT.cpp b/client/CMT.cpp index 35c61bcdb..a0d5fd946 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -395,9 +395,21 @@ static void setScreenRes(int w, int h, int bpp, bool fullscreen) if (bpp > 32) bpp = 32; // Try to use the best screen depth for the display - if (((bpp = SDL_VideoModeOK(w, h, bpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0))) == 0) || - ((screen = SDL_SetVideoMode(w, h, bpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0))) == NULL)) { - tlog1 << "Requested screen resolution is not available (" << w << "x" << h << ")\n"; + int suggestedBpp = SDL_VideoModeOK(w, h, bpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0)); + if(suggestedBpp == 0) + { + tlog2 << "Warning: SDL says that " << w << "x" << h << " resolution is not available!\n"; + suggestedBpp = bpp; + } + else if(suggestedBpp != bpp) + { + tlog2 << "Warning: SDL says that " << bpp << "bpp is wrong and suggests " << suggestedBpp << std::endl; + } + + + if((screen = SDL_SetVideoMode(w, h, suggestedBpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0))) == NULL) + { + tlog1 << "Requested screen resolution is not available (" << w << "x" << h << "x" << suggestedBpp << "bpp)\n"; throw "Requested screen resolution is not available\n"; } diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 5f0d52ea3..17fce902e 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -2945,15 +2945,16 @@ CTavernWindow::HeroPortrait::HeroPortrait(int &sel, int id, int x, int y, const { hoverName = CGI->generaltexth->tavernInfo[4]; boost::algorithm::replace_first(hoverName,"%s",H->name); + + int artifs = h->artifWorn.size() + h->artifacts.size(); + for(int i=13; i<=17; i++) //war machines and spellbook don't count + if(vstd::contains(h->artifWorn,i)) + artifs--; + sprintf_s(descr, sizeof(descr),CGI->generaltexth->allTexts[215].c_str(), + h->name.c_str(), h->level, h->type->heroClass->name.c_str(), artifs); + descr[sizeof(descr)-1] = '\0'; } - int artifs = h->artifWorn.size() + h->artifacts.size(); - for(int i=13; i<=17; i++) //war machines and spellbook don't count - if(vstd::contains(h->artifWorn,i)) - artifs--; - sprintf_s(descr, sizeof(descr),CGI->generaltexth->allTexts[215].c_str(), - h->name.c_str(), h->level, h->type->heroClass->name.c_str(), artifs); - descr[sizeof(descr)-1] = '\0'; } void CTavernWindow::HeroPortrait::show(SDL_Surface * to) diff --git a/config/cr_sounds.txt b/config/cr_sounds.txt index fdbfa0e90..4745a6162 100644 --- a/config/cr_sounds.txt +++ b/config/cr_sounds.txt @@ -79,7 +79,8 @@ Hydra HYDRATTK.wav HYDRDFND.wav HYDRKILL.wav HYDRMOVE.wav invalid HYDRWNCE.wav IceElemental ICELATTK.wav ICELDFND.wav ICELKILL.wav ICELMOVE.wav ICELSHOT.wav ICELWNCE.wav Imp IMPPATTK.wav IMPPDFND.wav IMPPKILL.wav IMPPMOVE.wav invalid IMPPWNCE.wav InfernalTroglodyte ITRGATTK.wav ITRGDFND.wav ITRGKILL.wav ITRGMOVE.wav invalid ITRGWNCE.wav -IronGolem IGLMATTK.wav IGLMDFND.wav IGLMKILL.wav IGLMMOVE.wav invalid IGLMWNCE.wav +# StoneGolem is actually an Iron Golem +StoneGolem IGLMATTK.wav IGLMDFND.wav IGLMKILL.wav IGLMMOVE.wav invalid IGLMWNCE.wav LesserTitan LTITATTK.wav LTITDFND.wav LTITKILL.wav LTITMOVE.wav invalid LTITWNCE.wav Lich LICHATTK.wav LICHDFND.wav LICHKILL.wav LICHMOVE.wav LICHSHOT.wav LICHWNCE.wav LICHATK2.wav LightCrossbowman LCRSATTK.wav LCRSDFND.wav LCRSKILL.wav LCRSMOVE.wav LCRSSHOT.wav LCRSWNCE.wav @@ -126,7 +127,8 @@ SkeletonWarrior SKLWATTK.wav SKLWDFND.wav SKLWKILL.wav SKLWMOVE.wav invalid SKLW Sprite SPRTATTK.wav SPRTDFND.wav SPRTKILL.wav SPRTMOVE.wav invalid SPRTWNCE.wav StoneElemental MAGMATTK.wav MAGMDFND.wav MAGMKILL.wav MAGMMOVE.wav invalid MAGMWNCE.wav StoneGargoyle SGRGATTK.wav SGRGDFND.wav SGRGKILL.wav SGRGMOVE.wav invalid SGRGWNCE.wav -StoneGolem SGLMATTK.wav SGLMDFND.wav SGLMKILL.wav SGLMMOVE.wav invalid SGLMWNCE.wav +# IronGolem is actually a Stone Golem +IronGolem SGLMATTK.wav SGLMDFND.wav SGLMKILL.wav SGLMMOVE.wav invalid SGLMWNCE.wav StormElemental STORATTK.wav STORDFND.wav STORKILL.wav STORMOVE.wav STORSHOT.wav STORWNCE.wav Swordsman SWRDATTK.wav SWRDDFND.wav SWRDKILL.wav SWRDMOVE.wav invalid SWRDWNCE.wav Thunderbird TBRDATTK.wav TBRDDFND.wav TBRDKILL.wav TBRDMOVE.wav invalid TBRDWNCE.wav