remove DirectDraw use and Windows mouse stuff made redundant by SDL (lots of WINDOWS...
authorChris Taylor <chris@icculus.org>
Tue, 2 Aug 2005 06:15:08 +0000 (06:15 +0000)
committerChris Taylor <chris@icculus.org>
Tue, 2 Aug 2005 06:15:08 +0000 (06:15 +0000)
36 files changed:
2d/bitblt.c
2d/bitmap.c
2d/pixel.c
2d/rect.c
2d/rle.c
3d/draw.c
3d/instance.c
3d/matrix.c
3d/points.c
3d/rod.c
3d/setup.c
ChangeLog
include/3d.h
include/palette.h
main/automap.c
main/cntrlcen.c
main/credits.c
main/endlevel.c
main/escort.c
main/game.c
main/game.h
main/gamecntl.c
main/gamerend.c
main/gameseq.c
main/gauges.c
main/hud.c
main/kconfig.c
main/kmatrix.c
main/menu.c
main/newmenu.c
main/object.c
main/paging.c
main/piggy.c
main/scores.c
main/state.c
main/titles.c

index b8a6f2b..4ae7c67 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bitblt.c,v 1.20 2005-07-30 09:17:06 chris Exp $ */
+/* $Id: bitblt.c,v 1.21 2005-08-02 06:15:08 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -1482,23 +1482,6 @@ void gr_bm_ubitblt(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * sr
        }
 #endif
 
-#ifdef D1XD3D
-       if ( (src->bm_type == BM_LINEAR) && (dest->bm_type == BM_DIRECTX ))
-       {
-               Assert ((int)dest->bm_data == BM_D3D_RENDER || (int)dest->bm_data == BM_D3D_DISPLAY);
-               Win32_BlitLinearToDirectX_bm (src, sx, sy, w, h, dx, dy, 0);
-               return;
-       }
-       if ( (src->bm_type == BM_DIRECTX) && (dest->bm_type == BM_LINEAR ))
-       {
-               return;
-       }
-       if ( (src->bm_type == BM_DIRECTX) && (dest->bm_type == BM_DIRECTX ))
-       {
-               return;
-       }
-#endif
-
        if ( (src->bm_flags & BM_FLAG_RLE ) && (src->bm_type == BM_LINEAR) ) {
                gr_bm_ubitblt0x_rle(w, h, dx, dy, sx, sy, src, dest );
                return;
@@ -1587,12 +1570,6 @@ void gr_ubitmap( int x, int y, grs_bitmap *bm )
                        ogl_ubitmapm(x,y,bm);
                        return;
 #endif
-#ifdef D1XD3D
-               case BM_DIRECTX:
-                       Assert ((int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_RENDER || (int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_DISPLAY);
-                       Win32_BlitLinearToDirectX_bm(bm, 0, 0, bm->bm_w, bm->bm_h, x, y, 0);
-                       return;
-#endif
 #ifdef __MSDOS__
                case BM_SVGA:
                        if ( bm->bm_flags & BM_FLAG_RLE )
@@ -1640,20 +1617,6 @@ void gr_ubitmapm( int x, int y, grs_bitmap *bm )
                        ogl_ubitmapm(x,y,bm);
                        return;
 #endif
-#ifdef D1XD3D
-               case BM_DIRECTX:
-                       if (bm->bm_w < 35 && bm->bm_h < 35) {
-                               // ugly hack needed for reticle
-                               if ( bm->bm_flags & BM_FLAG_RLE )
-                                       gr_bm_ubitblt0x_rle(bm->bm_w, bm->bm_h, x, y, 0, 0, bm, &grd_curcanv->cv_bitmap, 1 );
-                               else
-                                       gr_ubitmapGENERICm(x, y, bm);
-                               return;
-                       }
-                       Assert ((int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_RENDER || (int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_DISPLAY);
-                       Win32_BlitLinearToDirectX_bm(bm, 0, 0, bm->bm_w, bm->bm_h, x, y, 1);
-                       return;
-#endif
 #ifdef __MSDOS__
                case BM_SVGA:
                        if (bm->bm_flags & BM_FLAG_RLE)
@@ -1735,20 +1698,6 @@ void gr_bm_ubitbltm(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * s
                return;
        }
 #endif
-#ifdef D1XD3D
-       if ( (src->bm_type == BM_LINEAR) && (dest->bm_type == BM_DIRECTX ))
-       {
-               Assert ((int)dest->bm_data == BM_D3D_RENDER || (int)dest->bm_data == BM_D3D_DISPLAY);
-               Win32_BlitLinearToDirectX_bm (src, sx, sy, w, h, dx, dy, 1);
-               return;
-       }
-       if ( (src->bm_type == BM_DIRECTX) && (dest->bm_type == BM_DIRECTX ))
-       {
-               Assert ((int)src->bm_data == BM_D3D_RENDER || (int)src->bm_data == BM_D3D_DISPLAY);
-               //Win32_BlitDirectXToDirectX (w, h, dx, dy, sx, sy, src->bm_data, dest->bm_data, 0);
-               return;
-       }
-#endif
 
        for (y1=0; y1 < h; y1++ )    {
                for (x1=0; x1 < w; x1++ )    {
index cd75551..36621f6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bitmap.c,v 1.8 2005-07-30 01:51:42 chris Exp $ */
+/* $Id: bitmap.c,v 1.9 2005-08-02 06:15:08 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -44,10 +44,6 @@ void gr_set_bitmap_data (grs_bitmap *bm, unsigned char *data)
                ogl_freebmtexture(bm);
 #endif
        bm->bm_data = data;
-#ifdef D1XD3D
-       Assert (bm->iMagic == BM_MAGIC_NUMBER);
-       Win32_SetTextureBits (bm, data, bm->bm_flags & BM_FLAG_RLE);
-#endif
 }
 
 grs_bitmap *gr_create_bitmap(int w, int h )
@@ -68,10 +64,6 @@ grs_bitmap *gr_create_bitmap_raw(int w, int h, unsigned char * raw_data )
 
 void gr_init_bitmap( grs_bitmap *bm, int mode, int x, int y, int w, int h, int bytesperline, unsigned char * data ) // TODO: virtualize
 {
-#ifdef D1XD3D
-       Assert (bm->iMagic != BM_MAGIC_NUMBER || bm->pvSurface == NULL);
-#endif
-
        bm->bm_x = x;
        bm->bm_y = y;
        bm->bm_w = w;
@@ -81,14 +73,6 @@ void gr_init_bitmap( grs_bitmap *bm, int mode, int x, int y, int w, int h, int b
        bm->bm_rowsize = bytesperline;
 
        bm->bm_data = NULL;
-#ifdef D1XD3D
-       bm->iMagic = BM_MAGIC_NUMBER;
-       bm->pvSurface = NULL;
-#endif
-
-#ifdef D1XD3D
-       Win32_CreateTexture (bm);
-#endif
 #ifdef OGL
        bm->bm_parent=NULL;bm->gltexture=NULL;
 #endif
@@ -114,11 +98,6 @@ void gr_init_bitmap_alloc( grs_bitmap *bm, int mode, int x, int y, int w, int h,
 void gr_init_bitmap_data (grs_bitmap *bm) // TODO: virtulize
 {
        bm->bm_data = NULL;
-#ifdef D1XD3D
-       Assert (bm->iMagic != BM_MAGIC_NUMBER);
-       bm->iMagic = BM_MAGIC_NUMBER;
-       bm->pvSurface = NULL;
-#endif
 #ifdef OGL
 //     ogl_freebmtexture(bm);//not what we want here.
        bm->bm_parent=NULL;bm->gltexture=NULL;
@@ -146,9 +125,6 @@ void gr_free_sub_bitmap(grs_bitmap *bm )
 {
        if (bm!=NULL)
        {
-#ifdef D1XD3D
-               bm->iMagic = 0;
-#endif
                d_free(bm);
        }
 }
@@ -156,14 +132,6 @@ void gr_free_sub_bitmap(grs_bitmap *bm )
 
 void gr_free_bitmap_data (grs_bitmap *bm) // TODO: virtulize
 {
-#ifdef D1XD3D
-       Assert (bm->iMagic == BM_MAGIC_NUMBER);
-
-       Win32_FreeTexture (bm);
-       bm->iMagic = 0;
-       if (bm->bm_data == BM_D3D_RENDER)
-               bm->bm_data = NULL;
-#endif
 #ifdef OGL
        ogl_freebmtexture(bm);
 #endif
@@ -185,16 +153,6 @@ void gr_init_sub_bitmap (grs_bitmap *bm, grs_bitmap *bmParent, int x, int y, int
 #ifdef OGL
        bm->gltexture=bmParent->gltexture;
        bm->bm_parent=bmParent;
-#endif
-#ifdef D1XD3D
-       Assert (bmParent->iMagic == BM_MAGIC_NUMBER);
-       bm->iMagic = BM_MAGIC_NUMBER;
-       bm->pvSurface = bmParent->pvSurface;
-       if (bm->bm_type == BM_DIRECTX)
-       {
-               bm->bm_data = bmParent->bm_data;
-       }
-       else
 #endif
        {
                bm->bm_data = bmParent->bm_data+(unsigned int)((y*bmParent->bm_rowsize)+x);
@@ -276,17 +234,6 @@ void decode_data_asm(ubyte *data, int num_pixels, ubyte *colormap, int *count)
 
 void gr_set_bitmap_flags (grs_bitmap *pbm, int flags)
 {
-#ifdef D1XD3D
-       Assert (pbm->iMagic == BM_MAGIC_NUMBER);
-
-       if (pbm->pvSurface)
-       {
-               if ((flags & BM_FLAG_TRANSPARENT) != (pbm->bm_flags & BM_FLAG_TRANSPARENT))
-               {
-                       Win32_SetTransparent (pbm->pvSurface, flags & BM_FLAG_TRANSPARENT);
-               }
-       }
-#endif
        pbm->bm_flags = flags;
 }
 
index 0645bae..352672c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pixel.c,v 1.6 2004-05-31 08:33:41 btb Exp $ */
+/* $Id: pixel.c,v 1.7 2005-08-02 06:15:08 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -34,7 +34,6 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 
-#ifndef D1XD3D
 void gr_upixel( int x, int y )
 {
        switch (TYPE)
@@ -58,7 +57,6 @@ void gr_upixel( int x, int y )
 #endif
        }
 }
-#endif
 
 void gr_pixel( int x, int y )
 {
@@ -66,7 +64,6 @@ void gr_pixel( int x, int y )
        gr_upixel (x, y);
 }
 
-#ifndef D1XD3D
 inline void gr_bm_upixel( grs_bitmap * bm, int x, int y, unsigned char color )
 {
        switch (bm->bm_type)
@@ -92,7 +89,6 @@ inline void gr_bm_upixel( grs_bitmap * bm, int x, int y, unsigned char color )
 #endif
        }
 }
-#endif
 
 void gr_bm_pixel( grs_bitmap * bm, int x, int y, unsigned char color )
 {
index d885931..a243240 100644 (file)
--- a/2d/rect.c
+++ b/2d/rect.c
@@ -1,4 +1,4 @@
-/* $Id: rect.c,v 1.4 2002-10-10 18:55:32 btb Exp $ */
+/* $Id: rect.c,v 1.5 2005-08-02 06:15:08 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -40,13 +40,6 @@ void gr_urect(int left,int top,int right,int bot)
                ogl_urect(left,top,right,bot);
                return;
        }
-#endif
-#ifdef D1XD3D
-       if (TYPE == BM_DIRECTX) {
-               if (left <= right && top <= bot)
-                       Win32_Rect (left, top, right, bot, grd_curcanv->cv_bitmap.bm_data, COLOR);
-               return;
-       }
 #endif
        for ( i=top; i<=bot; i++ )
                gr_uscanline( left, right, i );
@@ -61,13 +54,6 @@ void gr_rect(int left,int top,int right,int bot)
                ogl_urect(left,top,right,bot);
                return;
        }
-#endif
-#ifdef D1XD3D
-       if (TYPE == BM_DIRECTX) {
-               if (left <= right && top <= bot)
-                       Win32_Rect (left, top, right, bot, grd_curcanv->cv_bitmap.bm_data, COLOR);
-               return;
-       }
 #endif
        for ( i=top; i<=bot; i++ )
                gr_scanline( left, right, i );
index 6aea629..a6c7c62 100644 (file)
--- a/2d/rle.c
+++ b/2d/rle.c
@@ -1,4 +1,4 @@
-/* $Id: rle.c,v 1.20 2005-07-30 01:51:42 chris Exp $ */
+/* $Id: rle.c,v 1.21 2005-08-02 06:15:08 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -25,7 +25,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: rle.c,v 1.20 2005-07-30 01:51:42 chris Exp $";
+static char rcsid[] = "$Id: rle.c,v 1.21 2005-08-02 06:15:08 chris Exp $";
 #endif
 
 #include <stdlib.h>
@@ -576,10 +576,6 @@ void rle_expand_texture_sub( grs_bitmap * bmp, grs_bitmap * rle_temp_bitmap_1 )
        unsigned char * dbits1;
 #endif
 
-#ifdef D1XD3D
-       Assert (bmp->iMagic == BM_MAGIC_NUMBER);
-#endif
-
        sbits = &bmp->bm_data[4 + bmp->bm_h];
        dbits = rle_temp_bitmap_1->bm_data;
 
@@ -597,9 +593,6 @@ void rle_expand_texture_sub( grs_bitmap * bmp, grs_bitmap * rle_temp_bitmap_1 )
                Assert( dbits == dbits1 );              // Get John, bogus rle data!
 #endif
        }
-#ifdef D1XD3D
-       gr_set_bitmap_data (rle_temp_bitmap_1, rle_temp_bitmap_1->bm_data);
-#endif
 }
 
 
index 46cdab0..7a5458e 100644 (file)
--- a/3d/draw.c
+++ b/3d/draw.c
@@ -1,4 +1,4 @@
-/* $Id: draw.c,v 1.4 2002-07-17 21:55:19 bradleyb Exp $ */
+/* $Id: draw.c,v 1.5 2005-08-02 06:14:48 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,7 +22,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: draw.c,v 1.4 2002-07-17 21:55:19 bradleyb Exp $";
+static char rcsid[] = "$Id: draw.c,v 1.5 2005-08-02 06:14:48 chris Exp $";
 #endif
 
 #include "error.h"
@@ -199,7 +199,7 @@ free_points:
        return ret;
 }
 
-#if (!(defined(D1XD3D) || defined(OGL)))
+#ifndef OGL
 //draw a flat-shaded face.
 //returns 1 if off screen, 0 if drew
 bool g3_draw_poly(int nv,g3s_point **pointlist)
index dac7173..c7cd611 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: instance.c,v 1.5 2004-08-28 23:17:45 schaffner Exp $ */
+/* $Id: instance.c,v 1.6 2005-08-02 06:14:48 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -43,10 +43,6 @@ void g3_start_instance_matrix(vms_vector *pos,vms_matrix *orient)
        vms_vector tempv;
        vms_matrix tempm,tempm2;
 
-#ifdef D1XD3D
-       Win32_start_instance_matrix (pos, orient);
-#endif
-
        Assert(instance_depth<MAX_INSTANCE_DEPTH);
 
        instance_stack[instance_depth].m = View_matrix;
@@ -95,10 +91,6 @@ void g3_start_instance_angles(vms_vector *pos,vms_angvec *angles)
 //pops the old context
 void g3_done_instance()
 {
-#ifdef D1XD3D
-       Win32_done_instance ();
-#endif
-
        instance_depth--;
 
        Assert(instance_depth >= 0);
index 63e8005..b6b38a6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: matrix.c,v 1.5 2004-08-28 23:17:45 schaffner Exp $ */
+/* $Id: matrix.c,v 1.6 2005-08-02 06:14:48 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,7 +22,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: matrix.c,v 1.5 2004-08-28 23:17:45 schaffner Exp $";
+static char rcsid[] = "$Id: matrix.c,v 1.6 2005-08-02 06:14:48 chris Exp $";
 #endif
 
 #include "3d.h"
@@ -38,10 +38,6 @@ void g3_set_view_angles(vms_vector *view_pos,vms_angvec *view_orient,fix zoom)
 
        vm_angles_2_matrix(&View_matrix,view_orient);
 
-#ifdef D1XD3D
-       Win32_set_view_matrix ();
-#endif
-
        scale_matrix();
 }
 
@@ -53,10 +49,6 @@ void g3_set_view_matrix(vms_vector *view_pos,vms_matrix *view_matrix,fix zoom)
 
        View_matrix = *view_matrix;
 
-#ifdef D1XD3D
-       Win32_set_view_matrix ();
-#endif
-
        scale_matrix();
 }
 
index ed8a426..3998796 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: points.c,v 1.6 2004-08-28 23:17:45 schaffner Exp $ */
+/* $Id: points.c,v 1.7 2005-08-02 06:14:48 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,7 +22,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: points.c,v 1.6 2004-08-28 23:17:45 schaffner Exp $";
+static char rcsid[] = "$Id: points.c,v 1.7 2005-08-02 06:14:48 chris Exp $";
 #endif
 
 #include "3d.h"
@@ -58,10 +58,6 @@ ubyte g3_rotate_point(g3s_point *dest,vms_vector *src)
 {
        vms_vector tempv;
 
-#ifdef D1XD3D
-       dest->p3_orig = *src;
-#endif
-
        vm_vec_sub(&tempv,src,&View_position);
 
        vm_vec_rotate(&dest->p3_vec,&tempv,&View_matrix);
index 6144784..20ec65b 100644 (file)
--- a/3d/rod.c
+++ b/3d/rod.c
@@ -1,4 +1,4 @@
-/* $Id: rod.c,v 1.6 2004-12-17 13:42:11 btb Exp $ */
+/* $Id: rod.c,v 1.7 2005-08-02 06:14:48 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,7 +22,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: rod.c,v 1.6 2004-12-17 13:42:11 btb Exp $";
+static char rcsid[] = "$Id: rod.c,v 1.7 2005-08-02 06:14:48 chris Exp $";
 #endif
 
 #include "3d.h"
@@ -133,7 +133,7 @@ bool g3_draw_rod_tmap(grs_bitmap *bitmap,g3s_point *bot_point,fix bot_width,g3s_
 int checkmuldiv(fix *r,fix a,fix b,fix c);
 #endif
 
-#if (!(defined(D1XD3D) || defined(OGL)))
+#ifndef OGL
 //draws a bitmap with the specified 3d width & height 
 //returns 1 if off screen, 0 if drew
 bool g3_draw_bitmap(vms_vector *pos,fix width,fix height,grs_bitmap *bm, int orientation)
index 3546426..c829d97 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.6 2004-08-28 23:17:45 schaffner Exp $ */
+/* $Id: setup.c,v 1.7 2005-08-02 06:14:48 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,7 +22,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: setup.c,v 1.6 2004-08-28 23:17:45 schaffner Exp $";
+static char rcsid[] = "$Id: setup.c,v 1.7 2005-08-02 06:14:48 chris Exp $";
 #endif
 
 #include <stdlib.h>
@@ -80,24 +80,16 @@ void g3_start_frame(void)
 
        init_free_points();
 
-#ifdef D1XD3D
-       Win32_start_frame ();
-#else
 #ifdef OGL
        ogl_start_frame();
 #else
        init_interface_vars_to_assembler();             //for the texture-mapper
 #endif
-#endif
-
 }
 
 //this doesn't do anything, but is here for completeness
 void g3_end_frame(void)
 {
-#ifdef D1XD3D
-       Win32_end_frame ();
-#endif
 #ifdef OGL
        ogl_end_frame();
 #endif
index f605b18..631f169 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-08-02  Chris Taylor  <chris@icculus.org>
+
+       * 2d/bitblt.c, 2d/bitmap.c, 2d/pixel.c, 2d/rect.c, 2d/rle.c,
+       3d/draw.c, 3d/instance.c, 3d/matrix.c, 3d/points.c, 3d/rod.c,
+       3d/setup.c,
+       include/3d.h, include/palette.h,
+       main/automap.c, main/cntrlcen.c, main/credits.c, main/endlevel.c,
+       main/escort.c, main/game.c, main/game.h, main/gamecntl.c,
+       main/gamerend.c, main/gameseq.c, main/gauges.c, main/hud.c,
+       main/kconfig.c, main/kmatrix.c, main/menu.c, main/newmenu.c,
+       main/object.c, main/paging.c, main/piggy.c, main/scores.c,
+       main/state.c, main/titles.c:
+       remove DirectDraw use and Windows mouse stuff made redundant by SDL
+       (lots of WINDOWS code).
+       Makes cockpit draw properly in SDL
+
 2005-07-30  Chris Taylor  <chris@icculus.org>
 
        * 2d/2dsline.c, 2d/bitblt.c, 2d/bitmap.c, 2d/font.c, 2d/ibitblt.c,
index ddee4cd..4d18f32 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: 3d.h,v 1.12 2004-08-28 23:17:45 schaffner Exp $ */
+/* $Id: 3d.h,v 1.13 2005-08-02 06:11:10 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -62,9 +62,6 @@ typedef struct g3s_codes {
 //if rotated, and flag to indicate if projected.
 typedef struct g3s_point {
        vms_vector p3_vec;  //x,y,z of rotated point
-#ifdef D1XD3D
-       vms_vector p3_orig;
-#endif
        fix p3_u,p3_v,p3_l; //u,v,l coords
        fix p3_sx,p3_sy;    //screen x&y
        ubyte p3_codes;     //clipping codes
index 10b11bd..b52c5d4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: palette.h,v 1.5 2004-08-28 23:17:45 schaffner Exp $ */
+/* $Id: palette.h,v 1.6 2005-08-02 06:11:10 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -40,9 +40,4 @@ extern void init_computed_colors(void);
 extern ubyte gr_palette_gamma;
 extern ubyte gr_current_pal[256*3];
 
-#ifdef D1XD3D
-typedef ubyte PALETTE [256 * 3];
-extern void DoSetPalette (PALETTE *pPal);
-#endif
-
 #endif
index 138e626..3acdfec 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: automap.c,v 1.21 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: automap.c,v 1.22 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -172,17 +172,8 @@ static short DrawingListBright[MAX_EDGES];
 #ifndef AUTOMAP_DIRECT_RENDER
 // Screen anvas variables
 static int current_page=0;
-#ifdef WINDOWS
-static dd_grs_canvas ddPages[2];
-static dd_grs_canvas ddDrawingPages[2];
-
-#define ddPage ddPages[0]
-#define ddDrawingPage ddDrawingPages[0]
-
-#endif
-
-       static grs_canvas Pages[2];
-       static grs_canvas DrawingPages[2];
+static grs_canvas Pages[2];
+static grs_canvas DrawingPages[2];
 #endif /* AUTOMAP_DIRECT_RENDER */
 
 #define Page Pages[0]
@@ -433,26 +424,16 @@ void draw_automap()
 
 #ifndef AUTOMAP_DIRECT_RENDER
        if (!AutomapHires) {
-               WIN(mprintf((1, "Can't do lores automap in Windows!\n")));
-               WIN(Int3());
                current_page ^= 1;
                gr_set_current_canvas(&DrawingPages[current_page]);
        }
        else {
-               WINDOS(
-                       dd_gr_set_current_canvas(&ddDrawingPage),
-                       gr_set_current_canvas(&DrawingPage)
-               );
+               gr_set_current_canvas(&DrawingPage);
        }
 #endif
 
-       WINDOS(
-               dd_gr_clear_canvas(BM_XRGB(0,0,0)),
-               gr_clear_canvas(BM_XRGB(0,0,0))
-       );
+       gr_clear_canvas(BM_XRGB(0,0,0));
 
-WIN(DDGRLOCK(dd_grd_curcanv));
-{
        g3_start_frame();
        render_start_frame();
 
@@ -460,7 +441,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
 
        g3_set_view_matrix(&viewer_position,&ViewMatrix,Automap_zoom);
 
-//     mprintf((0, "dd_grd_curcanv->canvas.cv_bitmap.bm_data= %x\n", dd_grd_curcanv->canvas.cv_bitmap.bm_data));
 //     mprintf((0, "grd_curcanv->cv_bitmap.bm_data= %x\n", grd_curcanv->cv_bitmap.bm_data));
 
        draw_all_edges();
@@ -537,8 +517,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
 
        gr_bitmapm(AutomapHires?10:5, AutomapHires?10:5, &name_canv_left->cv_bitmap);
        gr_bitmapm(grd_curcanv->cv_bitmap.bm_w-(AutomapHires?10:5)-name_canv_right->cv_bitmap.bm_w,AutomapHires?10:5,&name_canv_right->cv_bitmap);
-}
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
 #ifdef OGL
        ogl_swap_buffers();
@@ -547,23 +525,15 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
        if (!AutomapHires)
                gr_show_canvas( &Pages[current_page] );
        else {
-       #ifndef WINDOWS
                //gr_bm_ubitblt( Page.cv_bitmap.bm_w, Page.cv_bitmap.bm_h, Page.cv_bitmap.bm_x, Page.cv_bitmap.bm_y, 0, 0, &Page.cv_bitmap, &VR_screen_pages[0].cv_bitmap );
                gr_bm_ubitblt( Page.cv_bitmap.bm_w, Page.cv_bitmap.bm_h, Page.cv_bitmap.bm_x, Page.cv_bitmap.bm_y, 0, 0, &Page.cv_bitmap, &grd_curscreen->sc_canvas.cv_bitmap );
-       #else
-               dd_gr_blt_screen(&ddPage, 0,0,0,0,0,0,0,0);
-       #endif
        }
        gr_update();
 #endif
 #endif
 }
 
-#ifdef WINDOWS
-#define LEAVE_TIME 0x00010000
-#else
 #define LEAVE_TIME 0x4000
-#endif
 
 #define WINDOW_WIDTH           288
 
@@ -577,16 +547,9 @@ grs_canvas *print_to_canvas(char *s,grs_font *font, int fc, int bc, int double_f
        grs_canvas *temp_canv;
        grs_font *save_font;
        int w,h,aw;
+       grs_canvas *save_canv;
 
-WINDOS(
-       dd_grs_canvas *save_canv,
-       grs_canvas *save_canv
-);
-
-WINDOS(
-       save_canv = dd_grd_curcanv,
-       save_canv = grd_curcanv
-);
+       save_canv = grd_curcanv;
 
        save_font = grd_curcanv->cv_font;
        gr_set_curfont(font);                                   //set the font we're going to use
@@ -615,10 +578,7 @@ WINDOS(
                }
        }
 
-WINDOS(
-       dd_gr_set_current_canvas(save_canv),
-       gr_set_current_canvas(save_canv)
-);
+       gr_set_current_canvas(save_canv);
 
        return temp_canv;
 }
@@ -714,9 +674,6 @@ void do_automap( int key_code )     {
        char maxdrop;
        int must_free_canvas=0;
        
-       WIN(int dd_VR_screen_mode_save);
-       WIN(int redraw_screen=0);
-
        Automap_active = 1;
 
        init_automap_colors();
@@ -736,7 +693,6 @@ void do_automap( int key_code )     {
        mprintf( (0, "Num_vertices=%d, Max_edges=%d, (MAX:%d)\n", Num_vertices, Max_edges, MAX_EDGES ));
        mprintf( (0, "Allocated %d K for automap edge list\n", (sizeof(Edge_info)+sizeof(short))*Max_edges/1024 ));
 
-       #if !defined (WINDOWS) && !defined(MACINTOSH)
        if ((Current_display_mode!=0 && Current_display_mode!=2) || (Automap_always_hires && MenuHiresAvailable)) {
                //edit 4/23/99 Matt Mueller - don't switch res unless we need to
                if (grd_curscreen->sc_mode != AUTOMAP_MODE)
@@ -752,15 +708,6 @@ void do_automap( int key_code )    {
                gr_set_mode( SM(320, 400));
                AutomapHires = 0;
        }
-       #else
-               AutomapHires = 1;               //Mac & Windows(?) always in hires
-       #endif
-
-       #ifdef WINDOWS
-               dd_VR_screen_mode_save = VR_screen_mode;
-               VR_screen_mode = SM95_640x480x8;        // HACK! Forcing reinit of 640x480
-               set_screen_mode(SCREEN_GAME);
-       #endif
 
        FontHires = FontHiresAvailable && AutomapHires;
 
@@ -768,7 +715,6 @@ void do_automap( int key_code )     {
 
        gr_palette_clear();
 
-WIN(AutomapRedraw:)
        if (!AutomapHires) {
 #ifndef MACINTOSH
 #ifndef AUTOMAP_DIRECT_RENDER
@@ -802,35 +748,20 @@ WIN(AutomapRedraw:)
        else {
 #ifndef AUTOMAP_DIRECT_RENDER
                if (VR_render_buffer[0].cv_w >= automap_width && VR_render_buffer[0].cv_h >= automap_height)
-               {
-                       WIN(dd_gr_init_sub_canvas(&ddPage, &dd_VR_render_buffer[0], 0, 0, automap_width,automap_height));
-
                        gr_init_sub_canvas(&Page,&VR_render_buffer[0],0, 0, automap_width, automap_height);
-                       
-               }
                else {
-               #ifndef WINDOWS
                        void *raw_data;
                        MALLOC(raw_data,ubyte,automap_width*automap_height);
                        gr_init_canvas(&Page,raw_data,BM_LINEAR,automap_width,automap_height);
-               #else
-                       dd_gr_init_canvas(&ddPage, BM_LINEAR, automap_width,automap_height);
-                       gr_init_canvas(&Page,NULL,BM_LINEAR,automap_width,automap_height);
-               #endif
                        must_free_canvas = 1;
                }
 
-               WIN(dd_gr_init_sub_canvas(&ddDrawingPage, &ddPage, RESCALE_X(27), RESCALE_Y(80), RESCALE_X(582), RESCALE_Y(334)));
                gr_init_sub_canvas(&DrawingPage, &Page, RESCALE_X(27), RESCALE_Y(80), RESCALE_X(582), RESCALE_Y(334));
 
-               WINDOS(
-                       dd_gr_set_current_canvas(&ddPage),
-                       gr_set_current_canvas(&Page)
-               );
+               gr_set_current_canvas(&Page);
 #endif
 
 
-               WIN(DDGRLOCK(dd_grd_curcanv));
                pcx_error = pcx_read_fullscr(MAP_BACKGROUND_FILENAME, pal);
                        if ( pcx_error != PCX_ERROR_NONE )      {
                                //printf("File %s - PCX error: %s",MAP_BACKGROUND_FILENAME,pcx_errormsg(pcx_error));
@@ -848,18 +779,13 @@ WIN(AutomapRedraw:)
                        gr_printf(RESCALE_X(60), RESCALE_Y(426), TXT_TURN_SHIP);
                        gr_printf(RESCALE_X(60), RESCALE_Y(443), TXT_SLIDE_UPDOWN);
                        gr_printf(RESCALE_X(60), RESCALE_Y(460), TXT_VIEWING_DISTANCE);
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
        
 #ifndef AUTOMAP_DIRECT_RENDER
-               WINDOS(
-                       dd_gr_set_current_canvas(&ddDrawingPage),
-                       gr_set_current_canvas(&DrawingPage)
-               );
+                       gr_set_current_canvas(&DrawingPage);
 #endif
        }
 
 
-WIN(if (!redraw_screen) {)
        automap_build_edge_list();
 
        if ( ViewDist==0 )
@@ -882,9 +808,6 @@ WIN(if (!redraw_screen) {)
        SegmentLimit = Max_segments_away;
 
        adjust_segment_limit(SegmentLimit);
-WIN(})
-
-WIN(if (redraw_screen) redraw_screen = 0);
 
        while(!done)    {
                if ( leave_mode==0 && Controls.automap_state && (timer_get_fixed_seconds()-entry_time)>LEAVE_TIME)
@@ -923,23 +846,6 @@ WIN(if (redraw_screen) redraw_screen = 0);
                //see if redbook song needs to be restarted
                songs_check_redbook_repeat();
 
-               #ifdef WINDOWS
-               {
-                       MSG msg;
-                       DoMessageStuff(&msg);
-                       if (_RedrawScreen) {
-                               _RedrawScreen = FALSE;
-                               redraw_screen = 1;
-                               goto AutomapRedraw;
-                       }
-                               
-                       if (msg.message == WM_QUIT) exit(1);
-
-                       DDGRRESTORE;
-               }
-               #endif
-
-
                while( (c=key_inkey()) )        {
                        switch( c ) {
                        #ifndef NDEBUG
@@ -947,12 +853,8 @@ WIN(if (redraw_screen) redraw_screen = 0);
                        #endif
        
                        case KEY_PRINT_SCREEN: {
-                               if (AutomapHires) {
-                               WINDOS(
-                                       dd_gr_set_current_canvas(NULL),
-                                               gr_set_current_canvas(NULL)
-                               );
-                               }
+                               if (AutomapHires)
+                                       gr_set_current_canvas(NULL);
 #ifndef AUTOMAP_DIRECT_RENDER
                                else
                                        gr_set_current_canvas(&Pages[current_page]);
@@ -1036,10 +938,7 @@ WIN(if (redraw_screen) redraw_screen = 0);
 
                                if (HighlightMarker > -1 && MarkerObject[HighlightMarker] != -1) {
 #ifndef AUTOMAP_DIRECT_RENDER
-                                       WINDOS(
-                                               dd_gr_set_current_canvas(&ddPages[current_page]),
-                                               gr_set_current_canvas(&Pages[current_page])
-                                       );
+                                       gr_set_current_canvas(&Pages[current_page]);
 #endif
 
                                        if (nm_messagebox( NULL, 2, TXT_YES, TXT_NO, "Delete Marker?" ) == 0) {
@@ -1158,14 +1057,10 @@ WIN(if (redraw_screen) redraw_screen = 0);
        gr_free_canvas(name_canv_left);  name_canv_left=NULL;
        gr_free_canvas(name_canv_right);  name_canv_right=NULL;
 
-       if (must_free_canvas)   {
 #ifndef AUTOMAP_DIRECT_RENDER
-       WINDOS(
-               DDFreeSurface(ddPages[0].lpdds),
-               d_free(Page.cv_bitmap.bm_data)
-       );
+       if (must_free_canvas)
+               d_free(Page.cv_bitmap.bm_data);
 #endif
-       }
 
        mprintf( (0, "Automap memory freed\n" ));
 
@@ -1177,10 +1072,6 @@ WIN(if (redraw_screen) redraw_screen = 0);
                digi_resume_digi_sounds();
        }
 
-#ifdef WINDOWS
-       VR_screen_mode = dd_VR_screen_mode_save;
-#endif
-
        Automap_active = 0;
 }
 
index 2505c5e..506ff75 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cntrlcen.c,v 1.19 2005-06-22 09:08:21 chris Exp $ */
+/* $Id: cntrlcen.c,v 1.20 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -23,11 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: cntrlcen.c,v 1.19 2005-06-22 09:08:21 chris Exp $";
-#endif
-
-#ifdef WINDOWS
-#include "desw.h"
+static char rcsid[] = "$Id: cntrlcen.c,v 1.20 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 #include <stdlib.h>
@@ -230,14 +226,8 @@ void do_countdown_frame()
                PALETTE_FLASH_SET(flash_value,flash_value,flash_value);
 
                if (PaletteBlueAdd > 64 )       {
-               WINDOS(
-                       dd_gr_set_current_canvas(NULL),
-                       gr_set_current_canvas( NULL )
-               );
-               WINDOS(
-                       dd_gr_clear_canvas(BM_XRGB(31,31,31)),
-                       gr_clear_canvas(BM_XRGB(31,31,31))
-               );                                                                                                              //make screen all white to match palette effect
+                       gr_set_current_canvas( NULL );
+                       gr_clear_canvas(BM_XRGB(31,31,31));                             //make screen all white to match palette effect
                        reset_cockpit();                                                                //force cockpit redraw next time
                        reset_palette_add();                                                    //restore palette for death message
                        //controlcen->MaxCapacity = Fuelcen_max_amount;
index b41d197..4edb381 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: credits.c,v 1.13 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: credits.c,v 1.14 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -23,11 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: credits.c,v 1.13 2005-07-30 01:50:17 chris Exp $";
-#endif
-
-#ifdef WINDOWS
-#include "desw.h"
+static char rcsid[] = "$Id: credits.c,v 1.14 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 #include <stdio.h>
@@ -138,20 +134,11 @@ void credits_show(char *credits_filename)
        char * tempp;
        char filename[32];
 
-WIN(int credinit = 0;)
-
        box dirty_box[NUM_LINES_HIRES];
        grs_canvas *CreditsOffscreenBuf=NULL;
+       grs_canvas *save_canv;
 
-       WINDOS(
-               dd_grs_canvas *save_canv,
-               grs_canvas *save_canv
-       );
-
-       WINDOS(
-               save_canv = dd_grd_curcanv,
-               save_canv = grd_curcanv
-       );
+       save_canv = grd_curcanv;
 
        // Clear out all tex buffer lines.
        for (i=0; i<NUM_LINES; i++ )
@@ -185,11 +172,6 @@ WIN(int credinit = 0;)
 
        set_screen_mode(SCREEN_MENU);
 
-       WIN(DEFINE_SCREEN(NULL));
-
-#ifdef WINDOWS
-CreditsPaint:
-#endif
        gr_use_palette_table( "credits.256" );
 #ifdef OGL
        gr_palette_load(gr_palette);
@@ -212,14 +194,9 @@ CreditsPaint:
 
        gr_remap_bitmap_good( &backdrop,backdrop_palette, -1, -1 );
 
-WINDOS(
-       dd_gr_set_current_canvas(NULL), 
-       gr_set_current_canvas(NULL)
-);
-WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(NULL);
        gr_bitmap(0,0,&backdrop);
-WIN(DDGRUNLOCK(dd_grd_curcanv));
-        gr_update();
+       gr_update();
        gr_palette_fade_in( gr_palette, 32, 0 );
 
 //     Create a new offscreen buffer for the credits screen
@@ -227,7 +204,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
 //MWA  for size to determine if we can use that buffer.  If the game size
 //MWA  matches what we need, then lets save memory.
 
-#ifndef WINDOWS
        if (MenuHires && VR_offscreen_buffer->cv_w == 640)      {
                CreditsOffscreenBuf = VR_offscreen_buffer;
        }
@@ -237,9 +213,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
        else {
                CreditsOffscreenBuf = gr_create_canvas(320,200);
        }
-#else
-       CreditsOffscreenBuf = gr_create_canvas(640,480);
-#endif                         
 
        if (!CreditsOffscreenBuf)
                Error("Not enough memory to allocate Credits Buffer.");
@@ -247,17 +220,12 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
        //gr_clear_canvas(BM_XRGB(0,0,0));
        key_flush();
 
-#ifdef WINDOWS
-       if (!credinit)  
-#endif
        {
                last_time = timer_get_fixed_seconds();
                done = 0;
                first_line_offset = 0;
        }
 
-       WIN(credinit = 1);
-
        while( 1 )      {
                int k;
 
@@ -365,11 +333,9 @@ get_line:;
 
                                        tempbmp = &(CreditsOffscreenBuf->cv_bitmap);
 
-                               WIN(DDGRSCREENLOCK);
                                        gr_bm_bitblt( new_box->width + 1, new_box->height +4,
                                                                new_box->left, new_box->top, new_box->left, new_box->top,
                                                                tempbmp, &(grd_curscreen->sc_canvas.cv_bitmap) );
-                               WIN(DDGRSCREENUNLOCK);
                                }
 
 #ifndef OGL
@@ -395,38 +361,12 @@ get_line:;
                        }
 
 //             Wacky Fast Credits thing doesn't need this (it's done above)
-//@@           WINDOS(
-//@@                   dd_gr_blt_notrans(CreditsOffscreenBuf, 0,0,0,0, dd_grd_screencanv, 0,0,0,0),
-//@@                   gr_bm_ubitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(CreditsOffscreenBuf->cv_bitmap), &(grd_curscreen->sc_canvas.cv_bitmap) );
-//@@           );
+//@@           gr_bm_ubitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(CreditsOffscreenBuf->cv_bitmap), &(grd_curscreen->sc_canvas.cv_bitmap) );
 
 //                     mprintf( ( 0, "Fr = %d", (timer_get_fixed_seconds() - last_time) ));
                        while( timer_get_fixed_seconds() < last_time+time_delay );
                        last_time = timer_get_fixed_seconds();
                
-               #ifdef WINDOWS
-                       {
-                               MSG msg;
-
-                               DoMessageStuff(&msg);
-
-                               if (_RedrawScreen) {
-                                       _RedrawScreen = FALSE;
-
-                                       gr_close_font(header_font);
-                                       gr_close_font(title_font);
-                                       gr_close_font(names_font);
-
-                                       d_free(backdrop.bm_data);
-                                       gr_free_canvas(CreditsOffscreenBuf);
-               
-                                       goto CreditsPaint;
-                               }
-
-                               DDGRRESTORE;
-                       }
-               #endif
-
                        //see if redbook song needs to be restarted
                        songs_check_redbook_repeat();
 
@@ -460,21 +400,12 @@ get_line:;
                                        gr_use_palette_table( DEFAULT_PALETTE );
                                        d_free(backdrop.bm_data);
                                        cfclose(file);
-                               WINDOS(
-                                       dd_gr_set_current_canvas(save_canv),
-                                       gr_set_current_canvas(save_canv)
-                               );
+                                       gr_set_current_canvas(save_canv);
                                        songs_play_song( SONG_TITLE, 1 );
 
-                               #ifdef WINDOWS
-                                       gr_free_canvas(CreditsOffscreenBuf);
-                               #else                                   
                                        if (CreditsOffscreenBuf != VR_offscreen_buffer)
                                                gr_free_canvas(CreditsOffscreenBuf);
-                               #endif
 
-                               WIN(DEFINE_SCREEN(Menu_pcx_name));
-                       
                                return;
                        }
                }
index 35e16be..517aa49 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: endlevel.c,v 1.24 2004-10-23 17:42:13 schaffner Exp $ */
+/* $Id: endlevel.c,v 1.25 2005-08-02 06:13:56 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: endlevel.c,v 1.24 2004-10-23 17:42:13 schaffner Exp $";
+static char rcsid[] = "$Id: endlevel.c,v 1.25 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 //#define SLEW_ON 1
@@ -354,13 +354,11 @@ void start_endlevel_sequence()
                else
                        exit_models_loaded = load_exit_models();
 
-#ifndef WINDOWS
                if (exit_models_loaded)
                {
                        start_rendered_endlevel_sequence();
                        return;
                }
-#endif
        }
 
        //don't have movie or rendered sequence, fade out
index ed838a2..c70adae 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: escort.c,v 1.9 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: escort.c,v 1.10 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -1864,15 +1864,7 @@ void do_escort_menu(void)
        show_escort_menu(msg);          //TXT_PAUSE);
 
        while (paused) {
-       #ifdef WINDOWS
-               while (!(key = key_inkey()))
-               {
-                       MSG wmsg;
-                       DoMessageStuff(&wmsg);
-               }
-       #else
                key = key_getch();
-       #endif
 
                switch (key) {
                        case KEY_0:
@@ -1957,10 +1949,7 @@ void show_escort_menu(char *msg)
        int     x,y;
 
 
-       WINDOS(
-               dd_gr_set_current_canvas(&dd_VR_screen_pages[0]),
-               gr_set_current_canvas(&VR_screen_pages[0])
-       );
+       gr_set_current_canvas(&VR_screen_pages[0]);
 
        gr_set_curfont( GAME_FONT );
 
@@ -1973,9 +1962,7 @@ void show_escort_menu(char *msg)
    
    nm_draw_background(x-15,y-15,x+w+15-1,y+h+15-1);
 
-WIN(DDGRLOCK(dd_grd_curcanv));\
        gr_ustring( x, y, msg );
-WIN(DDGRUNLOCK(dd_grd_curcanv));
        gr_update();
 
        reset_cockpit();
index c939864..ac6ec92 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: game.c,v 1.40 2005-07-30 09:16:25 chris Exp $ */
+/* $Id: game.c,v 1.41 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -23,11 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-char game_rcsid[] = "$Id: game.c,v 1.40 2005-07-30 09:16:25 chris Exp $";
-#endif
-
-#ifdef WINDOWS
-#include "desw.h"
+char game_rcsid[] = "$Id: game.c,v 1.41 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 #include <stdio.h>
@@ -190,16 +186,6 @@ grs_canvas VR_render_sub_buffer[2];                        //  Two sub buffers for left/right eyes.
 grs_canvas     VR_screen_pages[2];                                     //  Two pages of VRAM if paging is available
 grs_canvas     VR_editor_canvas;                                               //  The canvas that the editor writes to.
 
-#ifdef WINDOWS
-//@@ LPDIRECTDRAWSURFACE _lpDDSMask = NULL;
-dd_grs_canvas *dd_VR_offscreen_buffer = NULL;
-dd_grs_canvas dd_VR_screen_pages[2];
-dd_grs_canvas dd_VR_render_buffer[2];
-dd_grs_canvas dd_VR_render_sub_buffer[2];
-
-void game_win_init_cockpit_mask(int sram);
-#endif
-
 //do menus work in 640x480 or 320x200?
 //PC version sets this in main().  Mac versios is always high-res, so set to 1 here
 int MenuHiresAvailable = 1;            //can we do highres menus?
@@ -338,87 +324,6 @@ void reset_palette_add()
 }
 
 
-#ifdef WINDOWS
-void win_get_span_list(grs_bitmap *bm, int miny, int maxy)
-{
-       int x,y;
-       int mode = 0;
-       ubyte *data;
-       int offset;
-       int lspan=0, rspan=0, span=0;
-//@@FILE *fp;
-
-       data = bm->bm_data;
-//@@   fp = fopen("cockspan.dat", "w");
-
-       for (y = 0; y < miny; y++)
-               win_cockpit_mask[y].num = 0;
-
-       for (y = miny; y <= maxy; y++)
-       {
-               span = 0;
-               //@@ fprintf(fp, "line %d: ", y);               
-               for (x = 0; x < bm->bm_w; x++)
-               {
-                       offset = y*bm->bm_rowsize + x;
-
-                       if (data[offset] == 255) {
-                               switch (mode)
-                               {
-                                       case 0:                         // Start Mode
-                                               lspan   = x;
-                                               win_cockpit_mask[y].span[span].xmin = x;
-                                               mode = 1;
-                                       //@@    fprintf(fp, "<%d,", lspan);
-                                               break;
-
-                                       case 1:                         // Transparency mode
-                                               rspan = x;
-                                               win_cockpit_mask[y].span[span].xmax = x;
-                                               break;
-
-                                       case 2:                         // Switch from Draw mode to transparent
-                                               lspan = x;
-                                               win_cockpit_mask[y].span[span].xmin = x;
-                                       //@@    fprintf(fp, "<%d,", lspan);
-                                               mode = 1;
-                                               break;
-                               }
-                       }
-                       else {
-                               switch(mode)
-                               {
-                                       case 0:                         // Start mode
-                                               mode = 2;
-                                               break;
-                                       
-                                       case 1:                         // Switching from transparent to Draw
-                                               rspan = x;
-                                               mode = 2;
-                                               win_cockpit_mask[y].span[span].xmax = x;
-                                               span++;
-                                       //@@    fprintf(fp, "%d> ", rspan);
-                                               break;
-
-                                       case 2:
-                                               break;
-                               }
-                       }
-               }
-               if (mode == 1) {
-               //@@    fprintf(fp, "%d> ", rspan);
-                       win_cockpit_mask[y].span[span].xmax = rspan;
-                       span++;
-               }
-               win_cockpit_mask[y].num = span;
-       //@@    fprintf(fp, "\n");
-               mode = 0;
-       }
-       win_cockpit_mask[y].num = 255;
-}
-#endif //WINDOWS
-       
-
 void game_show_warning(char *s)
 {
 
@@ -476,13 +381,10 @@ void init_cockpit()
        }
 #endif
 
-       WINDOS(
-               dd_gr_set_current_canvas(NULL),
-               gr_set_current_canvas(NULL)
-               );
+       gr_set_current_canvas(NULL);
        gr_set_curfont( GAME_FONT );
 
-#if !defined(MACINTOSH) && !defined(WINDOWS)
+#ifdef __MSDOS__
        if (Game_cockpit_copy_code)
                d_free(Game_cockpit_copy_code);
        Game_cockpit_copy_code  = NULL;
@@ -491,14 +393,6 @@ void init_cockpit()
                Game_cockpit_copy_code = 0;
 #endif
 
-//@@   #ifdef WINDOWS
-//@@           if (_lpDDSMask) { DDFreeSurface(_lpDDSMask); _lpDDSMask = NULL; }
-//@@   #endif
-
-#ifdef WINDOWS
-       game_win_init_cockpit_mask(0);
-#endif
-
        switch( Cockpit_mode ) {
        case CM_FULL_COCKPIT:
        case CM_REAR_VIEW: {
@@ -506,26 +400,16 @@ void init_cockpit()
 
                PIGGY_PAGE_IN(cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)]);
 
-#ifdef WINDOWS
-               dd_gr_set_current_canvas(NULL);
-               game_win_init_cockpit_mask(1);
-               dd_gr_set_current_canvas(dd_VR_offscreen_buffer);
-#else
                gr_set_current_canvas(VR_offscreen_buffer);
-#endif         
 
-               WIN(DDGRLOCK(dd_grd_curcanv));
                gr_bitmap( 0, 0, bm );
                bm = &VR_offscreen_buffer->cv_bitmap;
                bm->bm_flags = BM_FLAG_TRANSPARENT;
                gr_ibitblt_find_hole_size ( bm, &minx, &miny, &maxx, &maxy );
-               WIN(    win_get_span_list(bm, miny, maxy);
-                               DDGRUNLOCK(dd_grd_curcanv)
-                       );
 
-#ifndef WINDOWS
 #ifndef __MSDOS__
                gr_ibitblt_create_mask( bm, minx, miny, maxx-minx+1, maxy-miny+1, VR_offscreen_buffer->cv_bitmap.bm_rowsize);
+               Game_cockpit_copy_code  = (ubyte *)(1);
 #else
                if ( Current_display_mode ) {
                        Game_cockpit_copy_code  = gr_ibitblt_create_mask_svga( bm, minx, miny, maxx-minx+1, maxy-miny+1, VR_offscreen_buffer->cv_bitmap.bm_rowsize );
@@ -533,10 +417,6 @@ void init_cockpit()
                        Game_cockpit_copy_code  = gr_ibitblt_create_mask( bm, minx, miny, maxx-minx+1, maxy-miny+1, VR_offscreen_buffer->cv_bitmap.bm_rowsize );
 #endif
                bm->bm_flags = 0;               // Clear all flags for offscreen canvas
-#else
-               Game_cockpit_copy_code  = (ubyte *)(1);
-               bm->bm_flags = 0;               // Clear all flags for offscreen canvas
-#endif
                game_init_render_sub_buffers( 0, 0, maxx-minx+1, maxy-miny+1 );
                break;
        }
@@ -586,10 +466,7 @@ void init_cockpit()
 
        }
 
-WINDOS(
-       dd_gr_set_current_canvas(NULL),
-       gr_set_current_canvas(NULL)
-);
+       gr_set_current_canvas(NULL);
 }
 
 //selects a given cockpit (or lack of one).  See types in game.h
@@ -623,102 +500,11 @@ void VR_reset_params()
 
 void game_init_render_sub_buffers( int x, int y, int w, int h )
 {
-#ifdef WINDOWS
-       dd_gr_init_sub_canvas( &dd_VR_render_sub_buffer[0], &dd_VR_render_buffer[0], x, y, w, h );
-       dd_gr_init_sub_canvas( &dd_VR_render_sub_buffer[1], &dd_VR_render_buffer[1], x, y, w, h );
-
-       dd_VR_render_sub_buffer[0].canvas.cv_bitmap.bm_x = 0;
-       dd_VR_render_sub_buffer[0].canvas.cv_bitmap.bm_y = 0;
-       dd_VR_render_sub_buffer[0].xoff = x;
-       dd_VR_render_sub_buffer[0].yoff = y;
-       dd_VR_render_sub_buffer[1].canvas.cv_bitmap.bm_x = 0;
-       dd_VR_render_sub_buffer[1].canvas.cv_bitmap.bm_y = 0;
-       dd_VR_render_sub_buffer[1].xoff = x;
-       dd_VR_render_sub_buffer[1].yoff = y;
-
-#endif
        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;
-       VR_render_sub_buffer[0].cv_bitmap.bm_y = 0;
-       VR_render_sub_buffer[1].cv_bitmap.bm_x = 0;
-       VR_render_sub_buffer[1].cv_bitmap.bm_y = 0;
-#endif
 }
 
 
-#ifdef WINDOWS
-// Sets up the canvases we will be rendering to (WIN95)
-void game_init_render_buffers(int screen_mode, int render_w, int render_h, int render_method, int flags )
-{
-//     Hack for switching to higher that 640x480 modes (DDraw doesn't allow
-//      creating surfaces greater than the current resolution
-
-       if (GRMODEINFO(rw) < render_w || GRMODEINFO(rh) < render_h) {
-               render_w = GRMODEINFO(rw);
-               render_h = GRMODEINFO(rh);
-       }
-
-       VR_screen_mode          = screen_mode;
-
-       VR_screen_flags =  flags;
-
-       VR_reset_params();
-       VR_render_mode  = render_method;
-
-       Game_window_w           = render_w;
-       Game_window_h           = render_h;
-
-       if (dd_VR_offscreen_buffer && dd_VR_offscreen_buffer != dd_grd_backcanv) {
-               dd_gr_free_canvas(dd_VR_offscreen_buffer);
-       }
-
-       if ( (VR_render_mode==VR_AREA_DET) || (VR_render_mode==VR_INTERLACED ) )        {
-               if ( render_h*2 < 200 ) {
-                       Int3();         // Not Supported yet!!!
-//                     VR_offscreen_buffer = gr_create_canvas( render_w, 200 );
-               }
-               else {
-                       Int3();         // Not Supported yet!!!
-//                     VR_offscreen_buffer = gr_create_canvas( render_w, render_h*2 );
-               }
-
-               Int3();                 // Not Supported yet!!!
-//             gr_init_sub_canvas( &VR_render_buffer[0], VR_offscreen_buffer, 0, 0, render_w, render_h );
-//             gr_init_sub_canvas( &VR_render_buffer[1], VR_offscreen_buffer, 0, render_h, render_w, render_h );
-       }
-       else if (GRMODEINFO(paged) && !GRMODEINFO(dbuf)) {
-       //      Here we will make the VR_offscreen_buffer the 2nd page and hopefully
-       //      we can just flip it, saving a blt.
-
-               dd_VR_offscreen_buffer = dd_grd_backcanv;
-               VR_offscreen_buffer = & dd_grd_backcanv->canvas;
-       }
-       else if (GRMODEINFO(dbuf)||GRMODEINFO(emul)) {
-       //      The offscreen buffer will be created.  We will just blt this
-       //      to the screen (which may be blted to the primary surface)
-               if ( render_h < 200 ) {
-                       dd_VR_offscreen_buffer = dd_gr_create_canvas(render_w, 200);
-                       VR_offscreen_buffer = &dd_VR_offscreen_buffer->canvas;
-               }
-               else {
-                       dd_VR_offscreen_buffer = dd_gr_create_canvas(render_w, render_h);
-                       VR_offscreen_buffer = &dd_VR_offscreen_buffer->canvas;
-               }
-       }
-
-       dd_gr_init_sub_canvas( &dd_VR_render_buffer[0], dd_VR_offscreen_buffer, 0, 0, render_w, render_h );
-       dd_gr_init_sub_canvas( &dd_VR_render_buffer[1], dd_VR_offscreen_buffer, 0, 0, render_w, render_h );
-       gr_init_sub_canvas( &VR_render_buffer[0], VR_offscreen_buffer, 0, 0, render_w, render_h );
-       gr_init_sub_canvas( &VR_render_buffer[1], VR_offscreen_buffer, 0, 0, render_w, render_h );
-
-       game_init_render_sub_buffers( 0, 0, render_w, render_h );
-}
-
-#else
-
 // Sets up the canvases we will be rendering to (NORMAL VERSION)
 void game_init_render_buffers(int screen_mode, int render_w, int render_h, int render_method, int flags )
 {
@@ -769,7 +555,6 @@ void game_init_render_buffers(int screen_mode, int render_w, int render_h, int r
 
        game_init_render_sub_buffers( 0, 0, render_w, render_h );
 }
-#endif
 
 //called to get the screen in a mode compatible with popup menus.
 //if we can't have popups over the game screen, switch to menu mode.
@@ -791,10 +576,6 @@ void set_popup_screen(void)
 //mode if cannot init requested mode)
 int set_screen_mode(int sm)
 {
-WIN(static int force_mode_change=0);
-WIN(static int saved_window_w);
-WIN(static int saved_window_h);
-
 #if 0 //def EDITOR
        if ( (sm==SCREEN_MENU) && (Screen_mode==SCREEN_EDITOR) )        {
                gr_set_current_canvas( Canv_editor );
@@ -802,17 +583,10 @@ WIN(static int saved_window_h);
        }
 #endif
 
-#ifdef WINDOWS
-       if ( Screen_mode == sm && W95DisplayMode == VR_screen_mode) {
-               dd_gr_set_current_canvas( &dd_VR_screen_pages[VR_current_page] );
-               return 1;
-       }
-#else
        if ( Screen_mode == sm && VGA_current_mode == VR_screen_mode) {
                gr_set_current_canvas( &VR_screen_pages[VR_current_page] );
                return 1;
        }
-#endif
 
 #ifdef OGL
        if ((Screen_mode == sm) && !((sm==SCREEN_GAME) && (grd_curscreen->sc_mode != VR_screen_mode) && (Screen_mode == SCREEN_GAME))) {
@@ -831,35 +605,6 @@ WIN(static int saved_window_h);
        switch( Screen_mode )
        {
                case SCREEN_MENU:
-               #ifdef WINDOWS
-                       //mouse_set_mode(0);
-                       //ShowCursorW();
-                       if (!(VR_screen_flags & VRF_COMPATIBLE_MENUS)) {
-                       // HACK!!!  Meant to save window size when switching from
-                       // non-compat menu mode to menu mode.
-                               saved_window_w = Game_window_w;
-                               saved_window_h = Game_window_h;
-                               force_mode_change = 1;
-                       }
-                       if (W95DisplayMode != SM95_640x480x8) {
-//@@                           piggy_bitmap_page_out_all_w();          // 2D GFX Flush cache.
-                               DDSETDISPLAYMODE(SM95_640x480x8);
-                               dd_gr_init_screen();
-                               if (!gr_palette_faded_out) gr_palette_load(gr_palette);
-                       }
-
-                       dd_gr_init_sub_canvas(&dd_VR_screen_pages[0], dd_grd_screencanv,
-                                                                       0,0,
-                                                                       dd_grd_screencanv->canvas.cv_bitmap.bm_w,
-                                                                       dd_grd_screencanv->canvas.cv_bitmap.bm_h);
-                       dd_gr_init_sub_canvas(&dd_VR_screen_pages[1], dd_grd_screencanv,
-                                                                       0,0,
-                                                                       dd_grd_screencanv->canvas.cv_bitmap.bm_w,
-                                                                       dd_grd_screencanv->canvas.cv_bitmap.bm_h);
-                       MenuHires = 1;
-                       FontHires = FontHiresAvailable;
-
-               #else
                {
                        int menu_mode;
 
@@ -880,26 +625,9 @@ WIN(static int saved_window_h);
                        FontHires = FontHiresAvailable && MenuHires;
 
                }
-               #endif
                break;
 
        case SCREEN_GAME:
-       #ifdef WINDOWS
-               //mouse_set_mode(1);
-               HideCursorW();
-               if (force_mode_change || (W95DisplayMode != VR_screen_mode)) {
-
-                       DDSETDISPLAYMODE(VR_screen_mode);
-//@@                   piggy_bitmap_page_out_all_w();          // 2D GFX Flush cache.
-                       dd_gr_init_screen();
-                       mprintf((0, "Reinitializing render buffers due to display mode change.\n"));
-                       game_init_render_buffers(W95DisplayMode,
-                                       GRMODEINFO(rw), GRMODEINFO(rh),
-                                       VR_render_mode, VR_screen_flags);
-
-                       reset_cockpit();
-               }
-       #else
                if (VGA_current_mode != VR_screen_mode) {
                        if (gr_set_mode(VR_screen_mode))        {
                                Error("Cannot set desired screen mode for game!");
@@ -911,7 +639,6 @@ WIN(static int saved_window_h);
                        #endif
                        reset_cockpit();
                }
-       #endif
 
                if ( VR_render_mode == VR_NONE )
                {
@@ -934,46 +661,18 @@ WIN(static int saved_window_h);
                else
                        Cockpit_mode = CM_FULL_SCREEN;
 
-               #ifdef WINDOWS
-               //      Super hack.   If we are switching from a 320x200 game to 640x480.
-               //                                              and we were in a menumode when switching, we don't
-               //                                              restore Game_window vals
-                       if (force_mode_change && (W95DisplayMode == SM95_320x200x8X)) {
-                               Game_window_w = saved_window_w;
-                               Game_window_h = saved_window_h;
-                               force_mode_change = 0;
-                       }
-               #endif
-
-
        //      Define screen pages for game mode
        // If we designate through screen_flags to use paging, then do so.
-               WINDOS(
-                       dd_gr_init_sub_canvas( &dd_VR_screen_pages[0], dd_grd_screencanv, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h ),
-                       gr_init_sub_canvas( &VR_screen_pages[0], &grd_curscreen->sc_canvas, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h )
-               );
-
-               if ( VR_screen_flags&VRF_USE_PAGING ) {
-               WINDOS(
-                       dd_gr_init_sub_canvas( &dd_VR_screen_pages[1], dd_grd_backcanv, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h ),
-                       gr_init_sub_canvas( &VR_screen_pages[1], &grd_curscreen->sc_canvas, 0, grd_curscreen->sc_h, grd_curscreen->sc_w, grd_curscreen->sc_h )
-               );
-               }
-               else {
-               WINDOS (
-                       dd_gr_init_sub_canvas( &dd_VR_screen_pages[1], dd_grd_screencanv, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h ),
-                       gr_init_sub_canvas( &VR_screen_pages[1], &grd_curscreen->sc_canvas, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h )
-               );
-               }
+               gr_init_sub_canvas( &VR_screen_pages[0], &grd_curscreen->sc_canvas, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
+
+               if ( VR_screen_flags&VRF_USE_PAGING )
+                       gr_init_sub_canvas( &VR_screen_pages[1], &grd_curscreen->sc_canvas, 0, grd_curscreen->sc_h, grd_curscreen->sc_w, grd_curscreen->sc_h );
+               else
+                       gr_init_sub_canvas( &VR_screen_pages[1], &grd_curscreen->sc_canvas, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
 
                init_cockpit();
 
-       #ifdef WINDOWS
-               FontHires = FontHiresAvailable && (Current_display_mode != 0);
-               MenuHires = 1;
-       #else
                FontHires = FontHiresAvailable && (MenuHires = ((Current_display_mode != 0) && (Current_display_mode != 2)));
-       #endif
 
                if ( VR_render_mode != VR_NONE )        {
                        // for 640x480 or higher, use hires font.
@@ -1010,17 +709,10 @@ WIN(static int saved_window_h);
 
        VR_current_page = 0;
 
-       WINDOS(
-               dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-               gr_set_current_canvas( &VR_screen_pages[VR_current_page] )
-       );
+               gr_set_current_canvas( &VR_screen_pages[VR_current_page] );
 
-       if ( VR_screen_flags&VRF_USE_PAGING )   {
-       WINDOS(
-               dd_gr_flip(),
-               gr_show_canvas( &VR_screen_pages[VR_current_page] )
-       );
-       }
+       if ( VR_screen_flags&VRF_USE_PAGING )
+               gr_show_canvas( &VR_screen_pages[VR_current_page] );
 #ifdef OGL
        ogl_set_screen_mode();
 #endif
@@ -1375,11 +1067,7 @@ end:
 #ifndef OGL
 void save_screen_shot(int automap_flag)
 {
-#if defined(WINDOWS)
-       mprintf((0, "Doing screen shot thing.\n"));
-       win95_save_pcx_shot();
-
-#elif !defined(MACINTOSH)
+#if !defined(MACINTOSH)
        fix t1;
        char message[100];
        grs_canvas *screen_canv=&grd_curscreen->sc_canvas;
@@ -1807,9 +1495,7 @@ extern void gr_palette_step_up_vr( int r, int g, int b, int white, int black );
 void game_palette_step_up( int r, int g, int b )
 {
        if ( VR_use_reg_code )  {
-       #ifndef WINDOWS
 //             gr_palette_step_up_vr( r, g, b, VR_WHITE_INDEX, VR_BLACK_INDEX );
-       #endif
        } else {
                gr_palette_step_up( r, g, b );
        }
@@ -2115,7 +1801,7 @@ void game_setup(void)
        //keyd_repeat = 0;                // Don't allow repeat in game
        keyd_repeat = 1;                // Do allow repeat in game
 
-#if !defined(WINDOWS) && !defined(MACINTOSH)
+#ifdef __MSDOS__
        //_MARK_("start of game");
 #endif
 
@@ -2182,18 +1868,6 @@ void game()
 
                        player_shields = Players[Player_num].shields;
 
-               #ifdef WINDOWS
-               {
-                       MSG msg;
-                       DoMessageStuff(&msg);           // Do Windows event handling.
-                       if (_RedrawScreen) {
-                               _RedrawScreen = FALSE;
-                               load_palette(Current_level_palette,1,1);
-                               gr_palette_load(gr_palette);
-                       }
-               }
-               #endif          
-
                        ExtGameStatus=GAMESTAT_RUNNING;
                        GameLoop( 1, 1 );               // Do game loop with rendering and reading controls.
 
@@ -2205,11 +1879,9 @@ void game()
                        songs_check_redbook_repeat();   // Handle RedBook Audio Repeating.
 
                        if (Config_menu_flag)   {
-                               //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 (!(Game_mode&GM_MULTI)) palette_restore();
-                               //WIN(mouse_set_mode(1));
                        }
 
                        if (Automap_flag) {
@@ -2304,7 +1976,7 @@ void game()
 //@@           scores_maybe_add_player(Game_aborted);
 //@@   }
 
-#if !defined(WINDOWS) && !defined(MACINTOSH)
+#ifdef __MSDOS__
        //_MARK_("end of game");
 #endif
 
@@ -2320,26 +1992,16 @@ void game()
 //called at the end of the program
 void close_game()
 {
-#ifdef WINDOWS
-       if (dd_VR_offscreen_buffer) {
-               if (dd_grd_backcanv != dd_VR_offscreen_buffer) {
-                       dd_gr_free_canvas(dd_VR_offscreen_buffer);
-               }
-               dd_VR_offscreen_buffer = NULL;
-               VR_offscreen_buffer = NULL;
-       }
-#else
        if (VR_offscreen_buffer)        {
                gr_free_canvas(VR_offscreen_buffer);
                VR_offscreen_buffer = NULL;
        }
-#endif
 
        close_gauge_canvases();
 
        restore_effect_bitmap_icons();
 
-#if !defined(MACINTOSH) && !defined(WINDOWS)
+#ifdef __MSDOS__
        if (Game_cockpit_copy_code)     {
                d_free(Game_cockpit_copy_code);
                Game_cockpit_copy_code = NULL;
@@ -2355,19 +2017,10 @@ void close_game()
        clear_warn_func(game_show_warning);     //don't use this func anymore
 }
 
-#ifdef WINDOWS
-dd_grs_canvas * get_current_game_screen()
-{
-       return &dd_VR_screen_pages[VR_current_page];
-}
-
-#else
-
 grs_canvas * get_current_game_screen()
 {
        return &VR_screen_pages[VR_current_page];
 }
-#endif
 
 
 extern void kconfig_center_headset();
@@ -2568,24 +2221,6 @@ void GameLoop(int RenderFlag, int ReadControlsFlag )
                        for (i=0; i<1000; i++)
                                j += i;
        }
-       #endif
-
-       #ifdef WINDOWS
-       {
-               static int desc_dead_countdown=100;   /*  used if player shouldn't be playing */
-
-               if (desc_id_exit_num) {                          // are we supposed to be checking
-                       if (!(--desc_dead_countdown)) {// if so, at zero, then pull the plug
-                               char time_str[32], time_str2[32];
-
-                               _ctime(&t_saved_time, time_str);
-                               _ctime(&t_current_time, time_str2);
-
-                               Error ("EXPIRES %s.  YOUR TIME %s.\n", time_str, time_str2);
-                               Error ("Loading overlay -- error number: %d\n", (int)desc_id_exit_num);
-                       }
-               }
-       }
        #endif
 
                #ifndef RELEASE
@@ -3230,85 +2865,6 @@ void show_free_objects(void)
 
 #endif
 
-#ifdef WINDOWS
-void game_win_init_cockpit_mask(int sram)
-{
-       if (dd_VR_offscreen_buffer && dd_VR_offscreen_buffer != dd_grd_backcanv) {
-               dd_gr_free_canvas(dd_VR_offscreen_buffer);
-       }
-
-       if (GRMODEINFO(paged) && !GRMODEINFO(dbuf)) {
-       //      Here we will make the VR_offscreen_buffer the 2nd page and hopefully
-       //      we can just flip it, saving a blt.
-               Int3();
-       }
-       else if (GRMODEINFO(dbuf)||GRMODEINFO(emul)) {
-       //      The offscreen buffer will be created.  We will just blt this
-       //      to the screen (which may be blted to the primary surface)
-               if ( grd_curscreen->sc_h < 200 ) {
-                       dd_VR_offscreen_buffer = dd_gr_create_canvas(grd_curscreen->sc_w, 200);
-                       VR_offscreen_buffer = &dd_VR_offscreen_buffer->canvas;
-                       if (sram) {
-                               DDFreeSurface(dd_VR_offscreen_buffer->lpdds);
-                               dd_VR_offscreen_buffer->lpdds = DDCreateSysMemSurface(grd_curscreen->sc_w, 200);
-                               dd_VR_offscreen_buffer->sram = 1;
-                       }
-               }
-               else {
-                       dd_VR_offscreen_buffer = dd_gr_create_canvas(grd_curscreen->sc_w, grd_curscreen->sc_h);
-                       VR_offscreen_buffer = &dd_VR_offscreen_buffer->canvas;
-                       if (sram) {
-                               DDFreeSurface(dd_VR_offscreen_buffer->lpdds);
-                               dd_VR_offscreen_buffer->lpdds = DDCreateSysMemSurface(grd_curscreen->sc_w, grd_curscreen->sc_h);
-                               dd_VR_offscreen_buffer->sram = 1;
-                       }
-               }
-       }
-
-       dd_gr_init_sub_canvas( &dd_VR_render_buffer[0], dd_VR_offscreen_buffer, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
-       dd_gr_init_sub_canvas( &dd_VR_render_buffer[1], dd_VR_offscreen_buffer, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
-       gr_init_sub_canvas( &VR_render_buffer[0], VR_offscreen_buffer, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
-       gr_init_sub_canvas( &VR_render_buffer[1], VR_offscreen_buffer, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
-
-       game_init_render_sub_buffers( 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
-}
-
-//@@void game_win_init_cockpit_mask()
-//@@{
-//@@   char title_pal[768];
-//@@   dd_grs_canvas ccanv;
-//@@   int pcx_error;
-//@@   LPDIRECTDRAWSURFACE dds;
-//@@
-//@@   dds = DDCreateSurface(GRMODEINFO(w), GRMODEINFO(h), 1);
-//@@   Assert(dds != NULL);
-//@@   
-//@@   _lpDDSMask = dds;
-//@@   ccanv.lpdds = dds;
-//@@   dd_gr_reinit_canvas(&ccanv);
-//@@
-//@@   dd_gr_set_current_canvas(&ccanv);
-//@@   DDGRLOCK(dd_grd_curcanv)
-//@@   {
-//@@           if (W95DisplayMode == SM95_640x480x8) {
-//@@                   pcx_error=pcx_read_bitmap( "MASKB.PCX", &grd_curcanv->cv_bitmap,
-//@@                           grd_curcanv->cv_bitmap.bm_type,
-//@@                           title_pal );
-//@@           }
-//@@           else {
-//@@                   pcx_error=pcx_read_bitmap( "MASK.PCX", &grd_curcanv->cv_bitmap,
-//@@                           grd_curcanv->cv_bitmap.bm_type,
-//@@                           title_pal );
-//@@           }
-//@@   }
-//@@   DDGRUNLOCK(dd_grd_curcanv);
-//@@
-//@@   Assert(pcx_error == PCX_ERROR_NONE);
-//@@   Game_cockpit_copy_code = (ubyte *)(0xABADC0DE);
-//@@}
-
-#endif
-
 /*
  * reads a flickering_light structure from a CFILE
  */
index be5680d..56bf9a8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: game.h,v 1.12 2005-07-30 09:16:25 chris Exp $ */
+/* $Id: game.h,v 1.13 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -28,18 +28,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 
 //#include "segment.h"
 
-#ifdef WINDOWS
-typedef struct cockpit_span_line {
-       short num;
-       struct {
-               short xmin, xmax;
-       } span[5];
-} cockpit_span_line;
-
-extern cockpit_span_line win_cockpit_mask[480];
-#endif
-
-
 // from mglobal.c
 extern fix FrameTime;               // time in seconds since last frame
 extern fix RealFrameTime;           // time in seconds since last frame
@@ -174,9 +162,7 @@ extern void reset_time(void);       // called when starting level
 // If automap_flag == 1, then call automap routine to write message.
 extern void save_screen_shot(int automap_flag);
 
-#ifndef WINDOWS
 extern grs_canvas * get_current_game_screen();
-#endif
 
 //valid modes for cockpit
 #define CM_FULL_COCKPIT     0   // normal screen with cockput
index 7cc5c0f..2007e41 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gamecntl.c,v 1.27 2005-07-30 09:16:25 chris Exp $ */
+/* $Id: gamecntl.c,v 1.28 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -511,35 +511,7 @@ int do_game_pause()
        {
                int screen_changed;
 
-       #if defined (WINDOWS)
-
-               if (!(VR_screen_flags & VRF_COMPATIBLE_MENUS)) {
-                       show_boxed_message(msg);
-               }
-
-       SkipPauseStuff:
-
-               while (!(key = key_inkey()))
-               {
-                       MSG wmsg;
-                       DoMessageStuff(&wmsg);
-                       if (_RedrawScreen) {
-                               mprintf((0, "Redrawing paused screen.\n"));
-                               _RedrawScreen = FALSE;
-                               if (VR_screen_flags & VRF_COMPATIBLE_MENUS) 
-                                       game_render_frame();
-                               Screen_mode = -1;
-                               set_popup_screen();
-                               gr_palette_load(gr_palette);
-                               show_boxed_message(msg);
-                               if (Cockpit_mode==CM_FULL_COCKPIT || Cockpit_mode==CM_STATUS_BAR)
-                                       if (!GRMODEINFO(modex)) render_gauges();
-                       }
-               }
-
-       #else
                key = key_getch();
-       #endif
 
                #ifndef RELEASE
                HandleTestKey(key);
@@ -547,13 +519,6 @@ int do_game_pause()
                
                screen_changed = HandleSystemKey(key);
 
-       #ifdef WINDOWS
-               if (screen_changed == -1) {
-                       nm_messagebox(NULL,1, TXT_OK, "Unable to do this\noperation while paused under\n320x200 mode"); 
-                       goto SkipPauseStuff;
-               }
-       #endif
-
                HandleVRKey(key);
 
                if (screen_changed) {
@@ -1134,14 +1099,6 @@ int HandleSystemKey(int key)
                MAC(case KEY_COMMAND+KEY_3:)
 
                case KEY_F3:
-                       #ifdef WINDOWS          // HACK! these shouldn't work in 320x200 pause or in letterbox.
-                               if (Player_is_dead) break;
-                               if (!(VR_screen_flags&VRF_COMPATIBLE_MENUS) && Game_paused) {
-                                       screen_changed = -1;
-                                       break;
-                               }
-                       #endif
-       
                        if (!(Guided_missile[Player_num] && Guided_missile[Player_num]->type==OBJ_WEAPON && Guided_missile[Player_num]->id==GUIDEDMISS_ID && Guided_missile[Player_num]->signature==Guided_missile_sig[Player_num] && Guided_in_big_window))
                        {
                                toggle_cockpit();       screen_changed=1;
@@ -1153,28 +1110,12 @@ int HandleSystemKey(int key)
 
                case KEY_SHIFTED+KEY_MINUS:
                case KEY_MINUS: 
-               #ifdef WINDOWS
-                       if (Player_is_dead) break;
-                       if (!(VR_screen_flags&VRF_COMPATIBLE_MENUS) && Game_paused) {
-                               screen_changed = -1;
-                               break;
-                       }
-               #endif
-
                        shrink_window(); 
                        screen_changed=1; 
                        break;
 
                case KEY_SHIFTED+KEY_EQUAL:
                case KEY_EQUAL:                 
-               #ifdef WINDOWS
-                       if (Player_is_dead) break;
-                       if (!(VR_screen_flags&VRF_COMPATIBLE_MENUS) && Game_paused) {
-                               screen_changed = -1;
-                               break;
-                       }
-               #endif
-
                        grow_window();  
                        screen_changed=1; 
                        break;
index a5b8e2d..67dcf18 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gamerend.c,v 1.18 2005-07-30 09:16:25 chris Exp $ */
+/* $Id: gamerend.c,v 1.19 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -23,12 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: gamerend.c,v 1.18 2005-07-30 09:16:25 chris Exp $";
-#endif
-
-#ifdef WINDOWS
-#include "desw.h"
-#include "winapp.h"
+static char rcsid[] = "$Id: gamerend.c,v 1.19 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 #include <stdio.h>
@@ -76,12 +71,6 @@ extern int Current_display_mode;
 extern cvar_t r_framerate;
 
 
-#ifdef WINDOWS
-cockpit_span_line win_cockpit_mask[480];
-void win_do_emul_ibitblt(dd_grs_canvas *csrc, dd_grs_canvas *cdest);
-#endif
-
-
 #ifndef NDEBUG
 extern int Debug_pause;                                //John's debugging pause system
 #endif
@@ -544,7 +533,6 @@ void game_render_frame_stereo()
 
                Viewer = Guided_missile[Player_num];
 
-               WIN(DDGRLOCK(dd_grd_curcanv));  // Must lock DD canvas!!!
                {
                        update_rendered_data(0, Viewer, 0, 0);
                        render_frame(0, 0);
@@ -560,9 +548,8 @@ void game_render_frame_stereo()
 
                        draw_guided_crosshair();
                }
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
 
-                       HUD_render_message_frame();
+               HUD_render_message_frame();
 
                no_draw_hud=1;
        }
@@ -917,53 +904,28 @@ void show_extra_views()
 
 int BigWindowSwitch=0;
 extern int force_cockpit_redraw;
-#ifndef MACINTOSH
 extern ubyte * Game_cockpit_copy_code;
-#else
-extern ubyte Game_cockpit_copy_code;
-#endif
 
 void draw_guided_crosshair(void);
 
 
 //render a frame for the game
-//             WINDOWS:
-//                     will render everything to dd_VR_render_sub_buffer
-//                     which all leads to the dd_VR_offscreen_buffer
 void game_render_frame_mono(void)
 {
-       WINDOS (
-               dd_grs_canvas Screen_3d_window,
-               grs_canvas Screen_3d_window
-       );
+       grs_canvas Screen_3d_window;
        int no_draw_hud=0;
        
 
-       WINDOS (
-               dd_gr_init_sub_canvas(&Screen_3d_window, &dd_VR_screen_pages[0],
-                       dd_VR_render_sub_buffer[0].canvas.cv_bitmap.bm_x, 
-                       dd_VR_render_sub_buffer[0].canvas.cv_bitmap.bm_y, 
-                       dd_VR_render_sub_buffer[0].canvas.cv_bitmap.bm_w, 
-                       dd_VR_render_sub_buffer[0].canvas.cv_bitmap.bm_h),
-               gr_init_sub_canvas( &Screen_3d_window, &VR_screen_pages[0], 
-                       VR_render_sub_buffer[0].cv_bitmap.bm_x, 
-                       VR_render_sub_buffer[0].cv_bitmap.bm_y, 
-                       VR_render_sub_buffer[0].cv_bitmap.bm_w, 
-                       VR_render_sub_buffer[0].cv_bitmap.bm_h)
-       );
-
-       if ( Game_double_buffer ) {     
-               WINDOS(
-                       dd_gr_set_current_canvas(&dd_VR_render_sub_buffer[0]),
-                       gr_set_current_canvas(&VR_render_sub_buffer[0])
-               );
-       }
-       else    {
-               WINDOS(
-                       dd_gr_set_current_canvas(&Screen_3d_window),
-                       gr_set_current_canvas(&Screen_3d_window)
-               );
-       }
+       gr_init_sub_canvas( &Screen_3d_window, &VR_screen_pages[0], 
+               VR_render_sub_buffer[0].cv_bitmap.bm_x, 
+               VR_render_sub_buffer[0].cv_bitmap.bm_y, 
+               VR_render_sub_buffer[0].cv_bitmap.bm_w, 
+               VR_render_sub_buffer[0].cv_bitmap.bm_h);
+
+       if ( Game_double_buffer )
+               gr_set_current_canvas(&VR_render_sub_buffer[0]);
+       else
+               gr_set_current_canvas(&Screen_3d_window);
        
        if (Guided_missile[Player_num] && Guided_missile[Player_num]->type==OBJ_WEAPON && Guided_missile[Player_num]->id==GUIDEDMISS_ID && Guided_missile[Player_num]->signature==Guided_missile_sig[Player_num] && Guided_in_big_window) {
                char *msg = "Guided Missile View";
@@ -980,7 +942,6 @@ void game_render_frame_mono(void)
   
                Viewer = Guided_missile[Player_num];
 
-               WIN(DDGRLOCK(dd_grd_curcanv));  // Must lock DD canvas!!!
                {
                        update_rendered_data(0, Viewer, 0, 0);
                        render_frame(0, 0);
@@ -996,9 +957,8 @@ void game_render_frame_mono(void)
 
                        draw_guided_crosshair();
                }
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
 
-                       HUD_render_message_frame();
+               HUD_render_message_frame();
 
                no_draw_hud=1;
        }
@@ -1011,43 +971,20 @@ void game_render_frame_mono(void)
                   BigWindowSwitch=0;
                        return;
                 }
-               WIN(DDGRLOCK(dd_grd_curcanv));  // Must lock DD canvas!!!
                update_rendered_data(0, Viewer, Rear_view, 0);
                render_frame(0, 0);
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
         }
 
-       if ( Game_double_buffer ) {     
-               WINDOS(
-                       dd_gr_set_current_canvas(&dd_VR_render_sub_buffer[0]),
-                       gr_set_current_canvas(&VR_render_sub_buffer[0])
-               );
-       }
-       else    {
-               WINDOS(
-                       dd_gr_set_current_canvas(&Screen_3d_window),
-                       gr_set_current_canvas(&Screen_3d_window)
-               );
-       }
+       if ( Game_double_buffer )
+               gr_set_current_canvas(&VR_render_sub_buffer[0]);
+       else
+               gr_set_current_canvas(&Screen_3d_window);
 
-       if (!no_draw_hud)       {
-               WIN(DDGRLOCK(dd_grd_curcanv));
+       if (!no_draw_hud)
                game_draw_hud_stuff();
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
-       }
 
        show_extra_views();             //missile view, buddy bot, etc.
 
-#ifdef WINDOWS
-       if (Game_paused) {              //render pause message over off-screen 3d (to minimize flicker)
-               extern char *Pause_msg;
-//             LPDIRECTDRAWSURFACE save_dds = dd_VR_screen_pages[VR_current_page].lpdds;
-
-//             dd_VR_screen_pages[VR_current_page].lpdds = dd_VR_render_buffer[VR_current_page].lpdds;
-               show_boxed_message(Pause_msg);
-//             dd_VR_screen_pages[VR_current_page].lpdds = save_dds;
-       }
-#else
        if (Game_paused) {              //render pause message over off-screen 3d (to minimize flicker)
                extern char *Pause_msg;
                ubyte *save_data = VR_screen_pages[VR_current_page].cv_bitmap.bm_data;
@@ -1056,44 +993,17 @@ void game_render_frame_mono(void)
                show_boxed_message(Pause_msg);
                VR_screen_pages[VR_current_page].cv_bitmap.bm_data=save_data;
        }
-#endif
 
        if ( Game_double_buffer ) {             //copy to visible screen
                if ( !Game_cockpit_copy_code )  {
                        if ( VR_screen_flags&VRF_USE_PAGING )   {       
                                VR_current_page = !VR_current_page;
-                               #ifdef WINDOWS
-                                       dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]);
-                                       dd_gr_flip();
-                               #else
-                                       gr_set_current_canvas( &VR_screen_pages[VR_current_page] );
-                                       gr_bm_ubitblt( 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[VR_current_page].cv_bitmap );
-                                       gr_wait_for_retrace = 0;
-                                       gr_show_canvas( &VR_screen_pages[VR_current_page] );
-                                       gr_wait_for_retrace = 1;
-                               #endif
+                               gr_set_current_canvas( &VR_screen_pages[VR_current_page] );
+                               gr_bm_ubitblt( 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[VR_current_page].cv_bitmap );
+                               gr_wait_for_retrace = 0;
+                               gr_show_canvas( &VR_screen_pages[VR_current_page] );
+                               gr_wait_for_retrace = 1;
                        } else {
-                       #ifdef WINDOWS    
-                               if (GRMODEINFO(emul) || GRMODEINFO(modex) || GRMODEINFO(dbuf))
-                                       // From render buffer to screen buffer.
-                                       dd_gr_blt_notrans(&dd_VR_render_sub_buffer[0],
-                                               0,0,
-                                               dd_VR_render_sub_buffer[0].canvas.cv_w,
-                                               dd_VR_render_sub_buffer[0].canvas.cv_h,
-                                               dd_grd_screencanv,
-                                               dd_VR_render_sub_buffer[0].xoff, 
-                                               dd_VR_render_sub_buffer[0].yoff, 
-                                               dd_VR_render_sub_buffer[0].canvas.cv_w,
-                                               dd_VR_render_sub_buffer[0].canvas.cv_h);
-
-                                       DDGRRESTORE;
-                       // Puts back canvas to front canvas by blt or flip
-                               if (GRMODEINFO(modex)) {
-                                       //@@VR_current_page = !VR_current_page;
-                                       //@@dd_gr_flip();
-                                       win_flip = 1;
-                               }
-                       #else
                                gr_bm_ubitblt( VR_render_sub_buffer[0].cv_w, 
                                                VR_render_sub_buffer[0].cv_h, 
                                                VR_render_sub_buffer[0].cv_bitmap.bm_x, 
@@ -1101,24 +1011,13 @@ void game_render_frame_mono(void)
                                                0, 0, 
                                                &VR_render_sub_buffer[0].cv_bitmap, 
                                                &VR_screen_pages[0].cv_bitmap );
-                       #endif
                        }
                } else  {
-                       #ifdef WINDOWS
-                               win_do_emul_ibitblt( &dd_VR_render_sub_buffer[0], dd_grd_screencanv);
-                               DDGRRESTORE;
-                               if (GRMODEINFO(modex)) {
-                                       //@@VR_current_page = !VR_current_page;
-                                       //@@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
                }
        }
 
@@ -1133,13 +1032,6 @@ void game_render_frame_mono(void)
                        Game_mode = GM_NORMAL;
        }
 
-#ifdef WINDOWS
-       if (win_flip) {
-               VR_current_page = !VR_current_page;
-               dd_gr_flip();
-       }
-#endif
-
        con_update();
 
        gr_update();
@@ -1263,8 +1155,6 @@ void copy_background_rect(int left,int top,int right,int bot)
        ofs_y = top % bm->bm_h;
        dest_y = top;
 
-WIN(DDGRLOCK(dd_grd_curcanv))
-{
        for (y=tile_top;y<=tile_bot;y++) {
                int w,h;
 
@@ -1289,15 +1179,8 @@ WIN(DDGRLOCK(dd_grd_curcanv))
                ofs_y = 0;
                dest_y += h;
        }
-} 
-WIN(DDGRUNLOCK(dd_grd_curcanv));
-
 }
 
-#ifdef WINDOWS
-int force_background_fill=0;
-#endif
-
 //fills int the background surrounding the 3d window
 void fill_background()
 {
@@ -1311,51 +1194,23 @@ void fill_background()
        dx = x;
        dy = y;
 
-       WINDOS( dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-                               gr_set_current_canvas(&VR_screen_pages[VR_current_page])
-       );
+       gr_set_current_canvas(&VR_screen_pages[VR_current_page]);
        copy_background_rect(x-dx,y-dy,x-1,y+h+dy-1);
        copy_background_rect(x+w,y-dy,grd_curcanv->cv_w-1,y+h+dy-1);
        copy_background_rect(x,y-dy,x+w-1,y-1);
        copy_background_rect(x,y+h,x+w-1,y+h+dy-1);
 
-#ifdef WINDOWS
-       if (GRMODEINFO(modex)) {
-               copy_background_rect(x-dx,y-dy,x-1,y+h+dy-1);
-               copy_background_rect(x+w,y-dy,grd_curcanv->cv_w-1,y+h+dy-1);
-               copy_background_rect(x,y-dy,x+w-1,y-1);
-               copy_background_rect(x,y+h,x+w-1,y+h+dy-1);
-       }
-#endif
-
        if (VR_screen_flags & VRF_USE_PAGING) {
-               WINDOS( dd_gr_set_current_canvas(&dd_VR_screen_pages[!VR_current_page]),
-                                       gr_set_current_canvas(&VR_screen_pages[!VR_current_page])
-               );
+               gr_set_current_canvas(&VR_screen_pages[!VR_current_page]);
                copy_background_rect(x-dx,y-dy,x-1,y+h+dy-1);
                copy_background_rect(x+w,y-dy,x+w+dx-1,y+h+dy-1);
                copy_background_rect(x,y-dy,x+w-1,y-1);
                copy_background_rect(x,y+h,x+w-1,y+h+dy-1);
        }
-
-       #ifdef WINDOWS
-       if (GRMODEINFO(modex) && force_background_fill==0)              //double-buffered
-               force_background_fill=2;
-       #endif
 }
 
 void shrink_window()
 {
-       #ifdef WINDOWS
-       //When you shrink the window twice in two frames, the background doens't
-       //restore properly.  So this hack keeps you from shrinking the window
-       //before two frames have been drawn
-       static int last_shrink_framecount=-1;
-       if (FrameCount - last_shrink_framecount < 2)
-               return;
-       last_shrink_framecount = FrameCount;
-       #endif
-       
        mprintf((0,"%d ",FrameCount));
 
 //  mprintf ((0,"W=%d H=%d\n",Game_window_w,Game_window_h));
@@ -1426,15 +1281,10 @@ void update_cockpits(int force_redraw)
        switch( Cockpit_mode )  {
        case CM_FULL_COCKPIT:
        case CM_REAR_VIEW:
-       WINDOS(
-               dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-               gr_set_current_canvas(&VR_screen_pages[VR_current_page])
-       );
+               gr_set_current_canvas(&VR_screen_pages[VR_current_page]);
                PIGGY_PAGE_IN(cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)]);
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
                gr_ubitmapm(0,0, &GameBitmaps[cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)].index]);   
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
                break;
 
        case CM_FULL_SCREEN:
@@ -1445,15 +1295,10 @@ void update_cockpits(int force_redraw)
 
        case CM_STATUS_BAR:
 
-                       WINDOS (        dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-                                               gr_set_current_canvas(&VR_screen_pages[VR_current_page])
-                       );
+               gr_set_current_canvas(&VR_screen_pages[VR_current_page]);
 
-                       PIGGY_PAGE_IN(cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)]);
-                       
-                       WIN(DDGRLOCK(dd_grd_curcanv));
-                               gr_ubitmapm(0,max_window_h,&GameBitmaps[cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)].index]);
-                       WIN(DDGRUNLOCK(dd_grd_curcanv));
+               PIGGY_PAGE_IN(cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)]);
+               gr_ubitmapm(0,max_window_h,&GameBitmaps[cockpit_bitmap[Cockpit_mode+(Current_display_mode?(Num_cockpits/2):0)].index]);
        
                Game_window_x = (max_window_w - Game_window_w)/2;
                Game_window_y = (max_window_h - Game_window_h)/2;
@@ -1461,11 +1306,8 @@ void update_cockpits(int force_redraw)
                break;
 
        case CM_LETTERBOX:
-               WINDOS( dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-                                       gr_set_current_canvas(&VR_screen_pages[VR_current_page])
-               );
-               WINDOS ( dd_gr_clear_canvas( BM_XRGB(0,0,0) ),
-                                       gr_clear_canvas( BM_XRGB(0,0,0) ) );
+               gr_set_current_canvas(&VR_screen_pages[VR_current_page]);
+               gr_clear_canvas( BM_XRGB(0,0,0) );
 
                // In a modex mode, clear the other buffer.
                if (grd_curcanv->cv_bitmap.bm_type == BM_MODEX) {
@@ -1477,9 +1319,7 @@ void update_cockpits(int force_redraw)
 
        }
 
-       WINDOS (        dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-                               gr_set_current_canvas(&VR_screen_pages[VR_current_page])
-       );
+       gr_set_current_canvas(&VR_screen_pages[VR_current_page]);
 
        if (Cockpit_mode != last_drawn_cockpit[VR_current_page] || force_redraw )
                last_drawn_cockpit[VR_current_page] = Cockpit_mode;
@@ -1498,13 +1338,6 @@ void game_render_frame()
 
        update_cockpits(0);
 
-       #ifdef WINDOWS
-       if (force_background_fill) {
-               fill_background();
-               force_background_fill--;
-       }
-       #endif
-
        play_homing_warning();
 
        if (VR_render_mode == VR_NONE )
@@ -1559,10 +1392,7 @@ void show_boxed_message(char *msg)
        int w,h,aw;
        int x,y;
 
-       WINDOS(
-               dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-               gr_set_current_canvas(&VR_screen_pages[VR_current_page])
-       );
+       gr_set_current_canvas(&VR_screen_pages[VR_current_page]);
        gr_set_curfont( MEDIUM1_FONT );
 
        gr_get_string_size(msg,&w,&h,&aw);
@@ -1580,18 +1410,13 @@ void show_boxed_message(char *msg)
 
        bg.bmp = gr_create_bitmap( w+BOX_BORDER, h+BOX_BORDER );
 
-       WIN( DDGRLOCK(dd_grd_curcanv));
-               gr_bm_ubitblt(w+BOX_BORDER, h+BOX_BORDER, 0, 0, x-BOX_BORDER/2, y-BOX_BORDER/2, &(grd_curcanv->cv_bitmap), bg.bmp );
-       WIN( DDGRUNLOCK(dd_grd_curcanv));
+       gr_bm_ubitblt(w+BOX_BORDER, h+BOX_BORDER, 0, 0, x-BOX_BORDER/2, y-BOX_BORDER/2, &(grd_curcanv->cv_bitmap), bg.bmp );
 
-               nm_draw_background(x-BOX_BORDER/2,y-BOX_BORDER/2,x+w+BOX_BORDER/2-1,y+h+BOX_BORDER/2-1);
+       nm_draw_background(x-BOX_BORDER/2,y-BOX_BORDER/2,x+w+BOX_BORDER/2-1,y+h+BOX_BORDER/2-1);
 
-               gr_set_fontcolor( gr_getcolor(31, 31, 31), -1 );
+       gr_set_fontcolor( gr_getcolor(31, 31, 31), -1 );
 
-       WIN( DDGRLOCK(dd_grd_curcanv));
-               gr_ustring( 0x8000, y, msg );
-       WIN( DDGRUNLOCK(dd_grd_curcanv));
-       WIN( DDGRRESTORE);
+       gr_ustring( 0x8000, y, msg );
 }
 
 void clear_boxed_message()
@@ -1599,90 +1424,9 @@ void clear_boxed_message()
 
        if (bg.bmp) {
 
-               WIN(DDGRLOCK(dd_grd_curcanv));
-                       gr_bitmap(bg.x-BOX_BORDER/2, bg.y-BOX_BORDER/2, bg.bmp);
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
-               WIN(DDGRRESTORE);
+               gr_bitmap(bg.x-BOX_BORDER/2, bg.y-BOX_BORDER/2, bg.bmp);
        
                gr_free_bitmap(bg.bmp);
                bg.bmp = NULL;
        }
 }
-
-
-#ifdef WINDOWS
-void win_do_emul_ibitblt(dd_grs_canvas *csrc, dd_grs_canvas *cdest)
-{
-       ubyte *src_data;
-       ubyte *dest_data;
-       int line, span;
-
-
-       WIN(DDGRLOCK(csrc));
-       WIN(DDGRLOCK(cdest));
-               src_data = csrc->canvas.cv_bitmap.bm_data;
-               dest_data = cdest->canvas.cv_bitmap.bm_data; 
-
-//             mprintf((0, "Render Ptr: %x;  Dest Ptr: %x;\n",src_data, dest_data));
-
-               for (line = 0; line < 480; line++, 
-                                               dest_data += cdest->canvas.cv_bitmap.bm_rowsize)
-               {
-                       cockpit_span_line *sline;
-
-                       sline = &win_cockpit_mask[line];
-
-                       if (!sline->num) continue;
-                       if (sline->num == 255) break;
-                       for (span = 0; span < sline->num; span++)
-                       {
-                               if ((sline->span[span].xmax-sline->span[span].xmin+1) < 10) {
-                                       gr_winckpit_blt_span(sline->span[span].xmin,
-                                                                               sline->span[span].xmax,
-                                                                               src_data, dest_data);
-                               }
-                               else {
-                                       gr_winckpit_blt_span_long(sline->span[span].xmin,
-                                                                               sline->span[span].xmax,
-                                                                               src_data, dest_data);
-                               }
-                       }
-                       src_data += csrc->canvas.cv_bitmap.bm_rowsize;
-               }
-       WIN(DDGRUNLOCK(cdest));
-       WIN(DDGRUNLOCK(csrc));
-}
-
-
-//@@void win_do_emul_ibitblt(dd_grs_canvas *csrc, dd_grs_canvas *cdest)
-//@@{
-//@@   HRESULT res;
-//@@   DDBLTFX bltfx;
-//@@   RECT srect, drect;
-//@@
-//@@// Do Render Blt to Mask Surface (dest blt 1-255)
-//@@   bltfx.dwSize = sizeof(bltfx);
-//@@   bltfx.ddckDestColorkey.dwColorSpaceLowValue = 1;
-//@@   bltfx.ddckDestColorkey.dwColorSpaceHighValue = 255;
-//@@   SetRect(&srect, 0,0,    csrc->canvas.cv_w, csrc->canvas.cv_h);
-//@@   SetRect(&drect, 0,0,    csrc->canvas.cv_w, csrc->canvas.cv_h);
-//@@
-//@@   res = IDirectDrawSurface_Blt(_lpDDSMask, &drect, csrc->lpdds, &srect,
-//@@                                                                           DDBLT_WAIT | DDBLT_KEYDESTOVERRIDE,
-//@@                                                                           &bltfx);
-//@@   if (res != DD_OK) 
-//@@           Error("win_ibitblt: ddraw blt to mask err: %x.\n", res);
-//@@
-//@@// Do Mask Blt to Screen (src blt !0)
-//@@   bltfx.dwSize = sizeof(bltfx);
-//@@   bltfx.ddckSrcColorkey.dwColorSpaceLowValue = 0;
-//@@   bltfx.ddckSrcColorkey.dwColorSpaceHighValue = 0;
-//@@
-//@@   res = IDirectDrawSurface_Blt(cdest->lpdds, &drect, _lpDDSMask, &srect,
-//@@                                                                           DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE,
-//@@                                                                           NULL);
-//@@   if (res != DD_OK) 
-//@@           Error("win_ibitblt: ddraw blt to screen err: %x.\n", res);
-//@@}
-#endif
-
index 631b2e2..a78d663 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gameseq.c,v 1.46 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: gameseq.c,v 1.47 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -24,14 +24,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-char gameseq_rcsid[] = "$Id: gameseq.c,v 1.46 2005-07-30 01:50:17 chris Exp $";
+char gameseq_rcsid[] = "$Id: gameseq.c,v 1.47 2005-08-02 06:13:56 chris Exp $";
 #endif
 
-#ifdef WINDOWS
-#include "desw.h"
-#endif
-
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -734,11 +729,6 @@ try_again:
        return 1;
 }
 
-#ifdef WINDOWS
-#undef TXT_SELECT_PILOT
-#define TXT_SELECT_PILOT "Select pilot\n<Ctrl-D> or Right-click\nto delete"
-#endif
-
 //Inputs the player's name, without putting up the background screen
 int RegisterPlayer()
 {
@@ -823,13 +813,8 @@ void LoadLevel(int level_num,int page_in_textures)
        else                                    //normal level
                level_name = Level_names[level_num-1];
 
-       #ifdef WINDOWS
-               dd_gr_set_current_canvas(NULL);
-               dd_gr_clear_canvas(BM_XRGB(0,0,0));
-       #else
-               gr_set_current_canvas(NULL);
-               gr_clear_canvas(BM_XRGB(0, 0, 0));              //so palette switching is less obvious
-       #endif
+       gr_set_current_canvas(NULL);
+       gr_clear_canvas(BM_XRGB(0, 0, 0));              //so palette switching is less obvious
 
        Last_msg_ycrd = -1;             //so we don't restore backgound under msg
 
@@ -1064,20 +1049,11 @@ void DoEndLevelScoreGlitz(int network)
        sprintf(m_str[c++], "%s%i\n", TXT_TOTAL_BONUS, shield_points+energy_points+hostage_points+skill_points+all_hostage_points+endgame_points);
        sprintf(m_str[c++], "%s%i", TXT_TOTAL_SCORE, Players[Player_num].score);
 
-       #ifdef WINDOWS
-       sprintf(m_str[c++], "");
-       sprintf(m_str[c++], "         Done");
-       #endif
-
        for (i=0; i<c; i++) {
                m[i].type = NM_TYPE_TEXT;
                m[i].text = m_str[i];
        }
 
-       #ifdef WINDOWS
-       m[c-1].type = NM_TYPE_MENU;
-       #endif
-
        // m[c].type = NM_TYPE_MENU;    m[c++].text = "Ok";
 
        if (Current_level_num < 0)
@@ -1165,8 +1141,6 @@ void do_secret_message(char *msg)
        Function_mode = FMODE_MENU;
        nm_messagebox(NULL, 1, TXT_OK, msg);
        Function_mode = old_fmode;
-
-       WIN(DEFINE_SCREEN(NULL));
 }
 
 //     -----------------------------------------------------------------------------------------------------
@@ -1426,10 +1400,7 @@ void DoEndGame(void)
 
        set_screen_mode( SCREEN_MENU );
 
-       WINDOS(
-               dd_gr_set_current_canvas(NULL),
-               gr_set_current_canvas(NULL)
-       );
+       gr_set_current_canvas(NULL);
 
        key_flush();
 
@@ -1479,14 +1450,8 @@ void DoEndGame(void)
                DoEndLevelScoreGlitz(0);
 
        if (PLAYING_BUILTIN_MISSION && !((Game_mode & GM_MULTI) && !(Game_mode & GM_MULTI_COOP))) {
-               WINDOS(
-                       dd_gr_set_current_canvas(NULL),
-                       gr_set_current_canvas( NULL )
-               );
-               WINDOS(
-                       dd_gr_clear_canvas(BM_XRGB(0,0,0)),
-                       gr_clear_canvas(BM_XRGB(0,0,0))
-               );
+               gr_set_current_canvas( NULL );
+               gr_clear_canvas(BM_XRGB(0,0,0));
                gr_palette_clear();
                load_palette(DEFAULT_PALETTE,0,1);
                scores_maybe_add_player(0);
@@ -1608,8 +1573,6 @@ void load_stars()
 //@@
 //@@   gr_remap_bitmap_good( &grd_curcanv->cv_bitmap, pal, -1, -1 );
 
-       WIN(DEFINE_SCREEN(STARS_BACKGROUND));
-
        nm_draw_background1(STARS_BACKGROUND);
 
 }
@@ -1628,10 +1591,7 @@ died_in_mine_message(void)
 
        set_screen_mode(SCREEN_MENU);           //go into menu mode
 
-       WINDOS(
-               dd_gr_set_current_canvas(NULL),
-               gr_set_current_canvas(NULL)
-       );
+       gr_set_current_canvas(NULL);
 
        load_stars();
 
@@ -1639,8 +1599,6 @@ died_in_mine_message(void)
        Function_mode = FMODE_MENU;
        nm_messagebox(NULL, 1, TXT_OK, TXT_DIED_IN_MINE);
        Function_mode = old_fmode;
-
-       WIN(DEFINE_SCREEN(NULL));
 }
 
 //     Called when player dies on secret level.
@@ -1666,8 +1624,6 @@ void returning_to_level_message(void)
        sprintf(msg, "Returning to level %i", Entered_from_level);
        nm_messagebox(NULL, 1, TXT_OK, msg);
        Function_mode = old_fmode;
-
-       WIN(DEFINE_SCREEN(NULL));
 }
 
 //     Called when player dies on secret level.
@@ -1696,8 +1652,6 @@ void advancing_to_level_message(void)
        sprintf(msg, "Base level destroyed.\nAdvancing to level %i", Entered_from_level+1);
        nm_messagebox(NULL, 1, TXT_OK, msg);
        Function_mode = old_fmode;
-
-       WIN(DEFINE_SCREEN(NULL));
 }
 
 void digi_stop_digi_sounds();
@@ -2022,13 +1976,6 @@ void ShowLevelIntro(int level_num)
                                        }
                                }
 
-#ifdef WINDOWS
-                               if (!movie) {                                   //must go before briefing
-                                       dd_gr_init_screen();
-                                       Screen_mode = -1;
-                               }
-#endif
-
 #if 0
                                if (robot_movies)
                                {
@@ -2095,8 +2042,6 @@ void StartNewLevel(int level_num, int secret_flag)
 
        ShowLevelIntro(level_num);
 
-       WIN(DEFINE_SCREEN(NULL));               // ALT-TAB: no restore of background.
-       
        StartNewLevelSub(level_num, 1, secret_flag );
 
 }
index 3904368..bc258df 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gauges.c,v 1.19 2005-07-30 09:16:25 chris Exp $ */
+/* $Id: gauges.c,v 1.20 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,10 +22,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #include <conf.h>
 #endif
 
-#ifdef WINDOWS
-#include "desw.h"
-#endif
-
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -329,13 +325,8 @@ extern int Current_display_mode;
 #define SB_BOMB_COUNT_X                        (Current_display_mode?342:171)
 #define SB_BOMB_COUNT_Y                        (Current_display_mode?458:191)
 
-#ifdef WINDOWS
-#define LHX(x)         ((x)*(Current_display_mode?2:1))
-#define LHY(y)         ((y)*(Current_display_mode?2.4:1))
-#else
 #define LHX(x)         ((x)*(MenuHires?2:1))
 #define LHY(y)         ((y)*(MenuHires?2.4:1))
-#endif
 
 static int score_display[2];
 static fix score_time;
@@ -807,56 +798,6 @@ gauge_box gauge_boxes[] = {
 int    Color_0_31_0 = -1;
 
 //copy a box from the off-screen buffer to the visible page
-#ifdef WINDOWS
-void copy_gauge_box(gauge_box *box,dd_grs_canvas *cv)
-{
-//     This is kind of funny.  If we are in a full cockpit mode
-//     we have a system offscreen buffer for our canvas.
-//     Since this is true of cockpit mode only, we should do a 
-//     direct copy from system to video memory without blting.
-
-       if (box->spanlist) {
-               int n_spans = box->bot-box->top+1;
-               int cnt,y;
-
-               if (Cockpit_mode==CM_FULL_COCKPIT && cv->sram) {
-                       grs_bitmap *bm;
-
-                       Assert(cv->sram);
-               DDGRLOCK(cv);
-               DDGRLOCK(dd_grd_curcanv);
-                       bm = &cv->canvas.cv_bitmap;             
-       
-                       for (cnt=0,y=box->top;cnt<n_spans;cnt++,y++)
-                       {
-                               gr_bm_ubitblt(box->spanlist[cnt].r-box->spanlist[cnt].l+1,1,
-                                                       box->left+box->spanlist[cnt].l,y,box->left+box->spanlist[cnt].l,y,bm,&grd_curcanv->cv_bitmap);
-                       }
-               DDGRUNLOCK(dd_grd_curcanv);
-               DDGRUNLOCK(cv);
-               }
-               else {
-                       for (cnt=0,y=box->top;cnt<n_spans;cnt++,y++)
-                       {
-                               dd_gr_blt_notrans(cv, 
-                                                               box->left+box->spanlist[cnt].l,y,
-                                                               box->spanlist[cnt].r-box->spanlist[cnt].l+1,1,
-                                                               dd_grd_curcanv,
-                                                               box->left+box->spanlist[cnt].l,y,
-                                                               box->spanlist[cnt].r-box->spanlist[cnt].l+1,1);
-                       }
-               }
-       }
-       else {
-               dd_gr_blt_notrans(cv, box->left, box->top, 
-                                               box->right-box->left+1, box->bot-box->top+1,
-                                               dd_grd_curcanv, box->left, box->top,
-                                               box->right-box->left+1, box->bot-box->top+1);
-       }
-}
-
-#else
-
 void copy_gauge_box(gauge_box *box,grs_bitmap *bm)
 {
        if (box->spanlist) {
@@ -879,8 +820,6 @@ void copy_gauge_box(gauge_box *box,grs_bitmap *bm)
                                                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)
@@ -1016,7 +955,6 @@ void sb_show_score()
        static int last_x[4]={SB_SCORE_RIGHT_L,SB_SCORE_RIGHT_L,SB_SCORE_RIGHT_H,SB_SCORE_RIGHT_H};
        int redraw_score;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        if ( (Game_mode & GM_MULTI) && !(Game_mode & GM_MULTI_COOP) ) 
                redraw_score = -99;
        else
@@ -1059,7 +997,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        gr_printf(x,y,score_str);
 
        last_x[(Current_display_mode?2:0)+VR_current_page] = x;
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 void sb_show_score_added()
@@ -1077,7 +1014,6 @@ void sb_show_score_added()
        if (score_display[VR_current_page] == 0)
                return;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_curfont( GAME_FONT );
 
        score_time -= FrameTime;
@@ -1120,7 +1056,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
                score_display[VR_current_page] = 0;
 
        }
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
 }
 
 fix    Last_warning_beep_time[2] = {0,0};              //      Time we last played homing missile warning beep.
@@ -1159,23 +1094,16 @@ void show_homing_warning(void)
                if (Last_homing_warning_shown[VR_current_page] == 1) {
                        PAGE_IN_GAUGE( GAUGE_HOMING_WARNING_OFF );
 
-                       WIN(DDGRLOCK(dd_grd_curcanv));
-                               gr_ubitmapm( HOMING_WARNING_X, HOMING_WARNING_Y, &GameBitmaps[ GET_GAUGE_INDEX(GAUGE_HOMING_WARNING_OFF) ] );
-                       WIN(DDGRUNLOCK(dd_grd_curcanv));
+                       gr_ubitmapm( HOMING_WARNING_X, HOMING_WARNING_Y, &GameBitmaps[ GET_GAUGE_INDEX(GAUGE_HOMING_WARNING_OFF) ] );
 
                        Last_homing_warning_shown[VR_current_page] = 0;
                }
                return;
        }
 
-       WINDOS(
-               dd_gr_set_current_canvas( get_current_game_screen() ),
-               gr_set_current_canvas( get_current_game_screen() )
-       );
+       gr_set_current_canvas( get_current_game_screen() );
 
 
-WIN(DDGRLOCK(dd_grd_curcanv))
-{
        if (Players[Player_num].homing_object_dist >= 0) {
 
                if (GameTime & 0x4000) {
@@ -1197,9 +1125,6 @@ WIN(DDGRLOCK(dd_grd_curcanv))
                Last_homing_warning_shown[VR_current_page] = 0;
        }
 }
-WIN(DDGRUNLOCK(dd_grd_curcanv));
-
-}
 
 #define MAX_SHOWN_LIVES 4
 
@@ -1391,8 +1316,6 @@ void show_bomb_count(int x,int y,int bg_color,int always_show)
        //if (!always_show && countx == old_bombcount[VR_current_page])
        //      return;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
-
 // I hate doing this off of hard coded coords!!!!
 
        if (Cockpit_mode == CM_STATUS_BAR) {            //draw background
@@ -1421,8 +1344,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
 
        gr_string(x,y,txt);
 
-WIN(DDGRUNLOCK(dd_grd_curcanv));
-
        old_bombcount[VR_current_page] = countx;
 }
 
@@ -1608,7 +1529,6 @@ void sb_show_lives()
        x = SB_LIVES_X;
        y = SB_LIVES_Y;
   
-       WIN(DDGRLOCK(dd_grd_curcanv));
        //if (old_lives[VR_current_page] == -1)
        {
                gr_set_curfont( GAME_FONT );
@@ -1619,7 +1539,6 @@ void sb_show_lives()
                        gr_printf(SB_LIVES_LABEL_X,SB_LIVES_LABEL_Y,"%s:", TXT_LIVES);
 
        }
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        if (Game_mode & GM_MULTI)
        {
@@ -1628,7 +1547,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
                static int last_x[4] = {SB_SCORE_RIGHT_L,SB_SCORE_RIGHT_L,SB_SCORE_RIGHT_H,SB_SCORE_RIGHT_H};
                int x;
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
                sprintf(killed_str, "%5d", Players[Player_num].net_killed_total);
                gr_get_string_size(killed_str, &w, &h, &aw);
                gr_setcolor(BM_XRGB(0,0,0));
@@ -1637,13 +1555,11 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
                x = SB_SCORE_RIGHT-w-2;         
                gr_printf(x, y+1, killed_str);
                last_x[(Current_display_mode?2:0)+VR_current_page] = x;
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
                return;
        }
 
        //if (old_lives[VR_current_page]==-1 || Players[Player_num].lives != old_lives[VR_current_page])
        {
-       WIN(DDGRLOCK(dd_grd_curcanv));
 
                //erase old icons
 
@@ -1661,7 +1577,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
 
 //                     gr_printf(x+12, y, "x %d", Players[Player_num].lives-1);
                }
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
        }
 
 //     for (i=0;i<draw_count;i++,x+=bm->bm_w+2)
@@ -1852,13 +1767,8 @@ void draw_energy_bar(int energy)
                        if (x2 > x1) gr_uscanline( x1, x2, y ); 
                }
        
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas( get_current_game_screen() )
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_ubitmapm( LEFT_ENERGY_GAUGE_X, LEFT_ENERGY_GAUGE_Y, &Canv_LeftEnergyGauge->cv_bitmap );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_set_current_canvas( get_current_game_screen() );
+       gr_ubitmapm( LEFT_ENERGY_GAUGE_X, LEFT_ENERGY_GAUGE_Y, &Canv_LeftEnergyGauge->cv_bitmap );
 
        // Draw right energy bar
        gr_set_current_canvas( Canv_RightEnergyGauge );
@@ -1878,13 +1788,8 @@ void draw_energy_bar(int energy)
                        if (x2 > x1) gr_uscanline( x1, x2, y ); 
                }
 
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas( get_current_game_screen() )
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_ubitmapm( RIGHT_ENERGY_GAUGE_X, RIGHT_ENERGY_GAUGE_Y, &Canv_RightEnergyGauge->cv_bitmap );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_set_current_canvas( get_current_game_screen() );
+       gr_ubitmapm( RIGHT_ENERGY_GAUGE_X, RIGHT_ENERGY_GAUGE_Y, &Canv_RightEnergyGauge->cv_bitmap );
 }
 
 ubyte afterburner_bar_table[AFTERBURNER_GAUGE_H_L*2] = {
@@ -2016,13 +1921,8 @@ void draw_afterburner_bar(int afterburner)
                                                (Current_display_mode?afterburner_bar_table_hires[y*2+1]:afterburner_bar_table[y*2+1]), y ); 
        }
 
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas( get_current_game_screen() )
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_ubitmapm( AFTERBURNER_GAUGE_X, AFTERBURNER_GAUGE_Y, &Canv_AfterburnerGauge->cv_bitmap );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_set_current_canvas( get_current_game_screen() );
+       gr_ubitmapm( AFTERBURNER_GAUGE_X, AFTERBURNER_GAUGE_Y, &Canv_AfterburnerGauge->cv_bitmap );
 }
 
 void draw_shield_bar(int shield)
@@ -2030,10 +1930,7 @@ void draw_shield_bar(int shield)
        int bm_num = shield>=100?9:(shield / 10);
 
        PAGE_IN_GAUGE( GAUGE_SHIELDS+9-bm_num   );
-       WIN(DDGRLOCK(dd_grd_curcanv));
        gr_ubitmapm( SHIELD_GAUGE_X, SHIELD_GAUGE_Y, &GameBitmaps[ GET_GAUGE_INDEX(GAUGE_SHIELDS+9-bm_num) ] );
-
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 #define CLOAK_FADE_WAIT_TIME  0x400
@@ -2108,46 +2005,17 @@ void draw_player_ship(int cloak_state,int old_cloak_state,int x, int y)
                refade = 1;
        }
 
-       WINDOS(                 
-               dd_gr_set_current_canvas(&dd_VR_render_buffer[0]),
-               gr_set_current_canvas(&VR_render_buffer[0])
-       );
+       gr_set_current_canvas(&VR_render_buffer[0]);
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_ubitmap( x, y, bm);
+       gr_ubitmap( x, y, bm);
 
-               Gr_scanline_darkening_level = cloak_fade_value;
-               gr_rect(x, y, x+bm->bm_w-1, y+bm->bm_h-1);
-               Gr_scanline_darkening_level = GR_FADE_LEVELS;
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       Gr_scanline_darkening_level = cloak_fade_value;
+       gr_rect(x, y, x+bm->bm_w-1, y+bm->bm_h-1);
+       Gr_scanline_darkening_level = GR_FADE_LEVELS;
 
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas( get_current_game_screen() )
-       );
+       gr_set_current_canvas( get_current_game_screen() );
 
-#ifdef WINDOWS
-       DDGRLOCK(dd_grd_curcanv);
-       if (dd_grd_curcanv->lpdds != dd_VR_render_buffer[0].lpdds) {
-               DDGRLOCK(&dd_VR_render_buffer[0]);
-       }
-       else {
-               dd_gr_dup_hack(&dd_VR_render_buffer[0], dd_grd_curcanv);
-       }
-#endif
-       WINDOS(
-               gr_bm_ubitbltm( bm->bm_w, bm->bm_h, x, y, x, y, &dd_VR_render_buffer[0].canvas.cv_bitmap, &grd_curcanv->cv_bitmap),
-               gr_bm_ubitbltm( bm->bm_w, bm->bm_h, x, y, x, y, &VR_render_buffer[0].cv_bitmap, &grd_curcanv->cv_bitmap)
-       );
-#ifdef WINDOWS
-       if (dd_grd_curcanv->lpdds != dd_VR_render_buffer[0].lpdds) {
-               DDGRUNLOCK(&dd_VR_render_buffer[0]);
-       }
-       else {
-               dd_gr_dup_unhack(&dd_VR_render_buffer[0]);
-       }
-       DDGRUNLOCK(dd_grd_curcanv);
-#endif
+       gr_bm_ubitbltm( bm->bm_w, bm->bm_h, x, y, x, y, &VR_render_buffer[0].cv_bitmap, &grd_curcanv->cv_bitmap);
 }
 
 #define INV_FRAME_TIME (f1_0/10)               //how long for each frame
@@ -2171,24 +2039,15 @@ void draw_numerical_display(int shield, int energy)
                gr_printf((energy>99)?7:((energy>9)?11:15),4,"%d",energy);
        }
        
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas( get_current_game_screen() )
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_ubitmapm( NUMERICAL_GAUGE_X, NUMERICAL_GAUGE_Y, &Canv_NumericalGauge->cv_bitmap );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_set_current_canvas( get_current_game_screen() );
+       gr_ubitmapm( NUMERICAL_GAUGE_X, NUMERICAL_GAUGE_Y, &Canv_NumericalGauge->cv_bitmap );
 }
 
 
 void draw_keys()
 {
-WINDOS(
-       dd_gr_set_current_canvas( get_current_game_screen() ),
-       gr_set_current_canvas( get_current_game_screen() )
-);
+       gr_set_current_canvas( get_current_game_screen() );
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        if (Players[Player_num].flags & PLAYER_FLAGS_BLUE_KEY ) {
                PAGE_IN_GAUGE( GAUGE_BLUE_KEY );
                gr_ubitmapm( GAUGE_BLUE_KEY_X, GAUGE_BLUE_KEY_Y, &GameBitmaps[ GET_GAUGE_INDEX(GAUGE_BLUE_KEY) ] );
@@ -2212,7 +2071,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
                PAGE_IN_GAUGE( GAUGE_RED_KEY_OFF );
                gr_ubitmapm( GAUGE_RED_KEY_X,  GAUGE_RED_KEY_Y,  &GameBitmaps[ GET_GAUGE_INDEX(GAUGE_RED_KEY_OFF) ] );
        }
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 
@@ -2322,8 +2180,6 @@ void draw_ammo_info(int x,int y,int ammo_count,int primary)
        else
                w = (grd_curcanv->cv_font->ft_w*5)/2;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
-{
        gr_setcolor(BM_XRGB(0,0,0));
        gr_rect(x,y,x+w,y+grd_curcanv->cv_font->ft_h);
        gr_set_fontcolor(gr_getcolor(20,0,0),-1 );
@@ -2332,9 +2188,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        gr_printf(x,y,str);
 }
 
-WIN(DDGRUNLOCK(dd_grd_curcanv));
-}
-
 void draw_secondary_ammo_info(int ammo_count)
 {
        if (Cockpit_mode == CM_STATUS_BAR)
@@ -2349,12 +2202,8 @@ int draw_weapon_box(int weapon_type,int weapon_num)
        int drew_flag=0;
        int laser_level_changed;
 
-WINDOS(
-       dd_gr_set_current_canvas(&dd_VR_render_buffer[0]),
-       gr_set_current_canvas(&VR_render_buffer[0])
-);
+       gr_set_current_canvas(&VR_render_buffer[0]);
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_curfont( GAME_FONT );
 
        laser_level_changed = (weapon_type==0 && weapon_num==LASER_INDEX && (Players[Player_num].laser_level != old_laser_level[VR_current_page]));
@@ -2420,12 +2269,8 @@ WIN(DDGRLOCK(dd_grd_curcanv));
 
                Gr_scanline_darkening_level = GR_FADE_LEVELS;
        }
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
-WINDOS(
-       dd_gr_set_current_canvas(get_current_game_screen()),
-       gr_set_current_canvas(get_current_game_screen())
-);
+       gr_set_current_canvas(get_current_game_screen());
        return drew_flag;
 }
 
@@ -2451,27 +2296,15 @@ void draw_static(int win)
 
        bmp = &GameBitmaps[vc->frames[framenum].index];
 
-       WINDOS(
-       dd_gr_set_current_canvas(&dd_VR_render_buffer[0]),
-       gr_set_current_canvas(&VR_render_buffer[0])
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(&VR_render_buffer[0]);
    
        for (x=gauge_boxes[boxofs+win].left;x<gauge_boxes[boxofs+win].right;x+=bmp->bm_w)
                for (y=gauge_boxes[boxofs+win].top;y<gauge_boxes[boxofs+win].bot;y+=bmp->bm_h)
                        gr_bitmap(x,y,bmp);
 
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
-
-       WINDOS(
-       dd_gr_set_current_canvas(get_current_game_screen()),
-       gr_set_current_canvas(get_current_game_screen())
-       );
+       gr_set_current_canvas(get_current_game_screen());
 
-       WINDOS(
-       copy_gauge_box(&gauge_boxes[boxofs+win],&dd_VR_render_buffer[0]),
-       copy_gauge_box(&gauge_boxes[boxofs+win],&VR_render_buffer[0].cv_bitmap)
-       );
+       copy_gauge_box(&gauge_boxes[boxofs+win],&VR_render_buffer[0].cv_bitmap);
 }
 
 void draw_weapon_boxes()
@@ -2482,10 +2315,7 @@ void draw_weapon_boxes()
        if (weapon_box_user[0] == WBU_WEAPON) {
                drew = draw_weapon_box(0,Primary_weapon);
                if (drew) 
-                       WINDOS(
-                               copy_gauge_box(&gauge_boxes[boxofs+0],&dd_VR_render_buffer[0]),
-                               copy_gauge_box(&gauge_boxes[boxofs+0],&VR_render_buffer[0].cv_bitmap)
-                       );
+                       copy_gauge_box(&gauge_boxes[boxofs+0],&VR_render_buffer[0].cv_bitmap);
 
                if (weapon_box_states[0] == WS_SET) {
                        if ((Primary_weapon == VULCAN_INDEX) || (Primary_weapon == GAUSS_INDEX))
@@ -2513,10 +2343,7 @@ void draw_weapon_boxes()
        if (weapon_box_user[1] == WBU_WEAPON) {
                drew = draw_weapon_box(1,Secondary_weapon);
                if (drew)
-                       WINDOS(
-                               copy_gauge_box(&gauge_boxes[boxofs+1],&dd_VR_render_buffer[0]),
-                               copy_gauge_box(&gauge_boxes[boxofs+1],&VR_render_buffer[0].cv_bitmap)
-                       );
+                       copy_gauge_box(&gauge_boxes[boxofs+1],&VR_render_buffer[0].cv_bitmap);
 
                if (weapon_box_states[1] == WS_SET)
                {
@@ -2548,11 +2375,7 @@ void sb_draw_energy_bar(energy)
 
        //gr_set_current_canvas( Canv_SBEnergyGauge );
 
-       WINDOS(
-       dd_gr_set_current_canvas(get_current_game_screen()),
-       gr_set_current_canvas(get_current_game_screen())
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(get_current_game_screen());
 
        PAGE_IN_GAUGE( SB_GAUGE_ENERGY );
        gr_ubitmapm(SB_ENERGY_GAUGE_X, SB_ENERGY_GAUGE_Y, &GameBitmaps[GET_GAUGE_INDEX(SB_GAUGE_ENERGY)]);
@@ -2571,7 +2394,6 @@ void sb_draw_energy_bar(energy)
        gr_get_string_size(energy_str, &w, &h, &aw );
        gr_set_fontcolor(gr_getcolor(25,18,6),-1 );
        gr_printf(SB_ENERGY_GAUGE_X + ((SB_ENERGY_GAUGE_W - w)/2), SB_ENERGY_GAUGE_Y + SB_ENERGY_GAUGE_H - GAME_FONT->ft_h - (GAME_FONT->ft_h / 4), "%d", energy);
-       WIN(DDGRUNLOCK(dd_grd_curcanv));                                          
 }
 
 void sb_draw_afterburner()
@@ -2580,11 +2402,7 @@ void sb_draw_afterburner()
        char ab_str[3] = "AB";
 
        //gr_set_current_canvas( Canv_SBAfterburnerGauge );
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas(get_current_game_screen())
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(get_current_game_screen());
        PAGE_IN_GAUGE( SB_GAUGE_AFTERBURNER );
        gr_ubitmapm(SB_AFTERBURNER_GAUGE_X, SB_AFTERBURNER_GAUGE_Y, &GameBitmaps[GET_GAUGE_INDEX(SB_GAUGE_AFTERBURNER)]);
 
@@ -2605,8 +2423,6 @@ void sb_draw_afterburner()
 
        gr_get_string_size(ab_str, &w, &h, &aw );
        gr_printf(SB_AFTERBURNER_GAUGE_X + ((SB_AFTERBURNER_GAUGE_W - w)/2),SB_AFTERBURNER_GAUGE_Y+SB_AFTERBURNER_GAUGE_H-GAME_FONT->ft_h - (GAME_FONT->ft_h / 4),"AB");
-
-WIN(DDGRUNLOCK(dd_grd_curcanv));                                         
 }
 
 void sb_draw_shield_num(int shield)
@@ -2619,29 +2435,19 @@ void sb_draw_shield_num(int shield)
        //erase old one
 //     PIGGY_PAGE_IN(cockpit_bitmap[Cockpit_mode + (Current_display_mode ? (Num_cockpits/2) : 0)]);
 
-WIN(DDGRLOCK(dd_grd_curcanv));
-
 //     gr_setcolor(gr_gpixel(&grd_curcanv->cv_bitmap, SB_SHIELD_NUM_X - 1, SB_SHIELD_NUM_Y - 1));
 
 //     gr_rect(SB_SHIELD_NUM_X, SB_SHIELD_NUM_Y, SB_SHIELD_NUM_X + (Current_display_mode ? 27 : 13), SB_SHIELD_NUM_Y + GAME_FONT->ft_h);
        gr_printf((shield>99)?SB_SHIELD_NUM_X:((shield>9)?SB_SHIELD_NUM_X+2:SB_SHIELD_NUM_X+4),SB_SHIELD_NUM_Y,"%d",shield);
-
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 void sb_draw_shield_bar(int shield)
 {
        int bm_num = shield>=100?9:(shield / 10);
 
-WINDOS(
-       dd_gr_set_current_canvas(get_current_game_screen()),
-       gr_set_current_canvas(get_current_game_screen())
-);
-WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(get_current_game_screen());
        PAGE_IN_GAUGE( GAUGE_SHIELDS+9-bm_num );
        gr_ubitmapm( SB_SHIELD_GAUGE_X, SB_SHIELD_GAUGE_Y, &GameBitmaps[GET_GAUGE_INDEX(GAUGE_SHIELDS+9-bm_num) ] );
-       
-WIN(DDGRUNLOCK(dd_grd_curcanv));                                         
 }
 
 void sb_draw_keys()
@@ -2649,11 +2455,7 @@ void sb_draw_keys()
        grs_bitmap * bm;
        int flags = Players[Player_num].flags;
 
-WINDOS(
-       dd_gr_set_current_canvas(get_current_game_screen()),
-       gr_set_current_canvas(get_current_game_screen())
-);
-WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(get_current_game_screen());
        bm = &GameBitmaps[ GET_GAUGE_INDEX((flags&PLAYER_FLAGS_BLUE_KEY)?SB_GAUGE_BLUE_KEY:SB_GAUGE_BLUE_KEY_OFF) ];
        PAGE_IN_GAUGE( (flags&PLAYER_FLAGS_BLUE_KEY)?SB_GAUGE_BLUE_KEY:SB_GAUGE_BLUE_KEY_OFF );
        gr_ubitmapm( SB_GAUGE_KEYS_X, SB_GAUGE_BLUE_KEY_Y, bm );
@@ -2663,8 +2465,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        bm = &GameBitmaps[ GET_GAUGE_INDEX((flags&PLAYER_FLAGS_RED_KEY)?SB_GAUGE_RED_KEY:SB_GAUGE_RED_KEY_OFF) ];
        PAGE_IN_GAUGE( (flags&PLAYER_FLAGS_RED_KEY)?SB_GAUGE_RED_KEY:SB_GAUGE_RED_KEY_OFF );
        gr_ubitmapm( SB_GAUGE_KEYS_X, SB_GAUGE_RED_KEY_Y, bm  );
-
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 //     Draws invulnerable ship, or maybe the flashing ship, depending on invulnerability time left.
@@ -2672,11 +2472,7 @@ void draw_invulnerable_ship()
 {
        static fix time=0;
 
-WINDOS(
-       dd_gr_set_current_canvas(get_current_game_screen()),
-       gr_set_current_canvas(get_current_game_screen())
-);
-WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(get_current_game_screen());
 
        if (((Players[Player_num].invulnerable_time + INVULNERABLE_TIME_MAX - GameTime) > F1_0*4) || (GameTime & 0x8000)) {
 
@@ -2699,7 +2495,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
                sb_draw_shield_bar(f2ir(Players[Player_num].shields));
        else
                draw_shield_bar(f2ir(Players[Player_num].shields));
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 extern int Missile_gun;
@@ -2737,13 +2532,11 @@ void show_reticle(int force_big_one)
        int cross_bm_num,primary_bm_num,secondary_bm_num;
        int use_hires_reticle,small_reticle,ofs,gauge_index;
 
-   if (Newdemo_state==ND_STATE_PLAYBACK && Newdemo_flying_guided)
-               {
-               WIN(DDGRLOCK(dd_grd_curcanv));
+       if (Newdemo_state==ND_STATE_PLAYBACK && Newdemo_flying_guided)
+       {
                 draw_guided_crosshair();
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
                 return;
-          }
+       }
 
        x = grd_curcanv->cv_w/2;
        y = grd_curcanv->cv_h/2;
@@ -2771,15 +2564,17 @@ void show_reticle(int force_big_one)
        Assert(secondary_bm_num <= 4);
        Assert(cross_bm_num <= 1);
 #ifdef OGL
-      if (gl_reticle==2 || (gl_reticle && grd_curcanv->cv_bitmap.bm_w > 320)){                ogl_draw_reticle(cross_bm_num,primary_bm_num,secondary_bm_num);
-       } else {
+       if (gl_reticle==2 || (gl_reticle && grd_curcanv->cv_bitmap.bm_w > 320))
+       {
+               ogl_draw_reticle(cross_bm_num,primary_bm_num,secondary_bm_num);
+       }
+       else
+       {
 #endif
 
 
                use_hires_reticle = (FontHires != 0);
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
-
        small_reticle = !(grd_curcanv->cv_bitmap.bm_w*3 > max_window_w*2 || force_big_one);
        ofs = (use_hires_reticle?0:2) + small_reticle;
 
@@ -2795,9 +2590,8 @@ void show_reticle(int force_big_one)
        PAGE_IN_GAUGE( gauge_index );
        gr_ubitmapm(x+secondary_offsets[ofs].x,y+secondary_offsets[ofs].y,&GameBitmaps[GET_GAUGE_INDEX(gauge_index)] );
 
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
 #ifdef OGL
-       }
+       }
 #endif
 }
 
@@ -3099,7 +2893,6 @@ void draw_hud()
 
        Line_spacing = GAME_FONT->ft_h + GAME_FONT->ft_h/4;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        //      Show score so long as not in rearview
        if ( !Rear_view && Cockpit_mode!=CM_REAR_VIEW && Cockpit_mode!=CM_STATUS_BAR && !Saving_movie_frames) {
                hud_show_score();
@@ -3170,7 +2963,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
                else
                        gr_printf(0x8000,grd_curcanv->cv_h-10,TXT_REAR_VIEW);
        }
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 extern short *BackBuffer;
@@ -3201,10 +2993,7 @@ void render_gauges()
 
        if (shields < 0 ) shields = 0;
 
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas(get_current_game_screen())
-       );
+       gr_set_current_canvas(get_current_game_screen());
        gr_set_curfont( GAME_FONT );
 
        if (Newdemo_state == ND_STATE_RECORDING)
@@ -3350,19 +3139,8 @@ int SW_drawn[2], SW_x[2], SW_y[2], SW_w[2], SW_h[2];
 //window.
 void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,char *label)
 {
-       WINDOS(
-               dd_grs_canvas window_canv,
-               grs_canvas window_canv
-       );
-       WINDOS(
-               static dd_grs_canvas overlap_canv,
-               static grs_canvas overlap_canv
-       );
-
-#ifdef WINDOWS
-       int saved_window_x, saved_window_y;
-#endif
-
+       grs_canvas window_canv;
+       static grs_canvas overlap_canv;
        object *viewer_save = Viewer;
        static int overlap_dirty[2]={0,0};
        int boxnum;
@@ -3386,10 +3164,7 @@ void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,c
                weapon_box_user[win] = user;
 
                if (overlap_dirty[win]) {
-               WINDOS(
-                       dd_gr_set_current_canvas(&dd_VR_screen_pages[VR_current_page]),
-                       gr_set_current_canvas(&VR_screen_pages[VR_current_page])
-               );
+                       gr_set_current_canvas(&VR_screen_pages[VR_current_page]);
                        fill_background();
                        overlap_dirty[win] = 0;
                }
@@ -3416,20 +3191,10 @@ void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,c
                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);
 
-       #ifdef WINDOWS
-               saved_window_x = window_x;
-               saved_window_y = window_y;
-               window_x = dd_VR_render_sub_buffer[0].canvas.cv_bitmap.bm_w/2+dx;
-               window_y = VR_render_buffer[0].cv_bitmap.bm_h-h-(h/10)-dd_VR_render_sub_buffer[0].yoff;
-       #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; 
 
-       WINDOS(
-               dd_gr_init_sub_canvas(&window_canv, &dd_VR_render_buffer[0],window_x,window_y,w,h),
-               gr_init_sub_canvas(&window_canv,&VR_render_buffer[0],window_x,window_y,w,h)
-       );
+               gr_init_sub_canvas(&window_canv,&VR_render_buffer[0],window_x,window_y,w,h);
        }
        else {
                if (Cockpit_mode == CM_FULL_COCKPIT)
@@ -3441,23 +3206,13 @@ void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,c
 
                box = &gauge_boxes[boxnum];
 
-       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)
-       );
+               gr_init_sub_canvas(&window_canv,&VR_render_buffer[0],box->left,box->top,box->right-box->left+1,box->bot-box->top+1);
        }
 
-WINDOS(
-       dd_gr_set_current_canvas(&window_canv),
-       gr_set_current_canvas(&window_canv)
-);
-       
-       WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas(&window_canv);
        
-               render_frame(0, win+1);
+       render_frame(0, win+1);
                
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
-
        //      HACK! If guided missile, wake up robots as necessary.
        if (viewer->type == OBJ_WEAPON) {
                // -- Used to require to be GUIDED -- if (viewer->id == GUIDEDMISS_ID)
@@ -3465,103 +3220,59 @@ WINDOS(
        }
 
        if (label) {
-       WIN(DDGRLOCK(dd_grd_curcanv));
                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);
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
        }
 
-       if (user == WBU_GUIDED) {
-       WIN(DDGRLOCK(dd_grd_curcanv));
+       if (user == WBU_GUIDED)
                draw_guided_crosshair();
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
-       }
 
        if (Cockpit_mode == CM_FULL_SCREEN) {
                int small_window_bottom,big_window_bottom,extra_part_h;
                
-               WIN(DDGRLOCK(dd_grd_curcanv));
                {
                        gr_setcolor(BM_XRGB(0,0,32));
                        gr_ubox(0,0,grd_curcanv->cv_bitmap.bm_w-1,grd_curcanv->cv_bitmap.bm_h-1);
                }
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
 
                //if the window only partially overlaps the big 3d window, copy
                //the extra part to the visible screen
 
                big_window_bottom = Game_window_y + Game_window_h - 1;
 
-       #ifdef WINDOWS
-               window_x = saved_window_x;
-               window_y = saved_window_y;
-//             dd_gr_init_sub_canvas(&window_canv, &dd_VR_render_buffer[0],window_x,window_y,
-//                                             VR_render_buffer[0].cv_bitmap.bm_w/6,
-//                                             i2f(VR_render_buffer[0].cv_bitmap.bm_w/6) / grd_curscreen->sc_aspect);
-
-       #endif
-
                if (window_y > big_window_bottom) {
 
                        //the small window is completely outside the big 3d window, so
                        //copy it to the visible screen
 
                        if (VR_screen_flags & VRF_USE_PAGING)
-                               WINDOS(
-                                       dd_gr_set_current_canvas(&dd_VR_screen_pages[!VR_current_page]),
-                                       gr_set_current_canvas(&VR_screen_pages[!VR_current_page])
-                               );
+                               gr_set_current_canvas(&VR_screen_pages[!VR_current_page]);
                        else
-                               WINDOS(
-                                       dd_gr_set_current_canvas(get_current_game_screen()),
-                                       gr_set_current_canvas(get_current_game_screen())
-                               );
+                               gr_set_current_canvas(get_current_game_screen());
 
-                       WINDOS(
-                               dd_gr_blt_notrans(&window_canv, 0,0,0,0,
-                                                                               dd_grd_curcanv, window_x, window_y, 0,0),
-                               gr_bitmap(window_x,window_y,&window_canv.cv_bitmap)
-                       );
+                       gr_bitmap(window_x,window_y,&window_canv.cv_bitmap);
 
                        overlap_dirty[win] = 1;
                }
                else {
 
-               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
-               );
+                       small_window_bottom = window_y + window_canv.cv_bitmap.bm_h - 1;
                        
                        extra_part_h = small_window_bottom - big_window_bottom;
 
                        if (extra_part_h > 0) {
                        
-                               WINDOS(
-                                       dd_gr_init_sub_canvas(&overlap_canv,&window_canv,0,
-                                               window_canv.canvas.cv_bitmap.bm_h-extra_part_h,
-                                               window_canv.canvas.cv_bitmap.bm_w,extra_part_h),
-                                       gr_init_sub_canvas(&overlap_canv,&window_canv,0,window_canv.cv_bitmap.bm_h-extra_part_h,window_canv.cv_bitmap.bm_w,extra_part_h)
-                               );
+                               gr_init_sub_canvas(&overlap_canv,&window_canv,0,window_canv.cv_bitmap.bm_h-extra_part_h,window_canv.cv_bitmap.bm_w,extra_part_h);
 
                                if (VR_screen_flags & VRF_USE_PAGING)
-                                       WINDOS(
-                                               dd_gr_set_current_canvas(&dd_VR_screen_pages[!VR_current_page]),
-                                               gr_set_current_canvas(&VR_screen_pages[!VR_current_page])
-                                       );
+                                       gr_set_current_canvas(&VR_screen_pages[!VR_current_page]);
                                else
-                                       WINDOS(
-                                               dd_gr_set_current_canvas(get_current_game_screen()),
-                                               gr_set_current_canvas(get_current_game_screen())
-                                       );
-
-                               WINDOS(
-                                       dd_gr_blt_notrans(&overlap_canv, 0,0,0,0,
-                                                                                       dd_grd_curcanv, window_x, big_window_bottom+1, 0,0),
-                                       gr_bitmap(window_x,big_window_bottom+1,&overlap_canv.cv_bitmap)
-                               );
+                                       gr_set_current_canvas(get_current_game_screen());
+
+                               gr_bitmap(window_x,big_window_bottom+1,&overlap_canv.cv_bitmap);
                                
                                overlap_dirty[win] = 1;
                        }
@@ -3569,14 +3280,8 @@ WINDOS(
        }
        else {
        
-       WINDOS(
-               dd_gr_set_current_canvas(get_current_game_screen()),
-               gr_set_current_canvas(get_current_game_screen())
-       );
-       WINDOS(
-               copy_gauge_box(box,&dd_VR_render_buffer[0]),
-               copy_gauge_box(box,&VR_render_buffer[0].cv_bitmap)
-       );
+               gr_set_current_canvas(get_current_game_screen());
+               copy_gauge_box(box,&VR_render_buffer[0].cv_bitmap);
        }
 
        //force redraw when done
index db167e7..9394aaa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hud.c,v 1.11 2005-07-30 09:16:25 chris Exp $ */
+/* $Id: hud.c,v 1.12 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -74,47 +74,19 @@ int Modex_hud_msg_count;
 #define LHX(x)      ((x)*(FontHires?2:1))
 #define LHY(y)      ((y)*(FontHires?2.4:1))
 
-#ifdef WINDOWS
-int extra_clear=0;
-#endif
-
 // ----------------------------------------------------------------------------
 void clear_background_messages(void)
 {
-       #ifdef WINDOWS
-       if (extra_clear == FrameCount)          //don't do extra clear on same frame
-               return;
-       #endif
-
-#ifdef WINDOWS
-       if (((Cockpit_mode == CM_STATUS_BAR) || (Cockpit_mode == CM_FULL_SCREEN)) && (Last_msg_ycrd != -1) && (dd_VR_render_sub_buffer[0].yoff >= 6)) {
-               dd_grs_canvas *canv_save = dd_grd_curcanv;
-#else
        if (((Cockpit_mode == CM_STATUS_BAR) || (Cockpit_mode == CM_FULL_SCREEN)) && (Last_msg_ycrd != -1) && (VR_render_sub_buffer[0].cv_bitmap.bm_y >= 6)) {
                grs_canvas      *canv_save = grd_curcanv;
-#endif
 
-               WINDOS( dd_gr_set_current_canvas(get_current_game_screen()),
-                               gr_set_current_canvas(get_current_game_screen())
-               );
+               gr_set_current_canvas(get_current_game_screen());
 
                copy_background_rect(0, Last_msg_ycrd, grd_curcanv->cv_bitmap.bm_w, Last_msg_ycrd+Last_msg_height-1);
 
-               WINDOS(
-                       dd_gr_set_current_canvas(canv_save),
-                       gr_set_current_canvas(canv_save)
-               );
+               gr_set_current_canvas(canv_save);
 
-               #ifdef WINDOWS
-               if (extra_clear || !GRMODEINFO(modex)) {
-                       extra_clear = 0;
-                       Last_msg_ycrd = -1;
-               }
-               else
-                       extra_clear = FrameCount;
-               #else
                Last_msg_ycrd = -1;
-               #endif
        }
 
        Displayed_background_message[VR_current_page][0] = 0;
@@ -168,11 +140,6 @@ void HUD_render_message_frame()
 
        HUD_message_timer -= FrameTime;
 
-       #ifdef WINDOWS
-       if (extra_clear)
-               clear_background_messages();                    //      If in status bar mode and no messages, then erase.
-       #endif
-
        if ( HUD_message_timer < 0 )    {
                // Timer expired... get rid of oldest message...
                if (hud_last!=hud_first)        {
@@ -196,33 +163,20 @@ void HUD_render_message_frame()
                if (HUD_color == -1)
                        HUD_color = BM_XRGB(0,28,0);
 
-       #ifdef WINDOWS
-               if ( (VR_render_mode==VR_NONE) && ((Cockpit_mode == CM_STATUS_BAR) || (Cockpit_mode == CM_FULL_SCREEN)) && (dd_VR_render_sub_buffer[0].yoff >= (max_window_h/8))) {
-       #else
                if ( (VR_render_mode==VR_NONE) && ((Cockpit_mode == CM_STATUS_BAR) || (Cockpit_mode == CM_FULL_SCREEN)) && (VR_render_sub_buffer[0].cv_bitmap.bm_y >= (max_window_h/8))) {
-       #endif
                        // Only display the most recent message in this mode
                        char    *message = HUD_messages[(hud_first+HUD_nmessages-1) % HUD_MAX_NUM];
 
                        if (strcmp(Displayed_background_message[VR_current_page], message)) {
                                int     ycrd;
-                               WINDOS(
-                                       dd_grs_canvas *canv_save = dd_grd_curcanv,
-                                       grs_canvas      *canv_save = grd_curcanv
-                               );
+                               grs_canvas      *canv_save = grd_curcanv;
 
-                               WINDOS(
-                                       ycrd = dd_grd_curcanv->yoff - (SMALL_FONT->ft_h+2),
-                                       ycrd = grd_curcanv->cv_bitmap.bm_y - (SMALL_FONT->ft_h+2)
-                               );
+                               ycrd = grd_curcanv->cv_bitmap.bm_y - (SMALL_FONT->ft_h+2);
 
                                if (ycrd < 0)
                                        ycrd = 0;
 
-                               WINDOS(
-                                       dd_gr_set_current_canvas(get_current_game_screen()),
-                                       gr_set_current_canvas(get_current_game_screen())
-                               );
+                               gr_set_current_canvas(get_current_game_screen());
 
                                gr_set_curfont( SMALL_FONT );
                                gr_get_string_size(message, &w, &h, &aw );
@@ -230,7 +184,6 @@ void HUD_render_message_frame()
 
 
                                if (grd_curcanv->cv_bitmap.bm_type == BM_MODEX) {
-                                       WIN(Int3());    // No no no no ....
                                        ycrd -= h;
                                        h *= 2;
                                        modex_hud_message((grd_curcanv->cv_bitmap.bm_w-w)/2, ycrd, message, SMALL_FONT, HUD_color);
@@ -240,17 +193,12 @@ void HUD_render_message_frame()
                                        } else
                                                strcpy(Displayed_background_message[VR_current_page], message);
                                } else {
-                               WIN(DDGRLOCK(dd_grd_curcanv));
                                        gr_set_fontcolor( HUD_color, -1);
                                        gr_printf((grd_curcanv->cv_bitmap.bm_w-w)/2, ycrd, message );
                                        strcpy(Displayed_background_message[VR_current_page], message);
-                               WIN(DDGRUNLOCK(dd_grd_curcanv));
                                }
 
-                       WINDOS(
-                               dd_gr_set_current_canvas(canv_save),
-                               gr_set_current_canvas(canv_save)
-                       );
+                               gr_set_current_canvas(canv_save);
 
                                Last_msg_ycrd = ycrd;
                                Last_msg_height = h;
@@ -272,7 +220,6 @@ void HUD_render_message_frame()
                      Guided_missile[Player_num]->signature==Guided_missile_sig[Player_num] && Guided_in_big_window)
                              y+=SMALL_FONT->ft_h+3;
 
-               WIN(DDGRLOCK(dd_grd_curcanv));
                        for (i=0; i<HUD_nmessages; i++ )        {
                                n = (hud_first+i) % HUD_MAX_NUM;
                                if ((n < 0) || (n >= HUD_MAX_NUM))
@@ -285,10 +232,8 @@ void HUD_render_message_frame()
                                gr_string((grd_curcanv->cv_bitmap.bm_w-w)/2,y, &HUD_messages[n][0] );
                                y += h+1;
                        }
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
                }
        }
-       #ifndef WINDOWS
        else if (get_current_game_screen()->cv_bitmap.bm_type == BM_MODEX) {
                if (Modex_hud_msg_count) {
                        int     temp = Last_msg_ycrd;
@@ -297,7 +242,6 @@ void HUD_render_message_frame()
                        Last_msg_ycrd = temp;
                }
        }
-       #endif
 
        gr_set_curfont( GAME_FONT );
 }
index 9d35b81..4019cb9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: kconfig.c,v 1.39 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: kconfig.c,v 1.40 2005-08-02 06:13:56 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: kconfig.c,v 1.39 2005-07-30 01:50:17 chris Exp $";
+static char rcsid[] = "$Id: kconfig.c,v 1.40 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 #ifdef WINDOWS
@@ -884,10 +884,7 @@ int get_item_height(kc_item *item)
 
 void kconfig_sub(kc_item * items,int nitems, char * title)
 {
-WINDOS(
-       dd_grs_canvas * save_canvas,
-       grs_canvas * save_canvas
-);
+       grs_canvas * save_canvas;
        grs_font * save_font;
        int old_keyd_repeat;
 #ifdef NEWMENU_MOUSE
@@ -897,10 +894,6 @@ WINDOS(
 
        int i,k,ocitem,citem;
        int time_stopped = 0;
-WIN(char *old_bg_pcx);
-
-WIN(old_bg_pcx = _SCRContext.bkg_filename);
-WIN(DEFINE_SCREEN(NULL));
 
        All_items = items;
        Num_items = nitems;
@@ -918,16 +911,10 @@ WIN(DEFINE_SCREEN(NULL));
 //             );                                                                                              // Get Samir...
 //     }
 
-WINDOS(
-       save_canvas = dd_grd_curcanv,
-       save_canvas = grd_curcanv
-);
+       save_canvas = grd_curcanv;
 
 
-WINDOS(
-       dd_gr_set_current_canvas(NULL),
-       gr_set_current_canvas(NULL)
-);             
+       gr_set_current_canvas(NULL);
        save_font = grd_curcanv->cv_font;
 
 #ifdef WINDOWS
@@ -944,7 +931,6 @@ KConfigPaint:
 
        grd_curcanv->cv_font = MEDIUM3_FONT;
 
-WIN(DDGRLOCK(dd_grd_curcanv)); 
        {
                char * p;
                p = strchr( title, '\n' );
@@ -1040,8 +1026,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        }
 #endif
 
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
-
        for (i=0; i<nitems; i++ )       {
                kc_drawitem( &items[i], 0 );
        }
@@ -1057,23 +1041,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        while(1)                {
        //      Windows addendum to allow for kconfig input.
-       #ifdef WINDOWS
-               {
-                       MSG msg;
-
-                       DoMessageStuff(&msg);
-
-                       if (_RedrawScreen) {
-                               _RedrawScreen = FALSE;
-
-                               dd_gr_set_current_canvas(NULL); 
-
-                               goto KConfigPaint;
-                       }
-
-                       DDGRRESTORE;
-               }
-       #endif
                gr_update();
 
                //see if redbook song needs to be restarted
@@ -1200,12 +1167,7 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
                case KEY_ESC:
                        grd_curcanv->cv_font    = save_font;
 
-               WIN(DEFINE_SCREEN(old_bg_pcx));
-
-               WINDOS(
-                       dd_gr_set_current_canvas(save_canvas),
-                       gr_set_current_canvas( save_canvas )
-               );                      
+                       gr_set_current_canvas( save_canvas );
                        keyd_repeat = old_keyd_repeat;
                        game_flush_inputs();
                        newmenu_hide_cursor();
@@ -1329,8 +1291,7 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
                                y2 = y1 + close_size - LHX(1);
                                if ( ((mx > x1) && (mx < x2)) && ((my > y1) && (my < y2)) ) {
                                        grd_curcanv->cv_font    = save_font;
-                                       WINDOS(dd_gr_set_current_canvas( save_canvas ),
-                                                       gr_set_current_canvas( save_canvas ));
+                                       gr_set_current_canvas( save_canvas );
                                        keyd_repeat = old_keyd_repeat;
                                        game_flush_inputs();
                                        newmenu_hide_cursor();
@@ -1358,14 +1319,11 @@ void kc_drawitem( kc_item *item, int is_current )
        int x, w, h, aw;
        char btext[16];
 
-WIN(DDGRLOCK(dd_grd_curcanv));
-
        if (is_current)
                gr_set_fontcolor( BM_XRGB(20,20,29), -1 );
        else
                gr_set_fontcolor( BM_XRGB(15,15,24), -1 );
    gr_string( LHX(item->x), LHY(item->y), item->text );
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        if (item->value==255) {
                strcpy( btext, "" );
@@ -1427,7 +1385,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
                }
        }
        if (item->w1) {
-       WIN(DDGRLOCK(dd_grd_curcanv));
                gr_get_string_size(btext, &w, &h, &aw  );
 
                if (is_current)
@@ -1441,8 +1398,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
                x = LHX(item->w1+item->x)+((LHX(item->w2)-w)/2);
        
                gr_string( x, LHY(item->y), btext );
-
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
        }
 }
 
@@ -1453,8 +1408,6 @@ void kc_drawquestion( kc_item *item )
 {
        int c, x, w, h, aw;
 
-WIN(DDGRLOCK(dd_grd_curcanv)); 
-
        gr_get_string_size("?", &w, &h, &aw  );
 
        c = BM_XRGB(21,0,24);
@@ -1471,7 +1424,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        x = LHX(item->w1+item->x)+((LHX(item->w2)-w)/2);
    
        gr_string( x, LHY(item->y), "?" );
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 gr_update();
 }
 
@@ -1480,11 +1432,9 @@ void kc_change_key( kc_item * item )
        int i,n,f,k;
        ubyte keycode;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
        
        gr_string( 0x8000, LHY(INFO_Y), TXT_PRESS_NEW_KEY );
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
 
        game_flush_inputs();
        keycode=255;
@@ -1492,16 +1442,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
        
        while( (k!=KEY_ESC) && (keycode==255) ) 
        {                               
-       #ifdef WINDOWS
-               {
-                       MSG msg;
-
-                       DoMessageStuff(&msg);
-                       DDGRRESTORE;
-               
-               }
-       #endif
-
                #ifdef NETWORK
                if ((Game_mode & GM_MULTI) && (Function_mode == FMODE_GAME) && (!Endlevel_sequence))
                        multi_menu_poll();
@@ -1536,9 +1476,7 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
        }
        kc_drawitem( item, 1 );
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_fontcolor( BM_XRGB(28,28,28), BM_XRGB(0,0,0) );
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        nm_restore_background( 0, LHY(INFO_Y), LHX(310), grd_curcanv->cv_font->ft_h );
 
@@ -1551,11 +1489,9 @@ void kc_change_joybutton( kc_item * item )
        int n,i,k;
        ubyte code;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
        
        gr_string( 0x8000, LHY(INFO_Y), TXT_PRESS_NEW_JBUTTON );
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
 
        game_flush_inputs();
        code=255;
@@ -1563,14 +1499,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
        
        while( (k!=KEY_ESC) && (code==255))     
        {                               
-       #ifdef WINDOWS
-               {
-                       MSG msg;
-                       DoMessageStuff(&msg);
-                       DDGRRESTORE;
-               }
-       #endif
-
                #ifdef NETWORK
                if ((Game_mode & GM_MULTI) && (Function_mode == FMODE_GAME) && (!Endlevel_sequence))
                        multi_menu_poll();
@@ -1640,12 +1568,9 @@ void kc_change_mousebutton( kc_item * item )
        int n,i,b,k;
        ubyte code;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
        
        gr_string( 0x8000, LHY(INFO_Y), TXT_PRESS_NEW_MBUTTON );
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
-
 
        game_flush_inputs();
        code=255;
@@ -1653,14 +1578,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
        
        while( (k!=KEY_ESC) && (code==255))     
        {                               
-       #ifdef WINDOWS
-               {
-                       MSG msg;
-                       DoMessageStuff(&msg);
-                       DDGRRESTORE;
-               }
-       #endif
-
                #ifdef NETWORK
                if ((Game_mode & GM_MULTI) && (Function_mode == FMODE_GAME) && (!Endlevel_sequence))
                        multi_menu_poll();
@@ -1747,11 +1664,9 @@ void kc_change_joyaxis( kc_item * item )
        int n,i,k;
        ubyte code;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
        
        gr_string( 0x8000, LHY(INFO_Y), TXT_MOVE_NEW_JOY_AXIS );
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
 
        game_flush_inputs();
        code=255;
@@ -1764,14 +1679,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        while( (k!=KEY_ESC) && (code==255))     
        {                               
-       #ifdef WINDOWS
-               {
-                       MSG msg;
-                       DoMessageStuff(&msg);
-                       DDGRRESTORE;
-               }
-       #endif
-
                #ifdef NETWORK
                if ((Game_mode & GM_MULTI) && (Function_mode == FMODE_GAME) && (!Endlevel_sequence))
                        multi_menu_poll();
@@ -1838,11 +1745,9 @@ void kc_change_mouseaxis( kc_item * item )
        int dz;
 #endif
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
        
        gr_string( 0x8000, LHY(INFO_Y), TXT_MOVE_NEW_MSE_AXIS );
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
 
        game_flush_inputs();
        code=255;
@@ -1852,14 +1757,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        while( (k!=KEY_ESC) && (code==255))     
        {                               
-       #ifdef WINDOWS
-               {
-                       MSG msg;
-                       DoMessageStuff(&msg);
-                       DDGRRESTORE;
-               }
-       #endif
-
                #ifdef NETWORK
                if ((Game_mode & GM_MULTI) && (Function_mode == FMODE_GAME) && (!Endlevel_sequence))
                        multi_menu_poll();
@@ -1927,16 +1824,11 @@ void kconfig(int n, char * title)
        kc_set_controls();
 
        //save screen
-       WIN(mouse_set_mode(0));
-       WIN(dd_gr_set_current_canvas(NULL));
-       
        save_bm = gr_create_bitmap( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h );
        Assert( save_bm != NULL );
        
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_bm_bitblt(grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_w, 
-                                                0, 0, 0, 0, &grd_curcanv->cv_bitmap, save_bm );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_bm_bitblt(grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_w, 
+                                       0, 0, 0, 0, &grd_curcanv->cv_bitmap, save_bm );
 
        switch(n)       {
        case 0:kconfig_sub( kc_keyboard, NUM_KEY_CONTROLS, title );break;
@@ -1954,11 +1846,7 @@ void kconfig(int n, char * title)
        }
 
        //restore screen
-       WIN(mouse_set_mode(1));
-       WIN(dd_gr_set_current_canvas(NULL));
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_bitmap(0, 0, save_bm);
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_bitmap(0, 0, save_bm);
        gr_free_bitmap(save_bm);
 
 #if 0 // set_screen_mode always calls this later... right?
index 320a97c..65e52e7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: kmatrix.c,v 1.8 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: kmatrix.c,v 1.9 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,10 +22,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #include <conf.h>
 #endif
 
-#ifdef WINDOWS
-#include "desw.h"
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -376,19 +372,14 @@ void kmatrix_phallic ()
 
 void load_stars(void);
 
-WINDOS(dd_grs_canvas *StarBackCanvas,
-                       grs_canvas *StarBackCanvas
-);             //,*SaveCanvas;
+grs_canvas *StarBackCanvas;
 
 
 void kmatrix_redraw()
 {
        int i, color;
        int sorted[MAX_NUM_NET_PLAYERS];
-WINDOS(
-       dd_grs_canvas *tempcanvas,
-   grs_canvas *tempcanvas
-);
+       grs_canvas *tempcanvas;
   
    if (Game_mode & GM_MULTI_COOP)
         {
@@ -398,22 +389,12 @@ WINDOS(
         
        multi_sort_kill_list();
 
-       WINDOS(
-          tempcanvas=dd_gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h ),
-       tempcanvas=gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h )
-       );
+   tempcanvas=gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h );
 
-   WINDOS(
-               dd_gr_set_current_canvas(tempcanvas),
-               gr_set_current_canvas (tempcanvas)
-       );
+   gr_set_current_canvas (tempcanvas);
 
-       WINDOS (
-               dd_gr_blt_notrans(StarBackCanvas, 0,0,0,0, tempcanvas,0,0,0,0),
-               gr_bitmap (0,0,&StarBackCanvas->cv_bitmap)
-       );
+   gr_bitmap (0,0,&StarBackCanvas->cv_bitmap);
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        grd_curcanv->cv_font = MEDIUM3_FONT;
 
        gr_string( 0x8000, LHY(10), TXT_KILL_MATRIX_TITLE       );
@@ -441,54 +422,29 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        }
 
        kmatrix_draw_deaths(sorted);
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
-WINDOS(
-       dd_gr_set_current_canvas(NULL),
-       gr_set_current_canvas(NULL)
-);
+       gr_set_current_canvas(NULL);
 
-WINDOS(
-       dd_gr_blt_notrans(tempcanvas, 0,0,0,0, dd_grd_curcanv, 0,0,0,0),
-       gr_bitmap (0,0,&tempcanvas->cv_bitmap)
-);
+       gr_bitmap (0,0,&tempcanvas->cv_bitmap);
 
        gr_palette_load(gr_palette);
-WINDOS(
-       dd_gr_free_canvas(tempcanvas),
-       gr_free_canvas (tempcanvas)
-);
+       gr_free_canvas (tempcanvas);
 }
 
 void kmatrix_redraw_coop()
 {
        int i, color;
        int sorted[MAX_NUM_NET_PLAYERS];
-
-WINDOS(
-       dd_grs_canvas *tempcanvas,
-       grs_canvas *tempcanvas
-);
+       grs_canvas *tempcanvas;
        
        multi_sort_kill_list();
 
-WINDOS(
-   tempcanvas=dd_gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h ),
-   tempcanvas=gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h )
-);
-WINDOS(
-       dd_gr_set_current_canvas(tempcanvas),
-   gr_set_current_canvas (tempcanvas)
-);
-
-WINDOS (
-       dd_gr_blt_notrans(StarBackCanvas, 0,0,0,0, tempcanvas,0,0,0,0),
-       gr_bitmap (0,0,&StarBackCanvas->cv_bitmap)
-);
+       tempcanvas=gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h );
+       gr_set_current_canvas (tempcanvas);
 
+       gr_bitmap (0,0,&StarBackCanvas->cv_bitmap);
 
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        grd_curcanv->cv_font = MEDIUM3_FONT;
        gr_string( 0x8000, LHY(10), "COOPERATIVE SUMMARY"       );
 
@@ -511,23 +467,13 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        }
 
        kmatrix_draw_deaths(sorted);
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
-WINDOS(
-       dd_gr_set_current_canvas(NULL),
-       gr_set_current_canvas(NULL)
-);
+       gr_set_current_canvas(NULL);
 
-WINDOS(
-       dd_gr_blt_notrans(tempcanvas, 0,0,0,0, dd_grd_curcanv, 0,0,0,0),
-       gr_bitmap (0,0,&tempcanvas->cv_bitmap)
-);
+       gr_bitmap (0,0,&tempcanvas->cv_bitmap);
 
        gr_palette_load(gr_palette);
-WINDOS(
-       dd_gr_free_canvas(tempcanvas),
-       gr_free_canvas (tempcanvas)
-);
+       gr_free_canvas (tempcanvas);
 }
 
 #define MAX_VIEW_TIME   F1_0*15
@@ -558,14 +504,8 @@ void kmatrix_view(int network)
        
    set_screen_mode( SCREEN_MENU );
 
-       WINDOS(
-               StarBackCanvas=dd_gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h ),
-               StarBackCanvas=gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h )
-       );
-       WINDOS(
-               dd_gr_set_current_canvas(StarBackCanvas),
-          gr_set_current_canvas(StarBackCanvas)
-       );
+   StarBackCanvas=gr_create_canvas( grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h );
+   gr_set_current_canvas(StarBackCanvas);
        #ifdef MACINTOSH
        if (virtual_memory_on) {
                load_stars_palette();           // horrible hack to prevent too much paging when doing endlevel syncing
@@ -589,15 +529,6 @@ void kmatrix_view(int network)
           network_endlevel(&key);
 
        while(!done)    {
-       #ifdef WINDOWS
-               MSG msg;
-
-               DoMessageStuff(&msg);
-
-               DDGRRESTORE;
-
-       #endif
-
       kmatrix_kills_changed = 0;
       for (i=0; i<4; i++ )
           if (joy_get_button_down_cnt(i)>0)
@@ -609,10 +540,7 @@ void kmatrix_view(int network)
                        Players[Player_num].connected=0;
                                                 if (network)
                                network_send_endlevel_packet();
-                                               WINDOS(
-                                                       dd_gr_free_canvas(StarBackCanvas),
-                                                  gr_free_canvas (StarBackCanvas)
-                                               );
+                                                gr_free_canvas (StarBackCanvas);
                                            multi_leave_game();
                                       Kmatrix_nomovie_message=0;
                                       longjmp(LeaveGame, 0);
@@ -635,10 +563,7 @@ void kmatrix_view(int network)
                        Players[Player_num].connected=0;
                                                 if (network)
                                network_send_endlevel_packet();
-                                               WINDOS(
-                                                       dd_gr_free_canvas(StarBackCanvas),
-                                                  gr_free_canvas (StarBackCanvas)
-                                               );
+                                                gr_free_canvas (StarBackCanvas);
                                            multi_leave_game();
                                       Kmatrix_nomovie_message=0;
                                       longjmp(LeaveGame, 0);
@@ -671,10 +596,7 @@ void kmatrix_view(int network)
                        Players[Player_num].connected=0;
                                                 if (network)
                                network_send_endlevel_packet();
-                                               WINDOS(
-                                                       dd_gr_free_canvas(StarBackCanvas),
-                                                  gr_free_canvas (StarBackCanvas)
-                                               );
+                                                gr_free_canvas (StarBackCanvas);
                                            multi_leave_game();
                                       Kmatrix_nomovie_message=0;
                                       longjmp(LeaveGame, 0);
@@ -699,10 +621,7 @@ void kmatrix_view(int network)
                 Players[Player_num].connected=0;
                                         if (network)
                        network_send_endlevel_packet();
-                                               WINDOS(
-                                                       dd_gr_free_canvas(StarBackCanvas),
-                                                  gr_free_canvas (StarBackCanvas)
-                                               );
+                                        gr_free_canvas (StarBackCanvas);
                                    multi_leave_game();
                               Kmatrix_nomovie_message=0;
                               longjmp(LeaveGame, 0);
@@ -731,10 +650,7 @@ void kmatrix_view(int network)
                        Players[Player_num].connected=0;
                                                 if (network)
                                network_send_endlevel_packet();
-                                               WINDOS(
-                                                       dd_gr_free_canvas(StarBackCanvas),
-                                                  gr_free_canvas (StarBackCanvas)
-                                               );
+                                                gr_free_canvas (StarBackCanvas);
                                            multi_leave_game();
                                       Kmatrix_nomovie_message=0;
                                       longjmp(LeaveGame, 0);
@@ -814,10 +730,7 @@ void kmatrix_view(int network)
 
        game_flush_inputs();
 
-       WINDOS(
-               dd_gr_free_canvas(StarBackCanvas),
-               gr_free_canvas (StarBackCanvas)
-       );
+       gr_free_canvas (StarBackCanvas);
 
    Kmatrix_nomovie_message=0;
 
index 7a9440a..838cf21 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: menu.c,v 1.43 2005-07-30 08:16:13 chris Exp $ */
+/* $Id: menu.c,v 1.44 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,10 +22,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #include <conf.h>
 #endif
 
-#ifdef WINDOWS
-#include "desw.h"
-#endif
-
 #include <stdio.h>
 #include <string.h>
 
@@ -177,14 +173,12 @@ void autodemo_menu_check(int nitems, newmenu_item * items, int *last_key, int ci
                int w,h,aw;
 
                Menu_draw_copyright = 0;
-               WINDOS( dd_gr_set_current_canvas(NULL),
-                                       gr_set_current_canvas(NULL));
+               gr_set_current_canvas(NULL);
                gr_set_curfont(GAME_FONT);
                gr_set_fontcolor(BM_XRGB(6,6,6),-1);
 
                gr_get_string_size("V2.2", &w, &h, &aw );
        
-               WIN(DDGRLOCK(dd_grd_curcanv));
                        gr_printf(0x8000,grd_curcanv->cv_bitmap.bm_h-GAME_FONT->ft_h-2,TXT_COPYRIGHT);
                        #ifdef MACINTOSH        // print out fix level as well if it exists
                                if (Version_fix != 0)
@@ -211,8 +205,6 @@ void autodemo_menu_check(int nitems, newmenu_item * items, int *last_key, int ci
                        gr_set_curfont(MEDIUM2_FONT);
                        gr_printf(MenuHires?495:248, MenuHires?88:37, "Vertigo");
                }
-
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
        }
        
        // Don't allow them to hit ESC in the main menu.
@@ -235,10 +227,6 @@ try_again:;
                        if ((d_rand() % (n_demos+1)) == 0)
                        {
                                #ifndef SHAREWARE
-                                       #ifdef WINDOWS
-                                       mouse_set_mode(1);                              //re-enable centering mode
-                                       HideCursorW();
-                                       #endif
 #ifdef OGL
                                        Screen_mode = -1;
 #endif
@@ -246,10 +234,6 @@ try_again:;
                                        songs_play_song(SONG_TITLE,1);
                                        *last_key = -3; //exit menu to force redraw even if not going to game mode. -3 tells menu system not to restore
                                        set_screen_mode(SCREEN_MENU);
-                                       #ifdef WINDOWS
-                                       mouse_set_mode(0);                              //disenable centering mode
-                                       ShowCursorW();
-                                       #endif
                                #endif // end of ifndef shareware
                        }
                        else {
@@ -356,11 +340,6 @@ int DoMenu()
 
 extern void show_order_form(void);      // John didn't want this in inferno.h so I just externed it.
 
-#ifdef WINDOWS
-#undef TXT_SELECT_DEMO
-#define TXT_SELECT_DEMO "Select Demo\n<Ctrl-D> or Right-click\nto delete"
-#endif
-
 //returns flag, true means quit menu
 void do_option ( int select) 
 {
@@ -742,13 +721,6 @@ typedef struct {
 } dmi;
 
 dmi display_mode_info[7] = {
-               #ifdef WINDOWS
-                       {SM95_320x200x8X, 320, 200, VR_NONE, VRF_ALLOW_COCKPIT},
-                       {SM95_640x480x8, 640, 480, VR_NONE, VRF_COMPATIBLE_MENUS+VRF_ALLOW_COCKPIT},
-                       {SM95_640x400x8, 640, 400, VR_NONE, VRF_COMPATIBLE_MENUS }, 
-                       {SM95_800x600x8, 800, 600, VR_NONE, VRF_COMPATIBLE_MENUS },
-                       {SM95_1024x768x8, 1024, 768, VR_NONE, VRF_COMPATIBLE_MENUS }, 
-               #else
                        {SM(320,200),    320,   200, VR_NONE, VRF_ALLOW_COCKPIT+VRF_COMPATIBLE_MENUS}, 
                        {SM(640,480),    640, 480, VR_NONE, VRF_COMPATIBLE_MENUS+VRF_ALLOW_COCKPIT},
                        {SM(320,400),    320, 400, VR_NONE, VRF_USE_PAGING},
@@ -756,10 +728,7 @@ dmi display_mode_info[7] = {
                        {SM(800,600),    800, 600, VR_NONE, VRF_COMPATIBLE_MENUS}, 
                        {SM(1024,768),  1024,   768, VR_NONE, VRF_COMPATIBLE_MENUS},    
                        {SM(1280,1024),1280,1024, VR_NONE, VRF_COMPATIBLE_MENUS}, 
-               #endif
 };
-WIN(extern int DD_Emulation);
 
 
 void set_display_mode(int mode)
@@ -769,16 +738,12 @@ void set_display_mode(int mode)
        if ((Current_display_mode == -1)||(VR_render_mode != VR_NONE))  //special VR mode
                return;                                                         //...don't change
 
-       #if !defined(MACINTOSH) && !defined(WINDOWS)
        if (0) // (mode >= 5 && !FindArg("-superhires"))
                mode = 4;
-       #endif
 
        if (!MenuHiresAvailable && (mode != 2))
                mode = 0;
 
-#ifndef WINDOWS
-
        if (gr_check_mode(display_mode_info[mode].VGA_mode) != 0)               //can't do mode
                #ifndef MACINTOSH
                mode = 0;
@@ -787,16 +752,6 @@ void set_display_mode(int mode)
                #endif
 
        Current_display_mode = mode;
-#else
-       if (mode == 2) mode = 3;                                        // 320x400 -> 640x400.
-       Current_display_mode = mode;
-       if (mode >= 3) mode--;                                          // Match to Windows dmi.
-       if (DDCheckMode(display_mode_info[mode].VGA_mode)) {
-               if (Platform_system == WINNT_PLATFORM || DD_Emulation) mode = 1;
-               else mode = 0;
-               Current_display_mode = mode;
-       }
-#endif
 
        dmi = &display_mode_info[mode];
 
@@ -899,22 +854,9 @@ void do_screen_res_menu()
 
        m[0].type=NM_TYPE_TEXT;  m[0].value=0;                            m[0].text="Modes w/ Cockpit:";
        
-#ifdef WINDOWS
-       if (Platform_system == WINNT_PLATFORM || DD_Emulation) {
-               m[1].type=NM_TYPE_TEXT; m[1].value=0; m[1].text=" 320x200 N/A";
-       } else
-#endif
-               //NOTE LINK TO ABOVE IF
-               m[1].type=NM_TYPE_RADIO; m[1].value=0; m[1].group=0; m[1].text=" 320x200";
-
+       m[1].type=NM_TYPE_RADIO; m[1].value=0; m[1].group=0; m[1].text=" 320x200";
        m[2].type=NM_TYPE_RADIO; m[2].value=0; m[2].group=0; m[2].text=" 640x480";
        m[3].type=NM_TYPE_TEXT;  m[3].value=0;                                    m[3].text="Modes w/o Cockpit:";
-#ifdef WINDOWS
-       m[4].type=NM_TYPE_RADIO; m[4].value=0; m[4].group=0; m[4].text=" 640x400";
-       m[5].type=NM_TYPE_RADIO; m[5].value=0; m[5].group=0; m[5].text=" 800x600";
-//     m[6].type=NM_TYPE_RADIO; m[6].value=0; m[6].group=0; m[6].text=" 1024x768";
-       n_items = 6;
-#else
        m[4].type=NM_TYPE_RADIO; m[4].value=0; m[4].group=0; m[4].text=" 320x400";
        m[5].type=NM_TYPE_RADIO; m[5].value=0; m[5].group=0; m[5].text=" 640x400";
        m[6].type=NM_TYPE_RADIO; m[6].value=0; m[6].group=0; m[6].text=" 800x600";
@@ -924,7 +866,6 @@ void do_screen_res_menu()
                m[8].type=NM_TYPE_RADIO; m[8].value=0; m[8].group=0; m[8].text=" 1280x1024";
                n_items += 2;
        }
-#endif
 
 #ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE
        m[n_items].type = NM_TYPE_CHECK; m[n_items].text = "Fullscreen";
@@ -934,12 +875,8 @@ void do_screen_res_menu()
 
        citem = Current_display_mode+1;
        
-#ifdef WINDOWS
-       if (citem == 3) citem++;                                // if 320x400 in DOS, make it look like 640x400
-#else
        if (Current_display_mode >= 2)
                citem++;
-#endif
 
        if (citem >= n_items)
                citem = n_items-1;
@@ -959,35 +896,17 @@ void do_screen_res_menu()
                if (m[i].value)
                        break;
 
-#ifndef WINDOWS                                                                // if i >= 4 keep it that way since we skip 320x400
        if (i >= 4)
                i--;
-#endif
 
        i--;
 
-#ifndef WINDOWS
        if (((i != 0) && (i != 2) && !MenuHiresAvailable) || gr_check_mode(display_mode_info[i].VGA_mode)) {
                nm_messagebox(TXT_SORRY, 1, TXT_OK, 
                                "Cannot set requested\n"
                                "mode on this video card.");
                return;
        }
-#else
-       if (i >= 3) 
-               result = DDCheckMode(display_mode_info[i-1].VGA_mode);
-       else 
-               result = DDCheckMode(display_mode_info[i].VGA_mode);
-
-       if (result) {
-               nm_messagebox(TXT_SORRY, 1, TXT_OK, 
-                               "Mode not supported by your\n"
-                               "DirectDraw driver.\n", 
-                               "Using default mode for gameplay.\n");
-               return;
-       }
-
-#endif
 #ifdef SHAREWARE
                if (i != 0)
                        nm_messagebox(TXT_SORRY, 1, TXT_OK, 
index 6ba6a5a..6c65f4f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: newmenu.c,v 1.31 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: newmenu.c,v 1.32 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,10 +22,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #include <conf.h>
 #endif
 
-#ifdef WINDOWS
-#include "desw.h"
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -109,7 +105,7 @@ int Newmenu_first_time = 1;
 //--unused-- int Newmenu_fade_in = 1;
 
 typedef struct bkg {
-       WINDOS (dd_grs_canvas *menu_canvas, grs_canvas * menu_canvas);
+       grs_canvas * menu_canvas;
        grs_bitmap * saved;                     // The background under the menu.
        grs_bitmap * background;
 } bkg;
@@ -192,9 +188,7 @@ void nm_draw_background1(char * filename)
 
        }
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        show_fullscr(bmp);
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        gr_free_bitmap(bmp);
 
@@ -257,7 +251,6 @@ void nm_draw_background(int x1, int y1, int x2, int y2 )
 
                gr_bitmap_scale_to(&nm_background, tmp);
 
-               WIN(DDGRLOCK(dd_grd_curcanv));
                if (No_darkening)
                        gr_bm_bitblt(w, h, x1, y1, LHX(10), LHY(10), tmp, &(grd_curcanv->cv_bitmap) );
                else
@@ -265,7 +258,6 @@ void nm_draw_background(int x1, int y1, int x2, int y2 )
                gr_free_bitmap(tmp);
        }
 #else
-       WIN(DDGRLOCK(dd_grd_curcanv));
        if (No_darkening)
                gr_bm_bitblt(w, h, x1, y1, LHX(10), LHY(10), &nm_background, &(grd_curcanv->cv_bitmap) );
        else
@@ -290,7 +282,6 @@ void nm_draw_background(int x1, int y1, int x2, int y2 )
                gr_urect( x1+1, y2-1, x2, y2-1 );
                gr_urect( x1+0, y2, x2, y2-0 );
        }
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        Gr_scanline_darkening_level = GR_FADE_LEVELS;
 }
@@ -311,9 +302,7 @@ void nm_restore_background( int x, int y, int w, int h )
        w = x2 - x1 + 1;
        h = y2 - y1 + 1;
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_bm_bitblt(w, h, x1, y1, x1, y1, &nm_background, &(grd_curcanv->cv_bitmap) );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_bm_bitblt(w, h, x1, y1, x1, y1, &nm_background, &(grd_curcanv->cv_bitmap) );
 }
 
 // Draw a left justfied string
@@ -421,7 +410,6 @@ void nm_string_black( bkg * b, int w1,int x, int y, char * s )
        b = b;                                  
        if (w1 == 0) w1 = w;
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
                gr_setcolor( BM_XRGB(2,2,2) );
                gr_rect( x-1, y-1, x-1, y+h-1 );
                gr_rect( x-1, y-1, x+w1-1, y-1 );
@@ -435,7 +423,6 @@ void nm_string_black( bkg * b, int w1,int x, int y, char * s )
                gr_rect( x, y, x+w1-1, y+h-1 );
        
                gr_string( x+1, y+1, s );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 
@@ -451,10 +438,8 @@ void nm_rstring( bkg * b,int w1,int x, int y, char * s )
        //mprintf( 0, "Width = %d, string='%s'\n", w, s );
 
        // CHANGED
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_bm_bitblt(w1, h, x-w1, y, x-w1, y, b->background, &(grd_curcanv->cv_bitmap) );
-               gr_string( x-w, y, s );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
+       gr_bm_bitblt(w1, h, x-w1, y, x-w1, y, b->background, &(grd_curcanv->cv_bitmap) );
+       gr_string( x-w, y, s );
 }
 
 #include "timer.h"
@@ -480,14 +465,12 @@ void update_cursor( newmenu_item *item)
                w = 0;
        x = item->x+w; y = item->y;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        if (time & 0x8000)
                gr_string( x, y, CURSOR_STRING );
        else {
                gr_setcolor( BM_XRGB(0,0,0) );
                gr_rect( x, y, x+grd_curcanv->cv_font->ft_w-1, y+grd_curcanv->cv_font->ft_h-1 );
        }
-WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 void nm_string_inputbox( bkg *b, int w, int x, int y, char * text, int current )
@@ -536,7 +519,6 @@ void draw_item( bkg * b, newmenu_item *item, int is_current,int tiny )
                #endif
         }
 
-WIN(DDGRLOCK(dd_grd_curcanv)); 
        switch( item->type )    {
        case NM_TYPE_TEXT:
       // grd_curcanv->cv_font=TEXT_FONT;
@@ -594,8 +576,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
                }
                break;
        }
-WIN(DDGRUNLOCK(dd_grd_curcanv));
-
 }
 
 char *Newmenu_allowed_chars=NULL;
@@ -727,12 +707,10 @@ extern ubyte joydefs_calibrating;
 
 void draw_close_box(int x,int y)
 {
-       WIN (DDGRLOCK(dd_grd_curcanv));
        gr_setcolor( BM_XRGB(0, 0, 0) );
        gr_rect(x + CLOSE_X, y + CLOSE_Y, x + CLOSE_X + CLOSE_SIZE, y + CLOSE_Y + CLOSE_SIZE);
        gr_setcolor( BM_XRGB(21, 21, 21) );
        gr_rect(x + CLOSE_X + LHX(1), y + CLOSE_Y + LHX(1), x + CLOSE_X + CLOSE_SIZE - LHX(1), y + CLOSE_Y + CLOSE_SIZE - LHX(1));
-       WIN (DDGRUNLOCK(dd_grd_curcanv));
 }
 
 int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height, int TinyMode )
@@ -750,7 +728,7 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item,
    char *Temp,TempVal;
        int dont_restore=0;
    int MaxOnMenu=MAXDISPLAYABLEITEMS;
-       WINDOS(dd_grs_canvas *save_canvas, grs_canvas *save_canvas );   
+       grs_canvas *save_canvas;        
 #ifdef NEWMENU_MOUSE
        int mouse_state, omouse_state, dblclick_flag=0;
        int mx=0, my=0, x1 = 0, x2, y1, y2;
@@ -768,8 +746,6 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item,
                return -1;
     } 
 
-       WIN(mouse_set_mode(0));         //disable centering mode
-
         MaxDisplayable=nitems;
 
        //set_screen_mode(SCREEN_MENU);
@@ -790,12 +766,9 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item,
                #endif
        }
 
-#ifdef WINDOWS
-RePaintNewmenu4:
-#endif
-       WINDOS( save_canvas = dd_grd_curcanv, save_canvas = grd_curcanv );
+       save_canvas = grd_curcanv;
 
-       WINDOS( dd_gr_set_current_canvas(NULL), gr_set_current_canvas(NULL) );
+       gr_set_current_canvas(NULL);
 
        save_font = grd_curcanv->cv_font;
 
@@ -987,12 +960,8 @@ RePaintNewmenu4:
        }
 
 // Save the background of the display
-//             Win95 must refer to the screen as a dd_grs_canvas, so...
-       WINDOS (        bg.menu_canvas = dd_gr_create_sub_canvas( dd_grd_screencanv, x, y, w, h ),
-                       bg.menu_canvas = gr_create_sub_canvas( &grd_curscreen->sc_canvas, x, y, w, h )
-       );
-       WINDOS (        dd_gr_set_current_canvas( bg.menu_canvas ), 
-                       gr_set_current_canvas(bg.menu_canvas)   );
+       bg.menu_canvas = gr_create_sub_canvas( &grd_curscreen->sc_canvas, x, y, w, h );
+       gr_set_current_canvas(bg.menu_canvas);
 
        if ( filename == NULL ) {
                // Save the background under the menu...
@@ -1004,19 +973,13 @@ RePaintNewmenu4:
                bg.saved = gr_create_bitmap( w, h );
                Assert( bg.saved != NULL );
 
-               WIN (DDGRLOCK(dd_grd_curcanv));
-                       gr_bm_bitblt(w, h, 0, 0, 0, 0, &grd_curcanv->cv_bitmap, bg.saved );
-               WIN (DDGRUNLOCK(dd_grd_curcanv));
+               gr_bm_bitblt(w, h, 0, 0, 0, 0, &grd_curcanv->cv_bitmap, bg.saved );
 
-               WINDOS (        dd_gr_set_current_canvas(NULL), 
-                                       gr_set_current_canvas( NULL ) 
-               );
+               gr_set_current_canvas( NULL );
 
                nm_draw_background(x,y,x+w-1,y+h-1);
 
-               WINDOS (        dd_gr_set_current_canvas(bg.menu_canvas),
-                                       gr_set_current_canvas( bg.menu_canvas )
-               );
+               gr_set_current_canvas( bg.menu_canvas );
 
                bg.background = gr_create_sub_bitmap(&nm_background,0,0,w,h);
 
@@ -1024,10 +987,8 @@ RePaintNewmenu4:
                bg.saved = NULL;
                bg.background = gr_create_bitmap( w, h );
                Assert( bg.background != NULL );
-               
-               WIN (DDGRLOCK(dd_grd_curcanv));
-                       gr_bm_bitblt(w, h, 0, 0, 0, 0, &grd_curcanv->cv_bitmap, bg.background );
-               WIN (DDGRUNLOCK(dd_grd_curcanv));
+
+               gr_bm_bitblt(w, h, 0, 0, 0, 0, &grd_curcanv->cv_bitmap, bg.background );
        }
 
 // ty = 15 + (yborder/4);
@@ -1040,9 +1001,7 @@ RePaintNewmenu4:
                gr_get_string_size(title,&string_width,&string_height,&average_width );
                tw = string_width;
                th = string_height;
-               WIN (DDGRLOCK(dd_grd_curcanv));
-                       gr_printf( 0x8000, ty, title );
-               WIN (DDGRUNLOCK(dd_grd_curcanv));
+               gr_printf( 0x8000, ty, title );
                ty += th;
        }
 
@@ -1052,9 +1011,7 @@ RePaintNewmenu4:
                gr_get_string_size(subtitle,&string_width,&string_height,&average_width );
                tw = string_width;
                th = string_height;
-               WIN (DDGRLOCK(dd_grd_curcanv));
-                       gr_printf( 0x8000, ty, subtitle );
-               WIN (DDGRUNLOCK(dd_grd_curcanv));
+               gr_printf( 0x8000, ty, subtitle );
                ty += th;
        }
 
@@ -1135,32 +1092,6 @@ RePaintNewmenu4:
    mprintf ((0,"Set to true!\n"));
 
        while(!done)    {
-       #ifdef WINDOWS
-               MSG msg;
-
-               DoMessageStuff(&msg);
-
-               if (_RedrawScreen) {
-                       _RedrawScreen = FALSE;
-               
-                       if (!filename) {
-                               gr_free_bitmap(bg.saved);
-                               d_free( bg.background );
-                       }
-                       else    
-                               gr_free_bitmap(bg.background);
-
-                       dd_gr_free_sub_canvas( bg.menu_canvas );
-                       grd_curcanv->cv_font = save_font;
-                       dd_grd_curcanv = save_canvas;
-
-                       goto RePaintNewmenu4;
-               }
-
-               DDGRRESTORE;
-
-       #endif
-
 #ifdef NEWMENU_MOUSE
                if (!joydefs_calibrating)
                        newmenu_show_cursor();      // possibly hidden
@@ -1194,10 +1125,8 @@ RePaintNewmenu4:
                        k = -1;
                        done = 1;
                }
-#ifndef WINDOWS
                if (check_button_press())
                        done = 1;
-#endif
 
 //             if ( (nmenus<2) && (k>0) && (nothers==0) )
 //                     done=1;
@@ -1493,7 +1422,6 @@ RePaintNewmenu4:
                }
 
 #ifdef NEWMENU_MOUSE // for mouse selection of menu's etc.
-               WIN(Sleep(100));
                if ( !done && mouse_state && !omouse_state && !all_text ) {
                        mouse_get_pos(&mx, &my);
                        for (i=0; i<nitems; i++ )       {
@@ -1801,8 +1729,7 @@ RePaintNewmenu4:
        
                }
 
-               WINDOS (        dd_gr_set_current_canvas(bg.menu_canvas),
-                               gr_set_current_canvas(bg.menu_canvas));
+               gr_set_current_canvas(bg.menu_canvas);
 
        // Redraw everything...
        for (i=ScrollOffset; i<MaxDisplayable+ScrollOffset; i++ )
@@ -1863,32 +1790,22 @@ RePaintNewmenu4:
 
        // Restore everything...
 
-       WINDOS (        dd_gr_set_current_canvas(bg.menu_canvas),
-                       gr_set_current_canvas(bg.menu_canvas));
+       gr_set_current_canvas(bg.menu_canvas);
 
        if ( filename == NULL ) {
                // Save the background under the menu...
-               WIN (DDGRLOCK(dd_grd_curcanv));
-                       gr_bitmap(0, 0, bg.saved);      
-               WIN (DDGRUNLOCK(dd_grd_curcanv));
+               gr_bitmap(0, 0, bg.saved);      
                gr_free_bitmap(bg.saved);
                d_free( bg.background );
        } else {
                if (!dont_restore)      //info passed back from subfunction
-               {
-                       WIN (DDGRLOCK(dd_grd_curcanv));
                        gr_bitmap(0, 0, bg.background);
-                       WIN (DDGRUNLOCK(dd_grd_curcanv));       
-               }
                gr_free_bitmap(bg.background);
        }
 
-       WINDOS (        dd_gr_free_sub_canvas(bg.menu_canvas),
-                       gr_free_sub_canvas( bg.menu_canvas ) );
+       gr_free_sub_canvas( bg.menu_canvas );
 
-       WINDOS (dd_gr_set_current_canvas(NULL), gr_set_current_canvas( NULL ));                 
        grd_curcanv->cv_font    = save_font;
-       WINDOS (dd_gr_set_current_canvas(NULL), gr_set_current_canvas( save_canvas ));                  
        keyd_repeat = old_keyd_repeat;
 
        game_flush_inputs();
@@ -1905,8 +1822,6 @@ RePaintNewmenu4:
        if ( sound_stopped )
                digi_resume_digi_sounds();
 
-       WIN(mouse_set_mode(1));                         //re-enable centering mode
-
        return choice;
        
 }
@@ -2039,7 +1954,6 @@ int newmenu_get_filename(char *title, char *type, char *filename, int allow_abor
        int show_up_arrow=0, show_down_arrow=0;
 # endif
 #endif
-WIN(int win_redraw=0);
 
        w_x=w_y=w_w=w_h=title_height=0;
        box_x=box_y=box_w=box_h=0;
@@ -2050,8 +1964,6 @@ WIN(int win_redraw=0);
        citem = 0;
        keyd_repeat = 1;
 
-       WIN(mouse_set_mode(0));                         //disable centering mode
-
        if (!stricmp(type, "plr"))
                player_mode = 1;
        else if (!stricmp(type, "dem"))
@@ -2126,19 +2038,9 @@ ReadFileNames:
 //             set_screen_mode(SCREEN_MENU);
                set_popup_screen();
 
-        #ifdef WINDOWS
-RePaintNewmenuFile:
-
-               dd_gr_set_current_canvas(NULL);
-       #else
                gr_set_current_canvas(NULL);
-       #endif
 
-               WIN(DDGRLOCK(dd_grd_curcanv))                                   //mwa put these here -- are these needed Samir???
-               {
-                       grd_curcanv->cv_font = SUBTITLE_FONT;
-               }
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
+               grd_curcanv->cv_font = SUBTITLE_FONT;
 
                w_w = 0;
                w_h = 0;
@@ -2179,39 +2081,23 @@ RePaintNewmenuFile:
 
                bg.saved = NULL;
 
-       #if !defined(WINDOWS)
                if ( (VR_offscreen_buffer->cv_w >= w_w) && (VR_offscreen_buffer->cv_h >= w_h) ) 
                        bg.background = &VR_offscreen_buffer->cv_bitmap;
                else
-       #endif
                        bg.background = gr_create_bitmap( w_w, w_h );
 
                Assert( bg.background != NULL );
 
 
-               WIN(DDGRLOCK(dd_grd_curcanv));
                gr_bm_bitblt(w_w, w_h, 0, 0, w_x, w_y, &grd_curcanv->cv_bitmap, bg.background );
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
 
 #if 0
-               WINDOS(
-                       dd_gr_blt_notrans(dd_grd_curcanv, 0, 0, 
-                               _DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh, 
-                               dd_VR_offscreen_buffer, 0, 0, 
-                               _DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh),
-                       gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(grd_curcanv->cv_bitmap), &(VR_offscreen_buffer->cv_bitmap) )
-               );
+               gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(grd_curcanv->cv_bitmap), &(VR_offscreen_buffer->cv_bitmap) );
 #endif
 
                nm_draw_background( w_x,w_y,w_x+w_w-1,w_y+w_h-1 );
                
-               WIN(DDGRLOCK(dd_grd_curcanv))
-               {       
-                       gr_string( 0x8000, w_y+10, title );
-               }
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
-
-               WIN(DDGRRESTORE);
+               gr_string( 0x8000, w_y+10, title );
         
                initialized = 1;
        }
@@ -2242,24 +2128,6 @@ RePaintNewmenuFile:
 #endif
 
        while(!done)    {
-       #ifdef WINDOWS
-               MSG msg;
-
-               DoMessageStuff(&msg);
-
-               if (_RedrawScreen) {
-                       _RedrawScreen = FALSE;
-
-                       if ( bg.background != &VR_offscreen_buffer->cv_bitmap )
-                               gr_free_bitmap(bg.background);
-       
-                       win_redraw = 1;         
-                       goto RePaintNewmenuFile;
-               }
-
-               DDGRRESTORE
-       #endif
-
                ocitem = citem;
                ofirst_item = first_item;
                gr_update();
@@ -2274,22 +2142,8 @@ RePaintNewmenuFile:
                //see if redbook song needs to be restarted
                songs_check_redbook_repeat();
 
-               #ifdef WINDOWS
-               if (!mouse2_state && omouse2_state)
-                       key = KEY_CTRLED+KEY_D;         //fake ctrl-d
-               else
-               #endif
-                       //NOTE LINK TO ABOVE ELSE
-                       key = key_inkey();
+               key = key_inkey();
 
-       #ifdef WINDOWS
-               if (simukey==-1)
-                       key=KEY_UP;
-               else if (simukey==1)
-                  key=KEY_DOWN;
-               simukey=0;
-       #endif
-                       
                switch(key)     {
                MAC(case KEY_COMMAND+KEY_SHIFTED+KEY_3:)
                case KEY_PRINT_SCREEN:
@@ -2307,17 +2161,11 @@ RePaintNewmenuFile:
 
                        if ( ((player_mode)&&(citem>0)) || ((demo_mode)&&(citem>=0)) )  {
                                int x = 1;
-                               #ifdef WINDOWS
-                               mouse_set_mode(1);                              //re-enable centering mode
-                               #endif
                                newmenu_hide_cursor();
                                if (player_mode)
                                        x = nm_messagebox( NULL, 2, TXT_YES, TXT_NO, "%s %s?", TXT_DELETE_PILOT, &filenames[citem*14]+((player_mode && filenames[citem*14]=='$')?1:0) );
                                else if (demo_mode)
                                        x = nm_messagebox( NULL, 2, TXT_YES, TXT_NO, "%s %s?", TXT_DELETE_DEMO, &filenames[citem*14]+((demo_mode && filenames[citem*14]=='$')?1:0) );
-                               #ifdef WINDOWS
-                               mouse_set_mode(0);                              //disenable centering mode
-                               #endif
                                newmenu_show_cursor();
                                if (x==0)       {
                                        char * p;
@@ -2474,7 +2322,6 @@ RePaintNewmenuFile:
                if (first_item < 0 ) first_item = 0;
 
 #ifdef NEWMENU_MOUSE
-               WIN(Sleep(100));
                if (mouse_state || mouse2_state) {
                        int w, h, aw;
 
@@ -2537,17 +2384,11 @@ RePaintNewmenuFile:
 
 #endif
   
-       WIN(DDGRLOCK(dd_grd_curcanv));
                gr_setcolor( BM_XRGB(2,2,2));
                //gr_rect( box_x - 1, box_y-2, box_x + box_w, box_y-2 );
                gr_setcolor( BM_XRGB( 0,0,0)  );
 
-       #ifdef WINDOWS
-               if (ofirst_item != first_item || win_redraw)    {
-                       win_redraw = 0;
-       #else
                if (ofirst_item != first_item)  {
-       #endif
                        newmenu_hide_cursor();
                        gr_setcolor( BM_XRGB( 0,0,0)  );
                        for (i=first_item; i<first_item+NumFiles_displayed; i++ )       {
@@ -2636,10 +2477,6 @@ RePaintNewmenuFile:
                        }
 
        #endif
-
-
-
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
        }
 
 ExitFileMenuEarly:
@@ -2655,33 +2492,18 @@ ExitFileMenu:
        keyd_repeat = old_keyd_repeat;
 
        if ( initialized )      {
-                       if (Newdemo_state != ND_STATE_PLAYBACK) //horrible hack to prevent restore when screen has been cleared
-                       {
-                       WIN (DDGRLOCK(dd_grd_curcanv));
-                               gr_bm_bitblt(w_w, w_h, w_x, w_y, 0, 0, bg.background, &grd_curcanv->cv_bitmap );
-                       WIN (DDGRUNLOCK(dd_grd_curcanv));       
-                       }
-                       if ( bg.background != &VR_offscreen_buffer->cv_bitmap )
-                               gr_free_bitmap(bg.background);
+               if (Newdemo_state != ND_STATE_PLAYBACK) //horrible hack to prevent restore when screen has been cleared
+                       gr_bm_bitblt(w_w, w_h, w_x, w_y, 0, 0, bg.background, &grd_curcanv->cv_bitmap );
+               if ( bg.background != &VR_offscreen_buffer->cv_bitmap )
+                       gr_free_bitmap(bg.background);
 #if 0
-               WINDOS(
-                       dd_gr_blt_notrans(dd_VR_offscreen_buffer,
-                               0,0,_DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh,
-                               dd_grd_curcanv,
-                               0,0,_DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh),
-                       gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(VR_offscreen_buffer->cv_bitmap), &(grd_curcanv->cv_bitmap) )
-               );
+               gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(VR_offscreen_buffer->cv_bitmap), &(grd_curcanv->cv_bitmap) )
 #endif
-
-               WIN(DDGRRESTORE);
        }
 
        if ( filenames )
                d_free(filenames);
 
-       WIN(mouse_set_mode(1));                         //re-enable centering mode
-       WIN(newmenu_hide_cursor());
-
        return exit_value;
 
 }
@@ -2730,22 +2552,13 @@ int newmenu_listbox1( char * title, int nitems, char * items[], int allow_abort_
    int simukey=0,show_up_arrow=0,show_down_arrow=0;
 # endif
 #endif
-WIN(int win_redraw=0);
 
        keyd_repeat = 1;
 
-       WIN(mouse_set_mode(0));                         //disable centering mode
-
 //     set_screen_mode(SCREEN_MENU);
        set_popup_screen();
 
-#ifdef WINDOWS
-RePaintNewmenuListbox:
-       dd_gr_set_current_canvas(NULL);
-#else
        gr_set_current_canvas(NULL);
-#endif
 
        grd_curcanv->cv_font = SUBTITLE_FONT;
 
@@ -2783,37 +2596,23 @@ RePaintNewmenuListbox:
 
        bg.saved = NULL;
 
-#if !defined(WINDOWS)
        if ( (VR_offscreen_buffer->cv_w >= total_width) && (VR_offscreen_buffer->cv_h >= total_height) )
                bg.background = &VR_offscreen_buffer->cv_bitmap;
        else
-#endif
                //bg.background = gr_create_bitmap( width, (height + title_height) );
                bg.background = gr_create_bitmap(total_width,total_height);
        Assert( bg.background != NULL );
                
-       WIN (DDGRLOCK(dd_grd_curcanv));
-               //gr_bm_bitblt(wx+width+border_size, wy+height+border_size, 0, 0, wx-border_size, wy-title_height-border_size, &grd_curcanv->cv_bitmap, bg.background );
-               gr_bm_bitblt(total_width,total_height, 0, 0, wx-border_size, wy-title_height-border_size, &grd_curcanv->cv_bitmap, bg.background );
-       WIN (DDGRUNLOCK(dd_grd_curcanv));
+       //gr_bm_bitblt(wx+width+border_size, wy+height+border_size, 0, 0, wx-border_size, wy-title_height-border_size, &grd_curcanv->cv_bitmap, bg.background );
+       gr_bm_bitblt(total_width,total_height, 0, 0, wx-border_size, wy-title_height-border_size, &grd_curcanv->cv_bitmap, bg.background );
 
 #if 0
-       WINDOS(
-               dd_gr_blt_notrans(dd_grd_curcanv, 0, 0, 
-                               _DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh, 
-                               dd_VR_offscreen_buffer, 0, 0, 
-                               _DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh),
-               gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(grd_curcanv->cv_bitmap), &(VR_offscreen_buffer->cv_bitmap) )
-       );
+       gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(grd_curcanv->cv_bitmap), &(VR_offscreen_buffer->cv_bitmap) );
 #endif
 
        nm_draw_background( wx-border_size,wy-title_height-border_size,wx+width+border_size-1,wy+height+border_size-1 );
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_string( 0x8000, wy - title_height, title );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));        
-
-       WIN(DDGRRESTORE);
+       gr_string( 0x8000, wy - title_height, title );
 
        done = 0;
        citem = default_item;
@@ -2831,23 +2630,6 @@ RePaintNewmenuListbox:
 #endif
 
        while(!done)    {
-       #ifdef WINDOWS
-               MSG msg;
-
-               DoMessageStuff(&msg);
-
-               if (_RedrawScreen) {
-                       _RedrawScreen = FALSE;
-
-                       if ( bg.background != &VR_offscreen_buffer->cv_bitmap )
-                               gr_free_bitmap(bg.background);
-                       win_redraw = 1;                 
-                       goto RePaintNewmenuListbox;
-               }
-
-               DDGRRESTORE;
-       #endif
-  
                ocitem = citem;
                ofirst_item = first_item;
 #ifdef NEWMENU_MOUSE
@@ -2864,13 +2646,6 @@ RePaintNewmenuListbox:
                else
                        redraw = 0;
 
-       #ifdef WINDOWS
-               if (win_redraw) {
-                       redraw = 1;
-                       win_redraw = 0;
-               }
-       #endif
-
                if ( key<-1 ) {
                        citem = key;
                        key = -1;
@@ -2998,7 +2773,6 @@ RePaintNewmenuListbox:
 
 
 #ifdef NEWMENU_MOUSE
-               WIN(Sleep(100));
                if (mouse_state) {
                        int w, h, aw;
 
@@ -3069,7 +2843,6 @@ RePaintNewmenuListbox:
 
                if ( (ofirst_item != first_item) || redraw)     {
                        newmenu_hide_cursor();
-                       WIN(DDGRLOCK(dd_grd_curcanv));
 
                        gr_setcolor( BM_XRGB( 0,0,0)  );
                        for (i=first_item; i<first_item+LB_ITEMS_ON_SCREEN; i++ )       {
@@ -3114,7 +2887,6 @@ RePaintNewmenuListbox:
                        #endif
 
 
-                       WIN(DDGRUNLOCK(dd_grd_curcanv));
                        newmenu_show_cursor();
                        gr_update();
                } else if ( citem != ocitem )   {
@@ -3122,8 +2894,6 @@ RePaintNewmenuListbox:
 
                        newmenu_hide_cursor();
 
-                       WIN(DDGRLOCK(dd_grd_curcanv));
-
                        i = ocitem;
                        if ( (i>=0) && (i<nitems) )     {
                                y = (i-first_item)*(grd_curfont->ft_h+2)+wy;
@@ -3147,7 +2917,6 @@ RePaintNewmenuListbox:
                                gr_rect( wx, y-1, wx+width-1, y+h );
                                gr_string( wx+5, y, items[i]  );
                        }
-                       WIN(DDGRUNLOCK(dd_grd_curcanv));
 
                        newmenu_show_cursor();
                        gr_update();
@@ -3157,27 +2926,15 @@ RePaintNewmenuListbox:
 
        keyd_repeat = old_keyd_repeat;
 
-       WIN (DDGRLOCK(dd_grd_curcanv));
        gr_bm_bitblt(total_width,total_height, wx-border_size, wy-title_height-border_size, 0, 0, bg.background, &grd_curcanv->cv_bitmap );
-       WIN (DDGRUNLOCK(dd_grd_curcanv));       
 
        if ( bg.background != &VR_offscreen_buffer->cv_bitmap )
                gr_free_bitmap(bg.background);
 
 #if 0
-       WINDOS(
-               dd_gr_blt_notrans(dd_VR_offscreen_buffer,
-                               0,0,_DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh,
-                               dd_grd_curcanv,
-                               0,0,_DDModeList[W95DisplayMode].rw, _DDModeList[W95DisplayMode].rh),
-               gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(VR_offscreen_buffer->cv_bitmap), &(grd_curcanv->cv_bitmap) )
-       );
+       gr_bm_bitblt(grd_curcanv->cv_w, grd_curcanv->cv_h, 0, 0, 0, 0, &(VR_offscreen_buffer->cv_bitmap), &(grd_curcanv->cv_bitmap) );
 #endif
 
-       WIN(DDGRRESTORE);
-
-       WIN(mouse_set_mode(1));                         //re-enable centering mode
-
        return citem;
 }
 
index 2ee6d1e..84afc13 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: object.c,v 1.18 2005-07-30 07:46:03 chris Exp $ */
+/* $Id: object.c,v 1.19 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -22,10 +22,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #include <conf.h>
 #endif
 
-#ifdef WINDOWS
-#include "desw.h"
-#endif
-
 #include <string.h>    // for memset
 #include <stdio.h>
 
@@ -248,17 +244,7 @@ void draw_object_blob(object *obj,bitmap_index bmi)
 
        orientation = global_orientation;
 
-//@@#ifdef WINDOWS
-//@@   if (obj->type == OBJ_POWERUP) {
-//@@           if ( GameBitmaps[(bmi).index].bm_flags & BM_FLAG_PAGED_OUT)
-//@@                   piggy_bitmap_page_in_w( bmi,1 );
-//@@   }
-//@@   if (bm->bm_handle) {
-//@@           DDGRUNLOCK(dd_grd_curcanv);
-//@@   }
-//@@#else
        PIGGY_PAGE_IN( bmi );
-//@@#endif     
 
        if (bm->bm_w > bm->bm_h)
 
@@ -267,12 +253,6 @@ void draw_object_blob(object *obj,bitmap_index bmi)
        else
 
                g3_draw_bitmap(&obj->pos,fixmuldiv(obj->size,bm->bm_w,bm->bm_h),obj->size,bm, orientation);
-
-//@@#ifdef WINDOWS
-//@@   if (bm->bm_handle) {
-//@@           DDGRLOCK(dd_grd_curcanv);
-//@@   }
-//@@#endif
 }
 
 //draw an object that is a texture-mapped rod
index 7a69ce5..9247636 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: paging.c,v 1.4 2004-08-28 23:17:45 schaffner Exp $ */
+/* $Id: paging.c,v 1.5 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -25,11 +25,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 //#define PSX_BUILD_TOOLS
 
 #ifdef RCS
-static char rcsid[] = "$Id: paging.c,v 1.4 2004-08-28 23:17:45 schaffner Exp $";
-#endif
-
-#ifdef WINDOWS
-#include "desw.h"
+static char rcsid[] = "$Id: paging.c,v 1.5 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 #include <stdio.h>
@@ -65,19 +61,6 @@ static char rcsid[] = "$Id: paging.c,v 1.4 2004-08-28 23:17:45 schaffner Exp $";
 #include "mission.h"
 
 
-#ifdef WINDOWS
-void paging_touch_vclip_w( vclip * vc )
-{
-       int i;
-
-       for (i=0; i<vc->num_frames; i++ )       {
-               if ( GameBitmaps[(vc->frames[i]).index].bm_flags & BM_FLAG_PAGED_OUT)
-                       piggy_bitmap_page_in_w( vc->frames[i],1 );
-       }
-}
-#endif
-
-
 void paging_touch_vclip( vclip * vc )
 {
        int i;
@@ -221,11 +204,7 @@ void paging_touch_object( object * obj )
 
                case RT_POWERUP:
                        if ( obj->rtype.vclip_info.vclip_num > -1 ) {
-               //@@    #ifdef WINDOWS
-               //@@            paging_touch_vclip_w(&Vclip[obj->rtype.vclip_info.vclip_num]);
-               //@@    #else
                                paging_touch_vclip(&Vclip[obj->rtype.vclip_info.vclip_num]);
-               //@@    #endif
                        }
                        break;
 
index bd7dd35..ca8265f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: piggy.c,v 1.62 2005-03-06 04:26:37 chris Exp $ */
+/* $Id: piggy.c,v 1.63 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -24,7 +24,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: piggy.c,v 1.62 2005-03-06 04:26:37 chris Exp $";
+static char rcsid[] = "$Id: piggy.c,v 1.63 2005-08-02 06:13:56 chris Exp $";
 #endif
 
 
@@ -1240,11 +1240,9 @@ int piggy_init(void)
        if (piggy_low_memory)
                digi_lomem = 1;
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
                gr_set_curfont( SMALL_FONT );
                gr_set_fontcolor(gr_find_closest_color_current( 20, 20, 20 ),-1 );
                gr_printf( 0x8000, grd_curcanv->cv_h-20, "%s...", TXT_LOADING_DATA );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
 
 #if 1 //def EDITOR //need for d1 mission briefings
        piggy_init_pigfile(DEFAULT_PIGFILE);
@@ -1844,27 +1842,6 @@ int piggy_is_substitutable_bitmap( char * name, char * subst_name )
 
 
 
-#ifdef WINDOWS
-//     New Windows stuff
-
-//     windows bitmap page in
-//             Page in a bitmap, if ddraw, then page it into a ddsurface in 
-//             'video' memory.  if that fails, page it in normally.
-
-void piggy_bitmap_page_in_w( bitmap_index bitmap, int ddraw )
-{
-}
-
-
-//     Essential when switching video modes!
-
-void piggy_bitmap_page_out_all_w()
-{
-}
-
-#endif // WINDOWS
-
-
 /*
  * Functions for loading replacement textures
  *  1) From .pog files
index a99920a..539b0d1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: scores.c,v 1.7 2004-12-01 12:48:13 btb Exp $ */
+/* $Id: scores.c,v 1.8 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -311,7 +311,6 @@ void scores_draw_item( int  i, stats_info * stats )
 
                int y;
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
                y = 7+70+i*9;
 
                if (i==0) y -= 8;
@@ -325,7 +324,6 @@ void scores_draw_item( int  i, stats_info * stats )
 
                if (strlen(stats->name)==0) {
                        gr_printf( LHX(26+33+XX), LHY(y+YY), TXT_EMPTY );
-                       WIN(DDGRUNLOCK(dd_grd_curcanv));
                        return;
                }
                gr_printf( LHX(26+33+XX), LHY(y+YY), "%s", stats->name );
@@ -351,7 +349,6 @@ void scores_draw_item( int  i, stats_info * stats )
                        s = s % 60;
                        scores_rprintf( 311-42+XX, y+YY, "%d:%02d:%02d", h, m, s );
                }
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
 }
 
 void scores_view(int citem)
@@ -366,15 +363,12 @@ ReshowScores:
 
        set_screen_mode(SCREEN_MENU);
  
-       WINDOS( dd_gr_set_current_canvas(NULL),
-                               gr_set_current_canvas(NULL)
-       );
+       gr_set_current_canvas(NULL);
        
        nm_draw_background(0,0,grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h );
 
        grd_curcanv->cv_font = MEDIUM3_FONT;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        gr_string( 0x8000, LHY(15), TXT_HIGH_SCORES );
 
        grd_curcanv->cv_font = SMALL_FONT;
@@ -394,7 +388,6 @@ WIN(DDGRLOCK(dd_grd_curcanv));
        gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
 
        gr_printf( 0x8000, LHY(31), "%c%s%c  - %s", 34, Scores.cool_saying, 34, Scores.stats[0].name );
-WIN(DDGRUNLOCK(dd_grd_curcanv));       
 
        for (i=0; i<MAX_HIGH_SCORES; i++ )              {
                //@@if (i==0)   {
@@ -443,21 +436,6 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
                //see if redbook song needs to be restarted
                songs_check_redbook_repeat();
 
-       #ifdef WINDOWS
-               {
-                       MSG msg;
-
-                       DoMessageStuff(&msg);
-
-                       if (_RedrawScreen) {
-                               _RedrawScreen = FALSE;
-                               goto ReshowScores;
-                       }
-
-                       DDGRRESTORE;
-               }
-       #endif
-
                k = key_inkey();
                switch( k )     {
                case KEY_CTRLED+KEY_R:          
@@ -484,13 +462,7 @@ WIN(DDGRUNLOCK(dd_grd_curcanv));
 // Restore background and exit
        gr_palette_fade_out( gr_palette, 32, 0 );
 
-#ifdef WINDOWS
-       DDGRRESTORE;
-#endif
-
-       WINDOS( dd_gr_set_current_canvas(NULL),
-                               gr_set_current_canvas(NULL)
-       );
+       gr_set_current_canvas(NULL);
 
        game_flush_inputs();
        
index 7ccb13f..6987f95 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.25 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: state.c,v 1.26 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -182,29 +182,17 @@ void state_callback(int nitems,newmenu_item * items, int * last_key, int citem)
                if ( citem > 0 )        {
                        if ( sc_bmp[citem-1] )  {
                                if (MenuHires) {
-                               WINDOS(
-                                       dd_grs_canvas *save_canv = dd_grd_curcanv,
-                                       grs_canvas *save_canv = grd_curcanv
-                               );
+                                       grs_canvas *save_canv = grd_curcanv;
                                        grs_canvas *temp_canv = gr_create_canvas(THUMBNAIL_W*2,(THUMBNAIL_H*24/10));
                                        grs_point vertbuf[3] = {{0,0}, {0,0}, {i2f(THUMBNAIL_W*2),i2f(THUMBNAIL_H*24/10)} };
                                        gr_set_current_canvas(temp_canv);
                                        scale_bitmap(sc_bmp[citem-1], vertbuf, 0 );
-                               WINDOS(
-                                       dd_gr_set_current_canvas(save_canv),
-                                       gr_set_current_canvas( save_canv )
-                               );
-                               WIN(DDGRLOCK(dd_grd_curcanv));
+                                       gr_set_current_canvas( save_canv );
                                        gr_bitmap( (grd_curcanv->cv_bitmap.bm_w-THUMBNAIL_W*2)/2,items[0].y-10, &temp_canv->cv_bitmap);
-                               WIN(DDGRUNLOCK(dd_grd_curcanv));
                                        gr_free_canvas(temp_canv);
                                }
                                else    {
-                               #ifdef WINDOWS
-                                       Int3();
-                               #else
                                        gr_bitmap( (grd_curcanv->cv_bitmap.bm_w-THUMBNAIL_W)/2,items[0].y-5, sc_bmp[citem-1] );
-                               #endif
                                }
                        }
                }
@@ -641,13 +629,8 @@ int state_save_all_sub(char *filename, char *desc, int between_levels)
                ubyte *buf;
                int k;
 #endif
-               #ifdef WINDOWS
-                       dd_grs_canvas *cnv_save;
-                       cnv_save = dd_grd_curcanv;
-               #else
-                       grs_canvas * cnv_save;
-                       cnv_save = grd_curcanv;
-               #endif
+               grs_canvas * cnv_save;
+               cnv_save = grd_curcanv;
 
                gr_set_current_canvas( cnv );
 
@@ -671,15 +654,11 @@ int state_save_all_sub(char *filename, char *desc, int between_levels)
 # endif
 #endif
 
-                                       pal = gr_palette;
+               pal = gr_palette;
 
-                                       PHYSFS_write(fp, cnv->cv_bitmap.bm_data, THUMBNAIL_W * THUMBNAIL_H, 1);
+               PHYSFS_write(fp, cnv->cv_bitmap.bm_data, THUMBNAIL_W * THUMBNAIL_H, 1);
 
-               
-               WINDOS(
-                       dd_gr_set_current_canvas(cnv_save),
-                       gr_set_current_canvas(cnv_save)
-               );
+               gr_set_current_canvas(cnv_save);
                gr_free_canvas( cnv );
                PHYSFS_write(fp, pal, 3, 256);
        }
index 199a7c4..93d9b13 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: titles.c,v 1.37 2005-07-30 01:50:17 chris Exp $ */
+/* $Id: titles.c,v 1.38 2005-08-02 06:13:56 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -111,12 +111,6 @@ int local_key_inkey(void)
 {
        int     rval;
 
-#ifdef WINDOWS
-       MSG msg;
-
-       DoMessageStuff(&msg);
-#endif
-
        rval = key_inkey();
 
        if (rval == KEY_PRINT_SCREEN) {
@@ -199,15 +193,8 @@ int show_title_screen( char * filename, int allow_keys, int from_hog_only )
        gr_palette_clear();
 #endif
 
-       WINDOS(
-               dd_gr_set_current_canvas(NULL),
-               gr_set_current_canvas( NULL )
-       );
-       WIN(DDGRLOCK(dd_grd_curcanv));
+       gr_set_current_canvas( NULL );
        show_fullscr(&title_bm);
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
-
-       WIN(DDGRRESTORE);
 
        if (gr_palette_fade_in( New_pal, 32, allow_keys ))
                return 1;
@@ -336,11 +323,7 @@ sbyte   Door_dir=1, Door_div_count=0, Animating_bitmap_type=0;
 //-----------------------------------------------------------------------------
 void show_bitmap_frame(void)
 {
-#ifdef WINDOWS
-       dd_grs_canvas *curcanv_save, *bitmap_canv=0;
-#else
        grs_canvas *curcanv_save, *bitmap_canv=0;
-#endif
 
        grs_bitmap *bitmap_ptr;
 
@@ -366,25 +349,19 @@ void show_bitmap_frame(void)
                }
 
                switch (Animating_bitmap_type) {
-               case 0: WINDOS(
-                               bitmap_canv = dd_gr_create_sub_canvas(dd_grd_curcanv, rescale_x(220), rescale_x(45), 64, 64);   break,
-                               bitmap_canv = gr_create_sub_canvas(grd_curcanv, rescale_x(220), rescale_x(45), 64, 64); break
-                       );
+               case 0:
+                       bitmap_canv = gr_create_sub_canvas(grd_curcanv, rescale_x(220), rescale_x(45), 64, 64);
+                       break;
                case 1:
-                       WINDOS(
-                               bitmap_canv = dd_gr_create_sub_canvas(dd_grd_curcanv, rescale_x(220), rescale_x(45), 94, 94);   break,
-                               bitmap_canv = gr_create_sub_canvas(grd_curcanv, rescale_x(220), rescale_x(45), 94, 94); break
-                       );
+                       bitmap_canv = gr_create_sub_canvas(grd_curcanv, rescale_x(220), rescale_x(45), 94, 94);
+                       break;
 
                        // Adam: Change here for your new animating bitmap thing. 94, 94 are bitmap size.
                        default:
                                Int3(); // Impossible, illegal value for Animating_bitmap_type
                }
 
-               WINDOS(
-                       curcanv_save = dd_grd_curcanv; dd_grd_curcanv = bitmap_canv,
-                       curcanv_save = grd_curcanv; grd_curcanv = bitmap_canv
-               );
+               curcanv_save = grd_curcanv; grd_curcanv = bitmap_canv;
 
                pound_signp = strchr(Bitmap_name, '#');
                Assert(pound_signp != NULL);
@@ -431,14 +408,9 @@ void show_bitmap_frame(void)
                        PIGGY_PAGE_IN( bi );
                }
 
-               WIN(DDGRLOCK(dd_grd_curcanv));
                gr_bitmapm(0, 0, bitmap_ptr);
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
 
-               WINDOS(
-                       dd_grd_curcanv = curcanv_save,
-                       grd_curcanv = curcanv_save
-               );
+               grd_curcanv = curcanv_save;
                d_free(bitmap_canv);
 
                switch (Animating_bitmap_type) {
@@ -461,17 +433,6 @@ void show_bitmap_frame(void)
 //-----------------------------------------------------------------------------
 void show_briefing_bitmap(grs_bitmap *bmp)
 {
-#ifdef WINDOWS
-       dd_grs_canvas *bitmap_canv, *curcanv_save;
-
-       bitmap_canv = dd_gr_create_sub_canvas(dd_grd_curcanv, 220, 45, bmp->bm_w, bmp->bm_h);
-       curcanv_save = dd_grd_curcanv;
-       dd_gr_set_current_canvas(bitmap_canv);
-       DDGRLOCK(dd_grd_curcanv);
-       gr_bitmapm(0,0,bmp);
-       DDGRUNLOCK(dd_grd_curcanv);
-       dd_gr_set_current_canvas(curcanv_save);
-#else
        grs_canvas      *curcanv_save, *bitmap_canv;
 
        bitmap_canv = gr_create_sub_canvas(grd_curcanv, 220, 45, bmp->bm_w, bmp->bm_h);
@@ -479,12 +440,10 @@ void show_briefing_bitmap(grs_bitmap *bmp)
        gr_set_current_canvas(bitmap_canv);
        gr_bitmapm(0, 0, bmp);
        gr_set_current_canvas(curcanv_save);
-#endif
 
        d_free(bitmap_canv);
 }
 
-#ifndef WINDOWS
 //-----------------------------------------------------------------------------
 void show_spinning_robot_frame(int robot_num)
 {
@@ -517,7 +476,6 @@ void init_spinning_robot(void) //(int x,int y,int w,int h)
        Robot_canv = gr_create_sub_canvas(grd_curcanv, x, y, w, h);
        // 138, 55, 166, 138
 }
-#endif
 
 //---------------------------------------------------------------------------
 // Returns char width.
@@ -540,10 +498,8 @@ int show_char_delay(char the_char, int delay, int robot_num, int cursor_flag)
 
        //      Draw cursor if there is some delay and caller says to draw cursor
        if (cursor_flag && delay) {
-               WIN(DDGRLOCK(dd_grd_curcanv));
                gr_set_fontcolor(Briefing_foreground_colors[Current_color], -1);
                gr_printf(Briefing_text_x+1, Briefing_text_y, "_" );
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
                gr_update();
        }
 
@@ -565,7 +521,6 @@ int show_char_delay(char the_char, int delay, int robot_num, int cursor_flag)
 
        start_time = timer_get_fixed_seconds();
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
        //      Erase cursor
        if (cursor_flag && delay) {
                gr_set_fontcolor(Erase_color, -1);
@@ -578,7 +533,6 @@ int show_char_delay(char the_char, int delay, int robot_num, int cursor_flag)
 
        gr_set_fontcolor(Briefing_foreground_colors[Current_color], -1);
        gr_printf(Briefing_text_x+1, Briefing_text_y, message );
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
 
        if (delay) gr_update();
 
@@ -600,16 +554,11 @@ int load_briefing_screen( int screen_num )
        else
                fname = CurBriefScreenName;
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
        if ((pcx_error = pcx_read_fullscr(fname, New_pal)) != PCX_ERROR_NONE) {
                printf( "File '%s', PCX load error: %s\n  (It's a briefing screen.  Does this cause you pain?)\n", fname, pcx_errormsg(pcx_error));
                printf( "File '%s', PCX load error: %s (%i)\n  (It's a briefing screen.  Does this cause you pain?)\n", fname, pcx_errormsg(pcx_error), pcx_error);
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
                Error( "Error loading briefing screen <%s>, PCX load error: %s (%i)\n", fname, pcx_errormsg(pcx_error), pcx_error);
        }
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
-
-       WIN(DDGRRESTORE);
 
        return 0;
 }
@@ -621,21 +570,14 @@ int load_new_briefing_screen( char *fname )
        mprintf ((0,"Loading new briefing <%s>\n",fname));
        strcpy (CurBriefScreenName,fname);
 
-       //WIN(DEFINE_SCREEN(CurBriefScreenName));
-
        if (gr_palette_fade_out( New_pal, 32, 0 ))
                return 0;
 
-       WIN(DDGRLOCK(dd_grd_curcanv));
        if ((pcx_error=pcx_read_fullscr( fname, New_pal ))!=PCX_ERROR_NONE)     {
        //if ((pcx_error=pcx_read_bitmap( fname, &grd_curcanv->cv_bitmap, grd_curcanv->cv_bitmap.bm_type, New_pal ))!=PCX_ERROR_NONE)     {
                printf( "File '%s', PCX load error: %s (%i)\n  (It's a briefing screen.  Does this cause you pain?)\n",fname, pcx_errormsg(pcx_error), pcx_error);
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
                Error( "Error loading briefing screen <%s>, PCX load error: %s (%i)\n",fname, pcx_errormsg(pcx_error), pcx_error);
        }
-       WIN(DDGRUNLOCK(dd_grd_curcanv));
-
-       WIN(DDGRRESTORE);
 
        gr_copy_palette(gr_palette, New_pal, sizeof(gr_palette));
 
@@ -694,14 +636,12 @@ void flash_cursor(int cursor_flag)
        if (cursor_flag == 0)
                return;
 
-WIN(DDGRLOCK(dd_grd_curcanv));
        if ((timer_get_fixed_seconds() % (F1_0/2) ) > (F1_0/4))
                gr_set_fontcolor(Briefing_foreground_colors[Current_color], -1);
        else
                gr_set_fontcolor(Erase_color, -1);
 
        gr_printf(Briefing_text_x+1, Briefing_text_y, "_" );
-WIN(DDGRUNLOCK(dd_grd_curcanv));
        gr_update();
 }
 
@@ -728,7 +668,6 @@ int show_briefing_message(int screen_num, char *message)
        char chattering=0;
        int hum_channel=-1,printing_channel=-1;
        int LineAdjustment=1;
-       WIN(int wpage_done=0);
 
        Bitmap_name[0] = 0;
        Current_color = 0;
@@ -927,25 +866,10 @@ int show_briefing_message(int screen_num, char *message)
                                        digi_stop_sound( printing_channel );
                                printing_channel=-1;
 
-#ifdef WINDOWS
-                               if (!wpage_done) {
-                                       DDGRRESTORE;
-                                       wpage_done =1;
-                               }
-#endif
-
                                gr_update();
 
                                start_time = timer_get_fixed_seconds();
                                while ( (keypress = local_key_inkey()) == 0 ) {         //      Wait for a key
-#ifdef WINDOWS
-                                       if (_RedrawScreen) {
-                                               _RedrawScreen = FALSE;
-                                               hum_channel  = digi_start_sound( digi_xlat_sound(SOUND_BRIEFING_HUM), F1_0/2, 0xFFFF/2, 1, -1, -1, -1 );
-                                               keypress = KEY_ESC;
-                                               break;
-                                       }
-#endif
 
                                        while (timer_get_fixed_seconds() < start_time + KEY_DELAY_DEFAULT/2)
                                                ;
@@ -970,7 +894,6 @@ int show_briefing_message(int screen_num, char *message)
 
                                flashing_cursor = 0;
                                done = 1;
-                               WIN(wpage_done = 0);
                        } else if (ch == 'P') {         //      New page.
                                if (!GotZ) {
                                        Int3(); // Hey ryan!!!! You gotta load a screen before you start
@@ -1028,8 +951,6 @@ int show_briefing_message(int screen_num, char *message)
                                chattering=1;
                        }
 
-                       WIN(if (GRMODEINFO(emul)) delay_count = 0);
-
                        Briefing_text_x += show_char_delay(ch, delay_count, robot_num, flashing_cursor);
 
                }
@@ -1078,24 +999,8 @@ int show_briefing_message(int screen_num, char *message)
 
                        chattering=0;
 
-#ifdef WINDOWS
-                       if (!wpage_done) {
-                               DDGRRESTORE;
-                               wpage_done =1;
-                       }
-#endif
-
                        start_time = timer_get_fixed_seconds();
                        while ( (keypress = local_key_inkey()) == 0 ) {         //      Wait for a key
-#ifdef WINDOWS
-                               if (_RedrawScreen) {
-                                       _RedrawScreen = FALSE;
-                                       hum_channel  = digi_start_sound( digi_xlat_sound(SOUND_BRIEFING_HUM), F1_0/2, 0xFFFF/2, 1, -1, -1, -1 );
-                                       keypress = KEY_ESC;
-                                       break;
-                               }
-#endif
-
                                while (timer_get_fixed_seconds() < start_time + KEY_DELAY_DEFAULT/2)
                                        ;
                                flash_cursor(flashing_cursor);
@@ -1126,8 +1031,6 @@ int show_briefing_message(int screen_num, char *message)
                        Briefing_text_x = bsp->text_ulx;
                        Briefing_text_y = bsp->text_uly;
                        delay_count = KEY_DELAY_DEFAULT;
-
-                       WIN(wpage_done = 0);
                }
        }
 
@@ -1362,17 +1265,8 @@ int show_briefing_screen( int screen_num, int allow_keys)
        #endif
 
 
-#ifndef WINDOWS
        if (gr_palette_fade_out( New_pal, 32, allow_keys ))
                return 1;
-#else
-               DEFINE_SCREEN(NULL);
-               WIN(DDGRLOCK(dd_grd_curcanv));
-               gr_clear_canvas (0);
-               WIN(DDGRUNLOCK(dd_grd_curcanv));
-               if (gr_palette_fade_out( New_pal, 32, allow_keys ))
-                       return 1;
-#endif
 
        //gr_copy_palette(gr_palette, palette_save, sizeof(palette_save));
 
@@ -1414,10 +1308,7 @@ void do_briefing_screens(char *filename,int level_num)
 
        set_screen_mode( SCREEN_MENU );
 
-       WINDOS(
-               dd_gr_set_current_canvas(NULL),
-               gr_set_current_canvas(NULL)
-       );
+       gr_set_current_canvas(NULL);
 
        mprintf ((0,"Playing briefing screen <%s>, level %d\n",filename,level_num));