83 |
|
|
84 |
|
|
85 |
|
int |
86 |
< |
gmDrawGeom(clearports) /* draw current list of octrees (and ports) */ |
87 |
< |
int clearports; |
86 |
> |
gmDrawGeom() /* draw current list of octrees (and ports) */ |
87 |
|
{ |
88 |
|
register int n; |
89 |
|
|
90 |
|
FORALLGEOM(gmCurrent, n) |
91 |
|
glCallList(gmCurrent[n].listid); |
92 |
< |
if (!n | !clearports | !gmPortals) |
93 |
< |
return(n); |
94 |
< |
/* mark alpha channel over the portals */ |
95 |
< |
glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); |
92 |
> |
return(n); |
93 |
> |
} |
94 |
> |
|
95 |
> |
|
96 |
> |
gmDrawPortals(r, g, b, a) /* draw portals with specific RGBA value */ |
97 |
> |
int r, g, b, a; |
98 |
> |
{ |
99 |
> |
if (!gmPortals || r<0 & g<0 & b<0 & a<0) |
100 |
> |
return; |
101 |
> |
glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT| |
102 |
> |
GL_POLYGON_BIT|GL_LIGHTING_BIT); |
103 |
> |
glDisable(GL_LIGHTING); |
104 |
> |
glDisable(GL_DITHER); |
105 |
> |
glShadeModel(GL_FLAT); |
106 |
> |
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); |
107 |
> |
/* don't actually write depth */ |
108 |
|
glDepthMask(GL_FALSE); |
109 |
< |
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); |
110 |
< |
glClear(GL_COLOR_BUFFER_BIT); |
111 |
< |
glColor4ub(0, 0, 0, 0xff); /* write alpha buffer as mask */ |
109 |
> |
/* draw only selected channels */ |
110 |
> |
glColorMask(r>=0, g>=0, b>=0, a>=0); |
111 |
> |
glColor4ub(r&0xff, g&0xff, b&0xff, a&0xff); |
112 |
|
glCallList(gmPortals); /* draw them portals */ |
113 |
|
glPopAttrib(); |
103 |
– |
return(n); |
114 |
|
} |
115 |
|
|
116 |
|
|