PDA

View Full Version : couple of tiny bugs


Nicknack
08-16-2009, 03:22 PM
everything tested with ppl 2.0 on desktop and 1.53 on ppc:
1. spritechildren still returns sprites which have been already deleted :
proc main
s$=newsprite(null);
p$=newsprite(null);

Setspriteparent(p$, s$);
delsprite(p$);

showmessage(spritechildren(s$, &l$));
end;
set sprite's parent to null or use clearspritechildrens can help, but without them would be more compfortable and comprehensible.

2. wrap can't handle small or big number differences:
showmessage(wrap(5, 1,2, true)); //returns 4
showmessage(wrap(26, 1,6, true)); //returns 21

3. some ailing comparisons:
showmessage(1/4==0.25);
showmessage(1==0.75+0.25);

only produces error with 1.53, is it corrected for 1.6?
dim(point$,3,3);
b$,c$=5,4;
point$[1,1]=4;


btw the pathsprite demo doesn't work anymore for both ppl versions and the benchmark test only works with 2.0
hope you can sort them out kornalius ;)

kornalius
08-24-2009, 04:15 PM
Fixed SpriteChildren() not to return sprites flagged for deletion.

Wrap() works, you are using True to wrap around, this means the following:

if (around)
{
if (value < min)
value = max - value;
if (value > max)
value = value - max + min;
}
else
{
if (value < min)
value = min;
if (value > max)
value = max;
}


Floating point arithmetic is buggy in Windows when using certain values, this is because of IEEE storage. I have fixed the interpreter so it does not try to adjust the double precision values using epsilon by default.

The multiple variable assignment has just been fixed now. It will work fine in 1.60 too. Thanks for pointing it out.

Nicknack
08-24-2009, 08:47 PM
shouldn't wrap always keep the value between min and max? if not is there any function which does it?

kornalius
08-24-2009, 08:55 PM
Ah I see, I guess it should. It only does it if you use WrapAround, else it will not.