//with the rest of the variables polygonColor[0] = 0xBFD4D4D4; polygonColor[1] = 0xBFCBF9FF; polygonColor[2] = 0xBF777777; polygonColor[3] = 0xAFFFFFFF; polygonColor[4] = 0xBF34E7FF; polygonColor[5] = 0xBFFF0000; polygonColor[6] = 0xBFFF0000; polygonColor[7] = 0xBFFFFF00; polygonColor[8] = 0xBF00FF00; polygonColor[9] = 0xBFFF6600; //stays where it is // Number of polygons in the map. int polynum = read4bytes(NUMBERPOLYS); // Coords for the polygon, x1,y1,x2,y2,x3,y3. float px1; float px2; float px3; float py1; float py2; float py3; // Drawtriangle loop. // POLYDIFF is always 0x1c. for ( int i = 0; i <= polynum ; i++ ) { px1 = readfloat((POLYGONS + (0x54 * (i-1)))); py1 = readfloat(((POLYGONS + (0x54 * (i-1))) + + 0x4)); px2 = readfloat(((POLYGONS + (0x54 * (i-1))) + 0x1C)); py2 = readfloat(((POLYGONS + (0x54 * (i-1))) + 0x20)); px3 = readfloat(((POLYGONS + (0x54 * (i-1))) + 0x38)); py3 = readfloat(((POLYGONS + (0x54 * (i-1))) + 0x3C)); drawtriangleonmap(polygonColor[getpolytype(i)] ,px1,py1,px2,py2,px3,py3,m_pD3Ddev); }