This commit is contained in:
blueloveTH 2023-05-11 22:11:49 +08:00
parent c5ffc53c66
commit 80a5d5a13e
4 changed files with 7 additions and 6 deletions

View File

@ -9,7 +9,7 @@ pipeline = [
["common.h", "memory.h", "vector.h", "str.h", "tuplelist.h", "namedict.h", "error.h", "lexer.h"],
["obj.h", "codeobject.h", "frame.h"],
["gc.h", "vm.h", "ceval.h", "expr.h", "compiler.h", "repl.h"],
["_generated.h", "iter.h", "base64.h", "cffi.h", "mat3x3.h", "requests.h", "io.h", "pocketpy.h"]
["_generated.h", "iter.h", "base64.h", "cffi.h", "linalg.h", "requests.h", "io.h", "pocketpy.h"]
]
copied = set()

View File

@ -262,7 +262,7 @@ struct Mat3x3{
};
struct PyVec2: Vec2 {
PY_CLASS(PyVec2, builtins, vec2)
PY_CLASS(PyVec2, linalg, vec2)
PyVec2() : Vec2() {}
PyVec2(float x, float y) : Vec2(x, y) {}
@ -378,7 +378,7 @@ struct PyVec2: Vec2 {
};
struct PyMat3x3: Mat3x3{
PY_CLASS(PyMat3x3, builtins, mat3x3)
PY_CLASS(PyMat3x3, linalg, mat3x3)
PyMat3x3(): Mat3x3(){}
PyMat3x3(const Mat3x3& other): Mat3x3(other){}

View File

@ -7,7 +7,7 @@
#include "iter.h"
#include "base64.h"
#include "cffi.h"
#include "mat3x3.h"
#include "linalg.h"
#include "requests.h"
#include "io.h"
#include "_generated.h"
@ -1053,8 +1053,9 @@ inline void VM::post_init(){
add_module_requests(this);
}
PyVec2::register_class(this, builtins);
PyMat3x3::register_class(this, builtins);
PyObject* linalg = new_module("linalg");
PyVec2::register_class(this, linalg);
PyMat3x3::register_class(this, linalg);
#endif
}