diff --git a/d1x-rebirth/2d/scale.c b/d1x-rebirth/2d/scale.c deleted file mode 100644 index dfc71a881..000000000 --- a/d1x-rebirth/2d/scale.c +++ /dev/null @@ -1,407 +0,0 @@ -/* -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-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * - * Routines for scaling a bitmap. - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include "fix.h" -#include "gr.h" -#include "dxxerror.h" -#include "rle.h" - -#if 0 -#define TRANSPARENCY_COLOR 255; -#endif - -static int Transparency_color = TRANSPARENCY_COLOR; - -void rls_stretch_scanline( char * source, char * dest, int XDelta, int YDelta ); -void rls_stretch_scanline_setup( int XDelta, int YDelta ); -void scale_bitmap_asm(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ); -void scale_bitmap_asm_rle(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ); -void scale_bitmap_cc_asm(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ); -void scale_bitmap_cc_asm_rle(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ); - -void scale_row_c( ubyte * sbits, ubyte * dbits, int width, fix u, fix du ) -{ - int i; - ubyte c; - - for ( i=0; icv_bitmap; - fix x0, y0, x1, y1; - fix u0, v0, u1, v1; - fix clipped_x0, clipped_y0, clipped_x1, clipped_y1; - fix clipped_u0, clipped_v0, clipped_u1, clipped_v1; - fix xmin, xmax, ymin, ymax; - int dx0, dy0, dx1, dy1; - int dtemp; - // Set initial variables.... - - x0 = vertbuf[0].x; y0 = vertbuf[0].y; - x1 = vertbuf[2].x; y1 = vertbuf[2].y; - - xmin = 0; ymin = 0; - xmax = i2f(dbp->bm_w)-fl2f(.5); ymax = i2f(dbp->bm_h)-fl2f(.5); - - u0 = i2f(0); v0 = i2f(0); - u1 = i2f(bp->bm_w-1); v1 = i2f(bp->bm_h-1); - - // Check for obviously offscreen bitmaps... - if ( (y1<=y0) || (x1<=x0) ) return; - if ( (x1<0 ) || (x0>=xmax) ) return; - if ( (y1<0 ) || (y0>=ymax) ) return; - - clipped_u0 = u0; clipped_v0 = v0; - clipped_u1 = u1; clipped_v1 = v1; - - clipped_x0 = x0; clipped_y0 = y0; - clipped_x1 = x1; clipped_y1 = y1; - - // Clip the left, moving u0 right as necessary - if ( x0 < xmin ) { - clipped_u0 = FIND_SCALED_NUM(xmin,x0,x1,u0,u1); - clipped_x0 = xmin; - } - - // Clip the right, moving u1 left as necessary - if ( x1 > xmax ) { - clipped_u1 = FIND_SCALED_NUM(xmax,x0,x1,u0,u1); - clipped_x1 = xmax; - } - - // Clip the top, moving v0 down as necessary - if ( y0 < ymin ) { - clipped_v0 = FIND_SCALED_NUM(ymin,y0,y1,v0,v1); - clipped_y0 = ymin; - } - - // Clip the bottom, moving v1 up as necessary - if ( y1 > ymax ) { - clipped_v1 = FIND_SCALED_NUM(ymax,y0,y1,v0,v1); - clipped_y1 = ymax; - } - - dx0 = f2i(clipped_x0); dx1 = f2i(clipped_x1); - dy0 = f2i(clipped_y0); dy1 = f2i(clipped_y1); - - if (dx1<=dx0) return; - if (dy1<=dy0) return; - - Assert( dx0>=0 ); - Assert( dy0>=0 ); - Assert( dx1bm_w ); - Assert( dy1bm_h ); - Assert( f2i(u0)<=f2i(u1) ); - Assert( f2i(v0)<=f2i(v1) ); - Assert( f2i(u0)>=0 ); - Assert( f2i(v0)>=0 ); - Assert( u1bm_w) ); - Assert( v1bm_h) ); - - dtemp = f2i(clipped_u1)-f2i(clipped_u0); - - if ( bp->bm_flags & BM_FLAG_RLE ) { - if ( (dtemp < (f2i(clipped_x1)-f2i(clipped_x0))) && (dtemp>0) ) - scale_bitmap_cc_asm_rle(bp, dbp, dx0, dy0, dx1, dy1, clipped_u0, clipped_v0, clipped_u1, clipped_v1 ); - else - scale_bitmap_asm_rle(bp, dbp, dx0, dy0, dx1, dy1, clipped_u0, clipped_v0, clipped_u1, clipped_v1 ); - } else { - if ( (dtemp < (f2i(clipped_x1)-f2i(clipped_x0))) && (dtemp>0) ) - scale_bitmap_cc_asm(bp, dbp, dx0, dy0, dx1, dy1, clipped_u0, clipped_v0, clipped_u1, clipped_v1 ); - else - scale_bitmap_asm(bp, dbp, dx0, dy0, dx1, dy1, clipped_u0, clipped_v0, clipped_u1, clipped_v1 ); - } -} - - -void scale_bitmap_c(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ) -{ - fix u, v, du, dv; - int x, y; - ubyte * sbits, * dbits; - - du = (u1-u0) / (x1-x0); - dv = (v1-v0) / (y1-y0); - - v = v0; - - for (y=y0; y<=y1; y++ ) { - sbits = &source_bmp->bm_data[source_bmp->bm_rowsize*f2i(v)]; - dbits = &dest_bmp->bm_data[dest_bmp->bm_rowsize*y+x0]; - u = u0; - v += dv; - for (x=x0; x<=x1; x++ ) { - *dbits++ = sbits[ u >> 16 ]; - u += du; - } - } -} - -void scale_bitmap_asm(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ) -{ - fix du, dv, v; - int y; - - du = (u1-u0) / (x1-x0); - dv = (v1-v0) / (y1-y0); - - v = v0; - - for (y=y0; y<=y1; y++ ) { - scale_row_asm_transparent( &source_bmp->bm_data[source_bmp->bm_rowsize*f2i(v)], &dest_bmp->bm_data[dest_bmp->bm_rowsize*y+x0], x1-x0+1, u0, du ); - v += dv; - } -} - -ubyte scale_rle_data[640]; - -void decode_row( grs_bitmap * bmp, int y ) -{ - int i, offset=4+bmp->bm_h; - - for (i=0; ibm_data[4+i]; - gr_rle_decode( &bmp->bm_data[offset], scale_rle_data ); -} - -void scale_bitmap_asm_rle(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ) -{ - fix du, dv, v; - int y, last_row=-1; - - du = (u1-u0) / (x1-x0); - dv = (v1-v0) / (y1-y0); - - v = v0; - - for (y=y0; y<=y1; y++ ) { - if ( f2i(v) != last_row ) { - last_row = f2i(v); - decode_row( source_bmp, last_row ); - } - scale_row_asm_transparent( scale_rle_data, &dest_bmp->bm_data[dest_bmp->bm_rowsize*y+x0], x1-x0+1, u0, du ); - v += dv; - } -} - - -void scale_bitmap_cc_asm(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ) -{ - fix dv, v; - int y; - - dv = (v1-v0) / (y1-y0); - - rls_stretch_scanline_setup( (int)(x1-x0), f2i(u1)-f2i(u0) ); - if ( scale_ydelta_minus_1 < 1 ) return; - rls_do_cc_setup_asm(); - - v = v0; - - for (y=y0; y<=y1; y++ ) { - scale_source_ptr = &source_bmp->bm_data[source_bmp->bm_rowsize*f2i(v)+f2i(u0)]; - scale_dest_ptr = &dest_bmp->bm_data[dest_bmp->bm_rowsize*y+x0]; - scale_do_cc_scanline(); - v += dv; - } -} - -void scale_bitmap_cc_asm_rle(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 ) -{ - fix dv, v; - int y, last_row = -1; - - dv = (v1-v0) / (y1-y0); - - rls_stretch_scanline_setup( (int)(x1-x0), f2i(u1)-f2i(u0) ); - if ( scale_ydelta_minus_1 < 1 ) return; - rls_do_cc_setup_asm(); - - v = v0; - - for (y=y0; y<=y1; y++ ) { - if ( f2i(v) != last_row ) { - last_row = f2i(v); - decode_row( source_bmp, last_row ); - } - //scale_source_ptr = &source_bmp->bm_data[source_bmp->bm_rowsize*f2i(v)+f2i(u0)]; - scale_source_ptr = &scale_rle_data[f2i(u0)]; - scale_dest_ptr = &dest_bmp->bm_data[dest_bmp->bm_rowsize*y+x0]; - scale_do_cc_scanline(); - v += dv; - } -} - - - -// Run-length slice bitmap scan line stretcher - -void DrawHorizontalRun(char *ScreenPtr, int RunLength, int Color) -{ - int i; - - for (i=0; i 0) - { - RunLength++; - ErrorTerm -= AdjDown; /* reset the error term */ - } - /* Draw this scan line's run */ - - //if ( *source != Transparency_color ) - rep_stosb(dest, RunLength, *source ); - dest += RunLength; - source++; - - } - - /* Draw the final run of pixels */ - //if ( *source != Transparency_color ) - rep_stosb(dest, FinalPixelCount, *source ); - - return; -} - - - - -void rls_stretch_scanline_setup( int XDelta, int YDelta ) -{ - scale_trans_color = Transparency_color & 0xFF; - scale_ydelta_minus_1 = YDelta - 1; - - /* X major line */ - /* Minimum # of pixels in a run in this line */ - scale_whole_step = XDelta / YDelta; - - /* Error term adjust each time Y steps by 1; used to tell when one - extra pixel should be drawn as part of a run, to account for - fractional steps along the X axis per 1-pixel steps along Y */ - scale_adj_up = (XDelta % YDelta) * 2; - - /* Error term adjust when the error term turns over, used to factor - out the X step made at that time */ - scale_adj_down = YDelta * 2; - - /* Initial error term; reflects an initial step of 0.5 along the Y - axis */ - scale_error_term = (XDelta % YDelta) - (YDelta * 2); - - /* The initial and last runs are partial, because Y advances only 0.5 - for these runs, rather than 1. Divide one full run, plus the - initial pixel, between the initial and last runs */ - scale_initial_pixel_count = (scale_whole_step / 2) + 1; - scale_final_pixel_count = scale_initial_pixel_count; - - /* If the basic run length is even and there's no fractional - advance, we have one pixel that could go to either the initial - or last partial run, which we'll arbitrarily allocate to the - last run */ - if ((scale_adj_up == 0) && ((scale_whole_step & 0x01) == 0)) - { - scale_initial_pixel_count--; - } - /* If there're an odd number of pixels per run, we have 1 pixel that can't - be allocated to either the initial or last partial run, so we'll add 0.5 - to error term so this pixel will be handled by the normal full-run loop */ - if ((scale_whole_step & 0x01) != 0) - { - scale_error_term += YDelta; - } - -} - diff --git a/d1x-rebirth/arch/ogl/ogl.c b/d1x-rebirth/arch/ogl/ogl.c index a895d0acf..07f1e0126 100644 --- a/d1x-rebirth/arch/ogl/ogl.c +++ b/d1x-rebirth/arch/ogl/ogl.c @@ -449,7 +449,7 @@ void ogl_cache_level_textures(void) ogl_cache_polymodel_textures(Player_ship->model_num); ogl_cache_vclipn_textures(Player_ship->expl_vclip_num); - for (i=0;i>", find_next_hostage_sound );i += 29; - ui_add_gadget_button( MainWindow,155,i,70, 26, "<< Face", SelectPrevFace ); - ui_add_gadget_button( MainWindow,155+70,i,70, 26, "Face >>", SelectNextFace );i += 29; - ui_add_gadget_button( MainWindow,155,i,140, 26, "Play sound", PlayHostageSound );i += 29; ui_add_gadget_button( MainWindow,155,i,140, 26, "Next Hostage", SelectNextHostage ); i += 29; ui_add_gadget_button( MainWindow,155,i,140, 26, "Prev Hostage", SelectPrevHostage ); i += 29; ui_add_gadget_button( MainWindow,155,i,140, 26, "Compress All", CompressHostages ); i += 29; diff --git a/d1x-rebirth/editor/info.c b/d1x-rebirth/editor/info.c index 3d634792b..5010977f0 100644 --- a/d1x-rebirth/editor/info.c +++ b/d1x-rebirth/editor/info.c @@ -21,7 +21,6 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include #ifdef DO_MEMINFO -#include #include #endif diff --git a/d1x-rebirth/editor/macro.c b/d1x-rebirth/editor/macro.c deleted file mode 100644 index 9e4a8117e..000000000 --- a/d1x-rebirth/editor/macro.c +++ /dev/null @@ -1,182 +0,0 @@ -/* -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-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ - -/* - * - * Routines for recording/playing/saving macros - * - */ - -#include -#include -#include -#include -#include -#include "inferno.h" -#include "segment.h" -#include "editor.h" -#include "gr.h" -#include "ui.h" -#include "key.h" -#include "fix.h" -#include "3d.h" -#include "mouse.h" -#include "bm.h" -#include "dxxerror.h" -#include "medlisp.h" -#include "kdefs.h" -#include "u_mem.h" - -#define MAX_NUM_EVENTS 10000 - -UI_EVENT * RecordBuffer; - -int MacroNumEvents = 0; -int MacroStatus = 0; - -static char filename[PATH_MAX] = "*.MIN"; - -int MacroRecordAll() -{ - if ( MacroStatus== UI_STATUS_NORMAL ) - { - if (RecordBuffer) d_free( RecordBuffer ); - MALLOC( RecordBuffer, UI_EVENT, MAX_NUM_EVENTS ); - ui_record_events( MAX_NUM_EVENTS, RecordBuffer, UI_RECORD_MOUSE | UI_RECORD_KEYS ); - MacroStatus = UI_STATUS_RECORDING; - } - return 1; -} - -int MacroRecordKeys() -{ - if ( MacroStatus== UI_STATUS_NORMAL ) - { - if (RecordBuffer) d_free( RecordBuffer ); - MALLOC( RecordBuffer, UI_EVENT, MAX_NUM_EVENTS ); - ui_record_events( MAX_NUM_EVENTS, RecordBuffer, UI_RECORD_KEYS ); - MacroStatus = UI_STATUS_RECORDING; - } - return 1; -} - -int MacroPlayNormal() -{ - if (MacroStatus== UI_STATUS_NORMAL && MacroNumEvents > 0 && RecordBuffer ) - { - ui_set_playback_speed( 1 ); - ui_play_events_realtime(MacroNumEvents, RecordBuffer); - MacroStatus = UI_STATUS_PLAYING; - } - return 1; -} - -int MacroPlayFast() -{ - if (MacroStatus== UI_STATUS_NORMAL && MacroNumEvents > 0 && RecordBuffer ) - { - mouse_toggle_cursor(0); - ui_play_events_fast(MacroNumEvents, RecordBuffer); - MacroStatus = UI_STATUS_FASTPLAY; - } - return 1; -} - -int MacroSave() -{ - - if (MacroNumEvents < 1 ) - { - ui_messagebox( -2, -2, 1, "No macro has been defined to save!", "Oops" ); - return 1; - } - - if (ui_get_filename( filename, "*.MAC", "SAVE MACRO" )) - { - PHYSFS_file *fp = PHYSFS_openWrite(filename); - - if (!fp) return 0; - RecordBuffer[0].type = 7; - RecordBuffer[0].frame = 0; - RecordBuffer[0].data = MacroNumEvents; - PHYSFS_write(fp, RecordBuffer, sizeof(UI_EVENT), MacroNumEvents); - PHYSFS_close(fp); - } - return 1; -} - -int MacroLoad() -{ - if (ui_get_filename( filename, "*.MAC", "LOAD MACRO" )) - { - PHYSFS_file *fp = PHYSFS_openRead(filename); - int length; - - if (!fp) - return 0; - if (RecordBuffer) - d_free( RecordBuffer ); - length = PHYSFS_fileLength(fp); - RecordBuffer = d_malloc(length); - if (!RecordBuffer) - return 0; - - PHYSFS_read(fp, RecordBuffer, length, 1); - PHYSFS_close(fp); - MacroNumEvents = RecordBuffer[0].data; - } - return 1; -} - -void macro_free_buffer() -{ - if ( RecordBuffer ) - d_free(RecordBuffer); -} - -int MacroMenu() -{ - int x; - char * MenuItems[] = { "Play fast", - "Play normal", - "Record all", - "Record keys", - "Save macro", - "Load macro" }; - - x = MenuX( -1, -1, 6, MenuItems ); - - switch( x ) - { - case 1: - MacroPlayFast(); - break; - case 2: - MacroPlayNormal(); - break; - case 3: - MacroRecordAll(); - break; - case 4: - MacroRecordKeys(); - break; - case 5: // Save - MacroSave(); - break; - case 6: // Load - MacroLoad(); - break; - } - return 1; -} - diff --git a/d1x-rebirth/include/checker.h b/d1x-rebirth/include/checker.h deleted file mode 100644 index e97e41b5e..000000000 --- a/d1x-rebirth/include/checker.h +++ /dev/null @@ -1,34 +0,0 @@ -//checker.h added 05/17/99 Matt Mueller -//FD_* on linux use asm, but checker doesn't like it. Borrowed these non-asm versions outta -#include - -#ifdef __CHECKER__ - -#undef FD_ZERO(set) -#undef FD_SET(d, set) -#undef FD_CLR(d, set) -#undef FD_ISSET(d, set) - -# define FD_ZERO(set) \ - do { \ - unsigned int __i; \ - for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \ - ((__fd_mask *) set)[__i] = 0; \ - } while (0) -# define FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -# define FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -# define FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) - -//checker doesn't seem to handle jmp's correctly... -#undef setjmp(env) -#define setjmp(env) __chcksetjmp(env) -#undef longjmp(env,val) -#define longjmp(env,val) __chcklongjmp(env,val) - -int __chcklongjmp(jmp_buf buf,int val); -int __chcksetjmp(jmp_buf buf); - -void chcksetwritable(char * p, int size); -void chcksetunwritable(char * p, int size); - -#endif diff --git a/d1x-rebirth/include/d1x.xpm b/d1x-rebirth/include/d1x.xpm deleted file mode 100755 index ca4b262c1..000000000 --- a/d1x-rebirth/include/d1x.xpm +++ /dev/null @@ -1,41 +0,0 @@ -/* XPM */ -static char *pixmap[] = { -/* width height ncols cpp */ -"32 32 3 2", - /* Colors */ - "00 c #000000", - "01 c #FF0000", - ".. s None c None", - "................................................................", - "..............01................................01..............", - "..............0101............................0101..............", - "..............010101........................010101..............", - "..............01010101....................01010101..............", - "..............0101010101................0101010101..............", - "..............010101010101............010101010101..............", - "..............01010101010101........01010101010101..............", - "..............0101000101010101......01010101010001..............", - "..............010001010101010101......010101010100..............", - "..............00010101010101010101......010101010100............", - "..............0000010101010101010101......0101010000............", - "............00000000010101010100000001......0100000000..........", - "............0000..0000010101000000000001....0000..0000..........", - "................0000000000000000000000000000000000..............", - "................0000..0000000000000000000000..0000..............", - "..................0100000000000000000000000000..................", - "................0000000000000000000000000000000000..............", - "..............00000101000000000000000000000001010000............", - "............000000000101000000000000000000010100000000..........", - "..........000001000001010101....010101010101010000010000........", - "........0000010101010101010101....010101010101010101010000......", - "....00000101010101010101010101......01010101010101010101010000..", - "....0000..............................010101010101010101010000..", - "........................................010101010101010101......", - "..........................................0101010101010101......", - "............................................01010101010101......", - "..............................................010101010101......", - "................................................0101010101......", - "..................................................01010101......", - "....................................................010101......", - "................................................................", -}; diff --git a/d1x-rebirth/include/descent.xpm b/d1x-rebirth/include/descent.xpm deleted file mode 100755 index e1c5acf23..000000000 --- a/d1x-rebirth/include/descent.xpm +++ /dev/null @@ -1,45 +0,0 @@ -/* XPM */ -static char *pixmap[] = { -/* width height ncols cpp */ -"32 32 7 2", - /* Colors */ - "00 c #000000", - "01 c #800000", - "02 c #C0C0C0", - "03 c #808080", - "04 c #FF0000", - "05 c #FFFFFF", - ".. s None c None", - "................................................................", - "................................................................", - "..........0303..........0301........0304..............03........", - "..........030303........040301....03030304........030303........", - "..........0303030303..0303030304010303030304..0303030303........", - "..........0303030303030303020303000303020303030303030303........", - "..........0303030303030303020303030303030303030303030303........", - "..........0303030303030303020303030303020303030303030303........", - "............0101000303030303030303030303030303010100............", - "..............01010303030303030303030303030303010101............", - "............0301010303030303030303030203030303010103............", - "..........03010101030303030300000003000303030301010103..........", - "........030101010101030300000000000000030303030301010103........", - "........020101010303030300000000000000000303020303010403........", - "......03010101040103030300000000000000000303..040401010103......", - "......010101030402..030300000000000000030303..050503010103......", - "....030101030304....030300030000000000030300..04040303010103....", - "....03010303..00....000303030000000000030302..04040303030103....", - "....030303..........0303030300000000030303..........03030303....", - "....030303..........0303030300000000030303............030303....", - "....0302............030303030303030303030303..........040103....", - "......04............030303030303030303030303............0103....", - "......04............030303030303030303030303............04......", - "....0401............030303030303030303030303............04......", - "....0000............0303030303030303030303..............04......", - "....................0303030303030303030303..............00......", - "......................030303030303030303........................", - "......................030303030303030303........................", - "......................0303030303030303..........................", - "................................................................", - "................................................................", - "................................................................", -}; diff --git a/d1x-rebirth/include/i86.h b/d1x-rebirth/include/i86.h deleted file mode 100644 index 370f7d9da..000000000 --- a/d1x-rebirth/include/i86.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _I86_H -#define _I86_H - -#endif diff --git a/d1x-rebirth/main/endlevel.c b/d1x-rebirth/main/endlevel.c index 9d75fc9ce..b8557186e 100644 --- a/d1x-rebirth/main/endlevel.c +++ b/d1x-rebirth/main/endlevel.c @@ -51,6 +51,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "newdemo.h" #include "multi.h" #include "vclip.h" +#include "render.h" #include "fireball.h" #include "text.h" #include "digi.h" @@ -820,8 +821,6 @@ extern fix Render_zoom; //the player's zoom factor extern vms_vector Viewer_eye; //valid during render -void render_mine(int start_seg_num,fix eye_offset); - void draw_exit_model() { vms_vector model_pos; @@ -1158,6 +1157,10 @@ void do_endlevel_flythrough(int n) //update target point & angles compute_center_point_on_side(&dest_point,pseg,exit_side); + if (pseg->children[exit_side] == -2) + nextcenter = dest_point; + else + compute_segment_center(&nextcenter,&Segments[pseg->children[exit_side]]); //update target point and movement points @@ -1194,7 +1197,6 @@ void do_endlevel_flythrough(int n) vm_vec_scale(&flydata->step,flydata->speed); compute_segment_center(&curcenter,pseg); - compute_segment_center(&nextcenter,&Segments[pseg->children[exit_side]]); vm_vec_sub(&flydata->headvec,&nextcenter,&curcenter); #ifdef COMPACT_SEGS diff --git a/d1x-rebirth/main/mission.c b/d1x-rebirth/main/mission.c index 9b727e80e..3f10f0e8d 100644 --- a/d1x-rebirth/main/mission.c +++ b/d1x-rebirth/main/mission.c @@ -587,7 +587,7 @@ int load_mission(mle *mission) if (!PHYSFSX_exists(Ending_text_filename,1)) snprintf(Ending_text_filename, sizeof(Ending_text_filename), "%s.txb",Current_mission_filename); - while (PHYSFSX_fgets(buf,80,mfile)) { + while (PHYSFSX_fgets(buf,sizeof(buf),mfile)) { if (istok(buf,"type")) continue; //already have name, go to next line else if (istok(buf,"briefing")) { @@ -658,7 +658,7 @@ int load_mission(mle *mission) } for (i=0;i MAX_SEGMENTS_ORIGINAL ) { - for ( i = 0; i <= Highest_segment_index; i++ ) - PHYSFS_write(fp, Automap_visited, sizeof(ubyte), 1); + PHYSFS_write(fp, Automap_visited, sizeof(ubyte), Highest_segment_index + 1); } else PHYSFS_write(fp, Automap_visited, sizeof(ubyte), MAX_SEGMENTS_ORIGINAL); @@ -1362,8 +1361,7 @@ RetryObjectLoading: if ( Highest_segment_index+1 > MAX_SEGMENTS_ORIGINAL ) { memset(&Automap_visited, 0, MAX_SEGMENTS); - for ( i = 0; i <= Highest_segment_index; i++ ) - PHYSFS_read(fp, Automap_visited, sizeof(ubyte), 1); + PHYSFS_read(fp, Automap_visited, sizeof(ubyte), Highest_segment_index + 1); } else PHYSFS_read(fp, Automap_visited, sizeof(ubyte), MAX_SEGMENTS_ORIGINAL); diff --git a/d1x-rebirth/main/terrain.c b/d1x-rebirth/main/terrain.c index adc801eaf..f5448d6e5 100644 --- a/d1x-rebirth/main/terrain.c +++ b/d1x-rebirth/main/terrain.c @@ -29,6 +29,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "u_mem.h" #include "inferno.h" #include "textures.h" +#include "render.h" #include "object.h" #include "endlevel.h" #include "fireball.h" @@ -65,8 +66,6 @@ void build_light_table(); int terrain_outline=0; -void render_mine(int start_seg_num,fix eye_offset); - int org_i,org_j; int mine_tiles_drawn; //flags to tell if all 4 tiles under mine have drawn diff --git a/d1x-rebirth/misc/checker.c b/d1x-rebirth/misc/checker.c deleted file mode 100644 index f823cc608..000000000 --- a/d1x-rebirth/misc/checker.c +++ /dev/null @@ -1,195 +0,0 @@ -//added 05/17/99 Matt Mueller - checker stubs for various functions. - -/* Needed for CHKR_PREFIX. */ -#include -#include "checker_api.h" -#include -#include -#include -#include -#include -#include "gr.h" - -void chcksetwritable(char * p, int size)__asm__(CHKR_PREFIX ("chcksetwritable")); -void chcksetwritable(char * p, int size){ - stubs_chkr_set_right (p,size,CHKR_RW); -} -void chcksetunwritable(char * p, int size)__asm__(CHKR_PREFIX ("chcksetunwritable")); -void chcksetunwritable(char * p, int size){ - stubs_chkr_set_right (p,size,CHKR_RO); -} - -int chkr_stub_glob(const char *pattern, int flags,int errfunc(const char * epath, int eerrno),glob_t *pglob)__asm__ (CHKR_PREFIX ("glob")); -int -chkr_stub_glob(const char *pattern, int flags,int errfunc(const char * epath, int eerrno),glob_t *pglob) -{ - int g; - stubs_chkr_check_str(pattern,CHKR_RO,"pattern"); - stubs_chkr_check_addr(pglob,sizeof(glob_t),CHKR_WO,"pglob"); - g=glob(pattern,flags,errfunc,pglob); - if (g==0){ - int i; - stubs_chkr_set_right (pglob, sizeof(glob_t), CHKR_RW); - stubs_chkr_set_right (pglob->gl_pathv, sizeof(char*) * pglob->gl_pathc, CHKR_RW); - for (i=0;igl_pathc;i++) - stubs_chkr_set_right (pglob->gl_pathv[i], strlen(pglob->gl_pathv[i])+1, CHKR_RW); - - } - return g; -} - -int chkr_stub_SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags)__asm__(CHKR_PREFIX ("SDL_VideoModeOK")); -int chkr_stub_SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags) -{ - return SDL_VideoModeOK(width,height,bpp,flags); -} -SDL_Surface * chkr_stub_SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)__asm__(CHKR_PREFIX ("SDL_SetVideoMode")); -SDL_Surface * chkr_stub_SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) -{ - SDL_Surface * s; - s=SDL_SetVideoMode(width,height,bpp,flags); - stubs_chkr_set_right (s,sizeof(SDL_Surface),CHKR_RO); - stubs_chkr_set_right (s->format,sizeof(SDL_PixelFormat),CHKR_RO); - stubs_chkr_set_right (s->format->palette,256*3,CHKR_RO); -#ifdef TEST_GR_LOCK - stubs_chkr_set_right (s->pixels,s->w*s->h*s->format->BytesPerPixel,CHKR_RO); -#else - stubs_chkr_set_right (s->pixels,s->w*s->h*s->format->BytesPerPixel,CHKR_RW); -#endif - return s; -} -int chkr_stub_SDL_SetColors (SDL_Surface *surface,SDL_Color *colors, int firstcolor, int ncolors)__asm__ (CHKR_PREFIX ("SDL_SetColors")); -int chkr_stub_SDL_SetColors (SDL_Surface *surface,SDL_Color *colors, int firstcolor, int ncolors){ - int i; - - stubs_chkr_check_addr(surface,sizeof(SDL_Surface),CHKR_RO,"surface"); -// for (i=firstcolor;i=b); -} - -int32_t int32_lessthan(int32_t a,int32_t b) -{ - return (a