Jump to content
FHannes

SCAR Divi 3.40 Beta

Recommended Posts

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 by Freddy
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Bixby Sayz
Link to comment
Share on other sites

@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 by slacky
Link to comment
Share on other sites

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 by slacky
Link to comment
Share on other sites

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 :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...