Browse Source

Pixel picking

main
Devine Lu Linvega 6 years ago
parent
commit
7c4979ecd4
  1. 9
      nasu6.c
  2. BIN
      sprite.chr

9
nasu6.c

@ -28,6 +28,7 @@ typedef struct Brush {
static int SCREEN_WIDTH = 512 + PAD * 2;
static int SCREEN_HEIGHT = 512 + PAD * 2;
static int FPS = 30;
unsigned char tilelt[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
unsigned char buffer[1024 * 4];
int ZOOM = 4;
@ -129,12 +130,12 @@ write(int tx, int ty, int px, int py)
{
int id = tx + ty * 16;
int pid = px + py * 8;
int pix = id * 16;
pix += py;
int row = id * 16 + py;
printf("#%d [%d:%d](%d,%d)\n", id, tx, ty, px, py);
buffer[row] |= tilelt[px];
printf("#%d [%d:%d](%d,%d) = %d\n", id, tx, ty, px, py, buffer[row]);
buffer[pix] = 0xFF;
update();
}

BIN
sprite.chr

Binary file not shown.
Loading…
Cancel
Save