JLib Quick Reference Guide

Screen
SCREEN_WIDTH/HEIGHT, SCREEN_MAX_X/Y,SCREEN_NUM_PAGES
void screen_set_app_title(char *title);
void screen_set_video_mode(void);
void screen_restore_video_mode(void);
void screen_set_page(int page);
int screen_get_page(void);
void screen_show_page(int page);
void screen_clear(void);
void screen_fill(UBYTE colour);
void screen_wait_vsync(void);
void screen_put_pal(UBYTE col,UBYTE red,UBYTE green,UBYTE blue);
void screen_block_set_pal(UBYTE *pal);
void screen_blank_pal(void);
void screen_fade_in_pal(UBYTE *pal,unsigned int delay);
void screen_fade_to_pal(UBYTE *pal1, UBYTE *pal2,unsigned int delay);
void screen_fade_out_pal(UBYTE *pal,unsigned int delay);
void screen_blit_buff_to(int x, int y,BR *buff, int sx1, int sy1, int sx2, int sy2);
void screen_blit_fs_buffer(BR *sbuff);

Palette
SCREEN_NUM_COLORS
UBYTE *pal_init(void);
UBYTE *pal_load(char *fname);
UBYTE *pal_load_fp(FILE *fp);
void pal_to_grey(UBYTE *pal);
void pal_to_red(UBYTE *pal);
void pal_to_green(UBYTE *pal);
void pal_to_blue(UBYTE *pal);
UBYTE pal_closest_color_rgb(UBYTE *pal,UBYTE r,UBYTE g,UBYTE b);

Buffers
B_X_SIZE, B_Y_SIZE, B_MAX_X/Y, B_BUFF_PTR
BR *buff_init(int width, int height);
BR *buff_free(BR *buff);
void buff_blit_buff_to(BR *dest, int dx, int dy,BR*src, int sx1, int sy1, int sx2, int sy2);
void buff_stencil_buff_to(BR *dst, int x, int y,BR*src, int sx1, int sy1, int sx2, int sy2);
void buff_clear (BR *buff);
void buff_fill (BR *buff,UBYTE colour);
void buff_draw_point(BR *buff, int x, int y,UBYTE c);
UBYTE buff_get_point(BR *buff, int x, int y);
void buff_draw_box(BR *buff, int x1, int y1, int x2, int y2,UBYTE c);
void buff_draw_rect(BR *buff, int x1, int y1, int x2, int y2,UBYTE c);
void buff_draw_char(BR *buff,UBYTE letter, int x, int y,UBYTE c);
void buff_draw_string(BR *buff,char *string, int x, int y,UBYTE c);
void buff_draw_line(BR *buff, int x, int y, int x2, int y2,UBYTE c);
void buff_draw_h_line(BR *buff, int x1, int y1, int x2,UBYTE c);
void buff_draw_v_line(BR *buff, int x1, int y1, int y2,UBYTE c);
void buff_draw_ellipse(BR *buff, int x, int y, int a, int b,UBYTE c);
void buff_filled_ellipse(BR *buff, int x, int y, int a, int b,UBYTE c);
void buff_draw_circle(BR *buff, int x, int y, int d,UBYTE c);
void buff_filled_circle(BR *buff, int x, int y, int d,UBYTE c);
void buff_draw_triangle(BR *buff, int x1, int y1, int x2, int y2, int x3, int y3,UBYTE c);
void buff_filled_triangle(BR *buff, int x1, int y1, int x2, int y2, int x3, int y3,UBYTE c);
void buff_convex_poly(BR *buff, int n, int *x, int *y,UBYTE c);
void buff_hollow_poly(BR *buff, int n, int *x, int *y,UBYTE c);
void buff_scale_full_buff_to(BR *dest, int x1, int y1, int x2, int y2,BR *src);
void buff_scale_buff_to(BR*dest, int d1, int d2, int d3, int d4,BR *src, int x1, int y1, int x2, int y2);

Sprites
SPR_NUM_ACTIVE, SPR_NUM_LOADED, SPR_MAX_X/Y,SPR_IS_ON
SS *sprite_init(int max_sprites, int max_frames);
SS *sprite_free(SS *sys);
int sprite_load(char *fname,SS *sys);
void sprite_turn_on(SS *spr_sys, int snum);
void sprite_turn_off(SS *spr_sys, int snum);
void sprite_set_xy(SS *spr_sys, int snum, int newx, int newy);
void sprite_set_an_frame(SS *spr_sys, int snum, int frame);
void sprite_set_mode(SS *spr_sys, int snum, int mode);
void buff_save_sprite(SS *sys, int num,BR *buff);
void buff_save_all_sprites(SS *sys,BR *buff);
void buff_draw_sprite(SS *sys, int num,BR *buff);
void buff_draw_all_sprites(SS *sys,BR *buff);
void buff_rest_sprite(SS *sys, int num,BR *buff);
void buff_rest_all_sprites(SS *sys,BR *buff);
void sprite_set_move_info (SS *sys, int snum,UBYTE speed, int x_inc, int y_inc);
void sprite_set_anim_info(SS *sys, int num,UBYTE speed, int frames, int *pat);
void sprite_update_anim_and_move(SS *spr_sys, int snum);
void sprite_update_all_anim_and_move(SS *spr_sys);
void sprite_do_all_anim_and_move_n_times(SS *spr_sys, int n);
void buff_stencil_sprite(,SS *sys, int frame,BR *buff, int x, int y)
void buff_stamp_sprite(,SS *sys, int frame,BR *buff, int x, int y)
void buff_stencil_sprite_color(sprite_sys *ssys, int frame, BR *obuff, int x, int y, UBYTE col);
void buff_stamp_sprite_color(sprite_sys *ssys, int frame, BR *obuff, int x, int y, UBYTE col);
void buff_stencil_sprite_buff(sprite_sys *ssys,int frame,BR *obuff,int x, int y,BR * sbuff);
void buff_stamp_sprite_buff(sprite_sys *ssys,int frame,BR *obuff,int x, int y,BR * sbuff);
void sprite_build_from_buff(SS *sys, int fr,BR *bf, int x1, int y1, int x2, int y2);
int sprite_find_first_free(SS *spr_sys);
int sprite_find_first_frame(SS *spr_sys);
int sprite_do_intersect(SS *sys, int sprite1, int sprite2);
int sprites_do_intersect(SS *sys1, int sprite1, int sprite2,SS *sys2);

Mouse
MOUSE_AVAILABLE, BUTTON_DOWN, BUTTON_CHECK, MOUSE_NUM_BUTTONS, MOUSE_B_LEFT/MIDDLE/RIGHT
int mouse_present(void);
void mouse_closedown(void);
void mouse_show_pointer(void);
void mouse_hide_pointer(void);
void mouse_get_status(int *x_pos, int *y_pos, int *b_status);
void mouse_set_status(int x, int y);

Keyboard
KB_AVAILABLE
void kb_init(void);
void kb_closedown(void);
int kb_keydown(int key);
int kb_key_hit(void);
int kb_ext_key_hit(void);
char kb_get_next_key(void);
USHORT kb_get_next_ext_key(void);
void kb_clear(void);

Joystick
JOYSTICK_AVAILABLE,FIRE_1_DOWN, FIRE_2_DOWN,JOY_CENTRE,...
int joystick_count(void);
int joystick_init(int which);
void joystick_closedown(int which);
void joystick_get_status(int which, int *x_axis, int *y_axis, int *b_status);
int joystick_get_direction(int x_axis, int y_axis);
void joystick_calibrate(int which, int l, int r, int t, int b, int x_cen, int y_cen);

Images
IMG_WIDTH, IMG_HEIGHT, IMG_MAX_X, IMG_MAX_Y, IMG_PALETTE
image *image_load_pcx(char *filename);
image *image_load_jlb(char *filename);
image *image_free(image *img_ptr);
int image_save_pcx(char *filename,BR *buff,UBYTE *pal);
int image_save_jlb(char *filename,BR *buff,UBYTE *pal);
void buff_blit_img_to(BR *dest, int x, int y,image *img, int ix1, int iy1, int ix2, int iy2);
void buff_blit_img_toNC(BR *dest, int x, int y,image *img, int ix1, int iy1, int ix2, int iy2);

Miscellaneous
float jlib_return_version_number(void);
char *jlib_return_version_string_string(void);
void popup_about(UBYTE fg,UBYTE bg);
void popup_info(char *text,UBYTE fg,UBYTE bg);
void jlib_exit(char *message);
void jlib_set_error_handler(exit_function func);
void jlib_exit_details(char *message);
UCLOCK_TICKS_PER_SECOND
void uclock_init(void);
unsigned int uclock_read(void);

Copyright 1995,1996 Jonathan Paul Griffiths
