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

Debug tweaks

This commit is contained in:
AlexVinS 2016-02-10 08:59:24 +03:00
parent 3c78f960cd
commit fb17914ae5
3 changed files with 8 additions and 1 deletions

View File

@ -386,7 +386,9 @@ void CGObjectInstance::writeOwner(JsonNode & json) const
void CGObjectInstance::readOwner(const JsonNode & json) void CGObjectInstance::readOwner(const JsonNode & json)
{ {
if(json["owner"].getType() == JsonNode::DATA_STRING) if(json["owner"].getType() == JsonNode::DATA_STRING)
{
tempOwner = PlayerColor(vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, json["owner"].String())); tempOwner = PlayerColor(vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, json["owner"].String()));
}
} }
CGObjectInstanceBySubIdFinder::CGObjectInstanceBySubIdFinder(CGObjectInstance * obj) : obj(obj) CGObjectInstanceBySubIdFinder::CGObjectInstanceBySubIdFinder(CGObjectInstance * obj) : obj(obj)

View File

@ -244,6 +244,7 @@ si32 CMapLoaderJson::getIdentifier(const std::string& type, const std::string& n
std::unique_ptr<CMap> CMapLoaderJson::loadMap() std::unique_ptr<CMap> CMapLoaderJson::loadMap()
{ {
LOG_TRACE(logGlobal);
map = new CMap(); map = new CMap();
mapHeader = std::unique_ptr<CMapHeader>(dynamic_cast<CMapHeader *>(map)); mapHeader = std::unique_ptr<CMapHeader>(dynamic_cast<CMapHeader *>(map));
readMap(); readMap();
@ -252,6 +253,7 @@ std::unique_ptr<CMap> CMapLoaderJson::loadMap()
std::unique_ptr<CMapHeader> CMapLoaderJson::loadMapHeader() std::unique_ptr<CMapHeader> CMapLoaderJson::loadMapHeader()
{ {
LOG_TRACE(logGlobal);
mapHeader.reset(new CMapHeader); mapHeader.reset(new CMapHeader);
readHeader(); readHeader();
return std::move(mapHeader); return std::move(mapHeader);
@ -274,6 +276,7 @@ const JsonNode CMapLoaderJson::readJson(const std::string & archiveFilename)
void CMapLoaderJson::readMap() void CMapLoaderJson::readMap()
{ {
LOG_TRACE(logGlobal);
readHeader(); readHeader();
map->initTerrain(); map->initTerrain();
readTerrain(); readTerrain();
@ -575,11 +578,13 @@ void CMapLoaderJson::MapObjectLoader::construct()
if(typeName.empty()) if(typeName.empty())
{ {
logGlobal->errorStream() << "Object type missing"; logGlobal->errorStream() << "Object type missing";
logGlobal->traceStream() << configuration;
return; return;
} }
if(subTypeName.empty()) if(subTypeName.empty())
{ {
logGlobal->errorStream() << "Object subType missing"; logGlobal->errorStream() << "Object subType missing";
logGlobal->traceStream() << configuration;
return; return;
} }

View File

@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE(CMapFormatVCMI_Simple)
#if 1 #if 1
{ {
auto path = VCMIDirs::get().userDataPath()/"test.zip"; auto path = VCMIDirs::get().userDataPath()/"test.vmap";
boost::filesystem::remove(path); boost::filesystem::remove(path);
boost::filesystem::ofstream tmp(path, boost::filesystem::ofstream::binary); boost::filesystem::ofstream tmp(path, boost::filesystem::ofstream::binary);