- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
for(int i = posX-width, numBlock = 0; i < posX+width; i++)
{
for(int j = posY-height; j < posY+height; j++)
{
if(worldInfo[i][j] != air){
switch(worldInfo[i][j])
{
case grass:
for(i = 0; i < 8; i++) tempCoord[numBlock*8+i] = texCoordList[0][i];
break;
case dirt:
for(i = 0; i < 8; i++) tempCoord[numBlock*8+i] = texCoordList[1][i];
break;
case rock:
for(i = 0; i < 8; i++) tempCoord[numBlock*8+i] = texCoordList[2][i];
break;
case water:
if(j != 35)
for(i = 0; i < 8; i++) tempCoord[numBlock*8+i] = texCoordList[3][i];
else
for(i = 0; i < 8; i++) tempCoord[numBlock*8+i] = texCoordList[4][i];
break;
case sand:
for(i = 0; i < 8; i++) tempCoord[numBlock*8+i] = texCoordList[5][i];
break;
}
numBlock++;
}
}
}