2007-11-04 03:34:51 +00:00
|
|
|
/*
|
2012-03-17 20:01:54 +00:00
|
|
|
Copyright (C) 1999-2007 id Software, Inc. and contributors.
|
|
|
|
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
2007-11-04 03:34:51 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
This file is part of GtkRadiant.
|
2007-11-04 03:34:51 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
GtkRadiant is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
2007-11-04 03:34:51 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
GtkRadiant is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2007-11-04 03:34:51 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GtkRadiant; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2007-11-04 03:34:51 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// Quick interface hack for selected face interface
|
|
|
|
// this one really needs more work, but I'm in a hurry with TexTool
|
|
|
|
|
|
|
|
#ifndef __ISELECTEDFACE_H_
|
|
|
|
#define __ISELECTEDFACE_H_
|
|
|
|
|
|
|
|
#define SELECTEDFACE_MAJOR "selectedface"
|
|
|
|
// v2.0
|
|
|
|
// support for multiple faces selection (first use in textool v2)
|
|
|
|
// using the g_ptrSelectedFaces indexes, get the face_t* with GETFACE
|
|
|
|
// still relies on the _QERFaceData*, unless you cast the face_t* to do your own stuff
|
|
|
|
// removed PFN_TEXTUREFORNAME, it's in the IShaders API now
|
|
|
|
|
|
|
|
//++timo TODO: this interface needs some cleanup with the new texture / shaders interface
|
|
|
|
|
|
|
|
// number of selected textures
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef int ( WINAPI * PFN_GETSELECTEDFACECOUNT )();
|
2007-11-04 03:34:51 +00:00
|
|
|
// retrieve the corresponding brush_t* (we need it when we need to explicitely rebuild stuff)
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef brush_t* ( WINAPI * PFN_GETFACEBRUSH )( int iface );
|
2007-11-04 03:34:51 +00:00
|
|
|
// retrieve a given face_t*
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef face_t* ( WINAPI * PFN_GETFACE )( int iface );
|
2007-11-04 03:34:51 +00:00
|
|
|
// winding_t is assumed to have MAX_POINTS_ON_WINDING allocated and waiting
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef int ( WINAPI * PFN_GETFACEINFO )( int iface, _QERFaceData*, winding_t* );
|
2007-11-04 03:34:51 +00:00
|
|
|
// tell editor to update the selected face data
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef int ( WINAPI * PFN_SETFACEINFO )( int iface, _QERFaceData* );
|
2007-11-04 03:34:51 +00:00
|
|
|
// retrieve the texture number to bind to
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef int ( WINAPI * PFN_GETTEXTURENUMBER )( int iface );
|
2007-11-04 03:34:51 +00:00
|
|
|
// retrieving some texture information
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef void ( WINAPI * PFN_GETTEXTURESIZE )( int iface, int Size[2] );
|
2007-11-04 03:34:51 +00:00
|
|
|
// straight func pointer to Select_SetTexture
|
|
|
|
// last parameter must be casted to an IPluginTexdef
|
2012-03-17 20:01:54 +00:00
|
|
|
typedef void ( WINAPI * PFN_SELECT_SETTEXTURE )( texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, void* pPlugTexdef );
|
2007-11-04 03:34:51 +00:00
|
|
|
|
|
|
|
// NOTE: some things in there are not really related to the selected face
|
|
|
|
// having some stuff moved into a textures-dedicated part ?
|
|
|
|
struct _QERSelectedFaceTable
|
|
|
|
{
|
|
|
|
int m_nSize;
|
2012-03-17 20:01:54 +00:00
|
|
|
PFN_GETSELECTEDFACECOUNT m_pfnGetSelectedFaceCount;
|
|
|
|
PFN_GETFACEBRUSH m_pfnGetFaceBrush;
|
|
|
|
PFN_GETFACE m_pfnGetFace;
|
|
|
|
PFN_GETFACEINFO m_pfnGetFaceInfo;
|
|
|
|
PFN_SETFACEINFO m_pfnSetFaceInfo;
|
|
|
|
PFN_GETTEXTURENUMBER m_pfnGetTextureNumber;
|
|
|
|
PFN_GETTEXTURESIZE m_pfnGetTextureSize;
|
|
|
|
PFN_SELECT_SETTEXTURE m_pfnSelect_SetTexture;
|
2007-11-04 03:34:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef USE_SELECTEDFACETABLE_DEFINE
|
|
|
|
#ifndef __SELECTEDFACETABLENAME
|
2012-03-17 20:01:54 +00:00
|
|
|
#define __SELECTEDFACETABLENAME g_SelectedFaceTable
|
2007-11-04 03:34:51 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define GetSelectedFaceCount __SELECTEDFACETABLENAME.m_pfnGetSelectedFaceCount
|
|
|
|
#define GetFaceBrush __SELECTEDFACETABLENAME.m_pfnGetFaceBrush
|
|
|
|
#define GetFace __SELECTEDFACETABLENAME.m_pfnGetFace
|
|
|
|
#define GetFaceInfo __SELECTEDFACETABLENAME.m_pfnGetFaceInfo
|
|
|
|
#define SetFaceInfo __SELECTEDFACETABLENAME.m_pfnSetFaceInfo
|
|
|
|
#define GetTextureNumber __SELECTEDFACETABLENAME.m_pfnGetTextureNumber
|
|
|
|
#define GetTextureSize __SELECTEDFACETABLENAME.m_pfnGetTextureSize
|
|
|
|
#define Select_SetTexture __SELECTEDFACETABLENAME.m_pfnSelect_SetTexture
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|