Add size information to improve -fmudflap

This commit is contained in:
Kp 2012-11-11 00:12:17 +00:00
parent 5e21ee36fb
commit 8e94b21061
37 changed files with 64 additions and 66 deletions

View file

@ -1,7 +1,7 @@
#ifndef __JUKEBOX_H__
#define __JUKEBOX_H__
extern const char *const jukebox_exts[];
extern const char *const jukebox_exts[7];
void jukebox_unload();
void jukebox_load();

View file

@ -47,7 +47,7 @@ extern int event_key_get_raw(d_event *event); // same as above but without mod s
extern unsigned char key_ascii();
// Set to 1 if the key is currently down, else 0
extern volatile unsigned char keyd_pressed[];
extern volatile unsigned char keyd_pressed[256];
extern volatile unsigned char keyd_last_pressed;
extern volatile unsigned char keyd_last_released;

View file

@ -14,9 +14,7 @@
#include "text.h"
#include "u_mem.h"
#include "playsave.h"
extern char *joybutton_text[]; //from kconfig.c
extern char *joyaxis_text[]; //from kconfig.c
#include "kconfig.h"
int num_joysticks = 0;
int joy_num_axes = 0;

View file

@ -51,7 +51,7 @@ void jukebox_unload()
JukeboxSongs.num_songs = JukeboxSongs.max_songs = JukeboxSongs.max_buf = 0;
}
const char *const jukebox_exts[] = { SONG_EXT_HMP, SONG_EXT_MID, SONG_EXT_OGG, SONG_EXT_FLAC, SONG_EXT_MP3, NULL };
const char *const jukebox_exts[7] = { SONG_EXT_HMP, SONG_EXT_MID, SONG_EXT_OGG, SONG_EXT_FLAC, SONG_EXT_MP3, NULL };
int read_m3u(void)
{

View file

@ -70,7 +70,7 @@ editor_view RightView = {3,1, NULL, i2f(100),{{0,0,f1_0},{0,f1_0,0},{f1_0,0,0}},
#endif
editor_view *Views[] = {&LargeView,
editor_view *Views[ORTHO_VIEWS ? 4 : 1] = {&LargeView,
#if ORTHO_VIEWS
&TopView,&FrontView,&RightView
#endif

View file

@ -21,6 +21,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#define _EDITOR_H
#include "vecmat.h"
#include "segment.h"
#include "inferno.h"
#include "gr.h"
#include "ui.h"
@ -154,7 +155,7 @@ typedef struct editor_view {
*
*/
extern editor_view *Views[];
extern editor_view *Views[ORTHO_VIEWS ? 4 : 1];
extern int N_views;
extern int Large_view_index;
extern UI_GADGET_USERBOX * LargeViewBox;
@ -541,7 +542,7 @@ extern int Lock_view_to_cursegp; // !0 means whenever cursegp changes, view it
extern int Num_tilings; // number of tilings/wall
extern int Degenerate_segment_found;
extern sbyte Been_visited[]; // List of segments visited in a recursive search, if element n set, segment n done been visited
extern sbyte Been_visited[MAX_SEGMENTS]; // List of segments visited in a recursive search, if element n set, segment n done been visited
// Initializes autosave system.
// Sets global Autosave_count to 0.

View file

@ -109,9 +109,9 @@ fixang fix_acos (fix v);
//NOTE: this is different from the standard C atan2, since it is left-handed.
fixang fix_atan2 (fix cos, fix sin);
extern const ubyte guess_table[];
extern const short sincos_table[];
extern const ushort asin_table[];
extern const ushort acos_table[];
extern const ubyte guess_table[256];
extern const short sincos_table[321];
extern const ushort asin_table[258];
extern const ushort acos_table[258];
#endif

View file

@ -221,9 +221,9 @@ extern void ai_multi_send_robot_position(int objnum, int force);
// It is not valid to use FrameTime because robots do not get moved every frame.
extern int Num_boss_teleport_segs;
extern short Boss_teleport_segs[];
extern short Boss_teleport_segs[MAX_BOSS_TELEPORT_SEGS];
extern int Num_boss_gate_segs;
extern short Boss_gate_segs[];
extern short Boss_gate_segs[MAX_BOSS_TELEPORT_SEGS];
// --------- John: These variables must be saved as part of gamesave. ---------

View file

@ -24,6 +24,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
extern int Automap_active;
extern char Marker_input[40];
extern void do_automap(int key_code);
extern void automap_clear_visited();
extern ubyte Automap_visited[MAX_SEGMENTS];

View file

@ -52,8 +52,11 @@ typedef struct {
extern int Num_object_types;
#define N_COCKPIT_BITMAPS 6
struct player_ship;
extern struct player_ship only_player_ship;
extern int Num_cockpits;
extern bitmap_index cockpit_bitmap[N_COCKPIT_BITMAPS];
extern short tmap_xlate_table[MAX_TEXTURES];
extern int Num_tmaps;
#ifdef EDITOR
@ -62,10 +65,6 @@ extern int TmapList[MAX_TEXTURES];
extern tmap_info TmapInfo[MAX_TEXTURES];
//for each model, a model number for dying & dead variants, or -1 if none
extern int Dying_modelnums[];
extern int Dead_modelnums[];
//the model number of the marker object
extern int Marker_model_num;
@ -82,6 +81,7 @@ extern int Num_object_subtypes; // Number of possible IDs for the current t
#define MAX_OBJ_BITMAPS 610
extern int N_ObjBitmaps;
extern bitmap_index ObjBitmaps[MAX_OBJ_BITMAPS];
extern ushort ObjBitmapPtrs[MAX_OBJ_BITMAPS];
extern int First_multi_bitmap_num;

View file

@ -78,9 +78,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#define MAX_BITMAPS_PER_BRUSH 30
extern player_ship only_player_ship; // In bm.c
extern short N_ObjBitmaps; // in bm.c
short N_ObjBitmapPtrs=0;
static int Num_robot_ais = 0;
int TmapList[MAX_TEXTURES];
@ -119,10 +116,6 @@ int linenum; //line int table currently being parsed
//------------------- Useful macros and variables ---------------
#define IFTOK(str) if (!strcmp(arg, str))
extern char *space; // in piggy.c
//--unused-- char *equal = { "=" };
extern char *equal_space; // in piggy.c
// For the sake of LINT, defining prototypes to module's functions
void bm_read_alias(void);
@ -214,9 +207,6 @@ bitmap_index bm_load_sub(int skip, char * filename )
return bitmap_num;
}
extern ubyte bogus_bitmap_initialized;
extern digi_sound bogus_sound;
void ab_load(int skip, char * filename, bitmap_index bmp[], int *nframes )
{
grs_bitmap * bm[MAX_BITMAPS_PER_BRUSH];

View file

@ -45,6 +45,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "endlevel.h"
#include "object.h"
#include "game.h"
#include "gamepal.h"
#include "screens.h"
#include "gauges.h"
#include "wall.h"

View file

@ -593,8 +593,6 @@ int choose_drop_segment()
// ------------------------------------------------------------------------------------------------------
// Drop cloak powerup if in a network game.
extern char PowerupsInMine[],MaxPowerupsAllowed[];
void maybe_drop_net_powerup(int powerup_type)
{
if ((Game_mode & GM_MULTI) && !(Game_mode & GM_MULTI_COOP)) {

View file

@ -121,7 +121,6 @@ int game_load_mine(char * filename);
int load_mine_data(PHYSFS_file *LoadFile);
int load_mine_data_compiled(PHYSFS_file *LoadFile);
extern short tmap_xlate_table[];
extern fix Level_shake_frequency, Level_shake_duration;
extern int Secret_return_segment;
extern vms_matrix Secret_return_orient;

View file

@ -27,6 +27,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
extern char last_palette_loaded[FILENAME_LEN];
extern char Current_level_palette[FILENAME_LEN];
extern char last_palette_loaded_pig[FILENAME_LEN];
// load a palette by name. returns 1 if new palette loaded, else 0
// if used_for_level is set, load pig, etc.

View file

@ -61,7 +61,6 @@ extern void newmenu_free_background();
int netplayerinfo_on=0;
extern ubyte DefiningMarkerMessage;
extern char Marker_input[];
void game_draw_marker_message()
{

View file

@ -130,9 +130,6 @@ void do_load_save_levels(int save);
void dump_mine_info(void);
#endif
extern char MaxPowerupsAllowed[MAX_POWERUP_TYPES];
extern char PowerupsInMine[MAX_POWERUP_TYPES];
#ifdef EDITOR
extern char mine_filename[];
extern int save_mine_data_compiled(PHYSFS_file *SaveFile);

View file

@ -28,7 +28,7 @@ int get_level_name(void);
extern int load_level(const char *filename);
extern int save_level(char *filename);
extern char Gamesave_current_filename[];
extern char Gamesave_current_filename[PATH_MAX];
extern int Gamesave_current_version;

View file

@ -2226,7 +2226,7 @@ extern int Missile_gun;
extern int allowed_to_fire_laser(void);
extern int allowed_to_fire_missile(void);
const rgb player_rgb[] = {
const rgb player_rgb[MAX_PLAYERS] = {
{15,15,23},
{27,0,0},
{0,23,0},

View file

@ -26,6 +26,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "piggy.h"
#include "object.h"
#include "hudmsg.h"
#include "player.h"
//from gauges.c
@ -61,7 +62,7 @@ typedef struct {
ubyte r,g,b;
} rgb;
extern const rgb player_rgb[];
extern const rgb player_rgb[MAX_PLAYERS];
#define WBU_WEAPON 0 // the weapons display
#define WBU_MISSILE 1 // the missile view

View file

@ -64,4 +64,7 @@ extern void kc_set_controls();
//set the cruise speed to zero
extern void reset_cruise(void);
extern char *joybutton_text[JOY_MAX_BUTTONS];
extern char *joyaxis_text[JOY_MAX_AXES];
#endif /* _KCONFIG_H */

View file

@ -100,9 +100,6 @@ struct object;
extern fix Min_trackable_dot; // MIN_TRACKABLE_DOT inversely scaled by FrameTime
extern struct object *Guided_missile[];
extern int Guided_missile_sig[];
void Laser_render(struct object *obj);
void Laser_player_fire(struct object * obj, int type, int gun_num, int make_sound, int harmless_flag);
void Laser_player_fire_spread(struct object *obj, int laser_type, int gun_num, fix spreadr, fix spreadu, int make_sound, int harmless);

View file

@ -39,7 +39,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "console.h"
#include "wall.h"
#include "cntrlcen.h"
#include "powerup.h"
#include "polyobj.h"
#include "bm.h"
#include "endlevel.h"
@ -200,7 +199,7 @@ static const int message_length[] = {
char PowerupsInMine[MAX_POWERUP_TYPES],MaxPowerupsAllowed[MAX_POWERUP_TYPES];
extern fix ThisLevelTime;
char *RankStrings[]={"(unpatched) ","Cadet ","Ensign ","Lieutenant ","Lt.Commander ",
const char *const RankStrings[10]={"(unpatched) ","Cadet ","Ensign ","Lieutenant ","Lt.Commander ",
"Commander ","Captain ","Vice Admiral ","Admiral ","Demigod "};
char *multi_allow_powerup_text[MULTI_ALLOW_POWERUP_MAX] =
@ -4640,8 +4639,6 @@ void multi_do_start_trigger (const ubyte *buf)
Triggers[(int)buf[1]].flags |=TF_DISABLED;
}
extern char *RankStrings[];
void multi_add_lifetime_kills ()
{
// This function adds a kill to lifetime stats of this player, and possibly

View file

@ -23,6 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "gameseq.h"
#include "piggy.h"
#include "newmenu.h"
#include "powerup.h"
#ifdef USE_UDP
#ifdef _WIN32
@ -357,7 +358,9 @@ extern int Bounty_target;
extern bitmap_index multi_player_textures[MAX_PLAYERS][N_PLAYER_SHIP_TEXTURES];
extern char *RankStrings[];
extern const char *const RankStrings[10];
extern char PowerupsInMine[MAX_POWERUP_TYPES],
MaxPowerupsAllowed[MAX_POWERUP_TYPES];
// Globals for protocol-bound Refuse-functions
extern char RefuseThisPlayer,WaitForRefuseAnswer,RefuseTeam,RefusePlayerName[12];

View file

@ -33,6 +33,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "mouse.h"
#include "palette.h"
#include "game.h"
#include "gamepal.h"
#include "text.h"
#include "menu.h"
#include "newmenu.h"

View file

@ -37,6 +37,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "args.h"
#include "palette.h"
#include "gamefont.h"
#include "gamepal.h"
#include "rle.h"
#include "screens.h"
#include "piggy.h"
@ -1542,8 +1543,6 @@ int piggy_is_substitutable_bitmap( char * name, char * subst_name )
* 2) From descent.pig (for loading d1 levels)
*/
extern char last_palette_loaded_pig[];
void free_bitmap_replacements()
{
if (Bitmap_replacement_data) {
@ -1744,8 +1743,8 @@ void remove_char( char * s, char c )
if (p) *p = '\0';
}
char *space = { " \t" };
char *equal_space = { " \t=" };
const char space[3] = " \t";
const char equal_space[4] = " \t=";
// this function is at the same position in the d1 shareware piggy loading
// algorithm as bm_load_sub in main/bmread.c

View file

@ -132,4 +132,9 @@ extern void remove_char( char * s, char c ); // in piggy.c
#define REMOVE_COMMENTS(s) remove_char((s),';')
#define REMOVE_DOTS(s) remove_char((s),'.')
extern ubyte bogus_bitmap_initialized;
extern digi_sound bogus_sound;
extern const char space[3];
extern const char equal_space[4];
#endif //_PIGGY_H

View file

@ -197,6 +197,9 @@ extern int Player_num; // The player number who is on the console.
extern player Players[MAX_PLAYERS+4]; // Misc player info
extern player_ship *Player_ship;
extern struct object *Guided_missile[MAX_PLAYERS];
extern int Guided_missile_sig[MAX_PLAYERS];
/*
* reads a player_ship structure from a PHYSFS_file
*/

View file

@ -47,7 +47,6 @@ polymodel Polygon_models[MAX_POLYGON_MODELS]; // = {&bot11,&bot17,&robot_s2,&rob
int N_polygon_models = 0;
#define MAX_POLYGON_VECS 1000
g3s_point robot_points[MAX_POLYGON_VECS];
#define PM_COMPATIBLE_VERSION 6

View file

@ -33,6 +33,10 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#define MAX_POLYGON_MODELS 200
#define MAX_SUBMODELS 10
//for each model, a model number for dying & dead variants, or -1 if none
extern int Dying_modelnums[MAX_POLYGON_MODELS];
extern int Dead_modelnums[MAX_POLYGON_MODELS];
//used to describe a polygon model
typedef struct polymodel {
int n_models;
@ -55,7 +59,7 @@ typedef struct polymodel {
} __pack__ polymodel;
// array of pointers to polygon objects
extern polymodel Polygon_models[];
extern polymodel Polygon_models[MAX_POLYGON_MODELS];
// how many polygon objects there are
extern int N_polygon_models;
@ -90,7 +94,8 @@ void free_model(polymodel *po);
#define MAX_POLYOBJ_TEXTURES 100
extern grs_bitmap *texture_list[MAX_POLYOBJ_TEXTURES];
extern bitmap_index texture_list_index[MAX_POLYOBJ_TEXTURES];
extern g3s_point robot_points[];
#define MAX_POLYGON_VECS 1000
extern g3s_point robot_points[MAX_POLYGON_VECS];
/*
* reads a polymodel structure from a PHYSFS_file

View file

@ -139,7 +139,7 @@ typedef struct robot_info {
extern char Robot_names[MAX_ROBOT_TYPES][ROBOT_NAME_LENGTH];
//the array of robots types
extern robot_info Robot_info[]; // Robot info for AI system, loaded from bitmaps.tbl.
extern robot_info Robot_info[MAX_ROBOT_TYPES]; // Robot info for AI system, loaded from bitmaps.tbl.
//how many kinds of robots
extern int N_robot_types; // Number of robot types. We used to assume this was the same as N_polygon_models.

View file

@ -158,9 +158,9 @@ typedef struct {
} group;
// Globals from mglobal.c
extern vms_vector Vertices[];
extern segment Segments[];
#define Segment2s Segments
extern vms_vector Vertices[MAX_VERTICES];
extern segment Segments[MAX_SEGMENTS];
extern int Num_segments;
extern int Num_vertices;
@ -169,7 +169,7 @@ extern int Num_vertices;
extern const sbyte Side_to_verts[MAX_SIDES_PER_SEGMENT][4]; // Side_to_verts[my_side] is list of vertices forming side my_side.
extern const int Side_to_verts_int[MAX_SIDES_PER_SEGMENT][4]; // Side_to_verts[my_side] is list of vertices forming side my_side.
extern const char Side_opposite[]; // Side_opposite[my_side] returns side opposite cube from my_side.
extern const char Side_opposite[MAX_SIDES_PER_SEGMENT]; // Side_opposite[my_side] returns side opposite cube from my_side.
#define SEG_PTR_2_NUM(segptr) (Assert((unsigned) (segptr-Segments)<MAX_SEGMENTS),(segptr)-Segments)

View file

@ -23,6 +23,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "3d.h"
extern g3s_point Segment_points[];
extern g3s_point Segment_points[MAX_VERTICES];
#endif /* _SEGPOINTS_H */

View file

@ -70,7 +70,6 @@ int Num_open_doors; // Number of open doors
#define CLOAKING_WALL_TIME f1_0
#define MAX_CLOAKING_WALLS 10
cloaking_wall CloakingWalls[MAX_CLOAKING_WALLS];
int Num_cloaking_walls;

View file

@ -186,7 +186,8 @@ extern int Num_walls; // Number of walls
extern active_door ActiveDoors[MAX_DOORS]; // Master doors array
extern int Num_open_doors; // Number of open doors
extern cloaking_wall CloakingWalls[];
#define MAX_CLOAKING_WALLS 10
extern cloaking_wall CloakingWalls[MAX_CLOAKING_WALLS];
extern int Num_cloaking_walls;
extern wclip WallAnims[MAX_WALL_ANIMS];

View file

@ -155,7 +155,7 @@ typedef struct weapon_info {
#define NUM_SMART_CHILDREN 6 // Number of smart children created by default.
extern weapon_info Weapon_info[];
extern weapon_info Weapon_info[MAX_WEAPON_TYPES];
extern int N_weapon_types;
extern void do_weapon_select(int weapon_num, int secondary_flag);
extern void show_weapon_status(void);

View file

@ -19,7 +19,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "maths.h"
const ubyte guess_table[] = {
const ubyte guess_table[256] = {
1,
1,1,1,
2,2,2,2,2,
@ -38,7 +38,7 @@ const ubyte guess_table[] = {
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
};
const short sincos_table[] = {
const short sincos_table[321] = {
0,
402,
804,
@ -363,7 +363,7 @@ const short sincos_table[] = {
16384
};
const ushort asin_table[] = {
const ushort asin_table[258] = {
0,
41,
81,
@ -624,7 +624,7 @@ const ushort asin_table[] = {
16384 // extra for when exactly 1
};
const ushort acos_table[] = {
const ushort acos_table[258] = {
16384,
16343,
16303,