diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-02-02 13:09:51 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-02-02 13:09:51 +0100 |
commit | 4b79b5c799a63d0402b71985c29b3af73f18e925 (patch) | |
tree | ced15807cbaef1a7243c1a7b94b9a28c8eec3275 | |
parent | cc4b0faf4f0efd9716021e24bb715a1231864edd (diff) | |
download | AsciiMap-4b79b5c799a63d0402b71985c29b3af73f18e925.tar.gz |
/╲/\╭( ͡°͡° ͜ʖ ͡°͡°)╮/\╱\
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | main.c | 9 |
2 files changed, 6 insertions, 5 deletions
@@ -29,4 +29,4 @@ clean: rm -Rdf $(BUILDDIR) run: build - @LD_LIBRARY_PATH=../lib/ $(BUILDDIR)/$(OUTPUT) b.bmp b.txt + @LD_LIBRARY_PATH=../lib/ $(BUILDDIR)/$(OUTPUT) a.bmp a.txt @@ -19,7 +19,7 @@ #define BI_CLR_USED 0x2e #define BI_CLR_IMPORTANT 0x32 -#define CHAR_SIZE_X 20 //How many pixels should form one ASCII char? +#define CHAR_SIZE_X 10 //How many pixels should form one ASCII char? #define CHAR_SIZE_Y (2 * CHAR_SIZE_X) const char map[] = {' ', '.', ',', '-', '~', ':', ';', '!', '/','?' , '%', '$', '#'}; @@ -167,12 +167,12 @@ int main(int argc, char *argv[]) for(int y = 0; y < size_y; y++) { char b = 0; - - + //Shit is seriously Fucked up around here + //(Brain)Cells at work for(int row = y * CHAR_SIZE_Y; row < (y + 1) * CHAR_SIZE_Y; row ++) { //x * CHAR_SIZE_X - char d[2] = {avg(CHAR_SIZE_X, ascii_buff[y]), b}; + char d[2] = {avg(CHAR_SIZE_X, bitmap_buff[row]), b}; b = avg(2, d); } ascii_buff[x][y] = calc_char(b); @@ -182,6 +182,7 @@ int main(int argc, char *argv[]) //Write Output printf("Opening %s for writing.\n", argv[2]); FILE *out = fopen(argv[2], "w"); + if(!out) { printf("Error opening output File. Check writing permissions.\n"); |