graphics32
graphics32 copied to clipboard
Raspberry Pi (ARM) does not compile
in Blend_MMX line 745: procedure EMMS_MMX; {$IFDEF FPC} assembler; nostackframe; {$ENDIF} asm EMMS <--- should be conditional end;
in Blend_SSE2 line 1272 the comment is not accepted, has to be in (* ... *) asm { This is an implementation of the merge formula, as described in a paper by Bruce Wallace in 1981. Merging is associative, that is, A over (B over C) = (A over B) over C. The formula is,
Ra = Fa + Ba * (1 - Fa)
Rc = (Fa * (Fc - Bc * Ba) + Bc * Ba) / Ra
where
Rc is the resultant color,
Ra is the resultant alpha,
Fc is the foreground color,
Fa is the foreground alpha,
Bc is the background color,
Ba is the background alpha.
Implementation:
Ra := 1 - (1 - Fa) * (1 - Ba);
Wa := Fa / Ra;
Rc := Bc + Wa * (Fc - Bc);
(1 - Fa) * (1 - Ba) = 1 - Fa - Ba + Fa * Ba = (1 - Ra)
}
Even here this part is strange... :/
The GR32_BlendMMX unit shouldn't be compiled on ARM. Haven't you got the PUREPASCAL symbol defined?
The following from GR32_Compiler.inc should ensure that PUREPASCAL is defined:
{$IFDEF COMPILERFPC}
{$MODE Delphi}
{$DEFINE PLATFORM_INDEPENDENT}
{$DEFINE FPC_HAS_CONSTREF}
{$DEFINE HAS_NATIVEINT}
{$DEFINE NATIVE_SINCOS}
{$DEFINE USESTACKALLOC}
{$DEFINE RGBA_FORMAT}
{$IF DEFINED(CPUx86_64)}
{$DEFINE PUREPASCAL}
{$ELSEIF DEFINED(CPUi386)}
{$ELSE}
{$DEFINE PUREPASCAL}
{$IFEND}
{$ENDIF COMPILERFPC}
Yes, it is defined. I think, then those units have to be switched off in the package. Otherwise they get compiled regardless of they are really used or not. Are there other units for which this could be true (except for the three obvious BlendXYZ)?
Are there other units for which this could be true (except for the three obvious BlendXYZ)?
Not that I know of.
Then this should solve it: GR32_Lazarus.lpk.zip
Thanks. Any reason why you can't make a pull request with it?
I thought, you just meant it for the code (color things) I typed in here. But I am going to try to do it. For the backend as well?
Anders, I am not really familar with GitHub. Do I need my own repo to create a pull request? Or what would be the easiest way for somebody, who has nothing but an account here?
It's relatively easy:
- Start by creating a fork of the Graphics32 repository:
This copies the Graphics32 repository to a new repository under your own account. - Once that has been created you can clone your copy to your local PC using whatever Git tool you're using now (I'm assuming you're not just downloading the zip file. If that's wrong let me know).
- Apply your changes to a branch in your local clone and push them to your own repo.
- At your local repo create a pull request:

- Verify that the base repo (the Graphics32 repo) and the head repo and branch (your repo and your branch) is correct and then create the pull request.

That's it. Your pull request will show up at the Graphics32 repo and I can review, comment and merge there.
Closing due to inactivity