firing_char_single_img_c/Graphical.h
/**
 * Assumes the base of the image is at its mid-left point. This isn't a
 * problem if you're drawing your images with the appropriated
 * GRAL_DrawImage* call.
 */
Assumes the base of the image is at its mid-left point. This isn't a
problem if you're drawing your images with the appropriated
GRAL_DrawImage* call.
Assumes the base of the image is at its mid - left point . This isn ' t a problem if you ' re drawing your images with the appropriated GRAL_DrawImage * call .
static inline vec2f
GRAL_ImageCenterForTopAt(GRAL_Image *img,
                         vec2f top,
                         vec2f unit_direction)
{
  return sub_2f(top, mul_2f(unit_direction, 0.5f*img->h));
}
static inline vec2f GRAL_ImageCenterForTopAt ( GRAL_Image * img , vec2f top , vec2f unit_direction ) { return sub_2f ( top , mul_2f ( unit_direction , 0.5f * img -> h ) ) ; }
Assumes the base of the image is at its mid-left point.
Assumes the base of the image is at its mid - left point .
// Notice that unit_direction.x is the cosine of the angle for // that direction. Also unit_direction.y is the sine of the angle // for the direction.