uint -> uint32_t, removed 8 unit offset from the local feature dump method

develop
Petr Mrázek 2010-04-24 16:36:41 +02:00
parent 340b0cf91c
commit abaee5ce45
2 changed files with 8 additions and 8 deletions

@ -227,7 +227,7 @@ void memory_info::setProfession (const string & key, const string & value)
uint32_t keyInt = strtol(key.c_str(), NULL, 10); uint32_t keyInt = strtol(key.c_str(), NULL, 10);
if(d->professions.size() <= keyInt) if(d->professions.size() <= keyInt)
{ {
d->professions.resize(keyInt+1); d->professions.resize(keyInt+1,"");
} }
d->professions[keyInt] = value; d->professions[keyInt] = value;
} }

@ -668,14 +668,14 @@ bool Maps::ReadLocalFeatures( std::map <planecoord, std::vector<t_feature *> > &
local_features.clear(); local_features.clear();
for(uint blockX = 0; blockX < d->x_block_count; blockX ++) for(uint32_t blockX = 0; blockX < d->x_block_count; blockX ++)
for(uint blockY = 0; blockY < d->x_block_count; blockY ++) for(uint32_t blockY = 0; blockY < d->x_block_count; blockY ++)
{ {
//uint64_t block48_x = blockX / 3 + d->regionX; //uint64_t block48_x = blockX / 3 + d->regionX;
//uint16_t region_x_plus8 = ( block48_x + 8 ) / 16; //uint16_t region_x_plus8 = ( block48_x + 8 ) / 16;
// region X coord offset by 8 big blocks (48x48 tiles) // 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 // plain region Y coord
uint64_t region_y_local = ( blockY / 3 + d->regionY ) / 16; uint64_t region_y_local = ( blockY / 3 + d->regionY ) / 16;
@ -690,12 +690,12 @@ bool Maps::ReadLocalFeatures( std::map <planecoord, std::vector<t_feature *> > &
// wtf + sizeof(vector<ptr>) * crap; // wtf + sizeof(vector<ptr>) * crap;
uint32_t feat_vector = wtf + sizeof_vec * (16 * (region_x_plus8 % 16) + (region_y_local % 16)); uint32_t feat_vector = wtf + sizeof_vec * (16 * (region_x_plus8 % 16) + (region_y_local % 16));
DfVector<uint32_t> p_features(p, feat_vector); DfVector<uint32_t> p_features(p, feat_vector);
uint size = p_features.size(); uint32_t size = p_features.size();
planecoord pc; planecoord pc;
pc.dim.x = blockX; pc.dim.x = blockX;
pc.dim.y = blockY; pc.dim.y = blockY;
std::vector<t_feature *> tempvec; std::vector<t_feature *> tempvec;
for(uint i = 0; i < size; i++) for(uint32_t i = 0; i < size; i++)
{ {
uint32_t cur_ptr = p_features[i]; uint32_t cur_ptr = p_features[i];
@ -750,9 +750,9 @@ bool Maps::ReadGlobalFeatures( std::vector <t_feature> & features)
DfVector<uint32_t> p_features (p,global_feature_vector); DfVector<uint32_t> p_features (p,global_feature_vector);
features.clear(); features.clear();
uint size = p_features.size(); uint32_t size = p_features.size();
features.reserve(size); features.reserve(size);
for(uint i = 0; i < size; i++) for(uint32_t i = 0; i < size; i++)
{ {
t_feature temp; t_feature temp;
uint32_t feat_ptr = p->readDWord(p_features[i] + global_feature_funcptr ); uint32_t feat_ptr = p->readDWord(p_features[i] + global_feature_funcptr );