Merge branch 'd1x-rebirth' into unification/master

This commit is contained in:
Kp 2013-03-10 03:34:54 +00:00
commit 687b6284e6
18 changed files with 16 additions and 944 deletions

View file

@ -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 <conf.h>
#endif
#include <math.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#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; i<width; i++ ) {
c = sbits[ f2i(u) ];
if ( c != Transparency_color )
*dbits = c;
dbits++;
u += du;
}
}
#define FIND_SCALED_NUM(x,x0,x1,y0,y1) (fixmuldiv((x)-(x0),(y1)-(y0),(x1)-(x0))+(y0))
// Scales bitmap, bp, into vertbuf[0] to vertbuf[1]
void scale_bitmap(grs_bitmap *bp, grs_point *vertbuf ,int orientation)
{
grs_bitmap * dbp = &grd_curcanv->cv_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( dx1<dbp->bm_w );
Assert( dy1<dbp->bm_h );
Assert( f2i(u0)<=f2i(u1) );
Assert( f2i(v0)<=f2i(v1) );
Assert( f2i(u0)>=0 );
Assert( f2i(v0)>=0 );
Assert( u1<i2f(bp->bm_w) );
Assert( v1<i2f(bp->bm_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; i<y; i++ )
offset += bmp->bm_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<RunLength; i++)
*ScreenPtr++ = Color;
}
void rls_stretch_scanline( char * source, char * dest, int XDelta, int YDelta )
{
int AdjUp, AdjDown, ErrorTerm;
int WholeStep, InitialPixelCount, FinalPixelCount, i, RunLength;
/* X major line */
/* Minimum # of pixels in a run in this line */
WholeStep = 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 */
AdjUp = (XDelta % YDelta) * 2;
/* Error term adjust when the error term turns over, used to factor
out the X step made at that time */
AdjDown = YDelta * 2;
/* Initial error term; reflects an initial step of 0.5 along the Y
axis */
ErrorTerm = (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 */
InitialPixelCount = (WholeStep / 2) + 1;
FinalPixelCount = InitialPixelCount;
/* 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 ((AdjUp == 0) && ((WholeStep & 0x01) == 0))
{
InitialPixelCount--;
}
/* 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 ((WholeStep & 0x01) != 0)
{
ErrorTerm += YDelta;
}
/* Draw the first, partial run of pixels */
//if ( *source != Transparency_color )
rep_stosb(dest, InitialPixelCount, *source );
dest += InitialPixelCount;
source++;
/* Draw all full runs */
for (i=0; i<(YDelta-1); i++)
{
RunLength = WholeStep; /* run is at least this long */
/* Advance the error term and add an extra pixel if the error term so indicates */
if ((ErrorTerm += AdjUp) > 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;
}
}

View file

@ -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<Highest_object_index;i++){
for (i=0;i<=Highest_object_index;i++){
if(Objects[i].render_type==RT_POWERUP){
ogl_cache_vclipn_textures(Objects[i].rtype.vclip_info.vclip_num);
switch (Objects[i].id){

View file

@ -318,9 +318,6 @@ int do_hostage_dialog()
//@@ ui_add_gadget_button( MainWindow,155,i,70, 26, "<< Sound", find_prev_hostage_sound );
//@@ ui_add_gadget_button( MainWindow,155+70,i,70, 26, "Sound >>", 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;

View file

@ -21,7 +21,6 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include <stdlib.h>
#include <string.h>
#ifdef DO_MEMINFO
#include <i86.h>
#include <malloc.h>
#endif

View file

@ -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 <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include <string.h>
#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;
}

View file

@ -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 <selectbits.h>
#include <setjmp.h>
#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

View file

@ -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......",
"................................................................",
};

View file

@ -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..........................",
"................................................................",
"................................................................",
"................................................................",
};

View file

@ -1,4 +0,0 @@
#ifndef _I86_H
#define _I86_H
#endif

View file

@ -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

View file

@ -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<n_levels;i++) {
PHYSFSX_fgets(buf,80,mfile);
PHYSFSX_fgets(buf,sizeof(buf),mfile);
add_term(buf);
if (strlen(buf) <= 12) {
strcpy(Level_names[i],buf);
@ -696,7 +696,7 @@ int load_mission(mle *mission)
for (i=0;i<N_secret_levels;i++) {
char *t;
PHYSFSX_fgets(buf,80,mfile);
PHYSFSX_fgets(buf,sizeof(buf),mfile);
if ((t=strchr(buf,','))!=NULL) *t++=0;
else
break;

View file

@ -74,8 +74,6 @@ int Max_linear_depth_objects = 20;
int Simple_model_threshhold_scale = 50; // switch to simpler model when the object has depth greater than this value times its radius.
int Max_debris_objects = 15; // How many debris objects to create
void render_mine(int start_seg_num,fix eye_offset);
//used for checking if points have been rotated
int Clear_window_color=-1;
int Clear_window=2; // 1 = Clear whole background window, 2 = clear view portals into rest of world, 0 = no clear
@ -872,7 +870,7 @@ int matt_find_connect_side(int seg0,int seg1);
char visited2[MAX_SEGMENTS];
#endif
char visited[MAX_SEGMENTS];
unsigned char visited[MAX_SEGMENTS];
short Render_list[MAX_RENDER_SEGS];
short Seg_depth[MAX_RENDER_SEGS]; //depth for each seg in Render_list
ubyte processed[MAX_RENDER_SEGS]; //whether each entry has been processed

View file

@ -72,7 +72,7 @@ extern fix Render_zoom; // the player's zoom factor
// This is used internally to render_frame(), but is included here so AI
// can use it for its own purposes.
extern char visited[MAX_SEGMENTS];
extern unsigned char visited[MAX_SEGMENTS];
extern int N_render_segs;
extern short Render_list[MAX_RENDER_SEGS];
@ -94,6 +94,7 @@ g3s_codes rotate_list(int nv, int *pointnumlist);
//Given a lit of point numbers, project any that haven't been projected
void project_list(int nv, int *pointnumlist);
void render_mine(int start_seg_num,fix eye_offset);
#endif

View file

@ -112,7 +112,7 @@ void songs_init()
{
while (!PHYSFS_eof(fp))
{
PHYSFSX_fgets(inputline, 80, fp );
PHYSFSX_fgets(inputline, sizeof(inputline), fp );
if ( strlen( inputline ) )
{
BIMSongs = d_realloc(BIMSongs, sizeof(bim_song_info)*(i+1));

View file

@ -1019,8 +1019,7 @@ int state_save_all_sub(char *filename, char *desc)
// Save the automap visited info
if ( Highest_segment_index+1 > 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);

View file

@ -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

View file

@ -1,195 +0,0 @@
//added 05/17/99 Matt Mueller - checker stubs for various functions.
/* Needed for CHKR_PREFIX. */
#include <SDL/SDL.h>
#include "checker_api.h"
#include <setjmp.h>
#include <glob.h>
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#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;i<pglob->gl_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<ncolors;i++){
// stubs_chkr_check_addr(colors,sizeof(Uint8)*3,CHKR_RO,"colors");
// }
i=SDL_SetColors (surface,colors,firstcolor,ncolors);
return i;
}
void chkr_stub_SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)__asm__ (CHKR_PREFIX ("SDL_UpdateRect"));
void chkr_stub_SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h){
stubs_chkr_check_addr(screen,sizeof(SDL_Surface),CHKR_RO,"screen");
SDL_UpdateRect(screen,x,y,w,h);
}
void chkr_stub_SDL_WM_SetCaption (const char *title, const char *icon)__asm__ (CHKR_PREFIX ("SDL_WM_SetCaption"));
void chkr_stub_SDL_WM_SetCaption (const char *title, const char *icon){
stubs_chkr_check_str(title,CHKR_RO,"title");
if (icon)
stubs_chkr_check_str(icon,CHKR_RO,"icon");
SDL_WM_SetCaption(title,icon);
}
void chkr_stub_SDL_PauseAudio (int pause_on)__asm__ (CHKR_PREFIX ("SDL_PauseAudio"));
void chkr_stub_SDL_PauseAudio (int pause_on){
SDL_PauseAudio(pause_on);
}
void chkr_stub_SDL_CloseAudio (void)__asm__ (CHKR_PREFIX ("SDL_CloseAudio"));
void chkr_stub_SDL_CloseAudio (void){
SDL_CloseAudio();
}
int chkr_stub_SDL_OpenAudio (SDL_AudioSpec *desired, SDL_AudioSpec *obtained)__asm__ (CHKR_PREFIX ("SDL_OpenAudio"));
int chkr_stub_SDL_OpenAudio (SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
{
int i;
stubs_chkr_check_addr(desired,sizeof(SDL_AudioSpec),CHKR_RO,"desired");
i=SDL_OpenAudio(desired,obtained);
if (i && obtained){
stubs_chkr_set_right (obtained,sizeof(SDL_AudioSpec),CHKR_RO);
}
return i;
}
#define CD_Stub(name) int chkr_stub_SDL_CD ## name (SDL_CD *cdrom)__asm__ (CHKR_PREFIX ("SDL_CD" ## #name));\
int chkr_stub_SDL_CD ## name (SDL_CD *cdrom){\
return SDL_CD ## name(cdrom);\
}
CD_Stub(Stop);
CD_Stub(Pause);
CD_Stub(Resume);
CDstatus chkr_stub_SDL_CDStatus(SDL_CD *cdrom)__asm__ (CHKR_PREFIX ("SDL_CDStatus"));
CDstatus chkr_stub_SDL_CDStatus(SDL_CD *cdrom){
return SDL_CDStatus(cdrom);
}
SDL_CD * chkr_stub_SDL_CDOpen (int drive)__asm__ (CHKR_PREFIX ("SDL_CDOpen"));
SDL_CD * chkr_stub_SDL_CDOpen (int drive){
SDL_CD *c;
c=SDL_CDOpen(drive);
if (c)
stubs_chkr_set_right(c,sizeof(SDL_CD),CHKR_RO);
return c;
}
int chkr_stub_SDL_CDPlayTracks (SDL_CD *cdrom,int start_track, int start_frame, int ntracks, int nframes)__asm__ (CHKR_PREFIX ("SDL_CDPlayTracks"));
int chkr_stub_SDL_CDPlayTracks (SDL_CD *cdrom,int start_track, int start_frame, int ntracks, int nframes){
return SDL_CDPlayTracks(cdrom,start_track,start_frame,ntracks,nframes);
}
int chkr_stub_SDL_PollEvent (SDL_Event *event)__asm__ (CHKR_PREFIX ("SDL_PollEvent"));
int chkr_stub_SDL_PollEvent (SDL_Event *event){
int i;
i=SDL_PollEvent(event);
if(i && event){
stubs_chkr_set_right(event,sizeof(SDL_Event),CHKR_RO);
}
return i;
}
void chkr_stub_SDL_ShowCursor (int tog)__asm__ (CHKR_PREFIX ("SDL_ShowCursor"));
void chkr_stub_SDL_ShowCursor (int tog){
SDL_ShowCursor(tog);
}
Uint32 chkr_stub_SDL_GetTicks (void)__asm__ (CHKR_PREFIX ("SDL_GetTicks"));
Uint32 chkr_stub_SDL_GetTicks (void){
return SDL_GetTicks();
}
char * chkr_stub_SDL_GetError (void)__asm__ (CHKR_PREFIX ("SDL_GetError"));
char * chkr_stub_SDL_GetError (void){
char * t=SDL_GetError();
stubs_chkr_set_right(t,strlen(t)+1,CHKR_RO);
return t;
}
void chkr_stub_SDL_Quit(void)__asm__ (CHKR_PREFIX ("SDL_Quit"));
void chkr_stub_SDL_Quit(void){
SDL_Quit();
}
int chkr_stub_SDL_Init(Uint32 flags)__asm__ (CHKR_PREFIX ("SDL_Init"));
int chkr_stub_SDL_Init(Uint32 flags){
return SDL_Init(flags);
}
int chkr_stub_tcflush(int fd, int queue_selector)__asm__ (CHKR_PREFIX ("tcflush"));
int chkr_stub_tcflush(int fd, int queue_selector){
fd_used_by_prog(fd);
return tcflush(fd,queue_selector);
}
int chkr_stub_longjmp(jmp_buf buf,int val)__asm__ (CHKR_PREFIX ("__chcklongjmp"));
int
chkr_stub_longjmp(jmp_buf buf,int val)
{
// stubs_chkr_check_addr(buf,sizeof(jmp_buf),CHKR_WO,"jmp_buf");
//return __siglongjmp(buf,val);
longjmp(buf,val);
}
int chkr_stub_setjmp(jmp_buf buf)__asm__ (CHKR_PREFIX ("__chcksetjmp"));
int
chkr_stub_setjmp(jmp_buf buf)
{
// stubs_chkr_check_addr(buf,sizeof(jmp_buf),CHKR_WO,"jmp_buf");
return setjmp(buf);
}
int chkr_stub_sigsetjmp(jmp_buf buf,int save)__asm__ (CHKR_PREFIX ("__chcksigsetjmp"));
int
chkr_stub_sigsetjmp(jmp_buf buf,int save)
{
// stubs_chkr_check_addr(buf,sizeof(jmp_buf),CHKR_WO,"jmp_buf");
//return __sigsetjmp(buf,save);
return sigsetjmp(buf,save);
}

View file

@ -1,14 +0,0 @@
//added 03/05/99 Matt Mueller - comparison functions.. used in checking
//versions without need to duplicate a function or have kludgy code
#include "compare.h"
int32_t int32_greaterorequal(int32_t a,int32_t b)
{
return (a>=b);
}
int32_t int32_lessthan(int32_t a,int32_t b)
{
return (a<b);
}