and here's...
Code:
// snippet 1
/***************************** button_bounds_check *****************************
This function returns 1 if the mouse position is within the passed boundaries.
Else it returns zero.
*******************************************************************************/
un F5::PROTOCOL::button_bounds_check (un xl, un yl, un xh, un yh)
{
if ( (MX_POS < xl) ||
(MX_POS >= xh) ||
(MY_POS < yl) ||
(MY_POS >= yh) ) return (0);
else return (1);
}
/***************************** check_click *************************************
This function returns 1 if a button has been clicked [and released] within the
boundaries. It's used to get that nice user interface feel.
*******************************************************************************/
un F5::PROTOCOL::check_click (un xl, un yl, un xh, un yh, un btn_stat)
{
un ox, oy;
HE::MF::b_check ();
// if (M_BTN)
{
HE::MF::press ();
HE::MF::release ();
}
// if (HE::MF::VARS::press_n [btn_stat] == 0) return (0);
ox = MX_POS;
oy = MY_POS;
MX_POS = HE::MF::VARS::press_x [btn_stat];
MY_POS = HE::MF::VARS::press_y [btn_stat];
if (F5::PROTOCOL::button_bounds_check (xl, yl, xh, yh) == 0)
{
MX_POS = ox;
MY_POS = oy;
return (0);
}
MX_POS = HE::MF::VARS::rel_x [btn_stat];
MY_POS = HE::MF::VARS::rel_y [btn_stat];
if (F5::PROTOCOL::button_bounds_check (xl, yl, xh, yh) == 0)
{
MX_POS = ox;
MY_POS = oy;
return (0);
}
relpress ();
for (un u0 = 0; u0 < 4; u0++)
{
HE::MF::VARS::press_n [u0] = 0;
HE::MF::VARS::press_x [u0] = 0;
HE::MF::VARS::press_y [u0] = 0;
HE::MF::VARS::rel_n [u0] = 0;
HE::MF::VARS::rel_x [u0] = 0;
HE::MF::VARS::rel_y [u0] = 0;
}
return (1);
/*
// if (button_bounds_check (xl, yl, xh, yh) == 0) return (0);
// new click, non-source to source, + must be within bounds
HE::MF::b_check ();
if ((M_BTN == btn_stat))
{
// wait until non-source
while (M_BTN == btn_stat)
{
HE::MF::b_check (); // update status, and graphics
F5::OUTPUT::standard_graphics_loop (0);
}
// if still in bounds success, if out during non-source, fail
if (button_bounds_check (xl, yl, xh, yh)) return (1);
else return (0);
}
// if not on status after btn switch, or not within bounds after btn switch
else return (0);
*/
}
it complains about IMG tags, and i don't know why, i guess it was just too much...