diff options
| author | 2019-04-13 12:40:52 -0400 | |
|---|---|---|
| committer | 2019-04-13 12:40:52 -0400 | |
| commit | 55bfff7cf6541caac172b43186cf14405185b14d (patch) | |
| tree | c1ae99d2b39f8df8933d81ec2e61e81050bdb410 /frontends/calculator/CEdev/examples/gfx_floodfill/src | |
| parent | 761462861fc1228e65546c4e0f877d5212320082 (diff) | |
| download | cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.gz cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.bz2 cetris-55bfff7cf6541caac172b43186cf14405185b14d.zip | |
fix curses on linux
Diffstat (limited to 'frontends/calculator/CEdev/examples/gfx_floodfill/src')
| -rw-r--r-- | frontends/calculator/CEdev/examples/gfx_floodfill/src/main.c | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/frontends/calculator/CEdev/examples/gfx_floodfill/src/main.c b/frontends/calculator/CEdev/examples/gfx_floodfill/src/main.c index 31a2090..a282527 100644 --- a/frontends/calculator/CEdev/examples/gfx_floodfill/src/main.c +++ b/frontends/calculator/CEdev/examples/gfx_floodfill/src/main.c @@ -1,50 +1,50 @@ -#include <stdbool.h> -#include <stddef.h> -#include <stdint.h> -#include <tice.h> - -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <graphx.h> - -void main(void) { - int pts[10], i; - - int rx = 100; - int ry = 100; - int cx = LCD_WIDTH / 2; - int cy = LCD_HEIGHT / 2; - - /* Build the coordinates of the polygon */ - double theta = -M_PI / 2; - double dtheta = 4 * M_PI / 5; - for (i = 0; i < 10; i += 2) { - pts[i+0] = (int)(cx + rx * cos(theta)), - pts[i+1] = (int)(cy + ry * sin(theta)); - theta += dtheta; - } - - /* Initialize the 8bpp graphics */ - gfx_Begin(); - - /* Set up the palette */ - gfx_SetColor(gfx_black); - - /* Draw a polygon on the buffer */ - gfx_Polygon(pts, 5); - - /* Pause */ - while (!os_GetCSC()); - - /* Flood fill the rest of the screen */ - gfx_FloodFill(0, 0, 0); - - /* Pause */ - while (!os_GetCSC()); - - /* Close the graphics */ - gfx_End(); -} +#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <tice.h>
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <graphx.h>
+
+void main(void) {
+ int pts[10], i;
+
+ int rx = 100;
+ int ry = 100;
+ int cx = LCD_WIDTH / 2;
+ int cy = LCD_HEIGHT / 2;
+
+ /* Build the coordinates of the polygon */
+ double theta = -M_PI / 2;
+ double dtheta = 4 * M_PI / 5;
+ for (i = 0; i < 10; i += 2) {
+ pts[i+0] = (int)(cx + rx * cos(theta)),
+ pts[i+1] = (int)(cy + ry * sin(theta));
+ theta += dtheta;
+ }
+
+ /* Initialize the 8bpp graphics */
+ gfx_Begin();
+
+ /* Set up the palette */
+ gfx_SetColor(gfx_black);
+
+ /* Draw a polygon on the buffer */
+ gfx_Polygon(pts, 5);
+
+ /* Pause */
+ while (!os_GetCSC());
+
+ /* Flood fill the rest of the screen */
+ gfx_FloodFill(0, 0, 0);
+
+ /* Pause */
+ while (!os_GetCSC());
+
+ /* Close the graphics */
+ gfx_End();
+}
|