MCPcopy Create free account
hub / github.com/bernhardstrobl/Pico3D / compute_code

Function compute_code

engine/render_triangle.cpp:10–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#define CODE_TOP 8
9
10uint8_t compute_code (int32_t x, int32_t y) {
11 uint8_t code = CODE_INSIDE;
12
13 if (x < 0) {
14 code |= CODE_LEFT;
15 } else if (x > SCREEN_WIDTH) {
16 code |= CODE_RIGHT;
17 } else if (y < 0) {
18 code |= CODE_BOTTOM;
19 } else if (y > SCREEN_HEIGHT) {
20 code |= CODE_TOP;
21 }
22
23 return code;
24}
25
26
27void render_triangle(struct triangle_32 &in) {

Callers 1

render_triangleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected