Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TileMap::TileMap(const char* filename, const char* name) :
- m_Name( name )
- {
- std::ifstream file( filename );
- std::string line;
- while( std::getline( file, line ) )
- {
- std::string id;
- std::stringstream lineStream( line.c_str() );
- std::vector< int > lineData;
- int tmp = 0;
- while( std::getline( lineStream, id, ',' ) )
- {
- lineData.push_back( std::stoi( id ) );
- tmp++;
- }
- if( tmp > m_Width )
- m_Width = tmp;
- m_Height++;
- m_MapData.push_back( lineData );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement