Quote:
Originally Posted by Coagulus
Haha, I have been known to use them. I'm afraid my code hasn't changed much since the zx spectrum!
|
Well, you should consider upgrading your mind!
Adding only 4 bytes to your src makes a big speedup:
Code:
For a=0 To 31
AGAPalRGB 0,32+a+bary(0),bar(a),0,0
;Next
;For a=0 To 31
AGAPalRGB 0,32+a+bary(1),0,bar(a),0
;Next
;For a=0 To 31
AGAPalRGB 0,32+a+bary(2),0,0,bar(a)
Next
also,
Code:
DisplayBitMap 0,0
Repeat
;DisplayBitMap 0,0
DisplayRainbow 0,0,0
;For a=0 To 255
; AGAPalRGB 0,a,0,0,0 ; blank the palette
;Next
InitPalette 0,256 ;< this is an ASM routine inside the blitzlib! trust me: it is faster!
For a=0 To 2
bary(a)=bary(a)+baryt(a)
baryt(a)=baryt(a)+barydir(a)
If Abs(baryt(a))=13 Then barydir(a)=0-barydir(a)
Next
And, while setting up the bars:
this
Code:
For a=1 To 16
bar(a-1)=(a*16)-1
Next
For a=16 To 1 Step -1
bar(15+(17-a))=(a*16)-1
Next
becomes
Code:
;we try to create bars of 32pixl height:
;the saturation value should spread from 0to255 (AGA),
;the bar appears to be 3d-like.
For a=0 To 15
bar(a) = (a*16) ;we donot reach 255 here...
bar(a+15)= ((16-a)*16)
Next
Isn't that nice?