shithub: choc

Download patch

ref: 1a9dc27f4ef6b43316cb263ad15c36f3dde35338
parent: e2e163c6e3fc1db2df6da1d4ed831fe6629e180b
author: Simon Howard <[email protected]>
date: Sat Sep 20 16:41:26 EDT 2008

Replace all use of screens[0] by I_VideoBuffer.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1249

--- a/src/doom/am_map.c
+++ b/src/doom/am_map.c
@@ -288,10 +288,7 @@
 static boolean stopped = true;
 
 extern boolean viewactive;
-//extern byte screens[][SCREENWIDTH*SCREENHEIGHT];
 
-
-
 void
 V_MarkRect
 ( int	x,
@@ -459,7 +456,7 @@
     static event_t st_notify = { ev_keyup, AM_MSGENTERED, 0, 0 };
 
     automapactive = true;
-    fb = screens[0];
+    fb = I_VideoBuffer;
 
     f_oldloc.x = INT_MAX;
     amclock = 0;
--- a/src/doom/f_finale.c
+++ b/src/doom/f_finale.c
@@ -246,7 +246,7 @@
     
     // erase the entire screen to a tiled background
     src = W_CacheLumpName ( finaleflat , PU_CACHE);
-    dest = screens[0];
+    dest = I_VideoBuffer;
 	
     for (y=0 ; y<SCREENHEIGHT ; y++)
     {
@@ -592,7 +592,7 @@
     int		count;
 	
     column = (column_t *)((byte *)patch + LONG(patch->columnofs[col]));
-    desttop = screens[0]+x;
+    desttop = I_VideoBuffer + x;
 
     // step through the posts in a column
     while (column->topdelta != 0xff )
--- a/src/doom/f_wipe.c
+++ b/src/doom/f_wipe.c
@@ -283,7 +283,7 @@
     {
 	go = 1;
 	// wipe_scr = (byte *) Z_Malloc(width*height, PU_STATIC, 0); // DEBUG
-	wipe_scr = screens[0];
+	wipe_scr = I_VideoBuffer;
 	(*wipes[wipeno*3])(width, height, ticks);
     }
 
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -305,7 +305,7 @@
             color = COLOR_BLACK;
         }
 
-        screens[0][(box_y - 4) * SCREENWIDTH + box_x + x + 1] = color;
+        I_VideoBuffer[(box_y - 4) * SCREENWIDTH + box_x + x + 1] = color;
     }
 
     // Draw red line
@@ -312,7 +312,7 @@
 
     for (y=box_y - 8; y<box_y; ++y)
     {
-        screens[0][y * SCREENWIDTH + box_x + redline_x] = COLOR_RED;
+        I_VideoBuffer[y * SCREENWIDTH + box_x + redline_x] = COLOR_RED;
     }
 }
  
--- a/src/doom/r_draw.c
+++ b/src/doom/r_draw.c
@@ -791,7 +791,7 @@
 
     // Preclaculate all row offsets.
     for (i=0 ; i<height ; i++) 
-	ylookup[i] = screens[0] + (i+viewwindowy)*SCREENWIDTH; 
+	ylookup[i] = I_VideoBuffer + (i+viewwindowy)*SCREENWIDTH; 
 } 
  
  
@@ -900,7 +900,7 @@
   //  is not optiomal, e.g. byte by byte on
   //  a 32bit CPU, as GNU GCC/Linux libc did
   //  at one point.
-    memcpy (screens[0]+ofs, screens[1]+ofs, count); 
+    memcpy(I_VideoBuffer + ofs, screens[1] + ofs, count); 
 } 
 
 
--- a/src/doom/wi_stuff.c
+++ b/src/doom/wi_stuff.c
@@ -410,7 +410,7 @@
 
 void WI_slamBackground(void)
 {
-    memcpy(screens[0], screens[1], SCREENWIDTH * SCREENHEIGHT);
+    memcpy(I_VideoBuffer, screens[1], SCREENWIDTH * SCREENHEIGHT);
     V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
 }
 
--- a/src/i_scale.c
+++ b/src/i_scale.c
@@ -38,7 +38,7 @@
 #define inline __inline
 #endif
 
-// Should be screens[0]
+// Should be I_VideoBuffer
 
 static byte *src_buffer;
 
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1617,7 +1617,6 @@
                                                     PU_STATIC, NULL);
     }
 
-    screens[0] = I_VideoBuffer;
     V_RestoreBuffer();
 
     // "Loading from disk" icon
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -47,12 +47,10 @@
 static byte *dest_screen = NULL;
 
 // Each screen is [SCREENWIDTH*SCREENHEIGHT]; 
-byte*				screens[5];	
+byte *screens[5];	
  
-int				dirtybox[4]; 
+int dirtybox[4]; 
 
-
-
 // Now where did these came from?
 const byte gammatable[5][256] =
 {
@@ -366,7 +364,7 @@
 
     for (i=0 ; i<4 ; i++)
     {
-	screens[i + 1] = base + i*SCREENWIDTH*SCREENHEIGHT;
+        screens[i + 1] = base + i*SCREENWIDTH*SCREENHEIGHT;
     }
 }
 
@@ -478,30 +476,31 @@
 
 void V_ScreenShot (void)
 {
-    int		i;
-    byte*	linear;
-    char	lbmname[12];
+    int i;
+    char lbmname[12];
     
-    // munge planar buffer to linear
-    linear = screens[2];
-    I_ReadScreen (linear);
-    
     // find a file name to save it to
-    strcpy(lbmname,"DOOM00.pcx");
-		
+
+    strcpy(lbmname, "DOOM00.pcx");
+
     for (i=0 ; i<=99 ; i++)
     {
-	lbmname[4] = i/10 + '0';
-	lbmname[5] = i%10 + '0';
-	if (!M_FileExists(lbmname))
-	    break;	// file doesn't exist
+        lbmname[4] = i / 10 + '0';
+        lbmname[5] = i % 10 + '0';
+        if (!M_FileExists(lbmname))
+        {
+            break;      // file doesn't exist
+        }
     }
-    if (i==100)
-	I_Error ("V_ScreenShot: Couldn't create a PCX");
-    
+
+    if (i == 100)
+    {
+        I_Error ("V_ScreenShot: Couldn't create a PCX");
+    }
+
     // save the pcx file
-    WritePCXfile (lbmname, linear,
-		  SCREENWIDTH, SCREENHEIGHT,
-		  W_CacheLumpName (DEH_String("PLAYPAL"), PU_CACHE));
+    WritePCXfile(lbmname, I_VideoBuffer,
+                 SCREENWIDTH, SCREENHEIGHT,
+                 W_CacheLumpName (DEH_String("PLAYPAL"), PU_CACHE));
 }