SpinOff D3D Modifications

I use two modifications to the D3D driver. The first one was published by N'lightning software, and fixes an ATI Rage Pro bug to show sheets with transparency correct. The second one is by Orf: he implemented screenshot functionallity to D3D.
Change pcache.c line 1208 as following:
AppInfo.lpD3DDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP,D3DTOP_SELECTARG2 );
//AppInfo.lpD3DDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP,D3DTOP_MODULATE );
So it seems, the eclipse team had the right solution in their hands....


Screenshot functionality: Change this in d3ddrv.cpp, line 259;
BOOL DRIVERCC ScreenShot(const char *Name)
{
	return FALSE;
  	DDSURFACEDESC2 ddsd;
	BITMAPFILEHEADER bfh;
	BITMAPINFOHEADER bih;
	HRESULT result;
	HDC surfDC = NULL;
	HDC memDC = NULL;
	HBITMAP bitmap = NULL;
	HBITMAP oldbit = NULL;
	FILE *file = NULL;
	void *data= NULL;
	int width, height, bpp;
	int datasize;
	BOOL success = FALSE;
	
	memset(&ddsd,0,sizeof(ddsd));
	ddsd.dwSize = sizeof(ddsd);
	result = AppInfo.lpBackBuffer->GetSurfaceDesc(&ddsd);
	if(FAILED(result))
	  goto cleanup;
	
	width = ddsd.dwWidth;
	height= ddsd.dwHeight;
	bpp = ddsd.ddpfPixelFormat.dwRGBBitCount / 8;
	
	if(bpp < 2)
	  bpp = 2;
	if(bpp > 3)
	  bpp = 3;
	
	datasize = width * bpp * height;
	if(width * bpp % 4)
		datasize += height * (4 - width * bpp % 4);
			
	memset((void*)&bfh, 0, sizeof(bfh));
	bfh.bfType = 'B'+('M'<<8);
	bfh.bfSize = sizeof(bfh) + sizeof(bih) + datasize;
	bfh.bfOffBits = sizeof(bfh) + sizeof(bih);
	memset((void*)&bih, 0, sizeof(bih));
	bih.biSize = sizeof(bih);
	bih.biWidth = ddsd.dwWidth;
	bih.biHeight = ddsd.dwHeight;
	bih.biPlanes = 1;
	bih.biBitCount = bpp * 8;
	bih.biCompression = BI_RGB;
	result = AppInfo.lpBackBuffer->GetDC(&surfDC);
	
	if(FAILED(result))
	  goto cleanup;
		
	bitmap = CreateDIBSection(NULL, (BITMAPINFO *)&bih, DIB_RGB_COLORS, 
				&data, NULL, 0);
				
	if(!bitmap)
	  goto cleanup;
	if(!data)
	  goto cleanup;
		
	memDC = CreateCompatibleDC(surfDC);
	if(!memDC)
	  goto cleanup;
		
	oldbit = (HBITMAP)SelectObject(memDC, bitmap);
	if(!oldbit || FAILED(oldbit))
	  goto cleanup;
		
	result = BitBlt(memDC, 0, 0, width, height, surfDC, 0, 0, SRCCOPY);
	if(!result)
	  goto cleanup;
		
	AppInfo.lpBackBuffer->ReleaseDC(surfDC);
	surfDC = NULL;
	
	file = fopen(Name, "wb");
	
	if(!file)
	  goto cleanup;
		
	fwrite((void*)&bfh, sizeof(bfh), 1, file);
	fwrite((void*)&bih, sizeof(bih), 1, file);
	fwrite((void*)data, 1, datasize, file);
	success = TRUE;

cleanup:
	if(oldbit && !FAILED(oldbit))
	  SelectObject(memDC, oldbit);
	if(memDC)
	  DeleteDC(memDC);
	if(surfDC)
	  AppInfo.lpBackBuffer->ReleaseDC(surfDC);
	if(bitmap)
	  DeleteObject(bitmap);
	if(file)
	  fclose(file);
	return success;
}