浏览代码

Vector4: signed index

1vanK 3 年之前
父节点
当前提交
2e351e83a9
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 4 4
      Source/Urho3D/AngelScript/Generated_Members.h
  2. 2 2
      Source/Urho3D/Math/Vector4.h

+ 4 - 4
Source/Urho3D/AngelScript/Generated_Members.h

@@ -6440,11 +6440,11 @@ template <class T> void RegisterMembers_Vector4(asIScriptEngine* engine, const c
     // bool Vector4::operator ==(const Vector4& rhs) const
     engine->RegisterObjectMethod(className, "bool opEquals(const Vector4&in) const", AS_METHODPR(T, operator==, (const Vector4&) const, bool), AS_CALL_THISCALL);
 
-    // float Vector4::operator [](unsigned index) const
-    engine->RegisterObjectMethod(className, "float opIndex(uint) const", AS_METHODPR(T, operator[], (unsigned) const, float), AS_CALL_THISCALL);
+    // float Vector4::operator [](i32 index) const
+    engine->RegisterObjectMethod(className, "float opIndex(int) const", AS_METHODPR(T, operator[], (i32) const, float), AS_CALL_THISCALL);
 
-    // float& Vector4::operator [](unsigned index)
-    engine->RegisterObjectMethod(className, "float& opIndex(uint)", AS_METHODPR(T, operator[], (unsigned), float&), AS_CALL_THISCALL);
+    // float& Vector4::operator [](i32 index)
+    engine->RegisterObjectMethod(className, "float& opIndex(int)", AS_METHODPR(T, operator[], (i32), float&), AS_CALL_THISCALL);
 
     // float Vector4::ProjectOntoAxis(const Vector3& axis) const
     engine->RegisterObjectMethod(className, "float ProjectOntoAxis(const Vector3&in) const", AS_METHODPR(T, ProjectOntoAxis, (const Vector3&) const, float), AS_CALL_THISCALL);

+ 2 - 2
Source/Urho3D/Math/Vector4.h

@@ -143,10 +143,10 @@ public:
     }
 
     /// Return const value by index.
-    float operator[](unsigned index) const { return (&x_)[index]; }
+    float operator[](i32 index) const { return (&x_)[index]; }
 
     /// Return mutable value by index.
-    float& operator[](unsigned index) { return (&x_)[index]; }
+    float& operator[](i32 index) { return (&x_)[index]; }
 
     /// Calculate dot product.
     float DotProduct(const Vector4& rhs) const { return x_ * rhs.x_ + y_ * rhs.y_ + z_ * rhs.z_ + w_ * rhs.w_; }