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