PDA

View Full Version : Tiling Help!



MACnus
05-14-2004, 11:32 AM
Can any of you guys help me with this.
i can't anything out to my screen?
http://magnus.murel.no/Map.zip
i've tried to convert this to cocoa?
http://www.gamedev.net/reference/articles/article1256.asp

witeshark
05-14-2004, 01:29 PM
I saw some map application, but it didn't render rightly

MACnus
05-15-2004, 01:55 AM
I've have problems with this:


- (BOOL) draw_tiles
{
int tile;
int x,y;

char map[MAP_SIZEY][MAP_SIZEX] =
{
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
};

for (y = 0; y < MAP_SIZEY; y++)
{
for (x = 0; x < MAP_SIZEX; x++)
{
glLoadIdentity();
tile = map[y][x];
glBindTexture(GL_TEXTURE_2D, texture[tile]);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(float(x), float(y), 0.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(float(x + 1), float(y), 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(float(x + 1), float(y + 1), 0.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(float(x), float(y + 1), 0.0f);
glEnd();
}
}
return (1);
}

I get this error


MapView.m:121: error: parse error before "float"
MapView.m:123: error: parse error before "float"
MapView.m:125: error: parse error before "float"
MapView.m:127: error: parse error before "float"

What do I have to do?