1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-26 01:09:08 -05:00

Merge branch 'master' of ssh://villavu.com:54367/simba

This commit is contained in:
Merlijn Wajer 2010-06-22 19:10:52 +02:00
commit 3a781aabf2
7 changed files with 32 additions and 7 deletions

View File

@ -1,8 +1,10 @@
program DTMEditor_Extension;
{$ifndef PS_EXTENSION}
var
Client : TClient;
Simba_MainMenu : TMainMenu;
{$endif}
{$i mml.simba}
const
Version = '0.5';
@ -607,7 +609,7 @@ begin
h := GetImageTarget;
if (bmpOverlay = nil) then
bmpOverlay := bmpBuffer.Copy(0, 0, bmpBuffer.Width - 1, bmpBuffer.Height - 1);
SetTargetBitmap(bmpBuffer.Index);
SetTargetBitmap(bmpBuffer);
if FindColorsTolerance(Points, getColour, 0, 0, bmpBuffer.Width - 1, bmpBuffer.Height - 1, getTolerance) then
bmpOverlay.DrawTPA(Points, MarkCol);
@ -1295,12 +1297,14 @@ begin
end;
end;
{$ifndef PS_EXTENSION}
procedure ThreadSafe_ShowForm;
var
v: TVariantArray;
begin
ThreadSafeCall('ShowForm', v);
end;
{$ENDIF}
{
Simba integration
@ -1344,6 +1348,8 @@ begin;
end;
begin
{$ifndef PS_EXTENSION}
Client := GetTClient;
ThreadSafe_ShowForm;
{$endif}
end.

View File

@ -356,6 +356,8 @@ begin
with PSInstance do
begin
{$I ../../Units/MMLAddon/PSInc/psdefines.inc}
Defines.Add('PS_EXTENSION');
Defines.Add('EXTENSION');
end;
PSInstance.Script := Self.Script;

View File

@ -46,7 +46,7 @@ uses
CastaliaSimplePasPar, v_AutoCompleteForm, PSDump;
const
SimbaVersion = 695;
SimbaVersion = 700;
type
@ -2980,14 +2980,14 @@ begin
Result := false;
with TSaveDialog.Create(nil) do
try
filter := 'Simba Files|*.Simba;*.simb;*.cogat;*.mufa;*.txt;*.' +
filter := 'Simba Files|*.simba;*.simb;*.cogat;*.mufa;*.txt;*.' +
LoadSettingDef('Settings/Extensions/FileExtension','sex')+
'|Any files|*.*';
if Execute then
begin;
if ExtractFileExt(FileName) = '' then
begin;
ScriptFile := FileName + '.Simba';
ScriptFile := FileName + '.simba';
end else
ScriptFile := FileName;
CurrScript.SynEdit.Lines.SaveToFile(ScriptFile);

View File

@ -21,6 +21,10 @@
Math.inc for the Mufasa Macro Library
}
function ps_round(e : extended) : integer; extdecl;
begin
result := round(e);
end;
function ps_iAbs(a : integer) : integer;extdecl;
begin
result := abs(a);

View File

@ -52,7 +52,7 @@ AddFunction(@ps_CreateDTMPoint,'function CreateDTMPoint(x,y,c,t,asz : integer; b
{maths}
SetCurrSection('Math');
AddFunction(nil,'function Round(e:extended) : integer');
AddFunction(@ps_round,'function Round(e:extended) : integer');
AddFunction(@ps_ceil,'function ceil(e : extended) : integer');
AddFunction(@ps_floor,'function floor(e : extended) : integer');
AddFunction(@ps_pow,'function pow(base,exponent : extended) : extended');

View File

@ -2042,7 +2042,7 @@ var
i, h: Integer;
begin
h := High(tI);
Temp := tI;
Temp := Copy(tI);
for i := 0 to h do
tI[i] := Temp[h - i];
end;

View File

@ -106,11 +106,24 @@ begin
end;
end;
procedure TPenColor_W(Self: TPen; const T: TColor);begin Self.Color := T; end;
procedure TPenColor_R(Self: TPen; var T: TColor);begin T := Self.Color; end;
procedure TPenMode_W(Self: TPen; const T: TPENMODE);begin Self.Mode := T; end;
procedure TPenMode_R(Self: TPen; var T: TPENMODE);begin T := Self.Mode; end;
procedure TPenWidth_W(Self: TPen; const T: Integer);begin Self.Width := T; Writeln(t); end;
procedure TPenWidth_R(Self: TPen; var T: Integer);begin T := Self.Width; Writeln(self.width) end;
procedure TPenStyle_W(Self: TPen; const T: TPenStyle);begin Self.Style := T; end;
procedure TPenStyle_R(Self: TPen; var T: TPenStyle);begin T := Self.Style; end;
procedure RIRegisterTPEN(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPEN) do
begin
RegisterConstructor(@TPEN.CREATE, 'CREATE');
RegisterPropertyHelper(@TPenStyle_R,@TPenStyle_W,'Style');
RegisterPropertyHelper(@TPenWidth_R,@TPenWidth_W,'Width');
RegisterPropertyHelper(@TPenMode_R,@TPenMode_W,'Mode');
RegisterPropertyHelper(@TPenColor_R,@TPenColor_W,'Color');
end;
end;