Add middle() function for polygons in geometry util. Restructure stage mask overlays to be part of the stage mask polygon class. Reproduce sample using new class. Release Build 9572.
if(LoadingScreen::loading)ERR("WARNING! A stage mask overlay attempted to initialize itself before the stage finished! THIS IS NOT ALLOWED!");
if(LoadingScreen::loading)ERR("WARNING! A stage mask overlay attempted to initialize itself before the stage finished! THIS IS NOT ALLOWED!");
if(!game->MAP_DATA.at(game->GetCurrentMapName()).GetOptimizedMap())ERR(std::format("WARNING! No optimized map found for stage {} while trying to create a Stage Polygon! THIS IS NOT ALLOWED!",game->GetCurrentMapName()));
if(!game->MAP_DATA.at(game->GetCurrentMapName()).GetOptimizedMap())ERR(std::format("WARNING! No optimized map found for stage {} while trying to create a Stage Polygon! THIS IS NOT ALLOWED!",game->GetCurrentMapName()));
if(!GFX.count(texture))ERR(std::format("WARNING! Texture {} does not exist while trying to initialize Stage Mask Overlay!",texture));
overlayPolygon.pos.insert(overlayPolygon.pos.begin(),overlayPolygon.middle());//Insert the middle point to the front of the overlay polygon's point list.
//Copy the first point provided from the original polygon to the end of the new overlay polygon since we have to fully connect the polygon for the texture to show up correctly.
//The stage mask overlay auto-forms a UV mapping where the center is {0,0} and the edges are {1,1}. Use this to shape a texture with the desired outline you want.
geom2d::polygon<float>overlayPolygon;//The overlay polygon uses a middle point so that a texture can fade in towards the center.
geom2d::polygon<float>overlayUVs;
geom2d::polygon<float>overlayUVs;
PixeloverlayCol;
PixeloverlayCol;
//The entire overlay is replicated to also be at a smaller (or larger) blend scale size that interpolates from 1.0 on the outer edge towards 0.0 of the overlayCol to the blendScale.
//As an example, if blendScale is 0.6, then from 1.0 to 0.6x size of the shape from the outer edge the overlayCol will be lerped from 1.0 to 0.0 to the 0.6x size version of the shape.