1 /* 2 * cg.h load and display cg 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: cg.h,v 1.14 2001/09/16 15:59:11 chikama Exp $ */ 23 24 #ifndef __CG__ 25 #define __CG__ 26 27 #include "portab.h" 28 #include "graphics.h" 29 30 /* 31 * available cg format id 32 */ 33 typedef enum { 34 ALCG_UNKNOWN = 1, 35 ALCG_VSP = 2, 36 ALCG_PMS8 = 3, 37 ALCG_PMS16 = 4, 38 ALCG_BMP8 = 5, 39 ALCG_BMP24 = 6, 40 ALCG_QNT = 7 41 } CG_TYPE; 42 43 /* 44 * information for display cg data 45 */ 46 typedef struct { 47 CG_TYPE type; /* cg format type */ 48 int x; /* default display location x */ 49 int y; /* default display location y */ 50 int width; /* image width */ 51 int height; /* image height */ 52 53 BYTE *pic; /* extracted pixel data */ 54 BYTE *alpha; /* extracted alpha data if exists */ 55 Pallet256 *pal; /* extracted pallet data if exists */ 56 57 int vsp_bank; /* pallet bank for vsp */ 58 int pms_bank; /* pallet bank for pms */ 59 60 int spritecolor; /* sprite color for vsp and pms8 */ 61 int alphalevel; /* alpha level of image */ 62 63 int data_offset; /* pic offset for clipping */ 64 } cgdata; 65 66 /* 67 * location for draw image policy 68 */ 69 typedef enum { 70 OFFSET_NOMOVE, /* use location in data */ 71 OFFSET_ABSOLUTE_GC, /* absolute location and use only once */ 72 OFFSET_ABSOLUTE_JC, /* absolute location and use til J4 cmd */ 73 OFFSET_RELATIVE_GC, /* relative location and use only once */ 74 OFFSET_RELATIVE_JC /* relative location and use til J4 cmd */ 75 } CG_WHERETODISP; 76 77 extern void cg_init(); 78 extern void cg_set_display_location(int x, int y, CG_WHERETODISP policy); 79 extern void cg_load(int no, int flg); 80 extern void cg_load_with_alpha(int cgno, int shadowno); 81 extern int cg_load_with_filename(char *name, int x, int y); 82 extern void cg_get_info(int no, MyRectangle *info); 83 extern cgdata *cg_loadonly(int no); 84 extern void cg_clear_display_loc(); 85 86 extern int cg_vspPB; 87 extern int cg_fflg; 88 extern int *cg_loadCountVar; 89 extern int cg_alphaLevel; 90 91 #endif /* !__CG__ */ 92