summaryrefslogtreecommitdiff
path: root/frontends/calculator/CEdev/examples/gfx_light_dark/src
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2019-04-13 12:40:52 -0400
committerAndrew Opalach <andrew@akon.city> 2019-04-13 12:40:52 -0400
commit55bfff7cf6541caac172b43186cf14405185b14d (patch)
treec1ae99d2b39f8df8933d81ec2e61e81050bdb410 /frontends/calculator/CEdev/examples/gfx_light_dark/src
parent761462861fc1228e65546c4e0f877d5212320082 (diff)
downloadcetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.gz
cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.bz2
cetris-55bfff7cf6541caac172b43186cf14405185b14d.zip
fix curses on linux
Diffstat (limited to 'frontends/calculator/CEdev/examples/gfx_light_dark/src')
-rw-r--r--frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c118
1 files changed, 59 insertions, 59 deletions
diff --git a/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c b/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c
index d4c0a06..4f2e4d1 100644
--- a/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c
+++ b/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c
@@ -1,59 +1,59 @@
-#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>
-
-#define color gfx_RGBTo1555(34, 55, 89)
-
-void main(void) {
- uint8_t i = 0;
-
- /* Initialize the 8bpp graphics */
- gfx_Begin();
-
- /* For i in 0..255 */
- do {
-
- /* Fade out to black */
- gfx_palette[0] = gfx_Darken(color, i);
- /* Fade in from black */
- gfx_palette[1] = gfx_Darken(color, ~i);
- /* Fade in from white */
- gfx_palette[3] = gfx_Lighten(color, ~i);
- /* Fade out to white */
- gfx_palette[2] = gfx_Lighten(color, i);
-
- /* Fade out to black */
- gfx_SetColor(0);
- gfx_FillRectangle_NoClip(0, 0, 160, 120);
- /* Fade in from black */
- gfx_SetColor(1);
- gfx_FillRectangle_NoClip(160, 0, 160, 120);
- /* Fade in from white */
- gfx_SetColor(2);
- gfx_FillRectangle_NoClip(0, 120, 160, 120);
- /* Fade out to white */
- gfx_SetColor(3);
- gfx_FillRectangle_NoClip(160, 120, 160, 120);
-
- /* Wait for a keypress at the start of each quarter of the fade */
- if (!(i & 0x3f)) {
- while (!os_GetCSC());
- }
-
- /* Loop until i is 0 again because of 8 bit range */
- } while (++i);
-
- /* Wait for a keypress */
- while (!os_GetCSC());
-
- /* Usual cleanup */
- 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>
+
+#define color gfx_RGBTo1555(34, 55, 89)
+
+void main(void) {
+ uint8_t i = 0;
+
+ /* Initialize the 8bpp graphics */
+ gfx_Begin();
+
+ /* For i in 0..255 */
+ do {
+
+ /* Fade out to black */
+ gfx_palette[0] = gfx_Darken(color, i);
+ /* Fade in from black */
+ gfx_palette[1] = gfx_Darken(color, ~i);
+ /* Fade in from white */
+ gfx_palette[3] = gfx_Lighten(color, ~i);
+ /* Fade out to white */
+ gfx_palette[2] = gfx_Lighten(color, i);
+
+ /* Fade out to black */
+ gfx_SetColor(0);
+ gfx_FillRectangle_NoClip(0, 0, 160, 120);
+ /* Fade in from black */
+ gfx_SetColor(1);
+ gfx_FillRectangle_NoClip(160, 0, 160, 120);
+ /* Fade in from white */
+ gfx_SetColor(2);
+ gfx_FillRectangle_NoClip(0, 120, 160, 120);
+ /* Fade out to white */
+ gfx_SetColor(3);
+ gfx_FillRectangle_NoClip(160, 120, 160, 120);
+
+ /* Wait for a keypress at the start of each quarter of the fade */
+ if (!(i & 0x3f)) {
+ while (!os_GetCSC());
+ }
+
+ /* Loop until i is 0 again because of 8 bit range */
+ } while (++i);
+
+ /* Wait for a keypress */
+ while (!os_GetCSC());
+
+ /* Usual cleanup */
+ gfx_End();
+}