FHannes Posted October 2, 2013 Share Posted October 2, 2013 (edited) The first 3.40 beta build is now available. I've been working a lot on TSCARBitmap, it will now load any type of png image. There's also several new functions available. Downloads: SCAR Divi Development Changelog: Bugfixes: - ActivateClient restored window when maximized - TPAUnique didn't function properly - A bug in Delphi's VCL framework prevented palette based PNG imaged to be loaded correctly by TSCARBitmap - Several png formats were unsupported or lost transparency - FloodFill(Tol)(Ex) threw exceptions due to an implementation flaw New: - procedure SortTPAByX(var TPA: TPointArray); - procedure SortTPAByY(var TPA: TPointArray); - TChrono class to measure time intervals - TObject.ClassName - procedure ClampInt(var Value: Integer; const Min, Max: Integer); - procedure ClampExt(var Value: Extended; const Min, Max: Extended); - procedure ClampTIA(var TIA: TIntArray; const Min, Max: Integer); - procedure ClampTEA(var TEA: TExtArray; const Min, Max: Extended); - function MoveFile(const OldPath, NewPath: string): Boolean; - TSCARBitmap.ClearEx - function CopyFile(const OldPath, NewPath: string): Boolean; - function IsValidPath(const Path: string): Boolean; - TBmpResampler = (brNearest, brBilinear, brBicubic, brSuperSample); - procedure TSCARBitmap.ResizeEx(const NewWidth, NewHeight: Integer; const Resampler: TBmpResampler); - procedure TSCARBitmap.ClearAlpha; - procedure TSCARBitmap.ClearAlphaEx(const Alpha: Byte); - procedure TSCARBitmap.SetAlpha(const Color: Integer; const Alpha: Byte); - procedure TSCARBitmap.SetAlphaEx(const Colors: TIntArray; const Alpha: Byte); - property TSCARBitmap.Alpha[const X, Y: Integer]: Byte; Tweaks: - Optimized TPASpread, SortTPA(Ex) and TPARemoveEx - Rewritten SplitTPA(Ex) for added performance - TPADelete now raises an exception when the index fall outside of the array boundaries - TPARemove now removes the first point instead of the last when removing just one - Editor now shows icon to indicate modifications in tab - New clean look - Improved TSCARBitmap.SaveToPng performance - Merged in changes from official PascalScript codebase: * Support Include/Exclude for sets * Support iterating over enum types - Proper alpha channel support in TSCARBitmap - TSCARBitmap.Pixels renamed to TSCARBitmap.Pixel - TSCARBitmap.DrawTo(Ex) now has the "Blend" parameter for alpha blending Removed: - TSCARObject - Automated resource freeing for (previous) TSCARObject descendants Enjoy ~Freddy Edited October 2, 2013 by Freddy Quote Link to comment Share on other sites More sharing options...
Janilabo Posted October 2, 2013 Share Posted October 2, 2013 Thanks Freddy! I am pleased to see that you added support for MoveFile() and CopyFile() - much appreciated man. List of SCAR Divi's file handling capabilities is starting to look great. I'd say too much isn't missing anymore! Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 2, 2013 Author Share Posted October 2, 2013 A new version is available, with a pretty serious overhaul of parts of TSCARBitmap, so implement proper support for using the Alpha channel. FindBitmap functions will now ignore non-opaque pixels of the search bitmap, rather than using a single color to ignore. Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 19, 2013 Author Share Posted October 19, 2013 I've uploaded a new copy, which has TSCARBitmap.Reduce, as well as some fairly significant improvements for the compiler. Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 22, 2013 Author Share Posted October 22, 2013 SCAR now supports (animated) PNG and GIF files though TPNGFile and TGIFFile respectively. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted October 23, 2013 Share Posted October 23, 2013 Nice work, Freddy! Very nice to see animations are now supported, that's awesome. SCAR 3.40 just keeps getting better and better! Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted October 23, 2013 Share Posted October 23, 2013 (edited) Anyone else getting a broken file on this latest upload? Seems to happen every couple uploads can't open with any archiver. Edit: Managed to get a good copy after 8 download attempts. Edit2: I get an internal error when trying to compile OSI RS07 Template.scar using this build. SCAR Divi 3.39.00 compiles the same script just fine. Edited October 23, 2013 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
slacky Posted October 23, 2013 Share Posted October 23, 2013 (edited) @Bixby Sayz: If the download goes slow the server (where scar-files are hosted on) will send a "endof-stream"-signal.. This usually happens after a few minutes (~10mins).. But if the server is tired I guess it could be less, depends on how Freddy have configured it. If you are able to boost you Internet speed (if it's really slow) I would recommend doing so, else there is not much we can do.. Freddy on the other hand could tweak the config to allow for longer download time, he could also give the server a reboot. Edited October 25, 2013 by slacky Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 23, 2013 Author Share Posted October 23, 2013 Edit2: I get an internal error when trying to compile OSI RS07 Template.scar using this build. SCAR Divi 3.39.00 compiles the same script just fine. I will look into that, it's possible the compiler upgrades still need some tweaking. Quote Link to comment Share on other sites More sharing options...
slacky Posted October 24, 2013 Share Posted October 24, 2013 (edited) I will look into that, it's possible the compiler upgrades still need some tweaking. I was looking at the problem, and it seems to be related to function-passing (but there was more to it). I found that the functions that stopped OSI from compiling was inside `\Includes\OSI\Divi\Human\timing.scar`.. EG: //By wanted - per his request. function WaitFunc(Func: function: Boolean; DesiredResult: Boolean; MinWait, MaxWait, MinTotalWait, MaxTotalWait: LongInt): Boolean; var T: LongInt; begin Result := True; T := GetSystemTime + RR(MinTotalWait, MaxTotalWait); while (GetSystemTime < T) do if (Func() = DesiredResult) then Exit else WaitRR(MinWait, MaxWait); Result := False; end; Edited October 25, 2013 by slacky Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 24, 2013 Author Share Posted October 24, 2013 I was looking at the problem, and it seems to be related to function-passing (but there was more to it). I found that the functions that stopped OSI from compiling was inside `\Includes\OSI\Divi\Human\timing.scar`.. EG: function WaitFunc(Func: function: Boolean; DesiredResult: Boolean; MinWait, MaxWait, MinTotalWait, MaxTotalWait: LongInt): Boolean; var T: LongInt; begin Result := True; T := GetSystemTime + RR(MinTotalWait, MaxTotalWait); while (GetSystemTime < T) do if (Func() = DesiredResult) then Exit else WaitRR(MinWait, MaxWait); Result := False; end; That does sound like something that's easily overlooked Quote Link to comment Share on other sites More sharing options...
Wanted Posted October 24, 2013 Share Posted October 24, 2013 Please use OSI headers when posting code out of OSI so we know which version build number etc you are using and cite the proper contributors. Thank you. -Wanted Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 26, 2013 Author Share Posted October 26, 2013 I've found the issue causing the internal error, I'm in the process of resolving it. I will publish a new build as soon as the issue is resolved. Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 30, 2013 Author Share Posted October 30, 2013 A new build is now available, the compiler issues should be resolved. After this there should be one more beta release before the RC build. Just want to add 1 more feature to TSCARBitmap, as well as tweak the internal structure of the compiler a bit more. Quote Link to comment Share on other sites More sharing options...
Wanted Posted October 30, 2013 Share Posted October 30, 2013 Nice! Quote Link to comment Share on other sites More sharing options...