2021-05-02 22:04:36 +00:00
# pragma once
# include "build.h"
struct SectionLine
{
2021-12-05 20:18:55 +00:00
int section ;
int partnersection ;
int startpoint ;
int endpoint ;
int wall ;
int partner ;
int point2index ;
2021-12-15 10:07:46 +00:00
vec2_t v1 ( ) const { return : : wall [ startpoint ] . pos ; }
vec2_t v2 ( ) const { return : : wall [ endpoint ] . pos ; }
walltype * wallp ( ) const { return & : : wall [ wall ] ; }
SectionLine * partnerLine ( ) const ;
2021-05-02 22:04:36 +00:00
} ;
2021-12-15 10:07:46 +00:00
extern TArray < SectionLine > sectionLines ;
inline SectionLine * SectionLine : : partnerLine ( ) const
{
return partner = = - 1 ? nullptr : & sectionLines [ partner ] ;
}
2021-05-02 22:04:36 +00:00
struct Section
{
int sector ;
// this is the whole point of sections - instead of just having a start index and count, we have an explicit list of lines that's a lot easier to change when needed.
2021-12-05 20:26:34 +00:00
TArray < int > lines ;
2021-05-02 22:04:36 +00:00
} ;
2021-12-06 19:08:32 +00:00
extern TArray < Section > Sections ;
2021-12-06 19:54:21 +00:00
extern TArray < TArray < int > > sectionspersector ; // reverse map, mainly for the automap
2021-05-02 22:04:36 +00:00
void hw_BuildSections ( ) ;
2021-05-03 15:48:35 +00:00
void hw_SetSplitSector ( int sector , int startpos , int endpos ) ;
2021-05-23 15:06:47 +00:00
void hw_ClearSplitSector ( ) ;