document shapes array
[netris.git] / board.c
diff --git a/board.c b/board.c
index 3ff3cb6c18826ba7f4919e58982f9b7599b25f29..538a0dfe406f1d4aec0ceee05596dd18705d08de 100644 (file)
--- a/board.c
+++ b/board.c
 #include "board.h"
 
 static const char shapes[7][4][4][4] = {
+       /*
+        * 4 rotations of 4x4 pixels per shape
+        * high nibble signifies joinage (left, right, top, bottom, from MSB)
+        * low nibble identifies block type (typically 2..8)
+        */
+
        { { {0x00, 0x00, 0x00, 0x00}, {0x47, 0xC7, 0x97, 0x00},
            {0x00, 0x00, 0x27, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //sharp horizontal
          { {0x00, 0x17, 0x00, 0x00}, {0x00, 0x37, 0x00, 0x00},
@@ -51,18 +57,18 @@ static const char shapes[7][4][4][4] = {
            {0x00, 0x28, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} } }, //T (white)
 
        { { {0x00, 0x00, 0x00, 0x00}, {0x00, 0x52, 0x82, 0x00},
-           {0x42, 0xA2, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} },
+           {0x42, 0xA2, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //lieing
          { {0x12, 0x00, 0x00, 0x00}, {0x62, 0x92, 0x00, 0x00},
-           {0x00, 0x22, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} },
+           {0x00, 0x22, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //standing
          { {0x00, 0x00, 0x00, 0x00}, {0x00, 0x52, 0x82, 0x00},
            {0x42, 0xA2, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //rep
          { {0x12, 0x00, 0x00, 0x00}, {0x62, 0x92, 0x00, 0x00},
            {0x00, 0x22, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} } }, //S (green)
 
        { { {0x00, 0x00, 0x00, 0x00}, {0x46, 0x96, 0x00, 0x00},
-           {0x00, 0x66, 0x86, 0x00}, {0x00, 0x00, 0x00, 0x00} },
+           {0x00, 0x66, 0x86, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //lieing
          { {0x00, 0x16, 0x00, 0x00}, {0x56, 0xA6, 0x00, 0x00},
-           {0x26, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} },
+           {0x26, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //standing
          { {0x00, 0x00, 0x00, 0x00}, {0x46, 0x96, 0x00, 0x00},
            {0x00, 0x66, 0x86, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //rep
          { {0x00, 0x16, 0x00, 0x00}, {0x56, 0xA6, 0x00, 0x00},
@@ -75,7 +81,7 @@ static const char shapes[7][4][4][4] = {
          { {0x00, 0x00, 0x00, 0x00}, {0x44, 0xC4, 0xC4, 0x84},
            {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //rep
          { {0x00, 0x14, 0x00, 0x00}, {0x00, 0x34, 0x00, 0x00},
-           {0x00, 0x34, 0x00, 0x00}, {0x00, 0x24, 0x00, 0x00} } }, //stick (blue)
+           {0x00, 0x34, 0x00, 0x00}, {0x00, 0x24, 0x00, 0x00} } }, //I, stick (blue)
 
        { { {0x00, 0x00, 0x00, 0x00}, {0x00, 0x55, 0x95, 0x00},
            {0x00, 0x65, 0xA5, 0x00}, {0x00, 0x00, 0x00, 0x00} },
@@ -84,7 +90,7 @@ static const char shapes[7][4][4][4] = {
          { {0x00, 0x00, 0x00, 0x00}, {0x00, 0x55, 0x95, 0x00},
            {0x00, 0x65, 0xA5, 0x00}, {0x00, 0x00, 0x00, 0x00} }, //rep
          { {0x00, 0x00, 0x00, 0x00}, {0x00, 0x55, 0x95, 0x00},
-           {0x00, 0x65, 0xA5, 0x00}, {0x00, 0x00, 0x00, 0x00} } } //square (purple)
+           {0x00, 0x65, 0xA5, 0x00}, {0x00, 0x00, 0x00, 0x00} } } //O, square (purple)
 };
 
 int ShapeIterate(char s, int scr, int y, int x, ShapeDrawFunc func)