1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-15 23:49:42 +01:00

Refactor areamap initialization to not use strings

Instead, the data is held in a const int array, which is directly loaded
into areamap.
This commit is contained in:
Misa 2020-05-17 17:05:07 -07:00 committed by Ethan Lee
parent 86516bb284
commit e938bfdb57

View file

@ -88,28 +88,30 @@ mapclass::mapclass()
resetnames(); resetnames();
//Areamap starts at 100,100 and extends 20x20 //Areamap starts at 100,100 and extends 20x20
std::vector<std::string> tmap; const int tmap[] = {
tmap.push_back("1,2,2,2,2,2,2,2,0,3,0,0,0,4,4,4,4,4,4,4"); 1,2,2,2,2,2,2,2,0,3,0,0,0,4,4,4,4,4,4,4,
tmap.push_back("1,2,2,2,2,2,2,0,0,3,0,0,0,0,4,4,4,4,4,4"); 1,2,2,2,2,2,2,0,0,3,0,0,0,0,4,4,4,4,4,4,
tmap.push_back("0,1,0,0,2,0,0,0,0,3,0,0,0,0,4,4,4,4,4,4"); 0,1,0,0,2,0,0,0,0,3,0,0,0,0,4,4,4,4,4,4,
tmap.push_back("0,0,0,0,2,0,0,0,0,3,0,0,5,5,5,5,4,4,4,4"); 0,0,0,0,2,0,0,0,0,3,0,0,5,5,5,5,4,4,4,4,
tmap.push_back("0,0,2,2,2,0,0,0,0,3,11,11,5,5,5,5,0,0,0,0"); 0,0,2,2,2,0,0,0,0,3,11,11,5,5,5,5,0,0,0,0,
tmap.push_back("0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,0,0,0,0"); 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,0,0,0,0,
tmap.push_back("0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,0,0,0"); 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,0,0,0,
tmap.push_back("0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,5,5,0"); 0,0,0,0,0,0,0,0,0,3,5,5,5,5,5,5,5,5,5,0,
tmap.push_back("0,0,0,0,0,0,0,0,0,3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2,2,2,2,2,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,
fillareamap(tmap); };
areamap.clear();
areamap.insert(areamap.end(), tmap, tmap+400);
} }
int mapclass::RGB(int red,int green,int blue) int mapclass::RGB(int red,int green,int blue)