Hab jetzt mal die PlgBLT-Punkte durchrechnet mit XPIA und XPSE :
XPSE 100000 x Schleife : 254 Millisekunden
XPIA 100000 x Schleife : 145 Millisekunden
Wenn man bedenkt was die Programmier-Arbeit in XPIA ist gegenüber XPSE , ist das Resultat von XPSE sehenswert.
XPIA-Test 145 Millisec.:
Code
$MAKE CLE
declare zeit1&,zeit2&,zeit&
Declare xc!,yc!,wh!,winkel!,pts&
dim pts&,24
wh!=100
xc!=50
yc!=50
winkel!=56
if 0
AsmStart rotateplg(xc&,yc&,wh&,winkel&,pts&)
.data
pi180 dq 0.0174532925199433
xc dq 0.0
yc dq 0,0
wh dq 0.0
winkel dq 0.0
z1 dq 0.0
z2 dq 0.0
pts0 dd 0
pts4 dd 0
pts8 dd 0
pts12 dd 0
pts16 dd 0
pts20 dd 0
.code
finit
mov edx, para1
fld qword ptr [edx]
fst xc
mov edx, para2
fld qword ptr [edx]
fst yc
mov edx, para3
fld qword ptr [edx]
fst wh
mov edx, para4
fld qword ptr [edx]
fst winkel
mov ecx,0
.while ecx<100000
Inc ecx
'pts&,0=xc!+(0-xc!)*Cos(Pi180!*winkel!) -(0-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts0
'pts&,4=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts4
'pts&,8=xc!+(wh!-xc!)*Cos(Pi180!*winkel!)-(0-yc!)*Sin(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts8
'pts&,12=yc!+(wh!-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts12
'pts&,16=xc!+(0-xc!)*Cos(Pi180!*winkel!)-(wh!-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts16
'pts&,20=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(wh!-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts20
'--------------------------------
mov ebx,para5
Mov eax,pts0
Mov [ebx+0],eax
Mov eax,pts4
Mov [ebx+4],eax
Mov eax,pts8
Mov [ebx+8],eax
Mov eax,pts12
Mov [ebx+12],eax
Mov eax,pts16
Mov [ebx+16],eax
Mov eax,pts20
Mov [ebx+20],eax
.Endw
AsmEnd
endif
WindowTitle " Bitte warten ... teste mit XPIA"
cls
Print ""
Sleep 1000
zeit1& = &GetTickCount
Call(GetXpiaProcAddress(XpiaModule&,"rotateplg"),Addr(xc!),Addr(yc!),Addr(wh!),Addr(winkel!),pts&)
zeit2& = &GetTickCount
zeit& = zeit2& - zeit1&
print "Ausführungsgeschwindigkeit mit XPIA : " + str$(zeit&) + " Millisekunden"
SetText %HWnd,"Geschwindigkeitstest beendet!"
waitinput
end
Alles anzeigen
XPSE 254 Millisec :
Code
{$CLEQ}
declare zeit1&,zeit2&,zeit&
nProc drawhPicRotated()
Float Pi180=0.0174532925199433
Float xc=105.3
Float yc=123.6
Float winkel=157.0
Float wh=100.34
long pts=dim(24)
WhileLoop 1,100000,1
long pts&,0=Long(xc+(0.0-xc)*Cos(Pi180*winkel) -(0.0-yc)*Sin(Pi180*winkel))
long pts&,4=Long(yc+(0.0-xc)*Sin(Pi180*winkel)+(0.0-yc)*Cos(Pi180*winkel))
long pts&,8=Long(xc+(wh-xc)*Cos(Pi180*winkel)-(0.0-yc)*Sin(Pi180*winkel))
long pts&,12=Long(yc+(wh-xc)*Sin(Pi180*winkel)+(0.0-yc)*Cos(Pi180*winkel))
long pts&,16=Long(xc+(0.0-xc)*Cos(Pi180*winkel)-(wh-yc)*Sin(Pi180*winkel))
long pts&,20=Long(yc+(0.0-xc)*Sin(Pi180*winkel)+(wh-yc)*Cos(Pi180*winkel))
EndWhile
dispose(pts)
endproc
WindowTitle " Bitte warten ... teste mit nProc von XPSE"
cls
Print ""
Sleep 1000
zeit1& = &GetTickCount
drawhPicRotated()
zeit2& = &GetTickCount
zeit& = zeit2& - zeit1&
print "Ausführungsgeschwindigkeit mit XPSE: " + str$(zeit&) + " Millisekunden"
SetText %HWnd,"Geschwindigkeitstest beendet!"
waitinput
end
Alles anzeigen
Gruss