Skip to content

Commit

Permalink
new blocks for Beta 1.4 and 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
equalpants committed Apr 22, 2011
1 parent c71a98a commit 3f8155f
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README
Expand Up @@ -36,6 +36,10 @@ Use supplied makefile to build with g++.

Change log (important stuff only):

0.7.3
-new blocks for Minecraft Beta 1.4 and 1.5: locked chests, boosters, detectors,
pine/birch saplings, webs

0.7.2
-support for big-endian platforms (like PowerPC)

Expand Down
51 changes: 51 additions & 0 deletions blockimages.cpp
Expand Up @@ -998,6 +998,14 @@ void BlockImages::setOffsets()
setOffsetsForID(4, 4, *this);
setOffsetsForID(5, 5, *this);
setOffsetsForID(6, 6, *this);
blockOffsets[offsetIdx(6, 1)] = 250;
blockOffsets[offsetIdx(6, 5)] = 250;
blockOffsets[offsetIdx(6, 9)] = 250;
blockOffsets[offsetIdx(6, 13)] = 250;
blockOffsets[offsetIdx(6, 2)] = 251;
blockOffsets[offsetIdx(6, 6)] = 251;
blockOffsets[offsetIdx(6, 10)] = 251;
blockOffsets[offsetIdx(6, 14)] = 251;
setOffsetsForID(7, 7, *this);
setOffsetsForID(8, 8, *this);
//blockOffsets[offsetIdx(8, 1)] = 9;
Expand Down Expand Up @@ -1054,6 +1062,25 @@ void BlockImages::setOffsets()
blockOffsets[offsetIdx(26, 9)] = 233;
blockOffsets[offsetIdx(26, 10)] = 234;
blockOffsets[offsetIdx(26, 11)] = 235;
setOffsetsForID(27, 258, *this);
blockOffsets[offsetIdx(27, 1)] = 259;
blockOffsets[offsetIdx(27, 2)] = 260;
blockOffsets[offsetIdx(27, 3)] = 261;
blockOffsets[offsetIdx(27, 4)] = 262;
blockOffsets[offsetIdx(27, 5)] = 263;
blockOffsets[offsetIdx(27, 8)] = 252;
blockOffsets[offsetIdx(27, 9)] = 253;
blockOffsets[offsetIdx(27, 10)] = 254;
blockOffsets[offsetIdx(27, 11)] = 255;
blockOffsets[offsetIdx(27, 12)] = 256;
blockOffsets[offsetIdx(27, 13)] = 257;
setOffsetsForID(28, 264, *this);
blockOffsets[offsetIdx(28, 1)] = 265;
blockOffsets[offsetIdx(28, 2)] = 266;
blockOffsets[offsetIdx(28, 3)] = 267;
blockOffsets[offsetIdx(28, 4)] = 268;
blockOffsets[offsetIdx(28, 5)] = 269;
setOffsetsForID(30, 272, *this);
blockOffsets[offsetIdx(35, 0)] = 29;
blockOffsets[offsetIdx(35, 1)] = 204;
blockOffsets[offsetIdx(35, 2)] = 205;
Expand Down Expand Up @@ -1268,6 +1295,7 @@ void BlockImages::setOffsets()
blockOffsets[offsetIdx(94, 7)] = 241;
blockOffsets[offsetIdx(94, 11)] = 241;
blockOffsets[offsetIdx(94, 15)] = 241;
setOffsetsForID(95, 270, *this);
}

void BlockImages::checkOpacityAndTransparency(int B)
Expand Down Expand Up @@ -1481,6 +1509,8 @@ bool BlockImages::construct(int B, const string& terrainfile, const string& fire
drawBlockImage(img, getRect(174), tiles, 26, 42, 25, B); // double chest S
drawBlockImage(img, getRect(175), tiles, 41, 26, 25, B); // double chest E
drawBlockImage(img, getRect(176), tiles, 42, 26, 25, B); // double chest W
drawBlockImage(img, getRect(270), tiles, 26, 27, 25, B); // locked chest facing W
drawBlockImage(img, getRect(271), tiles, 27, 26, 25, B); // locked chest facing N
drawBlockImage(img, getRect(56), tiles, 50, 50, 50, B); // diamond ore
drawBlockImage(img, getRect(57), tiles, 24, 24, 24, B); // diamond block
drawBlockImage(img, getRect(58), tiles, 59, 60, 43, B); // workbench
Expand Down Expand Up @@ -1561,6 +1591,9 @@ bool BlockImages::construct(int B, const string& terrainfile, const string& fire
drawItemBlockImage(img, getRect(121), tiles, 115, B); // red torch floor off
drawItemBlockImage(img, getRect(122), tiles, 99, B); // red torch floor on
drawItemBlockImage(img, getRect(132), tiles, 73, B); // reeds
drawItemBlockImage(img, getRect(250), tiles, 63, B); // pine sapling
drawItemBlockImage(img, getRect(251), tiles, 79, B); // birch sapling
drawItemBlockImage(img, getRect(272), tiles, 11, B); // web

drawSingleFaceBlockImage(img, getRect(44), tiles, 80, 1, B); // torch pointing S
drawSingleFaceBlockImage(img, getRect(45), tiles, 80, 0, B); // torch pointing N
Expand Down Expand Up @@ -1622,11 +1655,29 @@ bool BlockImages::construct(int B, const string& terrainfile, const string& fire
drawFloorBlockImage(img, getRect(93), tiles, 112, 0, B); // track SE corner
drawFloorBlockImage(img, getRect(94), tiles, 112, 3, B); // track SW corner
drawFloorBlockImage(img, getRect(95), tiles, 112, 2, B); // track NW corner
drawFloorBlockImage(img, getRect(252), tiles, 179, 1, B); // booster on EW
drawFloorBlockImage(img, getRect(253), tiles, 179, 0, B); // booster on NS
drawFloorBlockImage(img, getRect(258), tiles, 163, 1, B); // booster off EW
drawFloorBlockImage(img, getRect(259), tiles, 163, 0, B); // booster off NS
drawFloorBlockImage(img, getRect(264), tiles, 195, 1, B); // detector EW
drawFloorBlockImage(img, getRect(265), tiles, 195, 0, B); // detector NS

drawAngledFloorBlockImage(img, getRect(200), tiles, 128, 0, 0, B); // track asc S
drawAngledFloorBlockImage(img, getRect(201), tiles, 128, 0, 2, B); // track asc N
drawAngledFloorBlockImage(img, getRect(202), tiles, 128, 1, 3, B); // track asc E
drawAngledFloorBlockImage(img, getRect(203), tiles, 128, 1, 1, B); // track asc W
drawAngledFloorBlockImage(img, getRect(254), tiles, 179, 0, 0, B); // booster on asc S
drawAngledFloorBlockImage(img, getRect(255), tiles, 179, 0, 2, B); // booster on asc N
drawAngledFloorBlockImage(img, getRect(256), tiles, 179, 1, 3, B); // booster on asc E
drawAngledFloorBlockImage(img, getRect(257), tiles, 179, 1, 1, B); // booster on asc W
drawAngledFloorBlockImage(img, getRect(260), tiles, 163, 0, 0, B); // booster off asc S
drawAngledFloorBlockImage(img, getRect(261), tiles, 163, 0, 2, B); // booster off asc N
drawAngledFloorBlockImage(img, getRect(262), tiles, 163, 1, 3, B); // booster off asc E
drawAngledFloorBlockImage(img, getRect(263), tiles, 163, 1, 1, B); // booster off asc W
drawAngledFloorBlockImage(img, getRect(266), tiles, 195, 0, 0, B); // detector asc S
drawAngledFloorBlockImage(img, getRect(267), tiles, 195, 0, 2, B); // detector asc N
drawAngledFloorBlockImage(img, getRect(268), tiles, 195, 1, 3, B); // detector asc E
drawAngledFloorBlockImage(img, getRect(269), tiles, 195, 1, 1, B); // detector asc W

drawFencePost(img, getRect(134), tiles, 4, B); // fence post
drawFence(img, getRect(158), tiles, 4, true, false, false, false, B); // fence N
Expand Down
32 changes: 25 additions & 7 deletions blockimages.h
Expand Up @@ -114,7 +114,7 @@ struct BlockImages
bool construct(int B, const std::string& terrainfile, const std::string& firefile);
};

#define NUMBLOCKIMAGES 250
#define NUMBLOCKIMAGES 273

// block image offsets:
//
Expand Down Expand Up @@ -177,12 +177,30 @@ struct BlockImages
// 151 UNUSED 183 furnace W 215 brown wool 247 repeater off W
// 152 UNUSED 184 furnace N 216 green wool 248 pine leaves
// 153 pumpkin facing E/S 185 furnace E/S 217 red wool 249 birch leaves
// 154 pumpkin facing N 186 lit furnace W 218 black wool
// 155 jack-o-lantern E/S 187 lit furnace N 219 pine log
// 156 jack-o-lantern N 188 lit furnace E/S 220 birch log
// 157 water surface 189 fire 221 lapis ore
// 158 fence N 190 stone button facing S 222 lapis block
// 159 fence S 191 stone button facing N 223 dispenser W
// 154 pumpkin facing N 186 lit furnace W 218 black wool 250 pine sapling
// 155 jack-o-lantern E/S 187 lit furnace N 219 pine log 251 birch sapling
// 156 jack-o-lantern N 188 lit furnace E/S 220 birch log 252 booster on EW
// 157 water surface 189 fire 221 lapis ore 253 booster on NS
// 158 fence N 190 stone button facing S 222 lapis block 254 booster on asc S
// 159 fence S 191 stone button facing N 223 dispenser W 255 booster on asc N
//
// 256 booster on asc E
// 257 booster on asc W
// 258 booster off EW
// 259 booster off NS
// 260 booster off asc S
// 261 booster off asc N
// 262 booster off asc E
// 263 booster off asc W
// 264 detector EW
// 265 detector NS
// 266 detector asc S
// 267 detector asc N
// 268 detector asc E
// 269 detector asc W
// 270 locked chest facing W
// 271 locked chest facing N
// 272 web



Expand Down
9 changes: 9 additions & 0 deletions render.cpp
Expand Up @@ -272,6 +272,15 @@ void checkSpecial(SceneGraphNode& node, uint8_t blockID, uint8_t blockData, cons
else if (rj.blockimages.isOpaque(blockIDW, blockDataW))
node.bimgoffset = 177;
}
else if (blockID == 95) // locked chest
{
uint8_t blockIDW, blockDataW;
GETNEIGHBOR(blockIDW, blockDataW, BlockIdx(0,1,0))
// if there's an opaque block to the W, we should face N instead
// (also: see note above for regular chests)
if (rj.blockimages.isOpaque(blockIDW, blockDataW))
node.bimgoffset = 271;
}

//!!!!!!!! for now, only fully opaque blocks can have drop-off shadows, but some others like snow could
// probably use them, too
Expand Down

0 comments on commit 3f8155f

Please sign in to comment.