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

Function clip2d

Descent3/render.cpp:355–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353};
354
355static inline int clip2d(g3Point *pnt, clip_wnd *wnd) {
356 int ret = 0;
357 if (pnt->p3_codes & CC_BEHIND)
358 return CC_BEHIND;
359
360 if (pnt->p3_sx < wnd->left)
361 ret |= CC_OFF_LEFT;
362 if (pnt->p3_sx > wnd->right)
363 ret |= CC_OFF_RIGHT;
364 if (pnt->p3_sy < wnd->top)
365 ret |= CC_OFF_TOP;
366 if (pnt->p3_sy > wnd->bot)
367 ret |= CC_OFF_BOT;
368 return ret;
369}
370
371// Returns true if a line intersects another line
372static inline bool LineIntersectsLine(g3Point *ls, g3Point *le, float x1, float y1, float x2, float y2) {

Callers 4

MarkFacesForRenderingFunction · 0.85
BuildRoomListSubFunction · 0.85
BuildMirroredRoomListSubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected