deprecated replacements
Neil Walker

Hello,
This seems as good a place as any. I'm compiling some code and it uses a function that allegro spits back as being 'deprecated'. What's the chances of, in the manual, to state what functions replace the deprecated ones?

Anyway, back to my main question. The deprecated function I have is set_clip(...), is this now replaced by set_clip_rect(...) and are the parameters the same, e.g. x,y,width,height instead of x1,y1,x2,y2, etc.?

Is there anything special with set_clip (thebitmap, 0, 0, 0, 0);

As in, what's with the zero values? the manual says use -1 to disable drawing, unless that's something else?

Matthew Leverton

set_clip was turned into set_clip_state and set_clip_rect.

set_clip(bmp, 0,0, 0,0);

Is the same as:

set_clip_rect(bitmap, 0, 0, bitmap->w-1, bitmap->h-1);
set_clip_state(bitmap, FALSE);

Clipping is now disabled, and you can draw anywhere (including out of bounds).

Quote:

As in, what's with the zero values? the manual says use -1 to disable drawing, unless that's something else?

set_clip_rect(bitmap, 0, 0, 0, 0); // you can draw on pixel 0,0

set_clip_rect(bitmap, 0, 0, -1, -1); // you cannot draw anywhere

In both of the above cases, clipping is still enabled.

Neil Walker

I take it set_clip with four zero's was a special case?

I think I'd better update my local allegro manual just to make sure :)

Matthew Leverton
Quote:

I take it set_clip with four zero's was a special case?

Any other numbers are equivalent to:

set_clip_rect(bitmap, x1, y1, x2, y2);
set_clip_state(bitmap, TRUE);

after making sure that x1 <= x2 and y1 <= y2.

Peter Wang

Replacements for deprecated functions are listed on this page: http://alleg.sourceforge.net/stabledocs/en/api.html

Thread #591407. Printed from Allegro.cc