Skip to content

Instantly share code, notes, and snippets.

@beelsebob
Created August 1, 2011 11:25
Show Gist options
  • Select an option

  • Save beelsebob/1117968 to your computer and use it in GitHub Desktop.

Select an option

Save beelsebob/1117968 to your computer and use it in GitHub Desktop.
[NSTask launchedTaskWithLaunchPath:@"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool"
arguments:[NSArray arrayWithObjects:
@"-e",
@"PVRTC",
@"--channel-weighting-perceptual",
compressionLevel,
@"-f",
@"PVR",
@"-o",
compressedTexturePath,
@"-p",
compressedTexturePreviewPath,
uncompressedImagePath,
nil]
completionHandler:^(int termStatus)
{
NSLog(@"Zomg it got called");
if(0 == termStatus)
{
[self setPreviewImage:[[[NSImage alloc] initWithContentsOfFile:compressedTexturePreviewPath] autorelease]];
[self setTextureData:[NSData dataWithContentsOfFile:compressedTexturePath]];
}
else
{
[self setPreviewImage:nil];
[self setTexture:nil];
[self setTextureData:nil];
}
[self setTextureIsCompressed:YES];
}];
[NSTask launchedTaskWithLaunchPath:@"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool"
arguments:[NSArray arrayWithObjects:
@"-e",
@"PVRTC",
@"--channel-weighting-perceptual",
compressionLevel,
@"-f",
@"PVR",
@"-o",
compressedTexturePath,
@"-p",
compressedTexturePreviewPath,
uncompressedImagePath,
nil]
completionHandler:^(int termStatus)
{
NSLog(@"Zomg it got called");
[self setPreviewImage:[[[NSImage alloc] initWithContentsOfFile:compressedTexturePreviewPath] autorelease]];
[self setTextureData:[NSData dataWithContentsOfFile:compressedTexturePath]];
[self setTextureIsCompressed:YES];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment