1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* updated changelog

* version set to 0.72
* integrated save format version to the CLoadFile
* fixed problems on entering non-number as resolution number
* minor improvements
This commit is contained in:
Michał W. Urbańczyk 2009-06-01 22:31:11 +00:00
parent fa7f35bbf4
commit a17936908a
13 changed files with 62 additions and 17 deletions

View File

@ -1,4 +1,4 @@
0.71 -> 0.72 (soon)
0.71 -> 0.72 (Jun 1 2009)
GENERAL:
* many sound effects and music
* autosave (to 5 subsequent files)
@ -13,6 +13,7 @@ GENERAL:
* timed events won't cause resources amount to be negative
* support for sorcery secondary skill
* reduntant quotation marks from artifact descriptions are removed
* no income at the first day
ADVENTURE INTERFACE:
* fixed crasbug occurring on revisiting objects (by pressing space)
@ -20,10 +21,12 @@ ADVENTURE INTERFACE:
* fixed map scrolling with ctrl+arrows when some windows are opened
* clicking scrolling arrows in town/hero list won't open town/hero window
* pathfinder will now look for a path going via printed positions of roads when it's possible
* enter can be used to open window with selected hero/town
BATTLES:
* many creatures special skills implemented
* battle will end when one side has only war machines
* fixed problems with handling obstacles info
* fixed some problems with handling obstacles info
* fixed bug with defending / waiting while no stack is active
* spellbook button is inactive when hero cannot cast any spell
* obstacles will be placed more properly when resolution is different than 800x600
@ -50,15 +53,19 @@ TOWNS:
* resting in town with mage guild will replenih all the mana points
* fixed Blacksmith
* the number of creatures at the beginning of game is their base growth
* it's possible to enter Tavern via Brotherhood of Sword
HERO WINDOW:
* fixed mana limit info in the hero window
* war machines can't be removed
* fixed problems with removing artifacts when all visible slots in backpack are full
PREGAME:
* clicking on "advanced options" a second time now closes the tab instead of refreshing it.
* Fix position of maps names.
* Made the slider cursor much more responsive. Speedup the map select screen.
* Try to behave when no maps/saves are present.
* Page Up / Page Down / Home / End hotkeys for scrolling through scenarios / games list
OBJECTS:
* Neutral creatures can join or escape depending on hero strength (escape formula needs to be improved)

View File

@ -297,12 +297,15 @@ void processCommand(const std::string &message, CClient *&client)
tlog4 << i++ <<". " << j->first.first << " x " << j->first.second << std::endl;
tlog4 << "Type number from 1 to " << i-1 << " to set appropriate resolution or 0 to cancel.\n";
std::cin >> i;
if(!i)
return;
else if(i < 0 || i > conf.guiOptions.size())
if(i < 0 || i > conf.guiOptions.size() || std::cin.bad() || std::cin.fail())
{
std::cin.clear();
tlog1 << "Invalid resolution ID! Not a number between 0 and " << conf.guiOptions.size() << ". No settings changed.\n";
}
else if(!i)
{
return;
}
else
{
for(j=conf.guiOptions.begin(); j!=conf.guiOptions.end() && hlp++<i; j++); //move j to the i-th resolution info

View File

@ -311,7 +311,7 @@ CSimpleWindow * CMessage::genWindow(std::string text, int player, int Lmar, int
ret->pos.h=ret->bitmap->h;
ret->pos.w=ret->bitmap->w;
int curh = ret->bitmap->h/2 - (fontHeight*txtg->size())/2;
blitTextOnSur(txtg,fontHeight,curh,ret->bitmap, fontHeight);
blitTextOnSur(txtg,fontHeight,curh,ret->bitmap);
delete brtext;
delete txtg;
return ret;

View File

@ -1355,6 +1355,7 @@ void CPlayerInterface::battleAttack(BattleAttack *ba)
tlog5 << "CPlayerInterface::battleAttack - locking...";
boost::unique_lock<boost::recursive_mutex> un(*pim);
tlog5 << "done!\n";
assert(curAction);
if(ba->lucky()) //lucky hit
{
CStack *stack = cb->battleGetStackByID(ba->stackAttacking);

View File

@ -1089,12 +1089,14 @@ void MapSel::processGames(const std::vector<std::string> &pliczkiTemp)
for(int i=0; i<pliczkiTemp.size(); i++)
{
CLoadFile lf(pliczkiTemp[i]);
if(!lf.sfile)
continue;
ui8 sign[8];
lf >> sign >> hlp;
if(hlp != version)
lf >> sign;
if(std::memcmp(sign,"VCMISVG",7))
{
tlog3 << "\t\t" << pliczkiTemp[i] << " seems to be too " << ((hlp>version) ? "new" : "old") << " and will be ommited.\n";
ourGames[i] = NULL;
tlog1 << pliczkiTemp[i] << " is not a correct savefile!" << std::endl;
continue;
}
ourGames[i] = new CMapInfo();

View File

@ -208,7 +208,7 @@ void CClient::load( const std::string & fname )
CGI->mh = new CMapHandler();
CLoadFile lf(fname + ".vlgm1");
lf >> sig >> ver >> dum >> *sig;
lf >> sig >> dum >> *sig;
tlog0 <<"Reading save signature: "<<tmh.getDif()<<std::endl;
lf >> *VLC;

View File

@ -19,7 +19,7 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte)
#define THC
#endif
#define NAME_VER ("VCMI 0.71c")
#define NAME_VER ("VCMI 0.72")
#define CONSOLE_LOGGING_LEVEL 5
#define FILE_LOGGING_LEVEL 6

View File

@ -47,6 +47,8 @@ void CGeneralTextHandler::load()
buf1.substr(pom+1,eol-pom-1)));
boost::algorithm::replace_all(zelp[zelp.size()-1].first,"\t","");
boost::algorithm::replace_all(zelp[zelp.size()-1].second,"\t","");
if(zelp.back().second[0] == '\"' && zelp.back().second[zelp.back().second.size()-1] == '\"')
zelp.back().second = zelp.back().second.substr(1,zelp.back().second.size()-2);
}
itr=eol+2;
}

View File

@ -206,6 +206,8 @@ void CSoundHandler::initCreaturesSounds(std::vector<CCreature> &creatures)
ifs.close();
ifs.clear();
//commented to avoid spurious warnings
/*
// Find creatures without sounds
for(unsigned int i=0;i<creatures.size();i++)
{
@ -217,7 +219,7 @@ void CSoundHandler::initCreaturesSounds(std::vector<CCreature> &creatures)
CCreature &c = creatures[i];
if (c.sounds.killed == soundBase::invalid)
tlog1 << "creature " << c.idNumber << " doesn't have sounds" << std::endl;
}
}*/
}
void CSoundHandler::initSpellsSounds(std::vector<CSpell> &spells)

View File

@ -182,6 +182,11 @@ CSaveFile::CSaveFile( const std::string &fname )
tlog1 << "Error: cannot open to write " << fname << std::endl;
sfile = NULL;
}
else
{
sfile->write("VCMI",4); //write magic identifier
*this << version; //write format version
}
}
CSaveFile::~CSaveFile()
@ -204,6 +209,27 @@ CLoadFile::CLoadFile( const std::string &fname )
tlog1 << "Error: cannot open to read " << fname << std::endl;
sfile = NULL;
}
else
{
char buffer[4];
sfile->read(buffer, 4);
if(std::memcmp(buffer,"VCMI",4))
{
tlog1 << "Error: wrong save format!\n";
delete sfile;
sfile = NULL;
return;
}
*this >> myVersion;
if(myVersion != version)
{
tlog1 << "Wrong save format!\n";
delete sfile;
sfile = NULL;
}
}
}
CLoadFile::~CLoadFile()

View File

@ -19,7 +19,7 @@
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_array.hpp>
const ui32 version = 704;
const ui32 version = 705;
class CConnection;
namespace mpl = boost::mpl;
@ -426,10 +426,12 @@ template <typename Serializer> class DLL_EXPORT CISer : public CLoaderBase
public:
bool saving;
std::map<ui16,CBasicPointerLoader*> loaders; // typeID => CPointerSaver<serializer,type>
ui32 myVersion;
CISer()
{
saving = false;
myVersion = version;
}
template<typename T> void registerType(const T * t=NULL)
@ -489,7 +491,7 @@ public:
template <typename T>
void loadSerializable(T &data)
{
data.serialize(*this,version);
data.serialize(*this,myVersion);
}
template <typename T>
void loadArray(T &data)

View File

@ -1472,7 +1472,7 @@ void CGameHandler::save( const std::string &fname )
tlog0 << "Serializing game info...\n";
CSaveFile save(std::string("Games") + PATHSEPARATOR + fname + ".vlgm1");
char hlp[8] = "VCMISVG";
save << hlp << version << static_cast<CMapHeader&>(*gs->map) << gs->scenarioOps->difficulty << *VLC << gs;
save << hlp << static_cast<CMapHeader&>(*gs->map) << gs->scenarioOps->difficulty << *VLC << gs;
}
{

View File

@ -184,7 +184,7 @@ void CVCMIServer::loadGame( CConnection *c )
CMapHeader dum;
CLoadFile lf(fname + ".vlgm1");
lf >> sig >> ver >> dum >> *sig;
lf >> sig >> dum >> *sig;
tlog0 <<"Reading save signature"<<std::endl;
lf >> *VLC;