So I am in the middle of writing support for moving lines in an engine I'm authoring based on the DOOM code.
While cross compiling, I get a few errors, all related:
src/p_poly.cc: In function 'void PO_SpawnPolyobj(float, float, int, int)':
src/p_poly.cc:643:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (segs[i].linedef->special == PO_LINE_START &&
^
src/p_poly.cc:688:35: error: expected ')' before 'PO_LINE_START'
if (segs[i].linedef->special PO_LINE_START &&
^
src/p_poly.cc:716:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if(segs[i].linedef->special == PO_LINE_EXPLICIT &&
^
src/p_poly.cc:732:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (segs[i].linedef->special == PO_LINE_EXPLICIT &&
^
make: *** [obj_win32/edge/p_poly.o] Error 1
So basically, I'm getting an error with the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
...
polyobjs[index].startSpot.x = x;
polyobjs[index].startSpot.y = y;
for (i = 0; i < numsegs; i++)
{
if (!segs[i].linedef)
continue;
// Next line results in a compile error
if (segs[i].linedef->special == PO_LINE_START &&
segs[i].linedef->arg1 == tag)
{
if (polyobjs[index].segs)
{
// Immpossible, because it is just cleared out
I_Error("PO_SpawnPolyobj: Polyobj %d already spawned.\n", tag);
}
...
All "errors" are of that type (defined 3 times in the source file).
At the top of the source file, I have the following:
I'm not sure why it's failing here, any advice is greatly appreciated =) It's causing me to pull my hair out! Basically it needs to know that if a linedef special is marked as PO_LINE_START or PO_LINE_EXPLICIT, that it is free to "spawn" the object. If I comment those lines out, the code compiles, but the engine will not spawn because there is no explicit special for PO_LINE_x defined.