1 /* 2 * sprite.h: ���ץ饤�ȴ��ܳƼ���� 3 * 4 * Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp> 5 * 1998- <masaki-c@is.aist-nara.ac.jp> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * 21 */ 22 /* $Id: sprite.h,v 1.3 2003/07/14 16:22:51 chikama Exp $ */ 23 24 #ifndef __SPRITE_H__ 25 #define __SPRITE_H__ 26 27 #include <glib.h> 28 #include "sact.h" 29 30 #define DEFAULT_UPDATE sp_draw 31 32 // in sprite.c 33 extern int sp_init(); 34 extern int sp_new(int no, int cg1, int cg2, int cg3, int type); 35 extern int sp_new_msg(int no, int x, int y, int width, int height); 36 extern int sp_set_wall_paper(int no); 37 extern int sp_free_all(); 38 extern int sp_free(int no); 39 extern int sp_set_show(int no, int cnt, int flag); 40 extern int sp_set_pos(int wNum, int wX, int wY); 41 extern int sp_set_move(int wNum, int wX, int wY); 42 extern int sp_set_movetime(int wNum, int wTime); 43 extern int sp_set_movespeed(int wNum, int wTime); 44 extern int sp_add_zkey_hidesprite(int wNum); 45 extern int sp_clear_zkey_hidesprite_all(); 46 extern int sp_freeze_sprite(int wNum, int wIndex); 47 extern int sp_thaw_sprite(int wNum); 48 extern int sp_add_quakesprite(int wNum); 49 extern int sp_clear_quakesprite_all(); 50 extern int sp_set_animeinterval(int wNum, int wTime); 51 extern boolean sp_is_insprite(sprite_t *sp, int x, int y); 52 extern int sp_set_blendrate(int wNum, int wCount, int rate); 53 extern int sp_query_isexist(int wNum, int *ret); 54 extern int sp_query_info(int wNum, int *vtype, int *vcg1, int *vcg2, int *vcg3); 55 extern int sp_query_show(int wNum, int *vShow); 56 extern int sp_query_pos(int wNum, int *vx, int *vy); 57 extern int sp_query_size(int wNum, int *vw, int *vh); 58 extern int sp_query_textpos(int wNum, int *vx, int *vy); 59 extern int sp_num_setcg(int nNum, int nIndex, int nCG); 60 extern int sp_num_getcg(int nNum, int nIndex, int *vCG); 61 extern int sp_num_setpos(int nNum, int nX, int nY); 62 extern int sp_num_getpos(int nNum, int *vX, int *vY); 63 extern int sp_num_setspan(int nNum, int nSpan); 64 extern int sp_num_getspan(int nNUm, int *vSpan); 65 extern int sp_exp_clear(); 66 extern int sp_exp_add(int nNumSP1, int nNumSP2); 67 extern int sp_exp_del(int wNum); 68 extern int sp_sound_set(int wNumSP, int wNumWave1, int wNumWave2, int wNumWave3); 69 extern int sp_sound_wait(); 70 extern int sp_sound_ob(int wNumWave); 71 72 73 // in sprite_update.c 74 extern int sp_update_all(boolean syncscreen); 75 extern int sp_update_clipped(); 76 extern int sp_updateme(sprite_t *sp); 77 extern int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h); 78 79 80 // in sprite_draw.c 81 extern int sp_draw(sprite_t *sf); 82 extern int sp_draw2(sprite_t *sf, cginfo_t *cg); 83 extern void sp_draw_dmap(gpointer data, gpointer userdata); 84 85 86 // in sprite_msg.c 87 extern void smsg_add(char *msg); 88 extern void smsg_newline(int wNum, int size); 89 extern void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace, int wAlign, int wRSize, int wRFont, int wRLineSpace, int *wLength); 90 extern void smsg_clear(int wNum); 91 extern int smsg_is_empty(); 92 extern int smsg_keywait(int sp1, int sp2, int timeout); 93 extern int smsg_update(sprite_t *sp); 94 95 // in sprite_sel.c 96 extern void ssel_init(); 97 extern void ssel_clear(); 98 extern void ssel_add(int nString, int wI); 99 extern int ssel_select(int wNum, int wChoiceSize, int wMenuOutSpc, int wChoiceLineSpace, int wChoiceAutoMoveCursor, int nAlign); 100 101 // in sprite_event.c 102 extern void spev_callback(agsevent_t *e); 103 extern void spev_add_eventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)); 104 extern void spev_remove_eventlistener(sprite_t *sp); 105 106 // in sprite_tevent.c 107 extern void spev_add_teventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)); 108 extern void spev_remove_teventlistener(sprite_t *sp); 109 extern void spev_main(); 110 111 // in sprite_move.c 112 extern void spev_move_setup(gpointer data, gpointer userdata); 113 extern void spev_move_waitend(sprite_t *sp, int dx, int dy, int time); 114 extern void spev_wait4moving_sp(); 115 116 // in sprite_switch.c 117 extern int sp_sw_setup(sprite_t *sp); 118 119 // in sprite_get.c 120 extern int sp_get_setup(sprite_t *sp); 121 122 // in sprite_put.c 123 extern int sp_put_setup(sprite_t *sp); 124 125 // in sprite_anime.c 126 extern int sp_anime_setup(sprite_t *sp); 127 128 // in sprite_eupdate.c 129 extern int sp_eupdate(int type, int time, int key); 130 131 // in sprite_quake.c 132 extern int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitude, int wCount, int cancel); 133 134 // in sprite_keywait.c 135 extern int sp_keywait(int *vOK, int *vRND, int *vRsv1, int *vRsv2, int *vRsv3, int timeout); 136 137 // in screen_quake.c 138 extern int sp_quake_screen(int type, int p1, int p2, int time, int cancel); 139 140 // in sactamask.c 141 extern int sp_eupdate_amap(int type, int time, int key); 142 143 // in sprite_xmenu.c 144 extern int spxm_clear(void); 145 extern int spxm_register(int reginum, int menuid); 146 extern int spxm_getnum(int reginum); 147 extern int spxm_gettext(int regnum, int strno); 148 extern int spxm_titlereg(void); 149 extern int spxm_titleget(int strno); 150 151 #endif /* __SPRITE_H__ */ 152