orefkov 8 years ago
parent
commit
36a2f29580

+ 41 - 41
Source/Urho3D/AngelScript/ScriptAPIDump.cpp

@@ -329,16 +329,16 @@ void Script::DumpAPI(DumpMode mode, const String& sourceTree)
                 "#define uint16 unsigned short\n"
                 "#define uint64 unsigned long\n"
                 "#define null 0\n"
-				"#define in\n"
-				"#define out\n"
-				"#define inout\n"
-				"#define is ==\n"
-				"#define interface struct\n"
-				"#define class struct\n"
-				"#define cast reinterpret_cast\n"
-				"#define mixin\n"
-				"#define funcdef\n"
-			);
+                "#define in\n"
+                "#define out\n"
+                "#define inout\n"
+                "#define is ==\n"
+                "#define interface struct\n"
+                "#define class struct\n"
+                "#define cast reinterpret_cast\n"
+                "#define mixin\n"
+                "#define funcdef\n"
+            );
 
     unsigned types = scriptEngine_->GetObjectTypeCount();
     Vector<Pair<String, unsigned> > sortedTypes;
@@ -396,27 +396,27 @@ void Script::DumpAPI(DumpMode mode, const String& sourceTree)
             }
             else if (mode == C_HEADER)
             {
-                ///\todo Find a cleaner way to do this instead of hardcoding
-				if (type->GetFlags() & asOBJ_TEMPLATE) {
-					String str = "\ntemplate <";
-					for (asUINT tt = 0, ttm = type->GetSubTypeCount(); tt < ttm; tt++) {
-						asITypeInfo* pSubType = type->GetSubType(tt);
-						str += String("class ") + pSubType->GetName() + (tt < ttm - 1 ? ", " : ">");
-					}
-					Log::WriteRaw(str);
-				}
-				Log::WriteRaw("\nclass " + typeName + "\n{\npublic:\n");
-			}
-			if (mode == C_HEADER) {
-				for (asUINT m = 0, mc = type->GetBehaviourCount(); m < mc; m++) {
-					asEBehaviours bh;
-					asIScriptFunction* pM = type->GetBehaviourByIndex(m, &bh);
-					if (bh == asBEHAVE_CONSTRUCT || bh == asBEHAVE_DESTRUCT || bh == asBEHAVE_FACTORY)
-						Log::WriteRaw(String(pM->GetDeclaration(false, false, true)) + ";\n");
-				}
-				if (typeName == "String")
-					Log::WriteRaw("String(const char*);\n");
-			}
+                if (type->GetFlags() & asOBJ_TEMPLATE) {
+                    String str = "\ntemplate <";
+                    for (asUINT tt = 0, ttm = type->GetSubTypeCount(); tt < ttm; tt++) {
+                        asITypeInfo* pSubType = type->GetSubType(tt);
+                        str += String("class ") + pSubType->GetName() + (tt < ttm - 1 ? ", " : ">");
+                    }
+                    Log::WriteRaw(str);
+                }
+                Log::WriteRaw("\nclass " + typeName + "\n{\npublic:\n");
+            }
+            if (mode == C_HEADER)
+            {
+                for (asUINT m = 0, mc = type->GetBehaviourCount(); m < mc; m++) {
+                    asEBehaviours bh;
+                    asIScriptFunction* pM = type->GetBehaviourByIndex(m, &bh);
+                    if (bh == asBEHAVE_CONSTRUCT || bh == asBEHAVE_DESTRUCT || bh == asBEHAVE_FACTORY)
+                        Log::WriteRaw(String(pM->GetDeclaration(false, false, true)) + ";\n");
+                }
+                if (typeName == "String")
+                    Log::WriteRaw("String(const char*);\n");
+            }
 
             unsigned methods = type->GetMethodCount();
             for (unsigned j = 0; j < methods; ++j)
@@ -433,16 +433,16 @@ void Script::DumpAPI(DumpMode mode, const String& sourceTree)
                 else
                 {
                     // Sanitate the method name. For some operators fix name
-					if (declaration.Contains("::op")) {
-						declaration.Replace("::opEquals(", "::operator==(");
-						declaration.Replace("::opAssign(", "::operator=(");
-						declaration.Replace("::opAddAssign(", "::operator+=(");
-						declaration.Replace("::opAdd(", "::operator+(");
-						declaration.Replace("::opCmp(", "::operator<(");
-						declaration.Replace("::opPreInc(", "::operator++(");
-						declaration.Replace("::opPostInc()", "::operator++(int)");
-					}
-					if (!declaration.Contains("::op"))
+                    if (declaration.Contains("::op")) {
+                        declaration.Replace("::opEquals(", "::operator==(");
+                        declaration.Replace("::opAssign(", "::operator=(");
+                        declaration.Replace("::opAddAssign(", "::operator+=(");
+                        declaration.Replace("::opAdd(", "::operator+(");
+                        declaration.Replace("::opCmp(", "::operator<(");
+                        declaration.Replace("::opPreInc(", "::operator++(");
+                        declaration.Replace("::opPostInc()", "::operator++(int)");
+                    }
+                    if (!declaration.Contains("::op"))
                     {
                         String prefix(typeName + "::");
                         declaration.Replace(prefix, "");

+ 14 - 11
Source/Urho3D/Scene/Node.cpp

@@ -1907,17 +1907,20 @@ Animatable* Node::FindAttributeAnimationTarget(const String& name, String& outNa
         {
             if (names[i].Front() != '#')
                 break;
-			
-			String name = names[i].Substring(1, names[i].Length() - 1);
-			char s = name.Front();
-			if (s >= '0' && s <= '9') {
-				unsigned index = ToUInt(name);
-				node = node->GetChild(index);
-			} else {
-				node = node->GetChild(name, true);
-			}
-			
-			if (!node)
+            
+            String name = names[i].Substring(1, names[i].Length() - 1);
+            char s = name.Front();
+            if (s >= '0' && s <= '9')
+            {
+                unsigned index = ToUInt(name);
+                node = node->GetChild(index);
+            }
+            else
+            {
+                node = node->GetChild(name, true);
+            }
+            
+            if (!node)
             {
                 URHO3D_LOGERROR("Could not find node by name " + name);
                 return 0;

+ 6 - 6
Source/Urho3D/Urho2D/ParticleEmitter2D.cpp

@@ -270,13 +270,13 @@ URHO3D_EVENT(E_PARTICLESDURATION, ParticlesDuration) {
 void ParticleEmitter2D::HandleScenePostUpdate(StringHash eventType, VariantMap& eventData)
 {
     using namespace ScenePostUpdate;
-	unsigned tests = (numParticles_ > 0 ? 1 : 0) | (emissionTime_ > 0.0f ? 2 : 0);
-	float timeStep = eventData[P_TIMESTEP].GetFloat();
+    unsigned tests = (numParticles_ > 0 ? 1 : 0) | (emissionTime_ > 0.0f ? 2 : 0);
+    float timeStep = eventData[P_TIMESTEP].GetFloat();
     Update(timeStep);
-	if ((tests & 2) && emissionTime_ == 0.0f)
-		SendEvent(E_PARTICLESDURATION);	// emitting particles stoped
-	if ((tests & 1) && !numParticles_)
-		SendEvent(E_PARTICLESEND);		// all particles over
+    if ((tests & 2) && emissionTime_ == 0.0f)
+        SendEvent(E_PARTICLESDURATION); // emitting particles stoped
+    if ((tests & 1) && !numParticles_)
+        SendEvent(E_PARTICLESEND);      // all particles over
 }
 
 void ParticleEmitter2D::Update(float timeStep)