diff options
Diffstat (limited to 'win32/plugins/dfxvideo/winsrc/draw.c')
| -rwxr-xr-x[-rw-r--r--] | win32/plugins/dfxvideo/winsrc/draw.c | 352 |
1 files changed, 176 insertions, 176 deletions
diff --git a/win32/plugins/dfxvideo/winsrc/draw.c b/win32/plugins/dfxvideo/winsrc/draw.c index 94095d38..1e82fba8 100644..100755 --- a/win32/plugins/dfxvideo/winsrc/draw.c +++ b/win32/plugins/dfxvideo/winsrc/draw.c @@ -3489,13 +3489,13 @@ void DoBufferSwap(void) // SWAP BUFFERS ViewportRect.right = PreviousPSXDisplay.DisplayMode.x; ViewportRect.bottom = PreviousPSXDisplay.DisplayMode.y; - if(iRumbleTime)
- {
- ScreenRect.left+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- ScreenRect.right+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- ScreenRect.top+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- ScreenRect.bottom+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- iRumbleTime--;
+ if(iRumbleTime) + { + ScreenRect.left+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + ScreenRect.right+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + ScreenRect.top+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + ScreenRect.bottom+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + iRumbleTime--; } } @@ -3528,16 +3528,16 @@ void DoBufferSwap(void) // SWAP BUFFERS ViewportRect.right=1024; ViewportRect.bottom=iGPUHeight; } - else
- {
- if(iRumbleTime)
- {
- ScreenRect.left+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- ScreenRect.right+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- ScreenRect.top+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- ScreenRect.bottom+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2);
- iRumbleTime--;
- }
+ else + { + if(iRumbleTime) + { + ScreenRect.left+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + ScreenRect.right+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + ScreenRect.top+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + ScreenRect.bottom+=((rand()*iRumbleVal)/RAND_MAX)-(iRumbleVal/2); + iRumbleTime--; + } } if(iUseScanLines==2) // stupid nvidia scanline mode @@ -3676,7 +3676,7 @@ int DXinitialize() DDSCAPS ddscaps; DDBLTFX ddbltfx; DDPIXELFORMAT dd; - HRESULT (WINAPI *pDDrawCreateFn)(GUID *,LPDIRECTDRAW *,IUnknown *);
+ HRESULT (WINAPI *pDDrawCreateFn)(GUID *,LPDIRECTDRAW *,IUnknown *); // init some DX vars DX.hWnd = (HWND)hWGPU; @@ -3686,9 +3686,9 @@ int DXinitialize() // make guid ! c=(unsigned char *)&guiDev; for(i=0;i<sizeof(GUID);i++,c++) - {if(*c) {guid=&guiDev;break;}}
+ {if(*c) {guid=&guiDev;break;}} - pDDrawCreateFn = (LPVOID)GetProcAddress( hDDrawDLL, "DirectDrawCreate" );
+ pDDrawCreateFn = (LPVOID)GetProcAddress( hDDrawDLL, "DirectDrawCreate" ); // create dd if(pDDrawCreateFn == NULL || pDDrawCreateFn(guid,&DD,0)) @@ -4377,54 +4377,54 @@ static void hq2x_16_def(unsigned short* dst0, unsigned short* dst1, const unsign if (interp_16_diff(c[8], c[4])) mask |= 1 << 7; -#define P0 dst0[0]
-#define P1 dst0[1]
-#define P2 dst1[0]
-#define P3 dst1[1]
-#define MUR interp_16_diff(c[1], c[5])
-#define MDR interp_16_diff(c[5], c[7])
-#define MDL interp_16_diff(c[7], c[3])
-#define MUL interp_16_diff(c[3], c[1])
-#define IC(p0) c[p0]
-#define I11(p0,p1) interp_16_11(c[p0], c[p1])
-#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2])
-#define I31(p0,p1) interp_16_31(c[p0], c[p1])
-#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2])
-#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2])
-#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2])
-#define I53(p0,p1) interp_16_53(c[p0], c[p1])
-#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2])
-#define I71(p0,p1) interp_16_71(c[p0], c[p1])
-#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2])
-#define I97(p0,p1) interp_16_97(c[p0], c[p1])
-#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2])
-#define I151(p0,p1) interp_16_151(c[p0], c[p1])
-
- switch (mask) {
-#include "hq2x.h"
- }
-
-#undef P0
-#undef P1
-#undef P2
-#undef P3
-#undef MUR
-#undef MDR
-#undef MDL
-#undef MUL
-#undef IC
-#undef I11
-#undef I211
-#undef I31
-#undef I332
-#undef I431
-#undef I521
-#undef I53
-#undef I611
-#undef I71
-#undef I772
-#undef I97
-#undef I1411
+#define P0 dst0[0] +#define P1 dst0[1] +#define P2 dst1[0] +#define P3 dst1[1] +#define MUR interp_16_diff(c[1], c[5]) +#define MDR interp_16_diff(c[5], c[7]) +#define MDL interp_16_diff(c[7], c[3]) +#define MUL interp_16_diff(c[3], c[1]) +#define IC(p0) c[p0] +#define I11(p0,p1) interp_16_11(c[p0], c[p1]) +#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2]) +#define I31(p0,p1) interp_16_31(c[p0], c[p1]) +#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2]) +#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2]) +#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2]) +#define I53(p0,p1) interp_16_53(c[p0], c[p1]) +#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2]) +#define I71(p0,p1) interp_16_71(c[p0], c[p1]) +#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2]) +#define I97(p0,p1) interp_16_97(c[p0], c[p1]) +#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2]) +#define I151(p0,p1) interp_16_151(c[p0], c[p1]) + + switch (mask) { +#include "hq2x.h" + } + +#undef P0 +#undef P1 +#undef P2 +#undef P3 +#undef MUR +#undef MDR +#undef MDL +#undef MUL +#undef IC +#undef I11 +#undef I211 +#undef I31 +#undef I332 +#undef I431 +#undef I521 +#undef I53 +#undef I611 +#undef I71 +#undef I772 +#undef I97 +#undef I1411 #undef I151 src0 += 1; @@ -4519,55 +4519,55 @@ static void hq2x_32_def(unsigned long * dst0, unsigned long * dst1, const unsign if (interp_32_diff(c[8], c[4])) mask |= 1 << 7; -#define P0 dst0[0]
-#define P1 dst0[1]
-#define P2 dst1[0]
-#define P3 dst1[1]
-#define MUR interp_32_diff(c[1], c[5])
-#define MDR interp_32_diff(c[5], c[7])
-#define MDL interp_32_diff(c[7], c[3])
-#define MUL interp_32_diff(c[3], c[1])
-#define IC(p0) c[p0]
-#define I11(p0,p1) interp_32_11(c[p0], c[p1])
-#define I211(p0,p1,p2) interp_32_211(c[p0], c[p1], c[p2])
-#define I31(p0,p1) interp_32_31(c[p0], c[p1])
-#define I332(p0,p1,p2) interp_32_332(c[p0], c[p1], c[p2])
-#define I431(p0,p1,p2) interp_32_431(c[p0], c[p1], c[p2])
-#define I521(p0,p1,p2) interp_32_521(c[p0], c[p1], c[p2])
-#define I53(p0,p1) interp_32_53(c[p0], c[p1])
-#define I611(p0,p1,p2) interp_32_611(c[p0], c[p1], c[p2])
-#define I71(p0,p1) interp_32_71(c[p0], c[p1])
-#define I772(p0,p1,p2) interp_32_772(c[p0], c[p1], c[p2])
-#define I97(p0,p1) interp_32_97(c[p0], c[p1])
-#define I1411(p0,p1,p2) interp_32_1411(c[p0], c[p1], c[p2])
-#define I151(p0,p1) interp_32_151(c[p0], c[p1])
-
- switch (mask) {
-#include "hq2x.h"
- }
-
-#undef P0
-#undef P1
-#undef P2
-#undef P3
-#undef MUR
-#undef MDR
-#undef MDL
-#undef MUL
-#undef IC
-#undef I11
-#undef I211
-#undef I31
-#undef I332
-#undef I431
-#undef I521
-#undef I53
-#undef I611
-#undef I71
-#undef I772
-#undef I97
-#undef I1411
-#undef I151
+#define P0 dst0[0] +#define P1 dst0[1] +#define P2 dst1[0] +#define P3 dst1[1] +#define MUR interp_32_diff(c[1], c[5]) +#define MDR interp_32_diff(c[5], c[7]) +#define MDL interp_32_diff(c[7], c[3]) +#define MUL interp_32_diff(c[3], c[1]) +#define IC(p0) c[p0] +#define I11(p0,p1) interp_32_11(c[p0], c[p1]) +#define I211(p0,p1,p2) interp_32_211(c[p0], c[p1], c[p2]) +#define I31(p0,p1) interp_32_31(c[p0], c[p1]) +#define I332(p0,p1,p2) interp_32_332(c[p0], c[p1], c[p2]) +#define I431(p0,p1,p2) interp_32_431(c[p0], c[p1], c[p2]) +#define I521(p0,p1,p2) interp_32_521(c[p0], c[p1], c[p2]) +#define I53(p0,p1) interp_32_53(c[p0], c[p1]) +#define I611(p0,p1,p2) interp_32_611(c[p0], c[p1], c[p2]) +#define I71(p0,p1) interp_32_71(c[p0], c[p1]) +#define I772(p0,p1,p2) interp_32_772(c[p0], c[p1], c[p2]) +#define I97(p0,p1) interp_32_97(c[p0], c[p1]) +#define I1411(p0,p1,p2) interp_32_1411(c[p0], c[p1], c[p2]) +#define I151(p0,p1) interp_32_151(c[p0], c[p1]) + + switch (mask) { +#include "hq2x.h" + } + +#undef P0 +#undef P1 +#undef P2 +#undef P3 +#undef MUR +#undef MDR +#undef MDL +#undef MUL +#undef IC +#undef I11 +#undef I211 +#undef I31 +#undef I332 +#undef I431 +#undef I521 +#undef I53 +#undef I611 +#undef I71 +#undef I772 +#undef I97 +#undef I1411 +#undef I151 src0 += 1; src1 += 1; @@ -4823,65 +4823,65 @@ static void hq3x_16_def(unsigned short* dst0, unsigned short* dst1, unsigned sho if (interp_16_diff(c[8], c[4])) mask |= 1 << 7; -#define P0 dst0[0]
-#define P1 dst0[1]
-#define P2 dst0[2]
-#define P3 dst1[0]
-#define P4 dst1[1]
-#define P5 dst1[2]
-#define P6 dst2[0]
-#define P7 dst2[1]
-#define P8 dst2[2]
-#define MUR interp_16_diff(c[1], c[5])
-#define MDR interp_16_diff(c[5], c[7])
-#define MDL interp_16_diff(c[7], c[3])
-#define MUL interp_16_diff(c[3], c[1])
-#define IC(p0) c[p0]
-#define I11(p0,p1) interp_16_11(c[p0], c[p1])
-#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2])
-#define I31(p0,p1) interp_16_31(c[p0], c[p1])
-#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2])
-#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2])
-#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2])
-#define I53(p0,p1) interp_16_53(c[p0], c[p1])
-#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2])
-#define I71(p0,p1) interp_16_71(c[p0], c[p1])
-#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2])
-#define I97(p0,p1) interp_16_97(c[p0], c[p1])
-#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2])
-#define I151(p0,p1) interp_16_151(c[p0], c[p1])
-
- switch (mask) {
-#include "hq3x.h"
- }
-
-#undef P0
-#undef P1
-#undef P2
-#undef P3
-#undef P4
-#undef P5
-#undef P6
-#undef P7
-#undef P8
-#undef MUR
-#undef MDR
-#undef MDL
-#undef MUL
-#undef IC
-#undef I11
-#undef I211
-#undef I31
-#undef I332
-#undef I431
-#undef I521
-#undef I53
-#undef I611
-#undef I71
-#undef I772
-#undef I97
-#undef I1411
-#undef I151
+#define P0 dst0[0] +#define P1 dst0[1] +#define P2 dst0[2] +#define P3 dst1[0] +#define P4 dst1[1] +#define P5 dst1[2] +#define P6 dst2[0] +#define P7 dst2[1] +#define P8 dst2[2] +#define MUR interp_16_diff(c[1], c[5]) +#define MDR interp_16_diff(c[5], c[7]) +#define MDL interp_16_diff(c[7], c[3]) +#define MUL interp_16_diff(c[3], c[1]) +#define IC(p0) c[p0] +#define I11(p0,p1) interp_16_11(c[p0], c[p1]) +#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2]) +#define I31(p0,p1) interp_16_31(c[p0], c[p1]) +#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2]) +#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2]) +#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2]) +#define I53(p0,p1) interp_16_53(c[p0], c[p1]) +#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2]) +#define I71(p0,p1) interp_16_71(c[p0], c[p1]) +#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2]) +#define I97(p0,p1) interp_16_97(c[p0], c[p1]) +#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2]) +#define I151(p0,p1) interp_16_151(c[p0], c[p1]) + + switch (mask) { +#include "hq3x.h" + } + +#undef P0 +#undef P1 +#undef P2 +#undef P3 +#undef P4 +#undef P5 +#undef P6 +#undef P7 +#undef P8 +#undef MUR +#undef MDR +#undef MDL +#undef MUL +#undef IC +#undef I11 +#undef I211 +#undef I31 +#undef I332 +#undef I431 +#undef I521 +#undef I53 +#undef I611 +#undef I71 +#undef I772 +#undef I97 +#undef I1411 +#undef I151 src0 += 1; src1 += 1; |
