summaryrefslogtreecommitdiff
path: root/src/scene01.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scene01.c')
-rw-r--r--src/scene01.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/scene01.c b/src/scene01.c
new file mode 100644
index 0000000..2b3e9f5
--- /dev/null
+++ b/src/scene01.c
@@ -0,0 +1,49 @@
+/*
+ * demoscene-eo, an ASCII art demoscene written as a gift for Emmanuel Otton retirement
+ * Copyright (C) 2019 XXXXXX XXXXXXX <xxxxxx@xxxxxx.fr>
+ *
+ * This file is part of demoscene-eo.
+ *
+ * demoscene-eo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * demoscene-eo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with demoscene-eo. If not, see <http://www.gnu.org/licenses/>
+ */
+#include "scene01.h"
+
+int scene01_init(graphical_env_t *ge, scene01_env_t *se) {
+ return 0;
+}
+
+void scene01_free(graphical_env_t *ge, scene01_env_t *se) {
+}
+
+int scene01_next(graphical_env_t *ge, scene01_env_t *se) {
+ // Shorthands
+ caca_canvas_t *cv = ge->cv;
+ int w = ge->w, h = ge->h;
+ Uint32 frame = ge->sc_framecount;
+
+ //XXX remove me
+ ((Uint32 *)ge->raw_target)[frame%(256*256)]=frame<<((frame%3)*8);
+
+ caca_clear_canvas(cv);
+ caca_set_dither_gamma(ge->d, (100-frame%100)/100.0);
+ caca_dither_bitmap(cv, 0, 0, w, h, ge->d, ge->raw_target);
+
+ caca_set_color_ansi(cv, CACA_WHITE, CACA_BLACK);
+ caca_put_str(cv, (w-17)/2, h/2, "This is a message");
+
+ if ( frame >= 300 ) {
+ return 1;
+ }
+ return 0;
+}