From 7e3decbf6973ae80ab31089465d5b141bbbd8d52 Mon Sep 17 00:00:00 2001 From: zueuk Date: Mon, 20 Apr 2009 08:00:53 +0000 Subject: [PATCH] opacity support in renderer --- 2.10/Source/Render32.pas | 12 ++++++++---- 2.10/Source/Render32f.pas | 20 ++++++++++++-------- 2.10/Source/Render48.pas | 23 ++++++++++++++--------- 2.10/Source/Render64.pas | 12 ++++++++---- 4 files changed, 42 insertions(+), 25 deletions(-) diff --git a/2.10/Source/Render32.pas b/2.10/Source/Render32.pas index eb57de8..1ae29d2 100644 --- a/2.10/Source/Render32.pas +++ b/2.10/Source/Render32.pas @@ -141,7 +141,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x - camX0; if (px < 0) or (px > camW) then continue; @@ -206,7 +207,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x * cosa + p.y * sina + rcX; if (px < 0) or (px > camW) then continue; @@ -272,7 +274,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q); @@ -339,7 +342,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q); diff --git a/2.10/Source/Render32f.pas b/2.10/Source/Render32f.pas index f0f48f9..98a909b 100644 --- a/2.10/Source/Render32f.pas +++ b/2.10/Source/Render32f.pas @@ -157,7 +157,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -168,7 +168,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x - camX0; if (px < 0) or (px > camW) then continue; @@ -224,7 +225,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -235,7 +236,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x * cosa + p.y * sina + rcX; if (px < 0) or (px > camW) then continue; @@ -292,7 +294,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -303,7 +305,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q); @@ -361,7 +364,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -372,7 +375,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q); diff --git a/2.10/Source/Render48.pas b/2.10/Source/Render48.pas index c47d5de..0c0b3ef 100644 --- a/2.10/Source/Render48.pas +++ b/2.10/Source/Render48.pas @@ -89,7 +89,7 @@ begin end; end; -/////////////////////////////////////////////////////////////////////////////// +// wtf??! ///////////////////////////////////////////////////////////////////// procedure TRenderer48.CreateColorMap; var i: integer; @@ -151,7 +151,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -162,7 +162,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x - camX0; if (px < 0) or (px > camW) then continue; @@ -175,6 +176,7 @@ end; {$ifndef _ASM_} // HACK warning!!! // this WILL corrupt data in case of 48-bit overflow! + // (which is still quite hard to get :) Inc((pInt64(@pBucket^.rl))^, MapColor.Red); Inc((pInt64(@pBucket^.gl))^, MapColor.Green); Inc((pInt64(@pBucket^.bl))^, MapColor.Blue); @@ -245,7 +247,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -256,7 +258,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x * cosa + p.y * sina + rcX; if (px < 0) or (px > camW) then continue; @@ -340,7 +343,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -351,7 +354,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q); @@ -436,7 +440,7 @@ end; {$endif} try - xf := fcp.xform[0];//random(fcp.NumXForms)]; + xf := fcp.xform[0]; xf.NextPoint(p); for i := 0 to FUSE do begin xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; @@ -447,7 +451,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q); diff --git a/2.10/Source/Render64.pas b/2.10/Source/Render64.pas index 74308a3..b05d6ef 100644 --- a/2.10/Source/Render64.pas +++ b/2.10/Source/Render64.pas @@ -166,7 +166,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x - camX0; if (px < 0) or (px > camW) then continue; @@ -231,7 +232,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; px := p.x * cosa + p.y * sina + rcX; if (px < 0) or (px > camW) then continue; @@ -297,7 +299,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q); @@ -364,7 +367,8 @@ end; xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf.NextPoint(p); - if xf.noPlot then continue; + if (xf.plotMode < 0) then continue + else if (xf.plotMode = 0) and (random > xf.opacity) then continue; finalXform.NextPointTo(p, q);