![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Allegro 4 compatibility layer on top of Allegro 5. More...
#include <stdarg.h>#include <stddef.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <math.h>#include <allegro5/allegro.h>#include <allegro5/allegro_primitives.h>#include <allegro5/allegro_image.h>#include <allegro5/allegro_font.h>#include <allegro5/allegro_ttf.h>#include <allegro5/allegro_audio.h>#include <allegro5/allegro_acodec.h>#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_module.h"#include "nilorea/n_allegro_4.h"#include <dirent.h>#include <unistd.h>Go to the source code of this file.
Data Structures | |
| struct | A4_BMP |
| struct | A4_TIMER |
| struct | FONT |
| a font: the built in one, or a TTF font loaded with load_ttf_font() More... | |
| struct | LEX_ITEM |
| struct | LexMenu |
| an INI driven menu More... | |
| struct | MIDI |
| a MIDI song More... | |
| struct | SAMPLE |
| a sound sample More... | |
Macros | |
| #define | A4_BATCH_MAX 6144 |
| #define | A4_BLEND_ALPHA 1 |
| #define | A4_BLEND_COPY 0 |
| #define | A4_BLEND_FADE 2 |
| #define | A4_KEYBUF_SIZE 64 |
| #define | A4_MASK_COLOR 0x00FF00FF |
| #define | A4_MAX_TIMERS 16 |
| #define | A4_MIDI_FRAG 1024 |
| #define | A4_MIDI_RATE 44100 |
| #define | A4_SAMPLE_IDS 16 |
| #define | A4_SYM(field, name) |
| #define | A4_TEXTPRINTF(align) |
| #define | A4P(b) |
| #define | ALLEGRO_UNSTABLE |
Typedefs | |
| typedef void(* | fs_delete_f) (void *) |
| typedef void *(* | fs_new_player_f) (void *) |
| typedef void *(* | fs_new_settings_f) (void) |
| typedef void *(* | fs_new_synth_f) (void *) |
| typedef int(* | fs_player_add_f) (void *, const char *) |
| typedef int(* | fs_player_int_f) (void *) |
| typedef int(* | fs_player_set_loop_f) (void *, int) |
| typedef void *(* | fs_set_log_function_f) (int, void *, void *) |
| typedef int(* | fs_settings_setnum_f) (void *, const char *, double) |
| typedef int(* | fs_settings_setstr_f) (void *, const char *, const char *) |
| typedef int(* | fs_sfload_f) (void *, const char *, int) |
| typedef int(* | fs_write_float_f) (void *, int, void *, int, int, void *, int, int) |
Functions | |
| static int | _a4_align (const char *v, int is_h) |
| static void | _a4_blend_alpha (void) |
| static void | _a4_blend_copy (void) |
| static void | _a4_box (BITMAP *b, float l, float t, float r, float bt, int color) |
| static int | _a4_color_from_pixel (uint32_t p) |
| static void | _a4_compute_scale (void) |
| static void | _a4_destroy_display (void) |
| static void | _a4_done (const BITMAP *b) |
| static void | _a4_draw_region (BITMAP *source, BITMAP *dest, int masked, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, int flags) |
| static N_MODULE * | _a4_fluidsynth_open (void) |
| static int | _a4_fluidsynth_sym (N_MODULE *lib, const char *name, void *fptr, size_t fsize) |
| static void | _a4_flush (void) |
| static ALLEGRO_FONT * | _a4_font (const FONT *f) |
| static float | _a4_gain (int vol) |
| static BITMAP * | _a4_highlight (BITMAP *src) |
| static void | _a4_input_handle (const ALLEGRO_EVENT *ev) |
| static void * | _a4_input_proc (ALLEGRO_THREAD *thr, void *arg) |
| static int | _a4_item_at (const LexMenu *menu, const BITMAP *buf, int mx, int my) |
| static void | _a4_item_rect (const LexMenu *menu, const BITMAP *buf, int i, float *x, float *y, float *w, float *h) |
| static ALLEGRO_LOCKED_REGION * | _a4_lock (BITMAP *b) |
| static int | _a4_midi_init (void) |
| static void * | _a4_midi_proc (ALLEGRO_THREAD *thr, void *arg) |
| static void | _a4_midi_shutdown (void) |
| static void | _a4_midi_stop_locked (void) |
| static float | _a4_pan (int pan) |
| uint32_t | _a4_pixel_from_color (int color) |
| store a colour as it is kept in a bitmap (opaque when its alpha byte is 0) | |
| static void | _a4_present (void) |
| static ALLEGRO_COLOR | _a4_prim (int color, int *blend) |
| static ALLEGRO_COLOR | _a4_prim_color (int color) |
| static void | _a4_quad (BITMAP *b, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, int color) |
| static ALLEGRO_VERTEX * | _a4_reserve (BITMAP *b, int blend, int n) |
| static char * | _a4_resolve (const char *path) |
| static ALLEGRO_COLOR | _a4_rgba (int color, int alpha) |
| static void | _a4_rotated (BITMAP *bmp, BITMAP *sprite, float x, float y, float cx, float cy, fixed angle, fixed scale) |
| static void | _a4_set_blend (int blend) |
| static const char * | _a4_soundfont (void) |
| static ALLEGRO_BITMAP * | _a4_source (BITMAP *b, int masked) |
| static void | _a4_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y, int flags) |
| static char * | _a4_strndup (const char *s, size_t n) |
| static int | _a4_take_click (int *x, int *y) |
| static int | _a4_target (BITMAP *b) |
| static void | _a4_text (BITMAP *bmp, const FONT *f, const char *s, int x, int y, int color, int bg, int align) |
| static void * | _a4_timer_proc (ALLEGRO_THREAD *thr, void *arg) |
| static void | _a4_unlock (BITMAP *b) |
| static void | _a4_vertex (ALLEGRO_VERTEX *v, float x, float y, ALLEGRO_COLOR c) |
| static BITMAP * | _a4_wrap (ALLEGRO_BITMAP *abmp) |
| int | a4_get_keyboard (char *keybuf, int *cur, int flags, int max) |
| read the typed keys into keybuf at *cur (printable ASCII, backspace erases), keeping it nul terminated within max bytes; flags is ignored. | |
| void | adjust_sample (const SAMPLE *spl, int vol, int pan, int freq, int loop) |
| change the settings of the playing instances of a sample | |
| int | alert (const char *s1, const char *s2, const char *s3, const char *b1, const char *b2, int c1, int c2) |
| a box with up to three lines and one or two buttons (b2 may be NULL), chosen with the mouse, the c1 / c2 shortcut keys, Enter (first) or Escape (second): 1 or 2 | |
| void | allegro_exit (void) |
| shut everything down | |
| void | allegro_gl_flip (void) |
| show the screen bitmap | |
| void | allegro_gl_set_allegro_mode (void) |
| no-op | |
| void | allegro_gl_unset_allegro_mode (void) |
| no-op | |
| int | allegro_init (void) |
| init the layer and Allegro 5 | |
| void | allegro_message (const char *format,...) |
| show a message: a box over the screen, or stderr without a display | |
| int | bitmap_color_depth (BITMAP *bmp) |
| always 32 | |
| int | bitmap_mask_color (BITMAP *bmp) |
| the mask colour, magenta | |
| void | blit (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height) |
| copy a rectangle | |
| uintptr_t | bmp_read_line (BITMAP *bmp, int y) |
| lock the bitmap and return the address of line y, 32 bit ARGB pixels | |
| void | bmp_select (BITMAP *bmp) |
| no-op | |
| void | bmp_unwrite_line (BITMAP *bmp) |
| no-op, the bitmap is unlocked when next drawn with the GPU | |
| uintptr_t | bmp_write_line (BITMAP *bmp, int y) |
| lock the bitmap and return the address of line y, 32 bit ARGB pixels | |
| void | circle (BITMAP *bmp, int x, int y, int radius, int color) |
| draw a circle outline | |
| void | circlefill (BITMAP *bmp, int x, int y, int radius, int color) |
| draw a filled circle | |
| void | clear (BITMAP *bmp) |
| clear to black | |
| void | clear_bitmap (BITMAP *bmp) |
| clear to black | |
| void | clear_keybuf (void) |
| empty the readkey() buffer | |
| void | clear_to_color (BITMAP *bmp, int color) |
| clear to a colour | |
| BITMAP * | create_bitmap (int width, int height) |
| create a w x h bitmap | |
| BITMAP * | create_bitmap_ex (int depth, int width, int height) |
| same as create_bitmap(), depth is ignored | |
| BITMAP * | create_video_bitmap (int width, int height) |
| same as create_bitmap() | |
| void | destroy_bitmap (BITMAP *bmp) |
| free a bitmap | |
| void | destroy_font (FONT *f) |
| free a font loaded with load_ttf_font() | |
| void | destroy_midi (MIDI *midi) |
| free a MIDI song, stopping it if it plays | |
| void | destroy_sample (SAMPLE *spl) |
| free a sample, stopping it | |
| void | draw_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y) |
| draw a sprite | |
| void | draw_sprite_h_flip (BITMAP *bmp, BITMAP *sprite, int x, int y) |
| draw a sprite mirrored horizontally | |
| void | draw_sprite_v_flip (BITMAP *bmp, BITMAP *sprite, int x, int y) |
| draw a sprite mirrored vertically | |
| void | draw_sprite_vh_flip (BITMAP *bmp, BITMAP *sprite, int x, int y) |
| draw a sprite mirrored both ways | |
| void | draw_trans_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y) |
| draw a sprite with the current blender (set_alpha_blender / set_trans_blender) | |
| void | drawing_mode (int mode, BITMAP *pattern, int x_anchor, int y_anchor) |
| set the drawing mode of primitives, pattern arguments are ignored | |
| void | ellipse (BITMAP *bmp, int x, int y, int rx, int ry, int color) |
| draw an ellipse outline | |
| void | ellipsefill (BITMAP *bmp, int x, int y, int rx, int ry, int color) |
| draw a filled ellipse | |
| void | fill_str (char *str, int c, size_t len) |
| fill len bytes of str with c | |
| int | get_color_depth (void) |
| return the color depth (always 32) | |
| void | get_mouse_mickeys (int *mickeyx, int *mickeyy) |
| movement since the last call | |
| int | geta (int c) |
| alpha component, 255 for an opaque colour | |
| int | getb (int c) |
| blue component | |
| int | getg (int c) |
| green component | |
| int | getpixel (BITMAP *bmp, int x, int y) |
| read a pixel, -1 outside the bitmap | |
| int | getr (int c) |
| red component | |
| int | gfx_mode (int mode, int w, int h, int v_w, int v_h, int depth, double r, double g, double b, double a) |
| set the color depth and the graphics mode in one go, clearing the screen to (r,g,b), components in 0-1 or 0-255; TRUE or FALSE | |
| int | gfx_status (int action, int value) |
| with GET, MODE_OGL when the current mode is an AllegroGL one, else MODE_STD | |
| void | hline (BITMAP *bmp, int x1, int y, int x2, int color) |
| draw a horizontal line | |
| int | install_allegro_gl (void) |
| no-op, the layer always uses Allegro 5's own driver | |
| int | install_int (void(*proc)(void), int speed) |
| call proc every speed milliseconds, from the timer thread | |
| int | install_int_ex (void(*proc)(void), long speed) |
| call proc every speed timer ticks, from the timer thread | |
| int | install_keyboard (void) |
| start the input thread for the keyboard | |
| int | install_mouse (void) |
| start the input thread for the mouse | |
| int | install_sound (int digi, int midi, const char *cfg_path) |
| start the audio, cfg_path is ignored | |
| int | install_timer (void) |
| no-op, timers are always available | |
| int | is_memory_bitmap (BITMAP *bmp) |
| always FALSE: pixels are reached through bmp_write_line() | |
| int | keypressed (void) |
| TRUE if a key is waiting in the readkey() buffer. | |
| LexMenu * | lexLoadMenuFromFile (const char *file, const char *section) |
| load menu section from INI file file, NULL on error | |
| LexMenu * | lexMenuDestroy (LexMenu *menu) |
| free a menu, returns NULL | |
| BITMAP * | lexMenuGetBitmap (LexMenu *menu, int item, int state) |
| the image of item item in state state, NULL if there is none | |
| int | lexMenuRun (LexMenu *menu, BITMAP *buf) |
| run the menu, drawing into buf: the chosen item index, -1 on escape | |
| void | line (BITMAP *bmp, int x1, int y1, int x2, int y2, int color) |
| draw a line | |
| BITMAP * | load_bitmap (const char *filename, RGB *pal) |
| load a BMP, PCX, TGA, PNG or JPG file, pal is ignored | |
| MIDI * | load_midi (const char *filename) |
| load a MIDI file | |
| SAMPLE * | load_sample (const char *filename) |
| load a WAV, OGG, FLAC or VOC file | |
| FONT * | load_ttf_font (const char *filename, int points, int smooth) |
| load a TrueType font at the given pixel size | |
| FONT * | load_ttf_font_mem (const char *filename, int points, int smooth) |
| same as load_ttf_font() | |
| int | makeacol (int r, int g, int b, int a) |
| make a colour with alpha | |
| int | makeacol32 (int r, int g, int b, int a) |
| make a colour with alpha | |
| int | makecol (int r, int g, int b) |
| make an opaque colour | |
| int | makecol32 (int r, int g, int b) |
| make an opaque colour | |
| void | masked_blit (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height) |
| copy a rectangle, skipping mask colour pixels | |
| void | masked_stretch_blit (BITMAP *source, BITMAP *dest, int source_x, int source_y, int source_w, int source_h, int dest_x, int dest_y, int dest_w, int dest_h) |
| copy and scale a rectangle, skipping mask colour pixels | |
| void | midi_pause (void) |
| pause the MIDI song | |
| void | midi_resume (void) |
| resume the MIDI song | |
| void | pivot_scaled_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y, int cx, int cy, fixed angle, fixed scale) |
| rotate and scale a sprite around (cx,cy) in the sprite, drawn at (x,y) | |
| void | pivot_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y, int cx, int cy, fixed angle) |
| rotate a sprite around (cx,cy) in the sprite, drawn at (x,y) | |
| int | play_midi (MIDI *midi, int loop) |
| play a MIDI song, replacing the current one, NULL stops | |
| int | play_sample (const SAMPLE *spl, int vol, int pan, int freq, int loop) |
| play a sample: vol and pan 0-255, freq 1000 = normal speed | |
| int | poll_keyboard (void) |
| no-op, input is updated by a thread | |
| int | poll_mouse (void) |
| no-op, input is updated by a thread | |
| void | position_mouse (int x, int y) |
| move the mouse pointer | |
| void | putpixel (BITMAP *bmp, int x, int y, int color) |
| write a pixel | |
| int | readkey (void) |
| wait for a key: (scancode << 8) | ascii | |
| void | rect (BITMAP *bmp, int x1, int y1, int x2, int y2, int color) |
| draw a rectangle outline | |
| void | rectfill (BITMAP *bmp, int x1, int y1, int x2, int y2, int color) |
| draw a filled rectangle | |
| void | remove_int (void(*proc)(void)) |
| stop calling proc | |
| void | remove_sound (void) |
| stop the audio | |
| void | rest (unsigned int ms) |
| sleep ms milliseconds | |
| void | rotate_scaled_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y, fixed angle, fixed scale) |
| rotate and scale a sprite around its centre | |
| void | rotate_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y, fixed angle) |
| rotate a sprite around its centre, angle in 256ths of a turn, clockwise | |
| int | save_bitmap (const char *filename, BITMAP *bmp, const RGB *pal) |
| save a bitmap | |
| void | set_alpha_blender (void) |
| blend with the alpha channel of the source colour or sprite | |
| int | set_close_button_callback (void(*proc)(void)) |
| call proc when the window close button is pressed | |
| void | set_color_depth (int depth) |
| set the color depth, only 32 is honoured | |
| int | set_gfx_mode (int card, int w, int h, int v_w, int v_h) |
| open a display of w x h pixels, or close it with GFX_TEXT | |
| void | set_trans_blender (int r, int g, int b, int a) |
| blend with a constant opacity a (0-255), r, g and b are ignored | |
| void | set_uformat (int type) |
| no-op, kept for source compatibility | |
| void | set_volume (int digi_volume, int midi_volume) |
| set the volumes (0-255), a negative value leaves one unchanged | |
| void | set_window_title (const char *name) |
| set the window title | |
| void | show_mouse (BITMAP *bmp) |
| show the system cursor (bmp != NULL) or hide it (NULL) | |
| void | solid_mode (void) |
| same as drawing_mode(DRAW_MODE_SOLID, ...) | |
| void | stop_midi (void) |
| stop the MIDI song | |
| void | stop_sample (const SAMPLE *spl) |
| stop every playing instance of a sample | |
| void | stretch_blit (BITMAP *source, BITMAP *dest, int source_x, int source_y, int source_width, int source_height, int dest_x, int dest_y, int dest_width, int dest_height) |
| copy and scale a rectangle | |
| void | stretch_sprite (BITMAP *bmp, BITMAP *sprite, int x, int y, int w, int h) |
| draw a sprite scaled to w x h | |
| int | text_height (const FONT *f) |
| height of the font in pixels | |
| int | text_length (const FONT *f, const char *str) |
| width of str in pixels | |
| void | textout_centre_ex (BITMAP *bmp, const FONT *f, const char *s, int x, int y, int color, int bg) |
| draw a string centred on x | |
| void | textout_ex (BITMAP *bmp, const FONT *f, const char *s, int x, int y, int color, int bg) |
| draw a string | |
| void | textout_right_ex (BITMAP *bmp, const FONT *f, const char *s, int x, int y, int color, int bg) |
| draw a string ending at x | |
| void | textprintf_centre_ex (BITMAP *bmp, const FONT *f, int x, int y, int color, int bg, const char *format,...) |
| draw a formatted string centred on x | |
| void | textprintf_ex (BITMAP *bmp, const FONT *f, int x, int y, int color, int bg, const char *format,...) |
| draw a formatted string | |
| void | textprintf_right_ex (BITMAP *bmp, const FONT *f, int x, int y, int color, int bg, const char *format,...) |
| draw a formatted string ending at x | |
| void | triangle (BITMAP *bmp, int x1, int y1, int x2, int y2, int x3, int y3, int color) |
| draw a filled triangle | |
| int | ustricmp (const char *s1, const char *s2) |
| case insensitive string compare | |
| void | vline (BITMAP *bmp, int x, int y1, int y2, int color) |
| draw a vertical line | |
Variables | |
| static int | a4_alpha_blender = 0 |
| static ALLEGRO_VERTEX | a4_batch [6144] |
| static int | a4_batch_blend = 0 |
| static int | a4_batch_n = 0 |
| static BITMAP * | a4_batch_target = NULL |
| static int | a4_click_pending = 0 |
| static int | a4_click_x = 0 |
| static int | a4_click_y = 0 |
| static void(* | a4_close_cb )(void) = NULL |
| static volatile int | a4_close_requested = 0 |
| static int | a4_cursor_shown = 0 |
| static int | a4_digi_volume = 255 |
| static ALLEGRO_DISPLAY * | a4_display = NULL |
| static int | a4_draw_mode = 0 |
| struct { | |
| MIDI * | current |
| fs_delete_f | delete_player |
| fs_delete_f | delete_settings |
| fs_delete_f | delete_synth |
| N_MODULE * | lib |
| ALLEGRO_MUTEX * | mutex |
| fs_new_player_f | new_player |
| fs_new_settings_f | new_settings |
| fs_new_synth_f | new_synth |
| int | ok |
| int | paused |
| void * | player |
| fs_player_add_f | player_add |
| fs_player_int_f | player_play |
| fs_player_set_loop_f | player_set_loop |
| fs_player_int_f | player_stop |
| ALLEGRO_EVENT_QUEUE * | queue |
| fs_set_log_function_f | set_log_function |
| fs_settings_setnum_f | setnum |
| fs_settings_setstr_f | setstr |
| void * | settings |
| fs_sfload_f | sfload |
| ALLEGRO_AUDIO_STREAM * | stream |
| void * | synth |
| fs_player_int_f | system_reset |
| ALLEGRO_THREAD * | thread |
| int | tried |
| fs_write_float_f | write_float |
| } | a4_fs |
| static int | a4_gl_mode = 0 |
| static int | a4_inited = 0 |
| static ALLEGRO_MUTEX * | a4_input_mutex = NULL |
| static ALLEGRO_EVENT_QUEUE * | a4_input_queue = NULL |
| static ALLEGRO_THREAD * | a4_input_thread = NULL |
| static int | a4_keybuf [64] |
| static int | a4_keybuf_count = 0 |
| static int | a4_keybuf_start = 0 |
| static int | a4_mickey_x = 0 |
| static int | a4_mickey_y = 0 |
| static int | a4_midi_volume = 255 |
| static float | a4_off_x = 0.0f |
| static float | a4_off_y = 0.0f |
| static float | a4_scale = 1.0f |
| static int | a4_screen_dirty = 0 |
| static int | a4_sound_ok = 0 |
| static ALLEGRO_MUTEX * | a4_timer_mutex = NULL |
| static ALLEGRO_THREAD * | a4_timer_thread = NULL |
| static A4_TIMER | a4_timers [16] |
| static int | a4_trans_alpha = 255 |
| char | allegro_error [256] = "" |
| last error message, as in Allegro 4 | |
| FONT * | font = NULL |
| the default 8x8 font, valid after allegro_init() | |
| volatile char | key [227] |
| TRUE while the key is held. | |
| volatile int | key_shifts = 0 |
| modifier flags, unused | |
| volatile int | mouse_b = 0 |
| button flags: 1 left, 2 right, 4 middle | |
| volatile int | mouse_x = 0 |
| mouse x in screen coordinates | |
| volatile int | mouse_y = 0 |
| mouse y in screen coordinates | |
| volatile int | mouse_z = 0 |
| mouse wheel position | |
| BITMAP * | screen = NULL |
| the screen, valid after set_gfx_mode() | |
Allegro 4 compatibility layer on top of Allegro 5.
Definition in file n_allegro_4.c.
| struct A4_BMP |
Definition at line 84 of file n_allegro_4.c.
| Data Fields | ||
|---|---|---|
| ALLEGRO_BITMAP * | bmp | |
| int | is_screen | |
| ALLEGRO_LOCKED_REGION * | lock | |
| ALLEGRO_BITMAP * | masked | |
| int | masked_dirty | |
| struct A4_TIMER |
Definition at line 162 of file n_allegro_4.c.
| Data Fields | ||
|---|---|---|
| double | next | |
| double | period | |
| void(*)(void) | proc | |
| struct FONT |
a font: the built in one, or a TTF font loaded with load_ttf_font()
Definition at line 98 of file n_allegro_4.c.
| Data Fields | ||
|---|---|---|
| ALLEGRO_FONT * | f | |
| struct LEX_ITEM |
Definition at line 2054 of file n_allegro_4.c.
| Data Fields | ||
|---|---|---|
| int | h_align | |
| BITMAP * | image | |
| BITMAP * | over | |
| SAMPLE * | sound | |
| int | v_align | |
| int | x | |
| int | y | |
| struct LexMenu |
an INI driven menu
Definition at line 2064 of file n_allegro_4.c.
| Data Fields | ||
|---|---|---|
| BITMAP * | bg | |
| LEX_ITEM * | items | |
| int | nb_items | |
| int | selected | |
| struct MIDI |
a MIDI song
Definition at line 112 of file n_allegro_4.c.
| Data Fields | ||
|---|---|---|
| char * | path | |
| struct SAMPLE |
| #define A4_BATCH_MAX 6144 |
Definition at line 459 of file n_allegro_4.c.
Referenced by _a4_reserve().
| #define A4_BLEND_ALPHA 1 |
Definition at line 277 of file n_allegro_4.c.
Referenced by _a4_prim(), and _a4_set_blend().
| #define A4_BLEND_COPY 0 |
Definition at line 276 of file n_allegro_4.c.
Referenced by _a4_prim(), _a4_prim_color(), _a4_quad(), and triangle().
| #define A4_BLEND_FADE 2 |
Definition at line 278 of file n_allegro_4.c.
Referenced by _a4_prim(), and _a4_set_blend().
| #define A4_KEYBUF_SIZE 64 |
Definition at line 147 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and readkey().
| #define A4_MASK_COLOR 0x00FF00FF |
Definition at line 81 of file n_allegro_4.c.
Referenced by bitmap_mask_color().
| #define A4_MAX_TIMERS 16 |
Definition at line 161 of file n_allegro_4.c.
Referenced by _a4_timer_proc(), install_int_ex(), and remove_int().
| #define A4_MIDI_FRAG 1024 |
Definition at line 1757 of file n_allegro_4.c.
Referenced by _a4_midi_init(), and _a4_midi_proc().
| #define A4_MIDI_RATE 44100 |
Definition at line 1756 of file n_allegro_4.c.
Referenced by _a4_midi_init().
| #define A4_SAMPLE_IDS 16 |
Definition at line 103 of file n_allegro_4.c.
Referenced by adjust_sample(), play_sample(), and stop_sample().
| #define A4_SYM | ( | field, | |
| name ) |
Definition at line 1784 of file n_allegro_4.c.
Referenced by _a4_midi_init().
| #define A4_TEXTPRINTF | ( | align | ) |
Definition at line 1366 of file n_allegro_4.c.
Referenced by textprintf_centre_ex(), textprintf_ex(), and textprintf_right_ex().
| #define A4P | ( | b | ) |
Definition at line 116 of file n_allegro_4.c.
Referenced by _a4_done(), _a4_flush(), _a4_lock(), _a4_reserve(), _a4_source(), _a4_target(), _a4_unlock(), bmp_write_line(), destroy_bitmap(), putpixel(), save_bitmap(), and set_gfx_mode().
| #define ALLEGRO_UNSTABLE |
Definition at line 28 of file n_allegro_4.c.
| typedef void(* fs_delete_f) (void *) |
Definition at line 1722 of file n_allegro_4.c.
| typedef void *(* fs_new_player_f) (void *) |
Definition at line 1717 of file n_allegro_4.c.
| typedef void *(* fs_new_settings_f) (void) |
Definition at line 1712 of file n_allegro_4.c.
| typedef void *(* fs_new_synth_f) (void *) |
Definition at line 1715 of file n_allegro_4.c.
| typedef int(* fs_player_add_f) (void *, const char *) |
Definition at line 1718 of file n_allegro_4.c.
| typedef int(* fs_player_int_f) (void *) |
Definition at line 1719 of file n_allegro_4.c.
| typedef int(* fs_player_set_loop_f) (void *, int) |
Definition at line 1720 of file n_allegro_4.c.
| typedef void *(* fs_set_log_function_f) (int, void *, void *) |
Definition at line 1723 of file n_allegro_4.c.
| typedef int(* fs_settings_setnum_f) (void *, const char *, double) |
Definition at line 1713 of file n_allegro_4.c.
| typedef int(* fs_settings_setstr_f) (void *, const char *, const char *) |
Definition at line 1714 of file n_allegro_4.c.
| typedef int(* fs_sfload_f) (void *, const char *, int) |
Definition at line 1716 of file n_allegro_4.c.
| typedef int(* fs_write_float_f) (void *, int, void *, int, int, void *, int, int) |
Definition at line 1721 of file n_allegro_4.c.
|
static |
Definition at line 2071 of file n_allegro_4.c.
Referenced by lexLoadMenuFromFile().
|
static |
Definition at line 425 of file n_allegro_4.c.
Referenced by _a4_draw_region(), _a4_rotated(), _a4_set_blend(), draw_trans_sprite(), and lexMenuRun().
|
static |
Definition at line 430 of file n_allegro_4.c.
Referenced by _a4_draw_region(), _a4_highlight(), and _a4_set_blend().
|
static |
Definition at line 515 of file n_allegro_4.c.
References _a4_quad().
Referenced by line(), putpixel(), rect(), and rectfill().
|
static |
Definition at line 265 of file n_allegro_4.c.
Referenced by getpixel().
|
static |
Definition at line 705 of file n_allegro_4.c.
References a4_display, a4_off_x, a4_off_y, a4_scale, and screen.
Referenced by set_gfx_mode().
|
static |
Definition at line 645 of file n_allegro_4.c.
References a4_display, a4_input_queue, destroy_bitmap(), and screen.
Referenced by allegro_exit(), and set_gfx_mode().
|
static |
Definition at line 375 of file n_allegro_4.c.
References _a4_present(), a4_gl_mode, A4P, and BITMAP::priv.
Referenced by _a4_draw_region(), _a4_rotated(), _a4_text(), circle(), circlefill(), clear_to_color(), draw_trans_sprite(), ellipse(), ellipsefill(), line(), putpixel(), rect(), rectfill(), and triangle().
|
static |
Definition at line 1029 of file n_allegro_4.c.
References _a4_blend_alpha(), _a4_blend_copy(), _a4_done(), _a4_source(), and _a4_target().
Referenced by _a4_sprite(), blit(), masked_blit(), masked_stretch_blit(), stretch_blit(), and stretch_sprite().
|
static |
Definition at line 1759 of file n_allegro_4.c.
References n_module_open().
Referenced by _a4_midi_init().
|
static |
Definition at line 1777 of file n_allegro_4.c.
References n_module_symbol().
Referenced by _a4_midi_init().
|
static |
Definition at line 465 of file n_allegro_4.c.
References _a4_set_blend(), a4_batch, a4_batch_blend, a4_batch_n, a4_batch_target, and A4P.
Referenced by _a4_lock(), _a4_present(), _a4_reserve(), _a4_source(), and _a4_target().
|
static |
Definition at line 1318 of file n_allegro_4.c.
Referenced by _a4_text(), text_height(), and text_length().
|
static |
Definition at line 1673 of file n_allegro_4.c.
References a4_digi_volume.
Referenced by adjust_sample(), and play_sample().
Definition at line 2080 of file n_allegro_4.c.
References _a4_blend_copy(), _a4_source(), _a4_target(), create_bitmap(), BITMAP::h, and BITMAP::w.
Referenced by lexLoadMenuFromFile().
|
static |
Definition at line 521 of file n_allegro_4.c.
References a4_click_pending, a4_click_x, a4_click_y, a4_close_cb, a4_close_requested, a4_input_mutex, a4_keybuf, a4_keybuf_count, A4_KEYBUF_SIZE, a4_keybuf_start, a4_mickey_x, a4_mickey_y, a4_off_x, a4_off_y, a4_scale, key, KEY_MAX, mouse_b, mouse_x, mouse_y, and mouse_z.
Referenced by _a4_input_proc().
|
static |
Definition at line 576 of file n_allegro_4.c.
References _a4_input_handle(), and a4_input_queue.
Referenced by allegro_init().
Definition at line 2175 of file n_allegro_4.c.
References _a4_item_rect(), and LexMenu::nb_items.
Referenced by lexMenuRun().
|
static |
Definition at line 2152 of file n_allegro_4.c.
References LexMenu::bg, BITMAP::h, LEX_ITEM::h_align, LEX_ITEM::image, LexMenu::items, LEX_ITEM::v_align, BITMAP::w, LEX_ITEM::x, and LEX_ITEM::y.
Referenced by _a4_item_at(), and lexMenuRun().
|
static |
Definition at line 353 of file n_allegro_4.c.
References _a4_flush(), A4P, A4_BMP::bmp, and A4_BMP::lock.
Referenced by bmp_read_line(), bmp_write_line(), getpixel(), and putpixel().
|
static |
Definition at line 1827 of file n_allegro_4.c.
References _a4_fluidsynth_open(), _a4_fluidsynth_sym(), _a4_midi_proc(), _a4_soundfont(), a4_fs, A4_MIDI_FRAG, A4_MIDI_RATE, a4_midi_volume, a4_sound_ok, A4_SYM, LOG_DEBUG, LOG_NOTICE, and n_log.
Referenced by play_midi().
|
static |
Definition at line 1807 of file n_allegro_4.c.
References a4_fs, and A4_MIDI_FRAG.
Referenced by _a4_midi_init().
|
static |
Definition at line 1904 of file n_allegro_4.c.
References _a4_midi_stop_locked(), a4_fs, and n_module_close().
Referenced by remove_sound().
|
static |
Definition at line 1893 of file n_allegro_4.c.
References a4_fs.
Referenced by _a4_midi_shutdown(), play_midi(), and stop_midi().
|
static |
Definition at line 1677 of file n_allegro_4.c.
Referenced by adjust_sample(), and play_sample().
|
static |
Definition at line 761 of file n_allegro_4.c.
References _a4_flush(), _a4_source(), a4_display, a4_off_x, a4_off_y, a4_scale, a4_screen_dirty, and screen.
Referenced by _a4_done(), alert(), allegro_gl_flip(), allegro_message(), gfx_mode(), lexMenuRun(), and set_gfx_mode().
|
static |
Definition at line 292 of file n_allegro_4.c.
References _a4_pixel_from_color(), _a4_rgba(), a4_alpha_blender, A4_BLEND_ALPHA, A4_BLEND_COPY, A4_BLEND_FADE, a4_draw_mode, a4_trans_alpha, and DRAW_MODE_TRANS.
Referenced by _a4_prim_color(), _a4_quad(), and triangle().
|
static |
Definition at line 445 of file n_allegro_4.c.
References _a4_prim(), _a4_set_blend(), and A4_BLEND_COPY.
Referenced by circle(), circlefill(), ellipse(), and ellipsefill().
|
static |
Definition at line 502 of file n_allegro_4.c.
References _a4_prim(), _a4_reserve(), _a4_vertex(), and A4_BLEND_COPY.
Referenced by _a4_box(), and line().
|
static |
Definition at line 477 of file n_allegro_4.c.
References _a4_flush(), _a4_unlock(), a4_batch, a4_batch_blend, A4_BATCH_MAX, a4_batch_n, a4_batch_target, a4_screen_dirty, A4P, A4_BMP::is_screen, and A4_BMP::masked_dirty.
Referenced by _a4_quad(), and triangle().
|
static |
Definition at line 186 of file n_allegro_4.c.
Referenced by lexLoadMenuFromFile(), load_bitmap(), load_midi(), load_sample(), and load_ttf_font().
|
static |
Definition at line 270 of file n_allegro_4.c.
Referenced by _a4_prim(), _a4_text(), and clear_to_color().
|
static |
Definition at line 1110 of file n_allegro_4.c.
References _a4_blend_alpha(), _a4_done(), _a4_source(), _a4_target(), and fixtof.
Referenced by pivot_scaled_sprite(), pivot_sprite(), rotate_scaled_sprite(), and rotate_sprite().
|
static |
Definition at line 434 of file n_allegro_4.c.
References _a4_blend_alpha(), _a4_blend_copy(), A4_BLEND_ALPHA, and A4_BLEND_FADE.
Referenced by _a4_flush(), and _a4_prim_color().
|
static |
Definition at line 1786 of file n_allegro_4.c.
Referenced by _a4_midi_init().
|
static |
Definition at line 380 of file n_allegro_4.c.
References _a4_flush(), _a4_unlock(), A4P, A4_BMP::bmp, BITMAP::h, A4_BMP::masked, A4_BMP::masked_dirty, BITMAP::priv, and BITMAP::w.
Referenced by _a4_draw_region(), _a4_highlight(), _a4_present(), _a4_rotated(), draw_trans_sprite(), and lexMenuRun().
Definition at line 1070 of file n_allegro_4.c.
References _a4_draw_region(), BITMAP::h, and BITMAP::w.
Referenced by draw_sprite(), draw_sprite_h_flip(), draw_sprite_v_flip(), and draw_sprite_vh_flip().
|
static |
Definition at line 248 of file n_allegro_4.c.
Referenced by allegro_message().
|
static |
Definition at line 801 of file n_allegro_4.c.
References a4_click_pending, a4_click_x, a4_click_y, and a4_input_mutex.
Referenced by alert(), allegro_message(), and lexMenuRun().
|
static |
Definition at line 363 of file n_allegro_4.c.
References _a4_flush(), _a4_unlock(), a4_screen_dirty, A4P, A4_BMP::bmp, A4_BMP::is_screen, A4_BMP::masked_dirty, and BITMAP::priv.
Referenced by _a4_draw_region(), _a4_highlight(), _a4_rotated(), _a4_text(), circle(), circlefill(), clear_to_color(), draw_trans_sprite(), ellipse(), ellipsefill(), and lexMenuRun().
|
static |
Definition at line 1334 of file n_allegro_4.c.
References _a4_done(), _a4_font(), _a4_rgba(), _a4_target(), a4_draw_mode, DRAW_MODE_SOLID, mode, and rectfill().
Referenced by textout_centre_ex(), textout_ex(), and textout_right_ex().
|
static |
Definition at line 585 of file n_allegro_4.c.
References A4_MAX_TIMERS, a4_timer_mutex, and a4_timers.
Referenced by allegro_init().
|
static |
Definition at line 344 of file n_allegro_4.c.
References A4P, A4_BMP::bmp, A4_BMP::lock, and BITMAP::priv.
Referenced by _a4_reserve(), _a4_source(), _a4_target(), destroy_bitmap(), and save_bitmap().
|
static |
Definition at line 492 of file n_allegro_4.c.
Referenced by _a4_quad(), and triangle().
|
static |
Definition at line 403 of file n_allegro_4.c.
References A4_BMP::bmp, Free, BITMAP::h, BITMAP::line, Malloc, A4_BMP::masked_dirty, BITMAP::priv, and BITMAP::w.
Referenced by create_bitmap(), and load_bitmap().
|
static |
Definition at line 140 of file n_allegro_4.c.
Referenced by _a4_prim(), draw_trans_sprite(), set_alpha_blender(), and set_trans_blender().
|
static |
Definition at line 460 of file n_allegro_4.c.
Referenced by _a4_flush(), and _a4_reserve().
|
static |
Definition at line 463 of file n_allegro_4.c.
Referenced by _a4_flush(), and _a4_reserve().
|
static |
Definition at line 461 of file n_allegro_4.c.
Referenced by _a4_flush(), _a4_reserve(), and destroy_bitmap().
|
static |
Definition at line 462 of file n_allegro_4.c.
Referenced by _a4_flush(), _a4_reserve(), and destroy_bitmap().
|
static |
Definition at line 156 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and _a4_take_click().
|
static |
Definition at line 157 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and _a4_take_click().
|
static |
Definition at line 158 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and _a4_take_click().
|
static |
Definition at line 133 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and set_close_button_callback().
|
static |
Definition at line 153 of file n_allegro_4.c.
Referenced by _a4_input_handle(), alert(), allegro_message(), and lexMenuRun().
|
static |
Definition at line 132 of file n_allegro_4.c.
Referenced by alert(), lexMenuRun(), set_gfx_mode(), and show_mouse().
|
static |
Definition at line 173 of file n_allegro_4.c.
Referenced by _a4_gain(), and set_volume().
|
static |
Definition at line 129 of file n_allegro_4.c.
Referenced by _a4_compute_scale(), _a4_destroy_display(), _a4_present(), alert(), allegro_message(), position_mouse(), set_gfx_mode(), set_window_title(), and show_mouse().
|
static |
Definition at line 139 of file n_allegro_4.c.
Referenced by _a4_prim(), _a4_text(), alert(), allegro_message(), drawing_mode(), putpixel(), and solid_mode().
| struct { ... } a4_fs |
Referenced by _a4_midi_init(), _a4_midi_proc(), _a4_midi_shutdown(), _a4_midi_stop_locked(), destroy_midi(), midi_pause(), midi_resume(), play_midi(), set_volume(), and stop_midi().
|
static |
Definition at line 130 of file n_allegro_4.c.
Referenced by _a4_done(), alert(), allegro_gl_flip(), allegro_message(), gfx_mode(), gfx_status(), lexMenuRun(), and set_gfx_mode().
|
static |
Definition at line 128 of file n_allegro_4.c.
Referenced by allegro_exit(), allegro_init(), install_int_ex(), install_keyboard(), install_mouse(), install_sound(), install_timer(), and set_gfx_mode().
|
static |
Definition at line 146 of file n_allegro_4.c.
Referenced by _a4_input_handle(), _a4_take_click(), allegro_exit(), allegro_init(), clear_keybuf(), get_mouse_mickeys(), keypressed(), and readkey().
|
static |
Definition at line 144 of file n_allegro_4.c.
Referenced by _a4_destroy_display(), _a4_input_proc(), allegro_exit(), allegro_init(), install_keyboard(), install_mouse(), and set_gfx_mode().
|
static |
Definition at line 145 of file n_allegro_4.c.
Referenced by allegro_exit(), and allegro_init().
|
static |
Definition at line 148 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and readkey().
|
static |
Definition at line 150 of file n_allegro_4.c.
Referenced by _a4_input_handle(), clear_keybuf(), keypressed(), and readkey().
|
static |
Definition at line 149 of file n_allegro_4.c.
Referenced by _a4_input_handle(), clear_keybuf(), and readkey().
|
static |
Definition at line 151 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and get_mouse_mickeys().
|
static |
Definition at line 152 of file n_allegro_4.c.
Referenced by _a4_input_handle(), and get_mouse_mickeys().
|
static |
Definition at line 174 of file n_allegro_4.c.
Referenced by _a4_midi_init(), and set_volume().
|
static |
Definition at line 136 of file n_allegro_4.c.
Referenced by _a4_compute_scale(), _a4_input_handle(), _a4_present(), and position_mouse().
|
static |
Definition at line 137 of file n_allegro_4.c.
Referenced by _a4_compute_scale(), _a4_input_handle(), _a4_present(), and position_mouse().
|
static |
Definition at line 135 of file n_allegro_4.c.
Referenced by _a4_compute_scale(), _a4_input_handle(), _a4_present(), and position_mouse().
|
static |
Definition at line 131 of file n_allegro_4.c.
Referenced by _a4_present(), _a4_reserve(), _a4_target(), allegro_gl_flip(), bmp_write_line(), and putpixel().
|
static |
Definition at line 172 of file n_allegro_4.c.
Referenced by _a4_midi_init(), adjust_sample(), install_sound(), load_sample(), play_sample(), remove_sound(), and stop_sample().
|
static |
Definition at line 169 of file n_allegro_4.c.
Referenced by _a4_timer_proc(), allegro_exit(), allegro_init(), install_int_ex(), and remove_int().
|
static |
Definition at line 168 of file n_allegro_4.c.
Referenced by allegro_exit(), and allegro_init().
|
static |
Definition at line 167 of file n_allegro_4.c.
Referenced by _a4_timer_proc(), allegro_init(), install_int_ex(), and remove_int().
|
static |
Definition at line 141 of file n_allegro_4.c.
Referenced by _a4_prim(), draw_trans_sprite(), and set_trans_blender().