- changed status to resolved
Packing arrays to VariantList takes lot of time
Issue #231
resolved
Сan use base64 encoding to reduce the processing time and takes place in a save file
Here:
void Tilemap::save( VariantMap& stream ) const
{
// saves the graphics map
VariantList bitsetInfo;
VariantList desInfo;
VariantList idInfo;
TilesArray tiles = const_cast< Tilemap* >( this )->getArea( TilePos( 0, 0 ), Size( _d->size ) );
foreach( it, tiles )
{
Tile* tile = *it;
bitsetInfo.push_back( TileHelper::encode( *tile ) ); //pack to base64 before saving
desInfo.push_back( tile->desirability() ); //and here
idInfo.push_back( tile->originalImgId() ); //and here
}
stream[ "bitset" ] = bitsetInfo;
stream[ "desirability" ] = desInfo;
stream[ "imgId" ] = idInfo;
stream[ "size" ] = _d->size;
}
Comments (1)
-
reporter - Log in to comment
fix
#231. Fast save/load alg for tilemap info.→ <<cset 08243a0cf0cf>>