[AD] docs patch (and a bit of source too) for compatibility layer

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I found initialise_joystick, which I moved to allegro/alcompat.h,
where I think it belongs.
After looking at the `differences between platforms' section, I decided
to put my stuff there anyway. I don't think we can get rid of
ALLEGRO_NO_CLEAR_BITMAP_ALIAS nor ALLEGRO_NO_FIX_ALIASES, unfortunately,
as client code might already be using those.

-- 
Vincent Penquerc'h
--- include/allegro/joystick.h.defines	Tue Oct 29 21:48:29 2002
+++ include/allegro/joystick.h	Tue Oct 29 21:48:40 2002
@@ -128,8 +128,6 @@
 AL_FUNC(int, install_joystick, (int type));
 AL_FUNC(void, remove_joystick, (void));
 
-AL_FUNC(int, initialise_joystick, (void));
-
 AL_FUNC(int, poll_joystick, (void));
 
 AL_FUNC(int, save_joystick_data, (AL_CONST char *filename));
--- include/allegro/alcompat.h.defines	Tue Oct 29 21:48:49 2002
+++ include/allegro/alcompat.h	Tue Oct 29 21:49:02 2002
@@ -124,6 +124,7 @@
 #define JOY_HAT_RIGHT         3
 #define JOY_HAT_UP            4
 
+AL_FUNC(int, initialise_joystick, (void));
 
 /* in case you want to spell 'palette' as 'pallete' */
 #define PALLETE                        PALETTE
--- docs/src/api._tx.defines	Tue Oct 29 21:29:02 2002
+++ docs/src/api._tx	Tue Oct 29 21:43:46 2002
@@ -36,6 +36,97 @@
 @heading
 Changes between 4.0.x and 4.1.x series
 <ul><li>
+   The new ALLEGRO_NO_COMPATIBILITY define allows one to not include the
+   backward compatibility layer, so people can more easily purge their code
+   of obsolete stuff. The main documentation was also purged of any references
+   to the obsolete symbols. If you are still using any of those, now might be
+   a good time to get rid of them (within parentheses is the symbol most
+   likely to be a replacement for the obsolete one, if any):
+   <ul>
+     <li>clear (clear_bitmap)
+     <li>fadd (fixadd)
+     <li>fsub (fixsub)
+     <li>fmul (fixmul)
+     <li>fdiv (fixdiv)
+     <li>fceil (fixceil)
+     <li>ffloor (fixfloor)
+     <li>fcos (fixcos)
+     <li>fsin (fixsin)
+     <li>ftan (fixtan)
+     <li>facos (fixacos)
+     <li>fasin (fixasin)
+     <li>fatan (fixatan)
+     <li>fatan2 (fixatan2)
+     <li>fsqrt (fixsqrt)
+     <li>fhypot (fixhypot)
+     <li>SEND_MESSAGE (object_message)
+     <li>KB_NORMAL
+     <li>KB_EXTENDED
+     <li>cpu_fpu (cpu_capabilities)
+     <li>cpu_mmx (cpu_capabilities)
+     <li>cpu_3dnow (cpu_capabilities)
+     <li>cpu_cpuid (cpu_capabilities)
+     <li>joy_x (joy)
+     <li>joy_y (joy)
+     <li>joy_left (joy)
+     <li>joy_right (joy)
+     <li>joy_up (joy)
+     <li>joy_down (joy)
+     <li>joy_b1 (joy)
+     <li>joy_b2 (joy)
+     <li>joy_b3 (joy)
+     <li>joy_b4 (joy)
+     <li>joy_b5 (joy)
+     <li>joy_b6 (joy)
+     <li>joy_b7 (joy)
+     <li>joy_b8 (joy)
+     <li>joy2_x (joy)
+     <li>joy2_y (joy)
+     <li>joy2_left (joy)
+     <li>joy2_right (joy)
+     <li>joy2_up (joy)
+     <li>joy2_down (joy)
+     <li>joy2_b1 (joy)
+     <li>joy2_b2 (joy)
+     <li>joy_throttle (joy)
+     <li>joy_hat (joy)
+     <li>JOY_HAT_CENTER
+     <li>JOY_HAT_CENTRE
+     <li>JOY_HAT_LEFT
+     <li>JOY_HAT_RIGHT
+     <li>JOY_HAT_DOWN
+     <li>JOY_HAT_UP
+     <li>PALLETE (PALETTE)
+     <li>black_pallete (black_palette)
+     <li>desktop_pallete (desktop_palette)
+     <li>set_pallete (set_palette)
+     <li>get_pallete (get_palette)
+     <li>set_pallete_range (set_palette_range)
+     <li>get_pallete_range (get_palette_range)
+     <li>fli_pallete (fli_palette)
+     <li>pallete_color (palette_color)
+     <li>DAT_PALLETE (DAT_PALETTE)
+     <li>select_pallete (select_palette)
+     <li>unselect_pallete (unselect_palette)
+     <li>generate_332_pallete (generate_332_palette)
+     <li>generate_optimized_pallete (generate_optimized_palette)
+     <li>OLD_FILESEL_WIDTH
+     <li>OLD_FILESEL_HEIGHT
+     <li>file_select (file_select_ex)
+     <li>_textmode
+     <li>text_mode
+     <li>textout (textout_ex)
+     <li>textout_centre (textout_centre_ex)
+     <li>textout_right (textout_right_ex)
+     <li>textout_justify (textout_justify_ex)
+     <li>textprintf (textprintf_ex)
+     <li>textprintf_centre (textprintf_centre_ex)
+     <li>textprintf_right (textprintf_right_ex)
+     <li>textprintf_justify (textprintf_justify_ex)
+     <li>draw_character (draw_character_ex)
+     <li>gui_textout (gui_textout_ex)
+   <ul></ul>
+<ul><li>
    The 'aspect' parameter of get_camera_matrix() and get_camera_matrix_f()
    strictly conforms to the documentation; in particular, setting it to 1
    instructs the functions to do no scaling. This was not the case before,
--- docs/src/allegro._tx.defines	Tue Oct 29 21:17:57 2002
+++ docs/src/allegro._tx	Tue Oct 29 21:55:19 2002
@@ -2477,10 +2477,6 @@
    selected configuration file. Returns zero on success: if it fails the 
    joystick state is undefined and you must reinitialise it from scratch.
 
-@domain.hid @initialise_joystick();
-@domain.hid install_joystick
-   Deprecated. Use install_joystick() instead.
-
 
 
 @heading
@@ -3357,7 +3353,8 @@
 You may notice that a lot of the code in Allegro spells 'palette' as 
 'pallete'. This is because the headers from my old Mark Williams compiler on 
 the Atari spelt it with two l's, so that is what I'm used to. Allegro will 
-happily accept either spelling, due to some #defines in allegro/alcompat.h.
+happily accept either spelling, due to some #defines in allegro/alcompat.h
+(which can be turned off using the ALLEGRO_NO_COMPATIBILITY cpp symbol).
 
 @@void @set_color(int index, const RGB *p);
 @xref set_palette, get_color, _set_color
@@ -3800,19 +3797,9 @@
 bitmap.
 
 @@void @clear_bitmap(BITMAP *bitmap);
-@domain.hid clear_to_color, clear
+@xref clear_to_color
    Clears the bitmap to color 0.
 
-@domain.hid @clear(BITMAP *bitmap);
-@domain.hid clear_bitmap
-   An alias for clear_bitmap(), provided for backwards compatibility. It is
-   implemented as a static inline function. The aliasing may be switched off
-   by defining the preprocessor symbol ALLEGRO_NO_CLEAR_BITMAP_ALIAS before
-   including Allegro headers, eg:
-<codeblock>
-      #define ALLEGRO_NO_CLEAR_BITMAP_ALIAS
-      #include &ltallegro.h&gt
-<endblock>
 @@void @clear_to_color(BITMAP *bitmap, int color);
 @xref clear_bitmap
    Clears the bitmap to the specified color.
@@ -3976,11 +3963,6 @@
    blue, zero green). The sprite must be an 8 bit image, even if the
    destination is a truecolor bitmap.
 
-@domain.hid @draw_character(BITMAP *bmp, BITMAP *sprite, int x, int y, int color);
-@domain.hid draw_sprite, bitmap_mask_color, text_mode, draw_character_ex
-   Deprecated. Use draw_character_ex() instead, passing the mode you would
-   have passed to text_mode() as the 'bg' parameter.
-
 @@void @rotate_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y, fixed angle);
 @xref draw_sprite, rotate_scaled_sprite, rotate_sprite_v_flip
 @xref rotate_scaled_sprite_v_flip
@@ -4257,67 +4239,6 @@
 @xref textprintf_ex, textout_justify_ex
    Like textout_justify_ex(), but using a printf() style format string.
 
-@domain.hid @text_mode(int mode);
-@domain.hid textout, textprintf
-   Deprecated: if you use the new textout_ex() family, you no longer have
-   to set the text mode.
-
-   Sets the mode in which text will be drawn. Returns previous mode.
-   If mode is zero or positive, text output will be opaque and the 
-   background of the characters will be set to color 'mode'. If mode is 
-   negative, text will be drawn transparently (ie. the background of the 
-   characters will not be altered). The default is a mode of zero.
-
-@domain.hid @textout(BITMAP *bmp, const FONT *f, const char *s,
-@@             int x, y, color);
-@domain.hid font, text_mode, textout_centre, textout_right, textout_justify
-@domain.hid textprintf, text_height, text_length, textout_ex
-   Deprecated. Use textout_ex() instead, passing the mode you would have
-   passed to text_mode() as the 'bg' parameter.
-
-@domain.hid @textout_centre(BITMAP *bmp, const FONT *f, const char *s,
-@@                    int x, y, color);
-@domain.hid textout, textprintf_centre, text_mode, textout_centre_ex
-   Deprecated. Use textout_centre_ex() instead, passing the mode you would
-   have passed to text_mode() as the 'bg' parameter.
-
-@domain.hid @textout_right(BITMAP *bmp, const FONT *f, const char *s,
-@@                   int x, y, color);
-@domain.hid textout, textprintf_right, text_mode, textout_right_ex
-   Deprecated. Use textout_right_ex() instead, passing the mode you would
-   have passed to text_mode() as the 'bg' parameter.
-
-@domain.hid @textout_justify(BITMAP *bmp, const FONT *f, const char *s,
-@@                     int x1, x2, y, diff, color);
-@domain.hid textout, textprintf_justify, text_mode, textout_justify_ex
-   Deprecated. Use textout_justify_ex() instead, passing the mode you would
-   have passed to text_mode() as the 'bg' parameter.
-
-@domain.hid @textprintf(BITMAP *bmp, const FONT *f, int x, y, color,
-@@                const char *fmt, ...);
-@domain.hid font, text_mode, textprintf_centre, text_mode, textprintf_right
-@domain.hid textprintf_justify, textout, text_height, text_length, textprintf_ex
-   Deprecated. Use textprintf_ex() instead, passing the mode you would have
-   passed to text_mode() as the 'bg' parameter.
-
-@domain.hid @textprintf_centre(BITMAP *bmp, const FONT *f, int x, y, color,
-@@                       const char *fmt, ...);
-@domain.hid textprintf, textout_centre, text_mode, textprintf_centre_ex
-   Deprecated. Use textprintf_centre_ex() instead, passing the mode you
-   would have passed to text_mode() as the 'bg' parameter.
-
-@domain.hid @textprintf_right(BITMAP *bmp, const FONT *f, int x, y, color,
-@@                      const char *fmt, ...);
-@domain.hid textprintf, textout_right, text_mode, textprintf_right_ex
-   Deprecated. Use textprintf_right_ex() instead, passing the mode you would
-   have passed to text_mode() as the 'bg' parameter.
-
-@domain.hid @textprintf_justify(BITMAP *bmp, const FONT *f, int x1, x2, y,
-@@                        diff, color, const char *fmt, ...);
-@domain.hid textprintf, textout_justify, text_mode, textprintf_justify_ex
-   Deprecated. Use textprintf_justify_ex() instead, passing the mode you
-   would have passed to text_mode() as the 'bg' parameter.
-
 
 
 @heading
@@ -6715,16 +6636,6 @@
 You should use the overloaded sqrt(x) or x.sqrt() instead.
 
 
-@domain.hid Fixed point aliases
-The fixed point functions used to be named with an "f" prefix instead of
-"fix", eg. fixsqrt() used to be fsqrt(), but were renamed due to conflicts
-with some libc implementations. This should not affect most existing code as
-there are backwards compatibility aliases. These aliases are static inline
-functions which map the old names to the new names, eg. fsqrt() calls
-fixsqrt(). You can disable the aliases by defining the preprocessor macro
-ALLEGRO_NO_FIX_ALIASES before including allegro.h.
-
-
 
 @heading
 3D math routines
@@ -7462,11 +7373,6 @@
    screen, interpreting the '&' character as an underbar for displaying 
    keyboard shortcuts. Returns the width of the output string in pixels.
 
-@domain.hid @gui_textout(BITMAP *bmp, const char *s, int x, y, color, centre);
-@domain.hid gui_strlen, text_mode, gui_textout_ex
-   Deprecated. Use gui_textout_ex() instead, passing the mode you would have
-   passed to text_mode() as the 'bg' parameter.
-
 @@int @gui_strlen(const char *s);
 @xref gui_textout_ex
    Helper function for use by the GUI routines. Returns the length of a 
@@ -7670,12 +7576,6 @@
    stretched to the corresponding screen dimension. This function returns
    zero if it was closed with the Cancel button or non-zero if it was OK'd.
 
-@domain.hid @file_select(const char *message, char *path, const char *ext);
-@domain.hid file_select_ex, gui_fg_color
-   Deprecated. Use file_select_ex() instead, passing the two constants
-   OLD_FILESEL_WIDTH and OLD_FILESEL_HEIGHT if you want the file selector
-   to be displayed with the dimensions of the old file selector.
-
 @@int @gfx_mode_select(int *card, int *w, int *h);
 @xref gfx_mode_select_ex, set_gfx_mode, gui_fg_color
    Displays the Allegro graphics mode selection dialog, which allows the 
@@ -8755,6 +8655,32 @@
    If you define this prior to including Allegro headers, Allegro will be 
    set up for building a console application rather than the default GUI 
    program on some platforms (especially Windows).
+
+<b>ALLEGRO_NO_STD_HEADER</b><br>
+   If defined, Allegro will not try to include some often used standard
+   headers (eg <stddef.h>, <limits.h>, etc).
+
+<b>ALLEGRO_NO_COMPATIBILITY</b><br>
+   If defined, Allegro will not include the backward compatibility layer.
+   It is undefined by default so old programs can still be compiled with
+   the minimum amount of issues, but you should define this symbol if you
+   intend to maintain your code to match the latest versions of Allegro.
+
+<b>ALLEGRO_NO_FIX_ALIASES</b><br>
+   The fixed point functions used to be named with an "f" prefix instead of
+   "fix", eg. fixsqrt() used to be fsqrt(), but were renamed due to conflicts
+   with some libc implementations. This should not affect most existing code as
+   there are backwards compatibility aliases. These aliases are static inline
+   functions which map the old names to the new names, eg. fsqrt() calls
+   fixsqrt(). You can disable the aliases by defining the preprocessor macro
+   ALLEGRO_NO_FIX_ALIASES before including allegro.h.
+
+<b>ALLEGRO_NO_CLEAR_BITMAP_ALIAS</b><br>
+   If defined, Allegro will not define the clear() alias to clear_bitmap().
+
+<b>ALLEGRO_NO_KEY_DEFINES</b><br>
+   If defined, Allegro will omit the definition of the KEY_* constants,
+   which sometimes clash with other headers.
 
 Allegro also defines a number of standard macros that can be used to 
 insulate you from some of the differences between systems:


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/