mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-05 21:50:38 +01:00
* made RGB functions inline
* changed paramters to constant words so they can be folded completly when the result is assigned to the videobuffer git-svn-id: trunk@5059 -
This commit is contained in:
parent
30ea65a89c
commit
ae5e58f5f7
@ -145,9 +145,9 @@ procedure WaitForVDraw(); inline;
|
||||
procedure VSync(); inline;
|
||||
function Flip(): pword;
|
||||
|
||||
function RGB(r, g, b: integer): integer;
|
||||
function RGB5(r, g, b: integer): integer;
|
||||
function RGB8(r, g, b: integer): integer;
|
||||
function RGB(const r, g, b: word): word;inline;
|
||||
function RGB5(const r, g, b: word): word;inline;
|
||||
function RGB8(const r, g, b: word): word;inline;
|
||||
|
||||
implementation
|
||||
|
||||
@ -266,17 +266,17 @@ begin
|
||||
Flip := VideoBuffer;
|
||||
end;
|
||||
|
||||
function RGB(r, g, b: integer): integer;
|
||||
function RGB(const r, g, b: word): word;inline;
|
||||
begin
|
||||
RGB := ((r) + (g shl 5) + (b shl 10));
|
||||
end;
|
||||
|
||||
function RGB5(r, g, b: integer): integer;
|
||||
function RGB5(const r, g, b: word): word;inline;
|
||||
begin
|
||||
RGB5 := ((r) or ((g) shl 5) or ((b) shl 10));
|
||||
end;
|
||||
|
||||
function RGB8(r, g, b: integer): integer;
|
||||
function RGB8(const r, g, b: word): word;inline;
|
||||
begin
|
||||
RGB8 := ( (((b) shr 3) shl 10) or (((g) shr 3) shl 5) or ((r) shr 3) );
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user