Skip to content
This repository
Browse code

Merge pull request #204 from EternalWind/master

Bugs fixed
  • Loading branch information...
commit 5c4f0f3be636c0395d1f8020fd08eb01607bcd8a 2 parents eea38bc + 2b94259
Sven-Hendrik Haase authored March 29, 2012
6  data/scripts/circular_movement.js
... ...
@@ -1,17 +1,17 @@
1 1
 var radius = 2;
2 2
 var speed = 0.5; // rotations per second
3 3
 
4  
-function OnCreate() {
  4
+function OnInitialize() {
5 5
     print("Component name property: " + this.component.name);
6 6
     print("Node: " + this.component.node.name);
7 7
 }
8 8
 
9  
-function OnDestroy() {
  9
+function OnDeinitialize() {
10 10
     print("Destroying circular_path script component.");
11 11
 }
12 12
 
13 13
 function OnUpdate(time_diff) {
14  
-    this.component.node.SetPosition(
  14
+    this.component.node.setPosition(
15 15
             this.radius * Math.sin(TotalTime * 2 * Math.PI * this.speed),
16 16
             this.radius * Math.cos(TotalTime * 2 * Math.PI * this.speed),
17 17
             0);
3  engine/src/Input/InputManager.hpp
@@ -195,7 +195,8 @@ class DUCTTAPE_API InputManager : public Manager,
195 195
         MC_BUTTON4     = 0xF2,    // Mouse Button 4
196 196
         MC_BUTTON5     = 0xF3,    // Mouse Button 5
197 197
         MC_BUTTON6     = 0xF4,    // Mouse Button 6
198  
-        MC_BUTTON7     = 0xF5     // Mouse Button 7
  198
+        MC_BUTTON7     = 0xF5,    // Mouse Button 7
  199
+        NONE           = 0xFF     // Invalid key
199 200
     };
200 201
 
201 202
     /**
4  engine/src/Logic/AdvancedPlayerComponent.hpp
@@ -6,8 +6,8 @@
6 6
 // http://www.gnu.org/licenses/lgpl.html
7 7
 // ----------------------------------------------------------------------------
8 8
 
9  
-#ifndef DUCTTAPE_ENGINE_COMPONENT_AdvancedPlayerComponent
10  
-#define DUCTTAPE_ENGINE_COMPONENT_AdvancedPlayerComponent
  9
+#ifndef DUCTTAPE_ENGINE_COMPONENT_ADVANCEDPLAYERCOMPONENT
  10
+#define DUCTTAPE_ENGINE_COMPONENT_ADVANCEDPLAYERCOMPONENT
11 11
 
12 12
 #include <Config.hpp>
13 13
 
14  engine/src/Logic/SimplePlayerComponent.cpp
@@ -25,22 +25,22 @@ SimplePlayerComponent::SimplePlayerComponent(const QString name)
25 25
       mMove(Ogre::Vector3::ZERO) {}
26 26
 
27 27
 void SimplePlayerComponent::onInitialize() {
28  
-    if(!QObject::connect(InputManager::get(), SIGNAL(sPressed(dt::InputManager::InputCode input_code, const OIS::EventArg& event)),
29  
-                         this,                SLOT(_HandleKeyPressed(dt::InputManager::InputCode input_code,
30  
-        const OIS::EventArg& event)))) {
  28
+    if(!QObject::connect(InputManager::get(), SIGNAL(sPressed(dt::InputManager::InputCode, const OIS::EventArg&)),
  29
+                         this,                SLOT(_handleKeyPressed(dt::InputManager::InputCode,
  30
+        const OIS::EventArg&)))) {
31 31
             Logger::get().error("Cannot connect the key pressed signal with " + getName()
32 32
                 + "'s keyboard input handling slot.");
33 33
     }
34 34
     if(mCostant) {
35  
-        if(!QObject::connect(InputManager::get(), SIGNAL(sReleased(dt::InputManager::InputCode input_code, const OIS::EventArg& event)),
36  
-                             this,                SLOT(_HandleKeyReleased(dt::InputManager::InputCode input_code,
37  
-            const OIS::EventArg& event)))) {
  35
+        if(!QObject::connect(InputManager::get(), SIGNAL(sReleased(dt::InputManager::InputCode, const OIS::EventArg&)),
  36
+                             this,                SLOT(_handleKeyReleased(dt::InputManager::InputCode,
  37
+            const OIS::EventArg&)))) {
38 38
                 Logger::get().error("Cannot connect the key released signal with " + getName()
39 39
                     + "'s keyboard input handling slot.");
40 40
         }
41 41
     }
42 42
     if(!QObject::connect(InputManager::get(), SIGNAL(sMouseMoved(const OIS::MouseEvent&)),
43  
-                         this,                SLOT(_HandleMouseInput(const OIS::MouseEvent&)))) {
  43
+                         this,                SLOT(_handleMouseInput(const OIS::MouseEvent&)))) {
44 44
             Logger::get().error("Cannot connect the mouse moved signal with " + getName()
45 45
                 + "'s mouse input handling slot.");
46 46
     }
2  tests/src/ScriptComponentTest/ScriptComponentTest.cpp
@@ -52,7 +52,7 @@ void Main::onInitialize() {
52 52
     auto meshnode = scene->addChildNode(new dt::Node("meshnode"));
53 53
     dt::MeshComponent* mesh = new dt::MeshComponent("Sinbad.mesh");
54 54
     meshnode->addComponent(mesh);
55  
-    meshnode->addComponent(new dt::ScriptComponent("circular_movement.js", "script"));
  55
+    meshnode->addComponent(new dt::ScriptComponent("circular_movement.js", "script", true));
56 56
 }
57 57
 
58 58
 

0 notes on commit 5c4f0f3

Please sign in to comment.
Something went wrong with that request. Please try again.