From 57d2b788b904b93a55e430dd11180511a13a369d Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Tue, 6 Aug 2002 04:53:48 +0000 Subject: [PATCH] merged endlevel stuff to non-shareware, more fast i/o macros, use global Piggy_hamfile_version --- main/bm.c | 55 ++++++++++++++++++++----------------------------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/main/bm.c b/main/bm.c index d66d9159..87690caa 100644 --- a/main/bm.c +++ b/main/bm.c @@ -1,4 +1,4 @@ -/* $Id: bm.c,v 1.13 2002-08-06 01:31:06 btb Exp $ */ +/* $Id: bm.c,v 1.14 2002-08-06 04:53:48 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -8,7 +8,7 @@ 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. +AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ @@ -122,7 +122,6 @@ int tmap_info_read_n(tmap_info *ti, int n, CFILE *fp) //#ifdef MACINTOSH -#ifdef SHAREWARE extern int exit_modelnum,destroyed_exit_modelnum, Num_bitmap_files; int N_ObjBitmaps, extra_bitmap_num; @@ -141,7 +140,7 @@ bitmap_index exitmodel_bm_load_sub( char * filename ) if (iff_error != IFF_NO_ERROR) { Error("Error loading exit model bitmap <%s> - IFF error: %s",filename,iff_errormsg(iff_error)); } - + if ( iff_has_transparency ) gr_remap_bitmap_good( new, newpal, iff_transparent_color, 254 ); else @@ -152,7 +151,7 @@ bitmap_index exitmodel_bm_load_sub( char * filename ) bitmap_num.index = extra_bitmap_num; GameBitmaps[extra_bitmap_num++] = *new; - + d_free( new ); return bitmap_num; } @@ -218,13 +217,12 @@ void load_exit_models() cfclose(exit_hamfile); } -#endif // SHAREWARE //#endif // MACINTOSH //----------------------------------------------------------------- // Read data from piggy. -// This is called when the editor is OUT. +// This is called when the editor is OUT. // If editor is in, bm_init_use_table() is called. int bm_init() { @@ -234,14 +232,12 @@ int bm_init() piggy_read_sounds(); - #ifdef SHAREWARE init_endlevel(); //this is in bm_init_use_tbl(), so I gues it goes here - #endif return 0; } -void bm_read_all(CFILE * fp, int hamfile_version) +void bm_read_all(CFILE * fp) { int i,t; @@ -269,14 +265,13 @@ void bm_read_all(CFILE * fp, int hamfile_version) jointpos_read_n(Robot_joints, N_robot_joints, fp); N_weapon_types = cfile_read_int(fp); - weapon_info_read_n(Weapon_info, N_weapon_types, fp, hamfile_version); + weapon_info_read_n(Weapon_info, N_weapon_types, fp, Piggy_hamfile_version); N_powerup_types = cfile_read_int(fp); powerup_type_info_read_n(Powerup_info, N_powerup_types, fp); N_polygon_models = cfile_read_int(fp); - for (i = 0; i < N_polygon_models; i++) - polymodel_read(&Polygon_models[i], fp); + polymodel_read_n(Polygon_models, N_polygon_models, fp); for (i=0; i= MAX_POLYGON_MODELS) Error("Too many polygon models (%d) in <%s>. Max is %d.",t,fname,MAX_POLYGON_MODELS-N_D2_POLYGON_MODELS); - for (i = N_D2_POLYGON_MODELS; i < t + N_D2_POLYGON_MODELS; i++) - polymodel_read(&Polygon_models[i], fp); + polymodel_read_n(&Polygon_models[N_D2_POLYGON_MODELS], t, fp); for (i=N_D2_POLYGON_MODELS; i= MAX_OBJ_BITMAPS) Error("Too many object bitmaps (%d) in <%s>. Max is %d.",t,fname,MAX_OBJ_BITMAPS-N_D2_OBJBITMAPS); - for (i = N_D2_OBJBITMAPS; i < (N_D2_OBJBITMAPS + t); i++) - bitmap_index_read(&ObjBitmaps[i], fp); + bitmap_index_read_n(&ObjBitmaps[N_D2_OBJBITMAPS], t, fp); t = cfile_read_int(fp); if (N_D2_OBJBITMAPPTRS+t >= MAX_OBJ_BITMAPS) -- 2.39.2