From 443a384e79ed519743481eec0e4f09294ffd6e0b Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Sat, 30 Jul 2005 09:17:36 +0000 Subject: [PATCH] remove pixel double code --- 2d/bitblt.c | 72 +--------------------------- 2d/ibitblt.c | 63 ++++++------------------- ChangeLog | 4 ++ include/gr.h | 7 +-- include/ibitblt.h | 4 +- main/game.c | 25 ++-------- main/game.h | 16 +------ main/gamecntl.c | 12 +---- main/gamerend.c | 75 ++++------------------------- main/gauges.c | 117 +--------------------------------------------- main/hud.c | 12 +---- 11 files changed, 38 insertions(+), 369 deletions(-) diff --git a/2d/bitblt.c b/2d/bitblt.c index d5923e07..b8a6f2b8 100644 --- a/2d/bitblt.c +++ b/2d/bitblt.c @@ -1,4 +1,4 @@ -/* $Id: bitblt.c,v 1.19 2005-07-30 07:48:24 chris Exp $ */ +/* $Id: bitblt.c,v 1.20 2005-07-30 09:17:06 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -1146,42 +1146,6 @@ extern void gr_lbitblt( grs_bitmap * source, grs_bitmap * dest, int height, int #ifdef MACINTOSH -// width == number of destination pixels - -void gr_linear_movsd_double(ubyte *src, ubyte *dest, int width) -{ - double *d = (double *)dest; - uint *s = (uint *)src; - uint doubletemp[2]; - uint temp, work; - int i, num_pixels; - - num_pixels = width / 2; - if ( (num_pixels & 0x3) || (((int)src & 0x7) != ((int)dest & 0x7)) ) { - // not a multiple of 4? do single pixel at a time - for (i=0; i> 8) & 0x00FFFF00) | (temp & 0xFF0000FF); // 0xABCDEFGH -> 0xABABCDEF - temp = ((temp >> 8) & 0x000000FF) | (temp & 0xFFFFFF00); // 0xABABCDEF -> 0xABABCDCD - doubletemp[0] = temp; - - work = ((work << 8) & 0x00FFFF00) | (work & 0xFF0000FF); // 0xABCDEFGH -> 0xABEFGHGH - work = ((work << 8) & 0xFF000000) | (work & 0x00FFFFFF); // 0xABEFGHGH -> 0xEFEFGHGH - doubletemp[1] = work; - - *d = *(double *) &(doubletemp[0]); - d++; - } -} - //extern void BlitLargeAlign(ubyte *draw_buffer, int dstRowBytes, ubyte *dstPtr, int w, int h, int modulus); asm void BlitLargeAlign(ubyte *rSrcPtr, int rDblDStrd, ubyte *rDst1Ptr, int rWidth, int rHeight, int rModulus) @@ -1249,40 +1213,6 @@ BlitLargeAlignX: blr // return to caller } -void gr_bm_ubitblt_double(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap *src, grs_bitmap *dest) -{ - ubyte * dbits; - ubyte * sbits; - int dstep, i; - - sbits = src->bm_data + (src->bm_rowsize * sy) + sx; - dbits = dest->bm_data + (dest->bm_rowsize * dy) + dx; - dstep = dest->bm_rowsize << gr_bitblt_dest_step_shift; - Assert( !((int)dbits & 0x7) ); // assert to check double word alignment - BlitLargeAlign(sbits, dstep, dbits, src->bm_w, src->bm_h, src->bm_rowsize); -} - -// w and h are the doubled width and height - -void gr_bm_ubitblt_double_slow(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap *src, grs_bitmap *dest) -{ - ubyte * dbits; - ubyte * sbits; - int dstep, i; - - sbits = src->bm_data + (src->bm_rowsize * sy) + sx; - dbits = dest->bm_data + (dest->bm_rowsize * dy) + dx; - dstep = dest->bm_rowsize << gr_bitblt_dest_step_shift; - - for (i=0; i < h; i++ ) { - - gr_linear_movsd_double(sbits, dbits, w); - dbits += dstep; - if (i & 1) - sbits += src->bm_rowsize; - } -} - #endif /* MACINTOSH */ diff --git a/2d/ibitblt.c b/2d/ibitblt.c index c2c9eba0..309ca5dc 100644 --- a/2d/ibitblt.c +++ b/2d/ibitblt.c @@ -1,4 +1,4 @@ -/* $Id: ibitblt.c,v 1.11 2005-07-30 01:51:42 chris Exp $ */ +/* $Id: ibitblt.c,v 1.12 2005-07-30 09:17:06 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -31,7 +31,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: ibitblt.c,v 1.11 2005-07-30 01:51:42 chris Exp $"; +static char rcsid[] = "$Id: ibitblt.c,v 1.12 2005-07-30 09:17:06 chris Exp $"; #endif #ifdef __MSDOS__ //ndef MACINTOSH @@ -562,11 +562,10 @@ static short start_points[MAX_SCANLINES][MAX_HOLES]; static short hole_length[MAX_SCANLINES][MAX_HOLES]; static double *scanline = NULL; -void gr_ibitblt(grs_bitmap *src_bmp, grs_bitmap *dest_bmp, ubyte pixel_double) +void gr_ibitblt(grs_bitmap *src_bmp, grs_bitmap *dest_bmp) { - int x, y, sw, sh, srowsize, drowsize, dstart, sy, dy; + int x, y, sw, sh, srowsize, drowsize, dstart, sy; ubyte *src, *dest; - short *current_hole, *current_hole_length; // variable setup @@ -583,51 +582,17 @@ void gr_ibitblt(grs_bitmap *src_bmp, grs_bitmap *dest_bmp, ubyte pixel_double) dest += drowsize; } - if (pixel_double) { - ubyte *scan = (ubyte *)scanline; // set up for byte processing of scanline - - dy = sy; - for (y = sy; y < sy + sh; y++) { - gr_linear_rep_movsd_2x(src, scan, sw); // was: gr_linear_movsd_double(src, scan, sw*2); - current_hole = start_points[dy]; - current_hole_length = hole_length[dy]; - for (x = 0; x < MAX_HOLES; x++) { - if (*current_hole == -1) - break; - dstart = *current_hole; - gr_linear_movsd(&(scan[dstart]), &(dest[dstart]), *current_hole_length); - current_hole++; - current_hole_length++; - } - dy++; - dest += drowsize; - current_hole = start_points[dy]; - current_hole_length = hole_length[dy]; - for (x = 0;x < MAX_HOLES; x++) { - if (*current_hole == -1) - break; - dstart = *current_hole; - gr_linear_movsd(&(scan[dstart]), &(dest[dstart]), *current_hole_length); - current_hole++; - current_hole_length++; - } - dy++; - dest += drowsize; - src += srowsize; - } - } else { - Assert(sw <= MAX_WIDTH); - Assert(sh <= MAX_SCANLINES); - for (y = sy; y < sy + sh; y++) { - for (x = 0; x < MAX_HOLES; x++) { - if (start_points[y][x] == -1) - break; - dstart = start_points[y][x]; - gr_linear_movsd(&(src[dstart]), &(dest[dstart]), hole_length[y][x]); - } - dest += drowsize; - src += srowsize; + Assert(sw <= MAX_WIDTH); + Assert(sh <= MAX_SCANLINES); + for (y = sy; y < sy + sh; y++) { + for (x = 0; x < MAX_HOLES; x++) { + if (start_points[y][x] == -1) + break; + dstart = start_points[y][x]; + gr_linear_movsd(&(src[dstart]), &(dest[dstart]), hole_length[y][x]); } + dest += drowsize; + src += srowsize; } } diff --git a/ChangeLog b/ChangeLog index 1e4d1faa..f605b181 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,10 @@ * 2d/bitblt.c, main/gamerend.c, main/inferno.c, main/object.c, main/polyobj.c: remove old _3DFX code + * 2d/bitblt.c, 2d/ibitblt.c, include/gr.h, include/ibitblt.h, + main/game.c, main/game.h, main/gamecntl.c, main/gamerend.c, + main/gauges.c, main/hud.c: remove pixel double code + 2005-07-29 Chris Taylor * 2d/font.c: show some missing wide 1's (bug #2269) diff --git a/include/gr.h b/include/gr.h index 76bb9ab4..36330464 100644 --- a/include/gr.h +++ b/include/gr.h @@ -1,4 +1,4 @@ -/* $Id: gr.h,v 1.29 2005-07-30 01:51:11 chris Exp $ */ +/* $Id: gr.h,v 1.30 2005-07-30 09:16:48 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -265,11 +265,6 @@ void gr_bm_bitblt(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src void gr_bm_ubitblt( int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); void gr_bm_ubitbltm(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); -#ifdef MACINTOSH -void gr_bm_ubitblt_double(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap *src, grs_bitmap *dest); -void gr_linear_movsd_double(ubyte *src, ubyte *dest, int num_pixels); -#endif /* def MACINTOSH */ - void gr_update_buffer( void * sbuf1, void * sbuf2, void * dbuf, int size ); void gr_set_transparent(grs_bitmap *pbm, int bTransparent); diff --git a/include/ibitblt.h b/include/ibitblt.h index 122380b0..14132b2e 100644 --- a/include/ibitblt.h +++ b/include/ibitblt.h @@ -1,4 +1,4 @@ -/* $Id: ibitblt.h,v 1.3 2004-08-28 23:17:45 schaffner Exp $ */ +/* $Id: ibitblt.h,v 1.4 2005-07-30 09:16:48 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -44,7 +44,7 @@ void gr_ibitblt_create_mask(grs_bitmap *mask_bmp, int sx, int sy, int sw, int sh #ifdef __MSDOS__ void gr_ibitblt(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, ubyte *mask); #else -void gr_ibitblt(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, ubyte pixel_double); +void gr_ibitblt(grs_bitmap *source_bmp, grs_bitmap *dest_bmp); #endif #endif diff --git a/main/game.c b/main/game.c index c6fa3f41..c9398649 100644 --- a/main/game.c +++ b/main/game.c @@ -1,4 +1,4 @@ -/* $Id: game.c,v 1.39 2005-07-30 01:50:17 chris Exp $ */ +/* $Id: game.c,v 1.40 2005-07-30 09:16:25 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -23,7 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -char game_rcsid[] = "$Id: game.c,v 1.39 2005-07-30 01:50:17 chris Exp $"; +char game_rcsid[] = "$Id: game.c,v 1.40 2005-07-30 09:16:25 chris Exp $"; #endif #ifdef WINDOWS @@ -166,12 +166,7 @@ int stop_count,start_count; int time_stopped,time_started; #endif -#ifndef MACINTOSH ubyte * Game_cockpit_copy_code = NULL; -#else -ubyte Game_cockpit_copy_code = 0; -ubyte Scanline_double = 1; -#endif int VR_screen_mode = 0; @@ -642,17 +637,8 @@ void game_init_render_sub_buffers( int x, int y, int w, int h ) dd_VR_render_sub_buffer[1].yoff = y; #endif - if (Scanline_double) { - #ifdef MACINTOSH - if ( w & 0x3 ) - w &= ~0x3; - gr_init_sub_canvas( &VR_render_sub_buffer[0], &VR_render_buffer[0], x, y, w/2, (h/2)+1); - gr_init_sub_canvas( &VR_render_sub_buffer[1], &VR_render_buffer[1], x, y, w/2, (h/2)+1); - #endif - } else { - gr_init_sub_canvas( &VR_render_sub_buffer[0], &VR_render_buffer[0], x, y, w, h ); - gr_init_sub_canvas( &VR_render_sub_buffer[1], &VR_render_buffer[1], x, y, w, h ); - } + gr_init_sub_canvas( &VR_render_sub_buffer[0], &VR_render_buffer[0], x, y, w, h ); + gr_init_sub_canvas( &VR_render_sub_buffer[1], &VR_render_buffer[1], x, y, w, h ); #ifdef WINDOWS VR_render_sub_buffer[0].cv_bitmap.bm_x = 0; @@ -2219,12 +2205,9 @@ void game() songs_check_redbook_repeat(); // Handle RedBook Audio Repeating. if (Config_menu_flag) { - int double_save = Scanline_double; - //WIN(mouse_set_mode(0)); if (!(Game_mode&GM_MULTI)) {palette_save(); reset_palette_add(); apply_modified_palette(); gr_palette_load( gr_palette ); } do_options_menu(); - if (Scanline_double != double_save) init_cockpit(); if (!(Game_mode&GM_MULTI)) palette_restore(); //WIN(mouse_set_mode(1)); } diff --git a/main/game.h b/main/game.h index 14fa36f6..be5680df 100644 --- a/main/game.h +++ b/main/game.h @@ -1,4 +1,4 @@ -/* $Id: game.h,v 1.11 2005-06-22 09:08:21 chris Exp $ */ +/* $Id: game.h,v 1.12 2005-07-30 09:16:25 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -28,10 +28,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. //#include "segment.h" -#ifdef MACINTOSH -extern ubyte Scanline_double; -#endif - #ifdef WINDOWS typedef struct cockpit_span_line { short num; @@ -126,16 +122,6 @@ extern int Game_double_buffer; // double buffering? #endif -#ifndef MACINTOSH - -#define Scanline_double 0 // PC doesn't do scanline doubling - -#else - -extern ubyte Scanline_double; // but the Macintosh does - -#endif - // Suspend flags #define SUSP_NONE 0 // Everything moving normally diff --git a/main/gamecntl.c b/main/gamecntl.c index 3c40062a..7cc5c0fe 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -1,4 +1,4 @@ -/* $Id: gamecntl.c,v 1.26 2005-07-30 01:50:17 chris Exp $ */ +/* $Id: gamecntl.c,v 1.27 2005-07-30 09:16:25 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -1115,13 +1115,6 @@ int HandleSystemKey(int key) case KEY_PAUSE: do_game_pause(); break; - #ifdef MACINTOSH - case KEY_COMMAND + KEY_D: - Scanline_double = !Scanline_double; - init_cockpit(); - break; - #endif - MAC(case KEY_COMMAND + KEY_SHIFTED + KEY_3:) case KEY_PRINT_SCREEN: save_screen_shot(0); break; @@ -1131,12 +1124,9 @@ int HandleSystemKey(int key) MAC(case KEY_COMMAND+KEY_2:) case KEY_F2: //Config_menu_flag = 1; break; { - int scanline_save = Scanline_double; - if (!(Game_mode&GM_MULTI)) {palette_save(); apply_modified_palette(); reset_palette_add(); gr_palette_load(gr_palette); } do_options_menu(); if (!(Game_mode&GM_MULTI)) palette_restore(); - if (scanline_save != Scanline_double) init_cockpit(); // reset the cockpit after changing... break; } diff --git a/main/gamerend.c b/main/gamerend.c index ff11b6bd..a5b8e2da 100644 --- a/main/gamerend.c +++ b/main/gamerend.c @@ -1,4 +1,4 @@ -/* $Id: gamerend.c,v 1.17 2005-07-30 07:46:03 chris Exp $ */ +/* $Id: gamerend.c,v 1.18 2005-07-30 09:16:25 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -23,7 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: gamerend.c,v 1.17 2005-07-30 07:46:03 chris Exp $"; +static char rcsid[] = "$Id: gamerend.c,v 1.18 2005-07-30 09:16:25 chris Exp $"; #endif #ifdef WINDOWS @@ -309,15 +309,6 @@ void render_countdown_gauge() void game_draw_hud_stuff() { -#ifdef MACINTOSH - int odisplay_mode = Current_display_mode; - if (Scanline_double) { - FontHires = 0; - Current_display_mode = 0; - } -#endif - - //mprintf ((0,"Linear is %d!\n",LinearSVGABuffer)); #ifndef NDEBUG @@ -361,10 +352,6 @@ void game_draw_hud_stuff() gr_set_fontcolor(gr_getcolor(27,0,0), -1 ); gr_get_string_size(message, &w, &h, &aw ); - #ifdef MACINTOSH - if (Scanline_double) // double height if scanline doubling since we have the correct - h += h; // font for printing, but the wrong height. - #endif if (Cockpit_mode == CM_FULL_COCKPIT) { if (grd_curcanv->cv_bitmap.bm_h > 240) h += 40; @@ -421,13 +408,6 @@ mprintf((0,"line_spacing=%d ",line_spacing)); if ( Player_is_dead ) player_dead_message(); - -#ifdef MACINTOSH - if (Scanline_double) { - FontHires = 1; - Current_display_mode = odisplay_mode; - } -#endif } extern int gr_bitblt_dest_step_shift; @@ -566,10 +546,6 @@ void game_render_frame_stereo() WIN(DDGRLOCK(dd_grd_curcanv)); // Must lock DD canvas!!! { - #ifdef MACINTOSH - if (Scanline_double) - FontHires = 0; - #endif update_rendered_data(0, Viewer, 0, 0); render_frame(0, 0); @@ -587,10 +563,6 @@ void game_render_frame_stereo() WIN(DDGRUNLOCK(dd_grd_curcanv)); HUD_render_message_frame(); - #ifdef MACINTOSH - if (Scanline_double) - FontHires = 1; - #endif no_draw_hud=1; } @@ -1010,10 +982,6 @@ void game_render_frame_mono(void) WIN(DDGRLOCK(dd_grd_curcanv)); // Must lock DD canvas!!! { - #ifdef MACINTOSH - if (Scanline_double) - FontHires = 0; - #endif update_rendered_data(0, Viewer, 0, 0); render_frame(0, 0); @@ -1031,10 +999,6 @@ void game_render_frame_mono(void) WIN(DDGRUNLOCK(dd_grd_curcanv)); HUD_render_message_frame(); - #ifdef MACINTOSH - if (Scanline_double) - FontHires = 1; - #endif no_draw_hud=1; } @@ -1109,11 +1073,6 @@ void game_render_frame_mono(void) gr_wait_for_retrace = 1; #endif } else { - #ifdef MACINTOSH - if (Scanline_double) - gr_bm_ubitblt_double( VR_render_sub_buffer[0].cv_w, VR_render_sub_buffer[0].cv_h, VR_render_sub_buffer[0].cv_bitmap.bm_x, VR_render_sub_buffer[0].cv_bitmap.bm_y, 0, 0, &VR_render_sub_buffer[0].cv_bitmap, &VR_screen_pages[0].cv_bitmap ); - else - #endif // NOTE LINK TO ABOVE IF #ifdef WINDOWS if (GRMODEINFO(emul) || GRMODEINFO(modex) || GRMODEINFO(dbuf)) // From render buffer to screen buffer. @@ -1145,12 +1104,7 @@ void game_render_frame_mono(void) #endif } } else { - #if 1 //def MACINTOSH - gr_ibitblt( &VR_render_sub_buffer[0].cv_bitmap, &VR_screen_pages[0].cv_bitmap, Scanline_double ); - #else - #ifndef WINDOWS - gr_ibitblt( &VR_render_buffer[0].cv_bitmap, &VR_screen_pages[0].cv_bitmap, Game_cockpit_copy_code ); - #else + #ifdef WINDOWS win_do_emul_ibitblt( &dd_VR_render_sub_buffer[0], dd_grd_screencanv); DDGRRESTORE; if (GRMODEINFO(modex)) { @@ -1158,6 +1112,11 @@ void game_render_frame_mono(void) //@@dd_gr_flip(); win_flip = 1; } + #else + #ifdef __MSDOS__ + gr_ibitblt( &VR_render_buffer[0].cv_bitmap, &VR_screen_pages[0].cv_bitmap, Game_cockpit_copy_code ); + #else //def MACINTOSH + gr_ibitblt( &VR_render_sub_buffer[0].cv_bitmap, &VR_screen_pages[0].cv_bitmap ); #endif #endif } @@ -1264,11 +1223,6 @@ void grow_window() Game_window_w += WINDOW_W_DELTA; Game_window_h += WINDOW_H_DELTA; - #ifdef MACINTOSH // horrible hack to ensure that height is even to satisfy pixel doubling blitter - if ( Scanline_double && (Game_window_h & 1) ) - Game_window_h--; - #endif - if (Game_window_h > max_window_h) Game_window_h = max_window_h; @@ -1447,11 +1401,6 @@ void shrink_window() if ( Game_window_h < WINDOW_MIN_H ) Game_window_h = WINDOW_MIN_H; - #ifdef MACINTOSH // horrible hack to ensure that height is even to satisfy pixel doubling blitter - if ( Scanline_double && (Game_window_h & 1) ) - Game_window_h--; - #endif - Game_window_x = (max_window_w - Game_window_w)/2; Game_window_y = (max_window_h - Game_window_h)/2; @@ -1506,14 +1455,6 @@ void update_cockpits(int force_redraw) gr_ubitmapm(0,max_window_h,&GameBitmaps[cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)].index]); WIN(DDGRUNLOCK(dd_grd_curcanv)); - #ifdef MACINTOSH // hideously horrible hack to put grey line 1 scanline above because of pixel doubling "oddness" - if (Scanline_double) - { - gr_setcolor(BM_XRGB(13,13,13)); // color of top of status bar - gr_uscanline( 0, grd_curcanv->cv_w, max_window_h-1 ); - } - #endif - Game_window_x = (max_window_w - Game_window_w)/2; Game_window_y = (max_window_h - Game_window_h)/2; fill_background(); diff --git a/main/gauges.c b/main/gauges.c index 144f3439..39043681 100644 --- a/main/gauges.c +++ b/main/gauges.c @@ -1,4 +1,4 @@ -/* $Id: gauges.c,v 1.18 2005-07-30 01:50:17 chris Exp $ */ +/* $Id: gauges.c,v 1.19 2005-07-30 09:16:25 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -881,48 +881,6 @@ void copy_gauge_box(gauge_box *box,grs_bitmap *bm) } #endif -#ifdef MACINTOSH - -extern int gr_bitblt_double; - -int copy_whole_box = 0; - -void copy_gauge_box_double(gauge_box *box,grs_bitmap *bm) -{ - - if (!copy_whole_box && box->spanlist) { - int n_spans = box->bot-box->top+1; - int cnt, sx, dx, sy, dy; - - sy = dy = box->top; - for (cnt=0; cnt < n_spans; cnt++) { - ubyte * dbits; - ubyte * sbits; - int i, j; - - sx = box->left; - dx = box->left+box->spanlist[cnt].l; - - sbits = bm->bm_data + (bm->bm_rowsize * sy) + sx; - dbits = grd_curcanv->cv_bitmap.bm_data + (grd_curcanv->cv_bitmap.bm_rowsize * dy) + dx; - - for (j = box->spanlist[cnt].l; j < box->spanlist[cnt].r+1; j++) - *dbits++ = sbits[j/2]; - - dy++; - - if (cnt & 1) - sy++; - } - - } - else - gr_bm_ubitblt_double_slow(box->right-box->left+1,box->bot-box->top, - box->left,box->top,box->left,box->top, - bm,&grd_curcanv->cv_bitmap); -} -#endif - //fills in the coords of the hostage video window void get_hostage_window_coords(int *x,int *y,int *w,int *h) @@ -2818,19 +2776,11 @@ void show_reticle(int force_big_one) #endif - #ifndef MACINTOSH use_hires_reticle = (FontHires != 0); - #else - use_hires_reticle = !Scanline_double; - #endif WIN(DDGRLOCK(dd_grd_curcanv)); -#ifndef MACINTOSH small_reticle = !(grd_curcanv->cv_bitmap.bm_w*3 > max_window_w*2 || force_big_one); -#else - small_reticle = !(grd_curcanv->cv_bitmap.bm_w*3 > max_window_w*(Scanline_double?1:2) || force_big_one); -#endif ofs = (use_hires_reticle?0:2) + small_reticle; gauge_index = (small_reticle?SML_RETICLE_CROSS:RETICLE_CROSS) + cross_bm_num; @@ -2861,10 +2811,6 @@ void hud_show_kill_list() // menuhires (which is always 1 for mac). This throws off placement of // players in pixel double mode. -#ifdef MACINTOSH - MenuHires = !(Scanline_double); -#endif - if (Show_kill_list_timer > 0) { Show_kill_list_timer -= FrameTime; @@ -3151,15 +3097,7 @@ void draw_hud() #endif -#ifdef MACINTOSH - if (Scanline_double) // I should be shot for this ugly hack.... - FontHires = 1; -#endif Line_spacing = GAME_FONT->ft_h + GAME_FONT->ft_h/4; -#ifdef MACINTOSH - if (Scanline_double) - FontHires = 0; -#endif WIN(DDGRLOCK(dd_grd_curcanv)); // Show score so long as not in rearview @@ -3470,10 +3408,6 @@ void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,c { w = VR_render_buffer[0].cv_bitmap.bm_w/6; // hmm. I could probably do the sub_buffer assigment for all macines, but I aint gonna chance it - #ifdef MACINTOSH - if (Scanline_double) - w /= 2; - #endif h = i2f(w) / grd_curscreen->sc_aspect; @@ -3489,13 +3423,6 @@ void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,c window_y = VR_render_buffer[0].cv_bitmap.bm_h-h-(h/10)-dd_VR_render_sub_buffer[0].yoff; #endif - #ifdef MACINTOSH - if (Scanline_double) { - window_x = (VR_render_buffer[0].cv_bitmap.bm_w/2+VR_render_sub_buffer[0].cv_bitmap.bm_x)/2+dx; - window_y = ((VR_render_buffer[0].cv_bitmap.bm_h+VR_render_sub_buffer[0].cv_bitmap.bm_y)/2)-h-(h/10); - } - #endif - //copy these vars so stereo code can get at them SW_drawn[win]=1; SW_x[win] = window_x; SW_y[win] = window_y; SW_w[win] = w; SW_h[win] = h; @@ -3514,17 +3441,10 @@ void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,c box = &gauge_boxes[boxnum]; - #ifndef MACINTOSH WINDOS( dd_gr_init_sub_canvas(&window_canv,&dd_VR_render_buffer[0],box->left,box->top,box->right-box->left+1,box->bot-box->top+1), gr_init_sub_canvas(&window_canv,&VR_render_buffer[0],box->left,box->top,box->right-box->left+1,box->bot-box->top+1) ); - #else - if (Scanline_double) - gr_init_sub_canvas(&window_canv,&VR_render_buffer[0],box->left,box->top,(box->right-box->left+1)/2,(box->bot-box->top+1)/2); - else - gr_init_sub_canvas(&window_canv,&VR_render_buffer[0],box->left,box->top,box->right-box->left+1,box->bot-box->top+1); - #endif } WINDOS( @@ -3546,13 +3466,11 @@ WINDOS( if (label) { WIN(DDGRLOCK(dd_grd_curcanv)); - MAC(if (Scanline_double) FontHires = 0;) // get the right font size gr_set_curfont( GAME_FONT ); if (Color_0_31_0 == -1) Color_0_31_0 = gr_getcolor(0,31,0); gr_set_fontcolor(Color_0_31_0, -1); gr_printf(0x8000,2,label); - MAC(if (Scanline_double) FontHires = 1;) // get the right font size back to normal WIN(DDGRUNLOCK(dd_grd_curcanv)); } @@ -3575,19 +3493,6 @@ WINDOS( //if the window only partially overlaps the big 3d window, copy //the extra part to the visible screen - #ifdef MACINTOSH // recalc window_x and window_y because of scanline doubling problems - { - int w, h, dx; - - w = VR_render_buffer[0].cv_bitmap.bm_w/6; // hmm. I could probably do the sub_buffer assigment for all macines, but I aint gonna chance it - h = i2f(w) / grd_curscreen->sc_aspect; - dx = (win==0)?-(w+(w/10)):(w/10); - window_x = VR_render_buffer[0].cv_bitmap.bm_w/2+dx; - window_y = VR_render_buffer[0].cv_bitmap.bm_h-h-(h/10); - if (Scanline_double) - window_x += ((win==0)?2:-1); // a real hack here.... - } - #endif big_window_bottom = Game_window_y + Game_window_h - 1; #ifdef WINDOWS @@ -3615,11 +3520,6 @@ WINDOS( gr_set_current_canvas(get_current_game_screen()) ); - #ifdef MACINTOSH - if (Scanline_double) - gr_bm_ubitblt_double_slow(window_canv.cv_bitmap.bm_w*2, window_canv.cv_bitmap.bm_h*2, window_x, window_y, 0, 0, &window_canv.cv_bitmap, &grd_curcanv->cv_bitmap); - else - #endif // note link to above if WINDOS( dd_gr_blt_notrans(&window_canv, 0,0,0,0, dd_grd_curcanv, window_x, window_y, 0,0), @@ -3634,20 +3534,11 @@ WINDOS( small_window_bottom = window_y + window_canv.canvas.cv_bitmap.bm_h - 1, small_window_bottom = window_y + window_canv.cv_bitmap.bm_h - 1 ); - #ifdef MACINTOSH - if (Scanline_double) - small_window_bottom = window_y + (window_canv.cv_bitmap.bm_h*2) - 1; - #endif extra_part_h = small_window_bottom - big_window_bottom; if (extra_part_h > 0) { - #ifdef MACINTOSH - if (Scanline_double) - extra_part_h /= 2; - #endif - WINDOS( dd_gr_init_sub_canvas(&overlap_canv,&window_canv,0, window_canv.canvas.cv_bitmap.bm_h-extra_part_h, @@ -3666,11 +3557,6 @@ WINDOS( gr_set_current_canvas(get_current_game_screen()) ); - #ifdef MACINTOSH - if (Scanline_double) - gr_bm_ubitblt_double_slow(window_canv.cv_bitmap.bm_w*2, extra_part_h*2, window_x, big_window_bottom+1, 0, window_canv.cv_bitmap.bm_h-extra_part_h, &window_canv.cv_bitmap, &grd_curcanv->cv_bitmap); - else - #endif // note link to above if WINDOS( dd_gr_blt_notrans(&overlap_canv, 0,0,0,0, dd_grd_curcanv, window_x, big_window_bottom+1, 0,0), @@ -3716,7 +3602,6 @@ abort:; Assert(outBoundsRect); Assert((inSubWindowNum == 0) || (inSubWindowNum == 1)); - Assert(!Scanline_double); switch (Cockpit_mode) { diff --git a/main/hud.c b/main/hud.c index 86f40fa7..db167e79 100644 --- a/main/hud.c +++ b/main/hud.c @@ -1,4 +1,4 @@ -/* $Id: hud.c,v 1.10 2005-07-30 01:50:17 chris Exp $ */ +/* $Id: hud.c,v 1.11 2005-07-30 09:16:25 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -211,11 +211,6 @@ void HUD_render_message_frame() grs_canvas *canv_save = grd_curcanv ); - #ifdef MACINTOSH - if (Scanline_double) - FontHires=1; // always display hires font outside of display - #endif - WINDOS( ycrd = dd_grd_curcanv->yoff - (SMALL_FONT->ft_h+2), ycrd = grd_curcanv->cv_bitmap.bm_y - (SMALL_FONT->ft_h+2) @@ -260,11 +255,6 @@ void HUD_render_message_frame() Last_msg_ycrd = ycrd; Last_msg_height = h; - #ifdef MACINTOSH - if (Scanline_double) - FontHires=0; // always display hires font outside of display - #endif - } } else { -- 2.39.2