1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-18 10:38:31 +02:00

Draw minimap.png if it is mounted

This is a simple change - we draw minimap.png, instead of the generated
custom map, if it is a per-level mounted custom asset.

Custom levels have already been able to utilize minimap.png, but it was
limited - they could do gamemode(teleporter) in a script, and that would
show their customized minimap.png, but it's not like the player could
look at it during gameplay.

I would have done this earlier if I had figured out how to check if a
specific asset was mounted or not.
This commit is contained in:
Misa 2021-04-18 23:39:10 -07:00 committed by Ethan Lee
parent 186f36beea
commit 370e53f4d3
3 changed files with 13 additions and 1 deletions

View File

@ -149,6 +149,7 @@ void Graphics::init(void)
#ifndef NO_CUSTOM_LEVELS
tiles1_mounted = false;
tiles2_mounted = false;
minimap_mounted = false;
#endif
}
@ -3402,6 +3403,7 @@ void Graphics::reloadresources(void)
#ifndef NO_CUSTOM_LEVELS
tiles1_mounted = FILESYSTEM_isAssetMounted("graphics/tiles.png");
tiles2_mounted = FILESYSTEM_isAssetMounted("graphics/tiles2.png");
minimap_mounted = FILESYSTEM_isAssetMounted("graphics/minimap.png");
#endif
}

View File

@ -220,6 +220,7 @@ public:
#ifndef NO_CUSTOM_LEVELS
bool tiles1_mounted;
bool tiles2_mounted;
bool minimap_mounted;
#endif

View File

@ -1929,11 +1929,19 @@ void maprender(void)
}
graphics.Print(-1, 105, "NO SIGNAL", 245, 245, 245, true);
}
#ifndef NO_CUSTOM_LEVELS
else if(map.custommode)
{
//draw the map image
graphics.drawcustompixeltextbox(35+map.custommmxoff, 16+map.custommmyoff, map.custommmxsize+10, map.custommmysize+10, (map.custommmxsize+10)/8, (map.custommmysize+10)/8, 65, 185, 207,4,0);
graphics.drawpartimage(12, 40+map.custommmxoff, 21+map.custommmyoff, map.custommmxsize,map.custommmysize);
if (graphics.minimap_mounted)
{
graphics.drawpartimage(1, 40+map.custommmxoff, 21+map.custommmyoff, map.custommmxsize, map.custommmysize);
}
else
{
graphics.drawpartimage(12, 40+map.custommmxoff, 21+map.custommmyoff, map.custommmxsize,map.custommmysize);
}
//Black out here
if(map.customzoom==4){
@ -2038,6 +2046,7 @@ void maprender(void)
}
}
}
#endif /* NO_CUSTOM_LEVELS */
else
{
//draw the map image