2006-03-20 17:12:09 +00:00
|
|
|
/*
|
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Bitmap and Palette loading functions.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _BM_H
|
|
|
|
#define _BM_H
|
|
|
|
|
|
|
|
#include "gr.h"
|
|
|
|
#include "piggy.h"
|
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
|
|
|
#define MAX_TEXTURES 800
|
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
2006-03-20 17:12:09 +00:00
|
|
|
#define MAX_TEXTURES 1200
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
//tmapinfo flags
|
|
|
|
#define TMI_VOLATILE 1 //this material blows up when hit
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
2006-03-20 17:12:09 +00:00
|
|
|
#define TMI_WATER 2 //this material is water
|
|
|
|
#define TMI_FORCE_FIELD 4 //this is force field - flares don't stick
|
|
|
|
#define TMI_GOAL_BLUE 8 //this is used to remap the blue goal
|
|
|
|
#define TMI_GOAL_RED 16 //this is used to remap the red goal
|
|
|
|
#define TMI_GOAL_HOARD 32 //this is used to remap the goals
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
|
|
|
typedef struct {
|
|
|
|
char filename[13];
|
|
|
|
ubyte flags;
|
|
|
|
fix lighting; // 0 to 1
|
|
|
|
fix damage; //how much damage being against this does
|
|
|
|
int eclip_num; //if not -1, the eclip that changes this
|
|
|
|
} __pack__ tmap_info;
|
|
|
|
#define N_COCKPIT_BITMAPS 4
|
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
2006-03-20 17:12:09 +00:00
|
|
|
typedef struct {
|
|
|
|
ubyte flags; //values defined above
|
|
|
|
ubyte pad[3]; //keep alignment
|
|
|
|
fix lighting; //how much light this casts
|
|
|
|
fix damage; //how much damage being against this does (for lava)
|
|
|
|
short eclip_num; //the eclip that changes this, or -1
|
|
|
|
short destroyed; //bitmap to show when destroyed, or -1
|
|
|
|
short slide_u,slide_v; //slide rates of texture, stored in 8:8 fix
|
|
|
|
#ifdef EDITOR
|
|
|
|
char filename[13]; //used by editor to remap textures
|
|
|
|
char pad2[3];
|
|
|
|
#endif
|
|
|
|
} __pack__ tmap_info;
|
|
|
|
|
|
|
|
#define TMAP_INFO_SIZE 20 // how much space it takes up on disk
|
2013-03-03 01:03:33 +00:00
|
|
|
#define N_COCKPIT_BITMAPS 6
|
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
extern int Num_object_types;
|
|
|
|
|
2012-11-11 00:12:17 +00:00
|
|
|
struct player_ship;
|
|
|
|
extern struct player_ship only_player_ship;
|
2006-03-20 17:12:09 +00:00
|
|
|
extern int Num_cockpits;
|
|
|
|
extern bitmap_index cockpit_bitmap[N_COCKPIT_BITMAPS];
|
2012-11-11 00:12:17 +00:00
|
|
|
extern short tmap_xlate_table[MAX_TEXTURES];
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
extern int Num_tmaps;
|
|
|
|
#ifdef EDITOR
|
|
|
|
extern int TmapList[MAX_TEXTURES];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern tmap_info TmapInfo[MAX_TEXTURES];
|
|
|
|
|
|
|
|
// Initializes the palette, bitmap system...
|
2008-11-14 16:56:40 +00:00
|
|
|
void gamedata_close();
|
2008-02-11 12:12:57 +00:00
|
|
|
int gamedata_init();
|
2006-03-20 17:12:09 +00:00
|
|
|
void bm_close();
|
|
|
|
|
|
|
|
// Initializes the Texture[] array of bmd_bitmap structures.
|
|
|
|
void init_textures();
|
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#define OL_ROBOT 1
|
|
|
|
#define OL_HOSTAGE 2
|
|
|
|
#define OL_POWERUP 3
|
|
|
|
#define OL_CONTROL_CENTER 4
|
|
|
|
#define OL_PLAYER 5
|
|
|
|
#define OL_CLUTTER 6 //some sort of misc object
|
|
|
|
#define OL_EXIT 7 //the exit model for external scenes
|
|
|
|
|
|
|
|
#define MAX_OBJTYPE 100
|
|
|
|
|
|
|
|
extern int Num_total_object_types; // Total number of object types, including robots, hostages, powerups, control centers, faces
|
|
|
|
extern sbyte ObjType[MAX_OBJTYPE]; // Type of an object, such as Robot, eg if ObjType[11] == OL_ROBOT, then object #11 is a robot
|
|
|
|
extern sbyte ObjId[MAX_OBJTYPE]; // ID of a robot, within its class, eg if ObjType[11] == 3, then object #11 is the third robot
|
|
|
|
extern fix ObjStrength[MAX_OBJTYPE]; // initial strength of each object
|
|
|
|
|
|
|
|
#define MAX_OBJ_BITMAPS 210
|
|
|
|
|
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
|
|
|
|
|
|
|
//the model number of the marker object
|
|
|
|
extern int Marker_model_num;
|
2006-03-20 17:12:09 +00:00
|
|
|
#define MAX_OBJ_BITMAPS 610
|
2012-11-11 00:12:17 +00:00
|
|
|
extern int N_ObjBitmaps;
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
extern int Num_object_subtypes; // Number of possible IDs for the current type of object to be placed
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
extern bitmap_index ObjBitmaps[MAX_OBJ_BITMAPS];
|
|
|
|
extern ushort ObjBitmapPtrs[MAX_OBJ_BITMAPS];
|
|
|
|
extern int First_multi_bitmap_num;
|
2011-04-12 01:02:51 +00:00
|
|
|
void compute_average_rgb(grs_bitmap *bm, fix *rgb);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// Initializes all bitmaps from BITMAPS.TBL file.
|
2008-02-11 12:12:57 +00:00
|
|
|
int gamedata_read_tbl(int pc_shareware);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2011-06-01 07:59:55 +00:00
|
|
|
extern void bm_read_all(PHYSFS_file * fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
int load_exit_models();
|
|
|
|
|
|
|
|
#endif /* _BM_H */
|