Browse Source

Added guide toggle option

main
Devine Lu Linvega 6 years ago
parent
commit
572a11b9fd
  1. 3
      README.md
  2. BIN
      chr6
  3. 12
      chr6.c

3
README.md

@ -12,9 +12,10 @@ sudo apt-get install libsdl2-dev
## Controls
### I/O
### General
- `E` Export
- `H` Toggle Guides
### Select

BIN
chr6

Binary file not shown.

12
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;

Loading…
Cancel
Save