removing obsolete var* files

This commit is contained in:
zueuk 2006-04-20 14:52:45 +00:00
parent ed550d9260
commit 1932271e5e
4 changed files with 0 additions and 372 deletions

View File

@ -1,84 +0,0 @@
unit VarBubble;
interface
uses
BaseVariation, XFormMan;
type
TVariationBubble = class(TBaseVariation)
public
class function GetName: string; override;
class function GetInstance: TBaseVariation; override;
procedure CalcFunction; override;
end;
implementation
uses
math;
// TVariationBubble - a pseudo-spherical distortion
///////////////////////////////////////////////////////////////////////////////
procedure TVariationBubble.CalcFunction;
{$if false}
var
r: double;
begin
r := vvar / ((sqr(FTx^) + sqr(FTy^))/4 + 1);
FPx^ := FPx^ + r * FTx^;
FPy^ := FPy^ + r * FTy^;
{$else}
asm
mov ecx, [eax+FTy]
fld qword ptr [ecx]
mov ecx, [eax+FTx]
fld qword ptr [ecx]
fld st(1)
fmul st, st
fld st(1)
fmul st, st
fadd
fld1
fadd st, st
fadd st, st
fdivp st(1), st
fld1
fadd
fdivr qword ptr [eax+vvar]
fmul st(2), st
fmulp
mov ecx, [eax+FPx]
fadd qword ptr [ecx]
fstp qword ptr [ecx]
mov ecx, [eax+FPy]
fadd qword ptr [ecx]
fstp qword ptr [ecx]
fwait
{$ifend}
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationBubble.GetInstance: TBaseVariation;
begin
Result := TVariationBubble.Create;
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationBubble.GetName: string;
begin
Result := 'bubble';
end;
///////////////////////////////////////////////////////////////////////////////
initialization
RegisterVariation(TVariationBubble);
end.

View File

@ -1,83 +0,0 @@
unit VarEyefish;
interface
uses
BaseVariation, XFormMan;
type
TVariationEyefish = class(TBaseVariation)
public
class function GetName: string; override;
class function GetInstance: TBaseVariation; override;
procedure CalcFunction; override;
end;
implementation
uses
math;
// TVariationEyefish, the correct "fish-eye" variation
///////////////////////////////////////////////////////////////////////////////
procedure TVariationEyefish.CalcFunction;
{$if false}
var
r: double;
begin
r := 2 * vvar / (sqrt(sqr(FTx^) + sqr(FTy^)) + 1);
FPx^ := FPx^ + r * FTx^;
FPy^ := FPy^ + r * FTy^;
{$else}
asm
fld qword ptr [eax+vvar]
fadd st, st
mov ecx, [eax+FTy]
fld qword ptr [ecx]
mov ecx, [eax+FTx]
fld qword ptr [ecx]
fld st(1)
fmul st, st
fld st(1)
fmul st, st
fadd
fsqrt
fld1
fadd
fdivp st(3), st
fmul st, st(2)
mov ecx, [eax+FPx]
fadd qword ptr [ecx]
fstp qword ptr [ecx]
fmulp
mov ecx, [eax+FPy]
fadd qword ptr [ecx]
fstp qword ptr [ecx]
fwait
{$ifend}
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationEyefish.GetInstance: TBaseVariation;
begin
Result := TVariationEyefish.Create;
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationEyefish.GetName: string;
begin
Result := 'eyefish';
end;
///////////////////////////////////////////////////////////////////////////////
initialization
RegisterVariation(TVariationEyefish);
end.

View File

@ -1,66 +0,0 @@
unit VarTest;
interface
uses
BaseVariation, XFormMan;
type
TVariationTest = class(TBaseVariation)
public
class function GetName: string; override;
class function GetInstance: TBaseVariation; override;
procedure CalcFunction; override;
end;
implementation
uses
math;
{ TVariationTest }
///////////////////////////////////////////////////////////////////////////////
procedure TVariationTest.CalcFunction;
const
EPS = 1E-10;
var
r : double;
// dx, dy, dx2: double;
Angle: double;
begin
r := sqrt(FTx^ * FTx^ + FTy^ * FTy^);
if (FTx^ < -EPS) or (FTx^ > EPS) or (FTy^ < -EPS) or (FTy^ > EPS) then
Angle := arctan2(FTx^, FTy^)
else
Angle := 0.0;
Angle := Angle + Max(0, (3 - r)) * sin(2 * r);
// r:= R - 0.04 * sin(6.2 * R - 1) - 0.008 * R;
FPx^ := FPx^ + vvar * r * cos(Angle);
FPy^ := FPy^ + vvar * r * sin(Angle);
// FPx^ := FPx^ + vvar * FTx^;
// FPy^ := FPy^ + vvar * FTy^;
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationTest.GetInstance: TBaseVariation;
begin
Result := TVariationTest.Create;
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationTest.GetName: string;
begin
Result := 'test';
end;
///////////////////////////////////////////////////////////////////////////////
initialization
RegisterVariation(TVariationTest);
end.

View File

@ -1,139 +0,0 @@
unit varSmoke2;
interface
uses
BaseVariation, XFormMan;
const
var_a_name='smoke2_amp';
var_f_name='smoke2_freq';
type
TVariationSmoke2 = class(TBaseVariation)
private
a, f: double;
public
constructor Create;
class function GetName: string; override;
class function GetInstance: TBaseVariation; override;
class function GetNrVariables: integer; override;
class function GetVariableNameAt(const Index: integer): string; override;
function SetVariable(const Name: string; var value: double): boolean; override;
function GetVariable(const Name: string; var value: double): boolean; override;
procedure CalcFunction; override;
end;
implementation
uses
math;
// TVariationSmoke2
///////////////////////////////////////////////////////////////////////////////
constructor TVariationSmoke2.Create;
begin
a := random;
f := 4*random;
end;
procedure TVariationSmoke2.CalcFunction;
{$if false}
begin
FPx^ := FPx^ + vvar*(ftx^ + a*sin(fty^*f) );
FPy^ := FPy^ + vvar*(fty^ + a*sin(ftx^*f) );
{$else}
asm
fld qword ptr [eax + vvar]
fld qword ptr [eax + a]
mov ecx, [eax + FTy]
fld qword ptr [ecx]
fld qword ptr [eax + f]
mov ecx, [eax + FTx]
fld qword ptr [ecx]
fld st(2)
fmul st, st(2)
fsin
fmul st, st(4)
fadd st, st(1)
fmul st, st(5)
mov ecx, [eax + FPx]
fadd qword ptr [ecx]
fstp qword ptr [ecx]
fmulp
fsin
fmulp st(2), st
faddp
fmulp
mov ecx, [eax + FPy]
fadd qword ptr [ecx]
fstp qword ptr [ecx]
fwait
{$ifend}
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationSmoke2.GetInstance: TBaseVariation;
begin
Result := TVariationSmoke2.Create;
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationSmoke2.GetName: string;
begin
Result := 'smoke2';
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationSmoke2.GetVariableNameAt(const Index: integer): string;
begin
case Index of
0: Result := var_a_name;
1: Result := var_f_name;
else
Result := '';
end
end;
///////////////////////////////////////////////////////////////////////////////
function TVariationSmoke2.SetVariable(const Name: string; var value: double): boolean;
begin
Result := False;
if Name = var_a_name then begin
a := Value;
Result := True;
end else if Name = var_f_name then begin
f := Value;
Result := True;
end
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationSmoke2.GetNrVariables: integer;
begin
Result := 2;
end;
///////////////////////////////////////////////////////////////////////////////
function TVariationSmoke2.GetVariable(const Name: string; var value: double): boolean;
begin
Result := False;
if Name = var_a_name then begin
Value := a;
Result := True;
end else if Name = var_f_name then begin
Value := f;
Result := True;
end
end;
///////////////////////////////////////////////////////////////////////////////
initialization
RegisterVariation(TVariationSmoke2);
end.