From b6a8fdb9655808668533d690127325faec6a260d Mon Sep 17 00:00:00 2001 From: nerzhul Date: Wed, 22 Apr 2015 11:47:22 +0200 Subject: [PATCH 01/14] Re-apply 972d17baea81ffe6d508b291ef97207a4822e1da... but not rename the container. Approved-By est31 --- src/environment.cpp | 4 ++-- src/environment.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index 8ade7fe05..96353dffb 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1238,7 +1238,7 @@ void ServerEnvironment::step(float dtime) // Read messages from object while(!obj->m_messages_out.empty()) { - m_active_object_messages.push_back( + m_active_object_messages.push( obj->m_messages_out.front()); obj->m_messages_out.pop(); } @@ -1462,7 +1462,7 @@ ActiveObjectMessage ServerEnvironment::getActiveObjectMessage() return ActiveObjectMessage(0); ActiveObjectMessage message = m_active_object_messages.front(); - m_active_object_messages.pop_front(); + m_active_object_messages.pop(); return message; } diff --git a/src/environment.h b/src/environment.h index 415a9ec31..a25a12db3 100644 --- a/src/environment.h +++ b/src/environment.h @@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include +#include #include #include "irr_v3d.h" #include "activeobject.h" @@ -378,7 +379,7 @@ private: // Active object list std::map m_active_objects; // Outgoing network message buffer for active objects - std::list m_active_object_messages; + std::queue m_active_object_messages; // Some timers float m_send_recommended_timer; IntervalLimiter m_object_management_interval; From 271677f7afb3c4e7c25da7dad53ee2a3139f8faa Mon Sep 17 00:00:00 2001 From: est31 Date: Wed, 22 Apr 2015 14:10:39 +0200 Subject: [PATCH 02/14] Protocol 25: wstring -> string for custom access denial reasons Also fix std::logic_error when server::DenyAccess() is used with only two arguments. --- src/network/clientpackethandler.cpp | 4 +--- src/network/serverpackethandler.cpp | 2 +- src/server.cpp | 4 ++-- src/server.h | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 68d4245f8..bddf8f6fd 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -149,9 +149,7 @@ void Client::handleCommand_AccessDenied(NetworkPacket* pkt) u8 denyCode = SERVER_ACCESSDENIED_UNEXPECTED_DATA; *pkt >> denyCode; if (denyCode == SERVER_ACCESSDENIED_CUSTOM_STRING) { - std::wstring wide_reason; - *pkt >> wide_reason; - m_access_denied_reason = wide_to_narrow(wide_reason); + *pkt >> m_access_denied_reason; } else if (denyCode < SERVER_ACCESSDENIED_MAX) { m_access_denied_reason = accessDeniedStrings[denyCode]; diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 955b1a7dc..6b1d5bc02 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -217,7 +217,7 @@ void Server::handleCommand_Auth(NetworkPacket* pkt) << "but it was disallowed for the following reason: " << reason << std::endl; DenyAccess(pkt->getPeerId(), SERVER_ACCESSDENIED_CUSTOM_STRING, - narrow_to_wide(reason.c_str())); + reason.c_str()); return; } } diff --git a/src/server.cpp b/src/server.cpp index e8fdea7d1..921dd14de 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1490,7 +1490,7 @@ void Server::SendBreath(u16 peer_id, u16 breath) Send(&pkt); } -void Server::SendAccessDenied(u16 peer_id, AccessDeniedCode reason, const std::wstring &custom_reason) +void Server::SendAccessDenied(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason) { DSTACK(__FUNCTION_NAME); @@ -2535,7 +2535,7 @@ void Server::RespawnPlayer(u16 peer_id) } } -void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::wstring &custom_reason) +void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason) { DSTACK(__FUNCTION_NAME); diff --git a/src/server.h b/src/server.h index ba993523b..25ffb7fc6 100644 --- a/src/server.h +++ b/src/server.h @@ -360,7 +360,7 @@ public: void peerAdded(con::Peer *peer); void deletingPeer(con::Peer *peer, bool timeout); - void DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::wstring &custom_reason=NULL); + void DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason=""); void DenyAccess_Legacy(u16 peer_id, const std::wstring &reason); bool getClientConInfo(u16 peer_id, con::rtt_stat_type type,float* retval); bool getClientInfo(u16 peer_id,ClientState* state, u32* uptime, @@ -383,7 +383,7 @@ private: void SendMovement(u16 peer_id); void SendHP(u16 peer_id, u8 hp); void SendBreath(u16 peer_id, u16 breath); - void SendAccessDenied(u16 peer_id, AccessDeniedCode reason, const std::wstring &custom_reason); + void SendAccessDenied(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason); void SendAccessDenied_Legacy(u16 peer_id, const std::wstring &reason); void SendDeathscreen(u16 peer_id,bool set_camera_point_target, v3f camera_point_target); void SendItemDef(u16 peer_id,IItemDefManager *itemdef, u16 protocol_version); From d78f995868d685b1e47799c7b8314fa98e8cdf78 Mon Sep 17 00:00:00 2001 From: paramat Date: Tue, 21 Apr 2015 12:09:32 +0100 Subject: [PATCH 03/14] DecoSchematic: Fix missing trees in rough terrain Move place_on check to before place_center_x/y/z displacement of p Reduce displacement of p by place_center_x/y/z flags to correctly position schematics --- src/mg_decoration.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/mg_decoration.cpp b/src/mg_decoration.cpp index ec2d3e8b0..84f60b029 100644 --- a/src/mg_decoration.cpp +++ b/src/mg_decoration.cpp @@ -324,26 +324,23 @@ size_t DecoSchematic::generate(MMVManip *vm, PseudoRandom *pr, v3s16 p) if (schematic == NULL) return 0; - if (flags & DECO_PLACE_CENTER_X) - p.X -= (schematic->size.X + 1) / 2; - if (flags & DECO_PLACE_CENTER_Y) - p.Y -= (schematic->size.Y + 1) / 2; - if (flags & DECO_PLACE_CENTER_Z) - p.Z -= (schematic->size.Z + 1) / 2; - - bool force_placement = (flags & DECO_FORCE_PLACEMENT); - - if (!vm->m_area.contains(p)) - return 0; - u32 vi = vm->m_area.index(p); content_t c = vm->m_data[vi].getContent(); if (!CONTAINS(c_place_on, c)) return 0; + if (flags & DECO_PLACE_CENTER_X) + p.X -= (schematic->size.X - 1) / 2; + if (flags & DECO_PLACE_CENTER_Y) + p.Y -= (schematic->size.Y - 1) / 2; + if (flags & DECO_PLACE_CENTER_Z) + p.Z -= (schematic->size.Z - 1) / 2; + Rotation rot = (rotation == ROTATE_RAND) ? (Rotation)pr->range(ROTATE_0, ROTATE_270) : rotation; + bool force_placement = (flags & DECO_FORCE_PLACEMENT); + schematic->blitToVManip(p, vm, rot, force_placement, m_ndef); return 1; From 387a19662655fa4629f516f4fc35bdb1a9ee63c9 Mon Sep 17 00:00:00 2001 From: nerzhul Date: Fri, 24 Apr 2015 15:33:47 +0200 Subject: [PATCH 04/14] Remove unused variable Client::m_active_blocks --- src/client.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client.h b/src/client.h index 47b3c2e00..082b3d6dd 100644 --- a/src/client.h +++ b/src/client.h @@ -573,7 +573,6 @@ private: bool m_inventory_updated; Inventory *m_inventory_from_server; float m_inventory_from_server_age; - std::set m_active_blocks; PacketCounter m_packetcounter; bool m_show_highlighted; // Block mesh animation parameters From 00579d63058fbb975a49e05255eb0ca55804ce92 Mon Sep 17 00:00:00 2001 From: est31 Date: Fri, 24 Apr 2015 20:25:33 +0200 Subject: [PATCH 05/14] German translation: shorter setting name --- po/de/minetest.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/de/minetest.po b/po/de/minetest.po index d32a997ab..4df3be6d7 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -416,7 +416,7 @@ msgstr "Schöne Bäume" #: builtin/mainmenu/tab_settings.lua:189 msgid "Opaque Water" -msgstr "Undurchsichtiges Wasser" +msgstr "Undurchs. Wasser" #: builtin/mainmenu/tab_settings.lua:191 msgid "Connected Glass" From 6f1c5d20dbe5c9cbfaff262454df76b5193c5640 Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Fri, 13 Mar 2015 14:39:55 +1000 Subject: [PATCH 06/14] Disable noclip button for Android --- src/touchscreengui.cpp | 6 +++++- src/touchscreengui.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/touchscreengui.cpp b/src/touchscreengui.cpp index f5868133f..619d17f74 100644 --- a/src/touchscreengui.cpp +++ b/src/touchscreengui.cpp @@ -39,7 +39,7 @@ using namespace irr::core; extern Settings *g_settings; -const char** touchgui_button_imagenames = (const char*[]) { +const char *touchgui_button_imagenames[] = { "up_arrow.png", "down_arrow.png", "left_arrow.png", @@ -49,7 +49,9 @@ const char** touchgui_button_imagenames = (const char*[]) { "jump_btn.png", "down.png", "fly_btn.png", +#ifdef ENABLE_ANDROID_NOCLIP "noclip_btn.png", +#endif "fast_btn.png", "debug_btn.png", "chat_btn.png", @@ -88,9 +90,11 @@ static irr::EKEY_CODE id2keycode(touch_gui_button_id id) case fly_id: key = "freemove"; break; +#ifdef ENABLE_ANDROID_NOCLIP case noclip_id: key = "noclip"; break; +#endif case fast_id: key = "fastmove"; break; diff --git a/src/touchscreengui.h b/src/touchscreengui.h index bb3231793..79244b5f1 100644 --- a/src/touchscreengui.h +++ b/src/touchscreengui.h @@ -43,7 +43,9 @@ typedef enum { jump_id, crunch_id, fly_id, +#ifdef ENABLE_ANDROID_NOCLIP noclip_id, +#endif fast_id, debug_id, chat_id, From 443dbd8413f758bbde6fa1c43ccf48088490e28b Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Fri, 13 Mar 2015 17:16:57 +1000 Subject: [PATCH 07/14] Fix extern decl. of touchgui_button_imagenames --- src/touchscreengui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/touchscreengui.h b/src/touchscreengui.h index 79244b5f1..f6633fd5e 100644 --- a/src/touchscreengui.h +++ b/src/touchscreengui.h @@ -58,7 +58,7 @@ typedef enum { #define MAX_TOUCH_COUNT 64 #define BUTTON_REPEAT_DELAY 0.2f -extern const char** touchgui_button_imagenames; +extern const char *touchgui_button_imagenames[]; class TouchScreenGUI { From e54da61f4051769421b080bda19cf884ea5130b8 Mon Sep 17 00:00:00 2001 From: OttoLidenbrock Date: Thu, 16 Apr 2015 16:36:18 +1000 Subject: [PATCH 08/14] Fix noclip button (touchscreen) removal patch --- src/touchscreengui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/touchscreengui.cpp b/src/touchscreengui.cpp index 619d17f74..bea266e5c 100644 --- a/src/touchscreengui.cpp +++ b/src/touchscreengui.cpp @@ -260,11 +260,13 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc, float density) m_screensize.X, m_screensize.Y - (button_size*1.5)), L"fly", false, SLOW_BUTTON_REPEAT); +#ifdef ENABLE_ANDROID_NOCLIP /* init noclip button */ initButton(noclip_id, rect(m_screensize.X - (0.75*button_size), 2.25*button_size, m_screensize.X, 3*button_size), L"clip", false, SLOW_BUTTON_REPEAT); +#endif /* init fast button */ initButton(fast_id, From 603715c9877d0b3f2c00226b769fdc8a5c3230f5 Mon Sep 17 00:00:00 2001 From: OttoLidenbrock Date: Thu, 16 Apr 2015 16:45:05 +1000 Subject: [PATCH 09/14] Remove help info and debug info from pause menu --- src/game.cpp | 54 +++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 3dcfcfaa9..798b069a3 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1029,9 +1029,13 @@ static inline void create_formspec_menu(GUIFormSpecMenu **cur_formspec, } #ifdef __ANDROID__ -#define SIZE_TAG "size[11,5.5]" +# define SIZE_TAG "size[11,5.5]" +# define PAUSE_MENU_SIZE_TAG "size[6,3.5]" +# define PAUSE_MENU_BUTTON_LEFT 1.5 #else -#define SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop +# define SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop +# define PAUSE_MENU_SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop +# define PAUSE_MENU_BUTTON_LEFT 4 #endif static void show_chat_menu(GUIFormSpecMenu **cur_formspec, @@ -1083,19 +1087,19 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec, bool singleplayermode) { #ifdef __ANDROID__ - std::string control_text = wide_to_narrow(wstrgettext("Default Controls:\n" - "No menu visible:\n" - "- single tap: button activate\n" - "- double tap: place/use\n" - "- slide finger: look around\n" - "Menu/Inventory visible:\n" - "- double tap (outside):\n" - " -->close\n" - "- touch stack, touch slot:\n" - " --> move stack\n" - "- touch&drag, tap 2nd finger\n" - " --> place single item to slot\n" - )); +// std::string control_text = wide_to_narrow(wstrgettext("Default Controls:\n" +// "No menu visible:\n" +// "- single tap: button activate\n" +// "- double tap: place/use\n" +// "- slide finger: look around\n" +// "Menu/Inventory visible:\n" +// "- double tap (outside):\n" +// " -->close\n" +// "- touch stack, touch slot:\n" +// " --> move stack\n" +// "- touch&drag, tap 2nd finger\n" +// " --> place single item to slot\n" +// )); #else std::string control_text = wide_to_narrow(wstrgettext("Default Controls:\n" "- WASD: move\n" @@ -1114,29 +1118,31 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec, float ypos = singleplayermode ? 0.5 : 0.1; std::ostringstream os; - os << FORMSPEC_VERSION_STRING << SIZE_TAG - << "button_exit[4," << (ypos++) << ";3,0.5;btn_continue;" + os << FORMSPEC_VERSION_STRING << PAUSE_MENU_SIZE_TAG + << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_continue;" << wide_to_narrow(wstrgettext("Continue")) << "]"; if (!singleplayermode) { - os << "button_exit[4," << (ypos++) << ";3,0.5;btn_change_password;" + os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_change_password;" << wide_to_narrow(wstrgettext("Change Password")) << "]"; } #ifndef __ANDROID__ - os << "button_exit[4," << (ypos++) << ";3,0.5;btn_sound;" + os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_sound;" << wide_to_narrow(wstrgettext("Sound Volume")) << "]"; - os << "button_exit[4," << (ypos++) << ";3,0.5;btn_key_config;" + os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_key_config;" << wide_to_narrow(wstrgettext("Change Keys")) << "]"; #endif - os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_menu;" + os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_exit_menu;" << wide_to_narrow(wstrgettext("Exit to Menu")) << "]"; - os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;" + os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_exit_os;" << wide_to_narrow(wstrgettext("Exit to OS")) << "]" +#ifndef __ANDROID__ << "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]" - << "textarea[0.4,0.25;3.5,6;;" << PROJECT_NAME "\n" - << g_build_info << "\n" + << "textarea[0.4,0.25;3.5,6;;" << "Minetest\n" + << minetest_build_info << "\n" << "path_user = " << wrap_rows(porting::path_user, 20) +#endif << "\n;]"; /* Create menu */ From 90a3a06974b3ae0c17664aaec6ec74d547979228 Mon Sep 17 00:00:00 2001 From: OttoLidenbrock Date: Fri, 17 Apr 2015 15:27:39 +1000 Subject: [PATCH 10/14] Move android movement controls to left hand side and make space for 4 more --- src/touchscreengui.cpp | 49 +++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/src/touchscreengui.cpp b/src/touchscreengui.cpp index bea266e5c..e7e39a1e3 100644 --- a/src/touchscreengui.cpp +++ b/src/touchscreengui.cpp @@ -191,40 +191,53 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc, float density) 3 * button_size, m_screensize.Y); /* draw control pad - 0 1 2 - 3 4 5 - for now only 0, 1, 2, and 4 are used + 0 3 6 + 1 4 7 + 2 5 8 */ int number = 0; - for (int y = 0; y < 2; ++y) + for (int y = 0; y < 3; ++y) for (int x = 0; x < 3; ++x, ++number) { rect button_rect( - x * button_size, m_screensize.Y - button_size * (2 - y), - (x + 1) * button_size, m_screensize.Y - button_size * (1 - y) + y * button_size, m_screensize.Y - button_size * (3 - x), + (y + 1) * button_size, m_screensize.Y - button_size * (2 - x) ); touch_gui_button_id id = after_last_element_id; std::wstring caption; switch (number) { case 0: + break; + case 1: id = left_id; caption = L"<"; break; - case 1: + case 2: + break; + case 3: id = forward_id; caption = L"^"; break; - case 2: - id = right_id; - caption = L">"; - break; case 4: + id = jump_id; + caption = L"x"; + break; + case 5: id = backward_id; caption = L"v"; break; + case 6: + break; + case 7: + id = right_id; + caption = L">"; + break; + case 8: + break; + } if (id != after_last_element_id) { initButton(id, button_rect, caption, false); - } + } } /* init inventory button */ @@ -237,20 +250,12 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc, float density) rect(2.5*button_size, m_screensize.Y - (button_size/2), 3*button_size, m_screensize.Y), L"drop", true); - /* init jump button */ - initButton(jump_id, + /* init crunch button */ + initButton(crunch_id, rect(m_screensize.X-(1.75*button_size), m_screensize.Y - (0.5*button_size), m_screensize.X-(0.25*button_size), m_screensize.Y), - L"x",false); - - /* init crunch button */ - initButton(crunch_id, - rect(m_screensize.X-(3.25*button_size), - m_screensize.Y - (0.5*button_size), - m_screensize.X-(1.75*button_size), - m_screensize.Y), L"H",false); /* init fly button */ From 1cd0fe8546707014a816a199ae10d567e6a6e9a8 Mon Sep 17 00:00:00 2001 From: OttoLidenbrock Date: Fri, 17 Apr 2015 16:49:19 +1000 Subject: [PATCH 11/14] Fix non-android build --- src/game.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 798b069a3..66e929704 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1139,8 +1139,8 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec, << wide_to_narrow(wstrgettext("Exit to OS")) << "]" #ifndef __ANDROID__ << "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]" - << "textarea[0.4,0.25;3.5,6;;" << "Minetest\n" - << minetest_build_info << "\n" + << "textarea[0.4,0.25;3.5,6;;" << PROJECT_NAME "\n" + << g_build_info << "\n" << "path_user = " << wrap_rows(porting::path_user, 20) #endif << "\n;]"; From 600ad94abe7878a52b1b4637fe611336c5a052c3 Mon Sep 17 00:00:00 2001 From: OttoLidenbrock Date: Sun, 26 Apr 2015 14:59:55 +1000 Subject: [PATCH 12/14] Added left click to place block on android --- src/game.cpp | 16 +++++++++++++--- src/touchscreengui.cpp | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 66e929704..09ffb164f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3515,14 +3515,24 @@ void Game::handlePointingAtNode(GameRunData *runData, } } + bool digging = false; + if (runData->nodig_delay_timer <= 0.0 && input->getLeftState() && client->checkPrivilege("interact")) { handleDigging(runData, pointed, nodepos, playeritem_toolcap, dtime); + digging = true; } - if ((input->getRightClicked() || - runData->repeat_rightclick_timer >= m_repeat_right_click_time) && - client->checkPrivilege("interact")) { + bool place = (input->getRightClicked() || + runData->repeat_rightclick_timer >= m_repeat_right_click_time) && + client->checkPrivilege("interact"); + +#ifdef HAVE_TOUCHSCREENGUI + place &= !digging; + place |= input->getLeftReleased(); +#endif + + if (place) { runData->repeat_rightclick_timer = 0; infostream << "Ground right-clicked" << std::endl; diff --git a/src/touchscreengui.cpp b/src/touchscreengui.cpp index e7e39a1e3..fb1584b35 100644 --- a/src/touchscreengui.cpp +++ b/src/touchscreengui.cpp @@ -508,6 +508,24 @@ void TouchScreenGUI::translateEvent(const SEvent &event) translated->MouseInput.Event = EMIE_LMOUSE_LEFT_UP; m_receiver->OnEvent(*translated); delete translated; + } else if (!m_move_has_really_moved) { + SEvent* translated = new SEvent; + memset(translated,0,sizeof(SEvent)); + translated->EventType = EET_MOUSE_INPUT_EVENT; + translated->MouseInput.X = m_move_downlocation.X; + translated->MouseInput.Y = m_move_downlocation.Y; + translated->MouseInput.Shift = false; + translated->MouseInput.Control = false; + translated->MouseInput.ButtonStates = 0; + translated->MouseInput.Event = EMIE_LMOUSE_LEFT_UP; + m_receiver->OnEvent(*translated); + delete translated; + + m_shootline = m_device + ->getSceneManager() + ->getSceneCollisionManager() + ->getRayFromScreenCoordinates( + v2s32(event.TouchInput.X,event.TouchInput.Y)); } else { /* do double tap detection */ From 8cca19f6e17cc59b633f9fea54b11ead3e52d4c6 Mon Sep 17 00:00:00 2001 From: OttoLidenbrock Date: Sun, 26 Apr 2015 15:15:58 +1000 Subject: [PATCH 13/14] Added lua function to get project name Usage: minetest.get_project_name() E.g. if (minetest.get_project_name() == "Minetest") then --- src/script/lua_api/l_env.cpp | 7 +++++++ src/script/lua_api/l_env.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 0fe1ddec3..38548e88b 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -894,6 +894,12 @@ int ModApiEnvMod::l_get_us_time(lua_State *L) return 1; } +int ModApiEnvMod::l_get_project_name(lua_State *L) +{ + lua_pushstring(L, PROJECT_NAME); + return 1; +} + void ModApiEnvMod::Initialize(lua_State *L, int top) { API_FCT(set_node); @@ -934,4 +940,5 @@ void ModApiEnvMod::Initialize(lua_State *L, int top) API_FCT(forceload_block); API_FCT(forceload_free_block); API_FCT(get_us_time); + API_FCT(get_project_name); } diff --git a/src/script/lua_api/l_env.h b/src/script/lua_api/l_env.h index 5c9afd2f1..6a50132ce 100644 --- a/src/script/lua_api/l_env.h +++ b/src/script/lua_api/l_env.h @@ -166,6 +166,8 @@ private: // get us precision time static int l_get_us_time(lua_State *L); + static int l_get_project_name(lua_State *L); + public: static void Initialize(lua_State *L, int top); }; From 8cf938c9283a67d26bb0b65ae8bd2e5e117b511e Mon Sep 17 00:00:00 2001 From: OttoLidenbrock Date: Mon, 27 Apr 2015 00:54:48 +1000 Subject: [PATCH 14/14] Change project name and version (not android yet) Update package Vendor and Email and version number Change version to 1.0.1 Partially change project name Changed android version code to 1 --- CMakeLists.txt | 4 ++-- build/android/Makefile | 4 ++-- src/client/clientlauncher.cpp | 2 +- src/game.cpp | 10 +++++----- src/guiEngine.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2561d1917..91c90e7a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,8 +197,8 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game") set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) -set(CPACK_PACKAGE_VENDOR "celeron55") -set(CPACK_PACKAGE_CONTACT "Perttu Ahola ") +set(CPACK_PACKAGE_VENDOR "MoNTE48") +set(CPACK_PACKAGE_CONTACT "MoNTE48@mail.ua") if(WIN32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) diff --git a/build/android/Makefile b/build/android/Makefile index 569a45a68..c989a0b77 100644 --- a/build/android/Makefile +++ b/build/android/Makefile @@ -19,8 +19,8 @@ GAMES_TO_COPY = minetest_game # Android Version code # Increase for each build! ################################################################################ -# Play Store actual version (16/03/15): 11 -ANDROID_VERSION_CODE = 12 + +ANDROID_VERSION_CODE = 1 ################################################################################ # toolchain config for arm old processors diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index 5307ccd4b..4b51ecf49 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -183,7 +183,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args) { // Set the window caption const wchar_t *text = wgettext("Main Menu"); - device->setWindowCaption((narrow_to_wide(PROJECT_NAME) + L" [" + text + L"]").c_str()); + device->setWindowCaption((narrow_to_wide("MultiCraft") + L" [" + text + L"]").c_str()); delete[] text; try { // This is used for catching disconnects diff --git a/src/game.cpp b/src/game.cpp index 09ffb164f..33e01c5cd 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2035,7 +2035,7 @@ bool Game::createClient(const std::string &playername, /* Set window caption */ - std::wstring str = narrow_to_wide(PROJECT_NAME); + std::wstring str = narrow_to_wide("MultiCraft"); str += L" ["; str += driver->getName(); str += L"]"; @@ -2060,7 +2060,7 @@ bool Game::initGui() { // First line of debug text guitext = guienv->addStaticText( - narrow_to_wide(PROJECT_NAME).c_str(), + narrow_to_wide("MultiCraft").c_str(), core::rect(0, 0, 0, 0), false, false, guiroot); @@ -4034,7 +4034,7 @@ void Game::updateGui(float *statustext_time, const RunStats &stats, std::ostringstream os(std::ios_base::binary); os << std::fixed - << PROJECT_NAME " " << g_version_hash + << "MultiCraft " << g_version_hash << " FPS = " << fps << " (R: range_all=" << draw_control->range_all << ")" << std::setprecision(0) @@ -4050,7 +4050,7 @@ void Game::updateGui(float *statustext_time, const RunStats &stats, guitext->setVisible(true); } else if (flags.show_hud || flags.show_chat) { std::ostringstream os(std::ios_base::binary); - os << PROJECT_NAME " " << g_version_hash; + os << "MultiCraft " << g_version_hash; guitext->setText(narrow_to_wide(os.str()).c_str()); guitext->setVisible(true); } else { @@ -4283,7 +4283,7 @@ void the_game(bool *kill, } catch (SerializationError &e) { error_message = std::string("A serialization error occurred:\n") + e.what() + "\n\nThe server is probably " - " running a different version of " PROJECT_NAME "."; + " running a different version of MultiCraft."; errorstream << error_message << std::endl; } catch (ServerError &e) { error_message = e.what(); diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index 6989ffa35..4ef9a0645 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -172,7 +172,7 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev, m_sound_manager = &dummySoundManager; //create topleft header - std::wstring t = narrow_to_wide(std::string(PROJECT_NAME " ") + + std::wstring t = narrow_to_wide(std::string("MultiCraft ") + g_version_hash); core::rect rect(0, 0, g_fontengine->getTextWidth(t), g_fontengine->getTextHeight());