diff options
author | Perttu Ahola <celeron55@gmail.com> | 2010-12-25 02:33:41 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2010-12-25 02:33:41 +0200 |
commit | 3fe377be4e860f4ec9664688489e4e22090fc29d (patch) | |
tree | dd05ac1a18f42db79f811f67ec06fb4dcb5b02a3 | |
parent | 699d0e9a5efa555f4b4c7652a0ca571acf0afdb2 (diff) | |
download | minetest-3fe377be4e860f4ec9664688489e4e22090fc29d.tar.gz minetest-3fe377be4e860f4ec9664688489e4e22090fc29d.tar.bz2 minetest-3fe377be4e860f4ec9664688489e4e22090fc29d.zip |
builds on both platforms
-rw-r--r-- | data/tool_mesepick.png | bin | 0 -> 990 bytes | |||
-rw-r--r-- | minetest.vcproj | 4 | ||||
-rw-r--r-- | src/inventory.h | 2 | ||||
-rw-r--r-- | src/irrlichtwrapper.cpp | 2 | ||||
-rw-r--r-- | src/main.cpp | 4 | ||||
-rw-r--r-- | src/materials.cpp | 14 | ||||
-rw-r--r-- | src/server.cpp | 23 | ||||
-rw-r--r-- | src/servermain.cpp | 2 |
8 files changed, 45 insertions, 6 deletions
diff --git a/data/tool_mesepick.png b/data/tool_mesepick.png Binary files differnew file mode 100644 index 000000000..886f4b21c --- /dev/null +++ b/data/tool_mesepick.png diff --git a/minetest.vcproj b/minetest.vcproj index f7a125d0d..920329150 100644 --- a/minetest.vcproj +++ b/minetest.vcproj @@ -251,6 +251,10 @@ >
</File>
<File
+ RelativePath=".\src\materials.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\player.cpp"
>
</File>
diff --git a/src/inventory.h b/src/inventory.h index ff0086102..97eacef5b 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -336,6 +336,8 @@ public: basename = "../data/tool_wpick.png"; else if(m_toolname == "STPick") basename = "../data/tool_stpick.png"; + else if(m_toolname == "MesePick") + basename = "../data/tool_mesepick.png"; // Default to cloud texture else basename = tile_texture_path_get(TILE_CLOUD); diff --git a/src/irrlichtwrapper.cpp b/src/irrlichtwrapper.cpp index fc9f96b18..30de6846c 100644 --- a/src/irrlichtwrapper.cpp +++ b/src/irrlichtwrapper.cpp @@ -163,7 +163,7 @@ video::ITexture * ProgressBarTextureMod::make(video::ITexture *original, u32 barwidth = size.Width - barpad_x*2; v2u32 barpos(barpad_x, size.Height - barheight - barpad_y); - u32 barvalue_i = round((float)barwidth * value); + u32 barvalue_i = (u32)(((float)barwidth * value) + 0.5); video::SColor active(255,255,0,0); video::SColor inactive(255,0,0,0); diff --git a/src/main.cpp b/src/main.cpp index 47dcbf70f..d50491a4b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2363,8 +2363,8 @@ int main(int argc, char *argv[]) for(u16 i=0; i<to_be_removed_count; i++)
{
core::list<ChatLine>::Iterator
- i = chat_lines.begin();
- chat_lines.erase(i);
+ it = chat_lines.begin();
+ chat_lines.erase(it);
}
chat_guitext->setText(whole.c_str());
// Update gui element size and position
diff --git a/src/materials.cpp b/src/materials.cpp index 5c1419580..dc080ba23 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -11,10 +11,14 @@ void setStoneLikeDiggingProperties(u8 material, float toughness) { g_material_properties[material].setDiggingProperties("", DiggingProperties(true, 15.0*toughness, 0)); + g_material_properties[material].setDiggingProperties("WPick", DiggingProperties(true, 2.0*toughness, 65535./20.*toughness)); g_material_properties[material].setDiggingProperties("STPick", DiggingProperties(true, 1.0*toughness, 65535./50.*toughness)); + + /*g_material_properties[material].setDiggingProperties("MesePick", + DiggingProperties(true, 0.0*toughness, 65535./20.*toughness));*/ } void initializeMaterialProperties() @@ -52,7 +56,15 @@ void initializeMaterialProperties() g_material_properties[CONTENT_WOOD].setDiggingProperties("", DiggingProperties(true, 1.0, 0)); - + + /* + Add MesePick to everything + */ + for(u16 i=0; i<MATERIAL_PROPERTIES_COUNT; i++) + { + g_material_properties[i].setDiggingProperties("MesePick", + DiggingProperties(true, 0.0, 65535./20.)); + } g_material_properties_initialized = true; } diff --git a/src/server.cpp b/src/server.cpp index e1f7ba739..3bdabdfa6 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2780,6 +2780,22 @@ void Server::SendInventory(u16 peer_id) } } + // Mese pick + if(!found) + { + ItemSpec specs[9]; + specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_MESE); + specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_MESE); + specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_MESE); + specs[4] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[7] = ItemSpec(ITEM_CRAFT, "Stick"); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new ToolItem("MesePick", 0)); + found = true; + } + } + } /* @@ -3043,6 +3059,11 @@ void Server::handlePeerChange(PeerChange &c) } else { + /*{ + InventoryItem *item = new MaterialItem(CONTENT_MESE, 6); + void* r = player->inventory.addItem("main", item); + assert(r == NULL); + } { InventoryItem *item = new MaterialItem(CONTENT_COALSTONE, 6); void* r = player->inventory.addItem("main", item); @@ -3067,7 +3088,7 @@ void Server::handlePeerChange(PeerChange &c) InventoryItem *item = new ToolItem("STPick", 32000); void* r = player->inventory.addItem("main", item); assert(r == NULL); - } + }*/ /*// Give some lights { InventoryItem *item = new MaterialItem(CONTENT_TORCH, 999); diff --git a/src/servermain.cpp b/src/servermain.cpp index b8bc0dc54..9a35a4b0e 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -65,7 +65,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "constants.h" #include "strfnd.h" #include "porting.h" -//#include "irrlichtwrapper.h" +#include "materials.h" /* Settings. |