builds on both platforms
authorPerttu Ahola <celeron55@gmail.com>
Sat, 25 Dec 2010 00:33:41 +0000 (02:33 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 25 Dec 2010 00:33:41 +0000 (02:33 +0200)
data/tool_mesepick.png [new file with mode: 0644]
minetest.vcproj
src/inventory.h
src/irrlichtwrapper.cpp
src/main.cpp
src/materials.cpp
src/server.cpp
src/servermain.cpp

diff --git a/data/tool_mesepick.png b/data/tool_mesepick.png
new file mode 100644 (file)
index 0000000..886f4b2
Binary files /dev/null and b/data/tool_mesepick.png differ
index f7a125d0d9e929940afe0fc5eaecf244e60709c2..920329150af691213ab8a2af93237749f25115b7 100644 (file)
                                RelativePath=".\src\mapsector.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath=".\src\materials.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath=".\src\player.cpp"\r
                                >\r
index ff0086102cfc7bb0d33c06d0fe02dfb3c0ee8527..97eacef5b4e9ea719557103c8c0ff442a5292b94 100644 (file)
@@ -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);
index fc9f96b18320522c54e2f27bc5d000df453de164..30de6846cf501f73c02aacc29b99128a5d60b80e 100644 (file)
@@ -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);
index 47dcbf70fb10d86e9796382e632fadfcc45f1fdd..d50491a4b8c8ce307afc328e82693b9a3407cf69 100644 (file)
@@ -2363,8 +2363,8 @@ int main(int argc, char *argv[])
                        for(u16 i=0; i<to_be_removed_count; i++)\r
                        {\r
                                core::list<ChatLine>::Iterator\r
-                                               i = chat_lines.begin();\r
-                               chat_lines.erase(i);\r
+                                               it = chat_lines.begin();\r
+                               chat_lines.erase(it);\r
                        }\r
                        chat_guitext->setText(whole.c_str());\r
                        // Update gui element size and position\r
index 5c141958027500cbedf9e0e8ed463327b0a3ddde..dc080ba2304cf130fc0ba4f75020e1de48e43a41 100644 (file)
@@ -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;
 }
index e1f7ba7395b1b5795151654225d5de8d4e9e10de..3bdabdfa66c83d6c38380d9631a8584517d0d165 100644 (file)
@@ -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);
index b8bc0dc542691db66a7a97316f997a24ae5e54af..9a35a4b0e1f92f2bcbfc6d07f579e22462e9e295 100644 (file)
@@ -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.