aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-09-23 16:13:13 +0000
committerTorbjörn Andersson2003-09-23 16:13:13 +0000
commitbef1facdbc73741ef34e88fe7d496944a6119391 (patch)
tree5f740e4d97e05a448203a386a06f7f955ee95f4c
parentf2f5f9a9af93b19692fe57c5f6230c6ce336ba84 (diff)
downloadscummvm-rg350-bef1facdbc73741ef34e88fe7d496944a6119391.tar.gz
scummvm-rg350-bef1facdbc73741ef34e88fe7d496944a6119391.tar.bz2
scummvm-rg350-bef1facdbc73741ef34e88fe7d496944a6119391.zip
Removed the screenshot code. (The SDL backend already has the ability to
make screenshots.) svn-id: r10382
-rw-r--r--sword2/driver/d_draw.cpp183
-rw-r--r--sword2/driver/driver96.h1
-rw-r--r--sword2/driver/rdwin.cpp5
-rw-r--r--sword2/sword2.cpp6
4 files changed, 4 insertions, 191 deletions
diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp
index a893c5ef7f..a56e764114 100644
--- a/sword2/driver/d_draw.cpp
+++ b/sword2/driver/d_draw.cpp
@@ -169,189 +169,6 @@ int32 EraseBackBuffer( void ) {
}
-
-
-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);
diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h
index a0281534e2..315d0d8fd3 100644
--- a/sword2/driver/driver96.h
+++ b/sword2/driver/driver96.h
@@ -1323,7 +1323,6 @@ extern void ClearShadowFx(void);
extern void SetShadowFx(void);
extern int32 GetRenderType(void);
extern int32 PlaySmacker(char *filename, _movieTextObject *textObjects[], uint8 *musicOut);
-extern int32 GrabScreenShot(void);
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp
index e29d10d355..55f87608d6 100644
--- a/sword2/driver/rdwin.cpp
+++ b/sword2/driver/rdwin.cpp
@@ -149,12 +149,7 @@ void Sword2State::parseEvents() {
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:
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index bdfbc89961..e18193fe9e 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -342,8 +342,10 @@ void Sword2State::go() {
ServiceWindows();
#ifdef _SWORD2_DEBUG
- if (grabbingSequences && !console_status)
- GrabScreenShot();
+// FIXME: If we want this, we should re-work it to use the backend's
+// screenshot functionality.
+// if (grabbingSequences && !console_status)
+// GrabScreenShot();
#endif
// if we are closing down the game, break out of main game loop