Added image for unrecognized items

This commit is contained in:
Nick Loose 2010-11-20 13:50:07 +01:00
parent fd071b3804
commit b7a628d6fa
3 changed files with 15 additions and 3 deletions

View File

@ -62,6 +62,8 @@
NSUInteger itemsPerRow = 9;
NSUInteger pixelsPerColumn = 36;
NSUInteger pixelsPerRow = 56;
NSImage *atlas;
BOOL notFound = FALSE;
int index = 0;
@ -93,7 +95,9 @@
else
{
NSLog(@"%s error: unrecognized item id %d", __PRETTY_FUNCTION__, itemId);
return nil;
index = 0;
atlasOffset = NSMakePoint(1, 30);
notFound = TRUE;
}
atlasOffset.x += pixelsPerColumn * (index % itemsPerRow);
@ -101,8 +105,12 @@
NSRect atlasRect = NSMakeRect(atlasOffset.x, atlasOffset.y, itemImageSize.width, itemImageSize.height);
NSImage *atlas = [NSImage imageNamed:@"DataValuesV110Transparent.png"];
if (notFound != TRUE) {
atlas = [NSImage imageNamed:@"DataValuesV110Transparent.png"];
}else {
atlas = [NSImage imageNamed:@"blockNotFound.png"];
}
NSImage *output = [[NSImage alloc] initWithSize:itemImageSize];
atlasRect.origin.y = atlas.size.height - atlasRect.origin.y;

BIN
Images/blockNotFound.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -28,6 +28,7 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
BA24598B1297428900F8B9C2 /* blockNotFound.png in Resources */ = {isa = PBXBuildFile; fileRef = BA24598A1297428900F8B9C2 /* blockNotFound.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -68,6 +69,7 @@
66BCFE61125FCEC6005A23F4 /* DataValuesV110Transparent.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DataValuesV110Transparent.png; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* InsideJob-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "InsideJob-Info.plist"; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Inside Job.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Inside Job.app"; sourceTree = BUILT_PRODUCTS_DIR; };
BA24598A1297428900F8B9C2 /* blockNotFound.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blockNotFound.png; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -218,6 +220,7 @@
66BC07711262823E005A23F4 /* Images */ = {
isa = PBXGroup;
children = (
BA24598A1297428900F8B9C2 /* blockNotFound.png */,
66BCFE61125FCEC6005A23F4 /* DataValuesV110Transparent.png */,
66BCFC35125EA53E005A23F4 /* InsideJob.icns */,
);
@ -284,6 +287,7 @@
66BCFC36125EA53E005A23F4 /* InsideJob.icns in Resources */,
66BCFE62125FCEC6005A23F4 /* DataValuesV110Transparent.png in Resources */,
66BC077312628257005A23F4 /* ItemPropertiesView.xib in Resources */,
BA24598B1297428900F8B9C2 /* blockNotFound.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};