- if (decalbrightness[numdecals] > 1)
- decalbrightness[numdecals] = 1;
- decalbright = decalbrightness[numdecals];
-
- decalposition[numdecals] = where;
- decaltype[numdecals] = type;
- decalopacity[numdecals] = opacity;
- decalrotation[numdecals] = rotation;
- decalalivetime[numdecals] = 0;
-
- placex = (float)whichx * scale + scale;
- placez = (float)whichy * scale;
-
- decaltexcoords[numdecals][0][0] = (placex - where.x) / size / 2 + .5;
- decaltexcoords[numdecals][0][1] = (placez - where.z) / size / 2 + .5;
-
- decalvertex[numdecals][0].x = placex;
- decalvertex[numdecals][0].z = placez;
- decalvertex[numdecals][0].y = heightmap[whichx + 1][whichy] * scale + .01;
-
-
- placex = (float)whichx * scale + scale;
- placez = (float)whichy * scale + scale;
-
- decaltexcoords[numdecals][1][0] = (placex - where.x) / size / 2 + .5;
- decaltexcoords[numdecals][1][1] = (placez - where.z) / size / 2 + .5;
-
- decalvertex[numdecals][1].x = placex;
- decalvertex[numdecals][1].z = placez;
- decalvertex[numdecals][1].y = heightmap[whichx + 1][whichy + 1] * scale + .01;
-
-
- placex = (float)whichx * scale;
- placez = (float)whichy * scale + scale;
-
- decaltexcoords[numdecals][2][0] = (placex - where.x) / size / 2 + .5;
- decaltexcoords[numdecals][2][1] = (placez - where.z) / size / 2 + .5;