Skip to content

Commit d9c0016

Browse files
Fix Triangles (Fix #114)
1 parent 1a45666 commit d9c0016

File tree

4 files changed

+205
-170
lines changed

4 files changed

+205
-170
lines changed

examples/gfx_shapes_shift/autotester.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@
99
},
1010
"sequence": [
1111
"action|launch",
12-
"delay|300",
13-
"hash|1",
12+
"hashWait|1",
1413
"key|enter",
15-
"delay|150",
16-
"hash|2",
14+
"hashWait|2",
1715
"key|enter",
18-
"delay|150",
19-
"hash|3",
16+
"hashWait|3",
2017
"key|enter",
21-
"delay|150",
22-
"hash|4",
18+
"hashWait|4",
2319
"key|enter",
24-
"delay|300",
25-
"hashWait|5"
20+
"hashWait|5",
21+
"key|enter",
22+
"hashWait|6"
2623
],
2724
"hashes": {
2825
"1": {
@@ -50,6 +47,12 @@
5047
"expected_CRCs": [ "F2BD5102" ]
5148
},
5249
"5": {
50+
"description": "The screen displays many different triangles",
51+
"start": "vram_start",
52+
"size": "vram_8_size",
53+
"expected_CRCs": [ "CDE95095" ]
54+
},
55+
"6": {
5356
"description": "Back to the home screen (exit check)",
5457
"start": "vram_start",
5558
"size": "vram_16_size",

examples/gfx_shapes_shift/src/main.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ void main(void) {
8989
/* Wait for any key */
9090
while (!os_GetCSC());
9191

92+
gfx_FillScreen(gfx_white);
93+
94+
/* Test triangle drawing */
95+
gfx_SetColor(gfx_blue);
96+
gfx_FillTriangle(110, 170, 110, 70, 230, 70);
97+
gfx_SetColor(gfx_green);
98+
gfx_FillTriangle_NoClip(110, 170, 230, 70, 230, 170);
99+
gfx_SetColor(gfx_black);
100+
gfx_FillTriangle(110, 170, 200, 200, 230, 200);
101+
gfx_FillTriangle_NoClip(140, 40, 110, 40, 230, 70);
102+
gfx_FillTriangle(1, 1, 318, 1, 1, 1);
103+
gfx_FillTriangle_NoClip(1, 238, 1, 238, 318, 238);
104+
gfx_FillTriangle(1, 3, 1, 236, 1, 236);
105+
gfx_FillTriangle_NoClip(318, 3, 318, 236, 318, 3);
106+
107+
/* Wait for any key */
108+
while (!os_GetCSC());
109+
92110
/* Close the graphics */
93111
gfx_End();
94112
}

0 commit comments

Comments
 (0)