From 3fe377be4e860f4ec9664688489e4e22090fc29d Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 25 Dec 2010 02:33:41 +0200 Subject: [PATCH] builds on both platforms --- data/tool_mesepick.png | Bin 0 -> 990 bytes minetest.vcproj | 4 ++++ src/inventory.h | 2 ++ src/irrlichtwrapper.cpp | 2 +- src/main.cpp | 4 ++-- src/materials.cpp | 14 +++++++++++++- src/server.cpp | 23 ++++++++++++++++++++++- src/servermain.cpp | 2 +- 8 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 data/tool_mesepick.png diff --git a/data/tool_mesepick.png b/data/tool_mesepick.png new file mode 100644 index 0000000000000000000000000000000000000000..886f4b21c9cde5210568b1fdd6aaa29fe18b8320 GIT binary patch literal 990 zcmZvaK}eKQ5XXm132942gG7+v6(s}`6m^M`b@Lw~QbIw6N>HaMiHuGWQc)2Sb67G0 zD~PDTOEed|*l{gA1YIV&bSo%GM9RZ7-wLwp_Q88^-p8Bw`_F&g-TuBKxyH6eBFdpR ze>~QvY;0(VxnseHiR!5T*g#Kgy*#|Uc&& z2r&~t>3@feOi6`=i9twlQ%zbe-c?ORnFZjKT*R0akcgQL&Mn9$ic5Q&t1(#H4?!bC&Y|Z zArdj0#r+Y$Eav1j>RsK$lvN-cdc}=Rp%Qhl8%(1wU6f6l$$<}yHA+*A7Vzo6H5Oo#)@G7j_g+E}t*dwTz$IjFGz1hkLDUxBujZ zXL~oDdD3#N^U&Cqk%{jcuP=VQv^;n9+vmx*Z(cnrjlO)}edGQl23qI!DRvdQ3hm?5 ze`g-wnQq>#dLA->ma7S{JL`abpB}m-O|p!-}Mc*P8|I4@I@(8i=MvxRQJ%> EKNMTbNdN!< literal 0 HcmV?d00001 diff --git a/minetest.vcproj b/minetest.vcproj index f7a125d..9203291 100644 --- a/minetest.vcproj +++ b/minetest.vcproj @@ -250,6 +250,10 @@ RelativePath=".\src\mapsector.cpp" > + + diff --git a/src/inventory.h b/src/inventory.h index ff00861..97eacef 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 fc9f96b..30de684 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 47dcbf7..d50491a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2363,8 +2363,8 @@ int main(int argc, char *argv[]) for(u16 i=0; i::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 5c14195..dc080ba 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; iaddItem(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 b8bc0dc..9a35a4b 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.