Implemented -dumpRGBAToFileNamed: for the SDL builds. Saves a .bmp planet texture file at the directory where Oolite is run from.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2847 127b21dd-08f5-0310-b4b7-95ae10353056master
parent
9e69f069ac
commit
0182572e90
|
@ -1822,7 +1822,13 @@ keys[a] = NO; keys[b] = NO; \
|
|||
height:(OOUInteger)height
|
||||
rowBytes:(OOUInteger)rowBytes
|
||||
{
|
||||
OOLog(@"dumpRGBA.unimplemented", @"If you had a Mac, you'd be getting some sort of debug image (\"%@\") dumped somewhere.", name);
|
||||
if (name == nil || bytes == NULL || width == 0 || height == 0 || rowBytes < width * 4) return;
|
||||
|
||||
NSString *dumpFileName = [NSString stringWithFormat:@"%@.bmp", name];
|
||||
|
||||
SDL_Surface* tmpSurface = SDL_CreateRGBSurfaceFrom(bytes, width, height, 32, rowBytes, 0xFF, 0xFF00, 0xFF0000, 0x0);
|
||||
SDL_SaveBMP(tmpSurface, [dumpFileName UTF8String]);
|
||||
SDL_FreeSurface(tmpSurface);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue