Merge branch 'electronstudio:master' into master
This commit is contained in:
commit
227e122f76
3 changed files with 9 additions and 7 deletions
|
@ -43,7 +43,7 @@ def makefunc(a):
|
|||
def func(*args):
|
||||
modified_args = []
|
||||
for (c_arg, arg) in zip(ffi.typeof(a).args, args):
|
||||
# print("arg:",str(arg), "c_arg.kind:", c_arg.kind, "c_arg:", c_arg, "type(arg):",str(type(arg)))
|
||||
#print("arg:",str(arg), "c_arg.kind:", c_arg.kind, "c_arg:", c_arg, "type(arg):",str(type(arg)))
|
||||
if c_arg.kind == 'pointer':
|
||||
if type(arg) == str:
|
||||
arg = arg.encode('utf-8')
|
||||
|
@ -53,6 +53,8 @@ def makefunc(a):
|
|||
arg = ffi.new("int *", arg)
|
||||
elif type(arg) is float:
|
||||
arg = ffi.new("float *", arg)
|
||||
elif type(arg) is list and str(c_arg) == "<ctype 'char * *'>":
|
||||
arg = [ffi.new("char[]", x.encode('utf-8')) for x in arg]
|
||||
elif str(type(arg)) == "<class '_cffi_backend.__CDataOwn'>" and "*" not in str(arg): # CPython
|
||||
arg = ffi.addressof(arg)
|
||||
elif str(type(arg)) == "<class '_cffi_backend._CDataBase'>" and "*" not in str(arg): # Pypy
|
||||
|
|
|
@ -170,11 +170,11 @@ def build_unix():
|
|||
|
||||
def build_windows():
|
||||
print("BUILDING FOR WINDOWS")
|
||||
ffibuilder.cdef(open("raylib/raylib.h.modified").read().replace("bool", "int"))
|
||||
ffibuilder.cdef(open("raylib/rlgl.h.modified").read().replace("bool", "int"))
|
||||
ffibuilder.cdef(open("raylib/raygui.h.modified").read().replace("bool", "int"))
|
||||
ffibuilder.cdef(open("raylib/physac.h.modified").read().replace("bool", "int"))
|
||||
ffibuilder.cdef(open("raylib/raymath.h.modified").read().replace("bool", "int"))
|
||||
ffibuilder.cdef(open("raylib/raylib.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/rlgl.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/raygui.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/physac.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/raymath.h.modified").read())
|
||||
ffibuilder.set_source("raylib._raylib_cffi", """
|
||||
#include "raylib.h"
|
||||
#include "rlgl.h"
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "4.2.1.1"
|
||||
__version__ = "4.2.1.2"
|
Reference in a new issue