From abaee5ce45a6da2b5aad708ab653ddf977cee8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 24 Apr 2010 16:36:41 +0200 Subject: [PATCH] uint -> uint32_t, removed 8 unit offset from the local feature dump method --- dfhack/DFMemInfo.cpp | 2 +- dfhack/modules/Maps.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dfhack/DFMemInfo.cpp b/dfhack/DFMemInfo.cpp index 7f0d9ef0a..549842c4b 100644 --- a/dfhack/DFMemInfo.cpp +++ b/dfhack/DFMemInfo.cpp @@ -227,7 +227,7 @@ void memory_info::setProfession (const string & key, const string & value) uint32_t keyInt = strtol(key.c_str(), NULL, 10); if(d->professions.size() <= keyInt) { - d->professions.resize(keyInt+1); + d->professions.resize(keyInt+1,""); } d->professions[keyInt] = value; } diff --git a/dfhack/modules/Maps.cpp b/dfhack/modules/Maps.cpp index 64041b9e7..7d4efbd4e 100644 --- a/dfhack/modules/Maps.cpp +++ b/dfhack/modules/Maps.cpp @@ -668,14 +668,14 @@ bool Maps::ReadLocalFeatures( std::map > & local_features.clear(); - for(uint blockX = 0; blockX < d->x_block_count; blockX ++) - for(uint blockY = 0; blockY < d->x_block_count; blockY ++) + for(uint32_t blockX = 0; blockX < d->x_block_count; blockX ++) + for(uint32_t blockY = 0; blockY < d->x_block_count; blockY ++) { //uint64_t block48_x = blockX / 3 + d->regionX; //uint16_t region_x_plus8 = ( block48_x + 8 ) / 16; // region X coord offset by 8 big blocks (48x48 tiles) - uint16_t region_x_plus8 = ( blockX / 3 + d->regionX + 8 ) / 16; + uint16_t region_x_plus8 = ( blockX / 3 + d->regionX /*+ 8*/ ) / 16; // plain region Y coord uint64_t region_y_local = ( blockY / 3 + d->regionY ) / 16; @@ -690,12 +690,12 @@ bool Maps::ReadLocalFeatures( std::map > & // wtf + sizeof(vector) * crap; uint32_t feat_vector = wtf + sizeof_vec * (16 * (region_x_plus8 % 16) + (region_y_local % 16)); DfVector p_features(p, feat_vector); - uint size = p_features.size(); + uint32_t size = p_features.size(); planecoord pc; pc.dim.x = blockX; pc.dim.y = blockY; std::vector tempvec; - for(uint i = 0; i < size; i++) + for(uint32_t i = 0; i < size; i++) { uint32_t cur_ptr = p_features[i]; @@ -750,9 +750,9 @@ bool Maps::ReadGlobalFeatures( std::vector & features) DfVector p_features (p,global_feature_vector); features.clear(); - uint size = p_features.size(); + uint32_t size = p_features.size(); features.reserve(size); - for(uint i = 0; i < size; i++) + for(uint32_t i = 0; i < size; i++) { t_feature temp; uint32_t feat_ptr = p->readDWord(p_features[i] + global_feature_funcptr );