I'm trying to figure out how I can avoid having to embed the pic number in the method for setting up the default room polygons and create new named polygons. Since I want to also support including multiple polygon header files in one room, and without embedding the pic number in the procedures, there would be name conflicts.
Here's an alternative proposal:
SetUpPolygons and CreateNewPolygon become global functions in main. Instead of taking a define that identifies the polygon, they take the address of a local variable from the script. The local variable would be an array of values that consist of: the number of polygons associated with that variable, followed by the following for each polygon: type, number of points, x/y for each point.
So the *.shp file might look like:
(local
P_110[???] = (2 PBarredAccess 3 212 68 45 67 47 88 PBarredAccess 5 12 68 269 68 286 85 267 101 225 101)
)
P_SomeName[8] = (1 PBarredAccess 3 212 68 45 67 47 88)
)
Then in the room's init, you'd have:
AddPolysToRoom(@P_110)
and to create polygons dynamically (for path motions, or to add around new features that appear after room init:
(send gRoom:addObstacle(CreateNewPolygon(@P_SomeName)))
I'm trying to make this as easy as possible to code against, while still being flexible enough to accomplish any task.
Thoughts?