2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
5 This file is part of GtkRadiant.
\r
7 GtkRadiant is free software; you can redistribute it and/or modify
\r
8 it under the terms of the GNU General Public License as published by
\r
9 the Free Software Foundation; either version 2 of the License, or
\r
10 (at your option) any later version.
\r
12 GtkRadiant is distributed in the hope that it will be useful,
\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 GNU General Public License for more details.
\r
17 You should have received a copy of the GNU General Public License
\r
18 along with GtkRadiant; if not, write to the Free Software
\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
22 //-----------------------------------------------------------------------------
\r
25 // Quick interface hack for selected face interface
\r
26 // this one really needs more work, but I'm in a hurry with TexTool
\r
28 #ifndef __ISELECTEDFACE_H_
\r
29 #define __ISELECTEDFACE_H_
\r
31 #define SELECTEDFACE_MAJOR "selectedface"
\r
33 // support for multiple faces selection (first use in textool v2)
\r
34 // using the g_ptrSelectedFaces indexes, get the face_t* with GETFACE
\r
35 // still relies on the _QERFaceData*, unless you cast the face_t* to do your own stuff
\r
36 // removed PFN_TEXTUREFORNAME, it's in the IShaders API now
\r
38 //++timo TODO: this interface needs some cleanup with the new texture / shaders interface
\r
40 // number of selected textures
\r
41 typedef int (WINAPI* PFN_GETSELECTEDFACECOUNT) ();
\r
42 // retrieve the corresponding brush_t* (we need it when we need to explicitely rebuild stuff)
\r
43 typedef brush_t* (WINAPI* PFN_GETFACEBRUSH) (int iface);
\r
44 // retrieve a given face_t*
\r
45 typedef face_t* (WINAPI* PFN_GETFACE) (int iface);
\r
46 // winding_t is assumed to have MAX_POINTS_ON_WINDING allocated and waiting
\r
47 typedef int (WINAPI* PFN_GETFACEINFO) (int iface, _QERFaceData*, winding_t* );
\r
48 // tell editor to update the selected face data
\r
49 typedef int (WINAPI* PFN_SETFACEINFO) (int iface, _QERFaceData*);
\r
50 // retrieve the texture number to bind to
\r
51 typedef int (WINAPI* PFN_GETTEXTURENUMBER) (int iface);
\r
52 // retrieving some texture information
\r
53 typedef void (WINAPI* PFN_GETTEXTURESIZE) (int iface, int Size[2] );
\r
54 // straight func pointer to Select_SetTexture
\r
55 // last parameter must be casted to an IPluginTexdef
\r
56 typedef void (WINAPI* PFN_SELECT_SETTEXTURE) (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, void* pPlugTexdef);
\r
58 // NOTE: some things in there are not really related to the selected face
\r
59 // having some stuff moved into a textures-dedicated part ?
\r
60 struct _QERSelectedFaceTable
\r
63 PFN_GETSELECTEDFACECOUNT m_pfnGetSelectedFaceCount;
\r
64 PFN_GETFACEBRUSH m_pfnGetFaceBrush;
\r
65 PFN_GETFACE m_pfnGetFace;
\r
66 PFN_GETFACEINFO m_pfnGetFaceInfo;
\r
67 PFN_SETFACEINFO m_pfnSetFaceInfo;
\r
68 PFN_GETTEXTURENUMBER m_pfnGetTextureNumber;
\r
69 PFN_GETTEXTURESIZE m_pfnGetTextureSize;
\r
70 PFN_SELECT_SETTEXTURE m_pfnSelect_SetTexture;
\r
73 #ifdef USE_SELECTEDFACETABLE_DEFINE
\r
74 #ifndef __SELECTEDFACETABLENAME
\r
75 #define __SELECTEDFACETABLENAME g_SelectedFaceTable
\r
78 #define GetSelectedFaceCount __SELECTEDFACETABLENAME.m_pfnGetSelectedFaceCount
\r
79 #define GetFaceBrush __SELECTEDFACETABLENAME.m_pfnGetFaceBrush
\r
80 #define GetFace __SELECTEDFACETABLENAME.m_pfnGetFace
\r
81 #define GetFaceInfo __SELECTEDFACETABLENAME.m_pfnGetFaceInfo
\r
82 #define SetFaceInfo __SELECTEDFACETABLENAME.m_pfnSetFaceInfo
\r
83 #define GetTextureNumber __SELECTEDFACETABLENAME.m_pfnGetTextureNumber
\r
84 #define GetTextureSize __SELECTEDFACETABLENAME.m_pfnGetTextureSize
\r
85 #define Select_SetTexture __SELECTEDFACETABLENAME.m_pfnSelect_SetTexture
\r