summaryrefslogtreecommitdiff
path: root/ThirdParty/tolua-5.2.4/src/tests/tfunction.pkg
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-08 10:53:42 +0800
committerchai <chaifix@163.com>2021-11-08 10:53:42 +0800
commit5f46b4102c179680d613b6b9e0e6d392318030d2 (patch)
tree16527828dc89133f7af41acf6f5c13c23743e7ef /ThirdParty/tolua-5.2.4/src/tests/tfunction.pkg
parent138d3f4d3d6e2aaf5ba34f89af15ef85ea074357 (diff)
+ tolua
Diffstat (limited to 'ThirdParty/tolua-5.2.4/src/tests/tfunction.pkg')
-rw-r--r--ThirdParty/tolua-5.2.4/src/tests/tfunction.pkg73
1 files changed, 73 insertions, 0 deletions
diff --git a/ThirdParty/tolua-5.2.4/src/tests/tfunction.pkg b/ThirdParty/tolua-5.2.4/src/tests/tfunction.pkg
new file mode 100644
index 0000000..1e4eae0
--- /dev/null
+++ b/ThirdParty/tolua-5.2.4/src/tests/tfunction.pkg
@@ -0,0 +1,73 @@
+$#include "tfunction.h"
+
+typedef enum {
+ FIRST = 1,
+ SECOND = 2
+} Order;
+
+class Point
+{
+ enum Error {
+ SUCCESS = 0,
+ ERROR = 1
+ };
+
+ Point (float x=0, float y=0);
+ virtual ~Point ();
+
+ void set (float x, float y);
+ void set (float v[2]=0);
+ void setpointer (Point* p);
+ void setref (Point& p);
+ void setvalue (Point p);
+ void setconst (const Point* p);
+
+ void get (float* x=0, float* y=0) const;
+ void get (float v[2]=0) const;
+ Point* getpointer ();
+ Point& getref ();
+ Point getvalue ();
+ const Point* getconst () const;
+
+ Point operator+ (const Point& p) const;
+ Point operator- (const Point& p) const;
+ Point operator* (const Point& p) const;
+ Point operator/ (float n) const;
+ bool operator< (const Point& p) const;
+ bool operator<= (const Point& p) const;
+ bool operator== (const Point& p) const;
+
+ tolua_len size () const;
+ float operator[] (int i) const;
+ float& operator[] (int i);
+
+ static Error echo (Error e);
+};
+
+module alg
+{
+ Point add (const Point& p1, const Point& p2);
+ Point sub (const Point& p1, const Point& p2);
+ Point mult (const Point& p1, const Point& p2);
+ Point div (const Point& p1, float n);
+}
+
+void getpoint (const Point* p, float* x=0, float* y=0);
+void setpoint (Point* p, float x=0, float y=0);
+inline Point average (int n, Point v[n]);
+inline Point averagepointer (int n, Point* v[n]);
+inline void copyvector (int n, const Point v[n], Point u[n]=(u+i));
+
+inline Order invert (Order o);
+
+$cfile "tfunction.h"
+
+/*
+class ColorPoint : public Point
+{
+ ColorPoint (float px, float py, float cr=0.0f, float cg=0.0f, float cb=0.0f);
+ virtual ~ColorPoint ();
+ virtual void getcolor (float* red, float *green, float *blue) const;
+ static const Point* MakeRed (float x, float y);
+};
+*/