- New planets atmosphere I: dump the older generated atmosphere to file.

- Alpha is converted to black for windows & linux file dumps.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2865 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Marc 2009-12-09 17:31:13 +00:00
parent 40db3dbfb3
commit f2e2654786
2 changed files with 16 additions and 2 deletions

View File

@ -444,6 +444,19 @@ void fillSquareImageDataWithCloudTexture(unsigned char * imageBuffer, int width,
imageBuffer[ 3 + 4 * (y * width + x) ] = 255 * rgba[3] * q;
}
}
#ifndef NDEBUG
if (nplanes == 4)
{
NSString *name = [NSString stringWithFormat:@"atmosphere-%u-%u-old", sNoiseSeed.high, sNoiseSeed.low];
OOLog(@"planetTex.temp", [NSString stringWithFormat:@"Saving generated texture to file %@.", name]);
[[UNIVERSE gameView] dumpRGBAToFileNamed:name
bytes:imageBuffer
width:width
height:width
rowBytes:width * 4];
}
#endif
}
void fillSquareImageWithPlanetTex(unsigned char * imageBuffer, int width, int nplanes, float impress, float bias,
@ -509,7 +522,7 @@ void fillSquareImageWithPlanetTex(unsigned char * imageBuffer, int width, int np
imageBuffer[ 3 + 4 * (y * width + x) ] = 255;
}
}
#if DEBUG_DUMP
#ifndef NDEBUG
if (nplanes == 4)
{
OOLog(@"planetTex.temp", [NSString stringWithFormat:@"Saving generated texture to file planet-%u-%u-old.", sNoiseSeed.high, sNoiseSeed.low]);

View File

@ -1830,7 +1830,8 @@ keys[a] = NO; keys[b] = NO; \
NSString *dumpFile = [[NSHomeDirectory() stringByAppendingPathComponent:@SAVEDIR] stringByAppendingPathComponent:@SNAPSHOTDIR];
dumpFile = [dumpFile stringByAppendingPathComponent: [NSString stringWithFormat:@"%@.bmp", name]];
SDL_Surface* tmpSurface = SDL_CreateRGBSurfaceFrom(bytes, width, height, 32, rowBytes, 0xFF, 0xFF00, 0xFF0000, 0x0);
// convert transparency to black before saving to bmp
SDL_Surface* tmpSurface = SDL_CreateRGBSurfaceFrom(bytes, width, height, 32, rowBytes, 0xFF, 0xFF00, 0xFF0000, 0xFF000000);
SDL_SaveBMP(tmpSurface, [dumpFile UTF8String]);
SDL_FreeSurface(tmpSurface);
}