Code: Select all
; Compartments for the SNB:
structure SNbits
SNID.q
SNbitflags.a
SNptr.q
endstructure
newlist SNB.SNbits()
enumerationbinary SNbitflags
#IsWater
#SNType
#IsPathNode
#IsParcelPoint
endenumeration
; Routines for the SNB
; GetSurfaceNodeBits() retrieves the set of bitflags from the SN assigned to the ID
; The parameter is the SurfaceNode index (SNID)
procedure GetSurfaceNodeBits(dummy)
; go thru the SNB and look for the matching SNID in the first element of each line's structure
while NextElement(SNB())
if SNB()\SNID = dummy
; if we're at the right line, the value is the single-byte set of bitflags for
; that ID
return SNB()\SNbitflags
break
endif
wend
; no entry was found -- return what will be processed as an error
return -1
endprocedure
