浏览代码

Add property with no prefix. Remove fixed propety error code in pkg files.

Aster Jian 12 年之前
父节点
当前提交
63dfd780ba

+ 3 - 16
Extras/LuaScript/pkgs/Math/BoundingBox.pkg

@@ -54,20 +54,7 @@ public:
     Vector3 max_ @ max;
     bool defined_ @ defined;
     
-    tolua_readonly tolua_property__get_set Vector3 center;
-    tolua_readonly tolua_property__get_set Vector3 size;
-    tolua_readonly tolua_property__get_set Vector3 halfSize;
+    tolua_readonly tolua_property__no_prefix Vector3 center;
+    tolua_readonly tolua_property__no_prefix Vector3 size;
+    tolua_readonly tolua_property__no_prefix Vector3 halfSize;
 };
-
-${
-
-#define TOLUA_DISABLE_tolua_get_BoundingBox_center
-#define tolua_get_BoundingBox_center tolua_MathLuaAPI_BoundingBox_Center00
-
-#define TOLUA_DISABLE_tolua_get_BoundingBox_size
-#define tolua_get_BoundingBox_size tolua_MathLuaAPI_BoundingBox_Size00
-
-#define TOLUA_DISABLE_tolua_get_BoundingBox_halfSize
-#define tolua_get_BoundingBox_halfSize tolua_MathLuaAPI_BoundingBox_HalfSize00
-
-$}

+ 1 - 9
Extras/LuaScript/pkgs/Navigation/NavigationMesh.pkg

@@ -51,8 +51,8 @@ public:
     bool Build(const BoundingBox& boundingBox);
     
     /// Find a path between world space points. Return non-empty list of points if successful. Extents specifies how far off the navigation mesh the points can be.
-    // void FindPath(PODVector<Vector3>& dest, const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
     tolua_outside PODVector<Vector3> NavigationMeshFindPath @ FindPath(const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
+    tolua_outside PODVector<Vector3> NavigationMeshFindPath @ FindPath(const Vector3& start, const Vector3& end);
     
     /// Return a random point on the navigation mesh.
     Vector3 GetRandomPoint();
@@ -130,12 +130,4 @@ PODVector<Vector3> NavigationMeshFindPath(NavigationMesh* navMesh, const Vector3
     return dest;
 }
 
-// Patch for NavigationMesh.worldBoundingBox property.
-#define TOLUA_DISABLE_tolua_get_NavigationMesh_worldBoundingBox
-#define tolua_get_NavigationMesh_worldBoundingBox tolua_NavigationLuaAPI_NavigationMesh_GetWorldBoundingBox00
-
-// Patch for NavigationMesh.numTiles property.
-#define TOLUA_DISABLE_tolua_get_NavigationMesh_numTiles
-#define tolua_get_NavigationMesh_numTiles tolua_NavigationLuaAPI_NavigationMesh_GetNumTiles00
-
 $}

+ 0 - 8
Extras/LuaScript/pkgs/Physics/CollisionShape.pkg

@@ -91,11 +91,3 @@ public:
     tolua_property__get_set unsigned lodLevel;
     tolua_readonly tolua_property__get_set BoundingBox worldBoundingBox;
 };
-
-${
-
-// Patch for CollisionShape.worldBoundingBox property.
-#define TOLUA_DISABLE_tolua_get_CollisionShape_worldBoundingBox
-#define tolua_get_CollisionShape_worldBoundingBox tolua_PhysicsLuaAPI_CollisionShape_GetWorldBoundingBox00
-
-$}

+ 0 - 7
Extras/LuaScript/pkgs/Physics/Constraint.pkg

@@ -91,10 +91,3 @@ public:
     tolua_readonly tolua_property__get_set RigidBody* ownBody;
     tolua_property__get_set RigidBody* otherBody;
 };
-
-${
-
-#define TOLUA_DISABLE_tolua_get_Constraint_worldPosition
-#define tolua_get_Constraint_worldPosition tolua_PhysicsLuaAPI_Constraint_GetWorldPosition00
-
-$}

+ 0 - 8
Extras/LuaScript/pkgs/Physics/PhysicsWorld.pkg

@@ -108,11 +108,3 @@ public:
     tolua_property__get_set bool internalEdge;
     tolua_property__get_set bool splitImpulse;
 };
-
-${
-
-// Patch for PhysicsWorld.gravity property.
-#define TOLUA_DISABLE_tolua_get_PhysicsWorld_gravity
-#define tolua_get_PhysicsWorld_gravity tolua_PhysicsLuaAPI_PhysicsWorld_GetGravity00
-
-$}

+ 0 - 23
Extras/LuaScript/pkgs/Physics/RigidBody.pkg

@@ -180,26 +180,3 @@ public:
     tolua_property__get_set unsigned collisionMask;
     tolua_property__get_set CollisionEventMode collisionEventMode;
 };
-
-${
-
-#define TOLUA_DISABLE_tolua_get_RigidBody_position
-#define tolua_get_RigidBody_position tolua_PhysicsLuaAPI_RigidBody_GetPosition00
-
-
-#define TOLUA_DISABLE_tolua_get_RigidBody_rotation
-#define tolua_get_RigidBody_rotation tolua_PhysicsLuaAPI_RigidBody_GetRotation00
-
-#define TOLUA_DISABLE_tolua_get_RigidBody_linearVelocity
-#define tolua_get_RigidBody_linearVelocity tolua_PhysicsLuaAPI_RigidBody_GetLinearVelocity00
-
-#define TOLUA_DISABLE_tolua_get_RigidBody_linearFactor
-#define tolua_get_RigidBody_linearFactor tolua_PhysicsLuaAPI_RigidBody_GetLinearFactor00
-
-#define TOLUA_DISABLE_tolua_get_RigidBody_angularVelocity
-#define tolua_get_RigidBody_angularVelocity tolua_PhysicsLuaAPI_RigidBody_GetAngularVelocity00
-
-#define TOLUA_DISABLE_tolua_get_RigidBody_angularFactor
-#define tolua_get_RigidBody_angularFactor tolua_PhysicsLuaAPI_RigidBody_GetAngularFactor00
-
-$}

+ 0 - 8
Extras/LuaScript/pkgs/UI/Sprite.pkg

@@ -44,11 +44,3 @@ public:
     tolua_property__get_set ResourceRef textureAttr;
     tolua_property__get_set const Matrix3x4& transform;
 };
-
-${
-
-// Fixed textureAttr property.
-#define TOLUA_DISABLE_tolua_get_Sprite_textureAttr
-#define tolua_get_Sprite_textureAttr tolua_UILuaAPI_Sprite_GetTextureAttr00
-
-$}

+ 1 - 4
Extras/LuaScript/pkgs/UI/UIElement.pkg

@@ -301,10 +301,7 @@ UIElement* UIElementGetChild(const UIElement* uiElement, const char* name, bool
 {
     return uiElement->GetChild(String(name), recursive);
 }
-#define GetStyle GetAppliedStyle
 
-// Fixed combinedScreenRect property.
-#define TOLUA_DISABLE_tolua_get_UIElement_combinedScreenRect_ref
-#define tolua_get_UIElement_combinedScreenRect_ref tolua_UILuaAPI_UIElement_GetCombinedScreenRect00
+#define GetStyle GetAppliedStyle
 
 $}

+ 5 - 0
Extras/LuaScript/pkgs/basic.lua

@@ -86,4 +86,9 @@ function get_property_methods_hook(ptype, name)
         local Name = string.upper(string.sub(name, 1, 1))..string.sub(name, 2)
         return "Has"..Name, "Set"..Name
     end
+    
+    if ptype == "no_prefix" then
+        local Name = string.upper(string.sub(name, 1, 1))..string.sub(name, 2)
+        return Name, "Set"..Name
+    end
 end