From d320ec46f2923e580b379cebef4bf91d0d279c91 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 13 Apr 2011 17:36:36 +0100 Subject: [PATCH] Trace unofficial D3D9 formats --- compat.h | 2 -- d3d9.py | 7 +---- d3d9imports.hpp | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ d3d9types.py | 10 +++++++ 4 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 d3d9imports.hpp diff --git a/compat.h b/compat.h index e98f746..cc6f70e 100644 --- a/compat.h +++ b/compat.h @@ -20,8 +20,6 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. - * Copyright 2007-2009 VMware, Inc. - * All rights reserved. * **************************************************************************/ diff --git a/d3d9.py b/d3d9.py index 057fad6..dbec2f8 100644 --- a/d3d9.py +++ b/d3d9.py @@ -411,12 +411,7 @@ class D3D9Tracer(DllTracer): if __name__ == '__main__': - print '#include ' - print '#include ' - print - print '#include "compat.h"' - print - print '#include ' + print '#include "d3d9imports.hpp"' print print '#include "trace_write.hpp"' print '#include "os.hpp"' diff --git a/d3d9imports.hpp b/d3d9imports.hpp new file mode 100644 index 0000000..f598f97 --- /dev/null +++ b/d3d9imports.hpp @@ -0,0 +1,74 @@ +/************************************************************************** + * + * Copyright 2011 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + **************************************************************************/ + +/* + * Central place for all D3D9 includes, and respective OS dependent headers. + */ + +#ifndef _D3D9IMPORTS_HPP_ +#define _D3D9IMPORTS_HPP_ + +#include +#include + +#include "compat.h" + +#include + + +#ifndef D3DFMT_ATI1 +#define D3DFMT_ATI1 ((D3DFORMAT)MAKEFOURCC('A','T','I','1')) +#endif + +#ifndef D3DFMT_ATI2 +#define D3DFMT_ATI2 ((D3DFORMAT)MAKEFOURCC('A','T','I','2')) +#endif + +#ifndef D3DFMT_AYUV +#define D3DFMT_AYUV ((D3DFORMAT)MAKEFOURCC('A','Y','U','V')) +#endif + +#ifndef D3DFMT_DF16 +#define D3DFMT_DF16 ((D3DFORMAT)MAKEFOURCC('D','F','1','6')) +#endif + +#ifndef D3DFMT_DF24 +#define D3DFMT_DF24 ((D3DFORMAT)MAKEFOURCC('D','F','2','4')) +#endif + +#ifndef D3DFMT_INTZ +#define D3DFMT_INTZ ((D3DFORMAT)MAKEFOURCC('I','N','T','Z')) +#endif + +#ifndef D3DFMT_NV12 +#define D3DFMT_NV12 ((D3DFORMAT)MAKEFOURCC('N','V','1','2')) +#endif + +#ifndef D3DFMT_NULL +#define D3DFMT_NULL ((D3DFORMAT)MAKEFOURCC('N','U','L','L')) +#endif + + +#endif /* _D3D9IMPORTS_HPP_ */ diff --git a/d3d9types.py b/d3d9types.py index b5dff50..1531321 100644 --- a/d3d9types.py +++ b/d3d9types.py @@ -928,6 +928,16 @@ D3DFORMAT = Enum("D3DFORMAT", [ "D3DFMT_CxV8U8", "D3DFMT_A1", "D3DFMT_BINARYBUFFER", + + # Unofficial formats + "D3DFMT_ATI1", + "D3DFMT_ATI2", + "D3DFMT_AYUV", + "D3DFMT_DF16", + "D3DFMT_DF24", + "D3DFMT_INTZ", + "D3DFMT_NV12", + "D3DFMT_NULL", ]) D3DDISPLAYMODE = Struct("D3DDISPLAYMODE", [ -- 2.43.0