mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Scan for trinkets and put them into shinytrinkets in customs
For showtrinkets() to work, we'll need the correct map data in custom levels.
This commit is contained in:
@@ -397,6 +397,15 @@ std::string mapclass::getglitchname(int x, int y)
|
||||
|
||||
void mapclass::initmapdata()
|
||||
{
|
||||
if (custommode)
|
||||
{
|
||||
initcustommapdata();
|
||||
return;
|
||||
}
|
||||
|
||||
teleporters.clear();
|
||||
shinytrinkets.clear();
|
||||
|
||||
//Set up static map information like teleporters and shiny trinkets.
|
||||
setteleporter(0, 0);
|
||||
setteleporter(0, 16);
|
||||
@@ -436,6 +445,27 @@ void mapclass::initmapdata()
|
||||
settrinket(10, 8);
|
||||
}
|
||||
|
||||
void mapclass::initcustommapdata()
|
||||
{
|
||||
shinytrinkets.clear();
|
||||
|
||||
#if !defined(NO_CUSTOM_LEVELS)
|
||||
for (size_t i = 0; i < edentity.size(); i++)
|
||||
{
|
||||
const edentities& ent = edentity[i];
|
||||
if (ent.t != 9)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const int rx = ent.x / 40;
|
||||
const int ry = ent.y / 30;
|
||||
|
||||
settrinket(rx, ry);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int mapclass::finalat(int x, int y)
|
||||
{
|
||||
//return the tile index of the final stretch tiles offset by the colour difference
|
||||
|
||||
Reference in New Issue
Block a user