From 54137b8b83d21862cbf139ce38a886d08df68eca Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 7 Feb 2010 00:55:52 +0000 Subject: [PATCH] The executable is now created in the "trunk", rather than Projects/SAMufasaGUI/. Maybe fixed the colourpicker-black-screen bug.. not sure. git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@530 3f818213-9676-44b0-a9b4-5e4c4e03d09d --- trunk/Projects/SAMufasaGUI/project1.lpi | 9 ++++++--- trunk/Projects/SAMufasaGUI/testunit.pas | 8 ++++---- trunk/Units/MMLAddon/PSInc/Wrappers/dtm.inc | 5 +++++ .../Units/MMLAddon/PSInc/psexportedmethods.inc | 1 + trunk/Units/MMLAddon/colourpicker.pas | 7 ++++--- trunk/Units/MMLCore/dtm.pas | 17 ++++++++--------- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/trunk/Projects/SAMufasaGUI/project1.lpi b/trunk/Projects/SAMufasaGUI/project1.lpi index 735932d..c52f3ac 100644 --- a/trunk/Projects/SAMufasaGUI/project1.lpi +++ b/trunk/Projects/SAMufasaGUI/project1.lpi @@ -39,7 +39,7 @@ - + @@ -224,12 +224,16 @@ + + + + - + @@ -245,7 +249,6 @@ - diff --git a/trunk/Projects/SAMufasaGUI/testunit.pas b/trunk/Projects/SAMufasaGUI/testunit.pas index 757e3fc..4d4e3ef 100644 --- a/trunk/Projects/SAMufasaGUI/testunit.pas +++ b/trunk/Projects/SAMufasaGUI/testunit.pas @@ -43,7 +43,7 @@ uses ColorBox , about, framefunctionlist, ocr, updateform, simbasettings; const - SimbaVersion = 521; + SimbaVersion = 530; type @@ -545,9 +545,9 @@ begin exit; end; AppPath:= MainDir + DS; - includePath:= LoadSettingDef('Settings/Includes/Path', IncludeTrailingPathDelimiter(ExpandFileName(MainDir+ DS + '..' + DS + '..' + ds)) + 'Includes' + DS); - fontPath := LoadSettingDef('Settings/Fonts/Path', IncludeTrailingPathDelimiter(ExpandFileName(MainDir+ DS + '..' + DS + '..' + ds)) + 'Fonts' + DS); - PluginsPath := LoadSettingDef('Settings/Plugins/Path', ExpandFileName(MainDir + DS + '..' + DS + '..'+ DS + 'Plugins'+ DS)); + includePath:= IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Includes/Path', ExpandFileName(MainDir+DS+'Includes' + DS))); + fontPath := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Fonts/Path', ExpandFileName(MainDir+DS+ 'Fonts' + DS))); + PluginsPath := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Plugins/Path', ExpandFileName(MainDir+ DS+ 'Plugins' + DS))); ScriptErrorLine:= -1; CurrentSyncInfo.SyncMethod:= @Self.SafeCallThread; UseCPascal := LoadSettingDef('Settings/Interpreter/UseCPascal', 'False'); diff --git a/trunk/Units/MMLAddon/PSInc/Wrappers/dtm.inc b/trunk/Units/MMLAddon/PSInc/Wrappers/dtm.inc index 9b9b1a2..12cafb2 100644 --- a/trunk/Units/MMLAddon/PSInc/Wrappers/dtm.inc +++ b/trunk/Units/MMLAddon/PSInc/Wrappers/dtm.inc @@ -84,6 +84,11 @@ begin sAngle, eAngle, aStep, aFound); end; } +procedure ps_SetDTMName(DTM : integer; name : string); +begin + CurrThread.Client.MDTM.SetDTMName(DTM,name); +end; + function ps_DTMFromString(DTMString: String): Integer; extdecl; var dtm: pDTM; diff --git a/trunk/Units/MMLAddon/PSInc/psexportedmethods.inc b/trunk/Units/MMLAddon/PSInc/psexportedmethods.inc index 7fffc04..e33f0c6 100644 --- a/trunk/Units/MMLAddon/PSInc/psexportedmethods.inc +++ b/trunk/Units/MMLAddon/PSInc/psexportedmethods.inc @@ -30,6 +30,7 @@ AddFunction(@ps_PrintpDTM, 'Procedure PrintpDTM(tDTM : pDTM);'); AddFunction(@ps_GetDTM ,'function GetDTM(index: Integer; out dtm: pDTM): Boolean;'); AddFunction(@pDTMToTDTM, 'Function pDTMToTDTM(DTM: pDTM): TDTM;'); AddFunction(@tDTMTopDTM, 'Function tDTMTopDTM(DTM: TDTM): pDTM;'); +AddFunction(@ps_SetDTMName, 'procedure SetDTMName(DTM : integer; name : string);'); AddFunction(@ps_DTMFromString, 'function DTMFromString(DTMString: String): Integer;'); AddFunction(@ps_FreeDTM, 'procedure FreeDTM(DTM: Integer);'); AddFunction(@ps_FindDTM, 'function FindDTM(DTM: Integer; out x, y: Integer; x1, y1, x2, y2: Integer): Boolean;'); diff --git a/trunk/Units/MMLAddon/colourpicker.pas b/trunk/Units/MMLAddon/colourpicker.pas index b46fdb2..82038fd 100644 --- a/trunk/Units/MMLAddon/colourpicker.pas +++ b/trunk/Units/MMLAddon/colourpicker.pas @@ -100,7 +100,7 @@ var w, h: integer; SS : TShiftState; p : TPoint; - + bmp2 : Graphics.TBitmap; bmp: TMufasaBitmap; Desktop : TIOManager; @@ -173,8 +173,9 @@ begin { Copy the client to ImageMain } bmp:=TMufasaBitmap.Create; bmp.CopyClientToBitmap(Desktop, true, 0, 0, w-1, h-1); - ImageMain.Picture.Bitmap.Free; - ImageMain.Picture.Bitmap := bmp.ToTBitmap; + Bmp2 := Bmp.ToTBitmap; + ImageMain.Picture.Assign(bmp2); + bmp2.free; bmp.Free; { Set up handles and events } diff --git a/trunk/Units/MMLCore/dtm.pas b/trunk/Units/MMLCore/dtm.pas index 23ff406..1e6ffed 100644 --- a/trunk/Units/MMLCore/dtm.pas +++ b/trunk/Units/MMLCore/dtm.pas @@ -112,9 +112,10 @@ begin if not b then begin; if DTMList[i].n <> '' then - Writeln(Format('DTM [%s] was not freed',[DTMList[i].n])) + Writeln(Format('DTM[%s] has not been freed in the script, freeing it now.',[DTMList[i].n])) else - writeln(Format('DTM [%d] was not freed',[i])); + writeln(Format('DTM[%d] has not been freed in the script, freeing it now.',[i])); + FreeDTM(i); end; end; SetLength(DTMList, 0); @@ -252,15 +253,13 @@ begin end; function TMDTM.SetDTMName(DTM: Integer; s: string): boolean; -var - dtm_: pDTM; begin - if(GetDTM(dtm, dtm_)) then - begin - dtm_.n := s; - Exit(True); + try + DTMList[DTM].n:= s; + Exit(true); + except + raise Exception.CreateFMT('SetDTMName: The given DTM %d does not exist.', [DTM]); end; - raise Exception.CreateFMT('SetDTMName: The given DTM %d does not exist.', [DTM]); Exit(False); end;