Browse Source

Use variadic SendEvent in Console::HandleTextFinished. Remove URHO3D_CXX11 define. Revert find_package (ODBC REQUIRED). Update porting notes.

Eugene Kozlov 8 years ago
parent
commit
c38a14c537
3 changed files with 13 additions and 7 deletions
  1. 4 1
      CMake/Modules/UrhoCommon.cmake
  2. 4 0
      Docs/Urho3D.dox
  3. 5 6
      Source/Urho3D/Engine/Console.cpp

+ 4 - 1
CMake/Modules/UrhoCommon.cmake

@@ -421,6 +421,10 @@ if (NOT URHO3D_LIB_TYPE STREQUAL SHARED AND NOT URHO3D_LIB_TYPE STREQUAL MODULE)
     endif ()
     endif ()
 endif ()
 endif ()
 
 
+if (URHO3D_DATABASE_ODBC)
+    find_package (ODBC REQUIRED)
+endif ()
+
 # Define preprocessor macros (for building the Urho3D library) based on the configured build options
 # Define preprocessor macros (for building the Urho3D library) based on the configured build options
 foreach (OPT
 foreach (OPT
         URHO3D_ANGELSCRIPT
         URHO3D_ANGELSCRIPT
@@ -462,7 +466,6 @@ if (WIN32 AND NOT CMAKE_PROJECT_NAME MATCHES ^Urho3D-ExternalProject-)
 endif ()
 endif ()
 
 
 # Platform and compiler specific options
 # Platform and compiler specific options
-add_definitions (-DURHO3D_CXX11)   # Note the define is NOT 'URHO3D_C++11'!
 if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
 if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
     # Use gnu++11/gnu++0x instead of c++11/c++0x as the latter does not work as expected when cross compiling
     # Use gnu++11/gnu++0x instead of c++11/c++0x as the latter does not work as expected when cross compiling
     if (VERIFIED_SUPPORTED_STANDARD)
     if (VERIFIED_SUPPORTED_STANDARD)

+ 4 - 0
Docs/Urho3D.dox

@@ -1362,6 +1362,10 @@ From 1.6 to 1.7:
 - Build system - the "Urho3D-CMake-common.cmake" file is now renamed to "UrhoCommon.cmake".
 - Build system - the "Urho3D-CMake-common.cmake" file is now renamed to "UrhoCommon.cmake".
 - Build system - downstream project is now responsible to add the HTML shell-file by calling the add_html_shell() macro or by passing "HTML_SHELL" option when calling the define_resource_dirs() in order to generate the HTML output when targeting Web platform, i.e. the build system defaults to JS output now, except when URHO3D_TESTING build option is set. When URHO3D_TESTING is set then it is assumed the output should be test runnable by using emrun, therefore the build system will automatically add the default HTML shell-file if none has been added yet.
 - Build system - downstream project is now responsible to add the HTML shell-file by calling the add_html_shell() macro or by passing "HTML_SHELL" option when calling the define_resource_dirs() in order to generate the HTML output when targeting Web platform, i.e. the build system defaults to JS output now, except when URHO3D_TESTING build option is set. When URHO3D_TESTING is set then it is assumed the output should be test runnable by using emrun, therefore the build system will automatically add the default HTML shell-file if none has been added yet.
 - Build system - when targeting macOS platform, the build tree will be configured to only target x86_64 arch by default as we are phasing out 32-bit mode. Use the URHO3D_UNIVERSAL build option, if you still want the universal binary build.
 - Build system - when targeting macOS platform, the build tree will be configured to only target x86_64 arch by default as we are phasing out 32-bit mode. Use the URHO3D_UNIVERSAL build option, if you still want the universal binary build.
+
+From 1.7 to master:
+- URHO3D_CXX11 define was removed. C++11 mode is unconditionally enabled.
+
 */
 */
 
 
 }
 }

+ 5 - 6
Source/Urho3D/Engine/Console.cpp

@@ -376,10 +376,9 @@ void Console::HandleTextFinished(StringHash eventType, VariantMap& eventData)
         // Send the command as an event for script subsystem
         // Send the command as an event for script subsystem
         using namespace ConsoleCommand;
         using namespace ConsoleCommand;
 
 
-        VariantMap& newEventData = GetEventDataMap();
-        newEventData[P_COMMAND] = line;
-        newEventData[P_ID] = static_cast<Text*>(interpreters_->GetSelectedItem())->GetText();
-        SendEvent(E_CONSOLECOMMAND, newEventData);
+        SendEvent(E_CONSOLECOMMAND,
+            P_COMMAND, line,
+            P_ID, static_cast<Text*>(interpreters_->GetSelectedItem())->GetText());
 
 
         // Make sure the line isn't the same as the last one
         // Make sure the line isn't the same as the last one
         if (history_.Empty() || line != history_.Back())
         if (history_.Empty() || line != history_.Back())
@@ -436,7 +435,7 @@ void Console::HandleLineEditKey(StringHash eventType, VariantMap& eventData)
                 historyPosition_ = history_.Size();
                 historyPosition_ = history_.Size();
             }
             }
         }
         }
-        
+
         // If no more auto complete options and history options left
         // If no more auto complete options and history options left
         if (autoCompletePosition_ == autoComplete_.Size() && historyPosition_ > 0)
         if (autoCompletePosition_ == autoComplete_.Size() && historyPosition_ > 0)
         {
         {
@@ -568,7 +567,7 @@ void Console::HandlePostUpdate(StringHash eventType, VariantMap& eventData)
         rowContainer_->RemoveItem((unsigned)0);
         rowContainer_->RemoveItem((unsigned)0);
         text = new Text(context_);
         text = new Text(context_);
         text->SetText(pendingRows_[i].second_);
         text->SetText(pendingRows_[i].second_);
-        
+
         // Highlight console messages based on their type
         // Highlight console messages based on their type
         text->SetStyle(logStyles[pendingRows_[i].first_]);
         text->SetStyle(logStyles[pendingRows_[i].first_]);