Incorporated beta 1.3 changes from nickloose's 4fddca6e98273a12aae0.

This commit is contained in:
preble 2011-02-24 23:42:46 -05:00
parent 32a8259e38
commit 8502c00bf0
6 changed files with 58 additions and 16 deletions

View File

@ -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;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 203 KiB

BIN
Images/blockNotFound.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
256AC3DA0F4B6AC300CF3369 /* InsideJobAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* InsideJobAppDelegate.m */; };
663803B2131769E90015CFAD /* blockNotFound.png in Resources */ = {isa = PBXBuildFile; fileRef = 663803B1131769E90015CFAD /* blockNotFound.png */; };
668B2556125D5A3E0060BF71 /* NBTContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 668B2555125D5A3E0060BF71 /* NBTContainer.m */; };
668B255C125D5BCA0060BF71 /* NSData+CocoaDevAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 668B255B125D5BCA0060BF71 /* NSData+CocoaDevAdditions.m */; };
668B2560125D5C1C0060BF71 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 668B255F125D5C1C0060BF71 /* libz.dylib */; };
@ -42,6 +43,7 @@
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
663803B1131769E90015CFAD /* blockNotFound.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blockNotFound.png; sourceTree = "<group>"; };
668B2554125D5A3E0060BF71 /* NBTContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NBTContainer.h; sourceTree = "<group>"; };
668B2555125D5A3E0060BF71 /* NBTContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NBTContainer.m; sourceTree = "<group>"; };
668B255A125D5BCA0060BF71 /* NSData+CocoaDevAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+CocoaDevAdditions.h"; sourceTree = "<group>"; };
@ -225,6 +227,7 @@
66BC07711262823E005A23F4 /* Images */ = {
isa = PBXGroup;
children = (
663803B1131769E90015CFAD /* blockNotFound.png */,
66BCFE61125FCEC6005A23F4 /* DataValuesV110Transparent.png */,
66BCFC35125EA53E005A23F4 /* InsideJob.icns */,
);
@ -291,6 +294,7 @@
66BCFC36125EA53E005A23F4 /* InsideJob.icns in Resources */,
66BCFE62125FCEC6005A23F4 /* DataValuesV110Transparent.png in Resources */,
66BC077312628257005A23F4 /* ItemPropertiesView.xib in Resources */,
663803B2131769E90015CFAD /* blockNotFound.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -18,8 +18,8 @@
18,Leaves
19,Sponge
20,Glass
21,Lapis Lazui Ore
22,Lapis Lazui Block
21,Lapis Lazuli Ore
22,Lapis Lazuli Block
23,Dispenser
24,Sandstone
25,Note Block
@ -32,6 +32,10 @@
42,Iron Block
43,Double Step
44,Step
# 44,Stone Step, 0
# 44,Sandstone Step, 1
# 44,Wodden Step, 2
# 44,Cobblestone Step, 3
45,Brick
46,TNT
47,Bookcase
@ -80,6 +84,8 @@
90,Portal
91,Jack-O-Lantern
92,Cake Block
93,Redstone Repeater (off)
94,Redstone Repeater (on)
256,Iron Spade
257,Iron Pickaxe
258,Iron Axe
@ -175,9 +181,28 @@
348,Glowstone Dust
349,Raw Fish
350,Cooked Fish
351,Ink Sack
#Dye
#351,Ink sack,0
#351,Rose Red,1
#351,Cactus Green,2
#351,Brown,3
#351,Lapis Lazuli Dye,4
#351,Purple Dye,5
#351,Cyan Dye,6
#351,Light Gray Dye,7
#351,Gray Dye,8
#351,Pink Dye,9
#351,Lime Dye,10
#351,Dandelion Yellow Dye,11
#351,Light Blue Dye,12
#351,Magenta Dye,13
#351,Orange Dye,14
#351,Bone Meal,15
351,Dye
#Dye End
352,Bone
353,Sugar
354,Cake
355,Bed
2256,Gold Record
2257,Green Record
2257,Green Record
Can't render this file because it has a wrong number of fields in line 35.