From 5864a50cbca44a5b170ce1862626f914158a98f0 Mon Sep 17 00:00:00 2001 From: sfb Date: Thu, 2 May 2013 14:34:40 -0500 Subject: [PATCH] merge --- code/CMakeLists.txt | 5 +++ .../include/nel/misc/event_emitter_multi.h | 2 +- code/nel/include/nel/misc/events.h | 14 ++++++++ code/nel/src/gui/libwww.cpp | 33 ------------------ code/nel/src/gui/stdpch.h | 3 +- code/nel/src/misc/win_event_emitter.cpp | 3 ++ .../src/plugins/CMakeLists.txt | 4 +++ code/nelns/naming_service/naming_service.cpp | 2 +- code/ryzom/client/src/events_listener.cpp | 7 ++++ .../interface_v3/input_handler_manager.cpp | 4 +-- .../src/interface_v3/interface_manager.cpp | 34 ++++++++++++++++++- code/ryzom/common/src/game_share/object.cpp | 2 +- .../server/src/ai_service/group_profile.cpp | 2 +- .../src/ai_share/ai_alias_description_node.h | 2 +- .../egs_sheets/egs_static_game_item.h | 10 +++--- 15 files changed, 80 insertions(+), 47 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index e71a1859d..1ae01610f 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -41,6 +41,11 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) # Force out of source builds. CHECK_OUT_OF_SOURCE() +# Specify Mac OS X deployment target before including Darwin.cmake +IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") +ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) SET(NL_VERSION_MAJOR 0) diff --git a/code/nel/include/nel/misc/event_emitter_multi.h b/code/nel/include/nel/misc/event_emitter_multi.h index 3de5f683d..3c6860e53 100644 --- a/code/nel/include/nel/misc/event_emitter_multi.h +++ b/code/nel/include/nel/misc/event_emitter_multi.h @@ -33,7 +33,7 @@ class CEventEmitterMulti : public IEventEmitter { public: /// dtor - ~CEventEmitterMulti(); + virtual ~CEventEmitterMulti(); /// add an emitter void addEmitter(IEventEmitter *e, bool mustDelete); /// remove an emitter (and delete it if necessary) diff --git a/code/nel/include/nel/misc/events.h b/code/nel/include/nel/misc/events.h index 87829926e..e05ef3d2f 100644 --- a/code/nel/include/nel/misc/events.h +++ b/code/nel/include/nel/misc/events.h @@ -65,6 +65,7 @@ const CClassId EventStringId (0x49b5af8f, 0x7f52cd26); const CClassId EventActivateId (0x7da66b0a, 0x1ef74519); const CClassId EventSetFocusId (0x17650fac, 0x19f85dde); const CClassId EventDestroyWindowId (0x69be73fe, 0x4b07603b); +const CClassId EventCloseWindowId (0xb5cb1333, 0xd092e63a); // Mouse events const CClassId EventMouseMoveId (0x3dd12fdb, 0x472f548b); @@ -504,6 +505,19 @@ public: virtual CEvent *clone() const {return new CEventDestroyWindow(*this);} }; +/** + * CEventCloseWindow + */ +class CEventCloseWindow : public CEvent +{ +public: + CEventCloseWindow (IEventEmitter* emitter) : CEvent (emitter, EventCloseWindowId) + { + } + + virtual CEvent *clone() const {return new CEventCloseWindow(*this);} +}; + /** * CEventIME */ diff --git a/code/nel/src/gui/libwww.cpp b/code/nel/src/gui/libwww.cpp index 6e9069f96..1926d6514 100644 --- a/code/nel/src/gui/libwww.cpp +++ b/code/nel/src/gui/libwww.cpp @@ -29,10 +29,6 @@ extern "C" #include "nel/gui/group_html.h" #include "nel/gui/libwww_nel_stream.h" -#ifdef HAVE_REVISION_H -#include "revision.h" -#endif - using namespace NLMISC; // The HText structure for libwww @@ -554,35 +550,6 @@ namespace NLGUI HTTrace_setCallback(NelTracer); /* Initiate libwww */ - -#if defined(HAVE_X86_64) -#define RYZOM_ARCH "x64" -#elif defined(HAVE_X86) -#define RYZOM_ARCH "x86" -#elif defined(HAVE_ARM) -#define RYZOM_ARCH "arm" -#else -#define RYZOM_ARCH "unknow" -#endif -#if defined(NL_OS_WINDOWS) -#define RYZOM_SYSTEM "windows" -#elif defined(NL_OS_MAC) -#define RYZOM_SYSTEM "mac" -#elif defined(NL_OS_UNIX) -#define RYZOM_SYSTEM "unix" -#else -#define RYZOM_SYSTEM "unkown" -#endif - -/* - char buffer[256]; -#ifdef REVISION - sprintf(buffer, "%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH); -#else - sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH); -#endif -*/ - HTLib_setAppName( CGroupHTML::options.appName.c_str() ); HTLib_setAppVersion( CGroupHTML::options.appVersion.c_str() ); diff --git a/code/nel/src/gui/stdpch.h b/code/nel/src/gui/stdpch.h index 6dfad8297..8ab2a3595 100644 --- a/code/nel/src/gui/stdpch.h +++ b/code/nel/src/gui/stdpch.h @@ -29,8 +29,9 @@ #include "nel/misc/uv.h" #include "nel/misc/hierarchical_timer.h" -#if NL_OS_WINDOWS +#ifdef NL_OS_WINDOWS #define NOMINMAX + #include #include #endif diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index b330d7e57..bb43e290b 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -281,6 +281,9 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA case WM_DESTROY: server->postEvent (new CEventDestroyWindow (this)); break; + case WM_CLOSE: + server->postEvent (new CEventCloseWindow (this)); + return true; case WM_DISPLAYCHANGE: server->postEvent (new CEventDisplayChange (LOWORD(lParam), HIWORD(lParam), (uint)wParam, this)); break; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt index 945e0825f..43900fe9e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt @@ -6,7 +6,11 @@ ADD_SUBDIRECTORY(log) ADD_SUBDIRECTORY(disp_sheet_id) ADD_SUBDIRECTORY(object_viewer) ADD_SUBDIRECTORY(georges_editor) + +IF(WITH_GUI) ADD_SUBDIRECTORY(gui_editor) +ENDIF(WITH_GUI) + ADD_SUBDIRECTORY(translation_manager) ADD_SUBDIRECTORY(bnp_manager) # Note: Temporarily disabled until development continues. diff --git a/code/nelns/naming_service/naming_service.cpp b/code/nelns/naming_service/naming_service.cpp index ab4d4f203..1c0dc465a 100644 --- a/code/nelns/naming_service/naming_service.cpp +++ b/code/nelns/naming_service/naming_service.cpp @@ -1139,7 +1139,7 @@ NLMISC_COMMAND (kill, "kill a service and send an unregister broadcast to other NLMISC_DYNVARIABLE(uint32, NbRegisteredServices, "display the number of service that are registered in naming service") { - if (get) *pointer = RegisteredServices.size(); + if (get) *pointer = (uint32)RegisteredServices.size(); } NLMISC_COMMAND( displayServiceInstances, "SIM: Display info on service instances", "" ) diff --git a/code/ryzom/client/src/events_listener.cpp b/code/ryzom/client/src/events_listener.cpp index bd2c6d45c..1d05f8a4e 100644 --- a/code/ryzom/client/src/events_listener.cpp +++ b/code/ryzom/client/src/events_listener.cpp @@ -90,6 +90,7 @@ void CEventsListener::addToServer(CEventServer& server) server.addListener(EventKeyDownId, this); server.addListener(EventKeyUpId, this); server.addListener(EventDestroyWindowId,this); + server.addListener(EventCloseWindowId, this); server.addListener(EventSetFocusId, this); server.addListener(EventDisplayChangeId, this); }// addToServer // @@ -108,6 +109,7 @@ void CEventsListener::removeFromServer (CEventServer& server) server.removeListener(EventKeyDownId, this); server.removeListener(EventKeyUpId, this); server.removeListener(EventDestroyWindowId,this); + server.removeListener(EventCloseWindowId, this); server.removeListener(EventSetFocusId, this); }// removeFromServer // @@ -141,6 +143,11 @@ void CEventsListener::operator()(const CEvent& event) // kill process exit(EXIT_SUCCESS); } + // Window close button pressed. + if(event == EventCloseWindowId) + { + CAHManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:quit_dialog"); + } // Event from the Mouse (ANGLE) if(event == EventGDMouseMove) { diff --git a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp index bccbb8535..62eac876c 100644 --- a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -94,6 +94,7 @@ void CInputHandlerManager::addToServer(NLMISC::CEventServer * server) // System server->addListener(EventGDMouseMove, this); server->addListener(EventDestroyWindowId, this); + server->addListener(EventCloseWindowId, this); server->addListener(EventSetFocusId, this); server->addListener(EventDisplayChangeId, this); @@ -118,6 +119,7 @@ void CInputHandlerManager::release() // System _EventServer->removeListener(EventGDMouseMove, this); _EventServer->removeListener(EventDestroyWindowId, this); + _EventServer->removeListener(EventCloseWindowId, this); _EventServer->removeListener(EventSetFocusId, this); _EventServer->removeListener(EventDisplayChangeId, this); @@ -133,10 +135,8 @@ void CInputHandlerManager::release() _EventServer->removeListener(EventCharId, this); _EventServer->removeListener(EventKeyDownId, this); _EventServer->removeListener(EventKeyUpId, this); - } - // *************************************************************************** void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) { diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 65eda61e8..d352aff91 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -132,6 +132,29 @@ using namespace NLGUI; #include "../global.h" +#ifdef HAVE_REVISION_H +#include "revision.h" +#endif + +#if defined(HAVE_X86_64) +#define RYZOM_ARCH "x64" +#elif defined(HAVE_X86) +#define RYZOM_ARCH "x86" +#elif defined(HAVE_ARM) +#define RYZOM_ARCH "arm" +#else +#define RYZOM_ARCH "unknow" +#endif +#if defined(NL_OS_WINDOWS) +#define RYZOM_SYSTEM "windows" +#elif defined(NL_OS_MAC) +#define RYZOM_SYSTEM "mac" +#elif defined(NL_OS_UNIX) +#define RYZOM_SYSTEM "unix" +#else +#define RYZOM_SYSTEM "unkown" +#endif + using namespace NLMISC; namespace NLGUI @@ -465,10 +488,19 @@ CInterfaceManager::CInterfaceManager() CViewRenderer::getInstance(); CViewTextID::setTextProvider( &SMTextProvider ); CViewTextFormated::setFormatter( &RyzomTextFormatter ); + + char buffer[256]; + +#ifdef REVISION + sprintf(buffer, "%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH); +#else + sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH); +#endif + CGroupHTML::options.trustedDomains = ClientCfg.WebIgTrustedDomains; CGroupHTML::options.languageCode = ClientCfg.getHtmlLanguageCode(); CGroupHTML::options.appName = "Ryzom"; - CGroupHTML::options.appVersion = RYZOM_VERSION; + CGroupHTML::options.appVersion = buffer; NLGUI::CDBManager::getInstance()->resizeBanks( NB_CDB_BANKS ); interfaceLinkUpdater = new CInterfaceLink::CInterfaceLinkUpdater(); diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index a034ddb2e..5f5394abf 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -507,7 +507,7 @@ bool CObject::getShortestName(std::string &instanceId, std::string &attrName, si return false; } instanceId = parent2->getAttr("InstanceId")->toString(); - attrName == parent2->getKey(index2); + attrName = parent2->getKey(index2); position = index; return true; } diff --git a/code/ryzom/server/src/ai_service/group_profile.cpp b/code/ryzom/server/src/ai_service/group_profile.cpp index 59d55cb64..2a605e96e 100644 --- a/code/ryzom/server/src/ai_service/group_profile.cpp +++ b/code/ryzom/server/src/ai_service/group_profile.cpp @@ -135,7 +135,7 @@ void CGrpProfileDynFollowPath::updateProfile(uint ticksSinceLastUpdate) _FollowRoute.setAIProfile(fr); - // faire gaffe à l'init du CGrpProfileFollowRouteSpawn dans le cadre statique .. :\ (adapter?) + // pay attention to CGrpProfileFollowRouteSpawn init in static case .. :\ (to adapt ?) #ifdef NL_DEBUG nlassert(_CurrentZone==_CurrentRoad->startZone() || _CurrentZone==_CurrentRoad->endZone()); #endif diff --git a/code/ryzom/server/src/ai_share/ai_alias_description_node.h b/code/ryzom/server/src/ai_share/ai_alias_description_node.h index d7ec509a0..3ea36a9a2 100644 --- a/code/ryzom/server/src/ai_share/ai_alias_description_node.h +++ b/code/ryzom/server/src/ai_share/ai_alias_description_node.h @@ -50,7 +50,7 @@ extern bool VerboseAliasDescriptionNodeLog; class CAIAliasDescriptionNode; -// à faire .. +// TODO... class CAIAliasDescriptionNode : public NLMISC::CRefCount { public: diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h index badcbb324..6fd990e65 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h @@ -157,11 +157,11 @@ public: /// params as strings std::vector StringParams; - //* Break when hit: Si une créature frappe le joueur, la consommation est immédiatement interrompue - //* Assis: le joueur peut consommer assis. - //* Debout: Le joueur peut consommer l'item debout, y compris en combat - //* Nage: le joueur peut consommer l'item lorsqu'il nage - //* Mektoub: le joueur peut consommer l'item lorsqu'il chevauche un mektoub + //* Break when hit: If a creature hits the player, consumption is immediatly aborted + //* Sit: player can consume item sit down + //* Stand Up: player can consume item stand up, including while fighting + //* Swim: player can consume item while swiming + //* Mektoub: player can consume item while riding a mektoub union { uint16 Data;