1 /* $Id: blockbitmaps.h,v 5.1 2002/02/10 19:29:39 bertg Exp $ 2 * 3 * XPilot, a multiplayer gravity war game. Copyright (C) 1991-2001 by 4 * 5 * Bj�rn Stabell <bjoern@xpilot.org> 6 * Ken Ronny Schouten <ken@xpilot.org> 7 * Bert Gijsbers <bert@xpilot.org> 8 * Dick Balaska <dick@xpilot.org> 9 * 10 * This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by 12 * the Free Software Foundation; either version 2 of the License, or 13 * (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License 21 * along with this program; if not, write to the Free Software 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 */ 24 25 #ifndef BLOCKBITMAPS_H 26 #define BLOCKBITMAPS_H 27 28 #include "gfx2d.h" 29 30 #define BM_HOLDER_FRIEND 0 31 #define BM_HOLDER_ENEMY 1 32 #define BM_BALL 2 33 #define BM_SHIP_SELF 3 34 #define BM_SHIP_FRIEND 4 35 #define BM_SHIP_ENEMY 5 36 #define BM_BULLET 6 37 #define BM_BULLET_OWN 7 38 #define BM_BASE_DOWN 8 39 #define BM_BASE_LEFT 9 40 #define BM_BASE_UP 10 41 #define BM_BASE_RIGHT 11 42 #define BM_FUELCELL 12 43 #define BM_FUEL 13 44 #define BM_ALL_ITEMS 14 45 #define BM_CANNON_DOWN 15 46 #define BM_CANNON_LEFT 16 47 #define BM_CANNON_UP 17 48 #define BM_CANNON_RIGHT 18 49 #define BM_SPARKS 19 50 #define BM_PAUSED 20 51 #define BM_WALL_TOP 21 52 #define BM_WALL_LEFT 22 53 #define BM_WALL_BOTTOM 23 54 #define BM_WALL_RIGHT 24 55 #define BM_WALL_LU 25 56 #define BM_WALL_RU 26 57 #define BM_WALL_LD 27 58 #define BM_WALL_RD 28 59 60 #define BM_WALL_FILLED 29 61 #define BM_WALL_UR 30 62 #define BM_WALL_UL 31 63 64 #define BM_SCORE_BG 32 65 #define BM_LOGO 33 66 #define BM_REFUEL 34 67 #define BM_WORMHOLE 35 68 #define BM_MINE_TEAM 36 69 #define BM_MINE_OTHER 37 70 #define BM_CONCENTRATOR 38 71 #define BM_PLUSGRAVITY 39 72 #define BM_MINUSGRAVITY 40 73 #define BM_CHECKPOINT 41 74 #define BM_METER 42 75 #define BM_ASTEROIDCONC 43 76 77 #define NUM_BITMAPS 44 78 79 #define BG_IMAGE_HEIGHT 442 80 #define LOGO_HEIGHT 223 81 82 #define RADAR_TEXTURE_SIZE 32 83 84 85 typedef struct { 86 Pixmap bitmap; 87 int scale_width, scale_height; 88 89 Pixmap mask; 90 bbox_t bbox; 91 } xp_bitmap_t; 92 93 /* XXX need comment about purpose of this structure. */ 94 typedef struct { 95 char *filename; 96 int rotations; 97 98 int width, height; 99 xp_bitmap_t *bitmaps; 100 xp_picture_t picture; 101 } xp_pixmap_t; 102 103 extern xp_pixmap_t xp_pixmaps[]; 104 105 void PaintBitmap(Drawable d, int type, int x, int y, int width, int height, 106 int number); 107 void PaintFuelSlice(Drawable d, int type, int x, int y, int width, int height, 108 int image, int size); 109 void PaintMeter(Drawable d, int type, int x, int y, int width, int height, 110 int size); 111 112 int Block_bitmap_images(int type); 113 int Block_bitmaps_create(void); 114 115 void Block_bitmap_create_begin(Drawable d, 116 xp_pixmap_t *xp_pixmap, int image, 117 int width, int height); 118 119 void Block_bitmap_create_end(Drawable d); 120 121 void Block_bitmap_set_pixel(xp_pixmap_t *xp_pixmap, int image, int x, int y, 122 RGB_COLOR color); 123 void Block_bitmap_paint(Drawable d, int type, int x, int y, 124 int width, int height, 125 int number); 126 127 void Cache_ships(Drawable d); 128 129 void Block_bitmap_create(Display* dpy, Drawable d, 130 xp_pixmap_t *xp_pixmap, int number, 131 int width, int height); 132 133 void Block_bitmap_paint_fuel_slice(Drawable d, int type, int x, int y, 134 int width, int height, 135 int image, int size); 136 137 void Block_bitmap_paint_meter(Drawable d, int type, int x, int y, 138 int width, int height, 139 int size); 140 141 #endif 142