Browse Source

Working images / ansi-to-src :D

Steve Thielemann 4 years ago
parent
commit
4e20fb8a79
3 changed files with 16 additions and 3 deletions
  1. 2 2
      ansi-to-src.cpp
  2. 4 1
      build_images.sh
  3. 10 0
      images.cpp

+ 2 - 2
ansi-to-src.cpp

@@ -59,13 +59,13 @@ char *repr(const char *data) {
     }
 
     if (c == '\\') {
-      memmove(cp, cp + 1, strlen(cp) + 1);
+      memmove(cp + 1, cp, strlen(cp) + 1);
       *cp = '\\';
       cp += 2;
       continue;
     }
     if (c == '"') {
-      memmove(cp, cp + 1, strlen(cp) + 1);
+      memmove(cp + 1, cp, strlen(cp) + 1);
       *cp = '\\';
       cp += 2;
       continue;

+ 4 - 1
build_images.sh

@@ -2,9 +2,12 @@
 
 ./ansi-to-src skull.ans > images.h
 ./ansi-to-src skull-blink.ans >> images.h
-# ./ansi-to-src bat.ans >> images.h
 ./ansi-to-src ghead.ans >> images.h
 ./ansi-to-src ghost.ans >> images.h
 ./ansi-to-src wolf.ans >> images.h
 ./ansi-to-src panther.ans >> images.h
 
+./ansi-to-src bat.ans >> images.h
+
+# ./ansi-to-src bat.ans > bat.h
+

+ 10 - 0
images.cpp

@@ -87,5 +87,15 @@ int main() {
   getchar();
   printf("\n\n");
 
+  size = (sizeof(bat) / sizeof(char *));
+  for (x = 0; x < size; x++) {
+    display_line(bat[x]);
+  }
+
+  fflush(stdout);
+  getchar();
+  printf("\n\n");
+
+
   return 0;
 }