Implemented centroid and signed_area functions to the geom2d util. Just a bunch of maths, I don't know why it works. Release Build 9683.

This commit is contained in:
2024-06-20 18:01:44 -05:00
parent 8699f1b808
commit a82d06940d
11 changed files with 139 additions and 22 deletions
+16
View File
@@ -46,6 +46,7 @@ All rights reserved.
#include "MenuComponent.h"
#include "Unlock.h"
#include "Tutorial.h"
#include "StageMaskPolygon.h"
INCLUDE_MONSTER_LIST
INCLUDE_game
@@ -87,6 +88,21 @@ void State_GameRun::OnUserUpdate(AiL*game){
}
void State_GameRun::Draw(AiL*game){
game->RenderWorld(game->GetElapsedTime());
if(game->GetCurrentMapData().provideOptimization&&!LoadingScreen::loading){
StageMaskPolygon poly{
{
game->view.ScreenToWorld(game->GetMousePos()-vf2d{50,50}),
game->view.ScreenToWorld(game->GetMousePos()+vf2d{100,-20}),
game->view.ScreenToWorld(game->GetMousePos()+vf2d{200,200}),
game->view.ScreenToWorld(game->GetMousePos()+vf2d{-50,150}),
game->view.ScreenToWorld(game->GetMousePos()+vf2d{-120,90}),
},"safeIndicatorGradient.png",PixelLerp(VERY_DARK_BLUE,BLACK,sin(geom2d::pi*game->GetRunTime()*2))
};
poly.Draw();
}
game->RenderHud();
Tutorial::Draw();
}