From 0a46930651034ea0c6c10994a64fbc4a0f410ede Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 29 Nov 2009 11:40:10 +0000 Subject: [PATCH] Added some functions. git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@249 3f818213-9676-44b0-a9b4-5e4c4e03d09d --- Units/MMLAddon/PSInc/Wrappers/other.inc | 5 +++++ Units/MMLAddon/PSInc/pscompile.inc | 3 +++ 2 files changed, 8 insertions(+) diff --git a/Units/MMLAddon/PSInc/Wrappers/other.inc b/Units/MMLAddon/PSInc/Wrappers/other.inc index 1b5c5e6..0deeb12 100644 --- a/Units/MMLAddon/PSInc/Wrappers/other.inc +++ b/Units/MMLAddon/PSInc/Wrappers/other.inc @@ -69,6 +69,11 @@ begin; Result := Round(Sqrt(Sqr(x2-x1) + Sqr(y2-y1))); end; +procedure TerminateScript; +begin; + CurrThread.PSScript.Stop; +end; + procedure HakunaMatata; begin; OpenWebPage('http://www.youtube.com/v/ejEVczA8PLU&hl=en&fs=1&autoplay=1'); diff --git a/Units/MMLAddon/PSInc/pscompile.inc b/Units/MMLAddon/PSInc/pscompile.inc index 0af347d..e55654c 100644 --- a/Units/MMLAddon/PSInc/pscompile.inc +++ b/Units/MMLAddon/PSInc/pscompile.inc @@ -24,6 +24,7 @@ Sender.Comp.AddConstantN('AppPath','string').SetString(CurrThread.AppPath); Sender.Comp.AddConstantN('ScriptPath','string').SetString(CurrThread.ScriptPath); Sender.Comp.AddTypeS('TIntegerArray', 'Array of integer'); +Sender.Comp.AddTypes('TBox', 'record X1,Y1,X2,Y2 : Integer; end;'); Sender.Comp.AddTypeS('TPointArray','Array of TPoint'); Sender.Comp.AddTypeS('TBmpMirrorStyle','(MirrorWidth,MirrorHeight,MirrorLine)'); Sender.Comp.AddTypeS('TMask','record White, Black : TPointArray; WhiteHi,BlackHi : integer; W,H : integer;end;'); @@ -56,6 +57,7 @@ Sender.AddFunction(@ps_addDTM, 'function AddDTM(d: TDTM): Integer;'); Sender.AddFunction(@ps_addpDTM, 'function AddpDTM(d: pDTM): Integer;'); {maths} +sender.AddFunction(@ceil,'function ceil(e : extended) : integer'); sender.AddFunction(@power,'function pow(base,exponent : extended) : extended'); Sender.AddFunction(@max,'function Max(a, b: Integer): Integer;'); Sender.AddFunction(@min,'function Min(a, b: Integer): Integer;'); @@ -90,6 +92,7 @@ Sender.AddFunction(@GetTickCount, 'function GetSystemTime: Integer;'); Sender.AddFunction(@CreateForm,'function CreateForm : TForm;'); Sender.AddFunction(@CreateButton,'function CreateButton(Owner : TComponent) : TButton'); Sender.AddFunction(@HakunaMatata,'procedure HakunaMatata;'); +Sender.AddFunction(@TerminateScript,'procedure TerminateScript;'); {web} Sender.AddFunction(@OpenWebPage,'procedure OpenWebPage(url : string);');