mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-28 20:12:16 -05:00
Fixes for Windows.
This commit is contained in:
parent
90e1e538a6
commit
7ff7047562
@ -23,12 +23,12 @@ begin
|
|||||||
C:=TCLient.Create('');
|
C:=TCLient.Create('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function getmousepos: tpoint;
|
function getmousepos: tpoint; cdecl;
|
||||||
begin
|
begin
|
||||||
C.IOManager.GetMousePos(result.x,result.y);
|
C.IOManager.GetMousePos(result.x,result.y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function returnpoints: PTPoint;
|
function returnpoints: PTPoint; cdecl;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result := AllocMem(sizeof(TPoint) * 2);
|
result := AllocMem(sizeof(TPoint) * 2);
|
||||||
@ -38,19 +38,19 @@ begin
|
|||||||
result[1].y := 30;
|
result[1].y := 30;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function printpoints(b: PTPoint; len: integer): boolean;
|
function printpoints(b: PTPoint; len: integer): boolean; cdecl;
|
||||||
var i:integer;
|
var i:integer;
|
||||||
begin
|
begin
|
||||||
for i := 0 to len - 1 do
|
for i := 0 to len - 1 do
|
||||||
writeln('X, Y: (' + inttostr(b[i].x) + ', ' + inttostr(b[i].y) + ')');
|
writeln('X, Y: (' + inttostr(b[i].x) + ', ' + inttostr(b[i].y) + ')');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure hoi(var i: integer);
|
procedure hoi(var i: integer); cdecl;
|
||||||
begin
|
begin
|
||||||
i := i + 1;
|
i := i + 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function givedtm:PPDTM;
|
function givedtm:PPDTM; cdecl;
|
||||||
var
|
var
|
||||||
dtm: PPDTM;
|
dtm: PPDTM;
|
||||||
begin
|
begin
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from ctypes import *
|
from ctypes import *
|
||||||
|
import platform
|
||||||
|
|
||||||
|
if platform.system() == 'Windows':
|
||||||
|
dll = CDLL('./libmml.dll')
|
||||||
|
print 'On Windows'
|
||||||
|
else:
|
||||||
dll = CDLL('./libmml.so')
|
dll = CDLL('./libmml.so')
|
||||||
dll.test.restype = c_char_p
|
dll.test.restype = c_char_p
|
||||||
a = dll.test()
|
a = dll.test()
|
||||||
@ -14,6 +19,7 @@ class POINT(Structure):
|
|||||||
('y', c_int)]
|
('y', c_int)]
|
||||||
|
|
||||||
dll.getmousepos.restype = POINT
|
dll.getmousepos.restype = POINT
|
||||||
|
dll.getmousepos.argtypes = None
|
||||||
b = dll.getmousepos()
|
b = dll.getmousepos()
|
||||||
|
|
||||||
print b.x, b.y
|
print b.x, b.y
|
||||||
@ -30,8 +36,8 @@ dll.printpoints.argtypes = [PPOINT, c_int]
|
|||||||
|
|
||||||
d = dll.printpoints(c, 2)
|
d = dll.printpoints(c, 2)
|
||||||
|
|
||||||
dll.hoi.restype = None
|
#dll.hoi.restype = None
|
||||||
dll.hoi.argtypes = [POINTER(c_int)]
|
#dll.hoi.argtypes = [POINTER(c_int)]
|
||||||
|
|
||||||
e = c_int(5)
|
e = c_int(5)
|
||||||
dll.hoi(byref(e))
|
dll.hoi(byref(e))
|
||||||
|
Loading…
Reference in New Issue
Block a user