diff --git a/README b/README index afce064..ee0ed45 100644 --- a/README +++ b/README @@ -22,6 +22,28 @@ Andrew Brown and contributors). --------------------------------------------------------------------------------------------------- +Change log (important stuff only): + +0.6 +-new block types for Minecraft Beta 1.2: lapis, cake, etc. +-remaining undrawn blocks from previous versions now drawn: fire, buttons, levers, ascending + cart tracks +-fire.png added; must be placed in images directory alongside terrain.png +-some block image offsets changed; see note below if you have manually edited your blocks-B.png +-some drawing improvements; may want to redo all block images from terrain.png + +0.5.1 +-speed improvements +-previously, we would abort if the world was too absurdly large to deal with--i.e. if there were + some chunks whose coordinates were well into the billions--but apparently there is a Minecraft + bug that can create such chunks way off in space, even if the world is normally-sized, so now + we just ignore any chunks that are too far out to handle + +0.5 +-initial version + +--------------------------------------------------------------------------------------------------- + Supported platforms are Linux and cygwin. (But porting to Windows native or OSX should be easy.) Use supplied makefile to build with g++. Depending on the system, it might need to be modified to @@ -87,6 +109,10 @@ that contains the isometric renderings of each block. The default image path is blocks-B.png comes with a corresponding blocks-B.version, which remembers how many block images are stored in blocks-B.png. (As more blocks are added to the game, the version will change.) +The file fire.png, included with pigmap, must also be placed in the image path, alongside +terrain.png. (fire.png contains the image used to draw fire blocks; terrain.png does not have a +tile for fire.) + The selection of block images works thusly: -If blocks-B.png does not exist, then terrain.png will be used to create it. @@ -160,3 +186,27 @@ that include required chunks are rendered and saved. Base tiles that exist alre are overwritten, but those at lower zoom levels are merely modified--only the changed portions are redrawn. +--------------------------------------------------------------------------------------------------- + +Special note for those who choose to manually edit blocks-B.png: + +When new block types are introduced, their block images are added on to the end of blocks-B.png, +and the existing contents are preserved, so you don't need to worry about previous modifications +getting destroyed. However, sometimes it may be necessary to remove existing block images and +replace them with new versions; when this happens, the old block image offset will no longer be +used, and a new block image will be added to the end of the file. + +Example: prior to pigmap 0.6, the furnace block images were located at offsets 68, 69, and 149-152. +Starting with 0.6, they are instead located at 183-188. (This is because the furnace graphics +were changed in Minecraft Beta 1.2.) So if you modified the furnace block images while using a +pre-0.6 version of pigmap, your modified images can still be found at their old locations in your +blocks-B.png, but they must be copied to the new locations. + +Complete list of block image moves: + +--- pigmap 0.6 --- +furnaces: 68->183, 69->186, 149->184, 150->185, 151->187, 152->188 +fire: 48->189 +buttons: 123->190, 124->191, 125->192, 126->193 +levers: 104->194, 105->195, 106->196, 107->197, 108->198, 109->199 +ascending tracks: 88->200, 89->201, 90->202, 91->203 \ No newline at end of file diff --git a/blockimages.cpp b/blockimages.cpp index d12d00b..5ee52a4 100755 --- a/blockimages.cpp +++ b/blockimages.cpp @@ -960,7 +960,7 @@ void drawFire(RGBAImage& dest, const ImageRect& drect, const RGBAImage& firetile -const int BlockImages::NUMIMAGES = 206; +const int BlockImages::NUMIMAGES = 229; int offsetIdx(uint8_t blockID, uint8_t blockData) { @@ -1019,10 +1019,35 @@ void BlockImages::setOffsets() setOffsetsForID(15, 23, *this); setOffsetsForID(16, 24, *this); setOffsetsForID(17, 25, *this); + blockOffsets[offsetIdx(17, 1)] = 219; + blockOffsets[offsetIdx(17, 2)] = 220; setOffsetsForID(18, 26, *this); setOffsetsForID(19, 27, *this); setOffsetsForID(20, 28, *this); - setOffsetsForID(35, 29, *this); + setOffsetsForID(21, 221, *this); + setOffsetsForID(22, 222, *this); + setOffsetsForID(23, 223, *this); + blockOffsets[offsetIdx(23, 2)] = 225; + blockOffsets[offsetIdx(23, 4)] = 224; + blockOffsets[offsetIdx(23, 5)] = 225; + setOffsetsForID(24, 226, *this); + setOffsetsForID(25, 227, *this); + blockOffsets[offsetIdx(35, 0)] = 29; + blockOffsets[offsetIdx(35, 1)] = 204; + blockOffsets[offsetIdx(35, 2)] = 205; + blockOffsets[offsetIdx(35, 3)] = 206; + blockOffsets[offsetIdx(35, 4)] = 207; + blockOffsets[offsetIdx(35, 5)] = 208; + blockOffsets[offsetIdx(35, 6)] = 209; + blockOffsets[offsetIdx(35, 7)] = 210; + blockOffsets[offsetIdx(35, 8)] = 211; + blockOffsets[offsetIdx(35, 9)] = 212; + blockOffsets[offsetIdx(35, 10)] = 213; + blockOffsets[offsetIdx(35, 11)] = 214; + blockOffsets[offsetIdx(35, 12)] = 215; + blockOffsets[offsetIdx(35, 13)] = 216; + blockOffsets[offsetIdx(35, 14)] = 217; + blockOffsets[offsetIdx(35, 15)] = 218; setOffsetsForID(37, 30, *this); setOffsetsForID(38, 31, *this); setOffsetsForID(39, 32, *this); @@ -1188,6 +1213,7 @@ void BlockImages::setOffsets() blockOffsets[offsetIdx(91, 0)] = 155; blockOffsets[offsetIdx(91, 1)] = 155; blockOffsets[offsetIdx(91, 3)] = 156; + setOffsetsForID(92, 228, *this); } void BlockImages::checkOpacityAndTransparency(int B) @@ -1313,6 +1339,11 @@ bool BlockImages::construct(int B, const string& terrainfile, const string& fire resize(terrain, ImageRect(5*16 + 1, 4*16 + 1, 14, 14), tiles, ImageRect(5*2*B, 4*2*B, 2*B, 2*B)); resize(terrain, ImageRect(6*16 + 1, 4*16, 14, 16), tiles, ImageRect(6*2*B, 4*2*B, 2*B, 2*B)); + // ...and the same thing for the cake tiles + resize(terrain, ImageRect(9*16 + 1, 7*16 + 1, 14, 14), tiles, ImageRect(9*2*B, 7*2*B, 2*B, 2*B)); + // put the side of the cake on the bottom half instead of the top to make drawing easier + resize(terrain, ImageRect(10*16 + 1, 7*16, 14, 8), tiles, ImageRect(10*2*B, 7*2*B + B, 2*B, B)); + // initialize image img.create(rectsize * 16, (NUMIMAGES/16 + 1) * rectsize); @@ -1336,10 +1367,27 @@ bool BlockImages::construct(int B, const string& terrainfile, const string& fire drawBlockImage(img, getRect(23), tiles, 33, 33, 33, B); // iron ore drawBlockImage(img, getRect(24), tiles, 34, 34, 34, B); // coal ore drawBlockImage(img, getRect(25), tiles, 20, 20, 21, B); // log + drawBlockImage(img, getRect(219), tiles, 116, 116, 21, B); // dark log + drawBlockImage(img, getRect(220), tiles, 117, 117, 21, B); // birch log drawBlockImage(img, getRect(26), tiles, 52, 52, 52, B); // leaves drawBlockImage(img, getRect(27), tiles, 48, 48, 48, B); // sponge drawBlockImage(img, getRect(28), tiles, 49, 49, 49, B); // glass - drawBlockImage(img, getRect(29), tiles, 64, 64, 64, B); // cloth + drawBlockImage(img, getRect(29), tiles, 64, 64, 64, B); // white wool + drawBlockImage(img, getRect(204), tiles, 210, 210, 210, B); // orange wool + drawBlockImage(img, getRect(205), tiles, 194, 194, 194, B); // magenta wool + drawBlockImage(img, getRect(206), tiles, 178, 178, 178, B); // light blue wool + drawBlockImage(img, getRect(207), tiles, 162, 162, 162, B); // yellow wool + drawBlockImage(img, getRect(208), tiles, 146, 146, 146, B); // lime wool + drawBlockImage(img, getRect(209), tiles, 130, 130, 130, B); // pink wool + drawBlockImage(img, getRect(210), tiles, 114, 114, 114, B); // gray wool + drawBlockImage(img, getRect(211), tiles, 225, 225, 225, B); // light gray wool + drawBlockImage(img, getRect(212), tiles, 209, 209, 209, B); // cyan wool + drawBlockImage(img, getRect(213), tiles, 193, 193, 193, B); // purple wool + drawBlockImage(img, getRect(214), tiles, 177, 177, 177, B); // blue wool + drawBlockImage(img, getRect(215), tiles, 161, 161, 161, B); // brown wool + drawBlockImage(img, getRect(216), tiles, 145, 145, 145, B); // green wool + drawBlockImage(img, getRect(217), tiles, 129, 129, 129, B); // red wool + drawBlockImage(img, getRect(218), tiles, 113, 113, 113, B); // black wool drawBlockImage(img, getRect(34), tiles, 23, 23, 23, B); // gold block drawBlockImage(img, getRect(35), tiles, 22, 22, 22, B); // iron block drawBlockImage(img, getRect(36), tiles, 5, 5, 6, B); // double step @@ -1383,6 +1431,13 @@ bool BlockImages::construct(int B, const string& terrainfile, const string& fire drawBlockImage(img, getRect(140), tiles, 118, 120, 102, B); // jack-o-lantern W drawBlockImage(img, getRect(155), tiles, 118, 118, 102, B); // jack-o-lantern E/S drawBlockImage(img, getRect(156), tiles, 120, 118, 102, B); // jack-o-lantern N + drawBlockImage(img, getRect(221), tiles, 160, 160, 160, B); // lapis ore + drawBlockImage(img, getRect(222), tiles, 144, 144, 144, B); // lapis block + drawBlockImage(img, getRect(223), tiles, 45, 46, 62, B); // dispenser W + drawBlockImage(img, getRect(224), tiles, 46, 45, 62, B); // dispenser N + drawBlockImage(img, getRect(225), tiles, 45, 45, 62, B); // dispenser E/S + drawBlockImage(img, getRect(226), tiles, 192, 192, 176, B); // sandstone + drawBlockImage(img, getRect(227), tiles, 74, 74, 74, B); // note block drawPartialBlockImage(img, getRect(9), tiles, 205, 205, 205, B, 0.125); // water level 7 drawPartialBlockImage(img, getRect(10), tiles, 205, 205, 205, B, 0.25); // water level 6 @@ -1398,6 +1453,7 @@ bool BlockImages::construct(int B, const string& terrainfile, const string& fire drawPartialBlockImage(img, getRect(110), tiles, 1, 1, 1, B, 0.875); // stone pressure plate drawPartialBlockImage(img, getRect(119), tiles, 4, 4, 4, B, 0.875); // wood pressure plate drawPartialBlockImage(img, getRect(127), tiles, 66, 66, 66, B, 0.75); // snow + drawPartialBlockImage(img, getRect(228), tiles, 122, 122, 121, B, 0.5); // cake drawItemBlockImage(img, getRect(6), tiles, 15, B); // sapling drawItemBlockImage(img, getRect(30), tiles, 13, B); // yellow flower diff --git a/blockimages.h b/blockimages.h index 4af66d4..e950eb9 100755 --- a/blockimages.h +++ b/blockimages.h @@ -120,71 +120,71 @@ struct BlockImages // block image offsets: // -// 0 dummy/air (transparent) 32 brown mushroom 64 wheat level 2 96 cobble stairs asc S -// 1 stone 33 red mushroom 65 wheat level 1 97 cobble stairs asc N -// 2 grass 34 gold block 66 wheat level 0 98 cobble stairs asc W -// 3 dirt 35 iron block 67 soil 99 cobble stairs asc E -// 4 cobblestone 36 double step 68 UNUSED 100 wall sign facing E -// 5 wood 37 single step 69 UNUSED 101 wall sign facing W -// 6 sapling 38 brick 70 sign facing N/S 102 wall sign facing N -// 7 bedrock 39 TNT 71 sign facing NE/SW 103 wall sign facing S -// 8 water full/falling 40 bookshelf 72 sign facing E/W 104 UNUSED -// 9 water level 7 41 mossy cobblestone 73 sign facing SE/NW 105 UNUSED -// 10 water level 6 42 obsidian 74 wood door S side 106 UNUSED -// 11 water level 5 43 torch floor 75 wood door N side 107 UNUSED -// 12 water level 4 44 torch pointing S 76 wood door W side 108 UNUSED -// 13 water level 3 45 torch pointing N 77 wood door E side 109 UNUSED -// 14 water level 2 46 torch pointing W 78 wood door top S 110 stone pressure plate -// 15 water level 1 47 torch pointing E 79 wood door top N 111 iron door S side -// 16 lava full/falling 48 UNUSED 80 wood door top W 112 iron door N side -// 17 lava level 3 49 spawner 81 wood door top E 113 iron door W side -// 18 lava level 2 50 wood stairs asc S 82 ladder E side 114 iron door E side -// 19 lava level 1 51 wood stairs asc N 83 ladder W side 115 iron door top S -// 20 sand 52 wood stairs asc W 84 ladder N side 116 iron door top N -// 21 gravel 53 wood stairs asc E 85 ladder S side 117 iron door top W -// 22 gold ore 54 chest facing W 86 track EW 118 iron door top E -// 23 iron ore 55 redstone wire NSEW 87 track NS 119 wood pressure plate -// 24 coal ore 56 diamond ore 88 UNUSED 120 redstone ore -// 25 log 57 diamond block 89 UNUSED 121 red torch floor off -// 26 leaves 58 workbench 90 UNUSED 122 red torch floor on -// 27 sponge 59 wheat level 7 91 UNUSED 123 UNUSED -// 28 glass 60 wheat level 6 92 track NE corner 124 UNUSED -// 29 cloth 61 wheat level 5 93 track SE corner 125 UNUSED -// 30 yellow flower 62 wheat level 4 94 track SW corner 126 UNUSED -// 31 red rose 63 wheat level 3 95 track NW corner 127 snow +// 0 dummy/air (transparent) 32 brown mushroom 64 wheat level 2 96 cobble stairs asc S +// 1 stone 33 red mushroom 65 wheat level 1 97 cobble stairs asc N +// 2 grass 34 gold block 66 wheat level 0 98 cobble stairs asc W +// 3 dirt 35 iron block 67 soil 99 cobble stairs asc E +// 4 cobblestone 36 double step 68 UNUSED 100 wall sign facing E +// 5 wood 37 single step 69 UNUSED 101 wall sign facing W +// 6 sapling 38 brick 70 sign facing N/S 102 wall sign facing N +// 7 bedrock 39 TNT 71 sign facing NE/SW 103 wall sign facing S +// 8 water full/falling 40 bookshelf 72 sign facing E/W 104 UNUSED +// 9 water level 7 41 mossy cobblestone 73 sign facing SE/NW 105 UNUSED +// 10 water level 6 42 obsidian 74 wood door S side 106 UNUSED +// 11 water level 5 43 torch floor 75 wood door N side 107 UNUSED +// 12 water level 4 44 torch pointing S 76 wood door W side 108 UNUSED +// 13 water level 3 45 torch pointing N 77 wood door E side 109 UNUSED +// 14 water level 2 46 torch pointing W 78 wood door top S 110 stone pressure plate +// 15 water level 1 47 torch pointing E 79 wood door top N 111 iron door S side +// 16 lava full/falling 48 UNUSED 80 wood door top W 112 iron door N side +// 17 lava level 3 49 spawner 81 wood door top E 113 iron door W side +// 18 lava level 2 50 wood stairs asc S 82 ladder E side 114 iron door E side +// 19 lava level 1 51 wood stairs asc N 83 ladder W side 115 iron door top S +// 20 sand 52 wood stairs asc W 84 ladder N side 116 iron door top N +// 21 gravel 53 wood stairs asc E 85 ladder S side 117 iron door top W +// 22 gold ore 54 chest facing W 86 track EW 118 iron door top E +// 23 iron ore 55 redstone wire NSEW 87 track NS 119 wood pressure plate +// 24 coal ore 56 diamond ore 88 UNUSED 120 redstone ore +// 25 log 57 diamond block 89 UNUSED 121 red torch floor off +// 26 leaves 58 workbench 90 UNUSED 122 red torch floor on +// 27 sponge 59 wheat level 7 91 UNUSED 123 UNUSED +// 28 glass 60 wheat level 6 92 track NE corner 124 UNUSED +// 29 white wool 61 wheat level 5 93 track SE corner 125 UNUSED +// 30 yellow flower 62 wheat level 4 94 track SW corner 126 UNUSED +// 31 red rose 63 wheat level 3 95 track NW corner 127 snow // -// 128 ice 160 fence NS 192 stone button facing W -// 129 snow block 161 fence E 193 stone button facing E -// 130 cactus 162 fence NE 194 wall lever facing S -// 131 clay 163 fence SE 195 wall lever facing N -// 132 reeds 164 fence NSE 196 wall lever facing W -// 133 jukebox 165 fence W 197 wall lever facing E -// 134 fence post 166 fence NW 198 ground lever EW -// 135 pumpkin facing W 167 fence SW 199 ground lever NS -// 136 netherstone 168 fence NSW 200 track asc S -// 137 mud 169 fence EW 201 track asc N -// 138 lightstone 170 fence NEW 202 track asc E -// 139 portal 171 fence SEW 203 track asc W -// 140 jack-o-lantern W 172 fence NSEW -// 141 red torch S on 173 double chest N -// 142 red torch N on 174 double chest S -// 143 red torch E on 175 double chest E -// 144 red torch W on 176 double chest W -// 145 red torch S off 177 chest facing N -// 146 red torch N off 178 water missing W -// 147 red torch E off 179 water missing N -// 148 red torch W off 180 ice surface -// 149 UNUSED 181 ice missing W -// 150 UNUSED 182 ice missing N -// 151 UNUSED 183 furnace W -// 152 UNUSED 184 furnace N -// 153 pumpkin facing E/S 185 furnace E/S -// 154 pumpkin facing N 186 lit furnace W -// 155 jack-o-lantern E/S 187 lit furnace N -// 156 jack-o-lantern N 188 lit furnace E/S -// 157 water surface 189 fire -// 158 fence N 190 stone button facing S -// 159 fence S 191 stone button facing N +// 128 ice 160 fence NS 192 stone button facing W 224 dispenser N +// 129 snow block 161 fence E 193 stone button facing E 225 dispenser E/S +// 130 cactus 162 fence NE 194 wall lever facing S 226 sandstone +// 131 clay 163 fence SE 195 wall lever facing N 227 note block +// 132 reeds 164 fence NSE 196 wall lever facing W 228 cake +// 133 jukebox 165 fence W 197 wall lever facing E +// 134 fence post 166 fence NW 198 ground lever EW +// 135 pumpkin facing W 167 fence SW 199 ground lever NS +// 136 netherstone 168 fence NSW 200 track asc S +// 137 mud 169 fence EW 201 track asc N +// 138 lightstone 170 fence NEW 202 track asc E +// 139 portal 171 fence SEW 203 track asc W +// 140 jack-o-lantern W 172 fence NSEW 204 orange wool +// 141 red torch S on 173 double chest N 205 magenta wool +// 142 red torch N on 174 double chest S 206 light blue wool +// 143 red torch E on 175 double chest E 207 yellow wool +// 144 red torch W on 176 double chest W 208 lime wool +// 145 red torch S off 177 chest facing N 209 pink wool +// 146 red torch N off 178 water missing W 210 gray wool +// 147 red torch E off 179 water missing N 211 light gray wool +// 148 red torch W off 180 ice surface 212 cyan wool +// 149 UNUSED 181 ice missing W 213 purple wool +// 150 UNUSED 182 ice missing N 214 blue wool +// 151 UNUSED 183 furnace W 215 brown wool +// 152 UNUSED 184 furnace N 216 green wool +// 153 pumpkin facing E/S 185 furnace E/S 217 red wool +// 154 pumpkin facing N 186 lit furnace W 218 black wool +// 155 jack-o-lantern E/S 187 lit furnace N 219 dark 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 diff --git a/fire.png b/fire.png new file mode 100755 index 0000000..f230f96 Binary files /dev/null and b/fire.png differ