00001 /// \file CATOverlay.cpp 00002 /// \brief Base image overlay for drawing on top of games 00003 /// \ingroup CAT 00004 /// 00005 /// Copyright (c) 2007-2008 by Michael Ellison. 00006 /// See COPYING.txt for the \ref gaslicense License (MIT License). 00007 /// 00008 // $Author: mikeellison $ 00009 // $Date: 2008-01-31 21:20:49 -0600 (Thu, 31 Jan 2008) $ 00010 // $Revision: $ 00011 // $NoKeywords: $ 00012 00013 #include "CATOverlay.h" 00014 #include "CATString.h" 00015 00016 #ifdef CAT_CONFIG_WIN32 00017 #include <gl/gl.h> 00018 00019 CATOverlay::CATOverlay() 00020 :CATIntercept() 00021 { 00022 fOverlay = 0; 00023 fOverlayDirty = false; 00024 fRefScreenWidth = 0; 00025 fRefScreenHeight = 0; 00026 fKeepAspect = true; 00027 } 00028 00029 CATOverlay::~CATOverlay() 00030 { 00031 RestoreAll(); 00032 } 00033 00034 CATRect CATOverlay::GetRect() 00035 { 00036 fLock.Wait(); 00037 00038 CATRect retRect = fRect; 00039 00040 fLock.Release(); 00041 return retRect; 00042 } 00043 00044 void CATOverlay::SetOverlayImage( CATImage* overlay, 00045 const CATRect& overlayRect, 00046 CATInt32 refScreenWidth, 00047 CATInt32 refScreenHeight, 00048 bool keepAspect) 00049 00050 { 00051 fLock.Wait(); 00052 00053 fOverlay = overlay; 00054 fOverlayDirty = true; 00055 fOverlayRect = overlayRect; 00056 fRefScreenWidth = refScreenWidth; 00057 fRefScreenHeight = refScreenHeight; 00058 fKeepAspect = keepAspect; 00059 fLock.Release(); 00060 } 00061 00062 #endif // CAT_CONFIG_WIN32