diff options
author | Torbjörn Andersson | 2003-09-23 16:13:13 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-09-23 16:13:13 +0000 |
commit | bef1facdbc73741ef34e88fe7d496944a6119391 (patch) | |
tree | 5f740e4d97e05a448203a386a06f7f955ee95f4c /sword2/driver/d_draw.cpp | |
parent | f2f5f9a9af93b19692fe57c5f6230c6ce336ba84 (diff) | |
download | scummvm-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
Diffstat (limited to 'sword2/driver/d_draw.cpp')
-rw-r--r-- | sword2/driver/d_draw.cpp | 183 |
1 files changed, 0 insertions, 183 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); |