8 #pragma disable_warning 85
14 typedef uint_least16_t edge_index_t
;
25 #ifndef __SDCC_pdk14 // Lack of memory
26 struct edge_t edges
[4];
32 void get_edge(struct edge_t
*const e
, const edge_index_t e_i
)
36 void set_edge(const edge_index_t e_i
, const struct edge_t
*const e
)
38 memcpy(edges
+ e_i
, e
, sizeof(struct edge_t
));
41 const uint_fast8_t vertices
[4][2] = {{7, 188}, {248, 188}, {248, 9}, {7, 9}};
43 struct edge_t edge_cache
;
45 void init_geometry(void)
50 for(i
= 0; i
< 4; i
++)
52 get_edge(&edge_cache
, i
);
53 edge_cache
.u
[0] = vertices
[(i
+ 0) % 4][0];
54 edge_cache
.u
[1] = vertices
[(i
+ 0) % 4][1];
55 edge_cache
.v
[0] = vertices
[(i
+ 1) % 4][0];
56 edge_cache
.v
[1] = vertices
[(i
+ 1) % 4][1];
57 edge_cache
.prev
= (i
+ 3) % 4;
58 edge_cache
.next
= (i
+ 1) % 4;
59 set_edge(i
, &edge_cache
);
66 #ifndef __SDCC_pdk14 // Lack of memory
69 ASSERT(edges
[0].prev
= 3);
70 ASSERT(edges
[3].prev
= 2);