[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.24,1.25 driver96.h,1.40,1.41 rdwin.cpp,1.22,1.23

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Tue Sep 23 09:15:09 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv15468/driver

Modified Files:
	d_draw.cpp driver96.h rdwin.cpp 
Log Message:
Removed the screenshot code. (The SDL backend already has the ability to
make screenshots.)


Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_draw.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- d_draw.cpp	23 Sep 2003 15:59:52 -0000	1.24
+++ d_draw.cpp	23 Sep 2003 16:13:13 -0000	1.25
@@ -169,189 +169,6 @@
 }
 
 
-
-
-int32 SaveScreenShot(uint8 *buffer, uint8 *palette)
-{
-
-	static uint16 pcxCount = 0;
-  int virtualWidth;
-  int pix;
-  int keyPix;
-  int line;
-  int i;
-  int runLength;
-  char filename[80];
-  unsigned char ch;
-  unsigned char *pcxData;
-  unsigned char pal[256*3];
-  FILE *fp;
-  _pcxHeader pcxHead;
-
-  sprintf(filename, "snap%.4d.pcx", pcxCount);
-
-  fp = fopen(filename, "wb");
-  if (fp == NULL)
-  {
-    sprintf(filename, "c:\\snap%.4d.pcx", pcxCount);
-    fp = fopen(filename, "wb");
-    if (fp == NULL)
-    {
-      return(0);
-    }
-  }
-  pcxCount += 1;
-
-  // Set up and write the header
-  pcxHead.manufacturer = 0x0a;
-  pcxHead.version = 5;
-  pcxHead.encoding = 1;
-  pcxHead.bitsPerPixel = 8;
-  pcxHead.xmin = 0;
-  pcxHead.ymin = 0;
-  pcxHead.xmax = 639;
-  pcxHead.ymax = 479;
-  pcxHead.hres = 72;
-  pcxHead.vres = 72;
-  pcxHead.reserved = 0;
-  pcxHead.colourPlanes = 1;
-  pcxHead.bytesPerLine = 640;
-  pcxHead.paletteType = 1;
-  fwrite(&pcxHead , sizeof(pcxHead), 1, fp);
-
-  // The simplest job is to write out the entire file as a series of single units
-
-  virtualWidth = 640;
-//  char *pcxDataBase = buffer;           //GetBitMap() + (GetHeight()-1)* virtualWidth ;
-  for (line = 0 ; line < 480; line++)
-  {       
-          pcxData = (unsigned char *)buffer;   //pcxDataBase;
-
-          // Look to compress this line of 'width' pixels
-          pix = 0;
-          while (pix < 640)
-          {       // Look for some run length coding
-                  keyPix = pcxData[pix++];
-                  runLength = 1;
-                  while ( (pix < 640) && (keyPix == pcxData[pix]) )
-                  {       runLength++;
-                          pix++;
-                  }
-                  while (runLength > 1)
-                  {       // We have a run length bit. Runs are a maximum of 0x3f
-                          int lRun = runLength > 0x3f ? 0x3f : runLength;
-                          runLength -= lRun;
-                          lRun |= 0xc0;
-                          ch = (unsigned char) lRun;
-                          fwrite(&ch, 1, 1, fp);
-                          ch = (unsigned char) keyPix;
-                          fwrite(&ch, 1, 1, fp);
-//                          fFile.WriteChar(lRun);
-//                          fFile.WriteChar(keyPix);
-                  }
-                  if (runLength)
-                  {       // Single pixel. If its <= 0x3f it goes straight in, otherwise it is a single run length
-                          if (keyPix < 0xc0)
-                          {
-                                  ch = (unsigned char) keyPix;
-                                  fwrite(&ch, 1, 1, fp);
-//                                  fFile.WriteChar(keyPix);
-                          }
-                          else
-                          {
-                             ch = 0xc1;
-                             fwrite(&ch, 1, 1, fp);
-                             ch = (unsigned char) keyPix;
-                             fwrite(&ch, 1, 1, fp);
-//                                  fFile.WriteChar(0xc1);
-//                                  fFile.WriteChar(keyPix);
-                          }
-                  }
-          }
-//          pcxDataBase -= virtualWidth;
-          buffer += virtualWidth;
-  }
-
-  // Convert and write out the palette
-//  StringClass sPal(768);
-//  unsigned char *pal = palette;
-//  for (int count = 0 ; count < 256 ; count++)
-//  {       *(pal++) = bmi.bmiColors[count].rgbRed;
-//          *(pal++) = bmi.bmiColors[count].rgbGreen;
-//          *(pal++) = bmi.bmiColors[count].rgbBlue;
-//  }
-  ch = 0x0c;
-  fwrite(&ch, 1, 1, fp);
-
-  for (i=0; i<256*3; i++)
-  {
-    pal[i] = *((unsigned char *) palette + i);
-  }
-
-//  fFile.WriteChar(0x0c);
-  fwrite(pal, 256*3, 1, fp);
-//  if (fFile.Write(sPal , 768)!=768)
-//          return(-1);
-  fclose(fp);
-
-  return(1);
-
-}
-
-int32 GrabScreenShot(void) {
-	warning("stub GrabScreenShot");
-/*
-	uint8			*screenGrabBuffer;
-	uint8			*palette;
-	DDSURFACEDESC	ddsd;
-	HRESULT			hr;
-	int32			i;
-
-
-	screenGrabBuffer = (uint8 *) malloc(screenWide * screenDeep);
-	if (screenGrabBuffer == NULL)
-		return(RDERR_OUTOFMEMORY);
-
-	ddsd.dwSize = sizeof(DDSURFACEDESC);
-	hr = IDirectDrawSurface2_Lock(lpPrimarySurface, NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL);
-	if (hr != DD_OK)
-	{
-		free(screenGrabBuffer);
-		return(RDERR_LOCKFAILED);
-	}
-	
-	for (i=0; i<screenDeep; i++)
-	{
-		memcpy(screenGrabBuffer + i * screenWide, (uint8 *) ddsd.lpSurface + ddsd.lPitch * i, screenWide);
-	}
-	IDirectDrawSurface2_Unlock(lpPrimarySurface, ddsd.lpSurface);
-
-
-	palette = (uint8 *) malloc(256 * 3);
-	if (palette == NULL)
-	{
-		free(screenGrabBuffer);
-		return(RDERR_OUTOFMEMORY);
-	}
-
-	for (i=0; i<256; i++)
-	{
-		palette[i*3] = palCopy[i][0];
-		palette[i*3+1] = palCopy[i][1];
-		palette[i*3+2] = palCopy[i][2];
-	}
-
-	hr = SaveScreenShot(screenGrabBuffer,palette);
-
-
-	free(palette);
-	free(screenGrabBuffer);
-*/
-	return(RD_OK);
-}
-
-
-
 int32 NextSmackerFrame(void) {
 	warning("stub NextSmackerFrame");
 	return(RD_OK);

Index: driver96.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/driver96.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- driver96.h	23 Sep 2003 15:59:52 -0000	1.40
+++ driver96.h	23 Sep 2003 16:13:13 -0000	1.41
@@ -1323,7 +1323,6 @@
 extern void SetShadowFx(void);
 extern int32 GetRenderType(void);
 extern int32 PlaySmacker(char *filename, _movieTextObject *textObjects[], uint8 *musicOut);
-extern int32 GrabScreenShot(void);
 //-----------------------------------------------------------------------------
 
 //-----------------------------------------------------------------------------

Index: rdwin.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/rdwin.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- rdwin.cpp	23 Sep 2003 15:59:52 -0000	1.22
+++ rdwin.cpp	23 Sep 2003 16:13:13 -0000	1.23
@@ -149,12 +149,7 @@
 	
 	while (_system->poll_event(&event)) {
 		switch(event.event_code) {
-		
 		case OSystem::EVENT_KEYDOWN:
-			if (event.kbd.flags==OSystem::KBD_CTRL) {
-				if (event.kbd.keycode == 'w')
-					GrabScreenShot();
-			}
 			WriteKey(event.kbd.ascii, event.kbd.keycode, event.kbd.flags);
 			break;
 		case OSystem::EVENT_MOUSEMOVE:





More information about the Scummvm-git-logs mailing list