opacity support in renderer

This commit is contained in:
zueuk 2009-04-20 08:00:53 +00:00
parent 48c5d52c6f
commit 7e3decbf69
4 changed files with 42 additions and 25 deletions

View File

@ -141,7 +141,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x - camX0;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -206,7 +207,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x * cosa + p.y * sina + rcX;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -272,7 +274,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);
@ -339,7 +342,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);

View File

@ -157,7 +157,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -168,7 +168,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x - camX0;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -224,7 +225,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -235,7 +236,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x * cosa + p.y * sina + rcX;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -292,7 +294,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -303,7 +305,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);
@ -361,7 +364,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -372,7 +375,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);

View File

@ -89,7 +89,7 @@ begin
end; end;
end; end;
/////////////////////////////////////////////////////////////////////////////// // wtf??! /////////////////////////////////////////////////////////////////////
procedure TRenderer48.CreateColorMap; procedure TRenderer48.CreateColorMap;
var var
i: integer; i: integer;
@ -151,7 +151,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -162,7 +162,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x - camX0;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -175,6 +176,7 @@ end;
{$ifndef _ASM_} {$ifndef _ASM_}
// HACK warning!!! // HACK warning!!!
// this WILL corrupt data in case of 48-bit overflow! // 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^.rl))^, MapColor.Red);
Inc((pInt64(@pBucket^.gl))^, MapColor.Green); Inc((pInt64(@pBucket^.gl))^, MapColor.Green);
Inc((pInt64(@pBucket^.bl))^, MapColor.Blue); Inc((pInt64(@pBucket^.bl))^, MapColor.Blue);
@ -245,7 +247,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -256,7 +258,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x * cosa + p.y * sina + rcX;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -340,7 +343,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -351,7 +354,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);
@ -436,7 +440,7 @@ end;
{$endif} {$endif}
try try
xf := fcp.xform[0];//random(fcp.NumXForms)]; xf := fcp.xform[0];
xf.NextPoint(p); xf.NextPoint(p);
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
@ -447,7 +451,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);

View File

@ -166,7 +166,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x - camX0;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -231,7 +232,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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; px := p.x * cosa + p.y * sina + rcX;
if (px < 0) or (px > camW) then continue; if (px < 0) or (px > camW) then continue;
@ -297,7 +299,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);
@ -364,7 +367,8 @@ end;
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
xf.NextPoint(p); 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); finalXform.NextPointTo(p, q);