Browse Source

+ "reverse merge" from 2.1

git-svn-id: trunk@1356 -
florian 20 years ago
parent
commit
c48c42b995
2 changed files with 39 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 38 0
      tests/webtbs/tw4234.pp

+ 1 - 0
.gitattributes

@@ -6303,6 +6303,7 @@ tests/webtbs/tw4215.pp svneol=native#text/plain
 tests/webtbs/tw4219.pp svneol=native#text/plain
 tests/webtbs/tw4223.pp svneol=native#text/plain
 tests/webtbs/tw4233.pp svneol=native#text/plain
+tests/webtbs/tw4234.pp svneol=native#text/plain
 tests/webtbs/tw4240.pp svneol=native#text/plain
 tests/webtbs/tw4247.pp svneol=native#text/plain
 tests/webtbs/tw4253.pp svneol=native#text/plain

+ 38 - 0
tests/webtbs/tw4234.pp

@@ -0,0 +1,38 @@
+{ %cpu=i386 }
+{ %opt=-O2 }
+
+{$mode objfpc}
+
+type
+  TFPColor = record
+    red,green,blue,alpha : word;
+  end;
+  TColorData = qword;
+
+  tcl=class
+    function ColorColorAlpha16 (CD:TColorData) : TFPColor;
+  end;
+
+function tcl.ColorColorAlpha16 (CD:TColorData) : TFPColor;
+var c : qword;
+begin
+with result do
+begin
+red := CD and $FFFF;
+c := qword($FFFF0000);
+green := (CD and c) shr 16;
+c := c shl 16;
+blue := (CD and c) shr 32;
+c := c shl 16;
+alpha := (CD and c) shr 48;
+end;
+end;
+
+var
+  cd  : tcolordata;
+  c : tcl;
+begin
+  cd:=$1234;
+  c:=tcl.create;
+  c.colorcoloralpha16(cd);
+end.