rotate_sprite - "Isufficient context" ?
Yuri2356

Hey-o!

While working on a project with DevC++ and allegro, my first use of the rotate_sprite function has met with problems.

rotate_sprite(PreScreen, BlipBit, int, int, (double * (128 / Pi) ) );

(I've substituted the types for the names of the variables I'm using)

That 'double' is an angle in radians.

There's no problem with the bitmaps or co-ordinates (I've used them in previous draw_sprite s) but the addition of rotation has prompted the error of "insufficient contextual information to determine type" on the Line where rotate_sprite is called. I've already tried converting the angle to float, int, and a few other types, all with the same problem.

Just what needs to be done to get that angle recognized?

CGamesPlay

You need to pass a "fixed" to the function. You don't pass radians, either. Look up these:

[edit]
Well, you already don't pass radians.

ImLeftFooted

*

Maybe paste some more code, copied exactly (make sure to use [code] blocks), preferably no more then 15 lines in length along with an exact copy of the error message?

* deleted due to inaccuracy

gnolam
Dustin Dettmer said:

Shouldn't 'double' actually be a variable of some sort? Shouldn't the two 'int's also be variables instead?

Yuri2356 said:

I've substituted the types for the names of the variables I'm using

bamccaig

My only real reply to this thread so far, since I haven't used the rotation function in question, is why would you replace variable names with data types in sample code?? It's difficult to help you if we aren't looking at the actual code.

I originally thought you were trying to pass a (double *) in for the angle which had me way confused...

Yuri2356

Well, converting my angle with ftofix is making everything run smoothly.

This shoulnd't be a problem any more. :)

Thread #590741. Printed from Allegro.cc