Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

DrawDecal.h File Reference

#include "SWTHandle.h"

Go to the source code of this file.

Functions

geBoolean DRIVERCC DrawDecal (geRDriver_THandle *THandle, RECT *SRect, int32 x, int32 y)


Function Documentation

geBoolean DRIVERCC DrawDecal geRDriver_THandle THandle,
RECT SRect,
int32  x,
int32  y
 

Definition at line 248 of file D3D7xDrv/Render.cpp.

00249 {
00250         RECT    SRect2, *pSRect;
00251         int32   Width, Height;
00252         HRESULT ddrval;
00253 
00254         if(!AppInfo.RenderingIsOK)
00255                 return  TRUE;
00256 
00257         if (!SRect)
00258         {
00259                 SRect2.left = 0;
00260                 SRect2.right = THandle->Width;
00261                 SRect2.top = 0;
00262                 SRect2.bottom = THandle->Height;
00263                 pSRect = &SRect2;
00264                 Width = (THandle->Width);
00265                 Height = (THandle->Height);
00266         }
00267         else
00268         {
00269                 pSRect = SRect;
00270                 Width = (pSRect->right - pSRect->left)+1;
00271                 Height = (pSRect->bottom - pSRect->top)+1;
00272         }
00273         
00274         if (x + Width <= 0)
00275                 return TRUE;
00276         if (y + Height <= 0)
00277                 return TRUE;
00278 
00279         if (x >= ClientWindow.Width)
00280                 return TRUE;
00281         
00282         if (y >= ClientWindow.Height)
00283                 return TRUE;
00284         
00285         if (x + Width >= (ClientWindow.Width-1))
00286                 pSRect->right -= ((x + Width) - (ClientWindow.Width-1));
00287         if (y + Height >= (ClientWindow.Height-1))
00288                 pSRect->bottom -= ((y + Height) - (ClientWindow.Height-1));
00289 
00290         if (x < 0)
00291         {
00292                 pSRect->left += -x;
00293                 x=0;
00294         }
00295         if (y < 0)
00296         {
00297                 pSRect->top += -y;
00298                 y=0;
00299         }
00300         
00301 #if 0
00302 
00303 /*      01/24/2002 Wendell Buckner
00304     Change flags for speed...
00305         AppInfo.lpBackBuffer->BltFast(x, y, THandle->MipData[0].Surface, pSRect, DDBLTFAST_SRCCOLORKEY | DDBLTFAST_WAIT);*/
00306     AppInfo.lpBackBuffer->BltFast(x, y, THandle->MipData[0].Surface, pSRect, DDBLTFAST_SRCCOLORKEY | DDBLTFAST_DONOTWAIT ); 
00307     
00308 #else
00309         RECT    DRect;
00310 
00311         Width = (pSRect->right - pSRect->left);
00312         Height = (pSRect->bottom - pSRect->top);
00313 
00314         DRect.left = x;
00315         DRect.right = x+Width;
00316         DRect.top = y;
00317         DRect.bottom = y+Height;
00318 
00319 /*      01/24/2002 Wendell Buckner
00320     Change flags for speed...
00321     ddrval= AppInfo.lpBackBuffer->Blt(&DRect, THandle->MipData[0].Surface, pSRect, 
00322                              (DDBLT_KEYSRC | DDBLT_WAIT), NULL);*/
00323         ddrval= AppInfo.lpBackBuffer->Blt(&DRect, THandle->MipData[0].Surface, pSRect, 
00324                              (DDBLT_KEYSRC | DDBLT_DONOTWAIT | DDBLT_ASYNC ), NULL);    
00325 
00326         if(ddrval==DDERR_SURFACELOST)
00327         {
00328                 if (!D3DMain_RestoreAllSurfaces())
00329                         return  GE_FALSE;
00330         }
00331         //AppInfo.lpBackBuffer->Blt(&DRect, Decals[Handle].Surface, pSRect, (DDBLT_WAIT), NULL);
00332 #endif
00333 
00334         return GE_TRUE;
00335 }


Generated on Tue Sep 30 12:37:26 2003 for GTestAndEngine by doxygen 1.3.2