diff --git a/README.md b/README.md index 77977c4..833599f 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,10 @@ sudo apt-get install libsdl2-dev ## Controls -### I/O +### General - `E` Export +- `H` Toggle Guides ### Select diff --git a/chr6 b/chr6 new file mode 100755 index 0000000..13ffa40 Binary files /dev/null and b/chr6 differ diff --git a/chr6.c b/chr6.c index 35a1aaf..252f04b 100644 --- a/chr6.c +++ b/chr6.c @@ -6,7 +6,8 @@ #define color1 0x000000 #define color2 0x72DEC2 #define color3 0xFFFFFF -#define color4 0x333333 +#define color4 0x444444 +#define color0 0x111111 typedef struct Point { int x; @@ -20,10 +21,11 @@ typedef struct Brush { } Brush; unsigned char buffer[4096]; -int colors[] = {color1, color2, color3, color4}; +int colors[] = {color1, color2, color3, color4, color0}; int WIDTH = 128 * ZOOM + PAD * 2; int HEIGHT = 128 * ZOOM + PAD * 2; int FPS = 30; +int GUIDES = 1; SDL_Window* gWindow = NULL; SDL_Renderer* gRenderer = NULL; SDL_Texture* gTexture = NULL; @@ -59,7 +61,7 @@ draw(uint32_t* dst, int id, int color) Point p; p.x = px + tx + (id % 8); p.y = ty + ((id % 64) / 8); - pixel(dst, p, colors[odd && color == 0 ? 3 : color]); + pixel(dst, p, colors[GUIDES && odd && color == 0 ? 4 : color]); } void @@ -194,6 +196,10 @@ keyhandler(SDL_Event* event, Brush* b) case SDLK_e: save(); break; + case SDLK_h: + GUIDES = !GUIDES; + redraw(); + break; case SDLK_1: b->color = 0; break;