00001 #include <gccore.h>
00002
00003 #include "defines.h"
00004 #include "globals.h"
00005
00006 #include "pieces_bin.h"
00007
00008 void SetupBlocks()
00009 {
00010
00011 for(int i = 0; i < NUMTYPES; i++)
00012 {
00013 cblockdesc& desc = blocks[i];
00014
00015
00016 for(int rot = 0; rot < 4; rot++)
00017 {
00018
00019 desc.xstart[rot] = 4;
00020 desc.xend[rot] = -1;
00021
00022 desc.ystart[rot] = 4;
00023 desc.yend[rot] = -1;
00024
00025
00026 for(int y = 0; y < 4; y++)
00027 {
00028 for(int x = 0; x < 4; x++)
00029 {
00030
00031 desc.map[rot][x][y] = pieces_bin[i * 4 * 4 * 4 + rot * 4 * 4 + y * 4 + x];
00032
00033 if(desc.map[rot][x][y])
00034 {
00035
00036 if(x < desc.xstart[rot])
00037 desc.xstart[rot] = x;
00038
00039
00040 if(x > desc.xend[rot])
00041 desc.xend[rot] = x;
00042
00043
00044 if(y < desc.ystart[rot])
00045 desc.ystart[rot] = y;
00046
00047
00048 if(y > desc.yend[rot])
00049 desc.yend[rot] = y;
00050 }
00051 }
00052 }
00053 }
00054 }
00055 }