Okay, I think I understand what you're doing. The parametric stuff near the top (I didn't recognize before that that's what it was) is just a fast way to determine collision. The part after collision is assured just "corrects" the movement vector so that it still moves the same distance horizontally, but stops at the edge of the hypotenuse.
I implemented the function, and there's still one part that I don't get. Keep in mind that I'm using a coordinate system where the origin is the top left of the window, so the y component of the slope of the upper-left facing triangle is negative its height.
void colltlm(SDL_Rect &d,SDL_Rect &s,vect &move)
{
if(!move.x)return;//If object is not moving horizontally, no movement on slope necessary
vect dpos(d.x,d.y);
//
vect h_inverted(s.h,s.w);//Inverse of triangle hypotenuse
float hm = 1/(h_inverted*move);
float hp = h_inverted*vect(s.x+s.w,s.y);
float t;
//
t = (hp-(dpos+vect(d.w,d.h))*h_inverted)*hm;
if(t >= 1 && t < 0)//The movement vector and slope do not intersect
return;
//
vect h(s.w,-s.h);//Hypotenuse vector
move = ((move*h)/(h*h))*h + vect(s.x+s.w,s.y);
}
It all works, up until the last line. You said that you're assuming the * operator means a dot product between a vector and a point, right? Well, that last h which is multiplied by ((move*h)/(h*h)) produces an error, because that expression produces a float value. And it can't multiply the h vector by a float.
I removed the last two lines that project the vector, and it appears to work fine up until that point. But the expression on that last line just looks a little weird to both me and my compiler.