Once again, I have a question about TIGCC.
When is it good to use a global variable?
Also, I noticed in the shadowfalls source code, mirogfx.h looks like this:
#define GetTilesMiro(dir,pl,nr) &(mirotiles[(((dir)+(nr))*MHEIGHT*2)+(pl*MHEIGHT)])
unsigned short mirotiles[8*MHEIGHT*2] = {
// Tile 0
0x07DC,0x1BF4,0x2FE8,0x1FB4,0x2F7C,0x1FF8,0x0F50,0x0E50
,0x1110,0x0EE0,0x0BA0,0x0CA0,0x04E0,0x0720,0x03E0,0x03A0
,0x07DC,0x1C2C,0x3118,0x124C,0x34D4,0x12F8,0x0950,0x0F50
,0x1F90,0x0FE0,0x0D60,0x0AA0,0x07A0,0x07A0,0x03E0,0x03E0
// Tile 1
,0x07DC,0x1BF4,0x2FE8,0x1FB4,0x2F7C,0x1FF8,0x0F50,0x0E50
,0x1110,0x0EE0,0x1BA0,0x27E0,0x27E0,0x1990,0x1D28,0x0BF0
,0x07DC,0x1C2C,0x3118,0x124C,0x34D4,0x12F8,0x0950,0x0F50
,0x1F90,0x0DE0,0x1660,0x33A0,0x3C20,0x1E50,0x1DB8,0x0FF0
// Tile 2
,0x07E0,0x1BD8,0x2FF4,0x3FF8,0x1FFC,0x1FF8,0x3FFC,0x5DBA
,0x2FF4,0x2FF2,0x1FF2,0x0E7E,0x0FFA,0x08F4,0x0FA0,0x05F0.....
};[CODE]
Why are these tiles defined in a header file, and what exactly is the macro for? how do macros work?