[BUG] mod_grproc: collision() using map with width 1 and angled map

Started by Sandman, February 27, 2009, 12:47:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sandman

Check it out.

import "mod_video"
import "mod_map"
import "mod_grproc"
import "mod_proc"
import "mod_wm"
import "mod_key"
import "mod_mouse"
import "mod_text"

#define SCREEN_DEPTH 16

Process Main()
Begin

set_mode(320,200,SCREEN_DEPTH);

steady(80,100,0);
steady(100,100,0);
steady(130,100,45000);

Movable();

Repeat
frame;
Until(exit_status||key(_ESC))

OnExit
let_me_alone();
End

Process Steady(int x, int y, int angle)
Begin

flags = B_ABLEND;
graph = new_map(50,50,SCREEN_DEPTH);
map_clear(0,graph,rgb(x,y,100));

Loop
frame;
End

OnExit
if(map_exists(0,graph))
map_unload(0,graph);
end
End
Process Movable()
Private
int colID;
int txt[9];
int i;
Begin
z = -1;
graph = new_map(1,100,SCREEN_DEPTH);
map_clear(0,graph,rgb(255,255,255));
Loop
x = mouse.x;
y = mouse.y;
for(i=0; i<10; i++)
if(colID=collision(type Steady))
txt[i] = write(0,0,i*10,0,"Collision: " + colID);
else
break;
end
end
frame;
for(i=0; i<10; i++)
if(txt[i])
delete_text(txt[i]);
txt[i] = 0;
end
end
End
OnExit
for(i=0; i<10; i++)
if(txt[i])
delete_text(txt[i]);
end
end
if(map_exists(0,graph))
map_unload(0,graph);
end
End


The angled process does not collide according to collision()!
It does work with height==1 pixel, but not with width==1 pixel.
-- Sandman

SplinterGU

I know... this is a float precision stuff...

oh, sorry, I interpreter other stuff... let me take a look... thanks...

yes, again...
"I know... this is a float precision stuff.."

well, I think so... the problem maybe is gr_rotate_blit.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2