|
@@ -62,38 +62,47 @@
|
|
|
NSUInteger itemsPerRow = 9;
|
|
|
NSUInteger pixelsPerColumn = 36;
|
|
|
NSUInteger pixelsPerRow = 56;
|
|
|
+ NSImage *atlas;
|
|
|
+ BOOL notFound = FALSE;
|
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
- if (itemId <= 92)
|
|
|
+ if (itemId <= 94)
|
|
|
{
|
|
|
- if (itemId <= 25)
|
|
|
+ if (itemId <= 17)
|
|
|
index = itemId - 1; // first item is 1
|
|
|
- else if (itemId == 35)
|
|
|
- index = itemId - (35 - 25);
|
|
|
+ else if (itemId <= 35 )
|
|
|
+ index = itemId + 1;
|
|
|
else if (itemId >= 37)
|
|
|
- index = itemId - (37 - 26);
|
|
|
+ index = itemId + 6;
|
|
|
atlasOffset = NSMakePoint(36, 75);
|
|
|
}
|
|
|
- else if (itemId >= 256 && itemId <= 355)
|
|
|
+ else if (itemId >= 256 && itemId <= 351)
|
|
|
{
|
|
|
index = itemId - 256;
|
|
|
- atlasOffset = NSMakePoint(445, 23+52);
|
|
|
+ atlasOffset = NSMakePoint(445, 75);
|
|
|
+ }
|
|
|
+ else if (itemId >= 352 && itemId <= 356)
|
|
|
+ {
|
|
|
+ index = itemId - 241;
|
|
|
+ atlasOffset = NSMakePoint(445, 75);
|
|
|
}
|
|
|
else if (itemId == 2256)
|
|
|
{
|
|
|
index = 0;
|
|
|
- atlasOffset = NSMakePoint(445, pixelsPerRow*12+17);
|
|
|
+ atlasOffset = NSMakePoint(445+pixelsPerColumn*8, pixelsPerRow*13 + 18);
|
|
|
}
|
|
|
else if (itemId == 2257)
|
|
|
{
|
|
|
index = 0;
|
|
|
- atlasOffset = NSMakePoint(445+pixelsPerColumn, pixelsPerRow*12+17);
|
|
|
+ atlasOffset = NSMakePoint(445, pixelsPerRow*14+18);
|
|
|
}
|
|
|
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 +110,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;
|