Started adding motion blur support

This commit is contained in:
pagefault
2003-02-28 20:19:21 +00:00
parent 9c08e0447e
commit 8cf5011098
7 changed files with 180 additions and 20 deletions

View File

@@ -130,7 +130,8 @@ extern "C" {
DWORD MouseButton;
DWORD SurfaceX=0;
DWORD SurfaceY=0;
VOID *blur_temp=0;
VOID *blur_buffer=0;
}
static char dinput8_dll[] = {"dinput8.dll\0"};
@@ -440,6 +441,8 @@ void ExitFunction()
ReleaseDirectInput();
ReleaseDirectSound();
ReleaseDirectDraw();
if (blur_temp) free(blur_temp);
if (blur_buffer) free(blur_buffer);
FreeLibrary(hM_dsound);
FreeLibrary(hM_ddraw);
FreeLibrary(hM_dinput8);
@@ -1364,6 +1367,11 @@ int InitDirectDraw()
return FALSE;
}
if (!blur_buffer) blur_buffer = malloc(SurfaceX * SurfaceY * (BitDepth == 16 ? 2 : 4));
else blur_buffer = realloc(blur_buffer, SurfaceX * SurfaceY * (BitDepth == 16 ? 2 : 4));
if (!blur_temp) blur_temp = malloc(SurfaceX * SurfaceY * (BitDepth == 16 ? 2 : 4));
else blur_temp = realloc(blur_temp, SurfaceX * SurfaceY * (BitDepth == 16 ? 2 : 4));
return TRUE;
}
@@ -2044,8 +2052,16 @@ void clearwin()
extern void DrawWin256x224x16();
extern void DrawWin256x224x32();
extern void DrawWin256x224x32MB();
extern void DrawWin320x240x16();
extern _int64 copymaskRB = 0x001FF800001FF800;
extern _int64 copymaskG = 0x0000FC000000FC00;
extern _int64 copymagic = 0x0008010000080100;
extern _int64 coef = 0x0066009a0066009a;
extern BYTE MotionBlur;
void drawscreenwin(void)
{
DWORD i,j,color32;
@@ -2104,8 +2120,9 @@ void drawscreenwin(void)
}
case 32:
{
DrawWin256x224x32();
break;
if (MotionBlur == 1) DrawWin256x224x32MB();
else DrawWin256x224x32();
break;
}
SURFDW=(DWORD *) &SurfBuf[(resolutn-1)*pitch];