changeset 27925:296d5da784b4

Simplify conditions in direct3d vo: remove == 1, change == 0 to ! etc.
author reimar
date Wed, 19 Nov 2008 13:39:07 +0000
parents 086d90e16523
children a02c39208d49
files libvo/vo_direct3d.c
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_direct3d.c	Tue Nov 18 20:34:07 2008 +0000
+++ b/libvo/vo_direct3d.c	Wed Nov 19 13:39:07 2008 +0000
@@ -291,7 +291,7 @@
     IDirect3DDevice9_ColorFill(gpD3DDevice, gpD3DSurface, NULL,
                                D3DCOLOR_ARGB(0xFF, 0, 0, 0) );
 
-    if (vo_fs == 1)
+    if (vo_fs)
         CalculateFullscreenRect ();
 
     return 1;
@@ -364,10 +364,10 @@
 
     if (FAILED (IDirect3DDevice9_StretchRect (gpD3DDevice,
                                               gpD3DSurface,
-                                              gIsPanscan == 1 ?
+                                              gIsPanscan ?
                                               &gPanScanSrcRect : NULL,
                                               gpD3DBackBuf,
-                                              vo_fs == 1 ?
+                                              vo_fs ?
                                               &gFullScrMovieRect : NULL,
                                               D3DTEXF_LINEAR)))
     {
@@ -455,7 +455,8 @@
        > an example of how to use it.
     */
 
-    if ((gpD3DHandle = Direct3DCreate9 (D3D_SDK_VERSION)) == NULL)
+    gpD3DHandle = Direct3DCreate9 (D3D_SDK_VERSION);
+    if (!gpD3DHandle)
     {
         mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>Unable to initialize Direct3D\n");
         return -1;
@@ -478,7 +479,7 @@
     /* w32_common framework call. Configures window on the screen, gets
      * fullscreen dimensions and does other useful stuff.
      */
-    if (vo_w32_init() == 0)
+    if (!vo_w32_init())
     {
         mp_msg(MSGT_VO,MSGL_V,"Unable to configure onscreen window\r\n");
         return -1;
@@ -567,16 +568,16 @@
     /* w32_common framework call. Creates window on the screen with
      * the given coordinates.
      */
-    if (vo_w32_config(d_width, d_height, options) == 0)
+    if (!vo_w32_config(d_width, d_height, options))
     {
         mp_msg(MSGT_VO,MSGL_V,"Unable to create onscreen window\r\n");
         return VO_ERROR;
     }
 
-    if (gIsD3DConfigFinished == 1)
+    if (gIsD3DConfigFinished)
     {
         gIsD3DConfigFinished = 0;
-        if (D3DConfigure () == 0)
+        if (!D3DConfigure ())
         {
             gIsD3DConfigFinished = 1;
             return VO_ERROR;
@@ -597,7 +598,7 @@
         mp_msg(MSGT_VO,MSGL_V,
                "<vo_direct3d>Video adapter became uncooperative.\n");
         mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>Trying to reinitialize it...\n");
-        if (D3DConfigure() == 0)
+        if (!D3DConfigure())
         {
             mp_msg(MSGT_VO,MSGL_V,"<vo_direct3d>Reinitialization Failed.\n");
             return;
@@ -647,7 +648,7 @@
     if (flags & VO_EVENT_RESIZE)
         D3DConfigure();
 
-    if ((flags & VO_EVENT_EXPOSE) && gIsPaused == TRUE)
+    if ((flags & VO_EVENT_EXPOSE) && gIsPaused)
         flip_page();
 }
 
@@ -715,10 +716,10 @@
 
     if (FAILED (IDirect3DDevice9_StretchRect (gpD3DDevice,
                                               gpD3DSurface,
-                                              gIsPanscan == 1 ?
+                                              gIsPanscan ?
                                               &gPanScanSrcRect : NULL,
                                               gpD3DBackBuf,
-                                              vo_fs == 1 ?
+                                              vo_fs ?
                                               &gFullScrMovieRect : NULL,
                                               D3DTEXF_LINEAR)))
     {