Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i=0; i<12; i++) {
- Mesh_tile *t = &main_mesh->tile[i];
- if (t->projection->visible) {
- glColor3f(t->projection->colour[0], t->projection->colour[1], t->projection->colour[2]);
- Vector2 *c[5] = {&t->corner[0]->projection->v, &t->corner[1]->projection->v, &t->corner[2]->projection->v, &t->corner[3]->projection->v, &t->corner[4]->projection->v};
- glBegin(GL_TRIANGLE_FAN);
- glVertex2f(t->projection->v.x, t->projection->v.y);
- glVertex2f(c[0]->x, c[0]->y);
- glVertex2f(c[1]->x, c[1]->y);
- glVertex2f(c[2]->x, c[2]->y);
- glVertex2f(c[3]->x, c[3]->y);
- glVertex2f(c[4]->x, c[4]->y);
- glVertex2f(c[0]->x, c[0]->y);
- glEnd();
- }
- }
- for (int i=12; i<main_mesh->tiles; i++) {
- Mesh_tile *t = &main_mesh->tile[i];
- if (t->projection->visible) {
- glColor3f(t->projection->colour[0], t->projection->colour[1], t->projection->colour[2]);
- Vector2 *c[6] = {&t->corner[0]->projection->v, &t->corner[1]->projection->v, &t->corner[2]->projection->v, &t->corner[3]->projection->v, &t->corner[4]->projection->v, &t->corner[5]->projection->v};
- glBegin(GL_TRIANGLE_FAN);
- glVertex2f(t->projection->v.x, t->projection->v.y);
- glVertex2f(c[0]->x, c[0]->y);
- glVertex2f(c[1]->x, c[1]->y);
- glVertex2f(c[2]->x, c[2]->y);
- glVertex2f(c[3]->x, c[3]->y);
- glVertex2f(c[4]->x, c[4]->y);
- glVertex2f(c[5]->x, c[5]->y);
- glVertex2f(c[0]->x, c[0]->y);
- glEnd();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement