Checks to see if we should render objects and also sets which order the objects should be rendered in
| 2181 | // Checks to see if we should render objects and also sets which order the objects |
| 2182 | // should be rendered in |
| 2183 | void SortTerrainObjectsForRendering(int cellcount) { |
| 2184 | int i, segnum; |
| 2185 | object *obj; |
| 2186 | #if (!defined(RELEASE) || defined(NEWEDITOR)) |
| 2187 | for (i = 0; i < cellcount; i++) |
| 2188 | Terrain_seg_render_objs[Terrain_list[i].segment] = -1; |
| 2189 | #endif |
| 2190 | |
| 2191 | // Go through each object and do trivial rejection |
| 2192 | for (i = 0; i <= Highest_object_index; i++) { |
| 2193 | #if (!defined(RELEASE) || defined(NEWEDITOR)) |
| 2194 | render_next[i] = -1; |
| 2195 | #endif |
| 2196 | obj = &Objects[i]; |
| 2197 | if (obj->type == OBJ_NONE) |
| 2198 | continue; |
| 2199 | if (obj->render_type == RT_NONE) |
| 2200 | continue; |
| 2201 | if (!OBJECT_OUTSIDE(obj)) |
| 2202 | continue; |
| 2203 | // Ok, we know that we can see this point. If its segment is in our list |
| 2204 | // then make this object draw right after this segment is drawn. Otherwise |
| 2205 | // just draw it |
| 2206 | segnum = CELLNUM(obj->roomnum); |
| 2207 | ASSERT(segnum >= 0 && segnum <= (TERRAIN_WIDTH * TERRAIN_DEPTH)); |
| 2208 | if (Terrain_rotate_list[segnum] == TS_FrameCount) { |
| 2209 | AddRenderObjectToTerrainSeg(segnum, i); |
| 2210 | } else |
| 2211 | AddRenderObjectToTerrainSeg(Terrain_list[cellcount - 1].segment, i); |
| 2212 | } |
| 2213 | } |
| 2214 | #if (defined(EDITOR) || defined(NEWEDITOR)) |
| 2215 | #define CROSS_WIDTH 8.0 |
| 2216 | #define CROSS_HEIGHT 8.0 |
no test coverage detected