Implement error-handling (file names and locations) via std::source_location and added CRT debugging memory leak detection.
This commit is contained in:
@@ -16,7 +16,9 @@ State_OverworldMap::State_OverworldMap(){
|
||||
SetStageMarker("Stage I-I"); //Eventually we will load the game from a file and this will not be necessary. We just set it to this for now.
|
||||
}
|
||||
void State_OverworldMap::OnStateChange(GameState*prevState){
|
||||
Menu::CloseAllMenus();
|
||||
if(Menu::IsMenuOpen()){
|
||||
Menu::CloseAllMenus();
|
||||
}
|
||||
game->GetPlayer()->SetPos(currentConnectionPoint->rect.pos+currentConnectionPoint->rect.size/2+vf2d{0,16});
|
||||
playerTargetPos=currentConnectionPoint->rect.pos+currentConnectionPoint->rect.size/2+vf2d{0,16};
|
||||
game->GetPlayer()->UpdateWalkingAnimation(DOWN);
|
||||
@@ -78,28 +80,28 @@ void State_OverworldMap::Draw(Crawler*game){
|
||||
vf2d pos=cp.rect.pos+vf2d{0,cp.rect.size.y-borderThickness}+vf2d{-pulsatingAmt.x,pulsatingAmt.y};
|
||||
vf2d size={borderThickness+crosshairExtension.x,borderThickness};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
pos={pos.x,pos.y-crosshairExtension.y}+vf2d{-pulsatingAmt.x,pulsatingAmt.y};
|
||||
pos=vf2d{pos.x,pos.y-crosshairExtension.y}+vf2d{-pulsatingAmt.x,pulsatingAmt.y};
|
||||
size={borderThickness,crosshairExtension.y};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
//Lower-Right Corner
|
||||
pos=cp.rect.pos+vf2d{cp.rect.size.x-borderThickness-crosshairExtension.x,cp.rect.size.y-borderThickness}+vf2d{pulsatingAmt.x,pulsatingAmt.y};
|
||||
size={borderThickness+crosshairExtension.x,borderThickness};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
pos={pos.x+crosshairExtension.x,pos.y-crosshairExtension.y}+vf2d{pulsatingAmt.x,pulsatingAmt.y};
|
||||
pos=vf2d{pos.x+crosshairExtension.x,pos.y-crosshairExtension.y}+vf2d{pulsatingAmt.x,pulsatingAmt.y};
|
||||
size={borderThickness,crosshairExtension.y};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
//Upper-Left Corner
|
||||
pos=cp.rect.pos+vf2d{0,0}+vf2d{-pulsatingAmt.x,-pulsatingAmt.y};
|
||||
size={borderThickness+crosshairExtension.x,borderThickness};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
pos={pos.x,pos.y+borderThickness}+vf2d{-pulsatingAmt.x,-pulsatingAmt.y};
|
||||
pos=vf2d{pos.x,pos.y+borderThickness}+vf2d{-pulsatingAmt.x,-pulsatingAmt.y};
|
||||
size={borderThickness,crosshairExtension.y};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
//Upper-Right Corner
|
||||
pos=cp.rect.pos+vf2d{cp.rect.size.x-borderThickness-crosshairExtension.x,0}+vf2d{pulsatingAmt.x,-pulsatingAmt.y};
|
||||
size={borderThickness+crosshairExtension.x,borderThickness};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
pos={pos.x+crosshairExtension.x,pos.y+borderThickness}+vf2d{pulsatingAmt.x,-pulsatingAmt.y};
|
||||
pos=vf2d{pos.x+crosshairExtension.x,pos.y+borderThickness}+vf2d{pulsatingAmt.x,-pulsatingAmt.y};
|
||||
size={borderThickness,crosshairExtension.y};
|
||||
game->view.FillRectDecal(pos,size,RED);
|
||||
break;
|
||||
@@ -113,8 +115,7 @@ void State_OverworldMap::SetStageMarker(std::string connectionName){
|
||||
return;
|
||||
}
|
||||
}
|
||||
std::cout<<"WARNING! Could not find a connection point with name "<<connectionName<<"!"<<std::endl;
|
||||
throw;
|
||||
ERR("WARNING! Could not find a connection point with name "<<connectionName<<"!");
|
||||
}
|
||||
|
||||
ConnectionPoint&State_OverworldMap::ConnectionPointFromIndex(int ind){
|
||||
|
||||
Reference in New Issue
Block a user