Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

0.7.1-dev
Justin Clark-Casey (justincc) 2011-04-21 18:44:04 +01:00
commit 44999dce76
1 changed files with 10 additions and 3 deletions

View File

@ -62,6 +62,8 @@ namespace PrimMesher
bool needsScaling = false;
bool smallMap = bmW * bmH <= lod * lod;
width = bmW;
height = bmH;
while (width * height > numLodPixels)
@ -104,9 +106,14 @@ namespace PrimMesher
{
for (int x = 0; x <= width; x++)
{
int bmY = y < height ? y * 2 : y * 2 - 1;
int bmX = x < width ? x * 2 : x * 2 - 1;
Color c = bm.GetPixel(bmX, bmY);
Color c;
if (smallMap)
c = bm.GetPixel(x < width ? x : x - 1,
y < height ? y : y - 1);
else
c = bm.GetPixel(x < width ? x * 2 : x * 2 - 1,
y < height ? y * 2 : y * 2 - 1);
redBytes[byteNdx] = c.R;
greenBytes[byteNdx] = c.G;