Main Page | Alphabetical List | Data Structures | File List | Globals

aintern.h

00001 /*         ______   ___    ___
00002  *        /\  _  \ /\_ \  /\_ \
00003  *        \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___
00004  *         \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\
00005  *          \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \
00006  *           \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
00007  *            \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
00008  *                                           /\____/
00009  *                                           \_/__/
00010  *
00011  *      Some definitions for internal use by the library code.
00012  *
00013  *      By Shawn Hargreaves.
00014  *
00015  *      See readme.txt for copyright information.
00016  */
00017 
00018 
00019 #ifndef AINTERN_H
00020 #define AINTERN_H
00021 
00022 #ifndef ALLEGRO_H
00023    #error must include allegro.h first
00024 #endif
00025 
00026 #ifdef __cplusplus
00027    extern "C" {
00028 #endif
00029 
00030 
00031 /* flag for how many times we have been initialised */
00032 AL_VAR(int, _allegro_count);
00033 
00034 
00035 /* some Allegro functions need a block of scratch memory */
00036 AL_VAR(void *, _scratch_mem);
00037 AL_VAR(int, _scratch_mem_size);
00038 
00039 
00040 AL_INLINE(void, _grow_scratch_mem, (int size),
00041 {
00042    if (size > _scratch_mem_size) {
00043       size = (size+1023) & 0xFFFFFC00;
00044       _scratch_mem = realloc(_scratch_mem, size);
00045       _scratch_mem_size = size;
00046    }
00047 })
00048 
00049 
00050 /* malloc wrappers for DLL <-> application shared memory */
00051 AL_FUNC(void *, _al_malloc, (int size));
00052 AL_FUNC(void, _al_free, (void *mem));
00053 AL_FUNC(void *, _al_realloc, (void *mem, int size));
00054 
00055 
00056 /* list of functions to call at program cleanup */
00057 AL_FUNC(void, _add_exit_func, (AL_METHOD(void, func, (void))));
00058 AL_FUNC(void, _remove_exit_func, (AL_METHOD(void, func, (void))));
00059 
00060 
00061 /* helper structure for talking to Unicode strings */
00062 typedef struct UTYPE_INFO
00063 {
00064    int id;
00065    AL_METHOD(int, u_getc, (AL_CONST char *s));
00066    AL_METHOD(int, u_getx, (char **s));
00067    AL_METHOD(int, u_setc, (char *s, int c));
00068    AL_METHOD(int, u_width, (AL_CONST char *s));
00069    AL_METHOD(int, u_cwidth, (int c));
00070    AL_METHOD(int, u_isok, (int c));
00071    int u_width_max;
00072 } UTYPE_INFO;
00073 
00074 AL_FUNC(UTYPE_INFO *, _find_utype, (int type));
00075 
00076 
00077 /* message stuff */
00078 #define ALLEGRO_MESSAGE_SIZE  4096
00079 
00080 
00081 /* wrappers for implementing disk I/O on different platforms */
00082 AL_FUNC(int, _al_file_isok, (AL_CONST char *filename));
00083 AL_FUNC(long, _al_file_size, (AL_CONST char *filename));
00084 AL_FUNC(time_t, _al_file_time, (AL_CONST char *filename));
00085 AL_FUNC(int, _al_drive_exists, (int drive));
00086 AL_FUNC(int, _al_getdrive, (void));
00087 AL_FUNC(void, _al_getdcwd, (int drive, char *buf, int size));
00088 
00089 
00090 /* packfile stuff */
00091 AL_VAR(int, _packfile_filesize);
00092 AL_VAR(int, _packfile_datasize);
00093 AL_VAR(int, _packfile_type);
00094 AL_FUNC(PACKFILE *, _pack_fdopen, (int fd, AL_CONST char *mode));
00095 
00096 
00097 /* various bits of mouse stuff */
00098 AL_FUNC(void, _handle_mouse_input, (void));
00099 
00100 AL_VAR(int, _mouse_x);
00101 AL_VAR(int, _mouse_y);
00102 AL_VAR(int, _mouse_z);
00103 AL_VAR(int, _mouse_b);
00104 AL_VAR(int, _mouse_on);
00105 
00106 AL_VAR(int, _mouse_installed);
00107 
00108 AL_VAR(int, _mouse_type);
00109 AL_VAR(BITMAP *, _mouse_screen);
00110 AL_VAR(BITMAP *, _mouse_pointer);
00111 
00112 
00113 /* various bits of timer stuff */
00114 AL_FUNC(long, _handle_timer_tick, (int interval));
00115 
00116 #define MAX_TIMERS      16
00117 
00118 /* list of active timer handlers */
00119 typedef struct TIMER_QUEUE
00120 {
00121    AL_METHOD(void, proc, (void));      /* timer handler functions */
00122    AL_METHOD(void, param_proc, (void *param));
00123    void *param;                        /* param for param_proc if used */
00124    long speed;                         /* timer speed */
00125    long counter;                       /* counts down to zero=blastoff */
00126 } TIMER_QUEUE;
00127 
00128 AL_ARRAY(TIMER_QUEUE, _timer_queue);
00129 
00130 AL_VAR(int, _timer_installed);
00131 
00132 AL_VAR(int, _timer_use_retrace);
00133 AL_VAR(volatile int, _retrace_hpp_value);
00134 
00135 AL_VAR(long, _vsync_speed);
00136 
00137 
00138 /* various bits of keyboard stuff */
00139 AL_FUNC(void, _handle_key_press, (int keycode, int scancode));
00140 AL_FUNC(void, _handle_key_release, (int scancode));
00141 
00142 AL_VAR(int, _keyboard_installed);
00143 
00144 AL_ARRAY(volatile char, _key);
00145 AL_VAR(volatile int, _key_shifts);
00146 
00147 AL_FUNC(void, _pckeys_init, (void));
00148 AL_FUNC(void, _handle_pckey, (int code));
00149 AL_FUNC(int,  _pckey_scancode_to_ascii, (int scancode));
00150 
00151 AL_VAR(unsigned short *, _key_ascii_table);
00152 AL_VAR(unsigned short *, _key_capslock_table);
00153 AL_VAR(unsigned short *, _key_shift_table);
00154 AL_VAR(unsigned short *, _key_control_table);
00155 AL_VAR(unsigned short *, _key_altgr_lower_table);
00156 AL_VAR(unsigned short *, _key_altgr_upper_table);
00157 AL_VAR(unsigned short *, _key_accent1_lower_table);
00158 AL_VAR(unsigned short *, _key_accent1_upper_table);
00159 AL_VAR(unsigned short *, _key_accent2_lower_table);
00160 AL_VAR(unsigned short *, _key_accent2_upper_table);
00161 AL_VAR(unsigned short *, _key_accent3_lower_table);
00162 AL_VAR(unsigned short *, _key_accent3_upper_table);
00163 AL_VAR(unsigned short *, _key_accent4_lower_table);
00164 AL_VAR(unsigned short *, _key_accent4_upper_table);
00165 
00166 AL_VAR(int, _key_accent1);
00167 AL_VAR(int, _key_accent2);
00168 AL_VAR(int, _key_accent3);
00169 AL_VAR(int, _key_accent4);
00170 AL_VAR(int, _key_accent1_flag);
00171 AL_VAR(int, _key_accent2_flag);
00172 AL_VAR(int, _key_accent3_flag);
00173 AL_VAR(int, _key_accent4_flag);
00174 
00175 AL_VAR(int, _key_standard_kb);
00176 
00177 
00178 /* various bits of joystick stuff */
00179 AL_VAR(int, _joy_type);
00180 
00181 AL_VAR(int, _joystick_installed);
00182 
00183 
00184 /* some GUI innards that other people need to use */
00185 AL_FUNC(int, _gui_shadow_box_proc, (int msg, DIALOG *d, int c));
00186 AL_FUNC(int, _gui_ctext_proc, (int msg, DIALOG *d, int c));
00187 AL_FUNC(int, _gui_button_proc, (int msg, DIALOG *d, int c));
00188 AL_FUNC(int, _gui_edit_proc, (int msg, DIALOG *d, int c));
00189 AL_FUNC(int, _gui_list_proc, (int msg, DIALOG *d, int c));
00190 AL_FUNC(int, _gui_text_list_proc, (int msg, DIALOG *d, int c));
00191 
00192 AL_FUNC(void, _handle_scrollable_scroll_click, (DIALOG *d, int listsize, int *offset, int height));
00193 AL_FUNC(void, _handle_scrollable_scroll, (DIALOG *d, int listsize, int *index, int *offset));
00194 AL_FUNC(void, _handle_listbox_click, (DIALOG *d));
00195 AL_FUNC(void, _draw_scrollable_frame, (DIALOG *d, int listsize, int offset, int height, int fg_color, int bg));
00196 AL_FUNC(void, _draw_listbox, (DIALOG *d));
00197 AL_FUNC(void, _draw_textbox, (char *thetext, int *listsize, int draw, int offset, int wword, int tabsize, int x, int y, int w, int h, int disabled, int fore, int deselect, int disable));
00198 
00199 
00200 /* text- and font-related stuff */
00201 typedef struct FONT_VTABLE
00202 {
00203    AL_METHOD(int, font_height, (AL_CONST FONT *f));
00204    AL_METHOD(int, char_length, (AL_CONST FONT *f, int ch));
00205    AL_METHOD(int, text_length, (AL_CONST FONT *f, AL_CONST char *text));
00206    AL_METHOD(int, render_char, (AL_CONST FONT *f, int ch, int fg, int bg, BITMAP *bmp, int x, int y));
00207    AL_METHOD(void, render, (AL_CONST FONT *f, AL_CONST char *text, int fg, int bg, BITMAP *bmp, int x, int y));
00208    AL_METHOD(void, destroy, (FONT *f));
00209 } FONT_VTABLE;
00210 
00211 AL_VAR(FONT, _default_font);
00212 AL_VAR(FONT_VTABLE, _font_vtable_mono);
00213 AL_VAR(FONT_VTABLE *, font_vtable_mono);
00214 AL_VAR(FONT_VTABLE, _font_vtable_color);
00215 AL_VAR(FONT_VTABLE *, font_vtable_color);
00216 
00217 AL_FUNC(FONT_GLYPH *, _mono_find_glyph, (AL_CONST FONT *f, int ch));
00218 AL_FUNC(BITMAP *, _color_find_glyph, (AL_CONST FONT *f, int ch));
00219 
00220 typedef struct FONT_MONO_DATA 
00221 {
00222    int begin, end;                  /* first char and one-past-the-end char */
00223    FONT_GLYPH **glyphs;             /* our glyphs */
00224    struct FONT_MONO_DATA *next;     /* linked list structure */
00225 } FONT_MONO_DATA;
00226 
00227 typedef struct FONT_COLOR_DATA
00228 {
00229    int begin, end;                  /* first char and one-past-the-end char */
00230    BITMAP **bitmaps;                /* our glyphs */
00231    struct FONT_COLOR_DATA *next;    /* linked list structure */
00232 } FONT_COLOR_DATA;
00233 
00234 
00235 /* caches and tables for svga bank switching */
00236 AL_VAR(int, _last_bank_1);
00237 AL_VAR(int, _last_bank_2); 
00238 
00239 AL_VAR(int *, _gfx_bank);
00240 
00241 /* bank switching routines (these use a non-C calling convention on i386!) */
00242 AL_FUNC(unsigned long, _stub_bank_switch, (BITMAP *bmp, int line));
00243 AL_FUNC(void, _stub_unbank_switch, (BITMAP *bmp));
00244 AL_FUNC(void, _stub_bank_switch_end, (void));
00245 
00246 #ifdef GFX_MODEX
00247 
00248 AL_FUNC(unsigned long, _x_bank_switch, (BITMAP *bmp, int line));
00249 AL_FUNC(void, _x_unbank_switch, (BITMAP *bmp));
00250 AL_FUNC(void, _x_bank_switch_end, (void));
00251 
00252 #endif
00253 
00254 #ifdef GFX_VBEAF
00255 
00256 AL_FUNC(void, _accel_bank_stub, (void));
00257 AL_FUNC(void, _accel_bank_stub_end, (void));
00258 AL_FUNC(void, _accel_bank_switch, (void));
00259 AL_FUNC(void, _accel_bank_switch_end, (void));
00260 
00261 AL_VAR(void *, _accel_driver);
00262 
00263 AL_VAR(int, _accel_active);
00264 
00265 AL_VAR(void *, _accel_set_bank);
00266 AL_VAR(void *, _accel_idle);
00267 
00268 AL_FUNC(void, _fill_vbeaf_libc_exports, (void *ptr));
00269 AL_FUNC(void, _fill_vbeaf_pmode_exports, (void *ptr));
00270 
00271 #endif
00272 
00273 
00274 /* stuff for setting up bitmaps */
00275 AL_FUNC(BITMAP *, _make_bitmap, (int w, int h, unsigned long addr, GFX_DRIVER *driver, int color_depth, int bpl));
00276 AL_FUNC(void, _sort_out_virtual_width, (int *width, GFX_DRIVER *driver));
00277 
00278 AL_FUNC(GFX_VTABLE *, _get_vtable, (int color_depth));
00279 
00280 AL_VAR(GFX_VTABLE, _screen_vtable);
00281 
00282 AL_VAR(int, _gfx_mode_set_count);
00283 
00284 AL_VAR(int, _refresh_rate_request);
00285 AL_FUNC(void, _set_current_refresh_rate, (int rate));
00286 
00287 AL_VAR(int, _sub_bitmap_id_count);
00288 
00289 AL_VAR(int, _screen_split_position);
00290 
00291 AL_VAR(int, _safe_gfx_mode_change);
00292 
00293 #ifdef ALLEGRO_I386
00294    #define BYTES_PER_PIXEL(bpp)     (((int)(bpp) + 7) / 8)
00295 #else
00296    #ifdef ALLEGRO_MPW 
00297       /* in Mac 24 bit is a unsigned long */
00298       #define BYTES_PER_PIXEL(bpp)  (((bpp) <= 8) ? 1                                    \
00299                                      : (((bpp) <= 16) ? sizeof (unsigned short)          \
00300                                         : sizeof (unsigned long)))
00301    #else
00302       #define BYTES_PER_PIXEL(bpp)  (((bpp) <= 8) ? 1                                    \
00303                                      : (((bpp) <= 16) ? sizeof (unsigned short)          \
00304                                         : (((bpp) <= 24) ? 3 : sizeof (unsigned long))))
00305    #endif
00306 #endif
00307 
00308 AL_FUNC(int, _color_load_depth, (int depth, int hasalpha));
00309 
00310 AL_VAR(int, _color_conv);
00311 
00312 AL_FUNC(BITMAP *, _fixup_loaded_bitmap, (BITMAP *bmp, PALETTE pal, int bpp));
00313 
00314 
00315 /* display switching support */
00316 AL_FUNC(void, _switch_in, (void));
00317 AL_FUNC(void, _switch_out, (void));
00318 
00319 AL_FUNC(void, _register_switch_bitmap, (BITMAP *bmp, BITMAP *parent));
00320 AL_FUNC(void, _unregister_switch_bitmap, (BITMAP *bmp));
00321 AL_FUNC(void, _save_switch_state, (int switch_mode));
00322 AL_FUNC(void, _restore_switch_state, ());
00323 
00324 AL_VAR(int, _dispsw_status);
00325 
00326 
00327 /* current drawing mode */
00328 AL_VAR(int, _drawing_mode);
00329 AL_VAR(BITMAP *, _drawing_pattern);
00330 AL_VAR(int, _drawing_x_anchor);
00331 AL_VAR(int, _drawing_y_anchor);
00332 AL_VAR(unsigned int, _drawing_x_mask);
00333 AL_VAR(unsigned int, _drawing_y_mask);
00334 
00335 AL_FUNCPTR(int *, _palette_expansion_table, (int bpp));
00336 
00337 AL_VAR(int, _color_depth);
00338 
00339 AL_VAR(int, _current_palette_changed);
00340 AL_VAR(PALETTE, _prev_current_palette);
00341 AL_VAR(int, _got_prev_current_palette);
00342 
00343 AL_ARRAY(int, _palette_color8);
00344 AL_ARRAY(int, _palette_color15);
00345 AL_ARRAY(int, _palette_color16);
00346 AL_ARRAY(int, _palette_color24);
00347 AL_ARRAY(int, _palette_color32);
00348 
00349 /* truecolor blending functions */
00350 AL_VAR(BLENDER_FUNC, _blender_func15);
00351 AL_VAR(BLENDER_FUNC, _blender_func16);
00352 AL_VAR(BLENDER_FUNC, _blender_func24);
00353 AL_VAR(BLENDER_FUNC, _blender_func32);
00354 
00355 AL_VAR(BLENDER_FUNC, _blender_func15x);
00356 AL_VAR(BLENDER_FUNC, _blender_func16x);
00357 AL_VAR(BLENDER_FUNC, _blender_func24x);
00358 
00359 AL_VAR(int, _blender_col_15);
00360 AL_VAR(int, _blender_col_16);
00361 AL_VAR(int, _blender_col_24);
00362 AL_VAR(int, _blender_col_32);
00363 
00364 AL_VAR(int, _blender_alpha);
00365 
00366 AL_FUNC(unsigned long, _blender_black, (unsigned long x, unsigned long y, unsigned long n));
00367 
00368 #ifdef ALLEGRO_COLOR16
00369 
00370 AL_FUNC(unsigned long, _blender_trans15, (unsigned long x, unsigned long y, unsigned long n));
00371 AL_FUNC(unsigned long, _blender_add15, (unsigned long x, unsigned long y, unsigned long n));
00372 AL_FUNC(unsigned long, _blender_burn15, (unsigned long x, unsigned long y, unsigned long n));
00373 AL_FUNC(unsigned long, _blender_color15, (unsigned long x, unsigned long y, unsigned long n));
00374 AL_FUNC(unsigned long, _blender_difference15, (unsigned long x, unsigned long y, unsigned long n));
00375 AL_FUNC(unsigned long, _blender_dissolve15, (unsigned long x, unsigned long y, unsigned long n));
00376 AL_FUNC(unsigned long, _blender_dodge15, (unsigned long x, unsigned long y, unsigned long n));
00377 AL_FUNC(unsigned long, _blender_hue15, (unsigned long x, unsigned long y, unsigned long n));
00378 AL_FUNC(unsigned long, _blender_invert15, (unsigned long x, unsigned long y, unsigned long n));
00379 AL_FUNC(unsigned long, _blender_luminance15, (unsigned long x, unsigned long y, unsigned long n));
00380 AL_FUNC(unsigned long, _blender_multiply15, (unsigned long x, unsigned long y, unsigned long n));
00381 AL_FUNC(unsigned long, _blender_saturation15, (unsigned long x, unsigned long y, unsigned long n));
00382 AL_FUNC(unsigned long, _blender_screen15, (unsigned long x, unsigned long y, unsigned long n));
00383 
00384 AL_FUNC(unsigned long, _blender_trans16, (unsigned long x, unsigned long y, unsigned long n));
00385 AL_FUNC(unsigned long, _blender_add16, (unsigned long x, unsigned long y, unsigned long n));
00386 AL_FUNC(unsigned long, _blender_burn16, (unsigned long x, unsigned long y, unsigned long n));
00387 AL_FUNC(unsigned long, _blender_color16, (unsigned long x, unsigned long y, unsigned long n));
00388 AL_FUNC(unsigned long, _blender_difference16, (unsigned long x, unsigned long y, unsigned long n));
00389 AL_FUNC(unsigned long, _blender_dissolve16, (unsigned long x, unsigned long y, unsigned long n));
00390 AL_FUNC(unsigned long, _blender_dodge16, (unsigned long x, unsigned long y, unsigned long n));
00391 AL_FUNC(unsigned long, _blender_hue16, (unsigned long x, unsigned long y, unsigned long n));
00392 AL_FUNC(unsigned long, _blender_invert16, (unsigned long x, unsigned long y, unsigned long n));
00393 AL_FUNC(unsigned long, _blender_luminance16, (unsigned long x, unsigned long y, unsigned long n));
00394 AL_FUNC(unsigned long, _blender_multiply16, (unsigned long x, unsigned long y, unsigned long n));
00395 AL_FUNC(unsigned long, _blender_saturation16, (unsigned long x, unsigned long y, unsigned long n));
00396 AL_FUNC(unsigned long, _blender_screen16, (unsigned long x, unsigned long y, unsigned long n));
00397 
00398 #endif
00399 
00400 #if (defined ALLEGRO_COLOR24) || (defined ALLEGRO_COLOR32)
00401 
00402 AL_FUNC(unsigned long, _blender_trans24, (unsigned long x, unsigned long y, unsigned long n));
00403 AL_FUNC(unsigned long, _blender_add24, (unsigned long x, unsigned long y, unsigned long n));
00404 AL_FUNC(unsigned long, _blender_burn24, (unsigned long x, unsigned long y, unsigned long n));
00405 AL_FUNC(unsigned long, _blender_color24, (unsigned long x, unsigned long y, unsigned long n));
00406 AL_FUNC(unsigned long, _blender_difference24, (unsigned long x, unsigned long y, unsigned long n));
00407 AL_FUNC(unsigned long, _blender_dissolve24, (unsigned long x, unsigned long y, unsigned long n));
00408 AL_FUNC(unsigned long, _blender_dodge24, (unsigned long x, unsigned long y, unsigned long n));
00409 AL_FUNC(unsigned long, _blender_hue24, (unsigned long x, unsigned long y, unsigned long n));
00410 AL_FUNC(unsigned long, _blender_invert24, (unsigned long x, unsigned long y, unsigned long n));
00411 AL_FUNC(unsigned long, _blender_luminance24, (unsigned long x, unsigned long y, unsigned long n));
00412 AL_FUNC(unsigned long, _blender_multiply24, (unsigned long x, unsigned long y, unsigned long n));
00413 AL_FUNC(unsigned long, _blender_saturation24, (unsigned long x, unsigned long y, unsigned long n));
00414 AL_FUNC(unsigned long, _blender_screen24, (unsigned long x, unsigned long y, unsigned long n));
00415 
00416 #endif
00417 
00418 AL_FUNC(unsigned long, _blender_alpha15, (unsigned long x, unsigned long y, unsigned long n));
00419 AL_FUNC(unsigned long, _blender_alpha16, (unsigned long x, unsigned long y, unsigned long n));
00420 AL_FUNC(unsigned long, _blender_alpha24, (unsigned long x, unsigned long y, unsigned long n));
00421 AL_FUNC(unsigned long, _blender_alpha32, (unsigned long x, unsigned long y, unsigned long n));
00422 
00423 AL_FUNC(unsigned long, _blender_write_alpha, (unsigned long x, unsigned long y, unsigned long n));
00424 
00425 
00426 /* graphics drawing routines */
00427 AL_FUNC(void, _normal_line, (BITMAP *bmp, int x1, int y1, int x2, int y2, int color));
00428 AL_FUNC(void, _normal_rectfill, (BITMAP *bmp, int x1, int y1, int x2, int y2, int color));
00429 
00430 #ifdef ALLEGRO_COLOR8
00431 
00432 AL_FUNC(int,  _linear_getpixel8, (BITMAP *bmp, int x, int y));
00433 AL_FUNC(void, _linear_putpixel8, (BITMAP *bmp, int x, int y, int color));
00434 AL_FUNC(void, _linear_vline8, (BITMAP *bmp, int x, int y1, int y2, int color));
00435 AL_FUNC(void, _linear_hline8, (BITMAP *bmp, int x1, int y, int x2, int color));
00436 AL_FUNC(void, _linear_draw_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00437 AL_FUNC(void, _linear_draw_sprite_v_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00438 AL_FUNC(void, _linear_draw_sprite_h_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00439 AL_FUNC(void, _linear_draw_sprite_vh_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00440 AL_FUNC(void, _linear_draw_trans_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00441 AL_FUNC(void, _linear_draw_lit_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
00442 AL_FUNC(void, _linear_draw_rle_sprite8, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00443 AL_FUNC(void, _linear_draw_trans_rle_sprite8, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00444 AL_FUNC(void, _linear_draw_lit_rle_sprite8, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color));
00445 AL_FUNC(void, _linear_draw_character8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg));
00446 AL_FUNC(void, _linear_draw_glyph8, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg));
00447 AL_FUNC(void, _linear_blit8, (BITMAP *source,BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00448 AL_FUNC(void, _linear_blit_backward8, (BITMAP *source,BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00449 AL_FUNC(void, _linear_masked_blit8, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00450 AL_FUNC(void, _linear_clear_to_color8, (BITMAP *bitmap, int color));
00451 
00452 #endif
00453 
00454 #ifdef ALLEGRO_COLOR16
00455 
00456 AL_FUNC(void, _linear_putpixel15, (BITMAP *bmp, int x, int y, int color));
00457 AL_FUNC(void, _linear_vline15, (BITMAP *bmp, int x, int y1, int y2, int color));
00458 AL_FUNC(void, _linear_hline15, (BITMAP *bmp, int x1, int y, int x2, int color));
00459 AL_FUNC(void, _linear_draw_trans_sprite15, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00460 AL_FUNC(void, _linear_draw_trans_rgba_sprite15, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00461 AL_FUNC(void, _linear_draw_lit_sprite15, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
00462 AL_FUNC(void, _linear_draw_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00463 AL_FUNC(void, _linear_draw_trans_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00464 AL_FUNC(void, _linear_draw_trans_rgba_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00465 AL_FUNC(void, _linear_draw_lit_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color));
00466 
00467 AL_FUNC(int,  _linear_getpixel16, (BITMAP *bmp, int x, int y));
00468 AL_FUNC(void, _linear_putpixel16, (BITMAP *bmp, int x, int y, int color));
00469 AL_FUNC(void, _linear_vline16, (BITMAP *bmp, int x, int y1, int y2, int color));
00470 AL_FUNC(void, _linear_hline16, (BITMAP *bmp, int x1, int y, int x2, int color));
00471 AL_FUNC(void, _linear_draw_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00472 AL_FUNC(void, _linear_draw_256_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00473 AL_FUNC(void, _linear_draw_sprite_v_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00474 AL_FUNC(void, _linear_draw_sprite_h_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00475 AL_FUNC(void, _linear_draw_sprite_vh_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00476 AL_FUNC(void, _linear_draw_trans_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00477 AL_FUNC(void, _linear_draw_trans_rgba_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00478 AL_FUNC(void, _linear_draw_lit_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
00479 AL_FUNC(void, _linear_draw_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00480 AL_FUNC(void, _linear_draw_trans_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00481 AL_FUNC(void, _linear_draw_trans_rgba_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00482 AL_FUNC(void, _linear_draw_lit_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color));
00483 AL_FUNC(void, _linear_draw_character16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg));
00484 AL_FUNC(void, _linear_draw_glyph16, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg));
00485 AL_FUNC(void, _linear_blit16, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00486 AL_FUNC(void, _linear_blit_backward16, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00487 AL_FUNC(void, _linear_masked_blit16, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00488 AL_FUNC(void, _linear_clear_to_color16, (BITMAP *bitmap, int color));
00489 
00490 #endif
00491 
00492 #ifdef ALLEGRO_COLOR24
00493 
00494 AL_FUNC(int,  _linear_getpixel24, (BITMAP *bmp, int x, int y));
00495 AL_FUNC(void, _linear_putpixel24, (BITMAP *bmp, int x, int y, int color));
00496 AL_FUNC(void, _linear_vline24, (BITMAP *bmp, int x, int y1, int y2, int color));
00497 AL_FUNC(void, _linear_hline24, (BITMAP *bmp, int x1, int y, int x2, int color));
00498 AL_FUNC(void, _linear_draw_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00499 AL_FUNC(void, _linear_draw_256_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00500 AL_FUNC(void, _linear_draw_sprite_v_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00501 AL_FUNC(void, _linear_draw_sprite_h_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00502 AL_FUNC(void, _linear_draw_sprite_vh_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00503 AL_FUNC(void, _linear_draw_trans_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00504 AL_FUNC(void, _linear_draw_trans_rgba_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00505 AL_FUNC(void, _linear_draw_lit_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
00506 AL_FUNC(void, _linear_draw_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00507 AL_FUNC(void, _linear_draw_trans_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00508 AL_FUNC(void, _linear_draw_trans_rgba_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00509 AL_FUNC(void, _linear_draw_lit_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color));
00510 AL_FUNC(void, _linear_draw_character24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg));
00511 AL_FUNC(void, _linear_draw_glyph24, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg));
00512 AL_FUNC(void, _linear_blit24, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00513 AL_FUNC(void, _linear_blit_backward24, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00514 AL_FUNC(void, _linear_masked_blit24, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00515 AL_FUNC(void, _linear_clear_to_color24, (BITMAP *bitmap, int color));
00516 
00517 #endif
00518 
00519 #ifdef ALLEGRO_COLOR32
00520 
00521 AL_FUNC(int,  _linear_getpixel32, (BITMAP *bmp, int x, int y));
00522 AL_FUNC(void, _linear_putpixel32, (BITMAP *bmp, int x, int y, int color));
00523 AL_FUNC(void, _linear_vline32, (BITMAP *bmp, int x, int y1, int y2, int color));
00524 AL_FUNC(void, _linear_hline32, (BITMAP *bmp, int x1, int y, int x2, int color));
00525 AL_FUNC(void, _linear_draw_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00526 AL_FUNC(void, _linear_draw_256_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00527 AL_FUNC(void, _linear_draw_sprite_v_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00528 AL_FUNC(void, _linear_draw_sprite_h_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00529 AL_FUNC(void, _linear_draw_sprite_vh_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00530 AL_FUNC(void, _linear_draw_trans_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00531 AL_FUNC(void, _linear_draw_lit_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
00532 AL_FUNC(void, _linear_draw_rle_sprite32, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00533 AL_FUNC(void, _linear_draw_trans_rle_sprite32, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00534 AL_FUNC(void, _linear_draw_lit_rle_sprite32, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color));
00535 AL_FUNC(void, _linear_draw_character32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg));
00536 AL_FUNC(void, _linear_draw_glyph32, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg));
00537 AL_FUNC(void, _linear_blit32, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00538 AL_FUNC(void, _linear_blit_backward32, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00539 AL_FUNC(void, _linear_masked_blit32, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00540 AL_FUNC(void, _linear_clear_to_color32, (BITMAP *bitmap, int color));
00541 
00542 #endif
00543 
00544 #ifdef GFX_MODEX
00545 
00546 AL_FUNC(int,  _x_getpixel, (BITMAP *bmp, int x, int y));
00547 AL_FUNC(void, _x_putpixel, (BITMAP *bmp, int x, int y, int color));
00548 AL_FUNC(void, _x_vline, (BITMAP *bmp, int x, int y1, int y2, int color));
00549 AL_FUNC(void, _x_hline, (BITMAP *bmp, int x1, int y, int x2, int color));
00550 AL_FUNC(void, _x_draw_sprite, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00551 AL_FUNC(void, _x_draw_sprite_v_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00552 AL_FUNC(void, _x_draw_sprite_h_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00553 AL_FUNC(void, _x_draw_sprite_vh_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00554 AL_FUNC(void, _x_draw_trans_sprite, (BITMAP *bmp, BITMAP *sprite, int x, int y));
00555 AL_FUNC(void, _x_draw_lit_sprite, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
00556 AL_FUNC(void, _x_draw_rle_sprite, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00557 AL_FUNC(void, _x_draw_trans_rle_sprite, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
00558 AL_FUNC(void, _x_draw_lit_rle_sprite, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color));
00559 AL_FUNC(void, _x_draw_character, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg));
00560 AL_FUNC(void, _x_draw_glyph, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg));
00561 AL_FUNC(void, _x_blit_from_memory, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00562 AL_FUNC(void, _x_blit_to_memory, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00563 AL_FUNC(void, _x_blit, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00564 AL_FUNC(void, _x_blit_forward, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00565 AL_FUNC(void, _x_blit_backward, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00566 AL_FUNC(void, _x_masked_blit, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
00567 AL_FUNC(void, _x_clear_to_color, (BITMAP *bitmap, int color));
00568 
00569 #endif
00570 
00571 
00572 /* color conversion routines */
00573 typedef struct GRAPHICS_RECT {
00574    int width;
00575    int height;
00576    int pitch;
00577    void *data;
00578 } GRAPHICS_RECT;
00579 
00580 typedef void (COLORCONV_BLITTER_FUNC)(GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect);
00581 
00582 AL_FUNC(COLORCONV_BLITTER_FUNC *, _get_colorconv_blitter, (int from_depth, int to_depth));
00583 AL_FUNC(void, _release_colorconv_blitter, (COLORCONV_BLITTER_FUNC *blitter));
00584 AL_FUNC(void, _set_colorconv_palette, (AL_CONST struct RGB *p, int from, int to));
00585 AL_FUNC(unsigned char *, _get_colorconv_map, (void));
00586 
00587 #ifdef ALLEGRO_COLOR8
00588 
00589 AL_FUNC(void, _colorconv_blit_8_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00590 AL_FUNC(void, _colorconv_blit_8_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00591 AL_FUNC(void, _colorconv_blit_8_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00592 AL_FUNC(void, _colorconv_blit_8_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00593 AL_FUNC(void, _colorconv_blit_8_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00594 
00595 #endif
00596 
00597 #ifdef ALLEGRO_COLOR16
00598 
00599 AL_FUNC(void, _colorconv_blit_15_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00600 AL_FUNC(void, _colorconv_blit_15_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00601 AL_FUNC(void, _colorconv_blit_15_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00602 AL_FUNC(void, _colorconv_blit_15_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00603 
00604 AL_FUNC(void, _colorconv_blit_16_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00605 AL_FUNC(void, _colorconv_blit_16_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00606 AL_FUNC(void, _colorconv_blit_16_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00607 AL_FUNC(void, _colorconv_blit_16_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00608 
00609 #endif
00610 
00611 #ifdef ALLEGRO_COLOR24
00612 
00613 AL_FUNC(void, _colorconv_blit_24_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00614 AL_FUNC(void, _colorconv_blit_24_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00615 AL_FUNC(void, _colorconv_blit_24_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00616 AL_FUNC(void, _colorconv_blit_24_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00617 
00618 #endif
00619 
00620 #ifdef ALLEGRO_COLOR32
00621 
00622 AL_FUNC(void, _colorconv_blit_32_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00623 AL_FUNC(void, _colorconv_blit_32_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00624 AL_FUNC(void, _colorconv_blit_32_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00625 AL_FUNC(void, _colorconv_blit_32_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00626 
00627 #endif
00628 
00629 
00630 /* color copy routines */
00631 #ifndef ALLEGRO_NO_COLORCOPY
00632 
00633 #ifdef ALLEGRO_COLOR16
00634 AL_FUNC(void, _colorcopy_blit_15_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00635 AL_FUNC(void, _colorcopy_blit_16_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00636 #endif
00637 
00638 #ifdef ALLEGRO_COLOR24
00639 AL_FUNC(void, _colorcopy_blit_24_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00640 #endif
00641 
00642 #ifdef ALLEGRO_COLOR32
00643 AL_FUNC(void, _colorcopy_blit_32_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect));
00644 #endif
00645 
00646 #endif
00647 
00648 
00649 /* generic color conversion blitter */
00650 AL_FUNC(void, _blit_between_formats, (BITMAP *src, BITMAP *dest, int s_x, int s_y, int d_x, int d_y, int w, int h));
00651 
00652 
00653 /* asm helper for stretch_blit() */
00654 #ifndef SCAN_EXPORT
00655 AL_FUNC(void, _do_stretch, (BITMAP *source, BITMAP *dest, void *drawer, int sx, fixed sy, fixed syd, int dx, int dy, int dh, int color_depth));
00656 #endif
00657 
00658 
00659 /* lower level functions for rotation */
00660 AL_FUNC(void, _parallelogram_map, (BITMAP *bmp, BITMAP *spr, fixed xs[4], fixed ys[4], void (*draw_scanline)(BITMAP *bmp, BITMAP *spr, fixed l_bmp_x, int bmp_y, fixed r_bmp_x, fixed l_spr_x, fixed l_spr_y, fixed spr_dx, fixed spr_dy), int sub_pixel_accuracy));
00661 AL_FUNC(void, _parallelogram_map_standard, (BITMAP *bmp, BITMAP *sprite, fixed xs[4], fixed ys[4]));
00662 AL_FUNC(void, _rotate_scale_flip_coordinates, (fixed w, fixed h, fixed x, fixed y, fixed cx, fixed cy, fixed angle, fixed scale_x, fixed scale_y, int h_flip, int v_flip, fixed xs[4], fixed ys[4]));
00663 AL_FUNC(void, _pivot_scaled_sprite_flip, (struct BITMAP *bmp, struct BITMAP *sprite, fixed x, fixed y, fixed cx, fixed cy, fixed angle, fixed scale, int v_flip));
00664 
00665 
00666 /* number of fractional bits used by the polygon rasteriser */
00667 #define POLYGON_FIX_SHIFT     18
00668 
00669 
00670 /* bitfield specifying which polygon attributes need interpolating */
00671 #define INTERP_FLAT           1      /* no interpolation */
00672 #define INTERP_1COL           2      /* gcol or alpha */
00673 #define INTERP_3COL           4      /* grgb */
00674 #define INTERP_FIX_UV         8      /* atex */
00675 #define INTERP_Z              16     /* always in scene3d */
00676 #define INTERP_FLOAT_UV       32     /* ptex */
00677 #define OPT_FLOAT_UV_TO_FIX   64     /* translate ptex to atex */
00678 #define COLOR_TO_RGB          128    /* grgb to gcol for truecolor */
00679 #define INTERP_ZBUF           256    /* z-buffered */
00680 #define INTERP_THRU           512    /* any kind of transparent */
00681 #define INTERP_NOSOLID        1024   /* non-solid modes for 8-bit flat */
00682 #define INTERP_BLEND          2048   /* lit for truecolor */
00683 #define INTERP_TRANS          4096   /* trans for truecolor */
00684 
00685 
00686 /* information for polygon scanline fillers */
00687 typedef struct POLYGON_SEGMENT
00688 {
00689    fixed u, v, du, dv;              /* fixed point u/v coordinates */
00690    fixed c, dc;                     /* single color gouraud shade values */
00691    fixed r, g, b, dr, dg, db;       /* RGB gouraud shade values */
00692    float z, dz;                     /* polygon depth (1/z) */
00693    float fu, fv, dfu, dfv;          /* floating point u/v coordinates */
00694    unsigned char *texture;          /* the texture map */
00695    int umask, vmask, vshift;        /* texture map size information */
00696    int seg;                         /* destination bitmap selector */
00697    unsigned long zbuf_addr;         /* Z-buffer address */
00698    unsigned long read_addr;         /* reading address for transparency modes */
00699 } POLYGON_SEGMENT;
00700 
00701 
00702 /* prototype for the scanline filler functions */
00703 typedef AL_METHOD(void, SCANLINE_FILLER, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00704 
00705 
00706 /* an active polygon edge */
00707 typedef struct POLYGON_EDGE 
00708 {
00709    int top;                         /* top y position */
00710    int bottom;                      /* bottom y position */
00711    fixed x, dx;                     /* fixed point x position and gradient */
00712    fixed w;                         /* width of line segment */
00713    POLYGON_SEGMENT dat;             /* texture/gouraud information */
00714    struct POLYGON_EDGE *prev;       /* doubly linked list */
00715    struct POLYGON_EDGE *next;
00716    struct POLYGON_INFO *poly;       /* father polygon */
00717 } POLYGON_EDGE;
00718 
00719 
00720 typedef struct POLYGON_INFO         /* a polygon waiting rendering */
00721 {
00722    struct POLYGON_INFO *next, *prev;/* double linked list */
00723    int inside;                      /* flag for "scanlining" */
00724    int flags;                       /* INTERP_* flags */
00725    int color;                       /* vtx[0]->c */
00726    float a, b, c;                   /* plane's coefficients -a/d, -b/d, -c/d */
00727    int dmode;                       /* drawing mode */
00728    BITMAP *dpat;                    /* drawing pattern */
00729    int xanchor, yanchor;            /* for dpat */
00730    int alpha;                       /* blender alpha */
00731    int b15, b16, b24, b32;          /* blender colors */
00732    COLOR_MAP *cmap;                 /* trans color map */
00733    SCANLINE_FILLER drawer;          /* scanline drawing functions */
00734    SCANLINE_FILLER alt_drawer; 
00735    POLYGON_EDGE *left_edge;         /* true edges used in interpolation */
00736    POLYGON_EDGE *right_edge;
00737    POLYGON_SEGMENT info;            /* base information for scanline functions */
00738 } POLYGON_INFO;
00739 
00740 
00741 /* global variable for z-buffer */
00742 AL_VAR(BITMAP *, _zbuffer);
00743 
00744 
00745 /* polygon helper functions */
00746 AL_VAR(SCANLINE_FILLER, _optim_alternative_drawer);
00747 AL_FUNC(POLYGON_EDGE *, _add_edge, (POLYGON_EDGE *list, POLYGON_EDGE *edge, int sort_by_x));
00748 AL_FUNC(POLYGON_EDGE *, _remove_edge, (POLYGON_EDGE *list, POLYGON_EDGE *edge));
00749 AL_FUNC(int, _fill_3d_edge_structure, (POLYGON_EDGE *edge, AL_CONST V3D *v1, AL_CONST V3D *v2, int flags, BITMAP *bmp));
00750 AL_FUNC(int, _fill_3d_edge_structure_f, (POLYGON_EDGE *edge, AL_CONST V3D_f *v1, AL_CONST V3D_f *v2, int flags, BITMAP *bmp));
00751 AL_FUNC(SCANLINE_FILLER, _get_scanline_filler, (int type, int *flags, POLYGON_SEGMENT *info, BITMAP *texture, BITMAP *bmp));
00752 AL_FUNC(void, _clip_polygon_segment, (POLYGON_SEGMENT *info, fixed gap, int flags));
00753 AL_FUNC(void, _clip_polygon_segment_f, (POLYGON_SEGMENT *info, int gap, int flags));
00754 
00755 
00756 /* polygon scanline filler functions */
00757 AL_FUNC(void, _poly_scanline_dummy, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00758 
00759 #ifdef ALLEGRO_COLOR8
00760 
00761 AL_FUNC(void, _poly_scanline_gcol8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00762 AL_FUNC(void, _poly_scanline_grgb8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00763 AL_FUNC(void, _poly_scanline_atex8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00764 AL_FUNC(void, _poly_scanline_ptex8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00765 AL_FUNC(void, _poly_scanline_atex_mask8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00766 AL_FUNC(void, _poly_scanline_ptex_mask8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00767 AL_FUNC(void, _poly_scanline_atex_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00768 AL_FUNC(void, _poly_scanline_ptex_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00769 AL_FUNC(void, _poly_scanline_atex_mask_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00770 AL_FUNC(void, _poly_scanline_ptex_mask_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00771 AL_FUNC(void, _poly_scanline_atex_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00772 AL_FUNC(void, _poly_scanline_ptex_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00773 AL_FUNC(void, _poly_scanline_atex_mask_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00774 AL_FUNC(void, _poly_scanline_ptex_mask_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00775 
00776 #ifndef SCAN_EXPORT
00777 AL_FUNC(void, _poly_scanline_grgb8x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00778 #endif
00779 
00780 AL_FUNC(void, _poly_zbuf_flat8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00781 AL_FUNC(void, _poly_zbuf_gcol8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00782 AL_FUNC(void, _poly_zbuf_grgb8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00783 AL_FUNC(void, _poly_zbuf_atex8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00784 AL_FUNC(void, _poly_zbuf_ptex8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00785 AL_FUNC(void, _poly_zbuf_atex_mask8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00786 AL_FUNC(void, _poly_zbuf_ptex_mask8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00787 AL_FUNC(void, _poly_zbuf_atex_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00788 AL_FUNC(void, _poly_zbuf_ptex_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00789 AL_FUNC(void, _poly_zbuf_atex_mask_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00790 AL_FUNC(void, _poly_zbuf_ptex_mask_lit8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00791 AL_FUNC(void, _poly_zbuf_atex_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00792 AL_FUNC(void, _poly_zbuf_ptex_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00793 AL_FUNC(void, _poly_zbuf_atex_mask_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00794 AL_FUNC(void, _poly_zbuf_ptex_mask_trans8, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00795 
00796 #endif
00797 
00798 #ifdef ALLEGRO_COLOR16
00799 
00800 AL_FUNC(void, _poly_scanline_grgb15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00801 AL_FUNC(void, _poly_scanline_atex_mask15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00802 AL_FUNC(void, _poly_scanline_ptex_mask15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00803 AL_FUNC(void, _poly_scanline_atex_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00804 AL_FUNC(void, _poly_scanline_ptex_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00805 AL_FUNC(void, _poly_scanline_atex_mask_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00806 AL_FUNC(void, _poly_scanline_ptex_mask_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00807 AL_FUNC(void, _poly_scanline_atex_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00808 AL_FUNC(void, _poly_scanline_ptex_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00809 AL_FUNC(void, _poly_scanline_atex_mask_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00810 AL_FUNC(void, _poly_scanline_ptex_mask_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00811 
00812 #ifndef SCAN_EXPORT
00813 AL_FUNC(void, _poly_scanline_grgb15x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00814 AL_FUNC(void, _poly_scanline_atex_lit15x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00815 AL_FUNC(void, _poly_scanline_ptex_lit15x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00816 AL_FUNC(void, _poly_scanline_atex_mask_lit15x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00817 AL_FUNC(void, _poly_scanline_ptex_mask_lit15x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00818 
00819 AL_FUNC(void, _poly_scanline_ptex_lit15d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00820 AL_FUNC(void, _poly_scanline_ptex_mask_lit15d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00821 #endif
00822 
00823 AL_FUNC(void, _poly_zbuf_grgb15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00824 AL_FUNC(void, _poly_zbuf_atex_mask15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00825 AL_FUNC(void, _poly_zbuf_ptex_mask15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00826 AL_FUNC(void, _poly_zbuf_atex_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00827 AL_FUNC(void, _poly_zbuf_ptex_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00828 AL_FUNC(void, _poly_zbuf_atex_mask_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00829 AL_FUNC(void, _poly_zbuf_ptex_mask_lit15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00830 AL_FUNC(void, _poly_zbuf_atex_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00831 AL_FUNC(void, _poly_zbuf_ptex_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00832 AL_FUNC(void, _poly_zbuf_atex_mask_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00833 AL_FUNC(void, _poly_zbuf_ptex_mask_trans15, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00834 
00835 AL_FUNC(void, _poly_scanline_grgb16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00836 AL_FUNC(void, _poly_scanline_atex16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00837 AL_FUNC(void, _poly_scanline_ptex16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00838 AL_FUNC(void, _poly_scanline_atex_mask16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00839 AL_FUNC(void, _poly_scanline_ptex_mask16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00840 AL_FUNC(void, _poly_scanline_atex_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00841 AL_FUNC(void, _poly_scanline_ptex_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00842 AL_FUNC(void, _poly_scanline_atex_mask_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00843 AL_FUNC(void, _poly_scanline_ptex_mask_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00844 AL_FUNC(void, _poly_scanline_atex_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00845 AL_FUNC(void, _poly_scanline_ptex_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00846 AL_FUNC(void, _poly_scanline_atex_mask_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00847 AL_FUNC(void, _poly_scanline_ptex_mask_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00848 
00849 #ifndef SCAN_EXPORT
00850 AL_FUNC(void, _poly_scanline_grgb16x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00851 AL_FUNC(void, _poly_scanline_atex_lit16x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00852 AL_FUNC(void, _poly_scanline_ptex_lit16x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00853 AL_FUNC(void, _poly_scanline_atex_mask_lit16x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00854 AL_FUNC(void, _poly_scanline_ptex_mask_lit16x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00855 
00856 AL_FUNC(void, _poly_scanline_ptex_lit16d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00857 AL_FUNC(void, _poly_scanline_ptex_mask_lit16d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00858 #endif
00859 
00860 AL_FUNC(void, _poly_zbuf_flat16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00861 AL_FUNC(void, _poly_zbuf_grgb16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00862 AL_FUNC(void, _poly_zbuf_atex16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00863 AL_FUNC(void, _poly_zbuf_ptex16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00864 AL_FUNC(void, _poly_zbuf_atex_mask16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00865 AL_FUNC(void, _poly_zbuf_ptex_mask16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00866 AL_FUNC(void, _poly_zbuf_atex_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00867 AL_FUNC(void, _poly_zbuf_ptex_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00868 AL_FUNC(void, _poly_zbuf_atex_mask_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00869 AL_FUNC(void, _poly_zbuf_ptex_mask_lit16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00870 AL_FUNC(void, _poly_zbuf_atex_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00871 AL_FUNC(void, _poly_zbuf_ptex_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00872 AL_FUNC(void, _poly_zbuf_atex_mask_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00873 AL_FUNC(void, _poly_zbuf_ptex_mask_trans16, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00874 
00875 #endif
00876 
00877 #ifdef ALLEGRO_COLOR24
00878 
00879 AL_FUNC(void, _poly_scanline_grgb24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00880 AL_FUNC(void, _poly_scanline_atex24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00881 AL_FUNC(void, _poly_scanline_ptex24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00882 AL_FUNC(void, _poly_scanline_atex_mask24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00883 AL_FUNC(void, _poly_scanline_ptex_mask24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00884 AL_FUNC(void, _poly_scanline_atex_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00885 AL_FUNC(void, _poly_scanline_ptex_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00886 AL_FUNC(void, _poly_scanline_atex_mask_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00887 AL_FUNC(void, _poly_scanline_ptex_mask_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00888 AL_FUNC(void, _poly_scanline_atex_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00889 AL_FUNC(void, _poly_scanline_ptex_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00890 AL_FUNC(void, _poly_scanline_atex_mask_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00891 AL_FUNC(void, _poly_scanline_ptex_mask_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00892 
00893 #ifndef SCAN_EXPORT
00894 AL_FUNC(void, _poly_scanline_grgb24x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00895 AL_FUNC(void, _poly_scanline_atex_lit24x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00896 AL_FUNC(void, _poly_scanline_ptex_lit24x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00897 AL_FUNC(void, _poly_scanline_atex_mask_lit24x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00898 AL_FUNC(void, _poly_scanline_ptex_mask_lit24x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00899 
00900 AL_FUNC(void, _poly_scanline_ptex_lit24d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00901 AL_FUNC(void, _poly_scanline_ptex_mask_lit24d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00902 #endif
00903 
00904 AL_FUNC(void, _poly_zbuf_flat24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00905 AL_FUNC(void, _poly_zbuf_grgb24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00906 AL_FUNC(void, _poly_zbuf_atex24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00907 AL_FUNC(void, _poly_zbuf_ptex24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00908 AL_FUNC(void, _poly_zbuf_atex_mask24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00909 AL_FUNC(void, _poly_zbuf_ptex_mask24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00910 AL_FUNC(void, _poly_zbuf_atex_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00911 AL_FUNC(void, _poly_zbuf_ptex_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00912 AL_FUNC(void, _poly_zbuf_atex_mask_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00913 AL_FUNC(void, _poly_zbuf_ptex_mask_lit24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00914 AL_FUNC(void, _poly_zbuf_atex_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00915 AL_FUNC(void, _poly_zbuf_ptex_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00916 AL_FUNC(void, _poly_zbuf_atex_mask_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00917 AL_FUNC(void, _poly_zbuf_ptex_mask_trans24, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00918 
00919 #endif
00920 
00921 #ifdef ALLEGRO_COLOR32
00922 
00923 AL_FUNC(void, _poly_scanline_grgb32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00924 AL_FUNC(void, _poly_scanline_atex32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00925 AL_FUNC(void, _poly_scanline_ptex32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00926 AL_FUNC(void, _poly_scanline_atex_mask32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00927 AL_FUNC(void, _poly_scanline_ptex_mask32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00928 AL_FUNC(void, _poly_scanline_atex_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00929 AL_FUNC(void, _poly_scanline_ptex_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00930 AL_FUNC(void, _poly_scanline_atex_mask_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00931 AL_FUNC(void, _poly_scanline_ptex_mask_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00932 AL_FUNC(void, _poly_scanline_atex_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00933 AL_FUNC(void, _poly_scanline_ptex_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00934 AL_FUNC(void, _poly_scanline_atex_mask_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00935 AL_FUNC(void, _poly_scanline_ptex_mask_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00936 
00937 #ifndef SCAN_EXPORT
00938 AL_FUNC(void, _poly_scanline_grgb32x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00939 AL_FUNC(void, _poly_scanline_atex_lit32x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00940 AL_FUNC(void, _poly_scanline_ptex_lit32x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00941 AL_FUNC(void, _poly_scanline_atex_mask_lit32x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00942 AL_FUNC(void, _poly_scanline_ptex_mask_lit32x, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00943 
00944 AL_FUNC(void, _poly_scanline_ptex_lit32d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00945 AL_FUNC(void, _poly_scanline_ptex_mask_lit32d, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00946 #endif
00947 
00948 AL_FUNC(void, _poly_zbuf_flat32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00949 AL_FUNC(void, _poly_zbuf_grgb32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00950 AL_FUNC(void, _poly_zbuf_atex32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00951 AL_FUNC(void, _poly_zbuf_ptex32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00952 AL_FUNC(void, _poly_zbuf_atex_mask32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00953 AL_FUNC(void, _poly_zbuf_ptex_mask32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00954 AL_FUNC(void, _poly_zbuf_atex_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00955 AL_FUNC(void, _poly_zbuf_ptex_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00956 AL_FUNC(void, _poly_zbuf_atex_mask_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00957 AL_FUNC(void, _poly_zbuf_ptex_mask_lit32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00958 AL_FUNC(void, _poly_zbuf_atex_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00959 AL_FUNC(void, _poly_zbuf_ptex_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00960 AL_FUNC(void, _poly_zbuf_atex_mask_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00961 AL_FUNC(void, _poly_zbuf_ptex_mask_trans32, (unsigned long addr, int w, POLYGON_SEGMENT *info));
00962 
00963 #endif
00964 
00965 
00966 /* sound lib stuff */
00967 AL_VAR(MIDI_DRIVER, _midi_none);
00968 AL_VAR(int, _digi_volume);
00969 AL_VAR(int, _midi_volume);
00970 AL_VAR(int, _sound_flip_pan); 
00971 AL_VAR(int, _sound_hq);
00972 AL_VAR(int, _sound_stereo);
00973 AL_VAR(int, _sound_bits);
00974 AL_VAR(int, _sound_freq);
00975 AL_VAR(int, _sound_port);
00976 AL_VAR(int, _sound_dma);
00977 AL_VAR(int, _sound_irq);
00978 
00979 AL_VAR(int, _sound_installed);
00980 AL_VAR(int, _sound_input_installed);
00981 
00982 AL_FUNC(int, _midi_allocate_voice, (int min, int max));
00983 
00984 AL_VAR(volatile long, _midi_tick);
00985 
00986 AL_FUNC(int, _digmid_find_patches, (char *dir, int dir_size, char *file, int file_size));
00987 
00988 #define VIRTUAL_VOICES  256
00989 
00990 
00991 typedef struct          /* a virtual (as seen by the user) soundcard voice */
00992 {
00993    AL_CONST SAMPLE *sample;      /* which sample are we playing? (NULL = free) */
00994    int num;             /* physical voice number (-1 = been killed off) */
00995    int autokill;        /* set to free the voice when the sample finishes */
00996    long time;           /* when we were started (for voice allocation) */
00997    int priority;        /* how important are we? */
00998 } VOICE;
00999 
01000 AL_ARRAY(VOICE, _voice);
01001 
01002 
01003 typedef struct          /* a physical (as used by hardware) soundcard voice */
01004 {
01005    int num;             /* the virtual voice currently using me (-1 = free) */
01006    int playmode;        /* are we looping? */
01007    int vol;             /* current volume (fixed point .12) */
01008    int dvol;            /* volume delta, for ramping */
01009    int target_vol;      /* target volume, for ramping */
01010    int pan;             /* current pan (fixed point .12) */
01011    int dpan;            /* pan delta, for sweeps */
01012    int target_pan;      /* target pan, for sweeps */
01013    int freq;            /* current frequency (fixed point .12) */
01014    int dfreq;           /* frequency delta, for sweeps */
01015    int target_freq;     /* target frequency, for sweeps */
01016 } PHYS_VOICE;
01017 
01018 AL_ARRAY(PHYS_VOICE, _phys_voice);
01019 
01020 
01021 #define MIXER_DEF_SFX               8
01022 #define MIXER_MAX_SFX               64
01023 
01024 AL_FUNC(int,  _mixer_init, (int bufsize, int freq, int stereo, int is16bit, int *voices));
01025 AL_FUNC(void, _mixer_exit, (void));
01026 AL_FUNC(void, _mix_some_samples, (unsigned long buf, unsigned short seg, int issigned));
01027 AL_FUNC(void, _mixer_init_voice, (int voice, AL_CONST SAMPLE *sample));
01028 AL_FUNC(void, _mixer_release_voice, (int voice));
01029 AL_FUNC(void, _mixer_start_voice, (int voice));
01030 AL_FUNC(void, _mixer_stop_voice, (int voice));
01031 AL_FUNC(void, _mixer_loop_voice, (int voice, int loopmode));
01032 AL_FUNC(int,  _mixer_get_position, (int voice));
01033 AL_FUNC(void, _mixer_set_position, (int voice, int position));
01034 AL_FUNC(int,  _mixer_get_volume, (int voice));
01035 AL_FUNC(void, _mixer_set_volume, (int voice, int volume));
01036 AL_FUNC(void, _mixer_ramp_volume, (int voice, int time, int endvol));
01037 AL_FUNC(void, _mixer_stop_volume_ramp, (int voice));
01038 AL_FUNC(int,  _mixer_get_frequency, (int voice));
01039 AL_FUNC(void, _mixer_set_frequency, (int voice, int frequency));
01040 AL_FUNC(void, _mixer_sweep_frequency, (int voice, int time, int endfreq));
01041 AL_FUNC(void, _mixer_stop_frequency_sweep, (int voice));
01042 AL_FUNC(int,  _mixer_get_pan, (int voice));
01043 AL_FUNC(void, _mixer_set_pan, (int voice, int pan));
01044 AL_FUNC(void, _mixer_sweep_pan, (int voice, int time, int endpan));
01045 AL_FUNC(void, _mixer_stop_pan_sweep, (int voice));
01046 AL_FUNC(void, _mixer_set_echo, (int voice, int strength, int delay));
01047 AL_FUNC(void, _mixer_set_tremolo, (int voice, int rate, int depth));
01048 AL_FUNC(void, _mixer_set_vibrato, (int voice, int rate, int depth));
01049 
01050 AL_FUNC(void, _dummy_noop1, (int p));
01051 AL_FUNC(void, _dummy_noop2, (int p1, int p2));
01052 AL_FUNC(void, _dummy_noop3, (int p1, int p2, int p3));
01053 AL_FUNC(int,  _dummy_load_patches, (AL_CONST char *patches, AL_CONST char *drums));
01054 AL_FUNC(void, _dummy_adjust_patches, (AL_CONST char *patches, AL_CONST char *drums));
01055 AL_FUNC(void, _dummy_key_on, (int inst, int note, int bend, int vol, int pan));
01056 
01057 
01058 /* datafile ID's for compatibility with the old datafile format */
01059 #define V1_DAT_MAGIC             0x616C6C2EL
01060 
01061 #define V1_DAT_DATA              0
01062 #define V1_DAT_FONT              1
01063 #define V1_DAT_BITMAP_16         2 
01064 #define V1_DAT_BITMAP_256        3
01065 #define V1_DAT_SPRITE_16         4
01066 #define V1_DAT_SPRITE_256        5
01067 #define V1_DAT_PALETTE_16        6
01068 #define V1_DAT_PALETTE_256       7
01069 #define V1_DAT_FONT_8x8          8
01070 #define V1_DAT_FONT_PROP         9
01071 #define V1_DAT_BITMAP            10
01072 #define V1_DAT_PALETTE           11
01073 #define V1_DAT_SAMPLE            12
01074 #define V1_DAT_MIDI              13
01075 #define V1_DAT_RLE_SPRITE        14
01076 #define V1_DAT_FLI               15
01077 #define V1_DAT_C_SPRITE          16
01078 #define V1_DAT_XC_SPRITE         17
01079 
01080 #define OLD_FONT_SIZE            95
01081 #define LESS_OLD_FONT_SIZE       224
01082 
01083 
01084 /* datafile object loading functions */
01085 AL_FUNC(void, _unload_datafile_object, (DATAFILE *dat));
01086 
01087 
01088 /* information about a datafile object */
01089 typedef struct DATAFILE_TYPE
01090 {
01091    int type;
01092    AL_METHOD(void *, load, (PACKFILE *f, long size));
01093    AL_METHOD(void, destroy, ());
01094 } DATAFILE_TYPE;
01095 
01096 
01097 #define MAX_DATAFILE_TYPES    32
01098 
01099 AL_ARRAY(DATAFILE_TYPE, _datafile_type);
01100 
01101 AL_VAR(int, _compile_sprites);
01102 
01103 AL_FUNC(void, _construct_datafile, (DATAFILE *data));
01104 
01105 
01106 /* for readbmp.c */
01107 AL_FUNC(void, _register_bitmap_file_type_init, (void));
01108 
01109 /* for readsmp.c */
01110 AL_FUNC(void, _register_sample_file_type_init, (void));
01111 
01112 
01113 /* for module linking system; see comment in allegro.c */
01114 struct _AL_LINKER_MIDI
01115 {
01116    AL_METHOD(int, init, (void));
01117    AL_METHOD(void, exit, (void));
01118 };
01119 
01120 AL_VAR(struct _AL_LINKER_MIDI *, _al_linker_midi);
01121 
01122 struct _AL_LINKER_MOUSE
01123 {
01124    AL_METHOD(void, set_mouse_etc, (void));
01125    AL_METHOD(void, show_mouse, (BITMAP *));
01126    BITMAP **mouse_screen_ptr;
01127 };
01128 
01129 AL_VAR(struct _AL_LINKER_MOUSE *, _al_linker_mouse);
01130 
01131 
01132 /* dynamic driver lists */
01133 AL_FUNC(_DRIVER_INFO *, _create_driver_list, ());
01134 AL_FUNC(void, _destroy_driver_list, (_DRIVER_INFO *drvlist));
01135 AL_FUNC(void, _driver_list_append_driver, (_DRIVER_INFO **drvlist, int id, void *driver, int autodetect));
01136 AL_FUNC(void, _driver_list_prepend_driver, (_DRIVER_INFO **drvlist, int id, void *driver, int autodetect));
01137 AL_FUNC(void, _driver_list_append_list, (_DRIVER_INFO **drvlist, _DRIVER_INFO *srclist));
01138 
01139 
01140 AL_FUNC(void *, _al_sane_realloc, (void *ptr, size_t size));
01141 
01142 
01143 #ifdef __cplusplus
01144    }
01145 #endif
01146 
01147 #endif          /* ifndef AINTERN_H */

Generated on Thu Jan 13 14:13:03 2005 for KOF91 by  doxygen 1.3.9.1