MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / RenderWireFrame

Function RenderWireFrame

editor/jaytest.cpp:176–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void RenderWireFrame(grViewport *my_viewport) {
177 int nv = 4;
178 g3s_point phold[10], dhold[10];
179 g3s_point *plist = phold, *dlist = dhold;
180 static float sx = 0, sy = 0, sz = 20;
181 static float xdir = .4;
182 static float ydir = .3;
183 static float zdir = .6;
184
185 if (Square == NULL)
186 if ((Square = AllocateObject()) == NULL)
187 return;
188
189 PositionObject(Square, sx, sy, sz);
190 sx = sx + xdir;
191 sy = sy + ydir;
192 sz = sz + zdir;
193 if (sx > 10 || sx < -10)
194 xdir = -xdir;
195 if (sy > 10 || sy < -10)
196 ydir = -ydir;
197 if (sz > 50 || sz < 5)
198 zdir = -zdir;
199
200 g3_BeginFrame();
201 g3_TransVertsToCamera(plist, square_data, Square, 4);
202 nv = g3_CheckToClip(&plist, &dlist, 4);
203
204 Square->cur_pos.orientation_angles.heading += GAME_ANGLE * 2;
205 Square->cur_pos.orientation_angles.pitch += GAME_ANGLE * 2;
206
207 if (nv > 0) {
208 g3_ProjectPointListToCanvas(dlist, nv);
209 Current_surface = my_viewport->lock();
210 DrawWireframeList(my_viewport, dlist, nv, GR_RGB(255, 0, 255));
211 my_viewport->unlock();
212 }
213}

Callers

nothing calls this directly

Calls 4

DrawWireframeListFunction · 0.85
GR_RGBFunction · 0.50
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected