conditionalize including multi.h and network.h, fix backslashes, fix compiler errors with EDITOR

This commit is contained in:
Bradley Bell 2001-10-25 02:19:32 +00:00
parent 413f2a34ab
commit 6e38434e6e
9 changed files with 101 additions and 45 deletions

View file

@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
/*
* $Source: /cvs/cvsroot/d2x/main/bmread.c,v $
* $Revision: 1.3 $
* $Revision: 1.4 $
* $Author: bradleyb $
* $Date: 2001-10-23 21:53:18 $
* $Date: 2001-10-25 02:19:31 $
*
* FIXME: put description here
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2001/10/23 21:53:18 bradleyb
* No longer #ifdef'ing out the whole file. RCS header added
*
*
*/
@ -38,7 +41,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "gr.h"
#include "bm.h"
#include "gamepal.h"
#include "mem.h"
#include "u_mem.h"
#include "mono.h"
#include "error.h"
#include "object.h"
@ -48,7 +51,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "wall.h"
#include "textures.h"
#include "game.h"
#ifdef NETWORK
#include "multi.h"
#endif
#include "iff.h"
#include "cfile.h"
@ -69,7 +74,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "args.h"
#include "editor\texpage.h"
#include "editor/texpage.h"
#define BM_NONE -1
#define BM_COCKPIT 0
@ -140,6 +145,8 @@ char *equal_space = { " \t=" };
// For the sake of LINT, defining prototypes to module's functions
void bm_read_alias(void);
void bm_read_marker(void);
void bm_read_robot_ai(void);
void bm_read_powerup(int unused_flag);
void bm_read_hostage(void);
@ -150,6 +157,8 @@ void bm_read_exitmodel(void);
void bm_read_player_ship(void);
void bm_read_some_file(void);
void bm_read_sound(void);
void bm_write_extra_robots(void);
void clear_to_end_of_line(void);
void verify_textures(void);
@ -721,7 +730,7 @@ void verify_textures()
}
bm_read_alias()
void bm_read_alias()
{
char *t;
@ -777,7 +786,7 @@ void set_texture_name(char *name)
void bm_read_eclip()
{
bitmap_index bitmap;
int dest_bm_num;
int dest_bm_num = 0;
Assert(clip_num < MAX_EFFECTS);
@ -1417,7 +1426,7 @@ void bm_read_robot()
for (i=0;i<n_models;i++) {
int n_textures;
int model_num,last_model_num;
int model_num,last_model_num=0;
n_textures = first_bitmap_num[i+1] - first_bitmap_num[i];
@ -1497,7 +1506,7 @@ void bm_read_robot()
void bm_read_reactor()
{
char *model_name, *model_name_dead=NULL;
int first_bitmap_num, first_bitmap_num_dead, n_normal_bitmaps;
int first_bitmap_num, first_bitmap_num_dead=0, n_normal_bitmaps;
char *equal_ptr;
short model_num;
short explosion_vclip_num = -1;
@ -1787,11 +1796,13 @@ void bm_read_player_ship()
if (First_multi_bitmap_num==-1)
first_bitmap_num[n_models] = N_ObjBitmapPtrs;
#ifdef NETWORK
Assert(last_multi_bitmap_num-First_multi_bitmap_num == (MAX_NUM_NET_PLAYERS-1)*2);
#endif
for (i=0;i<n_models;i++) {
int n_textures;
int model_num,last_model_num;
int model_num,last_model_num=0;
n_textures = first_bitmap_num[i+1] - first_bitmap_num[i];
@ -2137,7 +2148,7 @@ void bm_read_weapon(int unused_flag)
for (i=0;i<n_models;i++) {
int n_textures;
int model_num,last_model_num;
int model_num,last_model_num=0;
n_textures = first_bitmap_num[i+1] - first_bitmap_num[i];
@ -2418,14 +2429,15 @@ fclose(tfile);
bm_write_extra_robots();
}
bm_write_extra_robots()
void bm_write_extra_robots()
{
FILE *fp;
int t,i;
u_int32_t t;
int i;
fp = fopen("robots.ham","wb");
t = 'XHAM';
t = 0x5848414d; /* 'XHAM' */
fwrite( &t, sizeof(int), 1, fp );
t = 1; //version
fwrite( &t, sizeof(int), 1, fp );

View file

@ -11,6 +11,18 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
* $Source: /cvs/cvsroot/d2x/main/editor/editor.h,v $
* $Revision: 1.2 $
* $Author: bradleyb $
* $Date: 2001-10-25 02:19:32 $
*
* FIXME: put description here
*
* $Log: not supported by cvs2svn $
*
*/
#ifndef _EDITOR_H
#define _EDITOR_H
@ -625,10 +637,10 @@ extern UI_GADGET_USERBOX * GameViewBox;
extern UI_GADGET_USERBOX * LargeViewBox;
extern UI_GADGET_USERBOX * GroupViewBox;
extern med_point_2_vec(grs_canvas *canv,vms_vector *v,short sx,short sy);
extern void med_point_2_vec(grs_canvas *canv,vms_vector *v,short sx,short sy);
//shutdown ui on the editor screen
close_editor_screen(void);
void close_editor_screen(void);
// From eobject.c
extern int place_object(segment *segp, vms_vector *object_pos, int object_type);

View file

@ -16,7 +16,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#ifdef RCS
char game_rcsid[] = "$Id: game.c,v 1.7 2001-01-31 16:31:13 bradleyb Exp $";
char game_rcsid[] = "$Id: game.c,v 1.8 2001-10-25 02:19:31 bradleyb Exp $";
#endif
#ifdef WINDOWS
@ -88,7 +88,9 @@ char game_rcsid[] = "$Id: game.c,v 1.7 2001-01-31 16:31:13 bradleyb Exp $";
#include "powerup.h"
#include "fireball.h"
#include "newmenu.h"
#ifdef NETWORK
#include "network.h"
#endif
#include "gamefont.h"
#include "endlevel.h"
#include "joydefs.h"
@ -127,7 +129,7 @@ int VGA_current_mode;
#define SHOW_EXIT_PATH 1
#ifdef EDITOR
#include "editor\editor.h"
#include "editor/editor.h"
#endif
//#define _MARK_ON 1
@ -1037,9 +1039,9 @@ WIN(static int saved_window_h);
break;
#ifdef EDITOR
case SCREEN_EDITOR:
if (VGA_current_mode != SM_800x600V) {
if (grd_curscreen->sc_mode != SM(800,600)) {
int gr_error;
if ((gr_error=gr_set_mode(SM_800x600V))!=0) { //force into game scrren
if ((gr_error=gr_set_mode(SM(800,600)))!=0) { //force into game scrren
Warning("Cannot init editor screen (error=%d)",gr_error);
return 0;
}
@ -3014,11 +3016,12 @@ int add_flicker(int segnum,int sidenum,fix delay,ulong mask)
}
}
if (l == Num_flickering_lights)
if (l == Num_flickering_lights) {
if (Num_flickering_lights == MAX_FLICKERING_LIGHTS)
return 0;
else
Num_flickering_lights++;
}
f->segnum = segnum;
f->sidenum = sidenum;

View file

@ -64,7 +64,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "text.h"
#include "powerup.h"
#include "newmenu.h"
#ifdef NETWORK
#include "network.h"
#endif
#include "gamefont.h"
#include "endlevel.h"
#include "joydefs.h"
@ -107,7 +109,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#ifdef EDITOR
#include "editor\editor.h"
#include "editor/editor.h"
#endif
//#define _MARK_ON 1
@ -1788,7 +1790,9 @@ void HandleTestKey(int key)
#ifdef EDITOR //editor-specific functions
case KEY_E + KEY_DEBUGGED:
#ifdef NETWORK
network_leave_game();
#endif
Function_mode = FMODE_EDITOR;
break;
case KEY_Q + KEY_SHIFTED + KEY_DEBUGGED:

View file

@ -16,7 +16,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#ifdef RCS
char gamesave_rcsid[] = "$Id: gamesave.c,v 1.4 2001-01-31 15:17:53 bradleyb Exp $";
char gamesave_rcsid[] = "$Id: gamesave.c,v 1.5 2001-10-25 02:19:31 bradleyb Exp $";
#endif
#include <stdio.h>
@ -32,7 +32,7 @@ char gamesave_rcsid[] = "$Id: gamesave.c,v 1.4 2001-01-31 15:17:53 bradleyb Exp
#include "inferno.h"
#ifdef EDITOR
#include "editor\editor.h"
#include "editor/editor.h"
#endif
#include "error.h"
#include "object.h"
@ -195,6 +195,7 @@ struct {
// LINT: adding function prototypes
void read_object(object *obj, CFILE *f, int version);
void write_object(object *obj, FILE *f);
void do_load_save_levels(int save);
void dump_mine_info(void);
extern char MaxPowerupsAllowed[MAX_POWERUP_TYPES];
@ -1797,8 +1798,10 @@ int load_level(char * filename_passed)
#ifdef EDITOR
if (!use_compiled_level) {
mine_err = load_mine_data(LoadFile);
#if 0 //dunno - 3rd party stuff?
// Compress all uv coordinates in mine, improves texmap precision. --MK, 02/19/96
compress_uv_coordinates_all();
#endif
} else
#endif
//NOTE LINK TO ABOVE!!
@ -2075,8 +2078,9 @@ int save_level_sub(char * filename, int compiled_version)
{
FILE * SaveFile;
char temp_filename[128];
int sig = 'PLVL',version=LEVEL_FILE_VERSION;
int minedata_offset,gamedata_offset;
u_int32_t sig = 0x504c564c; /* 'PLVL' */
int version=LEVEL_FILE_VERSION;
int minedata_offset=0,gamedata_offset=0;
if ( !compiled_version ) {
write_game_text_file(filename);
@ -2203,7 +2207,9 @@ int save_level_sub(char * filename, int compiled_version)
}
#if 0 //dunno - 3rd party stuff?
extern void compress_uv_coordinates_all(void);
#endif
int save_level(char * filename)
{

View file

@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
/*
* $Source: /cvs/cvsroot/d2x/main/inferno.c,v $
* $Revision: 1.9 $
* $Revision: 1.10 $
* $Author: bradleyb $
* $Date: 2001-10-19 08:08:50 $
* $Date: 2001-10-25 02:19:31 $
*
* FIXME: put description here
*
* $Log: not supported by cvs2svn $
* Revision 1.9 2001/10/19 08:08:50 bradleyb
* conditionalize conf.h
*
* Revision 1.8 2001/10/19 00:31:51 bradleyb
* Trying to get network working on win32
*
@ -75,7 +78,9 @@ char copyright[] = "DESCENT II COPYRIGHT (C) 1994-1996 PARALLAX SOFTWARE CORPOR
#include "text.h"
#include "ipx.h"
#include "newdemo.h"
#ifdef NETWORK
#include "network.h"
#endif
#include "modem.h"
#include "gamefont.h"
#include "kconfig.h"
@ -102,9 +107,10 @@ extern int Current_display_mode; //$$ there's got to be a better way than
#endif
#ifdef EDITOR
#include "editor\editor.h"
#include "editor\kdefs.h"
#include "editor/editor.h"
#include "editor/kdefs.h"
#include "ui.h"
#include "d_io.h"
#endif
#ifdef SDL_INPUT
@ -192,8 +198,8 @@ void print_commandline_help()
}
}
// if (line[0] == ';')
// continue; //don't show comments
if (line[0] == ';')
continue; //don't show comments
printf("%s",line);
@ -508,7 +514,7 @@ int main(int argc,char **argv)
#ifdef EDITOR
if (!Inferno_is_800x600_available) {
con_printf(CON_NORMAL "The editor will not be available, press any key to start game...\n" );
con_printf(CON_NORMAL, "The editor will not be available, press any key to start game...\n" );
Function_mode = FMODE_MENU;
}
#endif
@ -763,7 +769,7 @@ int main(int argc,char **argv)
ubyte *buf;
ifile = fopen(sounds[i],"rb");
Assert(ifile != NULL);
size = filelength(ifile->_handle);
size = ffilelength(ifile);
buf = d_malloc(size);
fread(buf,1,size,ifile);
fwrite(&size,sizeof(size),1,ofile);
@ -799,7 +805,7 @@ int main(int argc,char **argv)
// to write certain data.
#ifdef EDITOR
{ int t;
if ( t = FindArg( "-autoload" ) ) {
if ( (t = FindArg( "-autoload" )) ) {
Auto_exit = 1;
strcpy(Auto_file, Args[t+1]);
}
@ -838,7 +844,7 @@ int main(int argc,char **argv)
} else {
#ifdef EDITOR
if (Auto_exit) {
strcpy(&Level_names[0], Auto_file);
strcpy((char *)&Level_names[0], Auto_file);
LoadLevel(1, 1);
Function_mode = FMODE_EXIT;
break;
@ -884,7 +890,9 @@ int main(int argc,char **argv)
case FMODE_EDITOR:
keyd_editor_mode = 1;
editor();
#ifdef __WATCOMC__
_harderr( (void*)descent_critical_error_handler ); // Reinstall game error handler
#endif
if ( Function_mode == FMODE_GAME ) {
Game_mode = GM_EDITOR;
editor_reset_stuff_on_level();

View file

@ -37,6 +37,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
** Constants
**/
// How close two points must be in all dimensions to be considered the same point.
#define FIX_EPSILON 10
//the maximum length of a filename
#define FILENAME_LEN 13

View file

@ -16,7 +16,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#ifdef RCS
static char rcsid[] = "$Id: piggy.c,v 1.4 2001-01-31 15:17:57 bradleyb Exp $";
static char rcsid[] = "$Id: piggy.c,v 1.5 2001-10-25 02:19:31 bradleyb Exp $";
#endif
@ -160,7 +160,12 @@ ubyte BigPig = 0;
extern int ConvertCToPStr(char* inCStr, StringPtr outPStrBuf);
#endif
int piggy_is_substitutable_bitmap( char * name, char * subst_name );
#ifdef EDITOR
void piggy_write_pigfile(char *filename);
static void write_int(int i,FILE *file);
void swap_0_255(grs_bitmap *bmp)
{
int i;
@ -1412,7 +1417,7 @@ void piggy_write_pigfile(char *filename)
pig_fp = fopen( filename, "wb" ); //open PIG file
Assert( pig_fp!=NULL );
write_int(PIGFILE_ID,pig_fp);
write_int((int)PIGFILE_ID,pig_fp);
write_int(PIGFILE_VERSION,pig_fp);
Num_bitmap_files--;
@ -1518,9 +1523,9 @@ void piggy_dump_all()
{
int i, xlat_offset;
FILE * ham_fp;
int org_offset,data_offset;
int org_offset,data_offset=0;
DiskSoundHeader sndh;
int sound_data_start;
int sound_data_start=0;
FILE *fp1,*fp2;
#ifdef NO_DUMP_SOUNDS
@ -1541,7 +1546,7 @@ void piggy_dump_all()
ham_fp = fopen( DEFAULT_HAMFILE, "wb" ); //open HAM file
Assert( ham_fp!=NULL );
write_int(HAMFILE_ID,ham_fp);
write_int((int)HAMFILE_ID,ham_fp);
write_int(HAMFILE_VERSION,ham_fp);
bm_write_all(ham_fp);
@ -1571,7 +1576,7 @@ void piggy_dump_all()
ham_fp = fopen( DEFAULT_SNDFILE, "wb" );
Assert( ham_fp!=NULL );
write_int(SNDFILE_ID,ham_fp);
write_int((int)SNDFILE_ID,ham_fp);
write_int(SNDFILE_VERSION,ham_fp);
fwrite( &Num_sound_files, sizeof(int), 1, ham_fp );

View file

@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
/*
* $Source: /cvs/cvsroot/d2x/main/render.c,v $
* $Revision: 1.6 $
* $Revision: 1.7 $
* $Author: bradleyb $
* $Date: 2001-10-18 00:01:01 $
* $Date: 2001-10-25 02:19:31 $
*
* FIXME: put description here
*
* $Log: not supported by cvs2svn $
* Revision 1.6 2001/10/18 00:01:01 bradleyb
* RCS headers added/changed
*
*
*/
@ -68,7 +71,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#define INITIAL_LOCAL_LIGHT (F1_0/4) // local light value in segment of occurence (of light emission)
#ifdef EDITOR
#include "editor\editor.h"
#include "editor/editor.h"
#endif
#if defined(POLY_ACC)
@ -681,7 +684,7 @@ extern ubyte DemoDoingRight,DemoDoingLeft;
void do_render_object(int objnum, int window_num)
{
#ifdef EDITOR
int save_3d_outline;
int save_3d_outline=0;
#endif
object *obj = &Objects[objnum];
int count = 0;