All pastes #458125 Raw Edit

Mine

public text v1 · immutable
#458125 ·published 2007-04-25 18:46 UTC
rendered paste body
2245        int x2; 
2246        for (x2=0;x2<scaled_square_size;x2++)
2247        {   
2248                // map x1, y1, x2 and y2 for the current scaled sqaure
2249                mx1 = mx + x2; 
2250                my1 = my + y2; 
2251                mx2 = mx + x2 + 1;
2252                my2 = my + y2 + 1;
2253                // world x1, y1, x2 and y2
2254                wx1 = (float) mx1 * world_square_size - terrainOffsetX;
2255                wy1 = (float) my1 * world_square_size - terrainOffsetY;
2256                wx2 = (float) mx2 * world_square_size - terrainOffsetX;
2257                wy2 = (float) my2 * world_square_size - terrainOffsetY;
2258
2259                // render it! 
2260                glColor4f(calc_colours[y2][x2+1].r,
2261                          calc_colours[y2][x2+1].g,
2262                          calc_colours[y2][x2+1].b,
2263                          calc_colours[y2][x2+1].a);
2264                glNormal3f(calc_normals[y2][x2+1].x, calc_normals[y2][x2+1].y, calc_normals[y2][x2+1].z);
2265                glTexCoord2f(calc_texcoords[y2][x2+1].u, calc_texcoords[y2][x2+1].v);
2266                glVertex3f(wx2, calc_heights[y2][x2+1], wy1);
2267
2268                glColor4f(calc_colours[y2+1][x2+1].r,
2269                          calc_colours[y2+1][x2+1].g,
2270                          calc_colours[y2+1][x2+1].b,
2271                          calc_colours[y2+1][x2+1].a);
2272                glNormal3f(calc_normals[y2+1][x2+1].x, calc_normals[y2+1][x2+1].y, calc_normals[y2+1][x2+1].z);
2273                glTexCoord2f(calc_texcoords[y2+1][x2+1].u, calc_texcoords[y2+1][x2+1].v);
2274                glVertex3f(wx2, calc_heights[y2+1][x2+1], wy2);
2275
2276
2277        }