Itsa me, quake3io!
This commit is contained in:
parent
dbe4ddb103
commit
5b755058f5
1409 changed files with 798983 additions and 798983 deletions
160
q3radiant/BMP.H
Normal file → Executable file
160
q3radiant/BMP.H
Normal file → Executable file
|
|
@ -19,83 +19,83 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#ifndef _BMP_H
|
||||
#define _BMP_H
|
||||
|
||||
#define xBI_NONE 0
|
||||
#define xBI_RGB 0
|
||||
#define xBI_RLE4 2
|
||||
#define xBI_RLE8 1
|
||||
|
||||
#define BMP_SIGNATURE_WORD 0x4d42
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned short bfType; // signature - 'BM'
|
||||
unsigned long bfSize; // file size in bytes
|
||||
unsigned short bfReserved1; // 0
|
||||
unsigned short bfReserved2; // 0
|
||||
unsigned long bfOffBits; // offset to bitmap
|
||||
} bmphd_t;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned long biSize; // size of this struct
|
||||
long biWidth; // bmap width in pixels
|
||||
long biHeight; // bmap height in pixels
|
||||
unsigned short biPlanes; // num planes - always 1
|
||||
unsigned short biBitCount; // bits perpixel
|
||||
unsigned long biCompression; // compression flag
|
||||
unsigned long biSizeImage; // image size in bytes
|
||||
long biXPelsPerMeter; // horz resolution
|
||||
long biYPelsPerMeter; // vert resolution
|
||||
unsigned long biClrUsed; // 0 -> color table size
|
||||
unsigned long biClrImportant; // important color count
|
||||
} binfo_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char blue;
|
||||
unsigned char green;
|
||||
unsigned char red;
|
||||
unsigned char reserved;
|
||||
} drgb_t;
|
||||
|
||||
|
||||
// quake expects its palette to be bgr
|
||||
// this is totally backwards but what can you do
|
||||
typedef struct {
|
||||
unsigned char r;
|
||||
unsigned char g;
|
||||
unsigned char b;
|
||||
} rgb_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char b;
|
||||
unsigned char g;
|
||||
unsigned char r;
|
||||
} bgr_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int bpp; // bits per pixel
|
||||
int width;
|
||||
int height;
|
||||
unsigned char *data;
|
||||
rgb_t *palette;
|
||||
} bitmap_t;
|
||||
|
||||
|
||||
void LoadBMP(char *filename, bitmap_t *bit);
|
||||
void FreeBMP(bitmap_t *bitmap);
|
||||
void WriteBMP(char *filename, bitmap_t *bit);
|
||||
void NewBMP(int width, int height, int bpp, bitmap_t *bit);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#ifndef _BMP_H
|
||||
#define _BMP_H
|
||||
|
||||
#define xBI_NONE 0
|
||||
#define xBI_RGB 0
|
||||
#define xBI_RLE4 2
|
||||
#define xBI_RLE8 1
|
||||
|
||||
#define BMP_SIGNATURE_WORD 0x4d42
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned short bfType; // signature - 'BM'
|
||||
unsigned long bfSize; // file size in bytes
|
||||
unsigned short bfReserved1; // 0
|
||||
unsigned short bfReserved2; // 0
|
||||
unsigned long bfOffBits; // offset to bitmap
|
||||
} bmphd_t;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned long biSize; // size of this struct
|
||||
long biWidth; // bmap width in pixels
|
||||
long biHeight; // bmap height in pixels
|
||||
unsigned short biPlanes; // num planes - always 1
|
||||
unsigned short biBitCount; // bits perpixel
|
||||
unsigned long biCompression; // compression flag
|
||||
unsigned long biSizeImage; // image size in bytes
|
||||
long biXPelsPerMeter; // horz resolution
|
||||
long biYPelsPerMeter; // vert resolution
|
||||
unsigned long biClrUsed; // 0 -> color table size
|
||||
unsigned long biClrImportant; // important color count
|
||||
} binfo_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char blue;
|
||||
unsigned char green;
|
||||
unsigned char red;
|
||||
unsigned char reserved;
|
||||
} drgb_t;
|
||||
|
||||
|
||||
// quake expects its palette to be bgr
|
||||
// this is totally backwards but what can you do
|
||||
typedef struct {
|
||||
unsigned char r;
|
||||
unsigned char g;
|
||||
unsigned char b;
|
||||
} rgb_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char b;
|
||||
unsigned char g;
|
||||
unsigned char r;
|
||||
} bgr_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int bpp; // bits per pixel
|
||||
int width;
|
||||
int height;
|
||||
unsigned char *data;
|
||||
rgb_t *palette;
|
||||
} bitmap_t;
|
||||
|
||||
|
||||
void LoadBMP(char *filename, bitmap_t *bit);
|
||||
void FreeBMP(bitmap_t *bitmap);
|
||||
void WriteBMP(char *filename, bitmap_t *bit);
|
||||
void NewBMP(int width, int height, int bpp, bitmap_t *bit);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
206
q3radiant/BRUSH.H
Normal file → Executable file
206
q3radiant/BRUSH.H
Normal file → Executable file
|
|
@ -19,106 +19,106 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// brush.h
|
||||
|
||||
// all types moved to qertypes.h
|
||||
//--typedef struct
|
||||
//--{
|
||||
//-- int numpoints;
|
||||
//-- int maxpoints;
|
||||
//-- float points[8][5]; // variable sized
|
||||
//--} winding_t;
|
||||
|
||||
|
||||
// the normals on planes point OUT of the brush
|
||||
//--#define MAXPOINTS 16
|
||||
//--typedef struct face_s
|
||||
//--{
|
||||
//-- struct face_s *next;
|
||||
//-- vec3_t planepts[3];
|
||||
//-- texdef_t texdef;
|
||||
//-- plane_t plane;
|
||||
//--
|
||||
//-- winding_t *face_winding;
|
||||
//--
|
||||
//-- vec3_t d_color;
|
||||
//-- qtexture_t *d_texture;
|
||||
//--
|
||||
//--} face_t;
|
||||
//--
|
||||
//--typedef struct {
|
||||
//-- vec3_t xyz;
|
||||
//-- float sideST[2];
|
||||
//-- float capST[2];
|
||||
//--} curveVertex_t;
|
||||
//--
|
||||
//--typedef struct {
|
||||
//-- curveVertex_t v[2];
|
||||
//--} sideVertex_t;
|
||||
//--
|
||||
//--typedef struct brush_s
|
||||
//--{
|
||||
//-- struct brush_s *prev, *next; // links in active/selected
|
||||
//-- struct brush_s *oprev, *onext; // links in entity
|
||||
//-- struct entity_s *owner;
|
||||
//-- vec3_t mins, maxs;
|
||||
//-- face_t *brush_faces;
|
||||
//--
|
||||
//-- qboolean bModelFailed;
|
||||
//-- //
|
||||
//-- // curve brush extensions
|
||||
//-- // all are derived from brush_faces
|
||||
//-- qboolean curveBrush;
|
||||
//-- qboolean patchBrush;
|
||||
//-- int nPatchID;
|
||||
//--} brush_t;
|
||||
|
||||
void Brush_AddToList (brush_t *b, brush_t *list);
|
||||
void Brush_Build(brush_t *b, bool bSnap = true, bool bMarkMap = true, bool bConvert = false);
|
||||
void Brush_BuildWindings( brush_t *b, bool bSnap = true );
|
||||
brush_t* Brush_Clone (brush_t *b);
|
||||
brush_t* Brush_FullClone(brush_t *b);
|
||||
brush_t* Brush_Create (vec3_t mins, vec3_t maxs, texdef_t *texdef);
|
||||
void Brush_Draw( brush_t *b );
|
||||
void Brush_DrawXY(brush_t *b, int nViewType);
|
||||
// set bRemoveNode to false to avoid trying to delete the item in group view tree control
|
||||
void Brush_Free (brush_t *b, bool bRemoveNode = true);
|
||||
int Brush_MemorySize(brush_t *b);
|
||||
void Brush_MakeSided (int sides);
|
||||
void Brush_MakeSidedCone (int sides);
|
||||
void Brush_Move (brush_t *b, const vec3_t move, bool bSnap = true);
|
||||
int Brush_MoveVertex(brush_t *b, vec3_t vertex, vec3_t delta, vec3_t end, bool bSnap = true);
|
||||
void Brush_ResetFaceOriginals(brush_t *b);
|
||||
brush_t* Brush_Parse (void);
|
||||
face_t* Brush_Ray (vec3_t origin, vec3_t dir, brush_t *b, float *dist);
|
||||
void Brush_RemoveFromList (brush_t *b);
|
||||
void Brush_SplitBrushByFace (brush_t *in, face_t *f, brush_t **front, brush_t **back);
|
||||
void Brush_SelectFaceForDragging (brush_t *b, face_t *f, qboolean shear);
|
||||
void Brush_SetTexture (brush_t *b, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef=NULL );
|
||||
void Brush_SideSelect (brush_t *b, vec3_t origin, vec3_t dir, qboolean shear);
|
||||
void Brush_SnapToGrid(brush_t *pb);
|
||||
void Brush_Rotate(brush_t *b, vec3_t vAngle, vec3_t vOrigin, bool bBuild = true);
|
||||
void Brush_MakeSidedSphere(int sides);
|
||||
void Brush_Write (brush_t *b, FILE *f);
|
||||
void Brush_Write (brush_t *b, CMemFile* pMemFile);
|
||||
void Brush_RemoveEmptyFaces ( brush_t *b );
|
||||
winding_t* Brush_MakeFaceWinding (brush_t *b, face_t *face);
|
||||
|
||||
int AddPlanept (float *f);
|
||||
float SetShadeForPlane (plane_t *p);
|
||||
|
||||
face_t* Face_Alloc( void );
|
||||
void Face_Free( face_t *f );
|
||||
face_t* Face_Clone (face_t *f);
|
||||
void Face_MakePlane (face_t *f);
|
||||
void Face_Draw( face_t *face );
|
||||
void Face_TextureVectors (face_t *f, float STfromXYZ[2][4]);
|
||||
void SetFaceTexdef (brush_t *b, face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef = NULL );
|
||||
|
||||
void Face_FitTexture( face_t * face, int nHeight, int nWidth );
|
||||
void Brush_FitTexture( brush_t *b, int nHeight, int nWidth );
|
||||
void Brush_SetEpair(brush_t *b, const char *pKey, const char *pValue);
|
||||
const char* Brush_GetKeyValue(brush_t *b, const char *pKey);
|
||||
brush_t *Brush_Alloc();
|
||||
const char* Brush_Name(brush_t *b);
|
||||
|
||||
// brush.h
|
||||
|
||||
// all types moved to qertypes.h
|
||||
//--typedef struct
|
||||
//--{
|
||||
//-- int numpoints;
|
||||
//-- int maxpoints;
|
||||
//-- float points[8][5]; // variable sized
|
||||
//--} winding_t;
|
||||
|
||||
|
||||
// the normals on planes point OUT of the brush
|
||||
//--#define MAXPOINTS 16
|
||||
//--typedef struct face_s
|
||||
//--{
|
||||
//-- struct face_s *next;
|
||||
//-- vec3_t planepts[3];
|
||||
//-- texdef_t texdef;
|
||||
//-- plane_t plane;
|
||||
//--
|
||||
//-- winding_t *face_winding;
|
||||
//--
|
||||
//-- vec3_t d_color;
|
||||
//-- qtexture_t *d_texture;
|
||||
//--
|
||||
//--} face_t;
|
||||
//--
|
||||
//--typedef struct {
|
||||
//-- vec3_t xyz;
|
||||
//-- float sideST[2];
|
||||
//-- float capST[2];
|
||||
//--} curveVertex_t;
|
||||
//--
|
||||
//--typedef struct {
|
||||
//-- curveVertex_t v[2];
|
||||
//--} sideVertex_t;
|
||||
//--
|
||||
//--typedef struct brush_s
|
||||
//--{
|
||||
//-- struct brush_s *prev, *next; // links in active/selected
|
||||
//-- struct brush_s *oprev, *onext; // links in entity
|
||||
//-- struct entity_s *owner;
|
||||
//-- vec3_t mins, maxs;
|
||||
//-- face_t *brush_faces;
|
||||
//--
|
||||
//-- qboolean bModelFailed;
|
||||
//-- //
|
||||
//-- // curve brush extensions
|
||||
//-- // all are derived from brush_faces
|
||||
//-- qboolean curveBrush;
|
||||
//-- qboolean patchBrush;
|
||||
//-- int nPatchID;
|
||||
//--} brush_t;
|
||||
|
||||
void Brush_AddToList (brush_t *b, brush_t *list);
|
||||
void Brush_Build(brush_t *b, bool bSnap = true, bool bMarkMap = true, bool bConvert = false);
|
||||
void Brush_BuildWindings( brush_t *b, bool bSnap = true );
|
||||
brush_t* Brush_Clone (brush_t *b);
|
||||
brush_t* Brush_FullClone(brush_t *b);
|
||||
brush_t* Brush_Create (vec3_t mins, vec3_t maxs, texdef_t *texdef);
|
||||
void Brush_Draw( brush_t *b );
|
||||
void Brush_DrawXY(brush_t *b, int nViewType);
|
||||
// set bRemoveNode to false to avoid trying to delete the item in group view tree control
|
||||
void Brush_Free (brush_t *b, bool bRemoveNode = true);
|
||||
int Brush_MemorySize(brush_t *b);
|
||||
void Brush_MakeSided (int sides);
|
||||
void Brush_MakeSidedCone (int sides);
|
||||
void Brush_Move (brush_t *b, const vec3_t move, bool bSnap = true);
|
||||
int Brush_MoveVertex(brush_t *b, vec3_t vertex, vec3_t delta, vec3_t end, bool bSnap = true);
|
||||
void Brush_ResetFaceOriginals(brush_t *b);
|
||||
brush_t* Brush_Parse (void);
|
||||
face_t* Brush_Ray (vec3_t origin, vec3_t dir, brush_t *b, float *dist);
|
||||
void Brush_RemoveFromList (brush_t *b);
|
||||
void Brush_SplitBrushByFace (brush_t *in, face_t *f, brush_t **front, brush_t **back);
|
||||
void Brush_SelectFaceForDragging (brush_t *b, face_t *f, qboolean shear);
|
||||
void Brush_SetTexture (brush_t *b, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef=NULL );
|
||||
void Brush_SideSelect (brush_t *b, vec3_t origin, vec3_t dir, qboolean shear);
|
||||
void Brush_SnapToGrid(brush_t *pb);
|
||||
void Brush_Rotate(brush_t *b, vec3_t vAngle, vec3_t vOrigin, bool bBuild = true);
|
||||
void Brush_MakeSidedSphere(int sides);
|
||||
void Brush_Write (brush_t *b, FILE *f);
|
||||
void Brush_Write (brush_t *b, CMemFile* pMemFile);
|
||||
void Brush_RemoveEmptyFaces ( brush_t *b );
|
||||
winding_t* Brush_MakeFaceWinding (brush_t *b, face_t *face);
|
||||
|
||||
int AddPlanept (float *f);
|
||||
float SetShadeForPlane (plane_t *p);
|
||||
|
||||
face_t* Face_Alloc( void );
|
||||
void Face_Free( face_t *f );
|
||||
face_t* Face_Clone (face_t *f);
|
||||
void Face_MakePlane (face_t *f);
|
||||
void Face_Draw( face_t *face );
|
||||
void Face_TextureVectors (face_t *f, float STfromXYZ[2][4]);
|
||||
void SetFaceTexdef (brush_t *b, face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef = NULL );
|
||||
|
||||
void Face_FitTexture( face_t * face, int nHeight, int nWidth );
|
||||
void Brush_FitTexture( brush_t *b, int nHeight, int nWidth );
|
||||
void Brush_SetEpair(brush_t *b, const char *pKey, const char *pValue);
|
||||
const char* Brush_GetKeyValue(brush_t *b, const char *pKey);
|
||||
brush_t *Brush_Alloc();
|
||||
const char* Brush_Name(brush_t *b);
|
||||
|
|
|
|||
188
q3radiant/BSInput.cpp
Normal file → Executable file
188
q3radiant/BSInput.cpp
Normal file → Executable file
|
|
@ -19,97 +19,97 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// BSInput.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "BSInput.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBSInput dialog
|
||||
|
||||
|
||||
CBSInput::CBSInput(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CBSInput::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CBSInput)
|
||||
m_fField1 = 0.0f;
|
||||
m_fField2 = 0.0f;
|
||||
m_fField3 = 0.0f;
|
||||
m_fField4 = 0.0f;
|
||||
m_fField5 = 0.0f;
|
||||
m_strField1 = _T("");
|
||||
m_strField2 = _T("");
|
||||
m_strField3 = _T("");
|
||||
m_strField4 = _T("");
|
||||
m_strField5 = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CBSInput::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CBSInput)
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD1, m_fField1);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD2, m_fField2);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD3, m_fField3);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD4, m_fField4);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD5, m_fField5);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD1, m_strField1);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD2, m_strField2);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD3, m_strField3);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD4, m_strField4);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD5, m_strField5);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CBSInput, CDialog)
|
||||
//{{AFX_MSG_MAP(CBSInput)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBSInput message handlers
|
||||
|
||||
BOOL CBSInput::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
if (m_strField1.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD1)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD1)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField2.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD2)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD2)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField3.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD3)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD3)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField4.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD4)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD4)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField5.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD5)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD5)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
// BSInput.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "BSInput.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBSInput dialog
|
||||
|
||||
|
||||
CBSInput::CBSInput(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CBSInput::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CBSInput)
|
||||
m_fField1 = 0.0f;
|
||||
m_fField2 = 0.0f;
|
||||
m_fField3 = 0.0f;
|
||||
m_fField4 = 0.0f;
|
||||
m_fField5 = 0.0f;
|
||||
m_strField1 = _T("");
|
||||
m_strField2 = _T("");
|
||||
m_strField3 = _T("");
|
||||
m_strField4 = _T("");
|
||||
m_strField5 = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CBSInput::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CBSInput)
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD1, m_fField1);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD2, m_fField2);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD3, m_fField3);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD4, m_fField4);
|
||||
DDX_Text(pDX, IDC_EDIT_FIELD5, m_fField5);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD1, m_strField1);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD2, m_strField2);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD3, m_strField3);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD4, m_strField4);
|
||||
DDX_Text(pDX, IDC_STATIC_FIELD5, m_strField5);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CBSInput, CDialog)
|
||||
//{{AFX_MSG_MAP(CBSInput)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBSInput message handlers
|
||||
|
||||
BOOL CBSInput::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
if (m_strField1.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD1)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD1)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField2.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD2)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD2)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField3.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD3)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD3)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField4.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD4)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD4)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
if (m_strField5.GetLength() == 0)
|
||||
{
|
||||
GetDlgItem(IDC_EDIT_FIELD5)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_FIELD5)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
|
|
|||
110
q3radiant/BSInput.h
Normal file → Executable file
110
q3radiant/BSInput.h
Normal file → Executable file
|
|
@ -19,58 +19,58 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_BSINPUT_H__81DF2A32_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_BSINPUT_H__81DF2A32_A552_11D1_B58E_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// BSInput.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBSInput dialog
|
||||
|
||||
class CBSInput : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CBSInput(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CBSInput)
|
||||
enum { IDD = IDD_DIALOG_INPUT };
|
||||
float m_fField1;
|
||||
float m_fField2;
|
||||
float m_fField3;
|
||||
float m_fField4;
|
||||
float m_fField5;
|
||||
CString m_strField1;
|
||||
CString m_strField2;
|
||||
CString m_strField3;
|
||||
CString m_strField4;
|
||||
CString m_strField5;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CBSInput)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CBSInput)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_BSINPUT_H__81DF2A32_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_BSINPUT_H__81DF2A32_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_BSINPUT_H__81DF2A32_A552_11D1_B58E_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// BSInput.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBSInput dialog
|
||||
|
||||
class CBSInput : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CBSInput(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CBSInput)
|
||||
enum { IDD = IDD_DIALOG_INPUT };
|
||||
float m_fField1;
|
||||
float m_fField2;
|
||||
float m_fField3;
|
||||
float m_fField4;
|
||||
float m_fField5;
|
||||
CString m_strField1;
|
||||
CString m_strField2;
|
||||
CString m_strField3;
|
||||
CString m_strField4;
|
||||
CString m_strField5;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CBSInput)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CBSInput)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_BSINPUT_H__81DF2A32_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
716
q3radiant/BSPFILE.H
Normal file → Executable file
716
q3radiant/BSPFILE.H
Normal file → Executable file
|
|
@ -19,361 +19,361 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
|
||||
// upper design bounds
|
||||
// leaffaces, leafbrushes, planes, and verts are still bounded by
|
||||
// 16 bit short limits
|
||||
#define MAX_MAP_MODELS 1024
|
||||
#define MAX_MAP_BRUSHES 8192
|
||||
#define MAX_MAP_ENTITIES 2048
|
||||
#define MAX_MAP_PATHS 2048
|
||||
#define MAX_MAP_ENTSTRING 0x20000
|
||||
#define MAX_MAP_TEXTURES 1024
|
||||
#define MAX_MAP_TEXINFO 8192
|
||||
|
||||
#define MAX_MAP_PLANES 65536
|
||||
#define MAX_MAP_NODES 65536
|
||||
#define MAX_MAP_BRUSHSIDES 65536
|
||||
#define MAX_MAP_LEAFS 65536
|
||||
#define MAX_MAP_VERTS 65536
|
||||
#define MAX_MAP_FACES 65536
|
||||
#define MAX_MAP_LEAFFACES 65536
|
||||
#define MAX_MAP_LEAFBRUSHES 65536
|
||||
#define MAX_MAP_PORTALS 65536
|
||||
#define MAX_MAP_EDGES 128000
|
||||
#define MAX_MAP_SURFEDGES 256000
|
||||
#define MAX_MAP_MIPTEX 0x200000
|
||||
#define MAX_MAP_LIGHTING 0x200000
|
||||
#define MAX_MAP_VISIBILITY 0x100000
|
||||
|
||||
// key / value pair sizes
|
||||
|
||||
#define MAX_KEY 32
|
||||
#define MAX_VALUE 1024
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#define BSPVERSION 34
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int fileofs, filelen;
|
||||
} lump_t;
|
||||
|
||||
#define LUMP_ENTITIES 0
|
||||
#define LUMP_PLANES 1
|
||||
#define LUMP_TEXTURES 2
|
||||
#define LUMP_VERTEXES 3
|
||||
#define LUMP_VISIBILITY 4
|
||||
#define LUMP_NODES 5
|
||||
#define LUMP_TEXINFO 6
|
||||
#define LUMP_FACES 7
|
||||
#define LUMP_LIGHTING 8
|
||||
#define LUMP_LEAFS 9
|
||||
#define LUMP_LEAFFACES 10
|
||||
#define LUMP_LEAFBRUSHES 11
|
||||
#define LUMP_EDGES 12
|
||||
#define LUMP_SURFEDGES 13
|
||||
#define LUMP_MODELS 14
|
||||
#define LUMP_PATHS 15
|
||||
#define LUMP_BRUSHES 16
|
||||
#define LUMP_BRUSHSIDES 17
|
||||
#define LUMP_POP 18
|
||||
|
||||
#define HEADER_LUMPS 18
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
} dheader_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float mins[3], maxs[3];
|
||||
float origin[3]; // for sounds or lights
|
||||
int headnode;
|
||||
int visleafs; // not including the solid leaf 0
|
||||
int firstface, numfaces;
|
||||
} dmodel_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nummiptex;
|
||||
int dataofs[4]; // [nummiptex]
|
||||
} dmiptexlump_t;
|
||||
|
||||
#define MIPLEVELS 4
|
||||
typedef struct miptex_s
|
||||
{
|
||||
char name[16];
|
||||
unsigned width, height;
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
int flags;
|
||||
int value;
|
||||
} miptex_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float point[3];
|
||||
} dvertex_t;
|
||||
|
||||
|
||||
// 0-2 are axial planes
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
|
||||
// 3-5 are non-axial planes snapped to the nearest
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
// planes (x&~1) and (x&~1)+1 are allways opposites
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate
|
||||
} dplane_t;
|
||||
|
||||
|
||||
// contents flags are seperate bits
|
||||
// a given brush can contribute multiple content bits
|
||||
// multiple brushes can be in a single leaf
|
||||
|
||||
// lower bits are stronger, and will eat weaker brushes completely
|
||||
#define CONTENTS_SOLID 1 // an eye is never valid in a solid
|
||||
#define CONTENTS_WINDOW 2 // translucent, but not watery
|
||||
#define CONTENTS_LAVA 8
|
||||
#define CONTENTS_SLIME 16
|
||||
#define CONTENTS_WATER 32
|
||||
#define CONTENTS_THINWATER 64 // translucent faces
|
||||
|
||||
#define LAST_VISIBLE_CONTENTS 64
|
||||
|
||||
// remaining contents are non-visible, and don't eat brushes
|
||||
#define CONTENTS_MONSTER 128
|
||||
#define CONTENTS_PLAYERCLIP 256
|
||||
#define CONTENTS_MONSTERCLIP 512
|
||||
|
||||
|
||||
// currents can be added to any other contents, and may be mixed
|
||||
#define CONTENTS_CURRENT_0 1024
|
||||
#define CONTENTS_CURRENT_90 2048
|
||||
#define CONTENTS_CURRENT_180 4096
|
||||
#define CONTENTS_CURRENT_270 8192
|
||||
#define CONTENTS_CURRENT_UP 16384
|
||||
#define CONTENTS_CURRENT_DOWN 32768
|
||||
|
||||
#define CONTENTS_ORIGIN 65536 // removed before processing
|
||||
|
||||
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
int planenum;
|
||||
int children[2]; // negative numbers are -(leafs+1), not nodes
|
||||
short mins[3]; // for frustom culling
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces; // counting both sides
|
||||
} dnode_t;
|
||||
|
||||
typedef struct texinfo_s
|
||||
{
|
||||
float vecs[2][4]; // [s/t][xyz offset]
|
||||
int miptex;
|
||||
int flags; // miptex flags + overrides
|
||||
int value; // light emition, etc
|
||||
} texinfo_t;
|
||||
|
||||
#define TEX_SPECIAL 1 // sky or slime, no lightmap or 256 subdivision
|
||||
#define SURF_LIGHT 2
|
||||
|
||||
#define SURF_WATER 4
|
||||
#define SURF_SLIME 8
|
||||
#define SURF_LAVA 16
|
||||
#define SURF_WINDOW 32
|
||||
|
||||
#define SURF_SKY 64
|
||||
#define SURF_MIRROR 128
|
||||
|
||||
#define SURF_SLIPPERY 256
|
||||
|
||||
// note that edge 0 is never used, because negative edge nums are used for
|
||||
// counterclockwise use of the edge in a face
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2]; // vertex numbers
|
||||
} dedge_t;
|
||||
|
||||
#define MAXLIGHTMAPS 4
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum;
|
||||
short side;
|
||||
|
||||
int firstedge; // we must support > 64k edges
|
||||
short numedges;
|
||||
short texinfo;
|
||||
|
||||
// lighting info
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int lightofs; // start of [numstyles*surfsize] samples
|
||||
} dface_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int contents; // OR of all brushes
|
||||
int visofs; // -1 = no visibility info
|
||||
|
||||
short mins[3]; // for frustum culling
|
||||
short maxs[3];
|
||||
|
||||
unsigned short firstleafface;
|
||||
unsigned short numleaffaces;
|
||||
|
||||
unsigned short firstleafbrush;
|
||||
unsigned short numleafbrushes;
|
||||
} dleaf_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum; // facing out of the leaf
|
||||
short texinfo;
|
||||
} dbrushside_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int firstside;
|
||||
int numsides;
|
||||
int contents;
|
||||
} dbrush_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float origin[3];
|
||||
float angles[3];
|
||||
int next, prev;
|
||||
int flags;
|
||||
float speed;
|
||||
} dpath_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
#ifndef QUAKE_GAME
|
||||
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
|
||||
|
||||
// the utilities get to be lazy and just use large static arrays
|
||||
|
||||
extern int nummodels;
|
||||
extern dmodel_t dmodels[MAX_MAP_MODELS];
|
||||
|
||||
extern int visdatasize;
|
||||
extern byte dvisdata[MAX_MAP_VISIBILITY];
|
||||
|
||||
extern int lightdatasize;
|
||||
extern byte dlightdata[MAX_MAP_LIGHTING];
|
||||
|
||||
extern int texdatasize;
|
||||
extern byte dtexdata[MAX_MAP_MIPTEX]; // (dmiptexlump_t)
|
||||
|
||||
extern int entdatasize;
|
||||
extern char dentdata[MAX_MAP_ENTSTRING];
|
||||
|
||||
extern int numleafs;
|
||||
extern dleaf_t dleafs[MAX_MAP_LEAFS];
|
||||
|
||||
extern int numplanes;
|
||||
extern dplane_t dplanes[MAX_MAP_PLANES];
|
||||
|
||||
extern int numvertexes;
|
||||
extern dvertex_t dvertexes[MAX_MAP_VERTS];
|
||||
|
||||
extern int numnodes;
|
||||
extern dnode_t dnodes[MAX_MAP_NODES];
|
||||
|
||||
extern int numtexinfo;
|
||||
extern texinfo_t texinfo[MAX_MAP_TEXINFO];
|
||||
|
||||
extern int numfaces;
|
||||
extern dface_t dfaces[MAX_MAP_FACES];
|
||||
|
||||
extern int numedges;
|
||||
extern dedge_t dedges[MAX_MAP_EDGES];
|
||||
|
||||
extern int numleaffaces;
|
||||
extern unsigned short dleaffaces[MAX_MAP_LEAFFACES];
|
||||
|
||||
extern int numleafbrushes;
|
||||
extern unsigned short dleafbrushes[MAX_MAP_LEAFBRUSHES];
|
||||
|
||||
extern int numsurfedges;
|
||||
extern int dsurfedges[MAX_MAP_SURFEDGES];
|
||||
|
||||
extern int numpaths;
|
||||
extern dpath_t dpaths[MAX_MAP_PATHS];
|
||||
|
||||
extern int numbrushes;
|
||||
extern dbrush_t dbrushes[MAX_MAP_BRUSHES];
|
||||
|
||||
extern int numbrushsides;
|
||||
extern dbrushside_t dbrushsides[MAX_MAP_BRUSHSIDES];
|
||||
|
||||
|
||||
void DecompressVis (byte *in, byte *decompressed);
|
||||
int CompressVis (byte *vis, byte *dest);
|
||||
|
||||
void LoadBSPFile (char *filename);
|
||||
void WriteBSPFile (char *filename);
|
||||
void PrintBSPFileSizes (void);
|
||||
|
||||
//===============
|
||||
|
||||
|
||||
typedef struct epair_s
|
||||
{
|
||||
struct epair_s *next;
|
||||
char *key;
|
||||
char *value;
|
||||
} epair_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t origin;
|
||||
int firstbrush;
|
||||
int numbrushes;
|
||||
epair_t *epairs;
|
||||
} entity_t;
|
||||
|
||||
extern int num_entities;
|
||||
extern entity_t entities[MAX_MAP_ENTITIES];
|
||||
|
||||
void ParseEntities (void);
|
||||
void UnparseEntities (void);
|
||||
|
||||
void SetKeyValue (entity_t *ent, char *key, char *value);
|
||||
char *ValueForKey (entity_t *ent, char *key);
|
||||
// will return "" if not present
|
||||
|
||||
vec_t FloatForKey (entity_t *ent, char *key);
|
||||
void GetVectorForKey (entity_t *ent, char *key, vec3_t vec);
|
||||
|
||||
epair_t *ParseEpair (void);
|
||||
|
||||
void PrintEntity (entity_t *ent);
|
||||
|
||||
extern int r_leaftovis[MAX_MAP_LEAFS];
|
||||
extern int r_vistoleaf[MAX_MAP_LEAFS];
|
||||
extern int r_numvisleafs;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// upper design bounds
|
||||
// leaffaces, leafbrushes, planes, and verts are still bounded by
|
||||
// 16 bit short limits
|
||||
#define MAX_MAP_MODELS 1024
|
||||
#define MAX_MAP_BRUSHES 8192
|
||||
#define MAX_MAP_ENTITIES 2048
|
||||
#define MAX_MAP_PATHS 2048
|
||||
#define MAX_MAP_ENTSTRING 0x20000
|
||||
#define MAX_MAP_TEXTURES 1024
|
||||
#define MAX_MAP_TEXINFO 8192
|
||||
|
||||
#define MAX_MAP_PLANES 65536
|
||||
#define MAX_MAP_NODES 65536
|
||||
#define MAX_MAP_BRUSHSIDES 65536
|
||||
#define MAX_MAP_LEAFS 65536
|
||||
#define MAX_MAP_VERTS 65536
|
||||
#define MAX_MAP_FACES 65536
|
||||
#define MAX_MAP_LEAFFACES 65536
|
||||
#define MAX_MAP_LEAFBRUSHES 65536
|
||||
#define MAX_MAP_PORTALS 65536
|
||||
#define MAX_MAP_EDGES 128000
|
||||
#define MAX_MAP_SURFEDGES 256000
|
||||
#define MAX_MAP_MIPTEX 0x200000
|
||||
#define MAX_MAP_LIGHTING 0x200000
|
||||
#define MAX_MAP_VISIBILITY 0x100000
|
||||
|
||||
// key / value pair sizes
|
||||
|
||||
#define MAX_KEY 32
|
||||
#define MAX_VALUE 1024
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#define BSPVERSION 34
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int fileofs, filelen;
|
||||
} lump_t;
|
||||
|
||||
#define LUMP_ENTITIES 0
|
||||
#define LUMP_PLANES 1
|
||||
#define LUMP_TEXTURES 2
|
||||
#define LUMP_VERTEXES 3
|
||||
#define LUMP_VISIBILITY 4
|
||||
#define LUMP_NODES 5
|
||||
#define LUMP_TEXINFO 6
|
||||
#define LUMP_FACES 7
|
||||
#define LUMP_LIGHTING 8
|
||||
#define LUMP_LEAFS 9
|
||||
#define LUMP_LEAFFACES 10
|
||||
#define LUMP_LEAFBRUSHES 11
|
||||
#define LUMP_EDGES 12
|
||||
#define LUMP_SURFEDGES 13
|
||||
#define LUMP_MODELS 14
|
||||
#define LUMP_PATHS 15
|
||||
#define LUMP_BRUSHES 16
|
||||
#define LUMP_BRUSHSIDES 17
|
||||
#define LUMP_POP 18
|
||||
|
||||
#define HEADER_LUMPS 18
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
} dheader_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float mins[3], maxs[3];
|
||||
float origin[3]; // for sounds or lights
|
||||
int headnode;
|
||||
int visleafs; // not including the solid leaf 0
|
||||
int firstface, numfaces;
|
||||
} dmodel_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nummiptex;
|
||||
int dataofs[4]; // [nummiptex]
|
||||
} dmiptexlump_t;
|
||||
|
||||
#define MIPLEVELS 4
|
||||
typedef struct miptex_s
|
||||
{
|
||||
char name[16];
|
||||
unsigned width, height;
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
int flags;
|
||||
int value;
|
||||
} miptex_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float point[3];
|
||||
} dvertex_t;
|
||||
|
||||
|
||||
// 0-2 are axial planes
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
|
||||
// 3-5 are non-axial planes snapped to the nearest
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
// planes (x&~1) and (x&~1)+1 are allways opposites
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate
|
||||
} dplane_t;
|
||||
|
||||
|
||||
// contents flags are seperate bits
|
||||
// a given brush can contribute multiple content bits
|
||||
// multiple brushes can be in a single leaf
|
||||
|
||||
// lower bits are stronger, and will eat weaker brushes completely
|
||||
#define CONTENTS_SOLID 1 // an eye is never valid in a solid
|
||||
#define CONTENTS_WINDOW 2 // translucent, but not watery
|
||||
#define CONTENTS_LAVA 8
|
||||
#define CONTENTS_SLIME 16
|
||||
#define CONTENTS_WATER 32
|
||||
#define CONTENTS_THINWATER 64 // translucent faces
|
||||
|
||||
#define LAST_VISIBLE_CONTENTS 64
|
||||
|
||||
// remaining contents are non-visible, and don't eat brushes
|
||||
#define CONTENTS_MONSTER 128
|
||||
#define CONTENTS_PLAYERCLIP 256
|
||||
#define CONTENTS_MONSTERCLIP 512
|
||||
|
||||
|
||||
// currents can be added to any other contents, and may be mixed
|
||||
#define CONTENTS_CURRENT_0 1024
|
||||
#define CONTENTS_CURRENT_90 2048
|
||||
#define CONTENTS_CURRENT_180 4096
|
||||
#define CONTENTS_CURRENT_270 8192
|
||||
#define CONTENTS_CURRENT_UP 16384
|
||||
#define CONTENTS_CURRENT_DOWN 32768
|
||||
|
||||
#define CONTENTS_ORIGIN 65536 // removed before processing
|
||||
|
||||
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
int planenum;
|
||||
int children[2]; // negative numbers are -(leafs+1), not nodes
|
||||
short mins[3]; // for frustom culling
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces; // counting both sides
|
||||
} dnode_t;
|
||||
|
||||
typedef struct texinfo_s
|
||||
{
|
||||
float vecs[2][4]; // [s/t][xyz offset]
|
||||
int miptex;
|
||||
int flags; // miptex flags + overrides
|
||||
int value; // light emition, etc
|
||||
} texinfo_t;
|
||||
|
||||
#define TEX_SPECIAL 1 // sky or slime, no lightmap or 256 subdivision
|
||||
#define SURF_LIGHT 2
|
||||
|
||||
#define SURF_WATER 4
|
||||
#define SURF_SLIME 8
|
||||
#define SURF_LAVA 16
|
||||
#define SURF_WINDOW 32
|
||||
|
||||
#define SURF_SKY 64
|
||||
#define SURF_MIRROR 128
|
||||
|
||||
#define SURF_SLIPPERY 256
|
||||
|
||||
// note that edge 0 is never used, because negative edge nums are used for
|
||||
// counterclockwise use of the edge in a face
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2]; // vertex numbers
|
||||
} dedge_t;
|
||||
|
||||
#define MAXLIGHTMAPS 4
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum;
|
||||
short side;
|
||||
|
||||
int firstedge; // we must support > 64k edges
|
||||
short numedges;
|
||||
short texinfo;
|
||||
|
||||
// lighting info
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int lightofs; // start of [numstyles*surfsize] samples
|
||||
} dface_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int contents; // OR of all brushes
|
||||
int visofs; // -1 = no visibility info
|
||||
|
||||
short mins[3]; // for frustum culling
|
||||
short maxs[3];
|
||||
|
||||
unsigned short firstleafface;
|
||||
unsigned short numleaffaces;
|
||||
|
||||
unsigned short firstleafbrush;
|
||||
unsigned short numleafbrushes;
|
||||
} dleaf_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum; // facing out of the leaf
|
||||
short texinfo;
|
||||
} dbrushside_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int firstside;
|
||||
int numsides;
|
||||
int contents;
|
||||
} dbrush_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float origin[3];
|
||||
float angles[3];
|
||||
int next, prev;
|
||||
int flags;
|
||||
float speed;
|
||||
} dpath_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
#ifndef QUAKE_GAME
|
||||
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
|
||||
|
||||
// the utilities get to be lazy and just use large static arrays
|
||||
|
||||
extern int nummodels;
|
||||
extern dmodel_t dmodels[MAX_MAP_MODELS];
|
||||
|
||||
extern int visdatasize;
|
||||
extern byte dvisdata[MAX_MAP_VISIBILITY];
|
||||
|
||||
extern int lightdatasize;
|
||||
extern byte dlightdata[MAX_MAP_LIGHTING];
|
||||
|
||||
extern int texdatasize;
|
||||
extern byte dtexdata[MAX_MAP_MIPTEX]; // (dmiptexlump_t)
|
||||
|
||||
extern int entdatasize;
|
||||
extern char dentdata[MAX_MAP_ENTSTRING];
|
||||
|
||||
extern int numleafs;
|
||||
extern dleaf_t dleafs[MAX_MAP_LEAFS];
|
||||
|
||||
extern int numplanes;
|
||||
extern dplane_t dplanes[MAX_MAP_PLANES];
|
||||
|
||||
extern int numvertexes;
|
||||
extern dvertex_t dvertexes[MAX_MAP_VERTS];
|
||||
|
||||
extern int numnodes;
|
||||
extern dnode_t dnodes[MAX_MAP_NODES];
|
||||
|
||||
extern int numtexinfo;
|
||||
extern texinfo_t texinfo[MAX_MAP_TEXINFO];
|
||||
|
||||
extern int numfaces;
|
||||
extern dface_t dfaces[MAX_MAP_FACES];
|
||||
|
||||
extern int numedges;
|
||||
extern dedge_t dedges[MAX_MAP_EDGES];
|
||||
|
||||
extern int numleaffaces;
|
||||
extern unsigned short dleaffaces[MAX_MAP_LEAFFACES];
|
||||
|
||||
extern int numleafbrushes;
|
||||
extern unsigned short dleafbrushes[MAX_MAP_LEAFBRUSHES];
|
||||
|
||||
extern int numsurfedges;
|
||||
extern int dsurfedges[MAX_MAP_SURFEDGES];
|
||||
|
||||
extern int numpaths;
|
||||
extern dpath_t dpaths[MAX_MAP_PATHS];
|
||||
|
||||
extern int numbrushes;
|
||||
extern dbrush_t dbrushes[MAX_MAP_BRUSHES];
|
||||
|
||||
extern int numbrushsides;
|
||||
extern dbrushside_t dbrushsides[MAX_MAP_BRUSHSIDES];
|
||||
|
||||
|
||||
void DecompressVis (byte *in, byte *decompressed);
|
||||
int CompressVis (byte *vis, byte *dest);
|
||||
|
||||
void LoadBSPFile (char *filename);
|
||||
void WriteBSPFile (char *filename);
|
||||
void PrintBSPFileSizes (void);
|
||||
|
||||
//===============
|
||||
|
||||
|
||||
typedef struct epair_s
|
||||
{
|
||||
struct epair_s *next;
|
||||
char *key;
|
||||
char *value;
|
||||
} epair_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t origin;
|
||||
int firstbrush;
|
||||
int numbrushes;
|
||||
epair_t *epairs;
|
||||
} entity_t;
|
||||
|
||||
extern int num_entities;
|
||||
extern entity_t entities[MAX_MAP_ENTITIES];
|
||||
|
||||
void ParseEntities (void);
|
||||
void UnparseEntities (void);
|
||||
|
||||
void SetKeyValue (entity_t *ent, char *key, char *value);
|
||||
char *ValueForKey (entity_t *ent, char *key);
|
||||
// will return "" if not present
|
||||
|
||||
vec_t FloatForKey (entity_t *ent, char *key);
|
||||
void GetVectorForKey (entity_t *ent, char *key, vec3_t vec);
|
||||
|
||||
epair_t *ParseEpair (void);
|
||||
|
||||
void PrintEntity (entity_t *ent);
|
||||
|
||||
extern int r_leaftovis[MAX_MAP_LEAFS];
|
||||
extern int r_vistoleaf[MAX_MAP_LEAFS];
|
||||
extern int r_numvisleafs;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
792
q3radiant/Bmp.cpp
Normal file → Executable file
792
q3radiant/Bmp.cpp
Normal file → Executable file
|
|
@ -19,399 +19,399 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bmp.h"
|
||||
|
||||
|
||||
void Error(char *fmt, ...);
|
||||
|
||||
|
||||
static int GetColorCount(int nbits)
|
||||
{
|
||||
int ncolors = 0;
|
||||
|
||||
if (nbits < 24)
|
||||
{
|
||||
ncolors = 1 << nbits;
|
||||
}
|
||||
|
||||
return(ncolors);
|
||||
}
|
||||
|
||||
|
||||
static void BMPLineNone(FILE *f, char *sline, int pixbytes, int width)
|
||||
{
|
||||
int nbytes, i, k, j;
|
||||
|
||||
switch (pixbytes)
|
||||
{
|
||||
case 1 :
|
||||
nbytes = (width + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fread(sline, width, 1, f);
|
||||
nbytes -= width;
|
||||
|
||||
while (nbytes-- > 0) fgetc(f);
|
||||
return;
|
||||
|
||||
case 3 :
|
||||
nbytes = ((width * 3) + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fread(sline, width, 3, f);
|
||||
nbytes -= width * 3;
|
||||
|
||||
while (nbytes-- > 0) fgetc(f);
|
||||
|
||||
// reorder bgr to rgb
|
||||
for (i = 0, j = 0; i < width; i++, j += 3)
|
||||
{
|
||||
k = sline[j];
|
||||
sline[j] = sline[j+2];
|
||||
sline[j+2] = k;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Error("BMPLineNone failed.");
|
||||
}
|
||||
|
||||
|
||||
static void BMPLineRLE8(FILE *f, char *sline, int pixbytes, int width)
|
||||
{
|
||||
Error("RLE8 not yet supported.");
|
||||
}
|
||||
|
||||
|
||||
static void BMPLineRLE4(FILE *f, char *sline, int pixbytes, int width)
|
||||
{
|
||||
Error("RLE4 not yet supported.");
|
||||
}
|
||||
|
||||
|
||||
static void BMPLine(FILE *f, char *scanline, int pixbytes, int width, int rle)
|
||||
{
|
||||
switch (rle)
|
||||
{
|
||||
case xBI_NONE : BMPLineNone(f, scanline, pixbytes, width); return;
|
||||
case xBI_RLE8 : BMPLineRLE8(f, scanline, pixbytes, width); return;
|
||||
case xBI_RLE4 : BMPLineRLE4(f, scanline, pixbytes, width); return;
|
||||
}
|
||||
|
||||
Error("Unknown compression type.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void PrintHeader(binfo_t *b)
|
||||
{
|
||||
printf("biSize : %ld\n", b->biSize);
|
||||
printf("biWidth : %ld\n", b->biWidth);
|
||||
printf("biHeight : %ld\n", b->biHeight);
|
||||
printf("biPlanes : %d\n", b->biPlanes);
|
||||
printf("biBitCount : %d\n", b->biBitCount);
|
||||
printf("biCompression : %ld\n", b->biCompression);
|
||||
printf("biSizeImage : %ld\n", b->biSizeImage);
|
||||
printf("biXPelsPerMeter: %ld\n", b->biXPelsPerMeter);
|
||||
printf("biYPelsPerMeter: %ld\n", b->biYPelsPerMeter);
|
||||
printf("biClrUsed : %ld\n", b->biClrUsed);
|
||||
printf("biClrImportant : %ld\n", b->biClrImportant);
|
||||
}
|
||||
|
||||
|
||||
void LoadBMP(char *filename, bitmap_t *bit)
|
||||
{
|
||||
FILE *f;
|
||||
bmphd_t bhd;
|
||||
binfo_t info;
|
||||
int pxlsize = 1;
|
||||
int rowbytes, i, pixbytes;
|
||||
char *scanline;
|
||||
|
||||
// open file
|
||||
if ((f = fopen(filename, "rb")) == NULL)
|
||||
{
|
||||
Error("Unable to open %s.", filename);
|
||||
}
|
||||
|
||||
// read in bitmap header
|
||||
if (fread(&bhd, sizeof(bhd), 1, f) != 1)
|
||||
{
|
||||
fclose(f);
|
||||
Error("Unable to read in bitmap header.");
|
||||
}
|
||||
|
||||
// make sure we have a valid bitmap file
|
||||
if (bhd.bfType != BMP_SIGNATURE_WORD)
|
||||
{
|
||||
fclose(f);
|
||||
Error("Invalid BMP file: %s", filename);
|
||||
}
|
||||
|
||||
// load in info header
|
||||
if (fread(&info, sizeof(info), 1, f) != 1)
|
||||
{
|
||||
fclose(f);
|
||||
Error("Unable to read bitmap info header.");
|
||||
}
|
||||
|
||||
// make sure this is an info type of bitmap
|
||||
if (info.biSize != sizeof(binfo_t))
|
||||
{
|
||||
fclose(f);
|
||||
Error("We only support the info bitmap type.");
|
||||
}
|
||||
|
||||
// PrintHeader(&info);
|
||||
|
||||
bit->bpp = info.biBitCount;
|
||||
bit->width = info.biWidth;
|
||||
bit->height = info.biHeight;
|
||||
bit->data = NULL;
|
||||
bit->palette = NULL;
|
||||
|
||||
//currently we only read in 8 and 24 bit bmp files
|
||||
if (info.biBitCount == 8) pixbytes = 1;
|
||||
else if (info.biBitCount == 24) pixbytes = 3;
|
||||
else
|
||||
{
|
||||
Error("BPP %d not supported.", info.biBitCount);
|
||||
}
|
||||
|
||||
// if this is an eight bit image load palette
|
||||
if (pixbytes == 1)
|
||||
{
|
||||
drgb_t q;
|
||||
|
||||
bit->palette = reinterpret_cast<rgb_t*>(malloc(sizeof(rgb_t) * 256));
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
if (fread(&q, sizeof(drgb_t), 1, f) != 1)
|
||||
{
|
||||
fclose(f); free(bit->palette);
|
||||
Error("Unable to read palette.");
|
||||
}
|
||||
|
||||
bit->palette[i].r = q.red;
|
||||
bit->palette[i].g = q.green;
|
||||
bit->palette[i].b = q.blue;
|
||||
}
|
||||
}
|
||||
|
||||
// position to start of bitmap
|
||||
fseek(f, bhd.bfOffBits, SEEK_SET);
|
||||
|
||||
// create scanline to read data into
|
||||
rowbytes = ((info.biWidth * pixbytes) + 3) / 4;
|
||||
rowbytes *= 4;
|
||||
|
||||
scanline = reinterpret_cast<char*>(malloc(rowbytes));
|
||||
|
||||
// alloc space for new bitmap
|
||||
bit->data = reinterpret_cast<unsigned char*>(malloc(info.biWidth * pixbytes * info.biHeight));
|
||||
|
||||
// read in image
|
||||
for (i = 0; i < info.biHeight; i++)
|
||||
{
|
||||
BMPLine(f, scanline, pixbytes, info.biWidth, info.biCompression);
|
||||
|
||||
// store line
|
||||
memcpy(&bit->data[info.biWidth * pixbytes * (info.biHeight - i - 1)], scanline, info.biWidth * pixbytes);
|
||||
}
|
||||
|
||||
free(scanline);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void BMPEncodeLine(FILE *f, unsigned char *data, int npxls, int pixbytes)
|
||||
{
|
||||
int nbytes, i, j, k;
|
||||
|
||||
switch (pixbytes)
|
||||
{
|
||||
case 1 :
|
||||
nbytes = (npxls + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fwrite(data, npxls, 1, f);
|
||||
nbytes -= npxls;
|
||||
|
||||
while (nbytes-- > 0) fputc(0, f);
|
||||
return;
|
||||
|
||||
case 3 :
|
||||
// reorder rgb to bgr
|
||||
for (i = 0, j = 0; i < npxls; i++, j+= 3)
|
||||
{
|
||||
k = data[j];
|
||||
data[j] = data[j + 2];
|
||||
data[j + 2] = k;
|
||||
}
|
||||
|
||||
nbytes = ((npxls * 3) + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fwrite(data, npxls, 3, f);
|
||||
nbytes -= npxls * 3;
|
||||
|
||||
while (nbytes-- > 0) fputc(0, f);
|
||||
return;
|
||||
}
|
||||
|
||||
Error("BMPEncodeLine Failed.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void WriteBMP(char *filename, bitmap_t *bit)
|
||||
{
|
||||
FILE *f;
|
||||
bmphd_t header;
|
||||
binfo_t info;
|
||||
drgb_t q; // palette that gets written
|
||||
long bmofs;
|
||||
int w, h, i;
|
||||
int pixbytes;
|
||||
|
||||
if (bit->bpp == 8) pixbytes = 1;
|
||||
else if (bit->bpp == 24) pixbytes = 3;
|
||||
|
||||
else
|
||||
{
|
||||
Error("BPP %d not supported.", bit->bpp);
|
||||
}
|
||||
|
||||
|
||||
if ((f = fopen(filename, "wb")) == NULL)
|
||||
{
|
||||
Error("Unable to open %s.", filename);
|
||||
}
|
||||
|
||||
// write out an empty header as a place holder
|
||||
if (fwrite(&header, sizeof(header), 1, f) != 1)
|
||||
{
|
||||
Error("Unable to fwrite.");
|
||||
}
|
||||
|
||||
// init and write info header
|
||||
info.biSize = sizeof(binfo_t);
|
||||
info.biWidth = bit->width;
|
||||
info.biHeight = bit->height;
|
||||
info.biPlanes = 1;
|
||||
info.biBitCount = bit->bpp;
|
||||
info.biCompression = xBI_NONE;
|
||||
info.biSizeImage = bit->width * bit->height;
|
||||
info.biXPelsPerMeter = 0;
|
||||
info.biYPelsPerMeter = 0;
|
||||
info.biClrUsed = 256;
|
||||
info.biClrImportant = 256;
|
||||
|
||||
if (fwrite(&info, sizeof(binfo_t), 1, f) != 1)
|
||||
{
|
||||
Error("fwrite failed.");
|
||||
}
|
||||
|
||||
// write out palette if we need to
|
||||
if (bit->bpp == 8)
|
||||
{
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
q.red = bit->palette[i].r;
|
||||
q.green = bit->palette[i].g;
|
||||
q.blue = bit->palette[i].b;
|
||||
|
||||
fwrite(&q, sizeof(q), 1, f);
|
||||
}
|
||||
}
|
||||
|
||||
// save offset to start of bitmap
|
||||
bmofs = ftell(f);
|
||||
|
||||
// output bitmap
|
||||
w = bit->width;
|
||||
h = bit->height;
|
||||
|
||||
for (i = h - 1; i >= 0; i--)
|
||||
{
|
||||
BMPEncodeLine(f, &bit->data[w * pixbytes * i], w, pixbytes);
|
||||
}
|
||||
|
||||
// update and rewrite file header
|
||||
header.bfType = BMP_SIGNATURE_WORD;
|
||||
header.bfSize = ftell(f);
|
||||
header.bfOffBits = bmofs;
|
||||
|
||||
fseek(f, 0L, SEEK_SET);
|
||||
fwrite(&header, sizeof(header), 1, f);
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
void NewBMP(int width, int height, int bpp, bitmap_t *bit)
|
||||
{
|
||||
int pixbytes;
|
||||
|
||||
if (bpp == 8) pixbytes = 1;
|
||||
else if (bpp == 24) pixbytes = 3;
|
||||
|
||||
else
|
||||
{
|
||||
Error("NewBMP: 8 or 24 bit only.");
|
||||
}
|
||||
|
||||
bit->bpp = bpp;
|
||||
bit->width = width;
|
||||
bit->height = height;
|
||||
|
||||
bit->data = reinterpret_cast<unsigned char*>(malloc(width * height * pixbytes));
|
||||
|
||||
if (bit->data == NULL)
|
||||
{
|
||||
Error("NewBMP: malloc failed.");
|
||||
}
|
||||
|
||||
// see if we need to create a palette
|
||||
if (pixbytes == 1)
|
||||
{
|
||||
bit->palette = (rgb_t *) malloc(768);
|
||||
|
||||
if (bit->palette == NULL)
|
||||
{
|
||||
Error("NewBMP: unable to malloc palette.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bit->palette = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FreeBMP(bitmap_t *bitmap)
|
||||
{
|
||||
if (bitmap->palette)
|
||||
{
|
||||
free(bitmap->palette);
|
||||
bitmap->palette = NULL;
|
||||
}
|
||||
|
||||
if (bitmap->data)
|
||||
{
|
||||
free(bitmap->data);
|
||||
bitmap->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bmp.h"
|
||||
|
||||
|
||||
void Error(char *fmt, ...);
|
||||
|
||||
|
||||
static int GetColorCount(int nbits)
|
||||
{
|
||||
int ncolors = 0;
|
||||
|
||||
if (nbits < 24)
|
||||
{
|
||||
ncolors = 1 << nbits;
|
||||
}
|
||||
|
||||
return(ncolors);
|
||||
}
|
||||
|
||||
|
||||
static void BMPLineNone(FILE *f, char *sline, int pixbytes, int width)
|
||||
{
|
||||
int nbytes, i, k, j;
|
||||
|
||||
switch (pixbytes)
|
||||
{
|
||||
case 1 :
|
||||
nbytes = (width + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fread(sline, width, 1, f);
|
||||
nbytes -= width;
|
||||
|
||||
while (nbytes-- > 0) fgetc(f);
|
||||
return;
|
||||
|
||||
case 3 :
|
||||
nbytes = ((width * 3) + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fread(sline, width, 3, f);
|
||||
nbytes -= width * 3;
|
||||
|
||||
while (nbytes-- > 0) fgetc(f);
|
||||
|
||||
// reorder bgr to rgb
|
||||
for (i = 0, j = 0; i < width; i++, j += 3)
|
||||
{
|
||||
k = sline[j];
|
||||
sline[j] = sline[j+2];
|
||||
sline[j+2] = k;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Error("BMPLineNone failed.");
|
||||
}
|
||||
|
||||
|
||||
static void BMPLineRLE8(FILE *f, char *sline, int pixbytes, int width)
|
||||
{
|
||||
Error("RLE8 not yet supported.");
|
||||
}
|
||||
|
||||
|
||||
static void BMPLineRLE4(FILE *f, char *sline, int pixbytes, int width)
|
||||
{
|
||||
Error("RLE4 not yet supported.");
|
||||
}
|
||||
|
||||
|
||||
static void BMPLine(FILE *f, char *scanline, int pixbytes, int width, int rle)
|
||||
{
|
||||
switch (rle)
|
||||
{
|
||||
case xBI_NONE : BMPLineNone(f, scanline, pixbytes, width); return;
|
||||
case xBI_RLE8 : BMPLineRLE8(f, scanline, pixbytes, width); return;
|
||||
case xBI_RLE4 : BMPLineRLE4(f, scanline, pixbytes, width); return;
|
||||
}
|
||||
|
||||
Error("Unknown compression type.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void PrintHeader(binfo_t *b)
|
||||
{
|
||||
printf("biSize : %ld\n", b->biSize);
|
||||
printf("biWidth : %ld\n", b->biWidth);
|
||||
printf("biHeight : %ld\n", b->biHeight);
|
||||
printf("biPlanes : %d\n", b->biPlanes);
|
||||
printf("biBitCount : %d\n", b->biBitCount);
|
||||
printf("biCompression : %ld\n", b->biCompression);
|
||||
printf("biSizeImage : %ld\n", b->biSizeImage);
|
||||
printf("biXPelsPerMeter: %ld\n", b->biXPelsPerMeter);
|
||||
printf("biYPelsPerMeter: %ld\n", b->biYPelsPerMeter);
|
||||
printf("biClrUsed : %ld\n", b->biClrUsed);
|
||||
printf("biClrImportant : %ld\n", b->biClrImportant);
|
||||
}
|
||||
|
||||
|
||||
void LoadBMP(char *filename, bitmap_t *bit)
|
||||
{
|
||||
FILE *f;
|
||||
bmphd_t bhd;
|
||||
binfo_t info;
|
||||
int pxlsize = 1;
|
||||
int rowbytes, i, pixbytes;
|
||||
char *scanline;
|
||||
|
||||
// open file
|
||||
if ((f = fopen(filename, "rb")) == NULL)
|
||||
{
|
||||
Error("Unable to open %s.", filename);
|
||||
}
|
||||
|
||||
// read in bitmap header
|
||||
if (fread(&bhd, sizeof(bhd), 1, f) != 1)
|
||||
{
|
||||
fclose(f);
|
||||
Error("Unable to read in bitmap header.");
|
||||
}
|
||||
|
||||
// make sure we have a valid bitmap file
|
||||
if (bhd.bfType != BMP_SIGNATURE_WORD)
|
||||
{
|
||||
fclose(f);
|
||||
Error("Invalid BMP file: %s", filename);
|
||||
}
|
||||
|
||||
// load in info header
|
||||
if (fread(&info, sizeof(info), 1, f) != 1)
|
||||
{
|
||||
fclose(f);
|
||||
Error("Unable to read bitmap info header.");
|
||||
}
|
||||
|
||||
// make sure this is an info type of bitmap
|
||||
if (info.biSize != sizeof(binfo_t))
|
||||
{
|
||||
fclose(f);
|
||||
Error("We only support the info bitmap type.");
|
||||
}
|
||||
|
||||
// PrintHeader(&info);
|
||||
|
||||
bit->bpp = info.biBitCount;
|
||||
bit->width = info.biWidth;
|
||||
bit->height = info.biHeight;
|
||||
bit->data = NULL;
|
||||
bit->palette = NULL;
|
||||
|
||||
//currently we only read in 8 and 24 bit bmp files
|
||||
if (info.biBitCount == 8) pixbytes = 1;
|
||||
else if (info.biBitCount == 24) pixbytes = 3;
|
||||
else
|
||||
{
|
||||
Error("BPP %d not supported.", info.biBitCount);
|
||||
}
|
||||
|
||||
// if this is an eight bit image load palette
|
||||
if (pixbytes == 1)
|
||||
{
|
||||
drgb_t q;
|
||||
|
||||
bit->palette = reinterpret_cast<rgb_t*>(malloc(sizeof(rgb_t) * 256));
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
if (fread(&q, sizeof(drgb_t), 1, f) != 1)
|
||||
{
|
||||
fclose(f); free(bit->palette);
|
||||
Error("Unable to read palette.");
|
||||
}
|
||||
|
||||
bit->palette[i].r = q.red;
|
||||
bit->palette[i].g = q.green;
|
||||
bit->palette[i].b = q.blue;
|
||||
}
|
||||
}
|
||||
|
||||
// position to start of bitmap
|
||||
fseek(f, bhd.bfOffBits, SEEK_SET);
|
||||
|
||||
// create scanline to read data into
|
||||
rowbytes = ((info.biWidth * pixbytes) + 3) / 4;
|
||||
rowbytes *= 4;
|
||||
|
||||
scanline = reinterpret_cast<char*>(malloc(rowbytes));
|
||||
|
||||
// alloc space for new bitmap
|
||||
bit->data = reinterpret_cast<unsigned char*>(malloc(info.biWidth * pixbytes * info.biHeight));
|
||||
|
||||
// read in image
|
||||
for (i = 0; i < info.biHeight; i++)
|
||||
{
|
||||
BMPLine(f, scanline, pixbytes, info.biWidth, info.biCompression);
|
||||
|
||||
// store line
|
||||
memcpy(&bit->data[info.biWidth * pixbytes * (info.biHeight - i - 1)], scanline, info.biWidth * pixbytes);
|
||||
}
|
||||
|
||||
free(scanline);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void BMPEncodeLine(FILE *f, unsigned char *data, int npxls, int pixbytes)
|
||||
{
|
||||
int nbytes, i, j, k;
|
||||
|
||||
switch (pixbytes)
|
||||
{
|
||||
case 1 :
|
||||
nbytes = (npxls + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fwrite(data, npxls, 1, f);
|
||||
nbytes -= npxls;
|
||||
|
||||
while (nbytes-- > 0) fputc(0, f);
|
||||
return;
|
||||
|
||||
case 3 :
|
||||
// reorder rgb to bgr
|
||||
for (i = 0, j = 0; i < npxls; i++, j+= 3)
|
||||
{
|
||||
k = data[j];
|
||||
data[j] = data[j + 2];
|
||||
data[j + 2] = k;
|
||||
}
|
||||
|
||||
nbytes = ((npxls * 3) + 3) / 4;
|
||||
nbytes *= 4;
|
||||
|
||||
fwrite(data, npxls, 3, f);
|
||||
nbytes -= npxls * 3;
|
||||
|
||||
while (nbytes-- > 0) fputc(0, f);
|
||||
return;
|
||||
}
|
||||
|
||||
Error("BMPEncodeLine Failed.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void WriteBMP(char *filename, bitmap_t *bit)
|
||||
{
|
||||
FILE *f;
|
||||
bmphd_t header;
|
||||
binfo_t info;
|
||||
drgb_t q; // palette that gets written
|
||||
long bmofs;
|
||||
int w, h, i;
|
||||
int pixbytes;
|
||||
|
||||
if (bit->bpp == 8) pixbytes = 1;
|
||||
else if (bit->bpp == 24) pixbytes = 3;
|
||||
|
||||
else
|
||||
{
|
||||
Error("BPP %d not supported.", bit->bpp);
|
||||
}
|
||||
|
||||
|
||||
if ((f = fopen(filename, "wb")) == NULL)
|
||||
{
|
||||
Error("Unable to open %s.", filename);
|
||||
}
|
||||
|
||||
// write out an empty header as a place holder
|
||||
if (fwrite(&header, sizeof(header), 1, f) != 1)
|
||||
{
|
||||
Error("Unable to fwrite.");
|
||||
}
|
||||
|
||||
// init and write info header
|
||||
info.biSize = sizeof(binfo_t);
|
||||
info.biWidth = bit->width;
|
||||
info.biHeight = bit->height;
|
||||
info.biPlanes = 1;
|
||||
info.biBitCount = bit->bpp;
|
||||
info.biCompression = xBI_NONE;
|
||||
info.biSizeImage = bit->width * bit->height;
|
||||
info.biXPelsPerMeter = 0;
|
||||
info.biYPelsPerMeter = 0;
|
||||
info.biClrUsed = 256;
|
||||
info.biClrImportant = 256;
|
||||
|
||||
if (fwrite(&info, sizeof(binfo_t), 1, f) != 1)
|
||||
{
|
||||
Error("fwrite failed.");
|
||||
}
|
||||
|
||||
// write out palette if we need to
|
||||
if (bit->bpp == 8)
|
||||
{
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
q.red = bit->palette[i].r;
|
||||
q.green = bit->palette[i].g;
|
||||
q.blue = bit->palette[i].b;
|
||||
|
||||
fwrite(&q, sizeof(q), 1, f);
|
||||
}
|
||||
}
|
||||
|
||||
// save offset to start of bitmap
|
||||
bmofs = ftell(f);
|
||||
|
||||
// output bitmap
|
||||
w = bit->width;
|
||||
h = bit->height;
|
||||
|
||||
for (i = h - 1; i >= 0; i--)
|
||||
{
|
||||
BMPEncodeLine(f, &bit->data[w * pixbytes * i], w, pixbytes);
|
||||
}
|
||||
|
||||
// update and rewrite file header
|
||||
header.bfType = BMP_SIGNATURE_WORD;
|
||||
header.bfSize = ftell(f);
|
||||
header.bfOffBits = bmofs;
|
||||
|
||||
fseek(f, 0L, SEEK_SET);
|
||||
fwrite(&header, sizeof(header), 1, f);
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
void NewBMP(int width, int height, int bpp, bitmap_t *bit)
|
||||
{
|
||||
int pixbytes;
|
||||
|
||||
if (bpp == 8) pixbytes = 1;
|
||||
else if (bpp == 24) pixbytes = 3;
|
||||
|
||||
else
|
||||
{
|
||||
Error("NewBMP: 8 or 24 bit only.");
|
||||
}
|
||||
|
||||
bit->bpp = bpp;
|
||||
bit->width = width;
|
||||
bit->height = height;
|
||||
|
||||
bit->data = reinterpret_cast<unsigned char*>(malloc(width * height * pixbytes));
|
||||
|
||||
if (bit->data == NULL)
|
||||
{
|
||||
Error("NewBMP: malloc failed.");
|
||||
}
|
||||
|
||||
// see if we need to create a palette
|
||||
if (pixbytes == 1)
|
||||
{
|
||||
bit->palette = (rgb_t *) malloc(768);
|
||||
|
||||
if (bit->palette == NULL)
|
||||
{
|
||||
Error("NewBMP: unable to malloc palette.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bit->palette = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FreeBMP(bitmap_t *bitmap)
|
||||
{
|
||||
if (bitmap->palette)
|
||||
{
|
||||
free(bitmap->palette);
|
||||
bitmap->palette = NULL;
|
||||
}
|
||||
|
||||
if (bitmap->data)
|
||||
{
|
||||
free(bitmap->data);
|
||||
bitmap->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
9148
q3radiant/Brush.cpp
Normal file → Executable file
9148
q3radiant/Brush.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load diff
1302
q3radiant/BrushScript.cpp
Normal file → Executable file
1302
q3radiant/BrushScript.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load diff
60
q3radiant/CAMERA.H
Normal file → Executable file
60
q3radiant/CAMERA.H
Normal file → Executable file
|
|
@ -19,33 +19,33 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// window system independent camera view code
|
||||
|
||||
typedef enum
|
||||
{
|
||||
cd_wire,
|
||||
cd_solid,
|
||||
cd_texture,
|
||||
cd_light,
|
||||
cd_blend
|
||||
} camera_draw_mode;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width, height;
|
||||
|
||||
qboolean timing;
|
||||
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
|
||||
camera_draw_mode draw_mode;
|
||||
|
||||
vec3_t color; // background
|
||||
|
||||
vec3_t forward, right, up; // move matrix
|
||||
|
||||
vec3_t vup, vpn, vright; // view matrix
|
||||
} camera_t;
|
||||
|
||||
|
||||
// window system independent camera view code
|
||||
|
||||
typedef enum
|
||||
{
|
||||
cd_wire,
|
||||
cd_solid,
|
||||
cd_texture,
|
||||
cd_light,
|
||||
cd_blend
|
||||
} camera_draw_mode;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width, height;
|
||||
|
||||
qboolean timing;
|
||||
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
|
||||
camera_draw_mode draw_mode;
|
||||
|
||||
vec3_t color; // background
|
||||
|
||||
vec3_t forward, right, up; // move matrix
|
||||
|
||||
vec3_t vup, vpn, vright; // view matrix
|
||||
} camera_t;
|
||||
|
||||
|
|
|
|||
1330
q3radiant/CSG.CPP
Normal file → Executable file
1330
q3radiant/CSG.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
2288
q3radiant/CamWnd.cpp
Normal file → Executable file
2288
q3radiant/CamWnd.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load diff
198
q3radiant/CamWnd.h
Normal file → Executable file
198
q3radiant/CamWnd.h
Normal file → Executable file
|
|
@ -19,102 +19,102 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// CamWnd.h : header file
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCamWnd window
|
||||
class CXYWnd;
|
||||
|
||||
class CCamWnd : public CWnd
|
||||
{
|
||||
DECLARE_DYNCREATE(CCamWnd);
|
||||
// Construction
|
||||
public:
|
||||
CCamWnd();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCamWnd)
|
||||
protected:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
void ShiftTexture_BrushPrimit(face_t *f, int x, int y);
|
||||
void ReInitGL();
|
||||
void BenchMark();
|
||||
CXYWnd* m_pXYFriend;
|
||||
void SetXYFriend(CXYWnd* pWnd);
|
||||
virtual ~CCamWnd();
|
||||
camera_t& Camera(){return m_Camera;};
|
||||
void Cam_MouseControl(float dtime);
|
||||
void Cam_ChangeFloor(qboolean up);
|
||||
|
||||
protected:
|
||||
void Cam_Init();
|
||||
void Cam_BuildMatrix();
|
||||
void Cam_PositionDrag();
|
||||
void Cam_MouseDown(int x, int y, int buttons);
|
||||
void Cam_MouseUp (int x, int y, int buttons);
|
||||
void Cam_MouseMoved (int x, int y, int buttons);
|
||||
void InitCull();
|
||||
qboolean CullBrush (brush_t *b);
|
||||
void Cam_Draw();
|
||||
|
||||
|
||||
brush_t* m_TransBrushes[MAX_MAP_BRUSHES];
|
||||
int m_nNumTransBrushes;
|
||||
camera_t m_Camera;
|
||||
int m_nCambuttonstate;
|
||||
CPoint m_ptButton;
|
||||
CPoint m_ptCursor;
|
||||
CPoint m_ptLastCursor;
|
||||
face_t* m_pSide_select;
|
||||
vec3_t m_vCull1;
|
||||
vec3_t m_vCull2;
|
||||
int m_nCullv1[3];
|
||||
int m_nCullv2[3];
|
||||
bool m_bClipMode;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
void OriginalMouseDown(UINT nFlags, CPoint point);
|
||||
void OriginalMouseUp(UINT nFlags, CPoint point);
|
||||
//{{AFX_MSG(CCamWnd)
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// CamWnd.h : header file
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCamWnd window
|
||||
class CXYWnd;
|
||||
|
||||
class CCamWnd : public CWnd
|
||||
{
|
||||
DECLARE_DYNCREATE(CCamWnd);
|
||||
// Construction
|
||||
public:
|
||||
CCamWnd();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCamWnd)
|
||||
protected:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
void ShiftTexture_BrushPrimit(face_t *f, int x, int y);
|
||||
void ReInitGL();
|
||||
void BenchMark();
|
||||
CXYWnd* m_pXYFriend;
|
||||
void SetXYFriend(CXYWnd* pWnd);
|
||||
virtual ~CCamWnd();
|
||||
camera_t& Camera(){return m_Camera;};
|
||||
void Cam_MouseControl(float dtime);
|
||||
void Cam_ChangeFloor(qboolean up);
|
||||
|
||||
protected:
|
||||
void Cam_Init();
|
||||
void Cam_BuildMatrix();
|
||||
void Cam_PositionDrag();
|
||||
void Cam_MouseDown(int x, int y, int buttons);
|
||||
void Cam_MouseUp (int x, int y, int buttons);
|
||||
void Cam_MouseMoved (int x, int y, int buttons);
|
||||
void InitCull();
|
||||
qboolean CullBrush (brush_t *b);
|
||||
void Cam_Draw();
|
||||
|
||||
|
||||
brush_t* m_TransBrushes[MAX_MAP_BRUSHES];
|
||||
int m_nNumTransBrushes;
|
||||
camera_t m_Camera;
|
||||
int m_nCambuttonstate;
|
||||
CPoint m_ptButton;
|
||||
CPoint m_ptCursor;
|
||||
CPoint m_ptLastCursor;
|
||||
face_t* m_pSide_select;
|
||||
vec3_t m_vCull1;
|
||||
vec3_t m_vCull2;
|
||||
int m_nCullv1[3];
|
||||
int m_nCullv2[3];
|
||||
bool m_bClipMode;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
void OriginalMouseDown(UINT nFlags, CPoint point);
|
||||
void OriginalMouseUp(UINT nFlags, CPoint point);
|
||||
//{{AFX_MSG(CCamWnd)
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CAMWND_H__44B4BA03_781B_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
86
q3radiant/CapDialog.cpp
Normal file → Executable file
86
q3radiant/CapDialog.cpp
Normal file → Executable file
|
|
@ -19,46 +19,46 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// CapDialog.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "CapDialog.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCapDialog dialog
|
||||
|
||||
|
||||
CCapDialog::CCapDialog(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CCapDialog::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CCapDialog)
|
||||
m_nCap = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CCapDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CCapDialog)
|
||||
DDX_Radio(pDX, IDC_RADIO_CAP, m_nCap);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCapDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CCapDialog)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCapDialog message handlers
|
||||
// CapDialog.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "CapDialog.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCapDialog dialog
|
||||
|
||||
|
||||
CCapDialog::CCapDialog(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CCapDialog::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CCapDialog)
|
||||
m_nCap = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CCapDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CCapDialog)
|
||||
DDX_Radio(pDX, IDC_RADIO_CAP, m_nCap);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCapDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CCapDialog)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCapDialog message handlers
|
||||
|
|
|
|||
96
q3radiant/CapDialog.h
Normal file → Executable file
96
q3radiant/CapDialog.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_CAPDIALOG_H__10637162_2BD2_11D2_B030_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_CAPDIALOG_H__10637162_2BD2_11D2_B030_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// CapDialog.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCapDialog dialog
|
||||
|
||||
class CCapDialog : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
static enum {BEVEL = 0, ENDCAP, IBEVEL, IENDCAP};
|
||||
CCapDialog(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
int getCapType() {return m_nCap;};
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CCapDialog)
|
||||
enum { IDD = IDD_DIALOG_CAP };
|
||||
int m_nCap;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCapDialog)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CCapDialog)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CAPDIALOG_H__10637162_2BD2_11D2_B030_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_CAPDIALOG_H__10637162_2BD2_11D2_B030_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_CAPDIALOG_H__10637162_2BD2_11D2_B030_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// CapDialog.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCapDialog dialog
|
||||
|
||||
class CCapDialog : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
static enum {BEVEL = 0, ENDCAP, IBEVEL, IENDCAP};
|
||||
CCapDialog(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
int getCapType() {return m_nCap;};
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CCapDialog)
|
||||
enum { IDD = IDD_DIALOG_CAP };
|
||||
int m_nCap;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCapDialog)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CCapDialog)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CAPDIALOG_H__10637162_2BD2_11D2_B030_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
176
q3radiant/CharBuffer.h
Normal file → Executable file
176
q3radiant/CharBuffer.h
Normal file → Executable file
|
|
@ -19,91 +19,91 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#ifndef __CHARBUFFER_HPP
|
||||
#define __CHARBUFFER_HPP
|
||||
|
||||
class CCharBuffer
|
||||
{
|
||||
char* m_pCharBuffer;
|
||||
unsigned m_uSize;
|
||||
|
||||
public:
|
||||
CCharBuffer();
|
||||
|
||||
CCharBuffer(unsigned uSize);
|
||||
|
||||
CCharBuffer(const char* pString);
|
||||
|
||||
CCharBuffer(const CCharBuffer& rhs);
|
||||
|
||||
~CCharBuffer();
|
||||
|
||||
char* Allocate(uint uSize);
|
||||
|
||||
void DeAllocate();
|
||||
|
||||
size_t StringLength()
|
||||
{ return strlen(m_pCharBuffer); }
|
||||
|
||||
void StripTrailing(char c, int nLen);
|
||||
|
||||
char& operator *()
|
||||
{ return *m_pCharBuffer; }
|
||||
|
||||
char& operator *() const
|
||||
{ return *const_cast<CCharBuffer*>(this)->m_pCharBuffer; }
|
||||
|
||||
operator void*()
|
||||
{ return m_pCharBuffer; }
|
||||
|
||||
operator char*()
|
||||
{ return m_pCharBuffer; }
|
||||
|
||||
operator const char*()
|
||||
{ return reinterpret_cast<const char*>(m_pCharBuffer); }
|
||||
|
||||
operator unsigned char*()
|
||||
{ return reinterpret_cast<unsigned char*>(m_pCharBuffer); }
|
||||
|
||||
operator const unsigned char*()
|
||||
{ return reinterpret_cast<const unsigned char*>(m_pCharBuffer); }
|
||||
|
||||
unsigned SizeOf()
|
||||
{ return m_uSize; }
|
||||
|
||||
CCharBuffer& operator =(const CCharBuffer& rhs);
|
||||
|
||||
CCharBuffer& operator =(const char* pString);
|
||||
|
||||
bool operator ==(const CCharBuffer& rhs) const
|
||||
{ return strcmp(m_pCharBuffer, rhs.m_pCharBuffer) == 0; }
|
||||
|
||||
bool operator ==(char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) == 0; }
|
||||
|
||||
bool operator ==(const char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) == 0; }
|
||||
|
||||
bool operator !=(CCharBuffer& rhs) const
|
||||
{ return strcmp(m_pCharBuffer, rhs.m_pCharBuffer) != 0; }
|
||||
|
||||
bool operator !=(char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) != 0; }
|
||||
|
||||
bool operator !=(const char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) != 0; }
|
||||
|
||||
char& operator [](int nIndex)
|
||||
{ return m_pCharBuffer[nIndex]; }
|
||||
|
||||
char& operator [](int nIndex) const
|
||||
{ return m_pCharBuffer[nIndex]; }
|
||||
|
||||
char* Fill(char FillChar)
|
||||
{ memset(m_pCharBuffer, FillChar, m_uSize-1); return m_pCharBuffer; }
|
||||
};
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif // __CCHARBUFFER_HPP
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
#ifndef __CHARBUFFER_HPP
|
||||
#define __CHARBUFFER_HPP
|
||||
|
||||
class CCharBuffer
|
||||
{
|
||||
char* m_pCharBuffer;
|
||||
unsigned m_uSize;
|
||||
|
||||
public:
|
||||
CCharBuffer();
|
||||
|
||||
CCharBuffer(unsigned uSize);
|
||||
|
||||
CCharBuffer(const char* pString);
|
||||
|
||||
CCharBuffer(const CCharBuffer& rhs);
|
||||
|
||||
~CCharBuffer();
|
||||
|
||||
char* Allocate(uint uSize);
|
||||
|
||||
void DeAllocate();
|
||||
|
||||
size_t StringLength()
|
||||
{ return strlen(m_pCharBuffer); }
|
||||
|
||||
void StripTrailing(char c, int nLen);
|
||||
|
||||
char& operator *()
|
||||
{ return *m_pCharBuffer; }
|
||||
|
||||
char& operator *() const
|
||||
{ return *const_cast<CCharBuffer*>(this)->m_pCharBuffer; }
|
||||
|
||||
operator void*()
|
||||
{ return m_pCharBuffer; }
|
||||
|
||||
operator char*()
|
||||
{ return m_pCharBuffer; }
|
||||
|
||||
operator const char*()
|
||||
{ return reinterpret_cast<const char*>(m_pCharBuffer); }
|
||||
|
||||
operator unsigned char*()
|
||||
{ return reinterpret_cast<unsigned char*>(m_pCharBuffer); }
|
||||
|
||||
operator const unsigned char*()
|
||||
{ return reinterpret_cast<const unsigned char*>(m_pCharBuffer); }
|
||||
|
||||
unsigned SizeOf()
|
||||
{ return m_uSize; }
|
||||
|
||||
CCharBuffer& operator =(const CCharBuffer& rhs);
|
||||
|
||||
CCharBuffer& operator =(const char* pString);
|
||||
|
||||
bool operator ==(const CCharBuffer& rhs) const
|
||||
{ return strcmp(m_pCharBuffer, rhs.m_pCharBuffer) == 0; }
|
||||
|
||||
bool operator ==(char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) == 0; }
|
||||
|
||||
bool operator ==(const char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) == 0; }
|
||||
|
||||
bool operator !=(CCharBuffer& rhs) const
|
||||
{ return strcmp(m_pCharBuffer, rhs.m_pCharBuffer) != 0; }
|
||||
|
||||
bool operator !=(char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) != 0; }
|
||||
|
||||
bool operator !=(const char* pString) const
|
||||
{ return strcmp(m_pCharBuffer, pString) != 0; }
|
||||
|
||||
char& operator [](int nIndex)
|
||||
{ return m_pCharBuffer[nIndex]; }
|
||||
|
||||
char& operator [](int nIndex) const
|
||||
{ return m_pCharBuffer[nIndex]; }
|
||||
|
||||
char* Fill(char FillChar)
|
||||
{ memset(m_pCharBuffer, FillChar, m_uSize-1); return m_pCharBuffer; }
|
||||
};
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif // __CCHARBUFFER_HPP
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
|||
130
q3radiant/ChildFrm.cpp
Normal file → Executable file
130
q3radiant/ChildFrm.cpp
Normal file → Executable file
|
|
@ -19,68 +19,68 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// ChildFrm.cpp : implementation of the CChildFrame class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
|
||||
#include "ChildFrm.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame
|
||||
|
||||
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
|
||||
//{{AFX_MSG_MAP(CChildFrame)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame construction/destruction
|
||||
|
||||
CChildFrame::CChildFrame()
|
||||
{
|
||||
// TODO: add member initialization code here
|
||||
|
||||
}
|
||||
|
||||
CChildFrame::~CChildFrame()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
// TODO: Modify the Window class or styles here by modifying
|
||||
// the CREATESTRUCT cs
|
||||
|
||||
return CMDIChildWnd::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CChildFrame::AssertValid() const
|
||||
{
|
||||
CMDIChildWnd::AssertValid();
|
||||
}
|
||||
|
||||
void CChildFrame::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CMDIChildWnd::Dump(dc);
|
||||
}
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame message handlers
|
||||
// ChildFrm.cpp : implementation of the CChildFrame class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
|
||||
#include "ChildFrm.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame
|
||||
|
||||
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
|
||||
//{{AFX_MSG_MAP(CChildFrame)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame construction/destruction
|
||||
|
||||
CChildFrame::CChildFrame()
|
||||
{
|
||||
// TODO: add member initialization code here
|
||||
|
||||
}
|
||||
|
||||
CChildFrame::~CChildFrame()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
// TODO: Modify the Window class or styles here by modifying
|
||||
// the CREATESTRUCT cs
|
||||
|
||||
return CMDIChildWnd::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CChildFrame::AssertValid() const
|
||||
{
|
||||
CMDIChildWnd::AssertValid();
|
||||
}
|
||||
|
||||
void CChildFrame::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CMDIChildWnd::Dump(dc);
|
||||
}
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CChildFrame message handlers
|
||||
|
|
|
|||
104
q3radiant/ChildFrm.h
Normal file → Executable file
104
q3radiant/ChildFrm.h
Normal file → Executable file
|
|
@ -19,55 +19,55 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// ChildFrm.h : interface of the CChildFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CHILDFRM_H__330BBF0C_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_CHILDFRM_H__330BBF0C_731C_11D1_B539_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CChildFrame : public CMDIChildWnd
|
||||
{
|
||||
DECLARE_DYNCREATE(CChildFrame)
|
||||
public:
|
||||
CChildFrame();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CChildFrame)
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CChildFrame();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CChildFrame)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CHILDFRM_H__330BBF0C_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
// ChildFrm.h : interface of the CChildFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CHILDFRM_H__330BBF0C_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_CHILDFRM_H__330BBF0C_731C_11D1_B539_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CChildFrame : public CMDIChildWnd
|
||||
{
|
||||
DECLARE_DYNCREATE(CChildFrame)
|
||||
public:
|
||||
CChildFrame();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CChildFrame)
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CChildFrame();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CChildFrame)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CHILDFRM_H__330BBF0C_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
176
q3radiant/CommandsDlg.cpp
Normal file → Executable file
176
q3radiant/CommandsDlg.cpp
Normal file → Executable file
|
|
@ -19,91 +19,91 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// CommandsDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "CommandsDlg.h"
|
||||
#include "MainFrm.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCommandsDlg dialog
|
||||
|
||||
|
||||
CCommandsDlg::CCommandsDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CCommandsDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CCommandsDlg)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CCommandsDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CCommandsDlg)
|
||||
DDX_Control(pDX, IDC_LIST_COMMANDS, m_lstCommands);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCommandsDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CCommandsDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCommandsDlg message handlers
|
||||
|
||||
BOOL CCommandsDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
m_lstCommands.SetTabStops(96);
|
||||
int nCount = g_nCommandCount;
|
||||
|
||||
CFile fileout;
|
||||
fileout.Open("c:/commandlist.txt", CFile::modeCreate | CFile::modeWrite);
|
||||
for (int n = 0; n < nCount; n++)
|
||||
{
|
||||
CString strLine;
|
||||
char c = g_Commands[n].m_nKey;
|
||||
CString strKeys = c;
|
||||
for (int k = 0; k < g_nKeyCount; k++)
|
||||
{
|
||||
if (g_Keys[k].m_nVKKey == g_Commands[n].m_nKey)
|
||||
{
|
||||
strKeys = g_Keys[k].m_strName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
CString strMod("");
|
||||
if (g_Commands[n].m_nModifiers & RAD_SHIFT)
|
||||
strMod = "Shift";
|
||||
if (g_Commands[n].m_nModifiers & RAD_ALT)
|
||||
strMod += (strMod.GetLength() > 0) ? " + Alt" : "Alt";
|
||||
if (g_Commands[n].m_nModifiers & RAD_CONTROL)
|
||||
strMod += (strMod.GetLength() > 0) ? " + Control" : "Control";
|
||||
if (strMod.GetLength() > 0)
|
||||
{
|
||||
strMod += " + ";
|
||||
}
|
||||
strLine.Format("%s \t%s%s", g_Commands[n].m_strCommand, strMod, strKeys);
|
||||
m_lstCommands.AddString(strLine);
|
||||
|
||||
strLine.Format("%s \t\t\t%s%s", g_Commands[n].m_strCommand, strMod, strKeys);
|
||||
|
||||
fileout.Write(strLine, strLine.GetLength());
|
||||
fileout.Write("\r\n", 2);
|
||||
}
|
||||
fileout.Close();
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
// CommandsDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "CommandsDlg.h"
|
||||
#include "MainFrm.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCommandsDlg dialog
|
||||
|
||||
|
||||
CCommandsDlg::CCommandsDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CCommandsDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CCommandsDlg)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CCommandsDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CCommandsDlg)
|
||||
DDX_Control(pDX, IDC_LIST_COMMANDS, m_lstCommands);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCommandsDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CCommandsDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCommandsDlg message handlers
|
||||
|
||||
BOOL CCommandsDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
m_lstCommands.SetTabStops(96);
|
||||
int nCount = g_nCommandCount;
|
||||
|
||||
CFile fileout;
|
||||
fileout.Open("c:/commandlist.txt", CFile::modeCreate | CFile::modeWrite);
|
||||
for (int n = 0; n < nCount; n++)
|
||||
{
|
||||
CString strLine;
|
||||
char c = g_Commands[n].m_nKey;
|
||||
CString strKeys = c;
|
||||
for (int k = 0; k < g_nKeyCount; k++)
|
||||
{
|
||||
if (g_Keys[k].m_nVKKey == g_Commands[n].m_nKey)
|
||||
{
|
||||
strKeys = g_Keys[k].m_strName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
CString strMod("");
|
||||
if (g_Commands[n].m_nModifiers & RAD_SHIFT)
|
||||
strMod = "Shift";
|
||||
if (g_Commands[n].m_nModifiers & RAD_ALT)
|
||||
strMod += (strMod.GetLength() > 0) ? " + Alt" : "Alt";
|
||||
if (g_Commands[n].m_nModifiers & RAD_CONTROL)
|
||||
strMod += (strMod.GetLength() > 0) ? " + Control" : "Control";
|
||||
if (strMod.GetLength() > 0)
|
||||
{
|
||||
strMod += " + ";
|
||||
}
|
||||
strLine.Format("%s \t%s%s", g_Commands[n].m_strCommand, strMod, strKeys);
|
||||
m_lstCommands.AddString(strLine);
|
||||
|
||||
strLine.Format("%s \t\t\t%s%s", g_Commands[n].m_strCommand, strMod, strKeys);
|
||||
|
||||
fileout.Write(strLine, strLine.GetLength());
|
||||
fileout.Write("\r\n", 2);
|
||||
}
|
||||
fileout.Close();
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
|
|
|||
92
q3radiant/CommandsDlg.h
Normal file → Executable file
92
q3radiant/CommandsDlg.h
Normal file → Executable file
|
|
@ -19,49 +19,49 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_COMMANDSDLG_H__C80F6E42_8531_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_COMMANDSDLG_H__C80F6E42_8531_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// CommandsDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCommandsDlg dialog
|
||||
|
||||
class CCommandsDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CCommandsDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CCommandsDlg)
|
||||
enum { IDD = IDD_DLG_COMMANDLIST };
|
||||
CListBox m_lstCommands;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCommandsDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CCommandsDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_COMMANDSDLG_H__C80F6E42_8531_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_COMMANDSDLG_H__C80F6E42_8531_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_COMMANDSDLG_H__C80F6E42_8531_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// CommandsDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCommandsDlg dialog
|
||||
|
||||
class CCommandsDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CCommandsDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CCommandsDlg)
|
||||
enum { IDD = IDD_DLG_COMMANDLIST };
|
||||
CListBox m_lstCommands;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCommandsDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CCommandsDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_COMMANDSDLG_H__C80F6E42_8531_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
1614
q3radiant/DRAG.CPP
Normal file → Executable file
1614
q3radiant/DRAG.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
146
q3radiant/DialogInfo.cpp
Normal file → Executable file
146
q3radiant/DialogInfo.cpp
Normal file → Executable file
|
|
@ -19,76 +19,76 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// DialogInfo.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "DialogInfo.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInfo dialog
|
||||
CDialogInfo g_dlgInfo;
|
||||
|
||||
void ShowInfoDialog(const char* pText)
|
||||
{
|
||||
if (g_dlgInfo.GetSafeHwnd())
|
||||
{
|
||||
g_dlgInfo.m_wndInfo.SetWindowText(pText);
|
||||
g_dlgInfo.ShowWindow(SW_SHOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_dlgInfo.Create(IDD_DLG_INFORMATION);
|
||||
g_dlgInfo.m_wndInfo.SetWindowText(pText);
|
||||
g_dlgInfo.ShowWindow(SW_SHOW);
|
||||
}
|
||||
g_pParentWnd->SetFocus();
|
||||
}
|
||||
|
||||
void HideInfoDialog()
|
||||
{
|
||||
if (g_dlgInfo.GetSafeHwnd())
|
||||
g_dlgInfo.ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
|
||||
CDialogInfo::CDialogInfo(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDialogInfo::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDialogInfo)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDialogInfo::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDialogInfo)
|
||||
DDX_Control(pDX, IDC_EDIT1, m_wndInfo);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDialogInfo, CDialog)
|
||||
//{{AFX_MSG_MAP(CDialogInfo)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInfo message handlers
|
||||
|
||||
BOOL CDialogInfo::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
// DialogInfo.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "DialogInfo.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInfo dialog
|
||||
CDialogInfo g_dlgInfo;
|
||||
|
||||
void ShowInfoDialog(const char* pText)
|
||||
{
|
||||
if (g_dlgInfo.GetSafeHwnd())
|
||||
{
|
||||
g_dlgInfo.m_wndInfo.SetWindowText(pText);
|
||||
g_dlgInfo.ShowWindow(SW_SHOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_dlgInfo.Create(IDD_DLG_INFORMATION);
|
||||
g_dlgInfo.m_wndInfo.SetWindowText(pText);
|
||||
g_dlgInfo.ShowWindow(SW_SHOW);
|
||||
}
|
||||
g_pParentWnd->SetFocus();
|
||||
}
|
||||
|
||||
void HideInfoDialog()
|
||||
{
|
||||
if (g_dlgInfo.GetSafeHwnd())
|
||||
g_dlgInfo.ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
|
||||
CDialogInfo::CDialogInfo(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDialogInfo::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDialogInfo)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDialogInfo::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDialogInfo)
|
||||
DDX_Control(pDX, IDC_EDIT1, m_wndInfo);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDialogInfo, CDialog)
|
||||
//{{AFX_MSG_MAP(CDialogInfo)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInfo message handlers
|
||||
|
||||
BOOL CDialogInfo::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
|
|
|||
96
q3radiant/DialogInfo.h
Normal file → Executable file
96
q3radiant/DialogInfo.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// DialogInfo.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInfo dialog
|
||||
void HideInfoDialog();
|
||||
void ShowInfoDialog(const char* pText);
|
||||
|
||||
class CDialogInfo : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDialogInfo(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDialogInfo)
|
||||
enum { IDD = IDD_DLG_INFORMATION };
|
||||
CEdit m_wndInfo;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDialogInfo)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDialogInfo)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// DialogInfo.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInfo dialog
|
||||
void HideInfoDialog();
|
||||
void ShowInfoDialog(const char* pText);
|
||||
|
||||
class CDialogInfo : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDialogInfo(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDialogInfo)
|
||||
enum { IDD = IDD_DLG_INFORMATION };
|
||||
CEdit m_wndInfo;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDialogInfo)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDialogInfo)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
136
q3radiant/DialogTextures.cpp
Normal file → Executable file
136
q3radiant/DialogTextures.cpp
Normal file → Executable file
|
|
@ -19,71 +19,71 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// DialogTextures.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "DialogTextures.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogTextures dialog
|
||||
|
||||
|
||||
CDialogTextures::CDialogTextures(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDialogTextures::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDialogTextures)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDialogTextures::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDialogTextures)
|
||||
DDX_Control(pDX, IDC_LIST_TEXTURES, m_wndList);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDialogTextures, CDialog)
|
||||
//{{AFX_MSG_MAP(CDialogTextures)
|
||||
ON_LBN_DBLCLK(IDC_LIST_TEXTURES, OnDblclkListTextures)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogTextures message handlers
|
||||
|
||||
void CDialogTextures::OnOK()
|
||||
{
|
||||
m_nSelection = m_wndList.GetCurSel();
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CDialogTextures::OnDblclkListTextures()
|
||||
{
|
||||
OnOK();
|
||||
}
|
||||
|
||||
BOOL CDialogTextures::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
CStringArray sa;
|
||||
FillTextureMenu(&sa);
|
||||
m_nSelection = -1;
|
||||
for (int i = 0; i < sa.GetSize(); i ++)
|
||||
{
|
||||
m_wndList.AddString(sa.GetAt(i));
|
||||
}
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
// DialogTextures.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "DialogTextures.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogTextures dialog
|
||||
|
||||
|
||||
CDialogTextures::CDialogTextures(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDialogTextures::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDialogTextures)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDialogTextures::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDialogTextures)
|
||||
DDX_Control(pDX, IDC_LIST_TEXTURES, m_wndList);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDialogTextures, CDialog)
|
||||
//{{AFX_MSG_MAP(CDialogTextures)
|
||||
ON_LBN_DBLCLK(IDC_LIST_TEXTURES, OnDblclkListTextures)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogTextures message handlers
|
||||
|
||||
void CDialogTextures::OnOK()
|
||||
{
|
||||
m_nSelection = m_wndList.GetCurSel();
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CDialogTextures::OnDblclkListTextures()
|
||||
{
|
||||
OnOK();
|
||||
}
|
||||
|
||||
BOOL CDialogTextures::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
CStringArray sa;
|
||||
FillTextureMenu(&sa);
|
||||
m_nSelection = -1;
|
||||
for (int i = 0; i < sa.GetSize(); i ++)
|
||||
{
|
||||
m_wndList.AddString(sa.GetAt(i));
|
||||
}
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
|
|
|||
96
q3radiant/DialogTextures.h
Normal file → Executable file
96
q3radiant/DialogTextures.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_DIALOGTEXTURES_H__F3F3F984_E47E_11D1_B61B_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_DIALOGTEXTURES_H__F3F3F984_E47E_11D1_B61B_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// DialogTextures.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogTextures dialog
|
||||
|
||||
class CDialogTextures : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDialogTextures(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDialogTextures)
|
||||
enum { IDD = IDD_DIALOG_TEXTURELIST };
|
||||
CListBox m_wndList;
|
||||
//}}AFX_DATA
|
||||
int m_nSelection;
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDialogTextures)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDialogTextures)
|
||||
virtual void OnOK();
|
||||
afx_msg void OnDblclkListTextures();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DIALOGTEXTURES_H__F3F3F984_E47E_11D1_B61B_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_DIALOGTEXTURES_H__F3F3F984_E47E_11D1_B61B_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_DIALOGTEXTURES_H__F3F3F984_E47E_11D1_B61B_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// DialogTextures.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogTextures dialog
|
||||
|
||||
class CDialogTextures : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDialogTextures(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDialogTextures)
|
||||
enum { IDD = IDD_DIALOG_TEXTURELIST };
|
||||
CListBox m_wndList;
|
||||
//}}AFX_DATA
|
||||
int m_nSelection;
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDialogTextures)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDialogTextures)
|
||||
virtual void OnOK();
|
||||
afx_msg void OnDblclkListTextures();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DIALOGTEXTURES_H__F3F3F984_E47E_11D1_B61B_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
90
q3radiant/DialogThick.cpp
Normal file → Executable file
90
q3radiant/DialogThick.cpp
Normal file → Executable file
|
|
@ -19,48 +19,48 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// DialogThick.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "DialogThick.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogThick dialog
|
||||
|
||||
|
||||
CDialogThick::CDialogThick(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDialogThick::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDialogThick)
|
||||
m_bSeams = TRUE;
|
||||
m_nAmount = 8;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDialogThick::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDialogThick)
|
||||
DDX_Check(pDX, IDC_CHECK_SEAMS, m_bSeams);
|
||||
DDX_Text(pDX, IDC_EDIT_AMOUNT, m_nAmount);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDialogThick, CDialog)
|
||||
//{{AFX_MSG_MAP(CDialogThick)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogThick message handlers
|
||||
// DialogThick.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "DialogThick.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogThick dialog
|
||||
|
||||
|
||||
CDialogThick::CDialogThick(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDialogThick::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDialogThick)
|
||||
m_bSeams = TRUE;
|
||||
m_nAmount = 8;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDialogThick::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDialogThick)
|
||||
DDX_Check(pDX, IDC_CHECK_SEAMS, m_bSeams);
|
||||
DDX_Text(pDX, IDC_EDIT_AMOUNT, m_nAmount);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDialogThick, CDialog)
|
||||
//{{AFX_MSG_MAP(CDialogThick)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogThick message handlers
|
||||
|
|
|
|||
94
q3radiant/DialogThick.h
Normal file → Executable file
94
q3radiant/DialogThick.h
Normal file → Executable file
|
|
@ -19,50 +19,50 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_DIALOGTHICK_H__59F46602_553D_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_DIALOGTHICK_H__59F46602_553D_11D2_B082_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// DialogThick.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogThick dialog
|
||||
|
||||
class CDialogThick : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDialogThick(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDialogThick)
|
||||
enum { IDD = IDD_DIALOG_THICKEN };
|
||||
BOOL m_bSeams;
|
||||
int m_nAmount;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDialogThick)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDialogThick)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DIALOGTHICK_H__59F46602_553D_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_DIALOGTHICK_H__59F46602_553D_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_DIALOGTHICK_H__59F46602_553D_11D2_B082_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// DialogThick.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogThick dialog
|
||||
|
||||
class CDialogThick : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDialogThick(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDialogThick)
|
||||
enum { IDD = IDD_DIALOG_THICKEN };
|
||||
BOOL m_bSeams;
|
||||
int m_nAmount;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDialogThick)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDialogThick)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DIALOGTHICK_H__59F46602_553D_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
88
q3radiant/DlgEvent.cpp
Normal file → Executable file
88
q3radiant/DlgEvent.cpp
Normal file → Executable file
|
|
@ -19,47 +19,47 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// DlgEvent.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "DlgEvent.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDlgEvent dialog
|
||||
|
||||
|
||||
CDlgEvent::CDlgEvent(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDlgEvent::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDlgEvent)
|
||||
m_strParm = _T("");
|
||||
m_event = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDlgEvent::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDlgEvent)
|
||||
DDX_Text(pDX, IDC_EDIT_PARAM, m_strParm);
|
||||
DDX_Radio(pDX, IDC_RADIO_EVENT, m_event);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDlgEvent, CDialog)
|
||||
//{{AFX_MSG_MAP(CDlgEvent)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDlgEvent message handlers
|
||||
// DlgEvent.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "DlgEvent.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDlgEvent dialog
|
||||
|
||||
|
||||
CDlgEvent::CDlgEvent(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDlgEvent::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDlgEvent)
|
||||
m_strParm = _T("");
|
||||
m_event = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CDlgEvent::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDlgEvent)
|
||||
DDX_Text(pDX, IDC_EDIT_PARAM, m_strParm);
|
||||
DDX_Radio(pDX, IDC_RADIO_EVENT, m_event);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDlgEvent, CDialog)
|
||||
//{{AFX_MSG_MAP(CDlgEvent)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDlgEvent message handlers
|
||||
|
|
|
|||
96
q3radiant/DlgEvent.h
Normal file → Executable file
96
q3radiant/DlgEvent.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_DLGEVENT_H__B12EEBE1_FB71_407B_9075_50F63B168567__INCLUDED_)
|
||||
#define AFX_DLGEVENT_H__B12EEBE1_FB71_407B_9075_50F63B168567__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// DlgEvent.h : header file
|
||||
//
|
||||
|
||||
#include "splines/splines.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDlgEvent dialog
|
||||
|
||||
class CDlgEvent : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDlgEvent(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDlgEvent)
|
||||
enum { IDD = IDD_DLG_CAMERAEVENT };
|
||||
CString m_strParm;
|
||||
int m_event;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDlgEvent)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDlgEvent)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DLGEVENT_H__B12EEBE1_FB71_407B_9075_50F63B168567__INCLUDED_)
|
||||
#if !defined(AFX_DLGEVENT_H__B12EEBE1_FB71_407B_9075_50F63B168567__INCLUDED_)
|
||||
#define AFX_DLGEVENT_H__B12EEBE1_FB71_407B_9075_50F63B168567__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// DlgEvent.h : header file
|
||||
//
|
||||
|
||||
#include "splines/splines.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDlgEvent dialog
|
||||
|
||||
class CDlgEvent : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDlgEvent(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDlgEvent)
|
||||
enum { IDD = IDD_DLG_CAMERAEVENT };
|
||||
CString m_strParm;
|
||||
int m_event;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDlgEvent)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDlgEvent)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DLGEVENT_H__B12EEBE1_FB71_407B_9075_50F63B168567__INCLUDED_)
|
||||
|
|
|
|||
1822
q3radiant/ECLASS.CPP
Normal file → Executable file
1822
q3radiant/ECLASS.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
1824
q3radiant/ENTITY.CPP
Normal file → Executable file
1824
q3radiant/ENTITY.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
110
q3radiant/ENTITY.H
Normal file → Executable file
110
q3radiant/ENTITY.H
Normal file → Executable file
|
|
@ -19,58 +19,58 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// entity.h
|
||||
|
||||
void Eclass_InitForSourceDirectory (char *path);
|
||||
eclass_t *Eclass_ForName (char *name, qboolean has_brushes);
|
||||
|
||||
// forward declare this one
|
||||
class IPluginEntity;
|
||||
|
||||
typedef struct entity_s
|
||||
{
|
||||
struct entity_s *prev, *next;
|
||||
brush_t brushes; // head/tail of list
|
||||
int undoId, redoId, entityId; // used for undo/redo
|
||||
vec3_t origin;
|
||||
eclass_t *eclass;
|
||||
epair_t *epairs;
|
||||
eclass_t *md3Class;
|
||||
IPluginEntity *pPlugEnt;
|
||||
vec3_t vRotation; // valid for misc_models only
|
||||
vec3_t vScale; // valid for misc_models only
|
||||
} entity_t;
|
||||
|
||||
char *ValueForKey (entity_t *ent, const char *key);
|
||||
void SetKeyValue (entity_t *ent, const char *key, const char *value);
|
||||
void SetKeyValue (epair_t *&e, const char *key, const char *value);
|
||||
void DeleteKey (entity_t *ent, const char *key);
|
||||
void DeleteKey (epair_t *&e, const char *key);
|
||||
float FloatForKey (entity_t *ent, const char *key);
|
||||
int IntForKey (entity_t *ent, const char *key);
|
||||
void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec);
|
||||
|
||||
void Entity_Free (entity_t *e);
|
||||
void Entity_FreeEpairs(entity_t *e);
|
||||
int Entity_MemorySize(entity_t *e);
|
||||
entity_t *Entity_Parse (qboolean onlypairs, brush_t* pList = NULL);
|
||||
void Entity_Write (entity_t *e, FILE *f, qboolean use_region);
|
||||
void Entity_WriteSelected(entity_t *e, FILE *f);
|
||||
void Entity_WriteSelected(entity_t *e, CMemFile*);
|
||||
entity_t *Entity_Create (eclass_t *c);
|
||||
entity_t *Entity_Clone (entity_t *e);
|
||||
void Entity_AddToList(entity_t *e, entity_t *list);
|
||||
void Entity_RemoveFromList(entity_t *e);
|
||||
|
||||
void Entity_LinkBrush (entity_t *e, brush_t *b);
|
||||
void Entity_UnlinkBrush (brush_t *b);
|
||||
entity_t *FindEntity(char *pszKey, char *pszValue);
|
||||
entity_t *FindEntityInt(char *pszKey, int iValue);
|
||||
|
||||
int GetUniqueTargetId(int iHint);
|
||||
qboolean Eclass_hasModel(eclass_t *e, vec3_t &vMin, vec3_t &vMax);
|
||||
eclass_t* GetCachedModel(entity_t *pEntity, const char *pName, vec3_t &vMin, vec3_t &vMax);
|
||||
|
||||
//Timo : used for parsing epairs in brush primitive
|
||||
epair_t* ParseEpair(void);
|
||||
char *ValueForKey ( epair_t *&e, const char *key);
|
||||
// entity.h
|
||||
|
||||
void Eclass_InitForSourceDirectory (char *path);
|
||||
eclass_t *Eclass_ForName (char *name, qboolean has_brushes);
|
||||
|
||||
// forward declare this one
|
||||
class IPluginEntity;
|
||||
|
||||
typedef struct entity_s
|
||||
{
|
||||
struct entity_s *prev, *next;
|
||||
brush_t brushes; // head/tail of list
|
||||
int undoId, redoId, entityId; // used for undo/redo
|
||||
vec3_t origin;
|
||||
eclass_t *eclass;
|
||||
epair_t *epairs;
|
||||
eclass_t *md3Class;
|
||||
IPluginEntity *pPlugEnt;
|
||||
vec3_t vRotation; // valid for misc_models only
|
||||
vec3_t vScale; // valid for misc_models only
|
||||
} entity_t;
|
||||
|
||||
char *ValueForKey (entity_t *ent, const char *key);
|
||||
void SetKeyValue (entity_t *ent, const char *key, const char *value);
|
||||
void SetKeyValue (epair_t *&e, const char *key, const char *value);
|
||||
void DeleteKey (entity_t *ent, const char *key);
|
||||
void DeleteKey (epair_t *&e, const char *key);
|
||||
float FloatForKey (entity_t *ent, const char *key);
|
||||
int IntForKey (entity_t *ent, const char *key);
|
||||
void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec);
|
||||
|
||||
void Entity_Free (entity_t *e);
|
||||
void Entity_FreeEpairs(entity_t *e);
|
||||
int Entity_MemorySize(entity_t *e);
|
||||
entity_t *Entity_Parse (qboolean onlypairs, brush_t* pList = NULL);
|
||||
void Entity_Write (entity_t *e, FILE *f, qboolean use_region);
|
||||
void Entity_WriteSelected(entity_t *e, FILE *f);
|
||||
void Entity_WriteSelected(entity_t *e, CMemFile*);
|
||||
entity_t *Entity_Create (eclass_t *c);
|
||||
entity_t *Entity_Clone (entity_t *e);
|
||||
void Entity_AddToList(entity_t *e, entity_t *list);
|
||||
void Entity_RemoveFromList(entity_t *e);
|
||||
|
||||
void Entity_LinkBrush (entity_t *e, brush_t *b);
|
||||
void Entity_UnlinkBrush (brush_t *b);
|
||||
entity_t *FindEntity(char *pszKey, char *pszValue);
|
||||
entity_t *FindEntityInt(char *pszKey, int iValue);
|
||||
|
||||
int GetUniqueTargetId(int iHint);
|
||||
qboolean Eclass_hasModel(eclass_t *e, vec3_t &vMin, vec3_t &vMax);
|
||||
eclass_t* GetCachedModel(entity_t *pEntity, const char *pName, vec3_t &vMin, vec3_t &vMax);
|
||||
|
||||
//Timo : used for parsing epairs in brush primitive
|
||||
epair_t* ParseEpair(void);
|
||||
char *ValueForKey ( epair_t *&e, const char *key);
|
||||
|
|
|
|||
94
q3radiant/ENTITYW.H
Normal file → Executable file
94
q3radiant/ENTITYW.H
Normal file → Executable file
|
|
@ -19,50 +19,50 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// entity.h
|
||||
|
||||
#define DlgXBorder 5
|
||||
#define DlgYBorder 5
|
||||
|
||||
|
||||
#define EntList 0
|
||||
#define EntComment 1
|
||||
#define EntCheck1 2
|
||||
#define EntCheck2 3
|
||||
#define EntCheck3 4
|
||||
#define EntCheck4 5
|
||||
#define EntCheck5 6
|
||||
#define EntCheck6 7
|
||||
#define EntCheck7 8
|
||||
#define EntCheck8 9
|
||||
#define EntCheck9 10
|
||||
#define EntCheck10 11
|
||||
#define EntCheck11 12
|
||||
#define EntCheck12 13
|
||||
#define EntProps 14
|
||||
#define EntDir0 15
|
||||
#define EntDir45 16
|
||||
#define EntDir90 17
|
||||
#define EntDir135 18
|
||||
#define EntDir180 19
|
||||
#define EntDir225 20
|
||||
#define EntDir270 21
|
||||
#define EntDir315 22
|
||||
#define EntDirUp 23
|
||||
#define EntDirDown 24
|
||||
#define EntDelProp 25
|
||||
#define EntKeyLabel 26
|
||||
#define EntKeyField 27
|
||||
#define EntValueLabel 28
|
||||
#define EntValueField 29
|
||||
#define EntColor 30
|
||||
#define EntAssignSounds 31
|
||||
#define EntAssignModels 32
|
||||
#define EntTab 33
|
||||
|
||||
#define EntLast 34
|
||||
|
||||
extern HWND hwndEnt[EntLast];
|
||||
|
||||
extern int rgIds[EntLast];
|
||||
|
||||
// entity.h
|
||||
|
||||
#define DlgXBorder 5
|
||||
#define DlgYBorder 5
|
||||
|
||||
|
||||
#define EntList 0
|
||||
#define EntComment 1
|
||||
#define EntCheck1 2
|
||||
#define EntCheck2 3
|
||||
#define EntCheck3 4
|
||||
#define EntCheck4 5
|
||||
#define EntCheck5 6
|
||||
#define EntCheck6 7
|
||||
#define EntCheck7 8
|
||||
#define EntCheck8 9
|
||||
#define EntCheck9 10
|
||||
#define EntCheck10 11
|
||||
#define EntCheck11 12
|
||||
#define EntCheck12 13
|
||||
#define EntProps 14
|
||||
#define EntDir0 15
|
||||
#define EntDir45 16
|
||||
#define EntDir90 17
|
||||
#define EntDir135 18
|
||||
#define EntDir180 19
|
||||
#define EntDir225 20
|
||||
#define EntDir270 21
|
||||
#define EntDir315 22
|
||||
#define EntDirUp 23
|
||||
#define EntDirDown 24
|
||||
#define EntDelProp 25
|
||||
#define EntKeyLabel 26
|
||||
#define EntKeyField 27
|
||||
#define EntValueLabel 28
|
||||
#define EntValueField 29
|
||||
#define EntColor 30
|
||||
#define EntAssignSounds 31
|
||||
#define EntAssignModels 32
|
||||
#define EntTab 33
|
||||
|
||||
#define EntLast 34
|
||||
|
||||
extern HWND hwndEnt[EntLast];
|
||||
|
||||
extern int rgIds[EntLast];
|
||||
|
||||
|
|
|
|||
2760
q3radiant/EPAIRS.H
Normal file → Executable file
2760
q3radiant/EPAIRS.H
Normal file → Executable file
File diff suppressed because it is too large
Load diff
80
q3radiant/EditWnd.cpp
Normal file → Executable file
80
q3radiant/EditWnd.cpp
Normal file → Executable file
|
|
@ -19,43 +19,43 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// EditWnd.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "EditWnd.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEditWnd
|
||||
IMPLEMENT_DYNCREATE(CEditWnd, CWnd);
|
||||
|
||||
CEditWnd::CEditWnd()
|
||||
{
|
||||
}
|
||||
|
||||
CEditWnd::~CEditWnd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CEditWnd, CEdit)
|
||||
//{{AFX_MSG_MAP(CEditWnd)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEditWnd message handlers
|
||||
|
||||
BOOL CEditWnd::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
cs.style = WS_CHILD | WS_VSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | WS_VISIBLE;
|
||||
cs.lpszClass = "EDIT";
|
||||
return CEdit::PreCreateWindow(cs);
|
||||
}
|
||||
// EditWnd.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "EditWnd.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEditWnd
|
||||
IMPLEMENT_DYNCREATE(CEditWnd, CWnd);
|
||||
|
||||
CEditWnd::CEditWnd()
|
||||
{
|
||||
}
|
||||
|
||||
CEditWnd::~CEditWnd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CEditWnd, CEdit)
|
||||
//{{AFX_MSG_MAP(CEditWnd)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEditWnd message handlers
|
||||
|
||||
BOOL CEditWnd::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
cs.style = WS_CHILD | WS_VSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | WS_VISIBLE;
|
||||
cs.lpszClass = "EDIT";
|
||||
return CEdit::PreCreateWindow(cs);
|
||||
}
|
||||
|
|
|
|||
100
q3radiant/EditWnd.h
Normal file → Executable file
100
q3radiant/EditWnd.h
Normal file → Executable file
|
|
@ -19,53 +19,53 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_EDITWND_H__279AAE22_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_EDITWND_H__279AAE22_78C5_11D1_B53C_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// EditWnd.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEditWnd window
|
||||
|
||||
class CEditWnd : public CEdit
|
||||
{
|
||||
DECLARE_DYNCREATE(CEditWnd);
|
||||
// Construction
|
||||
public:
|
||||
CEditWnd();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CEditWnd)
|
||||
protected:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CEditWnd();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CEditWnd)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_EDITWND_H__279AAE22_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_EDITWND_H__279AAE22_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_EDITWND_H__279AAE22_78C5_11D1_B53C_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// EditWnd.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEditWnd window
|
||||
|
||||
class CEditWnd : public CEdit
|
||||
{
|
||||
DECLARE_DYNCREATE(CEditWnd);
|
||||
// Construction
|
||||
public:
|
||||
CEditWnd();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CEditWnd)
|
||||
protected:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CEditWnd();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CEditWnd)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_EDITWND_H__279AAE22_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
262
q3radiant/EntityListDlg.cpp
Normal file → Executable file
262
q3radiant/EntityListDlg.cpp
Normal file → Executable file
|
|
@ -19,134 +19,134 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// EntityListDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "EntityListDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEntityListDlg dialog
|
||||
|
||||
|
||||
CEntityListDlg::CEntityListDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CEntityListDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CEntityListDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CEntityListDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CEntityListDlg)
|
||||
DDX_Control(pDX, IDC_LIST_ENTITY, m_lstEntity);
|
||||
DDX_Control(pDX, IDC_TREE_ENTITY, m_treeEntity);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CEntityListDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CEntityListDlg)
|
||||
ON_BN_CLICKED(IDSELECT, OnSelect)
|
||||
ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_ENTITY, OnSelchangedTreeEntity)
|
||||
ON_NOTIFY(NM_DBLCLK, IDC_TREE_ENTITY, OnDblclkTreeEntity)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEntityListDlg message handlers
|
||||
|
||||
void CEntityListDlg::OnSelect()
|
||||
{
|
||||
HTREEITEM hItem = m_treeEntity.GetSelectedItem();
|
||||
if (hItem)
|
||||
{
|
||||
entity_t* pEntity = reinterpret_cast<entity_t*>(m_treeEntity.GetItemData(hItem));
|
||||
if (pEntity)
|
||||
{
|
||||
Select_Deselect();
|
||||
Select_Brush (pEntity->brushes.onext);
|
||||
}
|
||||
}
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
BOOL CEntityListDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
CMapStringToPtr mapEntity;
|
||||
|
||||
HTREEITEM hParent = m_treeEntity.InsertItem(world_entity->eclass->name);
|
||||
HTREEITEM hChild = m_treeEntity.InsertItem(world_entity->eclass->name, hParent);
|
||||
m_treeEntity.SetItemData(hChild, reinterpret_cast<DWORD>(world_entity));
|
||||
|
||||
for (entity_t* pEntity=entities.next ; pEntity != &entities ; pEntity=pEntity->next)
|
||||
{
|
||||
hParent = NULL;
|
||||
if (mapEntity.Lookup(pEntity->eclass->name, reinterpret_cast<void*&>(hParent)) == FALSE)
|
||||
{
|
||||
hParent = m_treeEntity.InsertItem(pEntity->eclass->name);
|
||||
mapEntity.SetAt(pEntity->eclass->name, reinterpret_cast<void*>(hParent));
|
||||
}
|
||||
hChild = m_treeEntity.InsertItem(pEntity->eclass->name, hParent);
|
||||
m_treeEntity.SetItemData(hChild, reinterpret_cast<DWORD>(pEntity));
|
||||
}
|
||||
|
||||
CRect rct;
|
||||
m_lstEntity.GetClientRect(rct);
|
||||
m_lstEntity.InsertColumn(0, "Key", LVCFMT_LEFT, rct.Width() / 2);
|
||||
m_lstEntity.InsertColumn(1, "Value", LVCFMT_LEFT, rct.Width() / 2);
|
||||
m_lstEntity.DeleteColumn(2);
|
||||
UpdateData(FALSE);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CEntityListDlg::OnSelchangedTreeEntity(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
|
||||
HTREEITEM hItem = m_treeEntity.GetSelectedItem();
|
||||
m_lstEntity.DeleteAllItems();
|
||||
if (hItem)
|
||||
{
|
||||
CString strList;
|
||||
entity_t* pEntity = reinterpret_cast<entity_t*>(m_treeEntity.GetItemData(hItem));
|
||||
if (pEntity)
|
||||
{
|
||||
for (epair_t* pEpair = pEntity->epairs ; pEpair ; pEpair = pEpair->next)
|
||||
{
|
||||
if (strlen(pEpair->key) > 8)
|
||||
strList.Format("%s\t%s", pEpair->key, pEpair->value);
|
||||
else
|
||||
strList.Format("%s\t\t%s", pEpair->key, pEpair->value);
|
||||
int nParent = m_lstEntity.InsertItem(0, pEpair->key);
|
||||
m_lstEntity.SetItem(nParent, 1, LVIF_TEXT, pEpair->value, 0, 0, 0, reinterpret_cast<DWORD>(pEntity));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CEntityListDlg::OnDblclkListInfo()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CEntityListDlg::OnDblclkTreeEntity(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
OnSelect();
|
||||
*pResult = 0;
|
||||
}
|
||||
// EntityListDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "EntityListDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEntityListDlg dialog
|
||||
|
||||
|
||||
CEntityListDlg::CEntityListDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CEntityListDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CEntityListDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CEntityListDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CEntityListDlg)
|
||||
DDX_Control(pDX, IDC_LIST_ENTITY, m_lstEntity);
|
||||
DDX_Control(pDX, IDC_TREE_ENTITY, m_treeEntity);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CEntityListDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CEntityListDlg)
|
||||
ON_BN_CLICKED(IDSELECT, OnSelect)
|
||||
ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_ENTITY, OnSelchangedTreeEntity)
|
||||
ON_NOTIFY(NM_DBLCLK, IDC_TREE_ENTITY, OnDblclkTreeEntity)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEntityListDlg message handlers
|
||||
|
||||
void CEntityListDlg::OnSelect()
|
||||
{
|
||||
HTREEITEM hItem = m_treeEntity.GetSelectedItem();
|
||||
if (hItem)
|
||||
{
|
||||
entity_t* pEntity = reinterpret_cast<entity_t*>(m_treeEntity.GetItemData(hItem));
|
||||
if (pEntity)
|
||||
{
|
||||
Select_Deselect();
|
||||
Select_Brush (pEntity->brushes.onext);
|
||||
}
|
||||
}
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
BOOL CEntityListDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
CMapStringToPtr mapEntity;
|
||||
|
||||
HTREEITEM hParent = m_treeEntity.InsertItem(world_entity->eclass->name);
|
||||
HTREEITEM hChild = m_treeEntity.InsertItem(world_entity->eclass->name, hParent);
|
||||
m_treeEntity.SetItemData(hChild, reinterpret_cast<DWORD>(world_entity));
|
||||
|
||||
for (entity_t* pEntity=entities.next ; pEntity != &entities ; pEntity=pEntity->next)
|
||||
{
|
||||
hParent = NULL;
|
||||
if (mapEntity.Lookup(pEntity->eclass->name, reinterpret_cast<void*&>(hParent)) == FALSE)
|
||||
{
|
||||
hParent = m_treeEntity.InsertItem(pEntity->eclass->name);
|
||||
mapEntity.SetAt(pEntity->eclass->name, reinterpret_cast<void*>(hParent));
|
||||
}
|
||||
hChild = m_treeEntity.InsertItem(pEntity->eclass->name, hParent);
|
||||
m_treeEntity.SetItemData(hChild, reinterpret_cast<DWORD>(pEntity));
|
||||
}
|
||||
|
||||
CRect rct;
|
||||
m_lstEntity.GetClientRect(rct);
|
||||
m_lstEntity.InsertColumn(0, "Key", LVCFMT_LEFT, rct.Width() / 2);
|
||||
m_lstEntity.InsertColumn(1, "Value", LVCFMT_LEFT, rct.Width() / 2);
|
||||
m_lstEntity.DeleteColumn(2);
|
||||
UpdateData(FALSE);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CEntityListDlg::OnSelchangedTreeEntity(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
|
||||
HTREEITEM hItem = m_treeEntity.GetSelectedItem();
|
||||
m_lstEntity.DeleteAllItems();
|
||||
if (hItem)
|
||||
{
|
||||
CString strList;
|
||||
entity_t* pEntity = reinterpret_cast<entity_t*>(m_treeEntity.GetItemData(hItem));
|
||||
if (pEntity)
|
||||
{
|
||||
for (epair_t* pEpair = pEntity->epairs ; pEpair ; pEpair = pEpair->next)
|
||||
{
|
||||
if (strlen(pEpair->key) > 8)
|
||||
strList.Format("%s\t%s", pEpair->key, pEpair->value);
|
||||
else
|
||||
strList.Format("%s\t\t%s", pEpair->key, pEpair->value);
|
||||
int nParent = m_lstEntity.InsertItem(0, pEpair->key);
|
||||
m_lstEntity.SetItem(nParent, 1, LVIF_TEXT, pEpair->value, 0, 0, 0, reinterpret_cast<DWORD>(pEntity));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CEntityListDlg::OnDblclkListInfo()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CEntityListDlg::OnDblclkTreeEntity(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
OnSelect();
|
||||
*pResult = 0;
|
||||
}
|
||||
|
|
|
|||
102
q3radiant/EntityListDlg.h
Normal file → Executable file
102
q3radiant/EntityListDlg.h
Normal file → Executable file
|
|
@ -19,54 +19,54 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_ENTITYLISTDLG_H__C241B9A3_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_ENTITYLISTDLG_H__C241B9A3_819F_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// EntityListDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEntityListDlg dialog
|
||||
|
||||
class CEntityListDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CEntityListDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CEntityListDlg)
|
||||
enum { IDD = IDD_DLG_ENTITYLIST };
|
||||
CListCtrl m_lstEntity;
|
||||
CTreeCtrl m_treeEntity;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CEntityListDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CEntityListDlg)
|
||||
afx_msg void OnSelect();
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSelchangedTreeEntity(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDblclkListInfo();
|
||||
afx_msg void OnDblclkTreeEntity(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_ENTITYLISTDLG_H__C241B9A3_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_ENTITYLISTDLG_H__C241B9A3_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_ENTITYLISTDLG_H__C241B9A3_819F_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// EntityListDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CEntityListDlg dialog
|
||||
|
||||
class CEntityListDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CEntityListDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CEntityListDlg)
|
||||
enum { IDD = IDD_DLG_ENTITYLIST };
|
||||
CListCtrl m_lstEntity;
|
||||
CTreeCtrl m_treeEntity;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CEntityListDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CEntityListDlg)
|
||||
afx_msg void OnSelect();
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSelchangedTreeEntity(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDblclkListInfo();
|
||||
afx_msg void OnDblclkTreeEntity(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_ENTITYLISTDLG_H__C241B9A3_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
82
q3radiant/EpairsWrapper.h
Normal file → Executable file
82
q3radiant/EpairsWrapper.h
Normal file → Executable file
|
|
@ -19,45 +19,45 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:10 $
|
||||
// $Log: EpairsWrapper.h,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:10 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:41 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:25 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// virtual class to allow plugin operations on entities epairs
|
||||
// this is the internal header for our implementation
|
||||
|
||||
#ifndef _EPAIRSWRAPPER_H_
|
||||
#define _EPAIRSWRAPPER_H_
|
||||
|
||||
class CEpairsWrapper : public IEpair
|
||||
{
|
||||
public:
|
||||
int refCount;
|
||||
entity_t *m_pEnt;
|
||||
virtual void IncRef() { refCount++; }
|
||||
virtual void DecRef() { refCount--; if (refCount <= 0) delete this; }
|
||||
CEpairsWrapper() { refCount = 0; }
|
||||
CEpairsWrapper( entity_t* ep ) { refCount = 0; m_pEnt = ep; }
|
||||
virtual ~CEpairsWrapper() { }
|
||||
virtual void GetVectorForKey( char* key, vec3_t vec );
|
||||
virtual float FloatForKey( char *key );
|
||||
virtual char* ValueForKey( char *key );
|
||||
virtual void SetKeyValue( char *key, char *value );
|
||||
virtual void GetEntityOrigin( vec3_t vec );
|
||||
virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:10 $
|
||||
// $Log: EpairsWrapper.h,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:10 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:41 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:25 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// virtual class to allow plugin operations on entities epairs
|
||||
// this is the internal header for our implementation
|
||||
|
||||
#ifndef _EPAIRSWRAPPER_H_
|
||||
#define _EPAIRSWRAPPER_H_
|
||||
|
||||
class CEpairsWrapper : public IEpair
|
||||
{
|
||||
public:
|
||||
int refCount;
|
||||
entity_t *m_pEnt;
|
||||
virtual void IncRef() { refCount++; }
|
||||
virtual void DecRef() { refCount--; if (refCount <= 0) delete this; }
|
||||
CEpairsWrapper() { refCount = 0; }
|
||||
CEpairsWrapper( entity_t* ep ) { refCount = 0; m_pEnt = ep; }
|
||||
virtual ~CEpairsWrapper() { }
|
||||
virtual void GetVectorForKey( char* key, vec3_t vec );
|
||||
virtual float FloatForKey( char *key );
|
||||
virtual char* ValueForKey( char *key );
|
||||
virtual void SetKeyValue( char *key, char *value );
|
||||
virtual void GetEntityOrigin( vec3_t vec );
|
||||
virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs );
|
||||
};
|
||||
|
||||
#endif
|
||||
132
q3radiant/FNMATCH.CPP
Normal file → Executable file
132
q3radiant/FNMATCH.CPP
Normal file → Executable file
|
|
@ -19,69 +19,69 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#define Reg1 register
|
||||
int match(char *mask, char *name)
|
||||
{
|
||||
Reg1 unsigned char *m = (unsigned char *)mask, *n = (unsigned char *)name;
|
||||
char *ma = mask, *na = name;
|
||||
int wild = 0, q = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (*m == '*')
|
||||
{
|
||||
while (*m == '*')
|
||||
m++;
|
||||
wild = 1;
|
||||
ma = (char *)m;
|
||||
na = (char *)n;
|
||||
}
|
||||
|
||||
if (!*m)
|
||||
{
|
||||
if (!*n)
|
||||
return 0;
|
||||
for (m--; (m > (unsigned char *)mask) && (*m == '?'); m--)
|
||||
;
|
||||
if ((*m == '*') && (m > (unsigned char *)mask) &&
|
||||
(m[-1] != '\\'))
|
||||
return 0;
|
||||
if (!wild)
|
||||
return 1;
|
||||
m = (unsigned char *)ma;
|
||||
n = (unsigned char *)++na;
|
||||
}
|
||||
else if (!*n)
|
||||
{
|
||||
while(*m == '*')
|
||||
m++;
|
||||
return (*m != 0);
|
||||
}
|
||||
if ((*m == '\\') && ((m[1] == '*') || (m[1] == '?')))
|
||||
{
|
||||
m++;
|
||||
q = 1;
|
||||
}
|
||||
else
|
||||
q = 0;
|
||||
|
||||
if ((tolower(*m) != tolower(*n)) && ((*m != '?') || q))
|
||||
{
|
||||
if (!wild)
|
||||
return 1;
|
||||
m = (unsigned char *)ma;
|
||||
n = (unsigned char *)++na;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*m)
|
||||
m++;
|
||||
if (*n)
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#define Reg1 register
|
||||
int match(char *mask, char *name)
|
||||
{
|
||||
Reg1 unsigned char *m = (unsigned char *)mask, *n = (unsigned char *)name;
|
||||
char *ma = mask, *na = name;
|
||||
int wild = 0, q = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (*m == '*')
|
||||
{
|
||||
while (*m == '*')
|
||||
m++;
|
||||
wild = 1;
|
||||
ma = (char *)m;
|
||||
na = (char *)n;
|
||||
}
|
||||
|
||||
if (!*m)
|
||||
{
|
||||
if (!*n)
|
||||
return 0;
|
||||
for (m--; (m > (unsigned char *)mask) && (*m == '?'); m--)
|
||||
;
|
||||
if ((*m == '*') && (m > (unsigned char *)mask) &&
|
||||
(m[-1] != '\\'))
|
||||
return 0;
|
||||
if (!wild)
|
||||
return 1;
|
||||
m = (unsigned char *)ma;
|
||||
n = (unsigned char *)++na;
|
||||
}
|
||||
else if (!*n)
|
||||
{
|
||||
while(*m == '*')
|
||||
m++;
|
||||
return (*m != 0);
|
||||
}
|
||||
if ((*m == '\\') && ((m[1] == '*') || (m[1] == '?')))
|
||||
{
|
||||
m++;
|
||||
q = 1;
|
||||
}
|
||||
else
|
||||
q = 0;
|
||||
|
||||
if ((tolower(*m) != tolower(*n)) && ((*m != '?') || q))
|
||||
{
|
||||
if (!wild)
|
||||
return 1;
|
||||
m = (unsigned char *)ma;
|
||||
n = (unsigned char *)++na;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*m)
|
||||
m++;
|
||||
if (*n)
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
12
q3radiant/FNMATCH.H
Normal file → Executable file
12
q3radiant/FNMATCH.H
Normal file → Executable file
|
|
@ -19,9 +19,9 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#ifndef _FNMATCH_H
|
||||
#define _FNMATCH_H
|
||||
|
||||
int match(char *mask, char *name);
|
||||
|
||||
#endif /* fnmatch.h */
|
||||
#ifndef _FNMATCH_H
|
||||
#define _FNMATCH_H
|
||||
|
||||
int match(char *mask, char *name);
|
||||
|
||||
#endif /* fnmatch.h */
|
||||
|
|
|
|||
308
q3radiant/FindTextureDlg.cpp
Normal file → Executable file
308
q3radiant/FindTextureDlg.cpp
Normal file → Executable file
|
|
@ -19,157 +19,157 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// FindTextureDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "FindTextureDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CFindTextureDlg dialog
|
||||
|
||||
CFindTextureDlg g_TexFindDlg;
|
||||
CFindTextureDlg& g_dlgFind = g_TexFindDlg;
|
||||
static bool g_bFindActive = true;
|
||||
|
||||
void CFindTextureDlg::updateTextures(const char *p)
|
||||
{
|
||||
if (isOpen())
|
||||
{
|
||||
if (g_bFindActive)
|
||||
{
|
||||
setFindStr(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
setReplaceStr(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFindTextureDlg::CFindTextureDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CFindTextureDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CFindTextureDlg)
|
||||
m_bSelectedOnly = FALSE;
|
||||
m_strFind = _T("");
|
||||
m_strReplace = _T("");
|
||||
m_bForce = FALSE;
|
||||
m_bLive = TRUE;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CFindTextureDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CFindTextureDlg)
|
||||
DDX_Check(pDX, IDC_CHECK_SELECTED, m_bSelectedOnly);
|
||||
DDX_Text(pDX, IDC_EDIT_FIND, m_strFind);
|
||||
DDX_Text(pDX, IDC_EDIT_REPLACE, m_strReplace);
|
||||
DDX_Check(pDX, IDC_CHECK_FORCE, m_bForce);
|
||||
DDX_Check(pDX, IDC_CHECK_LIVE, m_bLive);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CFindTextureDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CFindTextureDlg)
|
||||
ON_BN_CLICKED(ID_BTN_APPLY, OnBtnApply)
|
||||
ON_EN_SETFOCUS(IDC_EDIT_FIND, OnSetfocusEditFind)
|
||||
ON_EN_SETFOCUS(IDC_EDIT_REPLACE, OnSetfocusEditReplace)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CFindTextureDlg::OnBtnApply()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct));
|
||||
FindReplaceTextures(m_strFind, m_strReplace, m_bSelectedOnly, m_bForce);
|
||||
}
|
||||
|
||||
void CFindTextureDlg::OnOK()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct));
|
||||
FindReplaceTextures(m_strFind, m_strReplace, m_bSelectedOnly, m_bForce);
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CFindTextureDlg::show()
|
||||
{
|
||||
if (g_dlgFind.GetSafeHwnd() == NULL || IsWindow(g_dlgFind.GetSafeHwnd()) == FALSE)
|
||||
{
|
||||
g_dlgFind.Create(IDD_DIALOG_FINDREPLACE);
|
||||
g_dlgFind.ShowWindow(SW_SHOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_dlgFind.ShowWindow(SW_SHOW);
|
||||
}
|
||||
CRect rct;
|
||||
LONG lSize = sizeof(rct);
|
||||
if (LoadRegistryInfo("Radiant::TextureFindWindow", &rct, &lSize))
|
||||
g_dlgFind.SetWindowPos(NULL, rct.left, rct.top, 0,0, SWP_NOSIZE | SWP_SHOWWINDOW);
|
||||
}
|
||||
|
||||
|
||||
bool CFindTextureDlg::isOpen()
|
||||
{
|
||||
return (g_dlgFind.GetSafeHwnd() == NULL || ::IsWindowVisible(g_dlgFind.GetSafeHwnd()) == FALSE) ? false : true;
|
||||
}
|
||||
|
||||
void CFindTextureDlg::setFindStr(const char * p)
|
||||
{
|
||||
g_dlgFind.UpdateData(TRUE);
|
||||
if (g_dlgFind.m_bLive)
|
||||
{
|
||||
g_dlgFind.m_strFind = p;
|
||||
g_dlgFind.UpdateData(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void CFindTextureDlg::setReplaceStr(const char * p)
|
||||
{
|
||||
g_dlgFind.UpdateData(TRUE);
|
||||
if (g_dlgFind.m_bLive)
|
||||
{
|
||||
g_dlgFind.m_strReplace = p;
|
||||
g_dlgFind.UpdateData(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CFindTextureDlg::OnCancel()
|
||||
{
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct));
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
BOOL CFindTextureDlg::DestroyWindow()
|
||||
{
|
||||
return CDialog::DestroyWindow();
|
||||
}
|
||||
|
||||
void CFindTextureDlg::OnSetfocusEditFind()
|
||||
{
|
||||
g_bFindActive = true;
|
||||
}
|
||||
|
||||
void CFindTextureDlg::OnSetfocusEditReplace()
|
||||
{
|
||||
g_bFindActive = false;
|
||||
}
|
||||
// FindTextureDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "FindTextureDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CFindTextureDlg dialog
|
||||
|
||||
CFindTextureDlg g_TexFindDlg;
|
||||
CFindTextureDlg& g_dlgFind = g_TexFindDlg;
|
||||
static bool g_bFindActive = true;
|
||||
|
||||
void CFindTextureDlg::updateTextures(const char *p)
|
||||
{
|
||||
if (isOpen())
|
||||
{
|
||||
if (g_bFindActive)
|
||||
{
|
||||
setFindStr(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
setReplaceStr(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFindTextureDlg::CFindTextureDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CFindTextureDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CFindTextureDlg)
|
||||
m_bSelectedOnly = FALSE;
|
||||
m_strFind = _T("");
|
||||
m_strReplace = _T("");
|
||||
m_bForce = FALSE;
|
||||
m_bLive = TRUE;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CFindTextureDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CFindTextureDlg)
|
||||
DDX_Check(pDX, IDC_CHECK_SELECTED, m_bSelectedOnly);
|
||||
DDX_Text(pDX, IDC_EDIT_FIND, m_strFind);
|
||||
DDX_Text(pDX, IDC_EDIT_REPLACE, m_strReplace);
|
||||
DDX_Check(pDX, IDC_CHECK_FORCE, m_bForce);
|
||||
DDX_Check(pDX, IDC_CHECK_LIVE, m_bLive);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CFindTextureDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CFindTextureDlg)
|
||||
ON_BN_CLICKED(ID_BTN_APPLY, OnBtnApply)
|
||||
ON_EN_SETFOCUS(IDC_EDIT_FIND, OnSetfocusEditFind)
|
||||
ON_EN_SETFOCUS(IDC_EDIT_REPLACE, OnSetfocusEditReplace)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CFindTextureDlg::OnBtnApply()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct));
|
||||
FindReplaceTextures(m_strFind, m_strReplace, m_bSelectedOnly, m_bForce);
|
||||
}
|
||||
|
||||
void CFindTextureDlg::OnOK()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct));
|
||||
FindReplaceTextures(m_strFind, m_strReplace, m_bSelectedOnly, m_bForce);
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CFindTextureDlg::show()
|
||||
{
|
||||
if (g_dlgFind.GetSafeHwnd() == NULL || IsWindow(g_dlgFind.GetSafeHwnd()) == FALSE)
|
||||
{
|
||||
g_dlgFind.Create(IDD_DIALOG_FINDREPLACE);
|
||||
g_dlgFind.ShowWindow(SW_SHOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_dlgFind.ShowWindow(SW_SHOW);
|
||||
}
|
||||
CRect rct;
|
||||
LONG lSize = sizeof(rct);
|
||||
if (LoadRegistryInfo("Radiant::TextureFindWindow", &rct, &lSize))
|
||||
g_dlgFind.SetWindowPos(NULL, rct.left, rct.top, 0,0, SWP_NOSIZE | SWP_SHOWWINDOW);
|
||||
}
|
||||
|
||||
|
||||
bool CFindTextureDlg::isOpen()
|
||||
{
|
||||
return (g_dlgFind.GetSafeHwnd() == NULL || ::IsWindowVisible(g_dlgFind.GetSafeHwnd()) == FALSE) ? false : true;
|
||||
}
|
||||
|
||||
void CFindTextureDlg::setFindStr(const char * p)
|
||||
{
|
||||
g_dlgFind.UpdateData(TRUE);
|
||||
if (g_dlgFind.m_bLive)
|
||||
{
|
||||
g_dlgFind.m_strFind = p;
|
||||
g_dlgFind.UpdateData(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void CFindTextureDlg::setReplaceStr(const char * p)
|
||||
{
|
||||
g_dlgFind.UpdateData(TRUE);
|
||||
if (g_dlgFind.m_bLive)
|
||||
{
|
||||
g_dlgFind.m_strReplace = p;
|
||||
g_dlgFind.UpdateData(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CFindTextureDlg::OnCancel()
|
||||
{
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct));
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
BOOL CFindTextureDlg::DestroyWindow()
|
||||
{
|
||||
return CDialog::DestroyWindow();
|
||||
}
|
||||
|
||||
void CFindTextureDlg::OnSetfocusEditFind()
|
||||
{
|
||||
g_bFindActive = true;
|
||||
}
|
||||
|
||||
void CFindTextureDlg::OnSetfocusEditReplace()
|
||||
{
|
||||
g_bFindActive = false;
|
||||
}
|
||||
|
|
|
|||
124
q3radiant/FindTextureDlg.h
Normal file → Executable file
124
q3radiant/FindTextureDlg.h
Normal file → Executable file
|
|
@ -19,65 +19,65 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// FindTextureDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CFindTextureDlg dialog
|
||||
|
||||
class CFindTextureDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
static void setReplaceStr(const char* p);
|
||||
static void setFindStr(const char* p);
|
||||
static bool isOpen();
|
||||
static void show();
|
||||
static void updateTextures(const char* p);
|
||||
CFindTextureDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CFindTextureDlg)
|
||||
enum { IDD = IDD_DIALOG_FINDREPLACE };
|
||||
BOOL m_bSelectedOnly;
|
||||
CString m_strFind;
|
||||
CString m_strReplace;
|
||||
BOOL m_bForce;
|
||||
BOOL m_bLive;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CFindTextureDlg)
|
||||
public:
|
||||
virtual BOOL DestroyWindow();
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CFindTextureDlg)
|
||||
afx_msg void OnBtnApply();
|
||||
virtual void OnOK();
|
||||
virtual void OnCancel();
|
||||
afx_msg void OnSetfocusEditFind();
|
||||
afx_msg void OnSetfocusEditReplace();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// FindTextureDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CFindTextureDlg dialog
|
||||
|
||||
class CFindTextureDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
static void setReplaceStr(const char* p);
|
||||
static void setFindStr(const char* p);
|
||||
static bool isOpen();
|
||||
static void show();
|
||||
static void updateTextures(const char* p);
|
||||
CFindTextureDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CFindTextureDlg)
|
||||
enum { IDD = IDD_DIALOG_FINDREPLACE };
|
||||
BOOL m_bSelectedOnly;
|
||||
CString m_strFind;
|
||||
CString m_strReplace;
|
||||
BOOL m_bForce;
|
||||
BOOL m_bLive;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CFindTextureDlg)
|
||||
public:
|
||||
virtual BOOL DestroyWindow();
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CFindTextureDlg)
|
||||
afx_msg void OnBtnApply();
|
||||
virtual void OnOK();
|
||||
virtual void OnCancel();
|
||||
afx_msg void OnSetfocusEditFind();
|
||||
afx_msg void OnSetfocusEditReplace();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
152
q3radiant/GLINGR.H
Normal file → Executable file
152
q3radiant/GLINGR.H
Normal file → Executable file
|
|
@ -19,79 +19,79 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// This .h file contains constants, typedefs, etc. for Intergraph
|
||||
// extensions to OpenGL. These extensions are:
|
||||
//
|
||||
// Multiple Palette Extension
|
||||
// Texture Object Extension
|
||||
|
||||
#define GL_INGR_multiple_palette 1
|
||||
#define GL_EXT_texture_object 1
|
||||
|
||||
|
||||
// New constants and typedefs for the Multiple Palette Extension
|
||||
#define GL_PALETTE_INGR 0x80c0
|
||||
#define GL_MAX_PALETTES_INGR 0x80c1
|
||||
#define GL_MAX_PALETTE_ENTRIES_INGR 0x80c2
|
||||
#define GL_CURRENT_PALETTE_INGR 0x80c3
|
||||
#define GL_PALETTE_WRITEMASK_INGR 0x80c4
|
||||
#define GL_CURRENT_RASTER_PALETTE_INGR 0x80c5
|
||||
#define GL_PALETTE_CLEAR_VALUE_INGR 0x80c6
|
||||
|
||||
// Function prototypes for the Multiple Palette Extension routines
|
||||
typedef void (APIENTRY *PALETTEFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PALETTEMASKFUNCPTR)(GLboolean);
|
||||
typedef void (APIENTRY *WGLLOADPALETTEFUNCPTR)(GLuint, GLsizei, GLuint *);
|
||||
typedef void (APIENTRY *CLEARPALETTEFUNCPTR)(GLuint);
|
||||
|
||||
|
||||
// New Constants and typedefs for the Texture Object Extension
|
||||
#define GL_TEXTURE_PRIORITY_EXT 0x8066
|
||||
#define GL_TEXTURE_RESIDENT_EXT 0x8067
|
||||
#define GL_TEXTURE_1D_BINDING_EXT 0x8068
|
||||
#define GL_TEXTURE_2D_BINDING_EXT 0x8069
|
||||
|
||||
// Function prototypes for the Texture Object Extension routines
|
||||
typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLboolean *);
|
||||
typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
|
||||
typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
|
||||
typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
|
||||
typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLclampf *);
|
||||
|
||||
|
||||
/* OpenGL ExtEscape escape function constants */
|
||||
#ifndef OPENGL_GETINFO
|
||||
#define OPENGL_GETINFO 4353 /* for OpenGL ExtEscape */
|
||||
#endif
|
||||
|
||||
// OPENGL_GETINFO ExtEscape sub-escape numbers. They are defined by
|
||||
// Microsoft.
|
||||
|
||||
#ifndef OPENGL_GETINFO_DRVNAME
|
||||
|
||||
#define OPENGL_GETINFO_DRVNAME 0
|
||||
|
||||
|
||||
// Input structure for OPENGL_GETINFO ExtEscape.
|
||||
|
||||
typedef struct _OPENGLGETINFO
|
||||
{
|
||||
ULONG ulSubEsc;
|
||||
} OPENGLGETINFO, *POPENGLGETINFO;
|
||||
|
||||
|
||||
// Output structure for OPENGL_GETINFO_DRVNAME ExtEscape.
|
||||
|
||||
typedef struct _GLDRVNAMERET
|
||||
{
|
||||
ULONG ulVersion; // must be 1 for this version
|
||||
ULONG ulDriverVersion; // driver specific version number
|
||||
WCHAR awch[MAX_PATH+1];
|
||||
} GLDRVNAMERET, *PGLDRVNAMERET;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// This .h file contains constants, typedefs, etc. for Intergraph
|
||||
// extensions to OpenGL. These extensions are:
|
||||
//
|
||||
// Multiple Palette Extension
|
||||
// Texture Object Extension
|
||||
|
||||
#define GL_INGR_multiple_palette 1
|
||||
#define GL_EXT_texture_object 1
|
||||
|
||||
|
||||
// New constants and typedefs for the Multiple Palette Extension
|
||||
#define GL_PALETTE_INGR 0x80c0
|
||||
#define GL_MAX_PALETTES_INGR 0x80c1
|
||||
#define GL_MAX_PALETTE_ENTRIES_INGR 0x80c2
|
||||
#define GL_CURRENT_PALETTE_INGR 0x80c3
|
||||
#define GL_PALETTE_WRITEMASK_INGR 0x80c4
|
||||
#define GL_CURRENT_RASTER_PALETTE_INGR 0x80c5
|
||||
#define GL_PALETTE_CLEAR_VALUE_INGR 0x80c6
|
||||
|
||||
// Function prototypes for the Multiple Palette Extension routines
|
||||
typedef void (APIENTRY *PALETTEFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PALETTEMASKFUNCPTR)(GLboolean);
|
||||
typedef void (APIENTRY *WGLLOADPALETTEFUNCPTR)(GLuint, GLsizei, GLuint *);
|
||||
typedef void (APIENTRY *CLEARPALETTEFUNCPTR)(GLuint);
|
||||
|
||||
|
||||
// New Constants and typedefs for the Texture Object Extension
|
||||
#define GL_TEXTURE_PRIORITY_EXT 0x8066
|
||||
#define GL_TEXTURE_RESIDENT_EXT 0x8067
|
||||
#define GL_TEXTURE_1D_BINDING_EXT 0x8068
|
||||
#define GL_TEXTURE_2D_BINDING_EXT 0x8069
|
||||
|
||||
// Function prototypes for the Texture Object Extension routines
|
||||
typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLboolean *);
|
||||
typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
|
||||
typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
|
||||
typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
|
||||
typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLclampf *);
|
||||
|
||||
|
||||
/* OpenGL ExtEscape escape function constants */
|
||||
#ifndef OPENGL_GETINFO
|
||||
#define OPENGL_GETINFO 4353 /* for OpenGL ExtEscape */
|
||||
#endif
|
||||
|
||||
// OPENGL_GETINFO ExtEscape sub-escape numbers. They are defined by
|
||||
// Microsoft.
|
||||
|
||||
#ifndef OPENGL_GETINFO_DRVNAME
|
||||
|
||||
#define OPENGL_GETINFO_DRVNAME 0
|
||||
|
||||
|
||||
// Input structure for OPENGL_GETINFO ExtEscape.
|
||||
|
||||
typedef struct _OPENGLGETINFO
|
||||
{
|
||||
ULONG ulSubEsc;
|
||||
} OPENGLGETINFO, *POPENGLGETINFO;
|
||||
|
||||
|
||||
// Output structure for OPENGL_GETINFO_DRVNAME ExtEscape.
|
||||
|
||||
typedef struct _GLDRVNAMERET
|
||||
{
|
||||
ULONG ulVersion; // must be 1 for this version
|
||||
ULONG ulDriverVersion; // driver specific version number
|
||||
WCHAR awch[MAX_PATH+1];
|
||||
} GLDRVNAMERET, *PGLDRVNAMERET;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
142
q3radiant/GLInterface.cpp
Normal file → Executable file
142
q3radiant/GLInterface.cpp
Normal file → Executable file
|
|
@ -19,75 +19,75 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $log$
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.4.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
// Revision 1.1.2.1 1999/10/27 08:34:26 Timo & Christine
|
||||
// preview version of the texture tools plugin is ready
|
||||
// ( TexTool.dll plugin is in Q3Plugin module )
|
||||
// plugins can draw in their own window using Radiant's qgl bindings
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Quick interface hack for selected face interface
|
||||
// this one really needs more work, but I'm in a hurry with TexTool
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// stores objects that want to be hooked into drawing in the XY window
|
||||
//++timo TODO: add support for camera view, Z view ... (texture view?)
|
||||
CPtrArray l_GLWindows;
|
||||
|
||||
int WINAPI QERApp_ISelectedFace_GetTextureNumber()
|
||||
{
|
||||
if (g_ptrSelectedFaces.GetSize() > 0)
|
||||
{
|
||||
face_t *selFace = reinterpret_cast<face_t*>(g_ptrSelectedFaces.GetAt(0));
|
||||
return selFace->d_texture->texture_number;
|
||||
}
|
||||
//++timo hu ? find the appropriate gl bind number
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WINAPI QERApp_HookXYGLWindow(IGLWindow* pGLW)
|
||||
{
|
||||
l_GLWindows.Add( pGLW );
|
||||
pGLW->IncRef();
|
||||
}
|
||||
|
||||
void WINAPI QERApp_UnHookGLWindow(IGLWindow* pGLW)
|
||||
{
|
||||
for( int i = 0; i < l_GLWindows.GetSize(); i++ )
|
||||
{
|
||||
if (l_GLWindows.GetAt(i) == pGLW)
|
||||
{
|
||||
l_GLWindows.RemoveAt(i);
|
||||
pGLW->DecRef();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Sys_Printf("ERROR: IGLWindow* not found in QERApp_UnHookGLWindow\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void DrawPluginEntities( VIEWTYPE vt )
|
||||
{
|
||||
for(int i = 0; i<l_GLWindows.GetSize(); i++ )
|
||||
static_cast<IGLWindow*>(l_GLWindows.GetAt(i))->Draw( vt );
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $log$
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.4.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
// Revision 1.1.2.1 1999/10/27 08:34:26 Timo & Christine
|
||||
// preview version of the texture tools plugin is ready
|
||||
// ( TexTool.dll plugin is in Q3Plugin module )
|
||||
// plugins can draw in their own window using Radiant's qgl bindings
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Quick interface hack for selected face interface
|
||||
// this one really needs more work, but I'm in a hurry with TexTool
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// stores objects that want to be hooked into drawing in the XY window
|
||||
//++timo TODO: add support for camera view, Z view ... (texture view?)
|
||||
CPtrArray l_GLWindows;
|
||||
|
||||
int WINAPI QERApp_ISelectedFace_GetTextureNumber()
|
||||
{
|
||||
if (g_ptrSelectedFaces.GetSize() > 0)
|
||||
{
|
||||
face_t *selFace = reinterpret_cast<face_t*>(g_ptrSelectedFaces.GetAt(0));
|
||||
return selFace->d_texture->texture_number;
|
||||
}
|
||||
//++timo hu ? find the appropriate gl bind number
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WINAPI QERApp_HookXYGLWindow(IGLWindow* pGLW)
|
||||
{
|
||||
l_GLWindows.Add( pGLW );
|
||||
pGLW->IncRef();
|
||||
}
|
||||
|
||||
void WINAPI QERApp_UnHookGLWindow(IGLWindow* pGLW)
|
||||
{
|
||||
for( int i = 0; i < l_GLWindows.GetSize(); i++ )
|
||||
{
|
||||
if (l_GLWindows.GetAt(i) == pGLW)
|
||||
{
|
||||
l_GLWindows.RemoveAt(i);
|
||||
pGLW->DecRef();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Sys_Printf("ERROR: IGLWindow* not found in QERApp_UnHookGLWindow\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void DrawPluginEntities( VIEWTYPE vt )
|
||||
{
|
||||
for(int i = 0; i<l_GLWindows.GetSize(); i++ )
|
||||
static_cast<IGLWindow*>(l_GLWindows.GetAt(i))->Draw( vt );
|
||||
}
|
||||
56
q3radiant/GLW_WIN.H
Normal file → Executable file
56
q3radiant/GLW_WIN.H
Normal file → Executable file
|
|
@ -19,31 +19,31 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#ifndef _WIN32
|
||||
# error You should not be including this file on this platform
|
||||
#endif
|
||||
|
||||
#ifndef __GLW_WIN_H__
|
||||
#define __GLW_WIN_H__
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HINSTANCE hInstance;
|
||||
void *wndproc;
|
||||
|
||||
HDC hDC; // handle to device context
|
||||
HWND hWnd; // handle to window
|
||||
HGLRC hGLRC; // handle to GL rendering context
|
||||
|
||||
HINSTANCE hinstOpenGL; // HINSTANCE for the OpenGL library
|
||||
|
||||
qboolean minidriver;
|
||||
qboolean allowdisplaydepthchange;
|
||||
qboolean mcd_accelerated;
|
||||
|
||||
FILE *log_fp;
|
||||
} glwstate_t;
|
||||
|
||||
extern glwstate_t glw_state;
|
||||
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
# error You should not be including this file on this platform
|
||||
#endif
|
||||
|
||||
#ifndef __GLW_WIN_H__
|
||||
#define __GLW_WIN_H__
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HINSTANCE hInstance;
|
||||
void *wndproc;
|
||||
|
||||
HDC hDC; // handle to device context
|
||||
HWND hWnd; // handle to window
|
||||
HGLRC hGLRC; // handle to GL rendering context
|
||||
|
||||
HINSTANCE hinstOpenGL; // HINSTANCE for the OpenGL library
|
||||
|
||||
qboolean minidriver;
|
||||
qboolean allowdisplaydepthchange;
|
||||
qboolean mcd_accelerated;
|
||||
|
||||
FILE *log_fp;
|
||||
} glwstate_t;
|
||||
|
||||
extern glwstate_t glw_state;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
126
q3radiant/GroupBar.cpp
Normal file → Executable file
126
q3radiant/GroupBar.cpp
Normal file → Executable file
|
|
@ -19,66 +19,66 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// GroupBar.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "GroupBar.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupBar dialog
|
||||
|
||||
|
||||
CGroupBar::CGroupBar(CWnd* pParent /*=NULL*/)
|
||||
: CDialogBar()
|
||||
{
|
||||
//{{AFX_DATA_INIT(CGroupBar)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CGroupBar::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogBar::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CGroupBar)
|
||||
DDX_Control(pDX, IDC_COMBO_GROUPS, m_wndGroupList);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CGroupBar, CDialogBar)
|
||||
//{{AFX_MSG_MAP(CGroupBar)
|
||||
ON_BN_CLICKED(IDC_BTN_ADDGROUP, OnBtnAddgroup)
|
||||
ON_BN_CLICKED(IDC_BTN_LISTGROUPS, OnBtnListgroups)
|
||||
ON_BN_CLICKED(IDC_BTN_REMOVEGROUP, OnBtnRemovegroup)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupBar message handlers
|
||||
|
||||
void CGroupBar::OnBtnAddgroup()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CGroupBar::OnBtnListgroups()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CGroupBar::OnBtnRemovegroup()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
// GroupBar.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "GroupBar.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupBar dialog
|
||||
|
||||
|
||||
CGroupBar::CGroupBar(CWnd* pParent /*=NULL*/)
|
||||
: CDialogBar()
|
||||
{
|
||||
//{{AFX_DATA_INIT(CGroupBar)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CGroupBar::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogBar::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CGroupBar)
|
||||
DDX_Control(pDX, IDC_COMBO_GROUPS, m_wndGroupList);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CGroupBar, CDialogBar)
|
||||
//{{AFX_MSG_MAP(CGroupBar)
|
||||
ON_BN_CLICKED(IDC_BTN_ADDGROUP, OnBtnAddgroup)
|
||||
ON_BN_CLICKED(IDC_BTN_LISTGROUPS, OnBtnListgroups)
|
||||
ON_BN_CLICKED(IDC_BTN_REMOVEGROUP, OnBtnRemovegroup)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupBar message handlers
|
||||
|
||||
void CGroupBar::OnBtnAddgroup()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CGroupBar::OnBtnListgroups()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CGroupBar::OnBtnRemovegroup()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
|
|
|||
96
q3radiant/GroupBar.h
Normal file → Executable file
96
q3radiant/GroupBar.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_GROUPBAR_H__926379A9_F46B_4E81_AD23_71BDDF55BDB3__INCLUDED_)
|
||||
#define AFX_GROUPBAR_H__926379A9_F46B_4E81_AD23_71BDDF55BDB3__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// GroupBar.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupBar dialog
|
||||
|
||||
class CGroupBar : public CDialogBar
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CGroupBar(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CGroupBar)
|
||||
enum { IDD = IDD_GROUPBAR };
|
||||
CComboBox m_wndGroupList;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGroupBar)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CGroupBar)
|
||||
afx_msg void OnBtnAddgroup();
|
||||
afx_msg void OnBtnListgroups();
|
||||
afx_msg void OnBtnRemovegroup();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_GROUPBAR_H__926379A9_F46B_4E81_AD23_71BDDF55BDB3__INCLUDED_)
|
||||
#if !defined(AFX_GROUPBAR_H__926379A9_F46B_4E81_AD23_71BDDF55BDB3__INCLUDED_)
|
||||
#define AFX_GROUPBAR_H__926379A9_F46B_4E81_AD23_71BDDF55BDB3__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// GroupBar.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupBar dialog
|
||||
|
||||
class CGroupBar : public CDialogBar
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CGroupBar(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CGroupBar)
|
||||
enum { IDD = IDD_GROUPBAR };
|
||||
CComboBox m_wndGroupList;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGroupBar)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CGroupBar)
|
||||
afx_msg void OnBtnAddgroup();
|
||||
afx_msg void OnBtnListgroups();
|
||||
afx_msg void OnBtnRemovegroup();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_GROUPBAR_H__926379A9_F46B_4E81_AD23_71BDDF55BDB3__INCLUDED_)
|
||||
|
|
|
|||
1268
q3radiant/GroupDlg.cpp
Normal file → Executable file
1268
q3radiant/GroupDlg.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load diff
138
q3radiant/GroupDlg.h
Normal file → Executable file
138
q3radiant/GroupDlg.h
Normal file → Executable file
|
|
@ -19,72 +19,72 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_GROUPDLG_H__92368487_9E05_454E_A66F_23A9A94A753B__INCLUDED_)
|
||||
#define AFX_GROUPDLG_H__92368487_9E05_454E_A66F_23A9A94A753B__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// GroupDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupDlg dialog
|
||||
|
||||
class CGroupDlg : public CDialog
|
||||
{
|
||||
CImageList m_imgList;
|
||||
// Construction
|
||||
public:
|
||||
virtual void OnOK();
|
||||
virtual void OnCancel();
|
||||
void InitGroups();
|
||||
CGroupDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
HTREEITEM m_hWorld;
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CGroupDlg)
|
||||
enum { IDD = IDD_DLG_GROUP };
|
||||
CTreeCtrl m_wndTree;
|
||||
CButton m_wndEdit;
|
||||
CButton m_wndDel;
|
||||
CButton m_wndAdd;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGroupDlg)
|
||||
public:
|
||||
virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult);
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CGroupDlg)
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnBtnAdd();
|
||||
afx_msg void OnBtnDel();
|
||||
afx_msg void OnBtnEdit();
|
||||
afx_msg void OnRclickTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnEndlabeleditTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnClickTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnSetdispinfoTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBegindragTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
extern CGroupDlg *g_pGroupDlg;
|
||||
|
||||
|
||||
#endif // !defined(AFX_GROUPDLG_H__92368487_9E05_454E_A66F_23A9A94A753B__INCLUDED_)
|
||||
#if !defined(AFX_GROUPDLG_H__92368487_9E05_454E_A66F_23A9A94A753B__INCLUDED_)
|
||||
#define AFX_GROUPDLG_H__92368487_9E05_454E_A66F_23A9A94A753B__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// GroupDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGroupDlg dialog
|
||||
|
||||
class CGroupDlg : public CDialog
|
||||
{
|
||||
CImageList m_imgList;
|
||||
// Construction
|
||||
public:
|
||||
virtual void OnOK();
|
||||
virtual void OnCancel();
|
||||
void InitGroups();
|
||||
CGroupDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
HTREEITEM m_hWorld;
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CGroupDlg)
|
||||
enum { IDD = IDD_DLG_GROUP };
|
||||
CTreeCtrl m_wndTree;
|
||||
CButton m_wndEdit;
|
||||
CButton m_wndDel;
|
||||
CButton m_wndAdd;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CGroupDlg)
|
||||
public:
|
||||
virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult);
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CGroupDlg)
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnBtnAdd();
|
||||
afx_msg void OnBtnDel();
|
||||
afx_msg void OnBtnEdit();
|
||||
afx_msg void OnRclickTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnEndlabeleditTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnClickTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnSetdispinfoTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBegindragTreeGroup(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
extern CGroupDlg *g_pGroupDlg;
|
||||
|
||||
|
||||
#endif // !defined(AFX_GROUPDLG_H__92368487_9E05_454E_A66F_23A9A94A753B__INCLUDED_)
|
||||
|
|
|
|||
158
q3radiant/IBSPFrontend.h
Normal file → Executable file
158
q3radiant/IBSPFrontend.h
Normal file → Executable file
|
|
@ -19,83 +19,83 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.3 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:43:59 $
|
||||
// $Log: IBSPFrontend.h,v $
|
||||
// Revision 1.3 2000/01/18 00:43:59 ttimo
|
||||
// RC
|
||||
//
|
||||
// Revision 1.2 2000/01/13 00:46:41 ttimo
|
||||
// Merged in patches in / out
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 2000/01/13 00:15:41 ttimo
|
||||
// beta of patches in / out - tested with GenSurf
|
||||
//
|
||||
// Revision 1.1.1.1 2000/01/07 17:17:27 ttimo
|
||||
// initial import of Q3Radiant module
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:09 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.2.4 2000/01/07 00:16:26 TBesset
|
||||
// frontend ready for public version
|
||||
//
|
||||
// Revision 1.1.2.3 2000/01/04 00:26:58 TBesset
|
||||
// added a LoadPointFile in BSP frontend
|
||||
//
|
||||
// Revision 1.1.2.2 1999/12/31 19:43:20 TBesset
|
||||
// no message
|
||||
//
|
||||
// Revision 1.1.2.1 1999/12/29 16:49:39 TBesset
|
||||
// adding IBSPFrontend to the repository
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// interface for BSP frontends plugins
|
||||
//
|
||||
|
||||
// DONE: - change BSP menu to Q3Build menu ?
|
||||
// DONE: - detect when Q3Build dies ?
|
||||
// DELAYED: - hotkeys !
|
||||
// SUCCESS: - try again getting feedback from Q3Build
|
||||
|
||||
#ifndef __IBSPFRONTEND_H_
|
||||
#define __IBSPFRONTEND_H_
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {8ED6A480-BA5E-11d3-A3E3-0004AC96D4C3}
|
||||
static const GUID QERPlugBSPFrontendTable_GUID =
|
||||
{ 0x8ed6a480, 0xba5e, 0x11d3, { 0xa3, 0xe3, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
// ask the plugin about the items to show up in the BSP menu
|
||||
typedef char * (WINAPI* PFN_GETBSPMENU) ();
|
||||
// dispatch a BSP menu command
|
||||
typedef void (WINAPI* PFN_DISPATCHBSPCOMMAND) (char *);
|
||||
|
||||
struct _QERPlugBSPFrontendTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_GETBSPMENU m_pfnGetBSPMenu;
|
||||
PFN_DISPATCHBSPCOMMAND m_pfnDispatchBSPCommand;
|
||||
};
|
||||
|
||||
// interface provided by Radiant to the plugin
|
||||
// {A2CCF366-BA60-11d3-A3E3-0004AC96D4C3}
|
||||
static const GUID QERAppBSPFrontendTable_GUID =
|
||||
{ 0xa2ccf366, 0xba60, 0x11d3, { 0xa3, 0xe3, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
typedef char * (WINAPI* PFN_GETMAPNAME) ();
|
||||
typedef void (WINAPI* PFN_LOADPOINTFILE) ();
|
||||
|
||||
struct _QERAppBSPFrontendTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_GETMAPNAME m_pfnGetMapName;
|
||||
PFN_LOADPOINTFILE m_pfnLoadPointFile;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.3 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:43:59 $
|
||||
// $Log: IBSPFrontend.h,v $
|
||||
// Revision 1.3 2000/01/18 00:43:59 ttimo
|
||||
// RC
|
||||
//
|
||||
// Revision 1.2 2000/01/13 00:46:41 ttimo
|
||||
// Merged in patches in / out
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 2000/01/13 00:15:41 ttimo
|
||||
// beta of patches in / out - tested with GenSurf
|
||||
//
|
||||
// Revision 1.1.1.1 2000/01/07 17:17:27 ttimo
|
||||
// initial import of Q3Radiant module
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:09 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.2.4 2000/01/07 00:16:26 TBesset
|
||||
// frontend ready for public version
|
||||
//
|
||||
// Revision 1.1.2.3 2000/01/04 00:26:58 TBesset
|
||||
// added a LoadPointFile in BSP frontend
|
||||
//
|
||||
// Revision 1.1.2.2 1999/12/31 19:43:20 TBesset
|
||||
// no message
|
||||
//
|
||||
// Revision 1.1.2.1 1999/12/29 16:49:39 TBesset
|
||||
// adding IBSPFrontend to the repository
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// interface for BSP frontends plugins
|
||||
//
|
||||
|
||||
// DONE: - change BSP menu to Q3Build menu ?
|
||||
// DONE: - detect when Q3Build dies ?
|
||||
// DELAYED: - hotkeys !
|
||||
// SUCCESS: - try again getting feedback from Q3Build
|
||||
|
||||
#ifndef __IBSPFRONTEND_H_
|
||||
#define __IBSPFRONTEND_H_
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {8ED6A480-BA5E-11d3-A3E3-0004AC96D4C3}
|
||||
static const GUID QERPlugBSPFrontendTable_GUID =
|
||||
{ 0x8ed6a480, 0xba5e, 0x11d3, { 0xa3, 0xe3, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
// ask the plugin about the items to show up in the BSP menu
|
||||
typedef char * (WINAPI* PFN_GETBSPMENU) ();
|
||||
// dispatch a BSP menu command
|
||||
typedef void (WINAPI* PFN_DISPATCHBSPCOMMAND) (char *);
|
||||
|
||||
struct _QERPlugBSPFrontendTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_GETBSPMENU m_pfnGetBSPMenu;
|
||||
PFN_DISPATCHBSPCOMMAND m_pfnDispatchBSPCommand;
|
||||
};
|
||||
|
||||
// interface provided by Radiant to the plugin
|
||||
// {A2CCF366-BA60-11d3-A3E3-0004AC96D4C3}
|
||||
static const GUID QERAppBSPFrontendTable_GUID =
|
||||
{ 0xa2ccf366, 0xba60, 0x11d3, { 0xa3, 0xe3, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
typedef char * (WINAPI* PFN_GETMAPNAME) ();
|
||||
typedef void (WINAPI* PFN_LOADPOINTFILE) ();
|
||||
|
||||
struct _QERAppBSPFrontendTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_GETMAPNAME m_pfnGetMapName;
|
||||
PFN_LOADPOINTFILE m_pfnLoadPointFile;
|
||||
};
|
||||
|
||||
#endif
|
||||
0
q3radiant/ICON1.ICO
Normal file → Executable file
0
q3radiant/ICON1.ICO
Normal file → Executable file
|
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
328
q3radiant/IEpairs.cpp
Normal file → Executable file
328
q3radiant/IEpairs.cpp
Normal file → Executable file
|
|
@ -19,167 +19,167 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:12 $
|
||||
// $Log: IEpairs.cpp,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:41 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// virtual class to allow plugin operations on entities epairs
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
void CEpairsWrapper::GetVectorForKey( char* key, vec3_t vec )
|
||||
{
|
||||
::GetVectorForKey( m_pEnt, key, vec );
|
||||
}
|
||||
|
||||
float CEpairsWrapper::FloatForKey( char *key )
|
||||
{
|
||||
return ::FloatForKey( m_pEnt, key );
|
||||
}
|
||||
|
||||
char* CEpairsWrapper::ValueForKey( char *key )
|
||||
{
|
||||
return ::ValueForKey( m_pEnt, key );
|
||||
}
|
||||
|
||||
void CEpairsWrapper::SetKeyValue( char *key, char *value )
|
||||
{
|
||||
::SetKeyValue( m_pEnt, key, value );
|
||||
}
|
||||
|
||||
void CEpairsWrapper::GetEntityOrigin( vec3_t vec )
|
||||
{
|
||||
VectorCopy( m_pEnt->origin, vec );
|
||||
}
|
||||
|
||||
// taken from Ritual's version of Q3Radiant ( Entity_CalculateRotatedBounds )
|
||||
void CEpairsWrapper::CalculateRotatedBounds( vec3_t mins, vec3_t maxs )
|
||||
{
|
||||
entity_t *ent = m_pEnt;
|
||||
int i;
|
||||
float angle;
|
||||
vec3_t angles;
|
||||
vec3_t forward,right,up;
|
||||
vec3_t rotmins, rotmaxs;
|
||||
float trans[3][3];
|
||||
qboolean changed;
|
||||
char tempangles[ 128 ];
|
||||
|
||||
memset( angles, 0, sizeof(vec3_t) );
|
||||
::GetVectorForKey (ent, "angles", angles);
|
||||
|
||||
changed = false;
|
||||
while ( angles[0] < 0 )
|
||||
{
|
||||
changed = true;
|
||||
angles[0] += 360;
|
||||
}
|
||||
while ( angles[0] > 359 )
|
||||
{
|
||||
changed = true;
|
||||
angles[0] -= 360;
|
||||
}
|
||||
while ( angles[1] < 0 )
|
||||
{
|
||||
changed = true;
|
||||
angles[1] += 360;
|
||||
}
|
||||
while ( angles[1] > 359 )
|
||||
{
|
||||
changed = true;
|
||||
angles[1] -= 360;
|
||||
}
|
||||
while ( angles[2] < 0 )
|
||||
{
|
||||
changed = true;
|
||||
angles[2] += 360;
|
||||
}
|
||||
while ( angles[2] > 359 )
|
||||
{
|
||||
changed = true;
|
||||
angles[2] -= 360;
|
||||
}
|
||||
|
||||
if ( changed )
|
||||
{
|
||||
sprintf( tempangles, "%d %d %d", (int)angles[0], (int)angles[1], (int)angles[2] );
|
||||
::SetKeyValue ( ent, "angles", tempangles );
|
||||
}
|
||||
|
||||
|
||||
angle = ::FloatForKey (ent, "angle");
|
||||
if ( fabs(angle) > 2 )
|
||||
{
|
||||
angles[1] = angle;
|
||||
}
|
||||
else if (angle == -1)
|
||||
{
|
||||
angles[0] = -90;
|
||||
}
|
||||
else if (angle == -2)
|
||||
{
|
||||
angles[0] = 90;
|
||||
}
|
||||
::AngleVectors( angles, forward, right, up );
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
trans[i][0] = forward[i];
|
||||
trans[i][1] = -right[i];
|
||||
trans[i][2] = up[i];
|
||||
}
|
||||
ClearBounds( rotmins, rotmaxs );
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
int j;
|
||||
vec3_t tmp, rottemp;
|
||||
|
||||
if ( i & 1 )
|
||||
tmp[0] = mins[0];
|
||||
else
|
||||
tmp[0] = maxs[0];
|
||||
|
||||
if ( i & 2 )
|
||||
tmp[1] = mins[1];
|
||||
else
|
||||
tmp[1] = maxs[1];
|
||||
|
||||
if ( i & 4 )
|
||||
tmp[2] = mins[2];
|
||||
else
|
||||
tmp[2] = maxs[2];
|
||||
|
||||
for (j=0; j<3 ; j++)
|
||||
{
|
||||
rottemp[j] = DotProduct( tmp, trans[j] );
|
||||
}
|
||||
AddPointToBounds( rottemp, rotmins, rotmaxs );
|
||||
}
|
||||
VectorCopy( rotmins, mins );
|
||||
VectorCopy( rotmaxs, maxs );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:12 $
|
||||
// $Log: IEpairs.cpp,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:41 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// virtual class to allow plugin operations on entities epairs
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
void CEpairsWrapper::GetVectorForKey( char* key, vec3_t vec )
|
||||
{
|
||||
::GetVectorForKey( m_pEnt, key, vec );
|
||||
}
|
||||
|
||||
float CEpairsWrapper::FloatForKey( char *key )
|
||||
{
|
||||
return ::FloatForKey( m_pEnt, key );
|
||||
}
|
||||
|
||||
char* CEpairsWrapper::ValueForKey( char *key )
|
||||
{
|
||||
return ::ValueForKey( m_pEnt, key );
|
||||
}
|
||||
|
||||
void CEpairsWrapper::SetKeyValue( char *key, char *value )
|
||||
{
|
||||
::SetKeyValue( m_pEnt, key, value );
|
||||
}
|
||||
|
||||
void CEpairsWrapper::GetEntityOrigin( vec3_t vec )
|
||||
{
|
||||
VectorCopy( m_pEnt->origin, vec );
|
||||
}
|
||||
|
||||
// taken from Ritual's version of Q3Radiant ( Entity_CalculateRotatedBounds )
|
||||
void CEpairsWrapper::CalculateRotatedBounds( vec3_t mins, vec3_t maxs )
|
||||
{
|
||||
entity_t *ent = m_pEnt;
|
||||
int i;
|
||||
float angle;
|
||||
vec3_t angles;
|
||||
vec3_t forward,right,up;
|
||||
vec3_t rotmins, rotmaxs;
|
||||
float trans[3][3];
|
||||
qboolean changed;
|
||||
char tempangles[ 128 ];
|
||||
|
||||
memset( angles, 0, sizeof(vec3_t) );
|
||||
::GetVectorForKey (ent, "angles", angles);
|
||||
|
||||
changed = false;
|
||||
while ( angles[0] < 0 )
|
||||
{
|
||||
changed = true;
|
||||
angles[0] += 360;
|
||||
}
|
||||
while ( angles[0] > 359 )
|
||||
{
|
||||
changed = true;
|
||||
angles[0] -= 360;
|
||||
}
|
||||
while ( angles[1] < 0 )
|
||||
{
|
||||
changed = true;
|
||||
angles[1] += 360;
|
||||
}
|
||||
while ( angles[1] > 359 )
|
||||
{
|
||||
changed = true;
|
||||
angles[1] -= 360;
|
||||
}
|
||||
while ( angles[2] < 0 )
|
||||
{
|
||||
changed = true;
|
||||
angles[2] += 360;
|
||||
}
|
||||
while ( angles[2] > 359 )
|
||||
{
|
||||
changed = true;
|
||||
angles[2] -= 360;
|
||||
}
|
||||
|
||||
if ( changed )
|
||||
{
|
||||
sprintf( tempangles, "%d %d %d", (int)angles[0], (int)angles[1], (int)angles[2] );
|
||||
::SetKeyValue ( ent, "angles", tempangles );
|
||||
}
|
||||
|
||||
|
||||
angle = ::FloatForKey (ent, "angle");
|
||||
if ( fabs(angle) > 2 )
|
||||
{
|
||||
angles[1] = angle;
|
||||
}
|
||||
else if (angle == -1)
|
||||
{
|
||||
angles[0] = -90;
|
||||
}
|
||||
else if (angle == -2)
|
||||
{
|
||||
angles[0] = 90;
|
||||
}
|
||||
::AngleVectors( angles, forward, right, up );
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
trans[i][0] = forward[i];
|
||||
trans[i][1] = -right[i];
|
||||
trans[i][2] = up[i];
|
||||
}
|
||||
ClearBounds( rotmins, rotmaxs );
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
int j;
|
||||
vec3_t tmp, rottemp;
|
||||
|
||||
if ( i & 1 )
|
||||
tmp[0] = mins[0];
|
||||
else
|
||||
tmp[0] = maxs[0];
|
||||
|
||||
if ( i & 2 )
|
||||
tmp[1] = mins[1];
|
||||
else
|
||||
tmp[1] = maxs[1];
|
||||
|
||||
if ( i & 4 )
|
||||
tmp[2] = mins[2];
|
||||
else
|
||||
tmp[2] = maxs[2];
|
||||
|
||||
for (j=0; j<3 ; j++)
|
||||
{
|
||||
rottemp[j] = DotProduct( tmp, trans[j] );
|
||||
}
|
||||
AddPointToBounds( rottemp, rotmins, rotmaxs );
|
||||
}
|
||||
VectorCopy( rotmins, mins );
|
||||
VectorCopy( rotmaxs, maxs );
|
||||
}
|
||||
|
|
|
|||
122
q3radiant/IEpairs.h
Normal file → Executable file
122
q3radiant/IEpairs.h
Normal file → Executable file
|
|
@ -19,65 +19,65 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:12 $
|
||||
// $Log: IEpairs.h,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:35 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// virtual class to allow plugin operations on entities epairs
|
||||
//
|
||||
|
||||
#ifndef _IEPAIRS_H_
|
||||
#define _IEPAIRS_H_
|
||||
|
||||
class IEpair
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
|
||||
virtual float FloatForKey( char *key ) = 0;
|
||||
virtual char* ValueForKey( char *key ) = 0;
|
||||
virtual void SetKeyValue( char *key, char *value ) = 0;
|
||||
virtual void GetEntityOrigin( vec3_t vec ) = 0;
|
||||
// compute the rotated bounds of the BBox based on "angle" and "angles" keys
|
||||
virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:12 $
|
||||
// $Log: IEpairs.h,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:35 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:26 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// virtual class to allow plugin operations on entities epairs
|
||||
//
|
||||
|
||||
#ifndef _IEPAIRS_H_
|
||||
#define _IEPAIRS_H_
|
||||
|
||||
class IEpair
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
|
||||
virtual float FloatForKey( char *key ) = 0;
|
||||
virtual char* ValueForKey( char *key ) = 0;
|
||||
virtual void SetKeyValue( char *key, char *value ) = 0;
|
||||
virtual void GetEntityOrigin( vec3_t vec ) = 0;
|
||||
// compute the rotated bounds of the BBox based on "angle" and "angles" keys
|
||||
virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
194
q3radiant/IMessaging.h
Normal file → Executable file
194
q3radiant/IMessaging.h
Normal file → Executable file
|
|
@ -19,101 +19,101 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $Log: IMessaging.h,v $
|
||||
// Revision 1.1.2.1 2000/02/04 22:59:34 ttimo
|
||||
// messaging API preview
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// interface for all-purpose messaging in Radiant
|
||||
|
||||
#ifndef __IMESSAGING_H_
|
||||
#define __IMESSAGING_H_
|
||||
|
||||
// this one can be hooked in the GL window procs for customizing GUI through plugins
|
||||
class IWindowListener
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
// since Radiant is MFC we don't use a WNDPROC, we wrap the MFC handlers
|
||||
// the handler is called first, if returns false Radiant continues processing
|
||||
//++timo maybe add more later ? OnKeyUp and OnKeyDown for instance
|
||||
//++timo TODO: add handlers everywhere
|
||||
virtual bool OnLButtonDown(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnMButtonDown(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnRButtonDown(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnLButtonUp(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnMButtonUp(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnRButtonUp(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnMouseMove(UINT nFlags, int x, int y) = 0;
|
||||
};
|
||||
|
||||
// various Radiant messages --------
|
||||
// this one holds the total number of supported messages (this is used to allocate structs)
|
||||
#define RADIANT_MSGCOUNT 3
|
||||
// they start with a 0, can be indexed in an array
|
||||
// something was selected / deselected
|
||||
#define RADIANT_SELECTION 0
|
||||
// a brush face was selected / deselected
|
||||
#define RADIANT_SFACE 1
|
||||
// current texture / shader changed
|
||||
#define RADIANT_TEXTURE 2
|
||||
|
||||
// this one can be used to listen for Radiant-specific events
|
||||
class IListener
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
// message is one of the RADIANT_* consts
|
||||
virtual void DispatchRadiantMsg( int Msg ) = 0;
|
||||
};
|
||||
|
||||
// this one is provided by Radiant, it's a wrapper for some usefull functions
|
||||
class IXYWndWrapper
|
||||
{
|
||||
public:
|
||||
virtual void SnapToGrid( int x1, int y1, vec3_t pt ) = 0;
|
||||
};
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {41FD005C-D36B-11d3-A3E9-0004AC96D4C3}
|
||||
static const GUID QERMessaging_GUID =
|
||||
{ 0x41fd005c, 0xd36b, 0x11d3, { 0xa3, 0xe9, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
// will hook the given IWindowListener to the XY window and increment the ref count
|
||||
//++timo TODO: add hooking in the CAM view and Z view
|
||||
typedef void (WINAPI* PFN_QERAPP_HOOKWINDOW) (IWindowListener *);
|
||||
// will unhook the given IWindowListener
|
||||
typedef void (WINAPI* PFN_QERAPP_UNHOOKWINDOW) (IWindowListener *);
|
||||
// to retrieve the IXYWndWrapper
|
||||
typedef IXYWndWrapper* (WINAPI* PFN_QERAPP_GETXYWNDWRAPPER) ();
|
||||
|
||||
// will hook a given listener into Radiant listening for the given message and increment ref count
|
||||
// call several times to listen for several messages
|
||||
typedef void (WINAPI* PFN_QERAPP_HOOKLISTENER) (IListener *, int Msg);
|
||||
// will unhook the listener and return the number of messages the given listener was removed from
|
||||
typedef int (WINAPI* PFN_QERAPP_UNHOOKLISTENER)(IListener *);
|
||||
|
||||
struct _QERMessagingTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_QERAPP_HOOKWINDOW m_pfnHookWindow;
|
||||
PFN_QERAPP_UNHOOKWINDOW m_pfnUnHookWindow;
|
||||
PFN_QERAPP_GETXYWNDWRAPPER m_pfnGetXYWndWrapper;
|
||||
PFN_QERAPP_HOOKLISTENER m_pfnHookListener;
|
||||
PFN_QERAPP_UNHOOKLISTENER m_pfnUnHookListener;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $Log: IMessaging.h,v $
|
||||
// Revision 1.1.2.1 2000/02/04 22:59:34 ttimo
|
||||
// messaging API preview
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// interface for all-purpose messaging in Radiant
|
||||
|
||||
#ifndef __IMESSAGING_H_
|
||||
#define __IMESSAGING_H_
|
||||
|
||||
// this one can be hooked in the GL window procs for customizing GUI through plugins
|
||||
class IWindowListener
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
// since Radiant is MFC we don't use a WNDPROC, we wrap the MFC handlers
|
||||
// the handler is called first, if returns false Radiant continues processing
|
||||
//++timo maybe add more later ? OnKeyUp and OnKeyDown for instance
|
||||
//++timo TODO: add handlers everywhere
|
||||
virtual bool OnLButtonDown(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnMButtonDown(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnRButtonDown(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnLButtonUp(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnMButtonUp(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnRButtonUp(UINT nFlags, int x, int y) = 0;
|
||||
virtual bool OnMouseMove(UINT nFlags, int x, int y) = 0;
|
||||
};
|
||||
|
||||
// various Radiant messages --------
|
||||
// this one holds the total number of supported messages (this is used to allocate structs)
|
||||
#define RADIANT_MSGCOUNT 3
|
||||
// they start with a 0, can be indexed in an array
|
||||
// something was selected / deselected
|
||||
#define RADIANT_SELECTION 0
|
||||
// a brush face was selected / deselected
|
||||
#define RADIANT_SFACE 1
|
||||
// current texture / shader changed
|
||||
#define RADIANT_TEXTURE 2
|
||||
|
||||
// this one can be used to listen for Radiant-specific events
|
||||
class IListener
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
// message is one of the RADIANT_* consts
|
||||
virtual void DispatchRadiantMsg( int Msg ) = 0;
|
||||
};
|
||||
|
||||
// this one is provided by Radiant, it's a wrapper for some usefull functions
|
||||
class IXYWndWrapper
|
||||
{
|
||||
public:
|
||||
virtual void SnapToGrid( int x1, int y1, vec3_t pt ) = 0;
|
||||
};
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {41FD005C-D36B-11d3-A3E9-0004AC96D4C3}
|
||||
static const GUID QERMessaging_GUID =
|
||||
{ 0x41fd005c, 0xd36b, 0x11d3, { 0xa3, 0xe9, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
// will hook the given IWindowListener to the XY window and increment the ref count
|
||||
//++timo TODO: add hooking in the CAM view and Z view
|
||||
typedef void (WINAPI* PFN_QERAPP_HOOKWINDOW) (IWindowListener *);
|
||||
// will unhook the given IWindowListener
|
||||
typedef void (WINAPI* PFN_QERAPP_UNHOOKWINDOW) (IWindowListener *);
|
||||
// to retrieve the IXYWndWrapper
|
||||
typedef IXYWndWrapper* (WINAPI* PFN_QERAPP_GETXYWNDWRAPPER) ();
|
||||
|
||||
// will hook a given listener into Radiant listening for the given message and increment ref count
|
||||
// call several times to listen for several messages
|
||||
typedef void (WINAPI* PFN_QERAPP_HOOKLISTENER) (IListener *, int Msg);
|
||||
// will unhook the listener and return the number of messages the given listener was removed from
|
||||
typedef int (WINAPI* PFN_QERAPP_UNHOOKLISTENER)(IListener *);
|
||||
|
||||
struct _QERMessagingTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_QERAPP_HOOKWINDOW m_pfnHookWindow;
|
||||
PFN_QERAPP_UNHOOKWINDOW m_pfnUnHookWindow;
|
||||
PFN_QERAPP_GETXYWNDWRAPPER m_pfnGetXYWndWrapper;
|
||||
PFN_QERAPP_HOOKLISTENER m_pfnHookListener;
|
||||
PFN_QERAPP_UNHOOKLISTENER m_pfnUnHookListener;
|
||||
};
|
||||
|
||||
#endif
|
||||
166
q3radiant/IPluginEntities.h
Normal file → Executable file
166
q3radiant/IPluginEntities.h
Normal file → Executable file
|
|
@ -19,87 +19,87 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:12 $
|
||||
// $Log: IPluginEntities.h,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:35 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// _QERPluginEntitiesTable is used by plugins for various plugin entities commands
|
||||
// _QERPlugEntitiesFactory is a set of commands Radiant uses to instanciate plugin entities
|
||||
// next are basics for plugin entities ( interfaces )
|
||||
|
||||
#ifndef __IPLUGINENTITIES_H_
|
||||
#define __IPLUGINENTITIES_H_
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {9613F500-8C7C-11d3-8EF3-C9EB56B6B7BE}
|
||||
static const GUID QERPluginEntitiesTable_GUID =
|
||||
{ 0x9613f500, 0x8c7c, 0x11d3, { 0x8e, 0xf3, 0xc9, 0xeb, 0x56, 0xb6, 0xb7, 0xbe } };
|
||||
|
||||
typedef int (WINAPI* PFN_ECLASSSCANDIR) ( char*, HMODULE );
|
||||
|
||||
struct _QERPluginEntitiesTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_ECLASSSCANDIR m_pfnEClassScanDir;
|
||||
};
|
||||
|
||||
// plugin entities
|
||||
class IPluginEntity
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
// getting bounds of the brush used to select/move the object
|
||||
virtual void GetBounds( vec3_t mins, vec3_t maxs ) = 0;
|
||||
// rendering the object in the camera view
|
||||
virtual void CamRender() = 0;
|
||||
};
|
||||
|
||||
// {DBC6B300-8E4B-11d3-8EF3-BA5E57D56399}
|
||||
static const GUID QERPlugEntitiesFactory_GUID =
|
||||
{ 0xdbc6b300, 0x8e4b, 0x11d3, { 0x8e, 0xf3, 0xba, 0x5e, 0x57, 0xd5, 0x63, 0x99 } };
|
||||
|
||||
typedef IPluginEntity * (WINAPI* PFN_CREATEENTITY) ( eclass_t *, IEpair * );
|
||||
|
||||
struct _QERPlugEntitiesFactory
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_CREATEENTITY m_pfnCreateEntity;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:12 $
|
||||
// $Log: IPluginEntities.h,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:35 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// _QERPluginEntitiesTable is used by plugins for various plugin entities commands
|
||||
// _QERPlugEntitiesFactory is a set of commands Radiant uses to instanciate plugin entities
|
||||
// next are basics for plugin entities ( interfaces )
|
||||
|
||||
#ifndef __IPLUGINENTITIES_H_
|
||||
#define __IPLUGINENTITIES_H_
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {9613F500-8C7C-11d3-8EF3-C9EB56B6B7BE}
|
||||
static const GUID QERPluginEntitiesTable_GUID =
|
||||
{ 0x9613f500, 0x8c7c, 0x11d3, { 0x8e, 0xf3, 0xc9, 0xeb, 0x56, 0xb6, 0xb7, 0xbe } };
|
||||
|
||||
typedef int (WINAPI* PFN_ECLASSSCANDIR) ( char*, HMODULE );
|
||||
|
||||
struct _QERPluginEntitiesTable
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_ECLASSSCANDIR m_pfnEClassScanDir;
|
||||
};
|
||||
|
||||
// plugin entities
|
||||
class IPluginEntity
|
||||
{
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
virtual void IncRef () = 0;
|
||||
// Decrement the reference count
|
||||
virtual void DecRef () = 0;
|
||||
// getting bounds of the brush used to select/move the object
|
||||
virtual void GetBounds( vec3_t mins, vec3_t maxs ) = 0;
|
||||
// rendering the object in the camera view
|
||||
virtual void CamRender() = 0;
|
||||
};
|
||||
|
||||
// {DBC6B300-8E4B-11d3-8EF3-BA5E57D56399}
|
||||
static const GUID QERPlugEntitiesFactory_GUID =
|
||||
{ 0xdbc6b300, 0x8e4b, 0x11d3, { 0x8e, 0xf3, 0xba, 0x5e, 0x57, 0xd5, 0x63, 0x99 } };
|
||||
|
||||
typedef IPluginEntity * (WINAPI* PFN_CREATEENTITY) ( eclass_t *, IEpair * );
|
||||
|
||||
struct _QERPlugEntitiesFactory
|
||||
{
|
||||
int m_nSize;
|
||||
PFN_CREATEENTITY m_pfnCreateEntity;
|
||||
};
|
||||
|
||||
#endif
|
||||
182
q3radiant/ISelectedFace.h
Normal file → Executable file
182
q3radiant/ISelectedFace.h
Normal file → Executable file
|
|
@ -19,95 +19,95 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/10 03:00:20 $
|
||||
// $Log: ISelectedFace.h,v $
|
||||
// Revision 1.1.1.4.2.1 2000/02/10 03:00:20 ttimo
|
||||
// adding IShaders.h
|
||||
//
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:35 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.4.3 1999/11/15 22:39:40 Timo & Christine
|
||||
// bug fixing / additional features after update 173 from Robert
|
||||
//
|
||||
// Revision 1.1.4.2 1999/11/14 16:26:10 Timo & Christine
|
||||
// first beta of the ritualmap surface plugin
|
||||
//
|
||||
// Revision 1.1.4.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
// Revision 1.1.2.1 1999/10/27 08:34:26 Timo & Christine
|
||||
// preview version of the texture tools plugin is ready
|
||||
// ( TexTool.dll plugin is in Q3Plugin module )
|
||||
// plugins can draw in their own window using Radiant's qgl bindings
|
||||
//
|
||||
//
|
||||
// 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 a GUID for this interface so plugins can access and reference it
|
||||
// {5416A2A0-8633-11d3-8EF3-88B61F3A3B12}
|
||||
static const GUID QERSelectedFaceTable_GUID =
|
||||
{ 0x5416a2a0, 0x8633, 0x11d3, { 0x8e, 0xf3, 0x88, 0xb6, 0x1f, 0x3a, 0x3b, 0x12 } };
|
||||
|
||||
//++timo TODO: this interface needs some cleanup with the new texture / shaders interface
|
||||
|
||||
// retrieve the texture number to bind to
|
||||
typedef int (WINAPI* PFN_GETTEXTURENUMBER) ();
|
||||
// winding_t is assumed to have MAX_POINTS_ON_WINDING allocated
|
||||
typedef int (WINAPI* PFN_GETFACEINFO) (_QERFaceData*, winding_t* );
|
||||
// tell editor to update the selected face data
|
||||
typedef int (WINAPI* PFN_SETFACEINFO) (_QERFaceData*);
|
||||
// retrieving some texture information
|
||||
typedef void (WINAPI* PFN_GETTEXTURESIZE) ( int Size[2] );
|
||||
// loading the qtexture_t from the texture name
|
||||
typedef qtexture_t* (WINAPI* PFN_TEXTUREFORNAME) ( const char *name );
|
||||
// straight func pointer to Select_SetTexture
|
||||
// last parameter must be casted to an IPluginTexdef
|
||||
typedef void (WINAPI* PFN_SELECT_SETTEXTURE) (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, void* pPlugTexdef );
|
||||
|
||||
// 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;
|
||||
PFN_GETTEXTURENUMBER m_pfnGetTextureNumber;
|
||||
PFN_GETFACEINFO m_pfnGetFaceInfo;
|
||||
PFN_SETFACEINFO m_pfnSetFaceInfo;
|
||||
PFN_GETTEXTURESIZE m_pfnGetTextureSize;
|
||||
PFN_TEXTUREFORNAME m_pfnTextureForName;
|
||||
PFN_SELECT_SETTEXTURE m_pfnSelect_SetTexture;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/10 03:00:20 $
|
||||
// $Log: ISelectedFace.h,v $
|
||||
// Revision 1.1.1.4.2.1 2000/02/10 03:00:20 ttimo
|
||||
// adding IShaders.h
|
||||
//
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:12 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:10 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:35 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:27 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:45 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.4.3 1999/11/15 22:39:40 Timo & Christine
|
||||
// bug fixing / additional features after update 173 from Robert
|
||||
//
|
||||
// Revision 1.1.4.2 1999/11/14 16:26:10 Timo & Christine
|
||||
// first beta of the ritualmap surface plugin
|
||||
//
|
||||
// Revision 1.1.4.1 1999/11/03 20:37:59 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
// Revision 1.1.2.1 1999/10/27 08:34:26 Timo & Christine
|
||||
// preview version of the texture tools plugin is ready
|
||||
// ( TexTool.dll plugin is in Q3Plugin module )
|
||||
// plugins can draw in their own window using Radiant's qgl bindings
|
||||
//
|
||||
//
|
||||
// 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 a GUID for this interface so plugins can access and reference it
|
||||
// {5416A2A0-8633-11d3-8EF3-88B61F3A3B12}
|
||||
static const GUID QERSelectedFaceTable_GUID =
|
||||
{ 0x5416a2a0, 0x8633, 0x11d3, { 0x8e, 0xf3, 0x88, 0xb6, 0x1f, 0x3a, 0x3b, 0x12 } };
|
||||
|
||||
//++timo TODO: this interface needs some cleanup with the new texture / shaders interface
|
||||
|
||||
// retrieve the texture number to bind to
|
||||
typedef int (WINAPI* PFN_GETTEXTURENUMBER) ();
|
||||
// winding_t is assumed to have MAX_POINTS_ON_WINDING allocated
|
||||
typedef int (WINAPI* PFN_GETFACEINFO) (_QERFaceData*, winding_t* );
|
||||
// tell editor to update the selected face data
|
||||
typedef int (WINAPI* PFN_SETFACEINFO) (_QERFaceData*);
|
||||
// retrieving some texture information
|
||||
typedef void (WINAPI* PFN_GETTEXTURESIZE) ( int Size[2] );
|
||||
// loading the qtexture_t from the texture name
|
||||
typedef qtexture_t* (WINAPI* PFN_TEXTUREFORNAME) ( const char *name );
|
||||
// straight func pointer to Select_SetTexture
|
||||
// last parameter must be casted to an IPluginTexdef
|
||||
typedef void (WINAPI* PFN_SELECT_SETTEXTURE) (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, void* pPlugTexdef );
|
||||
|
||||
// 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;
|
||||
PFN_GETTEXTURENUMBER m_pfnGetTextureNumber;
|
||||
PFN_GETFACEINFO m_pfnGetFaceInfo;
|
||||
PFN_SETFACEINFO m_pfnSetFaceInfo;
|
||||
PFN_GETTEXTURESIZE m_pfnGetTextureSize;
|
||||
PFN_TEXTUREFORNAME m_pfnTextureForName;
|
||||
PFN_SELECT_SETTEXTURE m_pfnSelect_SetTexture;
|
||||
};
|
||||
|
||||
#endif
|
||||
130
q3radiant/IShaders.cpp
Normal file → Executable file
130
q3radiant/IShaders.cpp
Normal file → Executable file
|
|
@ -19,68 +19,68 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.2 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/24 22:24:45 $
|
||||
// $Log: IShaders.cpp,v $
|
||||
// Revision 1.1.2.2 2000/02/24 22:24:45 ttimo
|
||||
// RC2
|
||||
//
|
||||
// Revision 1.1.2.1 2000/02/11 03:52:30 ttimo
|
||||
// working on the IShader interface
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// implementation of the shaders / textures interface
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
//++timo NOTE: this whole part is evolving on a seperate branch on SourceForge
|
||||
// will eventually turn into a major rewrite of the shader / texture code
|
||||
|
||||
// this is a modified version of Texture_ForName
|
||||
qtexture_t* WINAPI QERApp_TryTextureForName(const char* name)
|
||||
{
|
||||
qtexture_t *q;
|
||||
char filename[1024];
|
||||
for (q=g_qeglobals.d_qtextures ; q ; q=q->next)
|
||||
{
|
||||
if (!strcmp(name, q->filename))
|
||||
return q;
|
||||
}
|
||||
// try loading from file .. this is a copy of the worst part of Texture_ForName
|
||||
char cWork[1024];
|
||||
sprintf (filename, "%s/%s.tga", ValueForKey (g_qeglobals.d_project_entity, "texturepath"), name);
|
||||
QE_ConvertDOSToUnixName( cWork, filename );
|
||||
strcpy(filename, cWork);
|
||||
unsigned char* pPixels = NULL;
|
||||
int nWidth;
|
||||
int nHeight;
|
||||
LoadImage(filename, &pPixels, &nWidth, &nHeight);
|
||||
if (pPixels == NULL)
|
||||
{
|
||||
// try jpg
|
||||
// blatant assumption of .tga should be fine since we sprintf'd it above
|
||||
int nLen = strlen(filename);
|
||||
filename[nLen-3] = 'j';
|
||||
filename[nLen-2] = 'p';
|
||||
filename[nLen-1] = 'g';
|
||||
LoadImage(filename, &pPixels, &nWidth, &nHeight);
|
||||
}
|
||||
if (pPixels)
|
||||
{
|
||||
q = Texture_LoadTGATexture(pPixels, nWidth, nHeight, NULL, 0, 0, 0);
|
||||
//++timo storing the filename .. will be removed by shader code cleanup
|
||||
// this is dirty, and we sure miss some places were we should fill the filename info
|
||||
strcpy( q->filename, name );
|
||||
SetNameShaderInfo(q, filename, name);
|
||||
Sys_Printf ("done.\n", name);
|
||||
free(pPixels);
|
||||
return q;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.2 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/24 22:24:45 $
|
||||
// $Log: IShaders.cpp,v $
|
||||
// Revision 1.1.2.2 2000/02/24 22:24:45 ttimo
|
||||
// RC2
|
||||
//
|
||||
// Revision 1.1.2.1 2000/02/11 03:52:30 ttimo
|
||||
// working on the IShader interface
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// implementation of the shaders / textures interface
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
//++timo NOTE: this whole part is evolving on a seperate branch on SourceForge
|
||||
// will eventually turn into a major rewrite of the shader / texture code
|
||||
|
||||
// this is a modified version of Texture_ForName
|
||||
qtexture_t* WINAPI QERApp_TryTextureForName(const char* name)
|
||||
{
|
||||
qtexture_t *q;
|
||||
char filename[1024];
|
||||
for (q=g_qeglobals.d_qtextures ; q ; q=q->next)
|
||||
{
|
||||
if (!strcmp(name, q->filename))
|
||||
return q;
|
||||
}
|
||||
// try loading from file .. this is a copy of the worst part of Texture_ForName
|
||||
char cWork[1024];
|
||||
sprintf (filename, "%s/%s.tga", ValueForKey (g_qeglobals.d_project_entity, "texturepath"), name);
|
||||
QE_ConvertDOSToUnixName( cWork, filename );
|
||||
strcpy(filename, cWork);
|
||||
unsigned char* pPixels = NULL;
|
||||
int nWidth;
|
||||
int nHeight;
|
||||
LoadImage(filename, &pPixels, &nWidth, &nHeight);
|
||||
if (pPixels == NULL)
|
||||
{
|
||||
// try jpg
|
||||
// blatant assumption of .tga should be fine since we sprintf'd it above
|
||||
int nLen = strlen(filename);
|
||||
filename[nLen-3] = 'j';
|
||||
filename[nLen-2] = 'p';
|
||||
filename[nLen-1] = 'g';
|
||||
LoadImage(filename, &pPixels, &nWidth, &nHeight);
|
||||
}
|
||||
if (pPixels)
|
||||
{
|
||||
q = Texture_LoadTGATexture(pPixels, nWidth, nHeight, NULL, 0, 0, 0);
|
||||
//++timo storing the filename .. will be removed by shader code cleanup
|
||||
// this is dirty, and we sure miss some places were we should fill the filename info
|
||||
strcpy( q->filename, name );
|
||||
SetNameShaderInfo(q, filename, name);
|
||||
Sys_Printf ("done.\n", name);
|
||||
free(pPixels);
|
||||
return q;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
114
q3radiant/IShaders.h
Normal file → Executable file
114
q3radiant/IShaders.h
Normal file → Executable file
|
|
@ -19,61 +19,61 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.3 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/24 22:24:45 $
|
||||
// $Log: IShaders.h,v $
|
||||
// Revision 1.1.2.3 2000/02/24 22:24:45 ttimo
|
||||
// RC2
|
||||
//
|
||||
// Revision 1.1.2.2 2000/02/11 03:52:30 ttimo
|
||||
// working on the IShader interface
|
||||
//
|
||||
// Revision 1.1.2.1 2000/02/10 03:00:20 ttimo
|
||||
// adding IShaders.h
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// a set of functions to manipulate textures in Radiant
|
||||
//
|
||||
|
||||
#ifndef __ISHADERS_H_
|
||||
#define __ISHADERS_H_
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {D42F798A-DF57-11d3-A3EE-0004AC96D4C3}
|
||||
static const GUID QERShadersTable_GUID =
|
||||
{ 0xd42f798a, 0xdf57, 0x11d3, { 0xa3, 0xee, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
//++timo NOTE: global strategy, when there's try before it means .. if the thing can't be found / loaded it will not
|
||||
// create a default one
|
||||
|
||||
//++timo TODO: duplicate _QERFuncTable_1::m_pfnHasShader here?
|
||||
//++timo FIXME: change the names to fit the changes we wanna do in the Radiant shader / textures code
|
||||
//++timo NOTE: for Curry, this shader loading thingy is only provided so that we can update the Radiant texture window?
|
||||
// don't use yet .. will not implement yet
|
||||
// get a shader, load it if needed
|
||||
// returns NULL if shader doesn't exist
|
||||
//++timo will reload the shader if already loaded? .. no, don't do that yet ..
|
||||
//++timo I'm not happy with the name?
|
||||
typedef qtexture_t* (WINAPI* PFN_TRYSHADERFORNAME) (const char* name);
|
||||
// load a texture
|
||||
// will not try loading a shader, will look for the actual image file ..
|
||||
// returns NULL on file not found
|
||||
// NOTE: don't put the .tga or .jpg filetype extension
|
||||
// if returns NULL, it means the texture needs loading, use _QERSelectedFaceTable::m_pfnTextureForName
|
||||
//++timo NOTE: all of this is hacks and workarounds, the shader code rewrite is supposed to solve all issues
|
||||
typedef qtexture_t* (WINAPI* PFN_TRYTEXTUREFORNAME) (const char* filename);
|
||||
|
||||
struct _QERShadersTable
|
||||
{
|
||||
int m_nSize;
|
||||
// currently disabled
|
||||
// PFN_TRYLOADSHADER m_pfnTryLoadShader;
|
||||
PFN_TRYTEXTUREFORNAME m_pfnTryTextureForName;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.3 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/24 22:24:45 $
|
||||
// $Log: IShaders.h,v $
|
||||
// Revision 1.1.2.3 2000/02/24 22:24:45 ttimo
|
||||
// RC2
|
||||
//
|
||||
// Revision 1.1.2.2 2000/02/11 03:52:30 ttimo
|
||||
// working on the IShader interface
|
||||
//
|
||||
// Revision 1.1.2.1 2000/02/10 03:00:20 ttimo
|
||||
// adding IShaders.h
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// a set of functions to manipulate textures in Radiant
|
||||
//
|
||||
|
||||
#ifndef __ISHADERS_H_
|
||||
#define __ISHADERS_H_
|
||||
|
||||
// define a GUID for this interface so plugins can access and reference it
|
||||
// {D42F798A-DF57-11d3-A3EE-0004AC96D4C3}
|
||||
static const GUID QERShadersTable_GUID =
|
||||
{ 0xd42f798a, 0xdf57, 0x11d3, { 0xa3, 0xee, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } };
|
||||
|
||||
//++timo NOTE: global strategy, when there's try before it means .. if the thing can't be found / loaded it will not
|
||||
// create a default one
|
||||
|
||||
//++timo TODO: duplicate _QERFuncTable_1::m_pfnHasShader here?
|
||||
//++timo FIXME: change the names to fit the changes we wanna do in the Radiant shader / textures code
|
||||
//++timo NOTE: for Curry, this shader loading thingy is only provided so that we can update the Radiant texture window?
|
||||
// don't use yet .. will not implement yet
|
||||
// get a shader, load it if needed
|
||||
// returns NULL if shader doesn't exist
|
||||
//++timo will reload the shader if already loaded? .. no, don't do that yet ..
|
||||
//++timo I'm not happy with the name?
|
||||
typedef qtexture_t* (WINAPI* PFN_TRYSHADERFORNAME) (const char* name);
|
||||
// load a texture
|
||||
// will not try loading a shader, will look for the actual image file ..
|
||||
// returns NULL on file not found
|
||||
// NOTE: don't put the .tga or .jpg filetype extension
|
||||
// if returns NULL, it means the texture needs loading, use _QERSelectedFaceTable::m_pfnTextureForName
|
||||
//++timo NOTE: all of this is hacks and workarounds, the shader code rewrite is supposed to solve all issues
|
||||
typedef qtexture_t* (WINAPI* PFN_TRYTEXTUREFORNAME) (const char* filename);
|
||||
|
||||
struct _QERShadersTable
|
||||
{
|
||||
int m_nSize;
|
||||
// currently disabled
|
||||
// PFN_TRYLOADSHADER m_pfnTryLoadShader;
|
||||
PFN_TRYTEXTUREFORNAME m_pfnTryTextureForName;
|
||||
};
|
||||
|
||||
#endif
|
||||
2616
q3radiant/LBMLIB.CPP
Normal file → Executable file
2616
q3radiant/LBMLIB.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
38
q3radiant/LBMLIB.H
Normal file → Executable file
38
q3radiant/LBMLIB.H
Normal file → Executable file
|
|
@ -19,22 +19,22 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// piclib.h
|
||||
|
||||
|
||||
void LoadLBM (char *filename, byte **picture, byte **palette);
|
||||
void WriteLBMfile (char *filename, byte *data, int width, int height
|
||||
, byte *palette);
|
||||
void LoadPCX (char *filename, byte **picture, byte **palette, int *width, int *height);
|
||||
void WritePCXfile (char *filename, byte *data, int width, int height
|
||||
, byte *palette);
|
||||
|
||||
// loads / saves either lbm or pcx, depending on extension
|
||||
void Load256Image (char *name, byte **pixels, byte **palette,
|
||||
int *width, int *height);
|
||||
void Save256Image (char *name, byte *pixels, byte *palette,
|
||||
int width, int height);
|
||||
|
||||
|
||||
void LoadTGA (char *filename, byte **pixels, int *width, int *height);
|
||||
void LoadImage( const char *name, byte **pic, int *width, int *height );
|
||||
// piclib.h
|
||||
|
||||
|
||||
void LoadLBM (char *filename, byte **picture, byte **palette);
|
||||
void WriteLBMfile (char *filename, byte *data, int width, int height
|
||||
, byte *palette);
|
||||
void LoadPCX (char *filename, byte **picture, byte **palette, int *width, int *height);
|
||||
void WritePCXfile (char *filename, byte *data, int width, int height
|
||||
, byte *palette);
|
||||
|
||||
// loads / saves either lbm or pcx, depending on extension
|
||||
void Load256Image (char *name, byte **pixels, byte **palette,
|
||||
int *width, int *height);
|
||||
void Save256Image (char *name, byte *pixels, byte *palette,
|
||||
int width, int height);
|
||||
|
||||
|
||||
void LoadTGA (char *filename, byte **pixels, int *width, int *height);
|
||||
void LoadImage( const char *name, byte **pic, int *width, int *height );
|
||||
|
|
|
|||
76
q3radiant/LstToolBar.cpp
Normal file → Executable file
76
q3radiant/LstToolBar.cpp
Normal file → Executable file
|
|
@ -19,41 +19,41 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// LstToolBar.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "LstToolBar.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLstToolBar
|
||||
|
||||
CLstToolBar::CLstToolBar()
|
||||
{
|
||||
}
|
||||
|
||||
CLstToolBar::~CLstToolBar()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CLstToolBar, CToolBar)
|
||||
//{{AFX_MSG_MAP(CLstToolBar)
|
||||
ON_WM_PARENTNOTIFY()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLstToolBar message handlers
|
||||
|
||||
void CLstToolBar::OnParentNotify(UINT message, LPARAM lParam)
|
||||
{
|
||||
CToolBar::OnParentNotify(message, lParam);
|
||||
}
|
||||
// LstToolBar.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "LstToolBar.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLstToolBar
|
||||
|
||||
CLstToolBar::CLstToolBar()
|
||||
{
|
||||
}
|
||||
|
||||
CLstToolBar::~CLstToolBar()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CLstToolBar, CToolBar)
|
||||
//{{AFX_MSG_MAP(CLstToolBar)
|
||||
ON_WM_PARENTNOTIFY()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLstToolBar message handlers
|
||||
|
||||
void CLstToolBar::OnParentNotify(UINT message, LPARAM lParam)
|
||||
{
|
||||
CToolBar::OnParentNotify(message, lParam);
|
||||
}
|
||||
|
|
|
|||
96
q3radiant/LstToolBar.h
Normal file → Executable file
96
q3radiant/LstToolBar.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_LSTTOOLBAR_H__279AAE23_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_LSTTOOLBAR_H__279AAE23_78C5_11D1_B53C_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// LstToolBar.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLstToolBar window
|
||||
|
||||
class CLstToolBar : public CToolBar
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CLstToolBar();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CLstToolBar)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CLstToolBar();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CLstToolBar)
|
||||
afx_msg void OnParentNotify(UINT message, LPARAM lParam);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_LSTTOOLBAR_H__279AAE23_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_LSTTOOLBAR_H__279AAE23_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_LSTTOOLBAR_H__279AAE23_78C5_11D1_B53C_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// LstToolBar.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLstToolBar window
|
||||
|
||||
class CLstToolBar : public CToolBar
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CLstToolBar();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CLstToolBar)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CLstToolBar();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CLstToolBar)
|
||||
afx_msg void OnParentNotify(UINT message, LPARAM lParam);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_LSTTOOLBAR_H__279AAE23_78C5_11D1_B53C_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
2080
q3radiant/MAP.CPP
Normal file → Executable file
2080
q3radiant/MAP.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
76
q3radiant/MAP.H
Normal file → Executable file
76
q3radiant/MAP.H
Normal file → Executable file
|
|
@ -19,41 +19,41 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// map.h -- the state of the current world that all views are displaying
|
||||
|
||||
extern char currentmap[1024];
|
||||
|
||||
// head/tail of doubly linked lists
|
||||
extern brush_t active_brushes; // brushes currently being displayed
|
||||
extern brush_t selected_brushes; // highlighted
|
||||
|
||||
|
||||
extern CPtrArray& g_ptrSelectedFaces;
|
||||
extern CPtrArray& g_ptrSelectedFaceBrushes;
|
||||
//extern face_t *selected_face;
|
||||
//extern brush_t *selected_face_brush;
|
||||
extern brush_t filtered_brushes; // brushes that have been filtered or regioned
|
||||
|
||||
extern entity_t entities;
|
||||
extern entity_t *world_entity; // the world entity is NOT included in
|
||||
// the entities chain
|
||||
|
||||
extern qboolean modified; // for quit confirmations
|
||||
|
||||
extern vec3_t region_mins, region_maxs;
|
||||
extern qboolean region_active;
|
||||
|
||||
void Map_LoadFile (char *filename);
|
||||
void Map_SaveFile (char *filename, qboolean use_region);
|
||||
void Map_New (void);
|
||||
void Map_BuildBrushData(void);
|
||||
|
||||
void Map_RegionOff (void);
|
||||
void Map_RegionXY (void);
|
||||
void Map_RegionTallBrush (void);
|
||||
void Map_RegionBrush (void);
|
||||
void Map_RegionSelectedBrushes (void);
|
||||
qboolean Map_IsBrushFiltered (brush_t *b);
|
||||
|
||||
void Map_SaveSelected(CMemFile* pMemFile, CMemFile* pPatchFile = NULL);
|
||||
void Map_ImportBuffer (char* buf);
|
||||
// map.h -- the state of the current world that all views are displaying
|
||||
|
||||
extern char currentmap[1024];
|
||||
|
||||
// head/tail of doubly linked lists
|
||||
extern brush_t active_brushes; // brushes currently being displayed
|
||||
extern brush_t selected_brushes; // highlighted
|
||||
|
||||
|
||||
extern CPtrArray& g_ptrSelectedFaces;
|
||||
extern CPtrArray& g_ptrSelectedFaceBrushes;
|
||||
//extern face_t *selected_face;
|
||||
//extern brush_t *selected_face_brush;
|
||||
extern brush_t filtered_brushes; // brushes that have been filtered or regioned
|
||||
|
||||
extern entity_t entities;
|
||||
extern entity_t *world_entity; // the world entity is NOT included in
|
||||
// the entities chain
|
||||
|
||||
extern qboolean modified; // for quit confirmations
|
||||
|
||||
extern vec3_t region_mins, region_maxs;
|
||||
extern qboolean region_active;
|
||||
|
||||
void Map_LoadFile (char *filename);
|
||||
void Map_SaveFile (char *filename, qboolean use_region);
|
||||
void Map_New (void);
|
||||
void Map_BuildBrushData(void);
|
||||
|
||||
void Map_RegionOff (void);
|
||||
void Map_RegionXY (void);
|
||||
void Map_RegionTallBrush (void);
|
||||
void Map_RegionBrush (void);
|
||||
void Map_RegionSelectedBrushes (void);
|
||||
qboolean Map_IsBrushFiltered (brush_t *b);
|
||||
|
||||
void Map_SaveSelected(CMemFile* pMemFile, CMemFile* pPatchFile = NULL);
|
||||
void Map_ImportBuffer (char* buf);
|
||||
|
|
|
|||
580
q3radiant/MATHLIB.CPP
Normal file → Executable file
580
q3radiant/MATHLIB.CPP
Normal file → Executable file
|
|
@ -19,293 +19,293 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// mathlib.c -- math primitives
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "cmdlib.h"
|
||||
#include "mathlib.h"
|
||||
|
||||
vec3_t vec3_origin = {0.0f,0.0f,0.0f};
|
||||
|
||||
|
||||
float VectorLength(vec3_t v)
|
||||
{
|
||||
int i;
|
||||
float length;
|
||||
|
||||
length = 0.0f;
|
||||
for (i=0 ; i< 3 ; i++)
|
||||
length += v[i]*v[i];
|
||||
length = (float)sqrt (length);
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
qboolean VectorCompare (vec3_t v1, vec3_t v2)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
if (fabs(v1[i]-v2[i]) > EQUAL_EPSILON)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
vec_t Q_rint (vec_t in)
|
||||
{
|
||||
if (g_PrefsDlg.m_bNoClamp)
|
||||
return in;
|
||||
else
|
||||
return (float)floor (in + 0.5);
|
||||
}
|
||||
|
||||
void VectorMA (vec3_t va, float scale, vec3_t vb, vec3_t vc)
|
||||
{
|
||||
vc[0] = va[0] + scale*vb[0];
|
||||
vc[1] = va[1] + scale*vb[1];
|
||||
vc[2] = va[2] + scale*vb[2];
|
||||
}
|
||||
|
||||
void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross)
|
||||
{
|
||||
cross[0] = v1[1]*v2[2] - v1[2]*v2[1];
|
||||
cross[1] = v1[2]*v2[0] - v1[0]*v2[2];
|
||||
cross[2] = v1[0]*v2[1] - v1[1]*v2[0];
|
||||
}
|
||||
|
||||
vec_t _DotProduct (vec3_t v1, vec3_t v2)
|
||||
{
|
||||
return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
|
||||
}
|
||||
|
||||
void _VectorSubtract (vec3_t va, vec3_t vb, vec3_t out)
|
||||
{
|
||||
out[0] = va[0]-vb[0];
|
||||
out[1] = va[1]-vb[1];
|
||||
out[2] = va[2]-vb[2];
|
||||
}
|
||||
|
||||
void _VectorAdd (vec3_t va, vec3_t vb, vec3_t out)
|
||||
{
|
||||
out[0] = va[0]+vb[0];
|
||||
out[1] = va[1]+vb[1];
|
||||
out[2] = va[2]+vb[2];
|
||||
}
|
||||
|
||||
void _VectorCopy (vec3_t in, vec3_t out)
|
||||
{
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
}
|
||||
|
||||
vec_t VectorNormalize (vec3_t v)
|
||||
{
|
||||
int i;
|
||||
float length;
|
||||
|
||||
length = 0.0f;
|
||||
for (i=0 ; i< 3 ; i++)
|
||||
length += v[i]*v[i];
|
||||
length = (float)sqrt (length);
|
||||
if (length == 0)
|
||||
return (vec_t)0;
|
||||
|
||||
for (i=0 ; i< 3 ; i++)
|
||||
v[i] /= length;
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
void VectorInverse (vec3_t v)
|
||||
{
|
||||
v[0] = -v[0];
|
||||
v[1] = -v[1];
|
||||
v[2] = -v[2];
|
||||
}
|
||||
|
||||
void VectorScale (vec3_t v, vec_t scale, vec3_t out)
|
||||
{
|
||||
out[0] = v[0] * scale;
|
||||
out[1] = v[1] * scale;
|
||||
out[2] = v[2] * scale;
|
||||
}
|
||||
|
||||
|
||||
void VectorRotate (vec3_t vIn, vec3_t vRotation, vec3_t out)
|
||||
{
|
||||
vec3_t vWork, va;
|
||||
VectorCopy(vIn, va);
|
||||
VectorCopy(va, vWork);
|
||||
int nIndex[3][2];
|
||||
nIndex[0][0] = 1; nIndex[0][1] = 2;
|
||||
nIndex[1][0] = 2; nIndex[1][1] = 0;
|
||||
nIndex[2][0] = 0; nIndex[2][1] = 1;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (vRotation[i] != 0)
|
||||
{
|
||||
double dAngle = vRotation[i] * Q_PI / 180.0;
|
||||
double c = cos(dAngle);
|
||||
double s = sin(dAngle);
|
||||
vWork[nIndex[i][0]] = va[nIndex[i][0]] * c - va[nIndex[i][1]] * s;
|
||||
vWork[nIndex[i][1]] = va[nIndex[i][0]] * s + va[nIndex[i][1]] * c;
|
||||
}
|
||||
VectorCopy(vWork, va);
|
||||
}
|
||||
VectorCopy(vWork, out);
|
||||
}
|
||||
|
||||
void VectorRotate (vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out)
|
||||
{
|
||||
vec3_t vTemp, vTemp2;
|
||||
VectorSubtract(vIn, vOrigin, vTemp);
|
||||
VectorRotate(vTemp, vRotation, vTemp2);
|
||||
VectorAdd(vTemp2, vOrigin, out);
|
||||
}
|
||||
|
||||
void VectorPolar(vec3_t v, float radius, float theta, float phi)
|
||||
{
|
||||
v[0]=float(radius * cos(theta) * cos(phi));
|
||||
v[1]=float(radius * sin(theta) * cos(phi));
|
||||
v[2]=float(radius * sin(phi));
|
||||
}
|
||||
|
||||
void VectorSnap(vec3_t v)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
v[i] = floor (v[i] + 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _Vector5Add (vec5_t va, vec5_t vb, vec5_t out)
|
||||
{
|
||||
out[0] = va[0]+vb[0];
|
||||
out[1] = va[1]+vb[1];
|
||||
out[2] = va[2]+vb[2];
|
||||
out[3] = va[3]+vb[3];
|
||||
out[4] = va[4]+vb[4];
|
||||
}
|
||||
|
||||
void _Vector5Scale (vec5_t v, vec_t scale, vec5_t out)
|
||||
{
|
||||
out[0] = v[0] * scale;
|
||||
out[1] = v[1] * scale;
|
||||
out[2] = v[2] * scale;
|
||||
out[3] = v[3] * scale;
|
||||
out[4] = v[4] * scale;
|
||||
}
|
||||
|
||||
void _Vector53Copy (vec5_t in, vec3_t out)
|
||||
{
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
}
|
||||
|
||||
// NOTE: added these from Ritual's Q3Radiant
|
||||
void ClearBounds (vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
mins[0] = mins[1] = mins[2] = 99999;
|
||||
maxs[0] = maxs[1] = maxs[2] = -99999;
|
||||
}
|
||||
|
||||
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
int i;
|
||||
vec_t val;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
val = v[i];
|
||||
if (val < mins[i])
|
||||
mins[i] = val;
|
||||
if (val > maxs[i])
|
||||
maxs[i] = val;
|
||||
}
|
||||
}
|
||||
|
||||
#define PITCH 0 // up / down
|
||||
#define YAW 1 // left / right
|
||||
#define ROLL 2 // fall over
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
|
||||
{
|
||||
float angle;
|
||||
static float sr, sp, sy, cr, cp, cy;
|
||||
// static to help MS compiler fp bugs
|
||||
|
||||
angle = angles[YAW] * (M_PI*2 / 360);
|
||||
sy = sin(angle);
|
||||
cy = cos(angle);
|
||||
angle = angles[PITCH] * (M_PI*2 / 360);
|
||||
sp = sin(angle);
|
||||
cp = cos(angle);
|
||||
angle = angles[ROLL] * (M_PI*2 / 360);
|
||||
sr = sin(angle);
|
||||
cr = cos(angle);
|
||||
|
||||
if (forward)
|
||||
{
|
||||
forward[0] = cp*cy;
|
||||
forward[1] = cp*sy;
|
||||
forward[2] = -sp;
|
||||
}
|
||||
if (right)
|
||||
{
|
||||
right[0] = -sr*sp*cy+cr*sy;
|
||||
right[1] = -sr*sp*sy-cr*cy;
|
||||
right[2] = -sr*cp;
|
||||
}
|
||||
if (up)
|
||||
{
|
||||
up[0] = cr*sp*cy+sr*sy;
|
||||
up[1] = cr*sp*sy-sr*cy;
|
||||
up[2] = cr*cp;
|
||||
}
|
||||
}
|
||||
|
||||
void VectorToAngles( vec3_t vec, vec3_t angles )
|
||||
{
|
||||
float forward;
|
||||
float yaw, pitch;
|
||||
|
||||
if ( ( vec[ 0 ] == 0 ) && ( vec[ 1 ] == 0 ) )
|
||||
{
|
||||
yaw = 0;
|
||||
if ( vec[ 2 ] > 0 )
|
||||
{
|
||||
pitch = 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
pitch = 270;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
yaw = atan2( vec[ 1 ], vec[ 0 ] ) * 180 / M_PI;
|
||||
if ( yaw < 0 )
|
||||
{
|
||||
yaw += 360;
|
||||
}
|
||||
|
||||
forward = ( float )sqrt( vec[ 0 ] * vec[ 0 ] + vec[ 1 ] * vec[ 1 ] );
|
||||
pitch = atan2( vec[ 2 ], forward ) * 180 / M_PI;
|
||||
if ( pitch < 0 )
|
||||
{
|
||||
pitch += 360;
|
||||
}
|
||||
}
|
||||
|
||||
angles[ 0 ] = pitch;
|
||||
angles[ 1 ] = yaw;
|
||||
angles[ 2 ] = 0;
|
||||
}
|
||||
// mathlib.c -- math primitives
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "cmdlib.h"
|
||||
#include "mathlib.h"
|
||||
|
||||
vec3_t vec3_origin = {0.0f,0.0f,0.0f};
|
||||
|
||||
|
||||
float VectorLength(vec3_t v)
|
||||
{
|
||||
int i;
|
||||
float length;
|
||||
|
||||
length = 0.0f;
|
||||
for (i=0 ; i< 3 ; i++)
|
||||
length += v[i]*v[i];
|
||||
length = (float)sqrt (length);
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
qboolean VectorCompare (vec3_t v1, vec3_t v2)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
if (fabs(v1[i]-v2[i]) > EQUAL_EPSILON)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
vec_t Q_rint (vec_t in)
|
||||
{
|
||||
if (g_PrefsDlg.m_bNoClamp)
|
||||
return in;
|
||||
else
|
||||
return (float)floor (in + 0.5);
|
||||
}
|
||||
|
||||
void VectorMA (vec3_t va, float scale, vec3_t vb, vec3_t vc)
|
||||
{
|
||||
vc[0] = va[0] + scale*vb[0];
|
||||
vc[1] = va[1] + scale*vb[1];
|
||||
vc[2] = va[2] + scale*vb[2];
|
||||
}
|
||||
|
||||
void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross)
|
||||
{
|
||||
cross[0] = v1[1]*v2[2] - v1[2]*v2[1];
|
||||
cross[1] = v1[2]*v2[0] - v1[0]*v2[2];
|
||||
cross[2] = v1[0]*v2[1] - v1[1]*v2[0];
|
||||
}
|
||||
|
||||
vec_t _DotProduct (vec3_t v1, vec3_t v2)
|
||||
{
|
||||
return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
|
||||
}
|
||||
|
||||
void _VectorSubtract (vec3_t va, vec3_t vb, vec3_t out)
|
||||
{
|
||||
out[0] = va[0]-vb[0];
|
||||
out[1] = va[1]-vb[1];
|
||||
out[2] = va[2]-vb[2];
|
||||
}
|
||||
|
||||
void _VectorAdd (vec3_t va, vec3_t vb, vec3_t out)
|
||||
{
|
||||
out[0] = va[0]+vb[0];
|
||||
out[1] = va[1]+vb[1];
|
||||
out[2] = va[2]+vb[2];
|
||||
}
|
||||
|
||||
void _VectorCopy (vec3_t in, vec3_t out)
|
||||
{
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
}
|
||||
|
||||
vec_t VectorNormalize (vec3_t v)
|
||||
{
|
||||
int i;
|
||||
float length;
|
||||
|
||||
length = 0.0f;
|
||||
for (i=0 ; i< 3 ; i++)
|
||||
length += v[i]*v[i];
|
||||
length = (float)sqrt (length);
|
||||
if (length == 0)
|
||||
return (vec_t)0;
|
||||
|
||||
for (i=0 ; i< 3 ; i++)
|
||||
v[i] /= length;
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
void VectorInverse (vec3_t v)
|
||||
{
|
||||
v[0] = -v[0];
|
||||
v[1] = -v[1];
|
||||
v[2] = -v[2];
|
||||
}
|
||||
|
||||
void VectorScale (vec3_t v, vec_t scale, vec3_t out)
|
||||
{
|
||||
out[0] = v[0] * scale;
|
||||
out[1] = v[1] * scale;
|
||||
out[2] = v[2] * scale;
|
||||
}
|
||||
|
||||
|
||||
void VectorRotate (vec3_t vIn, vec3_t vRotation, vec3_t out)
|
||||
{
|
||||
vec3_t vWork, va;
|
||||
VectorCopy(vIn, va);
|
||||
VectorCopy(va, vWork);
|
||||
int nIndex[3][2];
|
||||
nIndex[0][0] = 1; nIndex[0][1] = 2;
|
||||
nIndex[1][0] = 2; nIndex[1][1] = 0;
|
||||
nIndex[2][0] = 0; nIndex[2][1] = 1;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (vRotation[i] != 0)
|
||||
{
|
||||
double dAngle = vRotation[i] * Q_PI / 180.0;
|
||||
double c = cos(dAngle);
|
||||
double s = sin(dAngle);
|
||||
vWork[nIndex[i][0]] = va[nIndex[i][0]] * c - va[nIndex[i][1]] * s;
|
||||
vWork[nIndex[i][1]] = va[nIndex[i][0]] * s + va[nIndex[i][1]] * c;
|
||||
}
|
||||
VectorCopy(vWork, va);
|
||||
}
|
||||
VectorCopy(vWork, out);
|
||||
}
|
||||
|
||||
void VectorRotate (vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out)
|
||||
{
|
||||
vec3_t vTemp, vTemp2;
|
||||
VectorSubtract(vIn, vOrigin, vTemp);
|
||||
VectorRotate(vTemp, vRotation, vTemp2);
|
||||
VectorAdd(vTemp2, vOrigin, out);
|
||||
}
|
||||
|
||||
void VectorPolar(vec3_t v, float radius, float theta, float phi)
|
||||
{
|
||||
v[0]=float(radius * cos(theta) * cos(phi));
|
||||
v[1]=float(radius * sin(theta) * cos(phi));
|
||||
v[2]=float(radius * sin(phi));
|
||||
}
|
||||
|
||||
void VectorSnap(vec3_t v)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
v[i] = floor (v[i] + 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _Vector5Add (vec5_t va, vec5_t vb, vec5_t out)
|
||||
{
|
||||
out[0] = va[0]+vb[0];
|
||||
out[1] = va[1]+vb[1];
|
||||
out[2] = va[2]+vb[2];
|
||||
out[3] = va[3]+vb[3];
|
||||
out[4] = va[4]+vb[4];
|
||||
}
|
||||
|
||||
void _Vector5Scale (vec5_t v, vec_t scale, vec5_t out)
|
||||
{
|
||||
out[0] = v[0] * scale;
|
||||
out[1] = v[1] * scale;
|
||||
out[2] = v[2] * scale;
|
||||
out[3] = v[3] * scale;
|
||||
out[4] = v[4] * scale;
|
||||
}
|
||||
|
||||
void _Vector53Copy (vec5_t in, vec3_t out)
|
||||
{
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
}
|
||||
|
||||
// NOTE: added these from Ritual's Q3Radiant
|
||||
void ClearBounds (vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
mins[0] = mins[1] = mins[2] = 99999;
|
||||
maxs[0] = maxs[1] = maxs[2] = -99999;
|
||||
}
|
||||
|
||||
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
int i;
|
||||
vec_t val;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
val = v[i];
|
||||
if (val < mins[i])
|
||||
mins[i] = val;
|
||||
if (val > maxs[i])
|
||||
maxs[i] = val;
|
||||
}
|
||||
}
|
||||
|
||||
#define PITCH 0 // up / down
|
||||
#define YAW 1 // left / right
|
||||
#define ROLL 2 // fall over
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
|
||||
{
|
||||
float angle;
|
||||
static float sr, sp, sy, cr, cp, cy;
|
||||
// static to help MS compiler fp bugs
|
||||
|
||||
angle = angles[YAW] * (M_PI*2 / 360);
|
||||
sy = sin(angle);
|
||||
cy = cos(angle);
|
||||
angle = angles[PITCH] * (M_PI*2 / 360);
|
||||
sp = sin(angle);
|
||||
cp = cos(angle);
|
||||
angle = angles[ROLL] * (M_PI*2 / 360);
|
||||
sr = sin(angle);
|
||||
cr = cos(angle);
|
||||
|
||||
if (forward)
|
||||
{
|
||||
forward[0] = cp*cy;
|
||||
forward[1] = cp*sy;
|
||||
forward[2] = -sp;
|
||||
}
|
||||
if (right)
|
||||
{
|
||||
right[0] = -sr*sp*cy+cr*sy;
|
||||
right[1] = -sr*sp*sy-cr*cy;
|
||||
right[2] = -sr*cp;
|
||||
}
|
||||
if (up)
|
||||
{
|
||||
up[0] = cr*sp*cy+sr*sy;
|
||||
up[1] = cr*sp*sy-sr*cy;
|
||||
up[2] = cr*cp;
|
||||
}
|
||||
}
|
||||
|
||||
void VectorToAngles( vec3_t vec, vec3_t angles )
|
||||
{
|
||||
float forward;
|
||||
float yaw, pitch;
|
||||
|
||||
if ( ( vec[ 0 ] == 0 ) && ( vec[ 1 ] == 0 ) )
|
||||
{
|
||||
yaw = 0;
|
||||
if ( vec[ 2 ] > 0 )
|
||||
{
|
||||
pitch = 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
pitch = 270;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
yaw = atan2( vec[ 1 ], vec[ 0 ] ) * 180 / M_PI;
|
||||
if ( yaw < 0 )
|
||||
{
|
||||
yaw += 360;
|
||||
}
|
||||
|
||||
forward = ( float )sqrt( vec[ 0 ] * vec[ 0 ] + vec[ 1 ] * vec[ 1 ] );
|
||||
pitch = atan2( vec[ 2 ], forward ) * 180 / M_PI;
|
||||
if ( pitch < 0 )
|
||||
{
|
||||
pitch += 360;
|
||||
}
|
||||
}
|
||||
|
||||
angles[ 0 ] = pitch;
|
||||
angles[ 1 ] = yaw;
|
||||
angles[ 2 ] = 0;
|
||||
}
|
||||
|
|
|
|||
130
q3radiant/MATHLIB.H
Normal file → Executable file
130
q3radiant/MATHLIB.H
Normal file → Executable file
|
|
@ -19,68 +19,68 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#ifndef __MATHLIB__
|
||||
#define __MATHLIB__
|
||||
|
||||
// mathlib.h
|
||||
|
||||
#include <math.h>
|
||||
|
||||
typedef float vec_t;
|
||||
typedef vec_t vec3_t[3];
|
||||
typedef vec_t vec5_t[5];
|
||||
|
||||
#define SIDE_FRONT 0
|
||||
#define SIDE_ON 2
|
||||
#define SIDE_BACK 1
|
||||
#define SIDE_CROSS -2
|
||||
|
||||
#define Q_PI 3.14159265358979323846
|
||||
|
||||
extern vec3_t vec3_origin;
|
||||
|
||||
#define EQUAL_EPSILON 0.001
|
||||
|
||||
qboolean VectorCompare (vec3_t v1, vec3_t v2);
|
||||
|
||||
#define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
|
||||
#define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];}
|
||||
#define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];}
|
||||
#define VectorCopy(a,b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];}
|
||||
#define VectorSet(v, a, b, c) {v[0]=a;v[1]=b;v[2]=c;}
|
||||
|
||||
vec_t Q_rint (vec_t in);
|
||||
vec_t _DotProduct (vec3_t v1, vec3_t v2);
|
||||
void _VectorSubtract (vec3_t va, vec3_t vb, vec3_t out);
|
||||
void _VectorAdd (vec3_t va, vec3_t vb, vec3_t out);
|
||||
void _VectorCopy (vec3_t in, vec3_t out);
|
||||
|
||||
float VectorLength(vec3_t v);
|
||||
|
||||
void VectorMA (vec3_t va, float scale, vec3_t vb, vec3_t vc);
|
||||
|
||||
void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
|
||||
vec_t VectorNormalize (vec3_t v);
|
||||
void VectorInverse (vec3_t v);
|
||||
void VectorScale (vec3_t v, vec_t scale, vec3_t out);
|
||||
void VectorPolar(vec3_t v, float radius, float theta, float phi);
|
||||
void VectorSnap(vec3_t v);
|
||||
|
||||
void _Vector53Copy (vec5_t in, vec3_t out);
|
||||
void _Vector5Scale (vec5_t v, vec_t scale, vec5_t out);
|
||||
void _Vector5Add (vec5_t va, vec5_t vb, vec5_t out);
|
||||
|
||||
// NOTE: added these from Ritual's Q3Radiant
|
||||
void ClearBounds (vec3_t mins, vec3_t maxs);
|
||||
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs);
|
||||
|
||||
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
|
||||
void VectorToAngles( vec3_t vec, vec3_t angles );
|
||||
#define VectorClear(x) {x[0] = x[1] = x[2] = 0;}
|
||||
|
||||
#define ZERO_EPSILON 1.0E-6
|
||||
#define RAD2DEG( a ) ( ( (a) * 180.0f ) / Q_PI )
|
||||
#define DEG2RAD( a ) ( ( (a) * Q_PI ) / 180.0f )
|
||||
|
||||
|
||||
#endif
|
||||
#ifndef __MATHLIB__
|
||||
#define __MATHLIB__
|
||||
|
||||
// mathlib.h
|
||||
|
||||
#include <math.h>
|
||||
|
||||
typedef float vec_t;
|
||||
typedef vec_t vec3_t[3];
|
||||
typedef vec_t vec5_t[5];
|
||||
|
||||
#define SIDE_FRONT 0
|
||||
#define SIDE_ON 2
|
||||
#define SIDE_BACK 1
|
||||
#define SIDE_CROSS -2
|
||||
|
||||
#define Q_PI 3.14159265358979323846
|
||||
|
||||
extern vec3_t vec3_origin;
|
||||
|
||||
#define EQUAL_EPSILON 0.001
|
||||
|
||||
qboolean VectorCompare (vec3_t v1, vec3_t v2);
|
||||
|
||||
#define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
|
||||
#define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];}
|
||||
#define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];}
|
||||
#define VectorCopy(a,b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];}
|
||||
#define VectorSet(v, a, b, c) {v[0]=a;v[1]=b;v[2]=c;}
|
||||
|
||||
vec_t Q_rint (vec_t in);
|
||||
vec_t _DotProduct (vec3_t v1, vec3_t v2);
|
||||
void _VectorSubtract (vec3_t va, vec3_t vb, vec3_t out);
|
||||
void _VectorAdd (vec3_t va, vec3_t vb, vec3_t out);
|
||||
void _VectorCopy (vec3_t in, vec3_t out);
|
||||
|
||||
float VectorLength(vec3_t v);
|
||||
|
||||
void VectorMA (vec3_t va, float scale, vec3_t vb, vec3_t vc);
|
||||
|
||||
void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
|
||||
vec_t VectorNormalize (vec3_t v);
|
||||
void VectorInverse (vec3_t v);
|
||||
void VectorScale (vec3_t v, vec_t scale, vec3_t out);
|
||||
void VectorPolar(vec3_t v, float radius, float theta, float phi);
|
||||
void VectorSnap(vec3_t v);
|
||||
|
||||
void _Vector53Copy (vec5_t in, vec3_t out);
|
||||
void _Vector5Scale (vec5_t v, vec_t scale, vec5_t out);
|
||||
void _Vector5Add (vec5_t va, vec5_t vb, vec5_t out);
|
||||
|
||||
// NOTE: added these from Ritual's Q3Radiant
|
||||
void ClearBounds (vec3_t mins, vec3_t maxs);
|
||||
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs);
|
||||
|
||||
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
|
||||
void VectorToAngles( vec3_t vec, vec3_t angles );
|
||||
#define VectorClear(x) {x[0] = x[1] = x[2] = 0;}
|
||||
|
||||
#define ZERO_EPSILON 1.0E-6
|
||||
#define RAD2DEG( a ) ( ( (a) * 180.0f ) / Q_PI )
|
||||
#define DEG2RAD( a ) ( ( (a) * Q_PI ) / 180.0f )
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
1300
q3radiant/MRU.CPP
Normal file → Executable file
1300
q3radiant/MRU.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
158
q3radiant/MRU.H
Normal file → Executable file
158
q3radiant/MRU.H
Normal file → Executable file
|
|
@ -19,82 +19,82 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//*************************************************************
|
||||
// File name: mru.h
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// Header for MRU support
|
||||
//
|
||||
// Development Team:
|
||||
//
|
||||
// Gilles Vollant (100144.2636@compuserve.com)
|
||||
//
|
||||
//*************************************************************
|
||||
|
||||
#ifndef __MRU_H__
|
||||
#define __MRU_H__
|
||||
|
||||
#define NBMRUMENUSHOW 6 // Default number of MRU showed in the menu File
|
||||
#define NBMRUMENU 9 // Default number of MRU stored
|
||||
#define IDMRU 8000 // Default First ID of MRU
|
||||
#ifdef OFS_MAXPATHNAME
|
||||
#define MAXSIZEMRUITEM OFS_MAXPATHNAME
|
||||
#else
|
||||
#define MAXSIZEMRUITEM 128 // Default max size of an entry
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WORD wNbItemFill;
|
||||
WORD wNbLruShow;
|
||||
WORD wNbLruMenu;
|
||||
WORD wMaxSizeLruItem;
|
||||
WORD wIdMru;
|
||||
LPSTR lpMRU;
|
||||
} MRUMENU;
|
||||
|
||||
typedef MRUMENU FAR * LPMRUMENU;
|
||||
|
||||
#ifdef __cplusplus
|
||||
LPMRUMENU CreateMruMenu (WORD wNbLruShowInit=NBMRUMENUSHOW,
|
||||
WORD wNbLruMenuInit=NBMRUMENU,
|
||||
WORD wMaxSizeLruItemInit=MAXSIZEMRUITEM,
|
||||
WORD wIdMruInit=IDMRU);
|
||||
#else
|
||||
LPMRUMENU CreateMruMenu (WORD wNbLruShowInit,
|
||||
WORD wNbLruMenuInit,
|
||||
WORD wMaxSizeLruItemInit,
|
||||
WORD wIdMruInit);
|
||||
#endif
|
||||
|
||||
LPMRUMENU CreateMruMenuDefault();
|
||||
void DeleteMruMenu (LPMRUMENU lpMruMenu);
|
||||
|
||||
void SetNbLruShow (LPMRUMENU lpMruMenu,WORD wNbLruShowInit);
|
||||
BOOL SetMenuItem (LPMRUMENU lpMruMenu,WORD wItem,
|
||||
LPSTR lpItem);
|
||||
BOOL GetMenuItem (LPMRUMENU lpMruMenu,WORD wItem,
|
||||
BOOL fIDMBased,LPSTR lpItem,UINT uiSize);
|
||||
BOOL DelMenuItem (LPMRUMENU lpMruMenu,WORD wItem,BOOL fIDMBased);
|
||||
void AddNewItem (LPMRUMENU lpMruMenu,LPSTR lpItem);
|
||||
void PlaceMenuMRUItem(LPMRUMENU lpMruMenu,HMENU hMenu,UINT uiItem);
|
||||
|
||||
BOOL SaveMruInIni (LPMRUMENU lpMruMenu,LPSTR lpszSection,LPSTR lpszFile);
|
||||
BOOL LoadMruInIni (LPMRUMENU lpMruMenu,LPSTR lpszSection,LPSTR lpszFile);
|
||||
#ifdef WIN32
|
||||
BOOL SaveMruInReg (LPMRUMENU lpMruMenu,LPSTR lpszKey);
|
||||
BOOL LoadMruInReg (LPMRUMENU lpMruMenu,LPSTR lpszKey);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIN32S,
|
||||
WINNT,
|
||||
WIN95ORGREATHER
|
||||
} WIN32KIND;
|
||||
WIN32KIND GetWin32Kind();
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
#endif
|
||||
//*************************************************************
|
||||
// File name: mru.h
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// Header for MRU support
|
||||
//
|
||||
// Development Team:
|
||||
//
|
||||
// Gilles Vollant (100144.2636@compuserve.com)
|
||||
//
|
||||
//*************************************************************
|
||||
|
||||
#ifndef __MRU_H__
|
||||
#define __MRU_H__
|
||||
|
||||
#define NBMRUMENUSHOW 6 // Default number of MRU showed in the menu File
|
||||
#define NBMRUMENU 9 // Default number of MRU stored
|
||||
#define IDMRU 8000 // Default First ID of MRU
|
||||
#ifdef OFS_MAXPATHNAME
|
||||
#define MAXSIZEMRUITEM OFS_MAXPATHNAME
|
||||
#else
|
||||
#define MAXSIZEMRUITEM 128 // Default max size of an entry
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WORD wNbItemFill;
|
||||
WORD wNbLruShow;
|
||||
WORD wNbLruMenu;
|
||||
WORD wMaxSizeLruItem;
|
||||
WORD wIdMru;
|
||||
LPSTR lpMRU;
|
||||
} MRUMENU;
|
||||
|
||||
typedef MRUMENU FAR * LPMRUMENU;
|
||||
|
||||
#ifdef __cplusplus
|
||||
LPMRUMENU CreateMruMenu (WORD wNbLruShowInit=NBMRUMENUSHOW,
|
||||
WORD wNbLruMenuInit=NBMRUMENU,
|
||||
WORD wMaxSizeLruItemInit=MAXSIZEMRUITEM,
|
||||
WORD wIdMruInit=IDMRU);
|
||||
#else
|
||||
LPMRUMENU CreateMruMenu (WORD wNbLruShowInit,
|
||||
WORD wNbLruMenuInit,
|
||||
WORD wMaxSizeLruItemInit,
|
||||
WORD wIdMruInit);
|
||||
#endif
|
||||
|
||||
LPMRUMENU CreateMruMenuDefault();
|
||||
void DeleteMruMenu (LPMRUMENU lpMruMenu);
|
||||
|
||||
void SetNbLruShow (LPMRUMENU lpMruMenu,WORD wNbLruShowInit);
|
||||
BOOL SetMenuItem (LPMRUMENU lpMruMenu,WORD wItem,
|
||||
LPSTR lpItem);
|
||||
BOOL GetMenuItem (LPMRUMENU lpMruMenu,WORD wItem,
|
||||
BOOL fIDMBased,LPSTR lpItem,UINT uiSize);
|
||||
BOOL DelMenuItem (LPMRUMENU lpMruMenu,WORD wItem,BOOL fIDMBased);
|
||||
void AddNewItem (LPMRUMENU lpMruMenu,LPSTR lpItem);
|
||||
void PlaceMenuMRUItem(LPMRUMENU lpMruMenu,HMENU hMenu,UINT uiItem);
|
||||
|
||||
BOOL SaveMruInIni (LPMRUMENU lpMruMenu,LPSTR lpszSection,LPSTR lpszFile);
|
||||
BOOL LoadMruInIni (LPMRUMENU lpMruMenu,LPSTR lpszSection,LPSTR lpszFile);
|
||||
#ifdef WIN32
|
||||
BOOL SaveMruInReg (LPMRUMENU lpMruMenu,LPSTR lpszKey);
|
||||
BOOL LoadMruInReg (LPMRUMENU lpMruMenu,LPSTR lpszKey);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WIN32S,
|
||||
WINNT,
|
||||
WIN95ORGREATHER
|
||||
} WIN32KIND;
|
||||
WIN32KIND GetWin32Kind();
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
#endif
|
||||
|
|
|
|||
10406
q3radiant/MainFrm.cpp
Normal file → Executable file
10406
q3radiant/MainFrm.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load diff
966
q3radiant/MainFrm.h
Normal file → Executable file
966
q3radiant/MainFrm.h
Normal file → Executable file
|
|
@ -19,486 +19,486 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// MainFrm.h : interface of the CMainFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "LstToolBar.h"
|
||||
#include "XYWnd.h"
|
||||
#include "TexWnd.h"
|
||||
#include "ZWnd.h"
|
||||
#include "CamWnd.h"
|
||||
#include "RADEditWnd.h"
|
||||
#include "TextureBar.h"
|
||||
#include "PlugInManager.h"
|
||||
#include "PlugIn.h"
|
||||
#include "groupdlg.h"
|
||||
|
||||
|
||||
const int RAD_SHIFT = 0x01;
|
||||
const int RAD_ALT = 0x02;
|
||||
const int RAD_CONTROL = 0x04;
|
||||
const int RAD_PRESS = 0x08;
|
||||
|
||||
struct SCommandInfo
|
||||
{
|
||||
char* m_strCommand;
|
||||
unsigned int m_nKey;
|
||||
unsigned int m_nModifiers;
|
||||
unsigned int m_nCommand;
|
||||
};
|
||||
|
||||
struct SKeyInfo
|
||||
{
|
||||
char* m_strName;
|
||||
unsigned int m_nVKKey;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class CMainFrame : public CFrameWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CMainFrame)
|
||||
public:
|
||||
CMainFrame();
|
||||
void HandleKey(UINT nChar, UINT nRepCnt, UINT nFlags, bool bDown = true)
|
||||
{
|
||||
if (bDown)
|
||||
OnKeyDown(nChar, nRepCnt, nFlags);
|
||||
else
|
||||
OnKeyUp(nChar, nRepCnt, nFlags);
|
||||
};
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMainFrame)
|
||||
public:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
|
||||
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
void UpdatePatchToolbarButtons();
|
||||
void NudgeSelection(int nDirection, int nAmount);
|
||||
void UpdateTextureBar();
|
||||
void SetButtonMenuStates();
|
||||
void SetTexValStatus();
|
||||
void SetGridStatus();
|
||||
void RoutineProcessing();
|
||||
CXYWnd* ActiveXY();
|
||||
void UpdateWindows(int nBits);
|
||||
void SetStatusText(int nPane, const char* pText);
|
||||
void UpdateStatusText();
|
||||
void SetWindowStyle(int nStyle);
|
||||
virtual ~CMainFrame();
|
||||
CXYWnd* GetXYWnd() {return m_pXYWnd;};
|
||||
CXYWnd* GetXZWnd() {return m_pXZWnd;};
|
||||
CXYWnd* GetYZWnd() {return m_pYZWnd;};
|
||||
CCamWnd* GetCamera() {return m_pCamWnd;};
|
||||
CTexWnd* GetTexWnd() {return m_pTexWnd;};
|
||||
void SetActiveXY(CXYWnd* p)
|
||||
{
|
||||
if (m_pActiveXY)
|
||||
m_pActiveXY->SetActive(false);
|
||||
|
||||
m_pActiveXY = p;
|
||||
|
||||
if (m_pActiveXY)
|
||||
m_pActiveXY->SetActive(true);
|
||||
|
||||
};
|
||||
int CurrentStyle() { return m_nCurrentStyle; };
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected: // control bar embedded members
|
||||
CStatusBar m_wndStatusBar;
|
||||
CLstToolBar m_wndToolBar;
|
||||
CLstToolBar m_wndScaleBar;
|
||||
CDialogBar m_wndHelpBar;
|
||||
CTextureBar m_wndTextureBar;
|
||||
CSplitterWnd m_wndSplit;
|
||||
CSplitterWnd m_wndSplit2;
|
||||
CSplitterWnd m_wndSplit3;
|
||||
CXYWnd* m_pXYWnd;
|
||||
CXYWnd* m_pYZWnd;
|
||||
CXYWnd* m_pXZWnd;
|
||||
CCamWnd* m_pCamWnd;
|
||||
CTexWnd* m_pTexWnd;
|
||||
CZWnd* m_pZWnd;
|
||||
CRADEditWnd* m_pEditWnd;
|
||||
int m_nCurrentStyle;
|
||||
CString m_strStatus[15];
|
||||
CXYWnd* m_pActiveXY;
|
||||
bool m_bCamPreview;
|
||||
CPlugInManager m_PlugInMgr;
|
||||
int m_nNextPlugInID;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
bool m_bDoLoop;
|
||||
bool m_bSplittersOK;
|
||||
void CreateQEChildren();
|
||||
void LoadCommandMap();
|
||||
void ShowMenuItemKeyBindings(CMenu *pMenu);
|
||||
void SetEntityCheck();
|
||||
afx_msg LRESULT OnBSPStatus(UINT wParam, long lParam);
|
||||
afx_msg LRESULT OnBSPDone(UINT wParam, long lParam);
|
||||
public:
|
||||
void Nudge(int nDim, float fNudge);
|
||||
|
||||
CPlugInManager &GetPlugInMgr() {return m_PlugInMgr;};
|
||||
void AddPlugInMenuItem(CPlugIn* pPlugIn);
|
||||
void CleanPlugInMenu();
|
||||
|
||||
// these are public so i can easily reflect messages
|
||||
// from child windows..
|
||||
//{{AFX_MSG(CMainFrame)
|
||||
afx_msg void OnParentNotify(UINT message, LPARAM lParam);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnTimer(UINT nIDEvent);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void ToggleCamera();
|
||||
afx_msg void OnFileClose();
|
||||
afx_msg void OnFileExit();
|
||||
afx_msg void OnFileLoadproject();
|
||||
afx_msg void OnFileNew();
|
||||
afx_msg void OnFileOpen();
|
||||
afx_msg void OnFilePointfile();
|
||||
afx_msg void OnFilePrint();
|
||||
afx_msg void OnFilePrintPreview();
|
||||
afx_msg void OnFileSave();
|
||||
afx_msg void OnFileSaveas();
|
||||
afx_msg void OnView100();
|
||||
afx_msg void OnViewCenter();
|
||||
afx_msg void OnViewConsole();
|
||||
afx_msg void OnViewDownfloor();
|
||||
afx_msg void OnViewEntity();
|
||||
afx_msg void OnViewFront();
|
||||
afx_msg void OnViewShowblocks();
|
||||
afx_msg void OnViewShowclip();
|
||||
afx_msg void OnViewShowcoordinates();
|
||||
afx_msg void OnViewShowdetail();
|
||||
afx_msg void OnViewShowent();
|
||||
afx_msg void OnViewShowlights();
|
||||
afx_msg void OnViewShownames();
|
||||
afx_msg void OnViewShowpath();
|
||||
afx_msg void OnViewShowwater();
|
||||
afx_msg void OnViewShowworld();
|
||||
afx_msg void OnViewTexture();
|
||||
afx_msg void OnViewUpfloor();
|
||||
afx_msg void OnViewXy();
|
||||
afx_msg void OnViewZ100();
|
||||
afx_msg void OnViewZoomin();
|
||||
afx_msg void OnViewZoomout();
|
||||
afx_msg void OnViewZzoomin();
|
||||
afx_msg void OnViewZzoomout();
|
||||
afx_msg void OnViewSide();
|
||||
afx_msg void OnTexturesShowinuse();
|
||||
afx_msg void OnTexturesInspector();
|
||||
afx_msg void OnMiscBenchmark();
|
||||
afx_msg void OnMiscFindbrush();
|
||||
afx_msg void OnMiscGamma();
|
||||
afx_msg void OnMiscNextleakspot();
|
||||
afx_msg void OnMiscPreviousleakspot();
|
||||
afx_msg void OnMiscPrintxy();
|
||||
afx_msg void OnMiscSelectentitycolor();
|
||||
afx_msg void OnTexturebk();
|
||||
afx_msg void OnColorsMajor();
|
||||
afx_msg void OnColorsMinor();
|
||||
afx_msg void OnColorsXybk();
|
||||
afx_msg void OnBrush3sided();
|
||||
afx_msg void OnBrush4sided();
|
||||
afx_msg void OnBrush5sided();
|
||||
afx_msg void OnBrush6sided();
|
||||
afx_msg void OnBrush7sided();
|
||||
afx_msg void OnBrush8sided();
|
||||
afx_msg void OnBrush9sided();
|
||||
afx_msg void OnBrushArbitrarysided();
|
||||
afx_msg void OnBrushFlipx();
|
||||
afx_msg void OnBrushFlipy();
|
||||
afx_msg void OnBrushFlipz();
|
||||
afx_msg void OnBrushRotatex();
|
||||
afx_msg void OnBrushRotatey();
|
||||
afx_msg void OnBrushRotatez();
|
||||
afx_msg void OnRegionOff();
|
||||
afx_msg void OnRegionSetbrush();
|
||||
afx_msg void OnRegionSetselection();
|
||||
afx_msg void OnRegionSettallbrush();
|
||||
afx_msg void OnRegionSetxy();
|
||||
afx_msg void OnSelectionArbitraryrotation();
|
||||
afx_msg void OnSelectionClone();
|
||||
afx_msg void OnSelectionConnect();
|
||||
afx_msg void OnSelectionCsgsubtract();
|
||||
afx_msg void OnSelectionCsgmerge();
|
||||
afx_msg void OnSelectionNoOutline();
|
||||
afx_msg void OnSelectionDelete();
|
||||
afx_msg void OnSelectionDeselect();
|
||||
afx_msg void OnSelectionDragedges();
|
||||
afx_msg void OnSelectionDragvertecies();
|
||||
afx_msg void OnRaiseLowerTerrain();
|
||||
afx_msg void OnSelectionMakeDetail();
|
||||
afx_msg void OnSelectionMakeStructural();
|
||||
afx_msg void OnSelectionMakehollow();
|
||||
afx_msg void OnSelectionSelectcompletetall();
|
||||
afx_msg void OnSelectionSelectinside();
|
||||
afx_msg void OnSelectionSelectpartialtall();
|
||||
afx_msg void OnSelectionSelecttouching();
|
||||
afx_msg void OnSelectionUngroupentity();
|
||||
afx_msg void OnTexturesPopup();
|
||||
afx_msg void OnSplinesPopup();
|
||||
afx_msg void OnPopupSelection();
|
||||
afx_msg void OnViewChange();
|
||||
afx_msg void OnViewCameraupdate();
|
||||
afx_msg void OnUpdateViewCameraupdate(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
|
||||
afx_msg void OnHelpAbout();
|
||||
afx_msg void OnViewClipper();
|
||||
afx_msg void OnCameraAngledown();
|
||||
afx_msg void OnCameraAngleup();
|
||||
afx_msg void OnCameraBack();
|
||||
afx_msg void OnCameraDown();
|
||||
afx_msg void OnCameraForward();
|
||||
afx_msg void OnCameraLeft();
|
||||
afx_msg void OnCameraRight();
|
||||
afx_msg void OnCameraStrafeleft();
|
||||
afx_msg void OnCameraStraferight();
|
||||
afx_msg void OnCameraUp();
|
||||
afx_msg void OnGridToggle();
|
||||
afx_msg void OnPrefs();
|
||||
afx_msg void OnTogglecamera();
|
||||
afx_msg void OnToggleconsole();
|
||||
afx_msg void OnToggleview();
|
||||
afx_msg void OnTogglez();
|
||||
afx_msg void OnToggleLock();
|
||||
afx_msg void OnEditMapinfo();
|
||||
afx_msg void OnEditEntityinfo();
|
||||
afx_msg void OnBrushScripts();
|
||||
afx_msg void OnViewNextview();
|
||||
afx_msg void OnHelpCommandlist();
|
||||
afx_msg void OnFileNewproject();
|
||||
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnFlipClip();
|
||||
afx_msg void OnClipSelected();
|
||||
afx_msg void OnSplitSelected();
|
||||
afx_msg void OnToggleviewXz();
|
||||
afx_msg void OnToggleviewYz();
|
||||
afx_msg void OnColorsBrush();
|
||||
afx_msg void OnColorsClipper();
|
||||
afx_msg void OnColorsGridtext();
|
||||
afx_msg void OnColorsSelectedbrush();
|
||||
afx_msg void OnColorsGridblock();
|
||||
afx_msg void OnColorsViewname();
|
||||
afx_msg void OnColorSetoriginal();
|
||||
afx_msg void OnColorSetqer();
|
||||
afx_msg void OnColorSetblack();
|
||||
afx_msg void OnSnaptogrid();
|
||||
afx_msg void OnSelectScale();
|
||||
afx_msg void OnSelectMouserotate();
|
||||
afx_msg void OnEditCopybrush();
|
||||
afx_msg void OnEditPastebrush();
|
||||
afx_msg void OnEditUndo();
|
||||
afx_msg void OnEditRedo();
|
||||
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSelectionInvert();
|
||||
afx_msg void OnSelectionTextureDec();
|
||||
afx_msg void OnSelectionTextureFit();
|
||||
afx_msg void OnSelectionTextureInc();
|
||||
afx_msg void OnSelectionTextureRotateclock();
|
||||
afx_msg void OnSelectionTextureRotatecounter();
|
||||
afx_msg void OnSelectionTextureScaledown();
|
||||
afx_msg void OnSelectionTextureScaleup();
|
||||
afx_msg void OnSelectionTextureShiftdown();
|
||||
afx_msg void OnSelectionTextureShiftleft();
|
||||
afx_msg void OnSelectionTextureShiftright();
|
||||
afx_msg void OnSelectionTextureShiftup();
|
||||
afx_msg void OnGridNext();
|
||||
afx_msg void OnGridPrev();
|
||||
afx_msg void OnSelectionTextureScaleLeft();
|
||||
afx_msg void OnSelectionTextureScaleRight();
|
||||
afx_msg void OnTextureReplaceall();
|
||||
afx_msg void OnScalelockx();
|
||||
afx_msg void OnScalelocky();
|
||||
afx_msg void OnScalelockz();
|
||||
afx_msg void OnSelectMousescale();
|
||||
afx_msg void OnViewCubicclipping();
|
||||
afx_msg void OnFileImport();
|
||||
afx_msg void OnFileProjectsettings();
|
||||
afx_msg void OnUpdateFileImport(CCmdUI* pCmdUI);
|
||||
afx_msg void OnViewCubein();
|
||||
afx_msg void OnViewCubeout();
|
||||
afx_msg void OnFileSaveregion();
|
||||
afx_msg void OnUpdateFileSaveregion(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSelectionMovedown();
|
||||
afx_msg void OnSelectionMoveup();
|
||||
afx_msg void OnToolbarMain();
|
||||
afx_msg void OnToolbarTexture();
|
||||
afx_msg void OnSelectionPrint();
|
||||
afx_msg void OnSelectionTogglesizepaint();
|
||||
afx_msg void OnBrushMakecone();
|
||||
afx_msg void OnTexturesLoad();
|
||||
afx_msg void OnToggleRotatelock();
|
||||
afx_msg void OnCurveBevel();
|
||||
afx_msg void OnCurveCylinder();
|
||||
afx_msg void OnCurveEighthsphere();
|
||||
afx_msg void OnCurveEndcap();
|
||||
afx_msg void OnCurveHemisphere();
|
||||
afx_msg void OnCurveInvertcurve();
|
||||
afx_msg void OnCurveQuarter();
|
||||
afx_msg void OnCurveSphere();
|
||||
afx_msg void OnFileImportmap();
|
||||
afx_msg void OnFileExportmap();
|
||||
afx_msg void OnEditLoadprefab();
|
||||
afx_msg void OnViewShowcurves();
|
||||
afx_msg void OnSelectionSelectNudgedown();
|
||||
afx_msg void OnSelectionSelectNudgeleft();
|
||||
afx_msg void OnSelectionSelectNudgeright();
|
||||
afx_msg void OnSelectionSelectNudgeup();
|
||||
afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnTexturesLoadlist();
|
||||
afx_msg void OnDontselectcurve();
|
||||
afx_msg void OnConvertcurves();
|
||||
afx_msg void OnDynamicLighting();
|
||||
afx_msg void OnCurveSimplepatchmesh();
|
||||
afx_msg void OnPatchToggleBox();
|
||||
afx_msg void OnPatchWireframe();
|
||||
afx_msg void OnCurvePatchcone();
|
||||
afx_msg void OnCurvePatchtube();
|
||||
afx_msg void OnPatchWeld();
|
||||
afx_msg void OnCurvePatchbevel();
|
||||
afx_msg void OnCurvePatchendcap();
|
||||
afx_msg void OnCurvePatchinvertedbevel();
|
||||
afx_msg void OnCurvePatchinvertedendcap();
|
||||
afx_msg void OnPatchDrilldown();
|
||||
afx_msg void OnCurveInsertcolumn();
|
||||
afx_msg void OnCurveInsertrow();
|
||||
afx_msg void OnCurveDeletecolumn();
|
||||
afx_msg void OnCurveDeleterow();
|
||||
afx_msg void OnCurveInsertAddcolumn();
|
||||
afx_msg void OnCurveInsertAddrow();
|
||||
afx_msg void OnCurveInsertInsertcolumn();
|
||||
afx_msg void OnCurveInsertInsertrow();
|
||||
afx_msg void OnCurveNegative();
|
||||
afx_msg void OnCurveNegativeTextureX();
|
||||
afx_msg void OnCurveNegativeTextureY();
|
||||
afx_msg void OnCurveDeleteFirstcolumn();
|
||||
afx_msg void OnCurveDeleteFirstrow();
|
||||
afx_msg void OnCurveDeleteLastcolumn();
|
||||
afx_msg void OnCurveDeleteLastrow();
|
||||
afx_msg void OnPatchBend();
|
||||
afx_msg void OnPatchInsdel();
|
||||
afx_msg void OnPatchEnter();
|
||||
afx_msg void OnPatchTab();
|
||||
afx_msg void OnCurvePatchdensetube();
|
||||
afx_msg void OnCurvePatchverydensetube();
|
||||
afx_msg void OnCurveCap();
|
||||
afx_msg void OnCurveCapInvertedbevel();
|
||||
afx_msg void OnCurveCapInvertedendcap();
|
||||
afx_msg void OnCurveRedisperseCols();
|
||||
afx_msg void OnCurveRedisperseRows();
|
||||
afx_msg void OnPatchNaturalize();
|
||||
afx_msg void OnSnapToGrid();
|
||||
afx_msg void OnCurvePatchsquare();
|
||||
afx_msg void OnTerrainCreateFromBrush();
|
||||
afx_msg void OnTexturesTexturewindowscale10();
|
||||
afx_msg void OnTexturesTexturewindowscale100();
|
||||
afx_msg void OnTexturesTexturewindowscale200();
|
||||
afx_msg void OnTexturesTexturewindowscale25();
|
||||
afx_msg void OnTexturesTexturewindowscale50();
|
||||
afx_msg void OnTexturesFlush();
|
||||
afx_msg void OnCurveOverlayClear();
|
||||
afx_msg void OnCurveOverlaySet();
|
||||
afx_msg void OnCurveThicken();
|
||||
afx_msg void OnCurveCyclecap();
|
||||
afx_msg void OnCurveMatrixTranspose();
|
||||
afx_msg void OnTexturesReloadshaders();
|
||||
afx_msg void OnShowEntities();
|
||||
afx_msg void OnViewEntitiesasBoundingbox();
|
||||
afx_msg void OnViewEntitiesasSelectedskinned();
|
||||
afx_msg void OnViewEntitiesasSelectedwireframe();
|
||||
afx_msg void OnViewEntitiesasSkinned();
|
||||
afx_msg void OnViewEntitiesasSkinnedandboxed();
|
||||
afx_msg void OnViewEntitiesasWireframe();
|
||||
afx_msg void OnPluginsRefresh();
|
||||
afx_msg void OnViewShowhint();
|
||||
afx_msg void OnUpdateTexturesShowinuse(CCmdUI* pCmdUI);
|
||||
afx_msg void OnTexturesShowall();
|
||||
afx_msg void OnPatchInspector();
|
||||
afx_msg void OnViewOpengllighting();
|
||||
afx_msg void OnSelectAll();
|
||||
afx_msg void OnViewShowcaulk();
|
||||
afx_msg void OnCurveFreeze();
|
||||
afx_msg void OnCurveUnFreeze();
|
||||
afx_msg void OnCurveUnFreezeAll();
|
||||
afx_msg void OnSelectReselect();
|
||||
afx_msg void OnViewShowangles();
|
||||
afx_msg void OnEditSaveprefab();
|
||||
afx_msg void OnCurveMoreendcapsbevelsSquarebevel();
|
||||
afx_msg void OnCurveMoreendcapsbevelsSquareendcap();
|
||||
afx_msg void OnBrushPrimitivesSphere();
|
||||
afx_msg void OnViewCrosshair();
|
||||
afx_msg void OnViewHideshowHideselected();
|
||||
afx_msg void OnViewHideshowShowhidden();
|
||||
afx_msg void OnTexturesShadersShow();
|
||||
afx_msg void OnTexturesFlushUnused();
|
||||
afx_msg void OnViewGroups();
|
||||
afx_msg void OnDropGroupAddtoWorld();
|
||||
afx_msg void OnDropGroupName();
|
||||
afx_msg void OnDropGroupNewgroup();
|
||||
afx_msg void OnDropGroupRemove();
|
||||
afx_msg void OnSplinesMode();
|
||||
afx_msg void OnSplinesLoad();
|
||||
afx_msg void OnSplinesSave();
|
||||
afx_msg void OnSplinesEdit();
|
||||
afx_msg void OnSplineTest();
|
||||
afx_msg void OnSplinesTarget();
|
||||
afx_msg void OnSplinesTargetPoints();
|
||||
afx_msg void OnSplinesCameraPoints();
|
||||
afx_msg void OnPopupNewcameraInterpolated();
|
||||
afx_msg void OnPopupNewcameraSpline();
|
||||
afx_msg void OnPopupNewcameraFixed();
|
||||
//}}AFX_MSG
|
||||
afx_msg void OnMru(unsigned int nID);
|
||||
afx_msg void OnViewNearest(unsigned int nID);
|
||||
afx_msg void OnTextureWad(unsigned int nID);
|
||||
afx_msg void OnBspCommand(unsigned int nID);
|
||||
afx_msg void OnGrid1(unsigned int nID);
|
||||
afx_msg LRESULT OnDisplayChange(WPARAM wp, LPARAM lp);
|
||||
void CheckTextureScale(int id);
|
||||
afx_msg void OnPlugIn(unsigned int nID);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
// MainFrm.h : interface of the CMainFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "LstToolBar.h"
|
||||
#include "XYWnd.h"
|
||||
#include "TexWnd.h"
|
||||
#include "ZWnd.h"
|
||||
#include "CamWnd.h"
|
||||
#include "RADEditWnd.h"
|
||||
#include "TextureBar.h"
|
||||
#include "PlugInManager.h"
|
||||
#include "PlugIn.h"
|
||||
#include "groupdlg.h"
|
||||
|
||||
|
||||
const int RAD_SHIFT = 0x01;
|
||||
const int RAD_ALT = 0x02;
|
||||
const int RAD_CONTROL = 0x04;
|
||||
const int RAD_PRESS = 0x08;
|
||||
|
||||
struct SCommandInfo
|
||||
{
|
||||
char* m_strCommand;
|
||||
unsigned int m_nKey;
|
||||
unsigned int m_nModifiers;
|
||||
unsigned int m_nCommand;
|
||||
};
|
||||
|
||||
struct SKeyInfo
|
||||
{
|
||||
char* m_strName;
|
||||
unsigned int m_nVKKey;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class CMainFrame : public CFrameWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CMainFrame)
|
||||
public:
|
||||
CMainFrame();
|
||||
void HandleKey(UINT nChar, UINT nRepCnt, UINT nFlags, bool bDown = true)
|
||||
{
|
||||
if (bDown)
|
||||
OnKeyDown(nChar, nRepCnt, nFlags);
|
||||
else
|
||||
OnKeyUp(nChar, nRepCnt, nFlags);
|
||||
};
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMainFrame)
|
||||
public:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
|
||||
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
void UpdatePatchToolbarButtons();
|
||||
void NudgeSelection(int nDirection, int nAmount);
|
||||
void UpdateTextureBar();
|
||||
void SetButtonMenuStates();
|
||||
void SetTexValStatus();
|
||||
void SetGridStatus();
|
||||
void RoutineProcessing();
|
||||
CXYWnd* ActiveXY();
|
||||
void UpdateWindows(int nBits);
|
||||
void SetStatusText(int nPane, const char* pText);
|
||||
void UpdateStatusText();
|
||||
void SetWindowStyle(int nStyle);
|
||||
virtual ~CMainFrame();
|
||||
CXYWnd* GetXYWnd() {return m_pXYWnd;};
|
||||
CXYWnd* GetXZWnd() {return m_pXZWnd;};
|
||||
CXYWnd* GetYZWnd() {return m_pYZWnd;};
|
||||
CCamWnd* GetCamera() {return m_pCamWnd;};
|
||||
CTexWnd* GetTexWnd() {return m_pTexWnd;};
|
||||
void SetActiveXY(CXYWnd* p)
|
||||
{
|
||||
if (m_pActiveXY)
|
||||
m_pActiveXY->SetActive(false);
|
||||
|
||||
m_pActiveXY = p;
|
||||
|
||||
if (m_pActiveXY)
|
||||
m_pActiveXY->SetActive(true);
|
||||
|
||||
};
|
||||
int CurrentStyle() { return m_nCurrentStyle; };
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected: // control bar embedded members
|
||||
CStatusBar m_wndStatusBar;
|
||||
CLstToolBar m_wndToolBar;
|
||||
CLstToolBar m_wndScaleBar;
|
||||
CDialogBar m_wndHelpBar;
|
||||
CTextureBar m_wndTextureBar;
|
||||
CSplitterWnd m_wndSplit;
|
||||
CSplitterWnd m_wndSplit2;
|
||||
CSplitterWnd m_wndSplit3;
|
||||
CXYWnd* m_pXYWnd;
|
||||
CXYWnd* m_pYZWnd;
|
||||
CXYWnd* m_pXZWnd;
|
||||
CCamWnd* m_pCamWnd;
|
||||
CTexWnd* m_pTexWnd;
|
||||
CZWnd* m_pZWnd;
|
||||
CRADEditWnd* m_pEditWnd;
|
||||
int m_nCurrentStyle;
|
||||
CString m_strStatus[15];
|
||||
CXYWnd* m_pActiveXY;
|
||||
bool m_bCamPreview;
|
||||
CPlugInManager m_PlugInMgr;
|
||||
int m_nNextPlugInID;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
bool m_bDoLoop;
|
||||
bool m_bSplittersOK;
|
||||
void CreateQEChildren();
|
||||
void LoadCommandMap();
|
||||
void ShowMenuItemKeyBindings(CMenu *pMenu);
|
||||
void SetEntityCheck();
|
||||
afx_msg LRESULT OnBSPStatus(UINT wParam, long lParam);
|
||||
afx_msg LRESULT OnBSPDone(UINT wParam, long lParam);
|
||||
public:
|
||||
void Nudge(int nDim, float fNudge);
|
||||
|
||||
CPlugInManager &GetPlugInMgr() {return m_PlugInMgr;};
|
||||
void AddPlugInMenuItem(CPlugIn* pPlugIn);
|
||||
void CleanPlugInMenu();
|
||||
|
||||
// these are public so i can easily reflect messages
|
||||
// from child windows..
|
||||
//{{AFX_MSG(CMainFrame)
|
||||
afx_msg void OnParentNotify(UINT message, LPARAM lParam);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnTimer(UINT nIDEvent);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void ToggleCamera();
|
||||
afx_msg void OnFileClose();
|
||||
afx_msg void OnFileExit();
|
||||
afx_msg void OnFileLoadproject();
|
||||
afx_msg void OnFileNew();
|
||||
afx_msg void OnFileOpen();
|
||||
afx_msg void OnFilePointfile();
|
||||
afx_msg void OnFilePrint();
|
||||
afx_msg void OnFilePrintPreview();
|
||||
afx_msg void OnFileSave();
|
||||
afx_msg void OnFileSaveas();
|
||||
afx_msg void OnView100();
|
||||
afx_msg void OnViewCenter();
|
||||
afx_msg void OnViewConsole();
|
||||
afx_msg void OnViewDownfloor();
|
||||
afx_msg void OnViewEntity();
|
||||
afx_msg void OnViewFront();
|
||||
afx_msg void OnViewShowblocks();
|
||||
afx_msg void OnViewShowclip();
|
||||
afx_msg void OnViewShowcoordinates();
|
||||
afx_msg void OnViewShowdetail();
|
||||
afx_msg void OnViewShowent();
|
||||
afx_msg void OnViewShowlights();
|
||||
afx_msg void OnViewShownames();
|
||||
afx_msg void OnViewShowpath();
|
||||
afx_msg void OnViewShowwater();
|
||||
afx_msg void OnViewShowworld();
|
||||
afx_msg void OnViewTexture();
|
||||
afx_msg void OnViewUpfloor();
|
||||
afx_msg void OnViewXy();
|
||||
afx_msg void OnViewZ100();
|
||||
afx_msg void OnViewZoomin();
|
||||
afx_msg void OnViewZoomout();
|
||||
afx_msg void OnViewZzoomin();
|
||||
afx_msg void OnViewZzoomout();
|
||||
afx_msg void OnViewSide();
|
||||
afx_msg void OnTexturesShowinuse();
|
||||
afx_msg void OnTexturesInspector();
|
||||
afx_msg void OnMiscBenchmark();
|
||||
afx_msg void OnMiscFindbrush();
|
||||
afx_msg void OnMiscGamma();
|
||||
afx_msg void OnMiscNextleakspot();
|
||||
afx_msg void OnMiscPreviousleakspot();
|
||||
afx_msg void OnMiscPrintxy();
|
||||
afx_msg void OnMiscSelectentitycolor();
|
||||
afx_msg void OnTexturebk();
|
||||
afx_msg void OnColorsMajor();
|
||||
afx_msg void OnColorsMinor();
|
||||
afx_msg void OnColorsXybk();
|
||||
afx_msg void OnBrush3sided();
|
||||
afx_msg void OnBrush4sided();
|
||||
afx_msg void OnBrush5sided();
|
||||
afx_msg void OnBrush6sided();
|
||||
afx_msg void OnBrush7sided();
|
||||
afx_msg void OnBrush8sided();
|
||||
afx_msg void OnBrush9sided();
|
||||
afx_msg void OnBrushArbitrarysided();
|
||||
afx_msg void OnBrushFlipx();
|
||||
afx_msg void OnBrushFlipy();
|
||||
afx_msg void OnBrushFlipz();
|
||||
afx_msg void OnBrushRotatex();
|
||||
afx_msg void OnBrushRotatey();
|
||||
afx_msg void OnBrushRotatez();
|
||||
afx_msg void OnRegionOff();
|
||||
afx_msg void OnRegionSetbrush();
|
||||
afx_msg void OnRegionSetselection();
|
||||
afx_msg void OnRegionSettallbrush();
|
||||
afx_msg void OnRegionSetxy();
|
||||
afx_msg void OnSelectionArbitraryrotation();
|
||||
afx_msg void OnSelectionClone();
|
||||
afx_msg void OnSelectionConnect();
|
||||
afx_msg void OnSelectionCsgsubtract();
|
||||
afx_msg void OnSelectionCsgmerge();
|
||||
afx_msg void OnSelectionNoOutline();
|
||||
afx_msg void OnSelectionDelete();
|
||||
afx_msg void OnSelectionDeselect();
|
||||
afx_msg void OnSelectionDragedges();
|
||||
afx_msg void OnSelectionDragvertecies();
|
||||
afx_msg void OnRaiseLowerTerrain();
|
||||
afx_msg void OnSelectionMakeDetail();
|
||||
afx_msg void OnSelectionMakeStructural();
|
||||
afx_msg void OnSelectionMakehollow();
|
||||
afx_msg void OnSelectionSelectcompletetall();
|
||||
afx_msg void OnSelectionSelectinside();
|
||||
afx_msg void OnSelectionSelectpartialtall();
|
||||
afx_msg void OnSelectionSelecttouching();
|
||||
afx_msg void OnSelectionUngroupentity();
|
||||
afx_msg void OnTexturesPopup();
|
||||
afx_msg void OnSplinesPopup();
|
||||
afx_msg void OnPopupSelection();
|
||||
afx_msg void OnViewChange();
|
||||
afx_msg void OnViewCameraupdate();
|
||||
afx_msg void OnUpdateViewCameraupdate(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
|
||||
afx_msg void OnHelpAbout();
|
||||
afx_msg void OnViewClipper();
|
||||
afx_msg void OnCameraAngledown();
|
||||
afx_msg void OnCameraAngleup();
|
||||
afx_msg void OnCameraBack();
|
||||
afx_msg void OnCameraDown();
|
||||
afx_msg void OnCameraForward();
|
||||
afx_msg void OnCameraLeft();
|
||||
afx_msg void OnCameraRight();
|
||||
afx_msg void OnCameraStrafeleft();
|
||||
afx_msg void OnCameraStraferight();
|
||||
afx_msg void OnCameraUp();
|
||||
afx_msg void OnGridToggle();
|
||||
afx_msg void OnPrefs();
|
||||
afx_msg void OnTogglecamera();
|
||||
afx_msg void OnToggleconsole();
|
||||
afx_msg void OnToggleview();
|
||||
afx_msg void OnTogglez();
|
||||
afx_msg void OnToggleLock();
|
||||
afx_msg void OnEditMapinfo();
|
||||
afx_msg void OnEditEntityinfo();
|
||||
afx_msg void OnBrushScripts();
|
||||
afx_msg void OnViewNextview();
|
||||
afx_msg void OnHelpCommandlist();
|
||||
afx_msg void OnFileNewproject();
|
||||
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnFlipClip();
|
||||
afx_msg void OnClipSelected();
|
||||
afx_msg void OnSplitSelected();
|
||||
afx_msg void OnToggleviewXz();
|
||||
afx_msg void OnToggleviewYz();
|
||||
afx_msg void OnColorsBrush();
|
||||
afx_msg void OnColorsClipper();
|
||||
afx_msg void OnColorsGridtext();
|
||||
afx_msg void OnColorsSelectedbrush();
|
||||
afx_msg void OnColorsGridblock();
|
||||
afx_msg void OnColorsViewname();
|
||||
afx_msg void OnColorSetoriginal();
|
||||
afx_msg void OnColorSetqer();
|
||||
afx_msg void OnColorSetblack();
|
||||
afx_msg void OnSnaptogrid();
|
||||
afx_msg void OnSelectScale();
|
||||
afx_msg void OnSelectMouserotate();
|
||||
afx_msg void OnEditCopybrush();
|
||||
afx_msg void OnEditPastebrush();
|
||||
afx_msg void OnEditUndo();
|
||||
afx_msg void OnEditRedo();
|
||||
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSelectionInvert();
|
||||
afx_msg void OnSelectionTextureDec();
|
||||
afx_msg void OnSelectionTextureFit();
|
||||
afx_msg void OnSelectionTextureInc();
|
||||
afx_msg void OnSelectionTextureRotateclock();
|
||||
afx_msg void OnSelectionTextureRotatecounter();
|
||||
afx_msg void OnSelectionTextureScaledown();
|
||||
afx_msg void OnSelectionTextureScaleup();
|
||||
afx_msg void OnSelectionTextureShiftdown();
|
||||
afx_msg void OnSelectionTextureShiftleft();
|
||||
afx_msg void OnSelectionTextureShiftright();
|
||||
afx_msg void OnSelectionTextureShiftup();
|
||||
afx_msg void OnGridNext();
|
||||
afx_msg void OnGridPrev();
|
||||
afx_msg void OnSelectionTextureScaleLeft();
|
||||
afx_msg void OnSelectionTextureScaleRight();
|
||||
afx_msg void OnTextureReplaceall();
|
||||
afx_msg void OnScalelockx();
|
||||
afx_msg void OnScalelocky();
|
||||
afx_msg void OnScalelockz();
|
||||
afx_msg void OnSelectMousescale();
|
||||
afx_msg void OnViewCubicclipping();
|
||||
afx_msg void OnFileImport();
|
||||
afx_msg void OnFileProjectsettings();
|
||||
afx_msg void OnUpdateFileImport(CCmdUI* pCmdUI);
|
||||
afx_msg void OnViewCubein();
|
||||
afx_msg void OnViewCubeout();
|
||||
afx_msg void OnFileSaveregion();
|
||||
afx_msg void OnUpdateFileSaveregion(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSelectionMovedown();
|
||||
afx_msg void OnSelectionMoveup();
|
||||
afx_msg void OnToolbarMain();
|
||||
afx_msg void OnToolbarTexture();
|
||||
afx_msg void OnSelectionPrint();
|
||||
afx_msg void OnSelectionTogglesizepaint();
|
||||
afx_msg void OnBrushMakecone();
|
||||
afx_msg void OnTexturesLoad();
|
||||
afx_msg void OnToggleRotatelock();
|
||||
afx_msg void OnCurveBevel();
|
||||
afx_msg void OnCurveCylinder();
|
||||
afx_msg void OnCurveEighthsphere();
|
||||
afx_msg void OnCurveEndcap();
|
||||
afx_msg void OnCurveHemisphere();
|
||||
afx_msg void OnCurveInvertcurve();
|
||||
afx_msg void OnCurveQuarter();
|
||||
afx_msg void OnCurveSphere();
|
||||
afx_msg void OnFileImportmap();
|
||||
afx_msg void OnFileExportmap();
|
||||
afx_msg void OnEditLoadprefab();
|
||||
afx_msg void OnViewShowcurves();
|
||||
afx_msg void OnSelectionSelectNudgedown();
|
||||
afx_msg void OnSelectionSelectNudgeleft();
|
||||
afx_msg void OnSelectionSelectNudgeright();
|
||||
afx_msg void OnSelectionSelectNudgeup();
|
||||
afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnTexturesLoadlist();
|
||||
afx_msg void OnDontselectcurve();
|
||||
afx_msg void OnConvertcurves();
|
||||
afx_msg void OnDynamicLighting();
|
||||
afx_msg void OnCurveSimplepatchmesh();
|
||||
afx_msg void OnPatchToggleBox();
|
||||
afx_msg void OnPatchWireframe();
|
||||
afx_msg void OnCurvePatchcone();
|
||||
afx_msg void OnCurvePatchtube();
|
||||
afx_msg void OnPatchWeld();
|
||||
afx_msg void OnCurvePatchbevel();
|
||||
afx_msg void OnCurvePatchendcap();
|
||||
afx_msg void OnCurvePatchinvertedbevel();
|
||||
afx_msg void OnCurvePatchinvertedendcap();
|
||||
afx_msg void OnPatchDrilldown();
|
||||
afx_msg void OnCurveInsertcolumn();
|
||||
afx_msg void OnCurveInsertrow();
|
||||
afx_msg void OnCurveDeletecolumn();
|
||||
afx_msg void OnCurveDeleterow();
|
||||
afx_msg void OnCurveInsertAddcolumn();
|
||||
afx_msg void OnCurveInsertAddrow();
|
||||
afx_msg void OnCurveInsertInsertcolumn();
|
||||
afx_msg void OnCurveInsertInsertrow();
|
||||
afx_msg void OnCurveNegative();
|
||||
afx_msg void OnCurveNegativeTextureX();
|
||||
afx_msg void OnCurveNegativeTextureY();
|
||||
afx_msg void OnCurveDeleteFirstcolumn();
|
||||
afx_msg void OnCurveDeleteFirstrow();
|
||||
afx_msg void OnCurveDeleteLastcolumn();
|
||||
afx_msg void OnCurveDeleteLastrow();
|
||||
afx_msg void OnPatchBend();
|
||||
afx_msg void OnPatchInsdel();
|
||||
afx_msg void OnPatchEnter();
|
||||
afx_msg void OnPatchTab();
|
||||
afx_msg void OnCurvePatchdensetube();
|
||||
afx_msg void OnCurvePatchverydensetube();
|
||||
afx_msg void OnCurveCap();
|
||||
afx_msg void OnCurveCapInvertedbevel();
|
||||
afx_msg void OnCurveCapInvertedendcap();
|
||||
afx_msg void OnCurveRedisperseCols();
|
||||
afx_msg void OnCurveRedisperseRows();
|
||||
afx_msg void OnPatchNaturalize();
|
||||
afx_msg void OnSnapToGrid();
|
||||
afx_msg void OnCurvePatchsquare();
|
||||
afx_msg void OnTerrainCreateFromBrush();
|
||||
afx_msg void OnTexturesTexturewindowscale10();
|
||||
afx_msg void OnTexturesTexturewindowscale100();
|
||||
afx_msg void OnTexturesTexturewindowscale200();
|
||||
afx_msg void OnTexturesTexturewindowscale25();
|
||||
afx_msg void OnTexturesTexturewindowscale50();
|
||||
afx_msg void OnTexturesFlush();
|
||||
afx_msg void OnCurveOverlayClear();
|
||||
afx_msg void OnCurveOverlaySet();
|
||||
afx_msg void OnCurveThicken();
|
||||
afx_msg void OnCurveCyclecap();
|
||||
afx_msg void OnCurveMatrixTranspose();
|
||||
afx_msg void OnTexturesReloadshaders();
|
||||
afx_msg void OnShowEntities();
|
||||
afx_msg void OnViewEntitiesasBoundingbox();
|
||||
afx_msg void OnViewEntitiesasSelectedskinned();
|
||||
afx_msg void OnViewEntitiesasSelectedwireframe();
|
||||
afx_msg void OnViewEntitiesasSkinned();
|
||||
afx_msg void OnViewEntitiesasSkinnedandboxed();
|
||||
afx_msg void OnViewEntitiesasWireframe();
|
||||
afx_msg void OnPluginsRefresh();
|
||||
afx_msg void OnViewShowhint();
|
||||
afx_msg void OnUpdateTexturesShowinuse(CCmdUI* pCmdUI);
|
||||
afx_msg void OnTexturesShowall();
|
||||
afx_msg void OnPatchInspector();
|
||||
afx_msg void OnViewOpengllighting();
|
||||
afx_msg void OnSelectAll();
|
||||
afx_msg void OnViewShowcaulk();
|
||||
afx_msg void OnCurveFreeze();
|
||||
afx_msg void OnCurveUnFreeze();
|
||||
afx_msg void OnCurveUnFreezeAll();
|
||||
afx_msg void OnSelectReselect();
|
||||
afx_msg void OnViewShowangles();
|
||||
afx_msg void OnEditSaveprefab();
|
||||
afx_msg void OnCurveMoreendcapsbevelsSquarebevel();
|
||||
afx_msg void OnCurveMoreendcapsbevelsSquareendcap();
|
||||
afx_msg void OnBrushPrimitivesSphere();
|
||||
afx_msg void OnViewCrosshair();
|
||||
afx_msg void OnViewHideshowHideselected();
|
||||
afx_msg void OnViewHideshowShowhidden();
|
||||
afx_msg void OnTexturesShadersShow();
|
||||
afx_msg void OnTexturesFlushUnused();
|
||||
afx_msg void OnViewGroups();
|
||||
afx_msg void OnDropGroupAddtoWorld();
|
||||
afx_msg void OnDropGroupName();
|
||||
afx_msg void OnDropGroupNewgroup();
|
||||
afx_msg void OnDropGroupRemove();
|
||||
afx_msg void OnSplinesMode();
|
||||
afx_msg void OnSplinesLoad();
|
||||
afx_msg void OnSplinesSave();
|
||||
afx_msg void OnSplinesEdit();
|
||||
afx_msg void OnSplineTest();
|
||||
afx_msg void OnSplinesTarget();
|
||||
afx_msg void OnSplinesTargetPoints();
|
||||
afx_msg void OnSplinesCameraPoints();
|
||||
afx_msg void OnPopupNewcameraInterpolated();
|
||||
afx_msg void OnPopupNewcameraSpline();
|
||||
afx_msg void OnPopupNewcameraFixed();
|
||||
//}}AFX_MSG
|
||||
afx_msg void OnMru(unsigned int nID);
|
||||
afx_msg void OnViewNearest(unsigned int nID);
|
||||
afx_msg void OnTextureWad(unsigned int nID);
|
||||
afx_msg void OnBspCommand(unsigned int nID);
|
||||
afx_msg void OnGrid1(unsigned int nID);
|
||||
afx_msg LRESULT OnDisplayChange(WPARAM wp, LPARAM lp);
|
||||
void CheckTextureScale(int id);
|
||||
afx_msg void OnPlugIn(unsigned int nID);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
186
q3radiant/MapInfo.cpp
Normal file → Executable file
186
q3radiant/MapInfo.cpp
Normal file → Executable file
|
|
@ -19,96 +19,96 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// MapInfo.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "MapInfo.h"
|
||||
#include "qe3.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapInfo dialog
|
||||
|
||||
|
||||
CMapInfo::CMapInfo(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CMapInfo::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CMapInfo)
|
||||
m_nNet = 0;
|
||||
m_nTotalBrushes = 0;
|
||||
m_nTotalEntities = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CMapInfo::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CMapInfo)
|
||||
DDX_Control(pDX, IDC_LIST_ENTITIES, m_lstEntity);
|
||||
DDX_Text(pDX, IDC_EDIT_NET, m_nNet);
|
||||
DDX_Text(pDX, IDC_EDIT_TOTALBRUSHES, m_nTotalBrushes);
|
||||
DDX_Text(pDX, IDC_EDIT_TOTALENTITIES, m_nTotalEntities);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMapInfo, CDialog)
|
||||
//{{AFX_MSG_MAP(CMapInfo)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapInfo message handlers
|
||||
|
||||
BOOL CMapInfo::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_nTotalBrushes = 0;
|
||||
m_nTotalEntities = 0;
|
||||
m_nNet = 0;
|
||||
for (brush_t* pBrush=active_brushes.next ; pBrush != &active_brushes ; pBrush=pBrush->next)
|
||||
{
|
||||
m_nTotalBrushes++;
|
||||
if (pBrush->owner == world_entity)
|
||||
m_nNet++;
|
||||
}
|
||||
|
||||
|
||||
CMapStringToPtr mapEntity;
|
||||
|
||||
int nValue = 0;
|
||||
for (entity_t* pEntity=entities.next ; pEntity != &entities ; pEntity=pEntity->next)
|
||||
{
|
||||
m_nTotalEntities++;
|
||||
nValue = 0;
|
||||
mapEntity.Lookup(pEntity->eclass->name, reinterpret_cast<void*&>(nValue));
|
||||
nValue++ ;
|
||||
mapEntity.SetAt(pEntity->eclass->name, reinterpret_cast<void*>(nValue));
|
||||
}
|
||||
|
||||
m_lstEntity.ResetContent();
|
||||
m_lstEntity.SetTabStops(96);
|
||||
CString strKey;
|
||||
POSITION pos = mapEntity.GetStartPosition();
|
||||
while (pos)
|
||||
{
|
||||
mapEntity.GetNextAssoc(pos, strKey, reinterpret_cast<void*&>(nValue));
|
||||
CString strList;
|
||||
strList.Format("%s\t%i", strKey, nValue);
|
||||
m_lstEntity.AddString(strList);
|
||||
}
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
// MapInfo.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "MapInfo.h"
|
||||
#include "qe3.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapInfo dialog
|
||||
|
||||
|
||||
CMapInfo::CMapInfo(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CMapInfo::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CMapInfo)
|
||||
m_nNet = 0;
|
||||
m_nTotalBrushes = 0;
|
||||
m_nTotalEntities = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CMapInfo::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CMapInfo)
|
||||
DDX_Control(pDX, IDC_LIST_ENTITIES, m_lstEntity);
|
||||
DDX_Text(pDX, IDC_EDIT_NET, m_nNet);
|
||||
DDX_Text(pDX, IDC_EDIT_TOTALBRUSHES, m_nTotalBrushes);
|
||||
DDX_Text(pDX, IDC_EDIT_TOTALENTITIES, m_nTotalEntities);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMapInfo, CDialog)
|
||||
//{{AFX_MSG_MAP(CMapInfo)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapInfo message handlers
|
||||
|
||||
BOOL CMapInfo::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_nTotalBrushes = 0;
|
||||
m_nTotalEntities = 0;
|
||||
m_nNet = 0;
|
||||
for (brush_t* pBrush=active_brushes.next ; pBrush != &active_brushes ; pBrush=pBrush->next)
|
||||
{
|
||||
m_nTotalBrushes++;
|
||||
if (pBrush->owner == world_entity)
|
||||
m_nNet++;
|
||||
}
|
||||
|
||||
|
||||
CMapStringToPtr mapEntity;
|
||||
|
||||
int nValue = 0;
|
||||
for (entity_t* pEntity=entities.next ; pEntity != &entities ; pEntity=pEntity->next)
|
||||
{
|
||||
m_nTotalEntities++;
|
||||
nValue = 0;
|
||||
mapEntity.Lookup(pEntity->eclass->name, reinterpret_cast<void*&>(nValue));
|
||||
nValue++ ;
|
||||
mapEntity.SetAt(pEntity->eclass->name, reinterpret_cast<void*>(nValue));
|
||||
}
|
||||
|
||||
m_lstEntity.ResetContent();
|
||||
m_lstEntity.SetTabStops(96);
|
||||
CString strKey;
|
||||
POSITION pos = mapEntity.GetStartPosition();
|
||||
while (pos)
|
||||
{
|
||||
mapEntity.GetNextAssoc(pos, strKey, reinterpret_cast<void*&>(nValue));
|
||||
CString strList;
|
||||
strList.Format("%s\t%i", strKey, nValue);
|
||||
m_lstEntity.AddString(strList);
|
||||
}
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
|
|
|||
98
q3radiant/MapInfo.h
Normal file → Executable file
98
q3radiant/MapInfo.h
Normal file → Executable file
|
|
@ -19,52 +19,52 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_MAPINFO_H__C241B9A2_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_MAPINFO_H__C241B9A2_819F_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// MapInfo.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapInfo dialog
|
||||
|
||||
class CMapInfo : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CMapInfo(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CMapInfo)
|
||||
enum { IDD = IDD_DLG_MAPINFO };
|
||||
CListBox m_lstEntity;
|
||||
int m_nNet;
|
||||
int m_nTotalBrushes;
|
||||
int m_nTotalEntities;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMapInfo)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CMapInfo)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAPINFO_H__C241B9A2_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_MAPINFO_H__C241B9A2_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_MAPINFO_H__C241B9A2_819F_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// MapInfo.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapInfo dialog
|
||||
|
||||
class CMapInfo : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CMapInfo(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CMapInfo)
|
||||
enum { IDD = IDD_DLG_MAPINFO };
|
||||
CListBox m_lstEntity;
|
||||
int m_nNet;
|
||||
int m_nTotalBrushes;
|
||||
int m_nTotalEntities;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMapInfo)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CMapInfo)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAPINFO_H__C241B9A2_819F_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
232
q3radiant/Messaging.cpp
Normal file → Executable file
232
q3radiant/Messaging.cpp
Normal file → Executable file
|
|
@ -19,119 +19,119 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $Log: Messaging.cpp,v $
|
||||
// Revision 1.1.2.1 2000/02/04 22:59:34 ttimo
|
||||
// messaging API preview
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// implementation of IMessaging specific interface
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
CPtrArray l_Listeners[RADIANT_MSGCOUNT];
|
||||
CPtrArray l_WindowListeners;
|
||||
CXYWndWrapper l_XYWndWrapper;
|
||||
|
||||
void WINAPI QERApp_HookWindow(IWindowListener* pListen)
|
||||
{
|
||||
l_WindowListeners.Add( pListen );
|
||||
pListen->IncRef();
|
||||
}
|
||||
|
||||
void WINAPI QERApp_UnHookWindow(IWindowListener* pListen)
|
||||
{
|
||||
for ( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
{
|
||||
if (l_WindowListeners.GetAt(i) == pListen)
|
||||
{
|
||||
l_WindowListeners.RemoveAt(i);
|
||||
pListen->DecRef();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Sys_Printf("WARNING: IWindowListener not found in QERApp_UnHookWindow\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void DispatchOnMouseMove(UINT nFlags, int x, int y)
|
||||
{
|
||||
for( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
static_cast<IWindowListener*>(l_WindowListeners.GetAt(i))->OnMouseMove( nFlags, x, y );
|
||||
}
|
||||
|
||||
bool DispatchOnLButtonDown(UINT nFlags, int x, int y)
|
||||
{
|
||||
for( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
if (static_cast<IWindowListener*>(l_WindowListeners.GetAt(i))->OnLButtonDown( nFlags, x, y ))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DispatchOnLButtonUp(UINT nFlags, int x, int y)
|
||||
{
|
||||
for( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
if (static_cast<IWindowListener*>(l_WindowListeners.GetAt(i))->OnLButtonUp( nFlags, x, y ))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void WINAPI QERApp_HookListener(IListener* pListen, int Msg)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (Msg >= RADIANT_MSGCOUNT)
|
||||
{
|
||||
Sys_Printf("ERROR: bad index in QERApp_HookListener\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
l_Listeners[Msg].Add( pListen );
|
||||
pListen->IncRef();
|
||||
}
|
||||
|
||||
int WINAPI QERApp_UnHookListener(IListener* pListen)
|
||||
{
|
||||
int count = 0;
|
||||
for( int i = 0; i<RADIANT_MSGCOUNT; i++ )
|
||||
for( int j = 0; j<l_Listeners[i].GetSize(); j++ )
|
||||
if (l_Listeners[i].GetAt(j) == pListen)
|
||||
{
|
||||
l_Listeners[i].RemoveAt(j);
|
||||
pListen->DecRef();
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void DispatchRadiantMsg( int Msg )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (Msg >= RADIANT_MSGCOUNT)
|
||||
{
|
||||
Sys_Printf("ERROR: bad index in DispatchRadiantMsg\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
for(int i = 0; i<l_Listeners[Msg].GetSize(); i++)
|
||||
static_cast<IListener *>(l_Listeners[Msg].GetAt(i))->DispatchRadiantMsg(Msg);
|
||||
}
|
||||
|
||||
void CXYWndWrapper::SnapToGrid( int x1, int y1, vec3_t pt )
|
||||
{
|
||||
CRect rctZ;
|
||||
g_pParentWnd->ActiveXY()->GetClientRect( rctZ );
|
||||
g_pParentWnd->ActiveXY()->SnapToPoint( x1, rctZ.Height() - 1 - y1, pt );
|
||||
}
|
||||
|
||||
IXYWndWrapper* WINAPI QERApp_GetXYWndWrapper()
|
||||
{
|
||||
return &l_XYWndWrapper;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $Log: Messaging.cpp,v $
|
||||
// Revision 1.1.2.1 2000/02/04 22:59:34 ttimo
|
||||
// messaging API preview
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// implementation of IMessaging specific interface
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
CPtrArray l_Listeners[RADIANT_MSGCOUNT];
|
||||
CPtrArray l_WindowListeners;
|
||||
CXYWndWrapper l_XYWndWrapper;
|
||||
|
||||
void WINAPI QERApp_HookWindow(IWindowListener* pListen)
|
||||
{
|
||||
l_WindowListeners.Add( pListen );
|
||||
pListen->IncRef();
|
||||
}
|
||||
|
||||
void WINAPI QERApp_UnHookWindow(IWindowListener* pListen)
|
||||
{
|
||||
for ( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
{
|
||||
if (l_WindowListeners.GetAt(i) == pListen)
|
||||
{
|
||||
l_WindowListeners.RemoveAt(i);
|
||||
pListen->DecRef();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Sys_Printf("WARNING: IWindowListener not found in QERApp_UnHookWindow\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void DispatchOnMouseMove(UINT nFlags, int x, int y)
|
||||
{
|
||||
for( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
static_cast<IWindowListener*>(l_WindowListeners.GetAt(i))->OnMouseMove( nFlags, x, y );
|
||||
}
|
||||
|
||||
bool DispatchOnLButtonDown(UINT nFlags, int x, int y)
|
||||
{
|
||||
for( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
if (static_cast<IWindowListener*>(l_WindowListeners.GetAt(i))->OnLButtonDown( nFlags, x, y ))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DispatchOnLButtonUp(UINT nFlags, int x, int y)
|
||||
{
|
||||
for( int i = 0; i < l_WindowListeners.GetSize(); i++ )
|
||||
if (static_cast<IWindowListener*>(l_WindowListeners.GetAt(i))->OnLButtonUp( nFlags, x, y ))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void WINAPI QERApp_HookListener(IListener* pListen, int Msg)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (Msg >= RADIANT_MSGCOUNT)
|
||||
{
|
||||
Sys_Printf("ERROR: bad index in QERApp_HookListener\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
l_Listeners[Msg].Add( pListen );
|
||||
pListen->IncRef();
|
||||
}
|
||||
|
||||
int WINAPI QERApp_UnHookListener(IListener* pListen)
|
||||
{
|
||||
int count = 0;
|
||||
for( int i = 0; i<RADIANT_MSGCOUNT; i++ )
|
||||
for( int j = 0; j<l_Listeners[i].GetSize(); j++ )
|
||||
if (l_Listeners[i].GetAt(j) == pListen)
|
||||
{
|
||||
l_Listeners[i].RemoveAt(j);
|
||||
pListen->DecRef();
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void DispatchRadiantMsg( int Msg )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (Msg >= RADIANT_MSGCOUNT)
|
||||
{
|
||||
Sys_Printf("ERROR: bad index in DispatchRadiantMsg\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
for(int i = 0; i<l_Listeners[Msg].GetSize(); i++)
|
||||
static_cast<IListener *>(l_Listeners[Msg].GetAt(i))->DispatchRadiantMsg(Msg);
|
||||
}
|
||||
|
||||
void CXYWndWrapper::SnapToGrid( int x1, int y1, vec3_t pt )
|
||||
{
|
||||
CRect rctZ;
|
||||
g_pParentWnd->ActiveXY()->GetClientRect( rctZ );
|
||||
g_pParentWnd->ActiveXY()->SnapToPoint( x1, rctZ.Height() - 1 - y1, pt );
|
||||
}
|
||||
|
||||
IXYWndWrapper* WINAPI QERApp_GetXYWndWrapper()
|
||||
{
|
||||
return &l_XYWndWrapper;
|
||||
}
|
||||
|
|
|
|||
48
q3radiant/Messaging.h
Normal file → Executable file
48
q3radiant/Messaging.h
Normal file → Executable file
|
|
@ -19,28 +19,28 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $Log: Messaging.h,v $
|
||||
// Revision 1.1.2.1 2000/02/04 22:59:34 ttimo
|
||||
// messaging API preview
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// headers for internal classes used in Messaging.cpp
|
||||
//
|
||||
|
||||
#ifndef __MESSAGING_H_
|
||||
#define __MESSAGING_H_
|
||||
|
||||
class CXYWndWrapper : public IXYWndWrapper
|
||||
{
|
||||
public:
|
||||
void SnapToGrid( int x1, int y1, vec3_t pt );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.2.1 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/02/04 22:59:34 $
|
||||
// $Log: Messaging.h,v $
|
||||
// Revision 1.1.2.1 2000/02/04 22:59:34 ttimo
|
||||
// messaging API preview
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// headers for internal classes used in Messaging.cpp
|
||||
//
|
||||
|
||||
#ifndef __MESSAGING_H_
|
||||
#define __MESSAGING_H_
|
||||
|
||||
class CXYWndWrapper : public IXYWndWrapper
|
||||
{
|
||||
public:
|
||||
void SnapToGrid( int x1, int y1, vec3_t pt );
|
||||
};
|
||||
|
||||
#endif
|
||||
116
q3radiant/NameDlg.cpp
Normal file → Executable file
116
q3radiant/NameDlg.cpp
Normal file → Executable file
|
|
@ -19,61 +19,61 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// NameDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "NameDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNameDlg dialog
|
||||
|
||||
|
||||
CNameDlg::CNameDlg(const char *pName, CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CNameDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CNameDlg)
|
||||
m_strName = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
m_strCaption = pName;
|
||||
}
|
||||
|
||||
|
||||
void CNameDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CNameDlg)
|
||||
DDX_Text(pDX, IDC_EDIT_NAME, m_strName);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNameDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CNameDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNameDlg message handlers
|
||||
|
||||
void CNameDlg::OnOK()
|
||||
{
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
BOOL CNameDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
SetWindowText(m_strCaption);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
// NameDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "NameDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNameDlg dialog
|
||||
|
||||
|
||||
CNameDlg::CNameDlg(const char *pName, CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CNameDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CNameDlg)
|
||||
m_strName = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
m_strCaption = pName;
|
||||
}
|
||||
|
||||
|
||||
void CNameDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CNameDlg)
|
||||
DDX_Text(pDX, IDC_EDIT_NAME, m_strName);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNameDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CNameDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNameDlg message handlers
|
||||
|
||||
void CNameDlg::OnOK()
|
||||
{
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
BOOL CNameDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
SetWindowText(m_strCaption);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
|
|
|||
96
q3radiant/NameDlg.h
Normal file → Executable file
96
q3radiant/NameDlg.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_NAMEDLG_H__624F3290_976A_48A9_AE89_50CD1E6E2F9A__INCLUDED_)
|
||||
#define AFX_NAMEDLG_H__624F3290_976A_48A9_AE89_50CD1E6E2F9A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// NameDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNameDlg dialog
|
||||
|
||||
class CNameDlg : public CDialog
|
||||
{
|
||||
CString m_strCaption;
|
||||
// Construction
|
||||
public:
|
||||
CNameDlg(const char *pName, CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CNameDlg)
|
||||
enum { IDD = IDD_NEWNAME };
|
||||
CString m_strName;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CNameDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CNameDlg)
|
||||
virtual void OnOK();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_NAMEDLG_H__624F3290_976A_48A9_AE89_50CD1E6E2F9A__INCLUDED_)
|
||||
#if !defined(AFX_NAMEDLG_H__624F3290_976A_48A9_AE89_50CD1E6E2F9A__INCLUDED_)
|
||||
#define AFX_NAMEDLG_H__624F3290_976A_48A9_AE89_50CD1E6E2F9A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// NameDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNameDlg dialog
|
||||
|
||||
class CNameDlg : public CDialog
|
||||
{
|
||||
CString m_strCaption;
|
||||
// Construction
|
||||
public:
|
||||
CNameDlg(const char *pName, CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CNameDlg)
|
||||
enum { IDD = IDD_NEWNAME };
|
||||
CString m_strName;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CNameDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CNameDlg)
|
||||
virtual void OnOK();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_NAMEDLG_H__624F3290_976A_48A9_AE89_50CD1E6E2F9A__INCLUDED_)
|
||||
|
|
|
|||
86
q3radiant/NewProjDlg.cpp
Normal file → Executable file
86
q3radiant/NewProjDlg.cpp
Normal file → Executable file
|
|
@ -19,46 +19,46 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// NewProjDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "NewProjDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNewProjDlg dialog
|
||||
|
||||
|
||||
CNewProjDlg::CNewProjDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CNewProjDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CNewProjDlg)
|
||||
m_strName = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CNewProjDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CNewProjDlg)
|
||||
DDX_Text(pDX, IDC_EDIT_NAME, m_strName);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNewProjDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CNewProjDlg)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNewProjDlg message handlers
|
||||
// NewProjDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "NewProjDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNewProjDlg dialog
|
||||
|
||||
|
||||
CNewProjDlg::CNewProjDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CNewProjDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CNewProjDlg)
|
||||
m_strName = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CNewProjDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CNewProjDlg)
|
||||
DDX_Text(pDX, IDC_EDIT_NAME, m_strName);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNewProjDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CNewProjDlg)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNewProjDlg message handlers
|
||||
|
|
|
|||
92
q3radiant/NewProjDlg.h
Normal file → Executable file
92
q3radiant/NewProjDlg.h
Normal file → Executable file
|
|
@ -19,49 +19,49 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_NEWPROJDLG_H__1E2527A2_8447_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_NEWPROJDLG_H__1E2527A2_8447_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// NewProjDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNewProjDlg dialog
|
||||
|
||||
class CNewProjDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CNewProjDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CNewProjDlg)
|
||||
enum { IDD = IDD_DLG_NEWPROJECT };
|
||||
CString m_strName;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CNewProjDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CNewProjDlg)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_NEWPROJDLG_H__1E2527A2_8447_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_NEWPROJDLG_H__1E2527A2_8447_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_NEWPROJDLG_H__1E2527A2_8447_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// NewProjDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNewProjDlg dialog
|
||||
|
||||
class CNewProjDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CNewProjDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CNewProjDlg)
|
||||
enum { IDD = IDD_DLG_NEWPROJECT };
|
||||
CString m_strName;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CNewProjDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CNewProjDlg)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_NEWPROJDLG_H__1E2527A2_8447_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
254
q3radiant/PARSE.CPP
Normal file → Executable file
254
q3radiant/PARSE.CPP
Normal file → Executable file
|
|
@ -19,130 +19,130 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "qe3.h"
|
||||
|
||||
char token[MAXTOKEN];
|
||||
qboolean unget;
|
||||
char *script_p;
|
||||
int scriptline;
|
||||
|
||||
void StartTokenParsing (char *data)
|
||||
{
|
||||
scriptline = 1;
|
||||
script_p = data;
|
||||
unget = false;
|
||||
}
|
||||
|
||||
qboolean WINAPI GetToken (qboolean crossline)
|
||||
{
|
||||
char *token_p;
|
||||
|
||||
if (unget) // is a token allready waiting?
|
||||
{
|
||||
unget = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// skip space
|
||||
//
|
||||
skipspace:
|
||||
while (*script_p <= 32)
|
||||
{
|
||||
if (!*script_p)
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [01]\n",scriptline);
|
||||
return false;
|
||||
}
|
||||
if (*script_p++ == '\n')
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [02]\n",scriptline);
|
||||
scriptline++;
|
||||
}
|
||||
}
|
||||
|
||||
if (script_p[0] == '/' && script_p[1] == '/') // comment field
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [03]\n",scriptline);
|
||||
while (*script_p++ != '\n')
|
||||
if (!*script_p)
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [04]\n",scriptline);
|
||||
return false;
|
||||
}
|
||||
goto skipspace;
|
||||
}
|
||||
|
||||
//
|
||||
// copy token
|
||||
//
|
||||
token_p = token;
|
||||
|
||||
if (*script_p == '"')
|
||||
{
|
||||
script_p++;
|
||||
//if (*script_p == '"') // handle double quotes i suspect they are put in by other editors cccasionally
|
||||
// script_p++;
|
||||
while ( *script_p != '"' )
|
||||
{
|
||||
if (!*script_p)
|
||||
Error ("EOF inside quoted token");
|
||||
*token_p++ = *script_p++;
|
||||
if (token_p == &token[MAXTOKEN])
|
||||
Error ("Token too large on line %i",scriptline);
|
||||
}
|
||||
script_p++;
|
||||
//if (*script_p == '"') // handle double quotes i suspect they are put in by other editors cccasionally
|
||||
// script_p++;
|
||||
}
|
||||
else while ( *script_p > 32 )
|
||||
{
|
||||
*token_p++ = *script_p++;
|
||||
if (token_p == &token[MAXTOKEN])
|
||||
Error ("Token too large on line %i",scriptline);
|
||||
}
|
||||
|
||||
*token_p = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WINAPI UngetToken (void)
|
||||
{
|
||||
unget = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
TokenAvailable
|
||||
|
||||
Returns true if there is another token on the line
|
||||
==============
|
||||
*/
|
||||
qboolean TokenAvailable (void)
|
||||
{
|
||||
char *search_p;
|
||||
|
||||
search_p = script_p;
|
||||
|
||||
while ( *search_p <= 32)
|
||||
{
|
||||
if (*search_p == '\n')
|
||||
return false;
|
||||
if (*search_p == 0)
|
||||
return false;
|
||||
search_p++;
|
||||
}
|
||||
|
||||
if (*search_p == ';')
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "qe3.h"
|
||||
|
||||
char token[MAXTOKEN];
|
||||
qboolean unget;
|
||||
char *script_p;
|
||||
int scriptline;
|
||||
|
||||
void StartTokenParsing (char *data)
|
||||
{
|
||||
scriptline = 1;
|
||||
script_p = data;
|
||||
unget = false;
|
||||
}
|
||||
|
||||
qboolean WINAPI GetToken (qboolean crossline)
|
||||
{
|
||||
char *token_p;
|
||||
|
||||
if (unget) // is a token allready waiting?
|
||||
{
|
||||
unget = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// skip space
|
||||
//
|
||||
skipspace:
|
||||
while (*script_p <= 32)
|
||||
{
|
||||
if (!*script_p)
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [01]\n",scriptline);
|
||||
return false;
|
||||
}
|
||||
if (*script_p++ == '\n')
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [02]\n",scriptline);
|
||||
scriptline++;
|
||||
}
|
||||
}
|
||||
|
||||
if (script_p[0] == '/' && script_p[1] == '/') // comment field
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [03]\n",scriptline);
|
||||
while (*script_p++ != '\n')
|
||||
if (!*script_p)
|
||||
{
|
||||
if (!crossline)
|
||||
Sys_Printf("Warning: Line %i is incomplete [04]\n",scriptline);
|
||||
return false;
|
||||
}
|
||||
goto skipspace;
|
||||
}
|
||||
|
||||
//
|
||||
// copy token
|
||||
//
|
||||
token_p = token;
|
||||
|
||||
if (*script_p == '"')
|
||||
{
|
||||
script_p++;
|
||||
//if (*script_p == '"') // handle double quotes i suspect they are put in by other editors cccasionally
|
||||
// script_p++;
|
||||
while ( *script_p != '"' )
|
||||
{
|
||||
if (!*script_p)
|
||||
Error ("EOF inside quoted token");
|
||||
*token_p++ = *script_p++;
|
||||
if (token_p == &token[MAXTOKEN])
|
||||
Error ("Token too large on line %i",scriptline);
|
||||
}
|
||||
script_p++;
|
||||
//if (*script_p == '"') // handle double quotes i suspect they are put in by other editors cccasionally
|
||||
// script_p++;
|
||||
}
|
||||
else while ( *script_p > 32 )
|
||||
{
|
||||
*token_p++ = *script_p++;
|
||||
if (token_p == &token[MAXTOKEN])
|
||||
Error ("Token too large on line %i",scriptline);
|
||||
}
|
||||
|
||||
*token_p = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WINAPI UngetToken (void)
|
||||
{
|
||||
unget = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
TokenAvailable
|
||||
|
||||
Returns true if there is another token on the line
|
||||
==============
|
||||
*/
|
||||
qboolean TokenAvailable (void)
|
||||
{
|
||||
char *search_p;
|
||||
|
||||
search_p = script_p;
|
||||
|
||||
while ( *search_p <= 32)
|
||||
{
|
||||
if (*search_p == '\n')
|
||||
return false;
|
||||
if (*search_p == 0)
|
||||
return false;
|
||||
search_p++;
|
||||
}
|
||||
|
||||
if (*search_p == ';')
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
26
q3radiant/PARSE.H
Normal file → Executable file
26
q3radiant/PARSE.H
Normal file → Executable file
|
|
@ -19,16 +19,16 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// parse.h -- text file parsing routines
|
||||
|
||||
#define MAXTOKEN 1024
|
||||
|
||||
extern char token[MAXTOKEN];
|
||||
extern int scriptline;
|
||||
|
||||
// NOTE: added WINAPI call syntax to export these for plugins in _QERScripLibTable
|
||||
void StartTokenParsing (char *data);
|
||||
qboolean WINAPI GetToken (qboolean crossline);
|
||||
void WINAPI UngetToken (void);
|
||||
qboolean TokenAvailable (void);
|
||||
|
||||
// parse.h -- text file parsing routines
|
||||
|
||||
#define MAXTOKEN 1024
|
||||
|
||||
extern char token[MAXTOKEN];
|
||||
extern int scriptline;
|
||||
|
||||
// NOTE: added WINAPI call syntax to export these for plugins in _QERScripLibTable
|
||||
void StartTokenParsing (char *data);
|
||||
qboolean WINAPI GetToken (qboolean crossline);
|
||||
void WINAPI UngetToken (void);
|
||||
qboolean TokenAvailable (void);
|
||||
|
||||
|
|
|
|||
10230
q3radiant/PMESH.CPP
Normal file → Executable file
10230
q3radiant/PMESH.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
0
q3radiant/PMESH.H
Normal file → Executable file
0
q3radiant/PMESH.H
Normal file → Executable file
270
q3radiant/POINTS.CPP
Normal file → Executable file
270
q3radiant/POINTS.CPP
Normal file → Executable file
|
|
@ -19,138 +19,138 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "qe3.h"
|
||||
|
||||
|
||||
#define MAX_POINTFILE 8192
|
||||
static vec3_t s_pointvecs[MAX_POINTFILE];
|
||||
static int s_num_points, s_check_point;
|
||||
|
||||
void Pointfile_Delete (void)
|
||||
{
|
||||
char name[1024];
|
||||
|
||||
strcpy (name, currentmap);
|
||||
StripExtension (name);
|
||||
strcat (name, ".lin");
|
||||
|
||||
remove(name);
|
||||
}
|
||||
|
||||
// advance camera to next point
|
||||
void Pointfile_Next (void)
|
||||
{
|
||||
vec3_t dir;
|
||||
|
||||
if (s_check_point >= s_num_points-2)
|
||||
{
|
||||
Sys_Status ("End of pointfile", 0);
|
||||
return;
|
||||
}
|
||||
s_check_point++;
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetCamera()->Camera().origin);
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetXYWnd()->GetOrigin());
|
||||
VectorSubtract (s_pointvecs[s_check_point+1], g_pParentWnd->GetCamera()->Camera().origin, dir);
|
||||
VectorNormalize (dir);
|
||||
g_pParentWnd->GetCamera()->Camera().angles[1] = atan2 (dir[1], dir[0])*180/3.14159;
|
||||
g_pParentWnd->GetCamera()->Camera().angles[0] = asin (dir[2])*180/3.14159;
|
||||
|
||||
Sys_UpdateWindows (W_ALL);
|
||||
}
|
||||
|
||||
// advance camera to previous point
|
||||
void Pointfile_Prev (void)
|
||||
{
|
||||
vec3_t dir;
|
||||
|
||||
if ( s_check_point == 0)
|
||||
{
|
||||
Sys_Status ("Start of pointfile", 0);
|
||||
return;
|
||||
}
|
||||
s_check_point--;
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetCamera()->Camera().origin);
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetXYWnd()->GetOrigin());
|
||||
VectorSubtract (s_pointvecs[s_check_point+1], g_pParentWnd->GetCamera()->Camera().origin, dir);
|
||||
VectorNormalize (dir);
|
||||
g_pParentWnd->GetCamera()->Camera().angles[1] = atan2 (dir[1], dir[0])*180/3.14159;
|
||||
g_pParentWnd->GetCamera()->Camera().angles[0] = asin (dir[2])*180/3.14159;
|
||||
|
||||
Sys_UpdateWindows (W_ALL);
|
||||
}
|
||||
|
||||
void WINAPI Pointfile_Check (void)
|
||||
{
|
||||
char name[1024];
|
||||
FILE *f;
|
||||
vec3_t v;
|
||||
|
||||
strcpy (name, currentmap);
|
||||
StripExtension (name);
|
||||
strcat (name, ".lin");
|
||||
|
||||
f = fopen (name, "r");
|
||||
if (!f)
|
||||
return;
|
||||
|
||||
Sys_Printf ("Reading pointfile %s\n", name);
|
||||
|
||||
if (!g_qeglobals.d_pointfile_display_list)
|
||||
g_qeglobals.d_pointfile_display_list = qglGenLists(1);
|
||||
|
||||
s_num_points = 0;
|
||||
qglNewList (g_qeglobals.d_pointfile_display_list, GL_COMPILE);
|
||||
qglColor3f (1, 0, 0);
|
||||
qglDisable(GL_TEXTURE_2D);
|
||||
qglDisable(GL_TEXTURE_1D);
|
||||
qglLineWidth (4);
|
||||
qglBegin(GL_LINE_STRIP);
|
||||
do
|
||||
{
|
||||
if (fscanf (f, "%f %f %f\n", &v[0], &v[1], &v[2]) != 3)
|
||||
break;
|
||||
if (s_num_points < MAX_POINTFILE)
|
||||
{
|
||||
VectorCopy (v, s_pointvecs[s_num_points]);
|
||||
s_num_points++;
|
||||
}
|
||||
qglVertex3fv (v);
|
||||
} while (1);
|
||||
qglEnd();
|
||||
qglLineWidth (1);
|
||||
qglEndList ();
|
||||
|
||||
s_check_point = 0;
|
||||
fclose (f);
|
||||
//Pointfile_Next ();
|
||||
}
|
||||
|
||||
void Pointfile_Draw( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
qglColor3f( 1.0F, 0.0F, 0.0F );
|
||||
qglDisable(GL_TEXTURE_2D);
|
||||
qglDisable(GL_TEXTURE_1D);
|
||||
qglLineWidth (4);
|
||||
qglBegin(GL_LINE_STRIP);
|
||||
for ( i = 0; i < s_num_points; i++ )
|
||||
{
|
||||
qglVertex3fv( s_pointvecs[i] );
|
||||
}
|
||||
qglEnd();
|
||||
qglLineWidth( 1 );
|
||||
}
|
||||
|
||||
void Pointfile_Clear (void)
|
||||
{
|
||||
if (!g_qeglobals.d_pointfile_display_list)
|
||||
return;
|
||||
|
||||
qglDeleteLists (g_qeglobals.d_pointfile_display_list, 1);
|
||||
g_qeglobals.d_pointfile_display_list = 0;
|
||||
Sys_UpdateWindows (W_ALL);
|
||||
}
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "qe3.h"
|
||||
|
||||
|
||||
#define MAX_POINTFILE 8192
|
||||
static vec3_t s_pointvecs[MAX_POINTFILE];
|
||||
static int s_num_points, s_check_point;
|
||||
|
||||
void Pointfile_Delete (void)
|
||||
{
|
||||
char name[1024];
|
||||
|
||||
strcpy (name, currentmap);
|
||||
StripExtension (name);
|
||||
strcat (name, ".lin");
|
||||
|
||||
remove(name);
|
||||
}
|
||||
|
||||
// advance camera to next point
|
||||
void Pointfile_Next (void)
|
||||
{
|
||||
vec3_t dir;
|
||||
|
||||
if (s_check_point >= s_num_points-2)
|
||||
{
|
||||
Sys_Status ("End of pointfile", 0);
|
||||
return;
|
||||
}
|
||||
s_check_point++;
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetCamera()->Camera().origin);
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetXYWnd()->GetOrigin());
|
||||
VectorSubtract (s_pointvecs[s_check_point+1], g_pParentWnd->GetCamera()->Camera().origin, dir);
|
||||
VectorNormalize (dir);
|
||||
g_pParentWnd->GetCamera()->Camera().angles[1] = atan2 (dir[1], dir[0])*180/3.14159;
|
||||
g_pParentWnd->GetCamera()->Camera().angles[0] = asin (dir[2])*180/3.14159;
|
||||
|
||||
Sys_UpdateWindows (W_ALL);
|
||||
}
|
||||
|
||||
// advance camera to previous point
|
||||
void Pointfile_Prev (void)
|
||||
{
|
||||
vec3_t dir;
|
||||
|
||||
if ( s_check_point == 0)
|
||||
{
|
||||
Sys_Status ("Start of pointfile", 0);
|
||||
return;
|
||||
}
|
||||
s_check_point--;
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetCamera()->Camera().origin);
|
||||
VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetXYWnd()->GetOrigin());
|
||||
VectorSubtract (s_pointvecs[s_check_point+1], g_pParentWnd->GetCamera()->Camera().origin, dir);
|
||||
VectorNormalize (dir);
|
||||
g_pParentWnd->GetCamera()->Camera().angles[1] = atan2 (dir[1], dir[0])*180/3.14159;
|
||||
g_pParentWnd->GetCamera()->Camera().angles[0] = asin (dir[2])*180/3.14159;
|
||||
|
||||
Sys_UpdateWindows (W_ALL);
|
||||
}
|
||||
|
||||
void WINAPI Pointfile_Check (void)
|
||||
{
|
||||
char name[1024];
|
||||
FILE *f;
|
||||
vec3_t v;
|
||||
|
||||
strcpy (name, currentmap);
|
||||
StripExtension (name);
|
||||
strcat (name, ".lin");
|
||||
|
||||
f = fopen (name, "r");
|
||||
if (!f)
|
||||
return;
|
||||
|
||||
Sys_Printf ("Reading pointfile %s\n", name);
|
||||
|
||||
if (!g_qeglobals.d_pointfile_display_list)
|
||||
g_qeglobals.d_pointfile_display_list = qglGenLists(1);
|
||||
|
||||
s_num_points = 0;
|
||||
qglNewList (g_qeglobals.d_pointfile_display_list, GL_COMPILE);
|
||||
qglColor3f (1, 0, 0);
|
||||
qglDisable(GL_TEXTURE_2D);
|
||||
qglDisable(GL_TEXTURE_1D);
|
||||
qglLineWidth (4);
|
||||
qglBegin(GL_LINE_STRIP);
|
||||
do
|
||||
{
|
||||
if (fscanf (f, "%f %f %f\n", &v[0], &v[1], &v[2]) != 3)
|
||||
break;
|
||||
if (s_num_points < MAX_POINTFILE)
|
||||
{
|
||||
VectorCopy (v, s_pointvecs[s_num_points]);
|
||||
s_num_points++;
|
||||
}
|
||||
qglVertex3fv (v);
|
||||
} while (1);
|
||||
qglEnd();
|
||||
qglLineWidth (1);
|
||||
qglEndList ();
|
||||
|
||||
s_check_point = 0;
|
||||
fclose (f);
|
||||
//Pointfile_Next ();
|
||||
}
|
||||
|
||||
void Pointfile_Draw( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
qglColor3f( 1.0F, 0.0F, 0.0F );
|
||||
qglDisable(GL_TEXTURE_2D);
|
||||
qglDisable(GL_TEXTURE_1D);
|
||||
qglLineWidth (4);
|
||||
qglBegin(GL_LINE_STRIP);
|
||||
for ( i = 0; i < s_num_points; i++ )
|
||||
{
|
||||
qglVertex3fv( s_pointvecs[i] );
|
||||
}
|
||||
qglEnd();
|
||||
qglLineWidth( 1 );
|
||||
}
|
||||
|
||||
void Pointfile_Clear (void)
|
||||
{
|
||||
if (!g_qeglobals.d_pointfile_display_list)
|
||||
return;
|
||||
|
||||
qglDeleteLists (g_qeglobals.d_pointfile_display_list, 1);
|
||||
g_qeglobals.d_pointfile_display_list = 0;
|
||||
Sys_UpdateWindows (W_ALL);
|
||||
}
|
||||
|
||||
|
|
|
|||
136
q3radiant/PatchDensityDlg.cpp
Normal file → Executable file
136
q3radiant/PatchDensityDlg.cpp
Normal file → Executable file
|
|
@ -19,71 +19,71 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// PatchDensityDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "PatchDensityDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDensityDlg dialog
|
||||
|
||||
|
||||
CPatchDensityDlg::CPatchDensityDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CPatchDensityDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CPatchDensityDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CPatchDensityDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CPatchDensityDlg)
|
||||
DDX_Control(pDX, IDC_COMBO_WIDTH, m_wndWidth);
|
||||
DDX_Control(pDX, IDC_COMBO_HEIGHT, m_wndHeight);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPatchDensityDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CPatchDensityDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDensityDlg message handlers
|
||||
|
||||
int g_nXLat[] = {3,5,7,9,11,13,15};
|
||||
|
||||
void CPatchDensityDlg::OnOK()
|
||||
{
|
||||
int nWidth = m_wndWidth.GetCurSel();
|
||||
int nHeight = m_wndHeight.GetCurSel();
|
||||
|
||||
if (nWidth >= 0 && nWidth <= 6 && nHeight >= 0 && nHeight <= 6)
|
||||
{
|
||||
Patch_GenericMesh(g_nXLat[nWidth], g_nXLat[nHeight], g_pParentWnd->ActiveXY()->GetViewType());
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
BOOL CPatchDensityDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_wndWidth.SetCurSel(0);
|
||||
m_wndHeight.SetCurSel(0);
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
// PatchDensityDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "PatchDensityDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDensityDlg dialog
|
||||
|
||||
|
||||
CPatchDensityDlg::CPatchDensityDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CPatchDensityDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CPatchDensityDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CPatchDensityDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CPatchDensityDlg)
|
||||
DDX_Control(pDX, IDC_COMBO_WIDTH, m_wndWidth);
|
||||
DDX_Control(pDX, IDC_COMBO_HEIGHT, m_wndHeight);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPatchDensityDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CPatchDensityDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDensityDlg message handlers
|
||||
|
||||
int g_nXLat[] = {3,5,7,9,11,13,15};
|
||||
|
||||
void CPatchDensityDlg::OnOK()
|
||||
{
|
||||
int nWidth = m_wndWidth.GetCurSel();
|
||||
int nHeight = m_wndHeight.GetCurSel();
|
||||
|
||||
if (nWidth >= 0 && nWidth <= 6 && nHeight >= 0 && nHeight <= 6)
|
||||
{
|
||||
Patch_GenericMesh(g_nXLat[nWidth], g_nXLat[nHeight], g_pParentWnd->ActiveXY()->GetViewType());
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
BOOL CPatchDensityDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_wndWidth.SetCurSel(0);
|
||||
m_wndHeight.SetCurSel(0);
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
|
|
|||
96
q3radiant/PatchDensityDlg.h
Normal file → Executable file
96
q3radiant/PatchDensityDlg.h
Normal file → Executable file
|
|
@ -19,51 +19,51 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_PATCHDENSITYDLG_H__509162A1_1023_11D2_AFFB_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PATCHDENSITYDLG_H__509162A1_1023_11D2_AFFB_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// PatchDensityDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDensityDlg dialog
|
||||
|
||||
class CPatchDensityDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CPatchDensityDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPatchDensityDlg)
|
||||
enum { IDD = IDD_DIALOG_NEWPATCH };
|
||||
CComboBox m_wndWidth;
|
||||
CComboBox m_wndHeight;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPatchDensityDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPatchDensityDlg)
|
||||
virtual void OnOK();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PATCHDENSITYDLG_H__509162A1_1023_11D2_AFFB_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_PATCHDENSITYDLG_H__509162A1_1023_11D2_AFFB_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PATCHDENSITYDLG_H__509162A1_1023_11D2_AFFB_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// PatchDensityDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDensityDlg dialog
|
||||
|
||||
class CPatchDensityDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CPatchDensityDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPatchDensityDlg)
|
||||
enum { IDD = IDD_DIALOG_NEWPATCH };
|
||||
CComboBox m_wndWidth;
|
||||
CComboBox m_wndHeight;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPatchDensityDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPatchDensityDlg)
|
||||
virtual void OnOK();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PATCHDENSITYDLG_H__509162A1_1023_11D2_AFFB_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
666
q3radiant/PatchDialog.cpp
Normal file → Executable file
666
q3radiant/PatchDialog.cpp
Normal file → Executable file
|
|
@ -19,336 +19,336 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// PatchDialog.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "PatchDialog.h"
|
||||
#include "TextureLayout.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDialog dialog
|
||||
|
||||
CPatchDialog g_PatchDialog;
|
||||
|
||||
CPatchDialog::CPatchDialog(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CPatchDialog::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CPatchDialog)
|
||||
m_strName = _T("");
|
||||
m_fS = 0.0f;
|
||||
m_fT = 0.0f;
|
||||
m_fX = 0.0f;
|
||||
m_fY = 0.0f;
|
||||
m_fZ = 0.0f;
|
||||
m_fHScale = 0.05f;
|
||||
m_fHShift = 0.05f;
|
||||
m_fRotate = 45;
|
||||
m_fVScale = 0.05f;
|
||||
m_fVShift = 0.05f;
|
||||
//}}AFX_DATA_INIT
|
||||
m_Patch = NULL;
|
||||
}
|
||||
|
||||
|
||||
void CPatchDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CPatchDialog)
|
||||
DDX_Control(pDX, IDC_SPIN_VSHIFT, m_wndVShift);
|
||||
DDX_Control(pDX, IDC_SPIN_VSCALE, m_wndVScale);
|
||||
DDX_Control(pDX, IDC_SPIN_ROTATE, m_wndRotate);
|
||||
DDX_Control(pDX, IDC_SPIN_HSHIFT, m_wndHShift);
|
||||
DDX_Control(pDX, IDC_SPIN_HSCALE, m_wndHScale);
|
||||
DDX_Control(pDX, IDC_COMBO_TYPE, m_wndType);
|
||||
DDX_Control(pDX, IDC_COMBO_ROW, m_wndRows);
|
||||
DDX_Control(pDX, IDC_COMBO_COL, m_wndCols);
|
||||
DDX_Text(pDX, IDC_EDIT_NAME, m_strName);
|
||||
DDX_Text(pDX, IDC_EDIT_S, m_fS);
|
||||
DDX_Text(pDX, IDC_EDIT_T, m_fT);
|
||||
DDX_Text(pDX, IDC_EDIT_X, m_fX);
|
||||
DDX_Text(pDX, IDC_EDIT_Y, m_fY);
|
||||
DDX_Text(pDX, IDC_EDIT_Z, m_fZ);
|
||||
DDX_Text(pDX, IDC_HSCALE, m_fHScale);
|
||||
DDX_Text(pDX, IDC_HSHIFT, m_fHShift);
|
||||
DDX_Text(pDX, IDC_ROTATE, m_fRotate);
|
||||
DDX_Text(pDX, IDC_VSCALE, m_fVScale);
|
||||
DDX_Text(pDX, IDC_VSHIFT, m_fVShift);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPatchDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CPatchDialog)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHDETAILS, OnBtnPatchdetails)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHFIT, OnBtnPatchfit)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHNATURAL, OnBtnPatchnatural)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHRESET, OnBtnPatchreset)
|
||||
ON_CBN_SELCHANGE(IDC_COMBO_COL, OnSelchangeComboCol)
|
||||
ON_CBN_SELCHANGE(IDC_COMBO_ROW, OnSelchangeComboRow)
|
||||
ON_CBN_SELCHANGE(IDC_COMBO_TYPE, OnSelchangeComboType)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_HSCALE, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ROTATE, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_VSCALE, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_VSHIFT, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_HSHIFT, OnDeltaposSpin)
|
||||
ON_WM_DESTROY()
|
||||
ON_BN_CLICKED(ID_APPLY, OnApply)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDialog message handlers
|
||||
|
||||
void CPatchDialog::OnBtnPatchdetails()
|
||||
{
|
||||
Patch_NaturalizeSelected(true);
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnBtnPatchfit()
|
||||
{
|
||||
Patch_FitTexturing();
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnBtnPatchnatural()
|
||||
{
|
||||
Patch_NaturalizeSelected();
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnBtnPatchreset()
|
||||
{
|
||||
CTextureLayout dlg;
|
||||
if (dlg.DoModal() == IDOK)
|
||||
{
|
||||
Patch_ResetTexturing(dlg.m_fX, dlg.m_fY);
|
||||
}
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnSelchangeComboCol()
|
||||
{
|
||||
UpdateRowColInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnSelchangeComboRow()
|
||||
{
|
||||
UpdateRowColInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnSelchangeComboType()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CPatchDialog::OnOK()
|
||||
{
|
||||
m_Patch = NULL;
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnDeltaposSpin(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
|
||||
UpdateSpinners((pNMUpDown->iDelta > 0), pNMUpDown->hdr.idFrom);
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
BOOL CPatchDialog::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_wndHScale.SetRange(0, 1000);
|
||||
m_wndVScale.SetRange(0, 1000);
|
||||
m_wndHShift.SetRange(0, 1000);
|
||||
m_wndVShift.SetRange(0, 1000);
|
||||
m_wndRotate.SetRange(0, 1000);
|
||||
|
||||
GetPatchInfo();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPatchDialog::GetPatchInfo()
|
||||
{
|
||||
m_Patch = SinglePatchSelected();
|
||||
if (m_Patch != NULL)
|
||||
{
|
||||
CString str;
|
||||
int i;
|
||||
m_wndRows.ResetContent();
|
||||
for (i = 0; i < m_Patch->height; i++)
|
||||
{
|
||||
str.Format("%i", i);
|
||||
m_wndRows.AddString(str);
|
||||
}
|
||||
m_wndRows.SetCurSel(0);
|
||||
m_wndCols.ResetContent();
|
||||
for (i = 0; i < m_Patch->width; i++)
|
||||
{
|
||||
str.Format("%i", i);
|
||||
m_wndCols.AddString(str);
|
||||
}
|
||||
m_wndCols.SetCurSel(0);
|
||||
}
|
||||
UpdateRowColInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::SetPatchInfo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DoPatchInspector()
|
||||
{
|
||||
if (g_PatchDialog.GetSafeHwnd() == NULL)
|
||||
{
|
||||
g_PatchDialog.Create(IDD_DIALOG_PATCH);
|
||||
CRect rct;
|
||||
LONG lSize = sizeof(rct);
|
||||
if (LoadRegistryInfo("Radiant::PatchWindow", &rct, &lSize))
|
||||
{
|
||||
g_PatchDialog.SetWindowPos(NULL, rct.left, rct.top, 0,0, SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
g_PatchDialog.ShowWindow(SW_SHOW);
|
||||
g_PatchDialog.GetPatchInfo();
|
||||
}
|
||||
|
||||
void UpdatePatchInspector()
|
||||
{
|
||||
if (g_PatchDialog.GetSafeHwnd() != NULL)
|
||||
{
|
||||
g_PatchDialog.UpdateInfo();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CPatchDialog::OnDestroy()
|
||||
{
|
||||
if (GetSafeHwnd())
|
||||
{
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::PatchWindow", &rct, sizeof(rct));
|
||||
}
|
||||
CDialog::OnDestroy();
|
||||
}
|
||||
|
||||
void CPatchDialog::UpdateRowColInfo()
|
||||
{
|
||||
m_fX = m_fY = m_fZ = m_fS = m_fT = 0.0;
|
||||
|
||||
if (m_Patch != NULL)
|
||||
{
|
||||
int r = m_wndRows.GetCurSel();
|
||||
int c = m_wndCols.GetCurSel();
|
||||
if (r >= 0 && r < m_Patch->height && c >= 0 && c < m_Patch->width)
|
||||
{
|
||||
m_fX = m_Patch->ctrl[c][r].xyz[0];
|
||||
m_fY = m_Patch->ctrl[c][r].xyz[1];
|
||||
m_fZ = m_Patch->ctrl[c][r].xyz[2];
|
||||
m_fS = m_Patch->ctrl[c][r].st[0];
|
||||
m_fT = m_Patch->ctrl[c][r].st[1];
|
||||
}
|
||||
}
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
|
||||
void CPatchDialog::UpdateInfo()
|
||||
{
|
||||
GetPatchInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnApply()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
if (m_Patch != NULL)
|
||||
{
|
||||
int r = m_wndRows.GetCurSel();
|
||||
int c = m_wndCols.GetCurSel();
|
||||
if (r >= 0 && r < m_Patch->height && c >= 0 && c < m_Patch->width)
|
||||
{
|
||||
m_Patch->ctrl[c][r].xyz[0] = m_fX;
|
||||
m_Patch->ctrl[c][r].xyz[1] = m_fY;
|
||||
m_Patch->ctrl[c][r].xyz[2] = m_fZ;
|
||||
m_Patch->ctrl[c][r].st[0] = m_fS;
|
||||
m_Patch->ctrl[c][r].st[1] = m_fT;
|
||||
m_Patch->bDirty = true;
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPatchDialog::UpdateSpinners(bool bUp, int nID)
|
||||
{
|
||||
texdef_t td;
|
||||
|
||||
td.rotate = 0.0;
|
||||
td.scale[0] = td.scale[1] = 0.0;
|
||||
td.shift[0] = td.shift[1] = 0.0;
|
||||
td.contents = 0;
|
||||
td.flags = 0;
|
||||
td.value = 0;
|
||||
|
||||
|
||||
UpdateData(TRUE);
|
||||
|
||||
if (nID == IDC_SPIN_ROTATE)
|
||||
{
|
||||
if (bUp)
|
||||
td.rotate = m_fRotate;
|
||||
else
|
||||
td.rotate = -m_fRotate;
|
||||
}
|
||||
else if (nID == IDC_SPIN_HSCALE)
|
||||
{
|
||||
if (bUp)
|
||||
td.scale[0] = 1 - m_fHScale;
|
||||
else
|
||||
td.scale[0] = 1 + m_fHScale;
|
||||
}
|
||||
else if (nID == IDC_SPIN_VSCALE)
|
||||
{
|
||||
if (bUp)
|
||||
td.scale[1] = 1 - m_fVScale;
|
||||
else
|
||||
td.scale[1] = 1 + m_fVScale;
|
||||
}
|
||||
|
||||
else if (nID == IDC_SPIN_HSHIFT)
|
||||
{
|
||||
if (bUp)
|
||||
td.shift[0] = m_fHShift;
|
||||
else
|
||||
td.shift[0] = -m_fHShift;
|
||||
}
|
||||
else if (nID == IDC_SPIN_VSHIFT)
|
||||
{
|
||||
if (bUp)
|
||||
td.shift[1] = m_fVShift;
|
||||
else
|
||||
td.shift[1] = -m_fVShift;
|
||||
}
|
||||
|
||||
Patch_SetTextureInfo(&td);
|
||||
Sys_UpdateWindows(W_CAMERA);
|
||||
}
|
||||
|
||||
|
||||
// PatchDialog.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "PatchDialog.h"
|
||||
#include "TextureLayout.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDialog dialog
|
||||
|
||||
CPatchDialog g_PatchDialog;
|
||||
|
||||
CPatchDialog::CPatchDialog(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CPatchDialog::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CPatchDialog)
|
||||
m_strName = _T("");
|
||||
m_fS = 0.0f;
|
||||
m_fT = 0.0f;
|
||||
m_fX = 0.0f;
|
||||
m_fY = 0.0f;
|
||||
m_fZ = 0.0f;
|
||||
m_fHScale = 0.05f;
|
||||
m_fHShift = 0.05f;
|
||||
m_fRotate = 45;
|
||||
m_fVScale = 0.05f;
|
||||
m_fVShift = 0.05f;
|
||||
//}}AFX_DATA_INIT
|
||||
m_Patch = NULL;
|
||||
}
|
||||
|
||||
|
||||
void CPatchDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CPatchDialog)
|
||||
DDX_Control(pDX, IDC_SPIN_VSHIFT, m_wndVShift);
|
||||
DDX_Control(pDX, IDC_SPIN_VSCALE, m_wndVScale);
|
||||
DDX_Control(pDX, IDC_SPIN_ROTATE, m_wndRotate);
|
||||
DDX_Control(pDX, IDC_SPIN_HSHIFT, m_wndHShift);
|
||||
DDX_Control(pDX, IDC_SPIN_HSCALE, m_wndHScale);
|
||||
DDX_Control(pDX, IDC_COMBO_TYPE, m_wndType);
|
||||
DDX_Control(pDX, IDC_COMBO_ROW, m_wndRows);
|
||||
DDX_Control(pDX, IDC_COMBO_COL, m_wndCols);
|
||||
DDX_Text(pDX, IDC_EDIT_NAME, m_strName);
|
||||
DDX_Text(pDX, IDC_EDIT_S, m_fS);
|
||||
DDX_Text(pDX, IDC_EDIT_T, m_fT);
|
||||
DDX_Text(pDX, IDC_EDIT_X, m_fX);
|
||||
DDX_Text(pDX, IDC_EDIT_Y, m_fY);
|
||||
DDX_Text(pDX, IDC_EDIT_Z, m_fZ);
|
||||
DDX_Text(pDX, IDC_HSCALE, m_fHScale);
|
||||
DDX_Text(pDX, IDC_HSHIFT, m_fHShift);
|
||||
DDX_Text(pDX, IDC_ROTATE, m_fRotate);
|
||||
DDX_Text(pDX, IDC_VSCALE, m_fVScale);
|
||||
DDX_Text(pDX, IDC_VSHIFT, m_fVShift);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPatchDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CPatchDialog)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHDETAILS, OnBtnPatchdetails)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHFIT, OnBtnPatchfit)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHNATURAL, OnBtnPatchnatural)
|
||||
ON_BN_CLICKED(IDC_BTN_PATCHRESET, OnBtnPatchreset)
|
||||
ON_CBN_SELCHANGE(IDC_COMBO_COL, OnSelchangeComboCol)
|
||||
ON_CBN_SELCHANGE(IDC_COMBO_ROW, OnSelchangeComboRow)
|
||||
ON_CBN_SELCHANGE(IDC_COMBO_TYPE, OnSelchangeComboType)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_HSCALE, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ROTATE, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_VSCALE, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_VSHIFT, OnDeltaposSpin)
|
||||
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_HSHIFT, OnDeltaposSpin)
|
||||
ON_WM_DESTROY()
|
||||
ON_BN_CLICKED(ID_APPLY, OnApply)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDialog message handlers
|
||||
|
||||
void CPatchDialog::OnBtnPatchdetails()
|
||||
{
|
||||
Patch_NaturalizeSelected(true);
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnBtnPatchfit()
|
||||
{
|
||||
Patch_FitTexturing();
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnBtnPatchnatural()
|
||||
{
|
||||
Patch_NaturalizeSelected();
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnBtnPatchreset()
|
||||
{
|
||||
CTextureLayout dlg;
|
||||
if (dlg.DoModal() == IDOK)
|
||||
{
|
||||
Patch_ResetTexturing(dlg.m_fX, dlg.m_fY);
|
||||
}
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
|
||||
void CPatchDialog::OnSelchangeComboCol()
|
||||
{
|
||||
UpdateRowColInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnSelchangeComboRow()
|
||||
{
|
||||
UpdateRowColInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnSelchangeComboType()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
|
||||
void CPatchDialog::OnOK()
|
||||
{
|
||||
m_Patch = NULL;
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnDeltaposSpin(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
|
||||
UpdateSpinners((pNMUpDown->iDelta > 0), pNMUpDown->hdr.idFrom);
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
BOOL CPatchDialog::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_wndHScale.SetRange(0, 1000);
|
||||
m_wndVScale.SetRange(0, 1000);
|
||||
m_wndHShift.SetRange(0, 1000);
|
||||
m_wndVShift.SetRange(0, 1000);
|
||||
m_wndRotate.SetRange(0, 1000);
|
||||
|
||||
GetPatchInfo();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPatchDialog::GetPatchInfo()
|
||||
{
|
||||
m_Patch = SinglePatchSelected();
|
||||
if (m_Patch != NULL)
|
||||
{
|
||||
CString str;
|
||||
int i;
|
||||
m_wndRows.ResetContent();
|
||||
for (i = 0; i < m_Patch->height; i++)
|
||||
{
|
||||
str.Format("%i", i);
|
||||
m_wndRows.AddString(str);
|
||||
}
|
||||
m_wndRows.SetCurSel(0);
|
||||
m_wndCols.ResetContent();
|
||||
for (i = 0; i < m_Patch->width; i++)
|
||||
{
|
||||
str.Format("%i", i);
|
||||
m_wndCols.AddString(str);
|
||||
}
|
||||
m_wndCols.SetCurSel(0);
|
||||
}
|
||||
UpdateRowColInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::SetPatchInfo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DoPatchInspector()
|
||||
{
|
||||
if (g_PatchDialog.GetSafeHwnd() == NULL)
|
||||
{
|
||||
g_PatchDialog.Create(IDD_DIALOG_PATCH);
|
||||
CRect rct;
|
||||
LONG lSize = sizeof(rct);
|
||||
if (LoadRegistryInfo("Radiant::PatchWindow", &rct, &lSize))
|
||||
{
|
||||
g_PatchDialog.SetWindowPos(NULL, rct.left, rct.top, 0,0, SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
g_PatchDialog.ShowWindow(SW_SHOW);
|
||||
g_PatchDialog.GetPatchInfo();
|
||||
}
|
||||
|
||||
void UpdatePatchInspector()
|
||||
{
|
||||
if (g_PatchDialog.GetSafeHwnd() != NULL)
|
||||
{
|
||||
g_PatchDialog.UpdateInfo();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CPatchDialog::OnDestroy()
|
||||
{
|
||||
if (GetSafeHwnd())
|
||||
{
|
||||
CRect rct;
|
||||
GetWindowRect(rct);
|
||||
SaveRegistryInfo("Radiant::PatchWindow", &rct, sizeof(rct));
|
||||
}
|
||||
CDialog::OnDestroy();
|
||||
}
|
||||
|
||||
void CPatchDialog::UpdateRowColInfo()
|
||||
{
|
||||
m_fX = m_fY = m_fZ = m_fS = m_fT = 0.0;
|
||||
|
||||
if (m_Patch != NULL)
|
||||
{
|
||||
int r = m_wndRows.GetCurSel();
|
||||
int c = m_wndCols.GetCurSel();
|
||||
if (r >= 0 && r < m_Patch->height && c >= 0 && c < m_Patch->width)
|
||||
{
|
||||
m_fX = m_Patch->ctrl[c][r].xyz[0];
|
||||
m_fY = m_Patch->ctrl[c][r].xyz[1];
|
||||
m_fZ = m_Patch->ctrl[c][r].xyz[2];
|
||||
m_fS = m_Patch->ctrl[c][r].st[0];
|
||||
m_fT = m_Patch->ctrl[c][r].st[1];
|
||||
}
|
||||
}
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
|
||||
void CPatchDialog::UpdateInfo()
|
||||
{
|
||||
GetPatchInfo();
|
||||
}
|
||||
|
||||
void CPatchDialog::OnApply()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
if (m_Patch != NULL)
|
||||
{
|
||||
int r = m_wndRows.GetCurSel();
|
||||
int c = m_wndCols.GetCurSel();
|
||||
if (r >= 0 && r < m_Patch->height && c >= 0 && c < m_Patch->width)
|
||||
{
|
||||
m_Patch->ctrl[c][r].xyz[0] = m_fX;
|
||||
m_Patch->ctrl[c][r].xyz[1] = m_fY;
|
||||
m_Patch->ctrl[c][r].xyz[2] = m_fZ;
|
||||
m_Patch->ctrl[c][r].st[0] = m_fS;
|
||||
m_Patch->ctrl[c][r].st[1] = m_fT;
|
||||
m_Patch->bDirty = true;
|
||||
Sys_UpdateWindows(W_ALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPatchDialog::UpdateSpinners(bool bUp, int nID)
|
||||
{
|
||||
texdef_t td;
|
||||
|
||||
td.rotate = 0.0;
|
||||
td.scale[0] = td.scale[1] = 0.0;
|
||||
td.shift[0] = td.shift[1] = 0.0;
|
||||
td.contents = 0;
|
||||
td.flags = 0;
|
||||
td.value = 0;
|
||||
|
||||
|
||||
UpdateData(TRUE);
|
||||
|
||||
if (nID == IDC_SPIN_ROTATE)
|
||||
{
|
||||
if (bUp)
|
||||
td.rotate = m_fRotate;
|
||||
else
|
||||
td.rotate = -m_fRotate;
|
||||
}
|
||||
else if (nID == IDC_SPIN_HSCALE)
|
||||
{
|
||||
if (bUp)
|
||||
td.scale[0] = 1 - m_fHScale;
|
||||
else
|
||||
td.scale[0] = 1 + m_fHScale;
|
||||
}
|
||||
else if (nID == IDC_SPIN_VSCALE)
|
||||
{
|
||||
if (bUp)
|
||||
td.scale[1] = 1 - m_fVScale;
|
||||
else
|
||||
td.scale[1] = 1 + m_fVScale;
|
||||
}
|
||||
|
||||
else if (nID == IDC_SPIN_HSHIFT)
|
||||
{
|
||||
if (bUp)
|
||||
td.shift[0] = m_fHShift;
|
||||
else
|
||||
td.shift[0] = -m_fHShift;
|
||||
}
|
||||
else if (nID == IDC_SPIN_VSHIFT)
|
||||
{
|
||||
if (bUp)
|
||||
td.shift[1] = m_fVShift;
|
||||
else
|
||||
td.shift[1] = -m_fVShift;
|
||||
}
|
||||
|
||||
Patch_SetTextureInfo(&td);
|
||||
Sys_UpdateWindows(W_CAMERA);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
162
q3radiant/PatchDialog.h
Normal file → Executable file
162
q3radiant/PatchDialog.h
Normal file → Executable file
|
|
@ -19,84 +19,84 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_PATCHDIALOG_H__DE62DFB4_E9EC_11D2_A509_0020AFEB881A__INCLUDED_)
|
||||
#define AFX_PATCHDIALOG_H__DE62DFB4_E9EC_11D2_A509_0020AFEB881A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// PatchDialog.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDialog dialog
|
||||
|
||||
class CPatchDialog : public CDialog
|
||||
{
|
||||
patchMesh_t *m_Patch;
|
||||
// Construction
|
||||
public:
|
||||
void UpdateInfo();
|
||||
void SetPatchInfo();
|
||||
void GetPatchInfo();
|
||||
CPatchDialog(CWnd* pParent = NULL); // standard constructor
|
||||
void UpdateSpinners(bool bUp, int nID);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPatchDialog)
|
||||
enum { IDD = IDD_DIALOG_PATCH };
|
||||
CSpinButtonCtrl m_wndVShift;
|
||||
CSpinButtonCtrl m_wndVScale;
|
||||
CSpinButtonCtrl m_wndRotate;
|
||||
CSpinButtonCtrl m_wndHShift;
|
||||
CSpinButtonCtrl m_wndHScale;
|
||||
CComboBox m_wndType;
|
||||
CComboBox m_wndRows;
|
||||
CComboBox m_wndCols;
|
||||
CString m_strName;
|
||||
float m_fS;
|
||||
float m_fT;
|
||||
float m_fX;
|
||||
float m_fY;
|
||||
float m_fZ;
|
||||
float m_fHScale;
|
||||
float m_fHShift;
|
||||
float m_fRotate;
|
||||
float m_fVScale;
|
||||
float m_fVShift;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPatchDialog)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
void UpdateRowColInfo();
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPatchDialog)
|
||||
afx_msg void OnBtnPatchdetails();
|
||||
afx_msg void OnBtnPatchfit();
|
||||
afx_msg void OnBtnPatchnatural();
|
||||
afx_msg void OnBtnPatchreset();
|
||||
afx_msg void OnSelchangeComboCol();
|
||||
afx_msg void OnSelchangeComboRow();
|
||||
afx_msg void OnSelchangeComboType();
|
||||
virtual void OnOK();
|
||||
afx_msg void OnDeltaposSpin(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnApply();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PATCHDIALOG_H__DE62DFB4_E9EC_11D2_A509_0020AFEB881A__INCLUDED_)
|
||||
#if !defined(AFX_PATCHDIALOG_H__DE62DFB4_E9EC_11D2_A509_0020AFEB881A__INCLUDED_)
|
||||
#define AFX_PATCHDIALOG_H__DE62DFB4_E9EC_11D2_A509_0020AFEB881A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// PatchDialog.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPatchDialog dialog
|
||||
|
||||
class CPatchDialog : public CDialog
|
||||
{
|
||||
patchMesh_t *m_Patch;
|
||||
// Construction
|
||||
public:
|
||||
void UpdateInfo();
|
||||
void SetPatchInfo();
|
||||
void GetPatchInfo();
|
||||
CPatchDialog(CWnd* pParent = NULL); // standard constructor
|
||||
void UpdateSpinners(bool bUp, int nID);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPatchDialog)
|
||||
enum { IDD = IDD_DIALOG_PATCH };
|
||||
CSpinButtonCtrl m_wndVShift;
|
||||
CSpinButtonCtrl m_wndVScale;
|
||||
CSpinButtonCtrl m_wndRotate;
|
||||
CSpinButtonCtrl m_wndHShift;
|
||||
CSpinButtonCtrl m_wndHScale;
|
||||
CComboBox m_wndType;
|
||||
CComboBox m_wndRows;
|
||||
CComboBox m_wndCols;
|
||||
CString m_strName;
|
||||
float m_fS;
|
||||
float m_fT;
|
||||
float m_fX;
|
||||
float m_fY;
|
||||
float m_fZ;
|
||||
float m_fHScale;
|
||||
float m_fHShift;
|
||||
float m_fRotate;
|
||||
float m_fVScale;
|
||||
float m_fVShift;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPatchDialog)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
void UpdateRowColInfo();
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPatchDialog)
|
||||
afx_msg void OnBtnPatchdetails();
|
||||
afx_msg void OnBtnPatchfit();
|
||||
afx_msg void OnBtnPatchnatural();
|
||||
afx_msg void OnBtnPatchreset();
|
||||
afx_msg void OnSelchangeComboCol();
|
||||
afx_msg void OnSelchangeComboRow();
|
||||
afx_msg void OnSelchangeComboType();
|
||||
virtual void OnOK();
|
||||
afx_msg void OnDeltaposSpin(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnApply();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PATCHDIALOG_H__DE62DFB4_E9EC_11D2_A509_0020AFEB881A__INCLUDED_)
|
||||
|
|
|
|||
552
q3radiant/PlugIn.cpp
Normal file → Executable file
552
q3radiant/PlugIn.cpp
Normal file → Executable file
|
|
@ -19,279 +19,279 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// PlugIn.cpp: implementation of the CPlugIn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "PlugIn.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[]=__FILE__;
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CPlugIn::CPlugIn()
|
||||
{
|
||||
m_hDLL = NULL;
|
||||
m_pQERPlugEntitiesFactory = NULL;
|
||||
}
|
||||
|
||||
CPlugIn::~CPlugIn()
|
||||
{
|
||||
if (m_pQERPlugEntitiesFactory)
|
||||
delete m_pQERPlugEntitiesFactory;
|
||||
if (m_hDLL != NULL)
|
||||
free();
|
||||
}
|
||||
|
||||
bool CPlugIn::load(const char *p)
|
||||
{
|
||||
m_hDLL = ::LoadLibrary(p);
|
||||
if (m_hDLL != NULL)
|
||||
{
|
||||
m_pfnInit = reinterpret_cast<PFN_QERPLUG_INIT>(::GetProcAddress(m_hDLL, QERPLUG_INIT));
|
||||
if (m_pfnInit != NULL)
|
||||
{
|
||||
m_strVersion = (*m_pfnInit)(AfxGetApp()->m_hInstance, g_pParentWnd->GetSafeHwnd());
|
||||
Sys_Printf("Loaded plugin > %s\n", m_strVersion);
|
||||
|
||||
m_pfnGetName = reinterpret_cast<PFN_QERPLUG_GETNAME>(::GetProcAddress(m_hDLL, QERPLUG_GETNAME));
|
||||
if (m_pfnGetName != NULL)
|
||||
{
|
||||
m_strName = (*m_pfnGetName)();
|
||||
}
|
||||
|
||||
m_pfnGetCommandList = reinterpret_cast<PFN_QERPLUG_GETCOMMANDLIST>(::GetProcAddress(m_hDLL, QERPLUG_GETCOMMANDLIST));
|
||||
if (m_pfnGetCommandList)
|
||||
{
|
||||
CString str = (*m_pfnGetCommandList)();
|
||||
char cTemp[1024];
|
||||
strcpy(cTemp, str);
|
||||
char* token = strtok(cTemp, ",;");
|
||||
if (token && *token == ' ')
|
||||
{
|
||||
while (*token == ' ')
|
||||
token++;
|
||||
}
|
||||
while (token != NULL)
|
||||
{
|
||||
m_CommandStrings.Add(token);
|
||||
token = strtok(NULL, ",;");
|
||||
}
|
||||
}
|
||||
|
||||
m_pfnDispatch = reinterpret_cast<PFN_QERPLUG_DISPATCH>(::GetProcAddress(m_hDLL, QERPLUG_DISPATCH));
|
||||
m_pfnGetFuncTable = reinterpret_cast<PFN_QERPLUG_GETFUNCTABLE>(::GetProcAddress(m_hDLL, QERPLUG_GETFUNCTABLE));
|
||||
|
||||
m_pfnGetTextureInfo = reinterpret_cast<PFN_QERPLUG_GETTEXTUREINFO>(::GetProcAddress(m_hDLL, QERPLUG_GETTEXTUREINFO));
|
||||
m_pfnLoadTexture = reinterpret_cast<PFN_QERPLUG_LOADTEXTURE>(::GetProcAddress(m_hDLL, QERPLUG_LOADTEXTURE));
|
||||
|
||||
m_pfnGetSurfaceFlags = reinterpret_cast<PFN_QERPLUG_GETSURFACEFLAGS>(::GetProcAddress(m_hDLL, QERPLUG_GETSURFACEFLAGS));
|
||||
|
||||
m_pfnRegisterPluginEntities = reinterpret_cast<PFN_QERPLUG_REGISTERPLUGINENTITIES>(::GetProcAddress(m_hDLL, QERPLUG_REGISTERPLUGINENTITIES));
|
||||
|
||||
m_pfnInitSurfaceProperties = reinterpret_cast<PFN_QERPLUG_INITSURFACEPROPERTIES>(::GetProcAddress(m_hDLL, QERPLUG_INITSURFACEPROPERTIES));
|
||||
|
||||
m_pfnRequestInterface = reinterpret_cast<PFN_QERPLUG_REQUESTINTERFACE>(::GetProcAddress(m_hDLL, QERPLUG_REQUESTINTERFACE));
|
||||
|
||||
return (m_pfnDispatch != NULL && m_pfnGetFuncTable != NULL);
|
||||
//--return true;
|
||||
}
|
||||
Sys_Printf("FAILED to Load plugin > %s\n", p);
|
||||
}
|
||||
LPVOID lpMsgBuf;
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0,
|
||||
NULL
|
||||
);
|
||||
Sys_Printf("LoadLibrary failed on %s: GetLastError: %s\n", p, lpMsgBuf );
|
||||
// Free the buffer.
|
||||
LocalFree( lpMsgBuf );
|
||||
free();
|
||||
return false;
|
||||
}
|
||||
|
||||
_QERTextureInfo* CPlugIn::getTextureInfo()
|
||||
{
|
||||
if (m_pfnGetTextureInfo != NULL)
|
||||
{
|
||||
return reinterpret_cast<_QERTextureInfo*>((*m_pfnGetTextureInfo)());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CPlugIn::loadTexture(LPCSTR pFilename)
|
||||
{
|
||||
if (m_pfnLoadTexture != NULL)
|
||||
{
|
||||
(*m_pfnLoadTexture)(pFilename);
|
||||
}
|
||||
}
|
||||
|
||||
LPVOID CPlugIn::getSurfaceFlags()
|
||||
{
|
||||
if (m_pfnGetSurfaceFlags != NULL)
|
||||
{
|
||||
return reinterpret_cast<LPVOID>((*m_pfnGetSurfaceFlags)());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CPlugIn::free()
|
||||
{
|
||||
if (m_hDLL != NULL)
|
||||
::FreeLibrary(m_hDLL);
|
||||
m_hDLL = NULL;
|
||||
}
|
||||
|
||||
const char* CPlugIn::getVersionStr()
|
||||
{
|
||||
return m_pfnGetName();
|
||||
}
|
||||
|
||||
const char* CPlugIn::getMenuName()
|
||||
{
|
||||
return m_strName;
|
||||
}
|
||||
|
||||
int CPlugIn::getCommandCount()
|
||||
{
|
||||
return m_CommandStrings.GetSize();
|
||||
}
|
||||
|
||||
const char* CPlugIn::getCommand(int n)
|
||||
{
|
||||
return m_CommandStrings.GetAt(n);
|
||||
}
|
||||
|
||||
void CPlugIn::dispatchCommand(const char* p, vec3_t vMin, vec3_t vMax, BOOL bSingleBrush)
|
||||
{
|
||||
if (m_pfnDispatch)
|
||||
{
|
||||
(*m_pfnDispatch)(p, vMin, vMax, bSingleBrush);
|
||||
}
|
||||
}
|
||||
|
||||
void CPlugIn::addMenuID(int n)
|
||||
{
|
||||
m_CommandIDs.Add(n);
|
||||
}
|
||||
|
||||
bool CPlugIn::ownsCommandID(int n)
|
||||
{
|
||||
for (int i = 0; i < m_CommandIDs.GetSize(); i++)
|
||||
{
|
||||
if (m_CommandIDs.GetAt(i) == n)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void* CPlugIn::getFuncTable()
|
||||
{
|
||||
if (m_pfnGetFuncTable)
|
||||
{
|
||||
return (*m_pfnGetFuncTable)();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CPlugIn::RegisterPluginEntities()
|
||||
{
|
||||
// if we found the QERPlug_RegisterPluginEntities export, it means this plugin provides his own entities
|
||||
if (m_pfnRegisterPluginEntities)
|
||||
{
|
||||
// resquest a _QERPlugEntitiesFactory
|
||||
if (m_pfnRequestInterface)
|
||||
{
|
||||
m_pQERPlugEntitiesFactory = new _QERPlugEntitiesFactory;
|
||||
m_pQERPlugEntitiesFactory->m_nSize = sizeof(_QERPlugEntitiesFactory);
|
||||
if (m_pfnRequestInterface( QERPlugEntitiesFactory_GUID, m_pQERPlugEntitiesFactory ))
|
||||
{
|
||||
// create an IEpair interface for the project settings
|
||||
CEpairsWrapper *pProjectEp = new CEpairsWrapper( g_qeglobals.d_project_entity );
|
||||
m_pfnRegisterPluginEntities( pProjectEp );
|
||||
}
|
||||
else
|
||||
Sys_Printf( "WARNING: failed to request QERPlugEntitiesFactory from plugin %s\n", m_strName.GetBuffer(0) );
|
||||
}
|
||||
else
|
||||
Sys_Printf( "WARNING: QERPlug_RequestInterface not found in %s\n", m_strName.GetBuffer(0) );
|
||||
}
|
||||
}
|
||||
|
||||
void CPlugIn::InitBSPFrontendPlugin()
|
||||
{
|
||||
if (m_pfnRequestInterface)
|
||||
{
|
||||
// request a _QERPlugBSPFrontendTable
|
||||
g_BSPFrontendTable.m_nSize = sizeof( _QERPlugBSPFrontendTable );
|
||||
if ( m_pfnRequestInterface( QERPlugBSPFrontendTable_GUID, &g_BSPFrontendTable ) )
|
||||
{
|
||||
g_qeglobals.bBSPFrontendPlugin = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPlugIn::InitSurfacePlugin()
|
||||
{
|
||||
// if we found the QERPlug_InitSurfaceProperties export, it means this plugin does surface properties
|
||||
if (m_pfnInitSurfaceProperties)
|
||||
{
|
||||
if (g_qeglobals.bSurfacePropertiesPlugin)
|
||||
{
|
||||
Sys_Printf( "WARNING: conflict for surface properties plugins. %s ignored.\n", m_strName );
|
||||
return;
|
||||
}
|
||||
if (m_pfnRequestInterface)
|
||||
{
|
||||
// call the plugin surface properties init
|
||||
m_pfnInitSurfaceProperties();
|
||||
// request filling of the global _QERPlugSurfaceTable
|
||||
g_SurfaceTable.m_nSize = sizeof( g_SurfaceTable );
|
||||
if ( m_pfnRequestInterface( QERPlugSurfaceTable_GUID, &g_SurfaceTable ) )
|
||||
{
|
||||
// update the global so we know we have a surface properties plugin
|
||||
g_qeglobals.bSurfacePropertiesPlugin = true;
|
||||
}
|
||||
else
|
||||
Sys_Printf( "WARNING: _QERPlugSurfaceTable interface request failed for surface plugin\n" );
|
||||
}
|
||||
else
|
||||
Sys_Printf("WARNING: QERPlug_RequestInterface export not found in surface properties plugin.\n");
|
||||
}
|
||||
}
|
||||
|
||||
// create a plugin entity
|
||||
// e is the entity being created
|
||||
// e->eclass is the plugin eclass info
|
||||
// e->epairs will be accessed by the plugin entity through a IEpair interface
|
||||
IPluginEntity * CPlugIn::CreatePluginEntity(entity_t *e)
|
||||
{
|
||||
if (m_pQERPlugEntitiesFactory)
|
||||
{
|
||||
// create an IEpair interface for e->epairs
|
||||
CEpairsWrapper *pEp = new CEpairsWrapper( e );
|
||||
IPluginEntity *pEnt = m_pQERPlugEntitiesFactory->m_pfnCreateEntity( e->eclass, pEp );
|
||||
if ( pEnt )
|
||||
return pEnt;
|
||||
delete pEp;
|
||||
return NULL;
|
||||
}
|
||||
Sys_Printf("WARNING: unexpected m_pQERPlugEntitiesFactory is NULL in CPlugin::CreatePluginEntity\n");
|
||||
return NULL;
|
||||
}
|
||||
// PlugIn.cpp: implementation of the CPlugIn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Radiant.h"
|
||||
#include "PlugIn.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[]=__FILE__;
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CPlugIn::CPlugIn()
|
||||
{
|
||||
m_hDLL = NULL;
|
||||
m_pQERPlugEntitiesFactory = NULL;
|
||||
}
|
||||
|
||||
CPlugIn::~CPlugIn()
|
||||
{
|
||||
if (m_pQERPlugEntitiesFactory)
|
||||
delete m_pQERPlugEntitiesFactory;
|
||||
if (m_hDLL != NULL)
|
||||
free();
|
||||
}
|
||||
|
||||
bool CPlugIn::load(const char *p)
|
||||
{
|
||||
m_hDLL = ::LoadLibrary(p);
|
||||
if (m_hDLL != NULL)
|
||||
{
|
||||
m_pfnInit = reinterpret_cast<PFN_QERPLUG_INIT>(::GetProcAddress(m_hDLL, QERPLUG_INIT));
|
||||
if (m_pfnInit != NULL)
|
||||
{
|
||||
m_strVersion = (*m_pfnInit)(AfxGetApp()->m_hInstance, g_pParentWnd->GetSafeHwnd());
|
||||
Sys_Printf("Loaded plugin > %s\n", m_strVersion);
|
||||
|
||||
m_pfnGetName = reinterpret_cast<PFN_QERPLUG_GETNAME>(::GetProcAddress(m_hDLL, QERPLUG_GETNAME));
|
||||
if (m_pfnGetName != NULL)
|
||||
{
|
||||
m_strName = (*m_pfnGetName)();
|
||||
}
|
||||
|
||||
m_pfnGetCommandList = reinterpret_cast<PFN_QERPLUG_GETCOMMANDLIST>(::GetProcAddress(m_hDLL, QERPLUG_GETCOMMANDLIST));
|
||||
if (m_pfnGetCommandList)
|
||||
{
|
||||
CString str = (*m_pfnGetCommandList)();
|
||||
char cTemp[1024];
|
||||
strcpy(cTemp, str);
|
||||
char* token = strtok(cTemp, ",;");
|
||||
if (token && *token == ' ')
|
||||
{
|
||||
while (*token == ' ')
|
||||
token++;
|
||||
}
|
||||
while (token != NULL)
|
||||
{
|
||||
m_CommandStrings.Add(token);
|
||||
token = strtok(NULL, ",;");
|
||||
}
|
||||
}
|
||||
|
||||
m_pfnDispatch = reinterpret_cast<PFN_QERPLUG_DISPATCH>(::GetProcAddress(m_hDLL, QERPLUG_DISPATCH));
|
||||
m_pfnGetFuncTable = reinterpret_cast<PFN_QERPLUG_GETFUNCTABLE>(::GetProcAddress(m_hDLL, QERPLUG_GETFUNCTABLE));
|
||||
|
||||
m_pfnGetTextureInfo = reinterpret_cast<PFN_QERPLUG_GETTEXTUREINFO>(::GetProcAddress(m_hDLL, QERPLUG_GETTEXTUREINFO));
|
||||
m_pfnLoadTexture = reinterpret_cast<PFN_QERPLUG_LOADTEXTURE>(::GetProcAddress(m_hDLL, QERPLUG_LOADTEXTURE));
|
||||
|
||||
m_pfnGetSurfaceFlags = reinterpret_cast<PFN_QERPLUG_GETSURFACEFLAGS>(::GetProcAddress(m_hDLL, QERPLUG_GETSURFACEFLAGS));
|
||||
|
||||
m_pfnRegisterPluginEntities = reinterpret_cast<PFN_QERPLUG_REGISTERPLUGINENTITIES>(::GetProcAddress(m_hDLL, QERPLUG_REGISTERPLUGINENTITIES));
|
||||
|
||||
m_pfnInitSurfaceProperties = reinterpret_cast<PFN_QERPLUG_INITSURFACEPROPERTIES>(::GetProcAddress(m_hDLL, QERPLUG_INITSURFACEPROPERTIES));
|
||||
|
||||
m_pfnRequestInterface = reinterpret_cast<PFN_QERPLUG_REQUESTINTERFACE>(::GetProcAddress(m_hDLL, QERPLUG_REQUESTINTERFACE));
|
||||
|
||||
return (m_pfnDispatch != NULL && m_pfnGetFuncTable != NULL);
|
||||
//--return true;
|
||||
}
|
||||
Sys_Printf("FAILED to Load plugin > %s\n", p);
|
||||
}
|
||||
LPVOID lpMsgBuf;
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0,
|
||||
NULL
|
||||
);
|
||||
Sys_Printf("LoadLibrary failed on %s: GetLastError: %s\n", p, lpMsgBuf );
|
||||
// Free the buffer.
|
||||
LocalFree( lpMsgBuf );
|
||||
free();
|
||||
return false;
|
||||
}
|
||||
|
||||
_QERTextureInfo* CPlugIn::getTextureInfo()
|
||||
{
|
||||
if (m_pfnGetTextureInfo != NULL)
|
||||
{
|
||||
return reinterpret_cast<_QERTextureInfo*>((*m_pfnGetTextureInfo)());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CPlugIn::loadTexture(LPCSTR pFilename)
|
||||
{
|
||||
if (m_pfnLoadTexture != NULL)
|
||||
{
|
||||
(*m_pfnLoadTexture)(pFilename);
|
||||
}
|
||||
}
|
||||
|
||||
LPVOID CPlugIn::getSurfaceFlags()
|
||||
{
|
||||
if (m_pfnGetSurfaceFlags != NULL)
|
||||
{
|
||||
return reinterpret_cast<LPVOID>((*m_pfnGetSurfaceFlags)());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CPlugIn::free()
|
||||
{
|
||||
if (m_hDLL != NULL)
|
||||
::FreeLibrary(m_hDLL);
|
||||
m_hDLL = NULL;
|
||||
}
|
||||
|
||||
const char* CPlugIn::getVersionStr()
|
||||
{
|
||||
return m_pfnGetName();
|
||||
}
|
||||
|
||||
const char* CPlugIn::getMenuName()
|
||||
{
|
||||
return m_strName;
|
||||
}
|
||||
|
||||
int CPlugIn::getCommandCount()
|
||||
{
|
||||
return m_CommandStrings.GetSize();
|
||||
}
|
||||
|
||||
const char* CPlugIn::getCommand(int n)
|
||||
{
|
||||
return m_CommandStrings.GetAt(n);
|
||||
}
|
||||
|
||||
void CPlugIn::dispatchCommand(const char* p, vec3_t vMin, vec3_t vMax, BOOL bSingleBrush)
|
||||
{
|
||||
if (m_pfnDispatch)
|
||||
{
|
||||
(*m_pfnDispatch)(p, vMin, vMax, bSingleBrush);
|
||||
}
|
||||
}
|
||||
|
||||
void CPlugIn::addMenuID(int n)
|
||||
{
|
||||
m_CommandIDs.Add(n);
|
||||
}
|
||||
|
||||
bool CPlugIn::ownsCommandID(int n)
|
||||
{
|
||||
for (int i = 0; i < m_CommandIDs.GetSize(); i++)
|
||||
{
|
||||
if (m_CommandIDs.GetAt(i) == n)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void* CPlugIn::getFuncTable()
|
||||
{
|
||||
if (m_pfnGetFuncTable)
|
||||
{
|
||||
return (*m_pfnGetFuncTable)();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CPlugIn::RegisterPluginEntities()
|
||||
{
|
||||
// if we found the QERPlug_RegisterPluginEntities export, it means this plugin provides his own entities
|
||||
if (m_pfnRegisterPluginEntities)
|
||||
{
|
||||
// resquest a _QERPlugEntitiesFactory
|
||||
if (m_pfnRequestInterface)
|
||||
{
|
||||
m_pQERPlugEntitiesFactory = new _QERPlugEntitiesFactory;
|
||||
m_pQERPlugEntitiesFactory->m_nSize = sizeof(_QERPlugEntitiesFactory);
|
||||
if (m_pfnRequestInterface( QERPlugEntitiesFactory_GUID, m_pQERPlugEntitiesFactory ))
|
||||
{
|
||||
// create an IEpair interface for the project settings
|
||||
CEpairsWrapper *pProjectEp = new CEpairsWrapper( g_qeglobals.d_project_entity );
|
||||
m_pfnRegisterPluginEntities( pProjectEp );
|
||||
}
|
||||
else
|
||||
Sys_Printf( "WARNING: failed to request QERPlugEntitiesFactory from plugin %s\n", m_strName.GetBuffer(0) );
|
||||
}
|
||||
else
|
||||
Sys_Printf( "WARNING: QERPlug_RequestInterface not found in %s\n", m_strName.GetBuffer(0) );
|
||||
}
|
||||
}
|
||||
|
||||
void CPlugIn::InitBSPFrontendPlugin()
|
||||
{
|
||||
if (m_pfnRequestInterface)
|
||||
{
|
||||
// request a _QERPlugBSPFrontendTable
|
||||
g_BSPFrontendTable.m_nSize = sizeof( _QERPlugBSPFrontendTable );
|
||||
if ( m_pfnRequestInterface( QERPlugBSPFrontendTable_GUID, &g_BSPFrontendTable ) )
|
||||
{
|
||||
g_qeglobals.bBSPFrontendPlugin = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPlugIn::InitSurfacePlugin()
|
||||
{
|
||||
// if we found the QERPlug_InitSurfaceProperties export, it means this plugin does surface properties
|
||||
if (m_pfnInitSurfaceProperties)
|
||||
{
|
||||
if (g_qeglobals.bSurfacePropertiesPlugin)
|
||||
{
|
||||
Sys_Printf( "WARNING: conflict for surface properties plugins. %s ignored.\n", m_strName );
|
||||
return;
|
||||
}
|
||||
if (m_pfnRequestInterface)
|
||||
{
|
||||
// call the plugin surface properties init
|
||||
m_pfnInitSurfaceProperties();
|
||||
// request filling of the global _QERPlugSurfaceTable
|
||||
g_SurfaceTable.m_nSize = sizeof( g_SurfaceTable );
|
||||
if ( m_pfnRequestInterface( QERPlugSurfaceTable_GUID, &g_SurfaceTable ) )
|
||||
{
|
||||
// update the global so we know we have a surface properties plugin
|
||||
g_qeglobals.bSurfacePropertiesPlugin = true;
|
||||
}
|
||||
else
|
||||
Sys_Printf( "WARNING: _QERPlugSurfaceTable interface request failed for surface plugin\n" );
|
||||
}
|
||||
else
|
||||
Sys_Printf("WARNING: QERPlug_RequestInterface export not found in surface properties plugin.\n");
|
||||
}
|
||||
}
|
||||
|
||||
// create a plugin entity
|
||||
// e is the entity being created
|
||||
// e->eclass is the plugin eclass info
|
||||
// e->epairs will be accessed by the plugin entity through a IEpair interface
|
||||
IPluginEntity * CPlugIn::CreatePluginEntity(entity_t *e)
|
||||
{
|
||||
if (m_pQERPlugEntitiesFactory)
|
||||
{
|
||||
// create an IEpair interface for e->epairs
|
||||
CEpairsWrapper *pEp = new CEpairsWrapper( e );
|
||||
IPluginEntity *pEnt = m_pQERPlugEntitiesFactory->m_pfnCreateEntity( e->eclass, pEp );
|
||||
if ( pEnt )
|
||||
return pEnt;
|
||||
delete pEp;
|
||||
return NULL;
|
||||
}
|
||||
Sys_Printf("WARNING: unexpected m_pQERPlugEntitiesFactory is NULL in CPlugin::CreatePluginEntity\n");
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
122
q3radiant/PlugIn.h
Normal file → Executable file
122
q3radiant/PlugIn.h
Normal file → Executable file
|
|
@ -19,64 +19,64 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// PlugIn.h: interface for the CPlugIn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CPlugIn : public CObject
|
||||
{
|
||||
private:
|
||||
HMODULE m_hDLL;
|
||||
PFN_QERPLUG_INIT m_pfnInit;
|
||||
PFN_QERPLUG_GETNAME m_pfnGetName;
|
||||
PFN_QERPLUG_GETCOMMANDLIST m_pfnGetCommandList;
|
||||
PFN_QERPLUG_DISPATCH m_pfnDispatch;
|
||||
PFN_QERPLUG_GETFUNCTABLE m_pfnGetFuncTable;
|
||||
PFN_QERPLUG_GETTEXTUREINFO m_pfnGetTextureInfo;
|
||||
PFN_QERPLUG_LOADTEXTURE m_pfnLoadTexture;
|
||||
PFN_QERPLUG_GETSURFACEFLAGS m_pfnGetSurfaceFlags;
|
||||
PFN_QERPLUG_REGISTERPLUGINENTITIES m_pfnRegisterPluginEntities;
|
||||
PFN_QERPLUG_INITSURFACEPROPERTIES m_pfnInitSurfaceProperties;
|
||||
PFN_QERPLUG_REQUESTINTERFACE m_pfnRequestInterface;
|
||||
CWordArray m_CommandIDs;
|
||||
CStringArray m_CommandStrings;
|
||||
CString m_strName;
|
||||
CString m_strVersion;
|
||||
|
||||
// for plugins that provide plugin entities
|
||||
_QERPlugEntitiesFactory* m_pQERPlugEntitiesFactory;
|
||||
|
||||
public:
|
||||
void InitBSPFrontendPlugin();
|
||||
IPluginEntity * CreatePluginEntity( entity_t * );
|
||||
HMODULE GetDLLModule() { return m_hDLL; }
|
||||
void InitSurfacePlugin();
|
||||
void RegisterPluginEntities();
|
||||
void* getFuncTable();
|
||||
bool ownsCommandID(int n);
|
||||
void addMenuID(int n);
|
||||
CPlugIn();
|
||||
virtual ~CPlugIn();
|
||||
bool load(const char *p);
|
||||
void free();
|
||||
const char* getVersionStr();
|
||||
const char* getMenuName();
|
||||
int getCommandCount();
|
||||
const char* getCommand(int n);
|
||||
void dispatchCommand(const char* p, vec3_t vMin, vec3_t vMax, BOOL bSingleBrush);
|
||||
|
||||
_QERTextureInfo *getTextureInfo();
|
||||
void loadTexture(LPCSTR pFilename);
|
||||
|
||||
LPVOID getSurfaceFlags();
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_)
|
||||
// PlugIn.h: interface for the CPlugIn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CPlugIn : public CObject
|
||||
{
|
||||
private:
|
||||
HMODULE m_hDLL;
|
||||
PFN_QERPLUG_INIT m_pfnInit;
|
||||
PFN_QERPLUG_GETNAME m_pfnGetName;
|
||||
PFN_QERPLUG_GETCOMMANDLIST m_pfnGetCommandList;
|
||||
PFN_QERPLUG_DISPATCH m_pfnDispatch;
|
||||
PFN_QERPLUG_GETFUNCTABLE m_pfnGetFuncTable;
|
||||
PFN_QERPLUG_GETTEXTUREINFO m_pfnGetTextureInfo;
|
||||
PFN_QERPLUG_LOADTEXTURE m_pfnLoadTexture;
|
||||
PFN_QERPLUG_GETSURFACEFLAGS m_pfnGetSurfaceFlags;
|
||||
PFN_QERPLUG_REGISTERPLUGINENTITIES m_pfnRegisterPluginEntities;
|
||||
PFN_QERPLUG_INITSURFACEPROPERTIES m_pfnInitSurfaceProperties;
|
||||
PFN_QERPLUG_REQUESTINTERFACE m_pfnRequestInterface;
|
||||
CWordArray m_CommandIDs;
|
||||
CStringArray m_CommandStrings;
|
||||
CString m_strName;
|
||||
CString m_strVersion;
|
||||
|
||||
// for plugins that provide plugin entities
|
||||
_QERPlugEntitiesFactory* m_pQERPlugEntitiesFactory;
|
||||
|
||||
public:
|
||||
void InitBSPFrontendPlugin();
|
||||
IPluginEntity * CreatePluginEntity( entity_t * );
|
||||
HMODULE GetDLLModule() { return m_hDLL; }
|
||||
void InitSurfacePlugin();
|
||||
void RegisterPluginEntities();
|
||||
void* getFuncTable();
|
||||
bool ownsCommandID(int n);
|
||||
void addMenuID(int n);
|
||||
CPlugIn();
|
||||
virtual ~CPlugIn();
|
||||
bool load(const char *p);
|
||||
void free();
|
||||
const char* getVersionStr();
|
||||
const char* getMenuName();
|
||||
int getCommandCount();
|
||||
const char* getCommand(int n);
|
||||
void dispatchCommand(const char* p, vec3_t vMin, vec3_t vMax, BOOL bSingleBrush);
|
||||
|
||||
_QERTextureInfo *getTextureInfo();
|
||||
void loadTexture(LPCSTR pFilename);
|
||||
|
||||
LPVOID getSurfaceFlags();
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
3288
q3radiant/PlugInManager.cpp
Normal file → Executable file
3288
q3radiant/PlugInManager.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load diff
158
q3radiant/PlugInManager.h
Normal file → Executable file
158
q3radiant/PlugInManager.h
Normal file → Executable file
|
|
@ -19,82 +19,82 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// PlugInManager.h: interface for the CPlugInManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
class CPlugInManager
|
||||
{
|
||||
private:
|
||||
CObArray m_PlugIns;
|
||||
CPtrArray m_BrushHandles;
|
||||
CPtrArray m_SelectedBrushHandles;
|
||||
CPtrArray m_ActiveBrushHandles;
|
||||
|
||||
CPlugIn *m_pTexturePlug;
|
||||
CPlugIn *m_pSurfaceListPlug;
|
||||
|
||||
// v1.70
|
||||
// brushes of the current entity ( see m_SelectedBrushHandles and m_ActiveBrushHandles )
|
||||
CPtrArray m_EntityBrushHandles;
|
||||
// allocated entities, not commited yet ( see m_BrushHandles )
|
||||
CPtrArray m_EntityHandles;
|
||||
|
||||
// tells in which array to look when given a patch index
|
||||
enum EPatchesMode { EActivePatches, ESelectedPatches, EAllocatedPatches } PatchesMode;
|
||||
// patches handles (brush_t*)
|
||||
CPtrArray m_PatchesHandles;
|
||||
// plugin-allocated patches, not commited yet (patchMesh_t*)
|
||||
CPtrArray m_PluginPatches;
|
||||
|
||||
public:
|
||||
CPlugIn * PluginForModule( HMODULE hPlug );
|
||||
CPtrArray& GetActiveHandles() {return m_ActiveBrushHandles; };
|
||||
CPtrArray& GetSelectedHandles() {return m_SelectedBrushHandles; };
|
||||
CPtrArray& GetPluginPatches() {return m_PluginPatches; };
|
||||
brush_t* FindBrushHandle(void *vp);
|
||||
patchMesh_t* FindPatchHandle(int index);
|
||||
int CreatePatchHandle();
|
||||
int AllocateActivePatchHandles();
|
||||
int AllocateSelectedPatchHandles();
|
||||
void CommitPatchHandleToMap(int index, patchMesh_t *pMesh, char *texName);
|
||||
void ReleasePatchesHandles() { m_PatchesHandles.RemoveAll(); m_PluginPatches.RemoveAll(); }
|
||||
void AddFaceToBrushHandle(void *vp, vec3_t v1, vec3_t v2, vec3_t v3);
|
||||
void CommitBrushHandleToMap(void *vp);
|
||||
void DeleteBrushHandle(LPVOID vp);
|
||||
LPVOID CreateBrushHandle();
|
||||
void Dispatch(int n, const char *p);
|
||||
void Cleanup();
|
||||
void Init(const char* pPath);
|
||||
CPlugInManager();
|
||||
virtual ~CPlugInManager();
|
||||
|
||||
// the texture manager front ends the single load
|
||||
// addins (texture, model, map formats.. etc.)
|
||||
_QERTextureInfo* GetTextureInfo();
|
||||
void LoadTexture(const char *pFilename);
|
||||
|
||||
LPVOID GetSurfaceFlags();
|
||||
|
||||
// v1.70
|
||||
CPtrArray& GetEntityBrushHandles() {return m_EntityBrushHandles; };
|
||||
CPtrArray& GetEntityHandles() {return m_EntityHandles; };
|
||||
// the vpBrush needs to be in m_BrushHandles
|
||||
void CommitBrushHandleToEntity( LPVOID vpBrush, LPVOID vpEntity );
|
||||
// the vpEntity needs to be in m_EntityHandles
|
||||
void CommitEntityHandleToMap( LPVOID vpEntity );
|
||||
|
||||
protected:
|
||||
int FillFuncTable(CPlugIn *pPlug); // PGM
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
// PlugInManager.h: interface for the CPlugInManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
class CPlugInManager
|
||||
{
|
||||
private:
|
||||
CObArray m_PlugIns;
|
||||
CPtrArray m_BrushHandles;
|
||||
CPtrArray m_SelectedBrushHandles;
|
||||
CPtrArray m_ActiveBrushHandles;
|
||||
|
||||
CPlugIn *m_pTexturePlug;
|
||||
CPlugIn *m_pSurfaceListPlug;
|
||||
|
||||
// v1.70
|
||||
// brushes of the current entity ( see m_SelectedBrushHandles and m_ActiveBrushHandles )
|
||||
CPtrArray m_EntityBrushHandles;
|
||||
// allocated entities, not commited yet ( see m_BrushHandles )
|
||||
CPtrArray m_EntityHandles;
|
||||
|
||||
// tells in which array to look when given a patch index
|
||||
enum EPatchesMode { EActivePatches, ESelectedPatches, EAllocatedPatches } PatchesMode;
|
||||
// patches handles (brush_t*)
|
||||
CPtrArray m_PatchesHandles;
|
||||
// plugin-allocated patches, not commited yet (patchMesh_t*)
|
||||
CPtrArray m_PluginPatches;
|
||||
|
||||
public:
|
||||
CPlugIn * PluginForModule( HMODULE hPlug );
|
||||
CPtrArray& GetActiveHandles() {return m_ActiveBrushHandles; };
|
||||
CPtrArray& GetSelectedHandles() {return m_SelectedBrushHandles; };
|
||||
CPtrArray& GetPluginPatches() {return m_PluginPatches; };
|
||||
brush_t* FindBrushHandle(void *vp);
|
||||
patchMesh_t* FindPatchHandle(int index);
|
||||
int CreatePatchHandle();
|
||||
int AllocateActivePatchHandles();
|
||||
int AllocateSelectedPatchHandles();
|
||||
void CommitPatchHandleToMap(int index, patchMesh_t *pMesh, char *texName);
|
||||
void ReleasePatchesHandles() { m_PatchesHandles.RemoveAll(); m_PluginPatches.RemoveAll(); }
|
||||
void AddFaceToBrushHandle(void *vp, vec3_t v1, vec3_t v2, vec3_t v3);
|
||||
void CommitBrushHandleToMap(void *vp);
|
||||
void DeleteBrushHandle(LPVOID vp);
|
||||
LPVOID CreateBrushHandle();
|
||||
void Dispatch(int n, const char *p);
|
||||
void Cleanup();
|
||||
void Init(const char* pPath);
|
||||
CPlugInManager();
|
||||
virtual ~CPlugInManager();
|
||||
|
||||
// the texture manager front ends the single load
|
||||
// addins (texture, model, map formats.. etc.)
|
||||
_QERTextureInfo* GetTextureInfo();
|
||||
void LoadTexture(const char *pFilename);
|
||||
|
||||
LPVOID GetSurfaceFlags();
|
||||
|
||||
// v1.70
|
||||
CPtrArray& GetEntityBrushHandles() {return m_EntityBrushHandles; };
|
||||
CPtrArray& GetEntityHandles() {return m_EntityHandles; };
|
||||
// the vpBrush needs to be in m_BrushHandles
|
||||
void CommitBrushHandleToEntity( LPVOID vpBrush, LPVOID vpEntity );
|
||||
// the vpEntity needs to be in m_EntityHandles
|
||||
void CommitEntityHandleToMap( LPVOID vpEntity );
|
||||
|
||||
protected:
|
||||
int FillFuncTable(CPlugIn *pPlug); // PGM
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
160
q3radiant/PluginEntities.cpp
Normal file → Executable file
160
q3radiant/PluginEntities.cpp
Normal file → Executable file
|
|
@ -19,83 +19,83 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:34 $
|
||||
// $Log: PluginEntities.cpp,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:34 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:11 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:38 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
|
||||
// Q3Radiant public version
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:46 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:38:01 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// implementation of IPluginEntities specific interface
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "io.h"
|
||||
|
||||
// is Eclass_InitForModelDirectory
|
||||
int WINAPI QERApp_EClassScanDir( char *path, HMODULE hPlug )
|
||||
{
|
||||
struct _finddata_t fileinfo;
|
||||
int handle;
|
||||
char temp[ _MAX_PATH ];
|
||||
char filebase[ _MAX_PATH ];
|
||||
char filename[ _MAX_PATH ];
|
||||
char *s;
|
||||
eclass_t *e;
|
||||
QE_ConvertDOSToUnixName( temp, path );
|
||||
strcpy (filebase, path);
|
||||
s = filebase + strlen(filebase)-1;
|
||||
while (*s != '\\' && *s != '/' && s!=filebase)
|
||||
s--;
|
||||
*s = 0;
|
||||
handle = _findfirst (path, &fileinfo);
|
||||
if (handle != -1)
|
||||
{
|
||||
do
|
||||
{
|
||||
sprintf (filename, "%s\\%s", filebase, fileinfo.name);
|
||||
Eclass_ScanFile (filename);
|
||||
|
||||
if (eclass_found)
|
||||
{
|
||||
e = eclass_e;
|
||||
e->modelpath = strdup( fileinfo.name );
|
||||
e->nShowFlags |= ECLASS_PLUGINENTITY;
|
||||
e->hPlug = hPlug;
|
||||
}
|
||||
} while (_findnext( handle, &fileinfo ) != -1);
|
||||
|
||||
_findclose (handle);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $LogFile$
|
||||
// $Revision: 1.1.1.4 $
|
||||
// $Author: ttimo $
|
||||
// $Date: 2000/01/18 00:17:34 $
|
||||
// $Log: PluginEntities.cpp,v $
|
||||
// Revision 1.1.1.4 2000/01/18 00:17:34 ttimo
|
||||
// merging in for RC
|
||||
//
|
||||
// Revision 1.3 2000/01/17 23:53:42 TBesset
|
||||
// ready for merge in sourceforge (RC candidate)
|
||||
//
|
||||
// Revision 1.2 2000/01/07 16:40:11 TBesset
|
||||
// merged from BSP frontend
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.1.1.1.2.1 1999/12/29 21:39:38 TBesset
|
||||
// updated to update3 from Robert
|
||||
//
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
|
||||
// Q3Radiant public version
|
||||
// Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
|
||||
// Q3Radiant public version
|
||||
//
|
||||
// Revision 1.2 1999/11/22 17:46:46 Timo & Christine
|
||||
// merged EARadiant into the main tree
|
||||
// bug fixes for Q3Plugin / EAPlugin
|
||||
// export for Robert
|
||||
//
|
||||
// Revision 1.1.2.1 1999/11/03 20:38:01 Timo & Christine
|
||||
// MEAN plugin for Q3Radiant, alpha version
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// implementation of IPluginEntities specific interface
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "io.h"
|
||||
|
||||
// is Eclass_InitForModelDirectory
|
||||
int WINAPI QERApp_EClassScanDir( char *path, HMODULE hPlug )
|
||||
{
|
||||
struct _finddata_t fileinfo;
|
||||
int handle;
|
||||
char temp[ _MAX_PATH ];
|
||||
char filebase[ _MAX_PATH ];
|
||||
char filename[ _MAX_PATH ];
|
||||
char *s;
|
||||
eclass_t *e;
|
||||
QE_ConvertDOSToUnixName( temp, path );
|
||||
strcpy (filebase, path);
|
||||
s = filebase + strlen(filebase)-1;
|
||||
while (*s != '\\' && *s != '/' && s!=filebase)
|
||||
s--;
|
||||
*s = 0;
|
||||
handle = _findfirst (path, &fileinfo);
|
||||
if (handle != -1)
|
||||
{
|
||||
do
|
||||
{
|
||||
sprintf (filename, "%s\\%s", filebase, fileinfo.name);
|
||||
Eclass_ScanFile (filename);
|
||||
|
||||
if (eclass_found)
|
||||
{
|
||||
e = eclass_e;
|
||||
e->modelpath = strdup( fileinfo.name );
|
||||
e->nShowFlags |= ECLASS_PLUGINENTITY;
|
||||
e->hPlug = hPlug;
|
||||
}
|
||||
} while (_findnext( handle, &fileinfo ) != -1);
|
||||
|
||||
_findclose (handle);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
1114
q3radiant/PrefsDlg.cpp
Normal file → Executable file
1114
q3radiant/PrefsDlg.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load diff
280
q3radiant/PrefsDlg.h
Normal file → Executable file
280
q3radiant/PrefsDlg.h
Normal file → Executable file
|
|
@ -19,143 +19,143 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !defined(AFX_PREFSDLG_H__DC829122_812D_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PREFSDLG_H__DC829122_812D_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// PrefsDlg.h : header file
|
||||
//
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPrefsDlg dialog
|
||||
|
||||
#define MAX_TEXTURE_QUALITY 3
|
||||
|
||||
class CPrefsDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
// these mirror what goes in the combo box
|
||||
enum {SHADER_NONE = 0, SHADER_COMMON, SHADER_ALL};
|
||||
void LoadPrefs();
|
||||
void SavePrefs();
|
||||
void SetGamePrefs();
|
||||
CPrefsDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPrefsDlg)
|
||||
enum { IDD = IDD_DLG_PREFS };
|
||||
CSpinButtonCtrl m_wndUndoSpin;
|
||||
CSpinButtonCtrl m_wndFontSpin;
|
||||
CSliderCtrl m_wndTexturequality;
|
||||
CComboBox m_wndWhatGame;
|
||||
CSliderCtrl m_wndCamSpeed;
|
||||
CSpinButtonCtrl m_wndSpin;
|
||||
CString m_strQuake2;
|
||||
int m_nMouse;
|
||||
int m_nView;
|
||||
BOOL m_bTextureLock;
|
||||
BOOL m_bLoadLast;
|
||||
BOOL m_bRunBefore;
|
||||
CString m_strLastProject;
|
||||
CString m_strLastMap;
|
||||
BOOL m_bFace;
|
||||
BOOL m_bInternalBSP;
|
||||
BOOL m_bRightClick;
|
||||
BOOL m_bRunQuake;
|
||||
BOOL m_bSetGame;
|
||||
BOOL m_bVertex;
|
||||
BOOL m_bAutoSave;
|
||||
BOOL m_bNewApplyHandling;
|
||||
CString m_strAutoSave;
|
||||
BOOL m_bPAK;
|
||||
BOOL m_bLoadLastMap;
|
||||
BOOL m_bGatewayHack;
|
||||
BOOL m_bTextureWindow;
|
||||
BOOL m_bSnapShots;
|
||||
float m_fTinySize;
|
||||
BOOL m_bCleanTiny;
|
||||
CString m_strPAKFile;
|
||||
int m_nStatusSize;
|
||||
BOOL m_bCamXYUpdate;
|
||||
BOOL m_bNewLightDraw;
|
||||
CString m_strPrefabPath;
|
||||
int m_nWhatGame;
|
||||
CString m_strWhatGame;
|
||||
BOOL m_bALTEdge;
|
||||
BOOL m_bTextureBar;
|
||||
BOOL m_bFaceColors;
|
||||
BOOL m_bQE4Painting;
|
||||
BOOL m_bSnapTToGrid;
|
||||
BOOL m_bXZVis;
|
||||
BOOL m_bYZVis;
|
||||
BOOL m_bZVis;
|
||||
BOOL m_bSizePaint;
|
||||
BOOL m_bDLLEntities;
|
||||
BOOL m_bRotateLock;
|
||||
BOOL m_bWideToolbar;
|
||||
BOOL m_bNoClamp;
|
||||
CString m_strUserPath;
|
||||
int m_nRotation;
|
||||
BOOL m_bSGIOpenGL;
|
||||
BOOL m_bBuggyICD;
|
||||
BOOL m_bHiColorTextures;
|
||||
BOOL m_bChaseMouse;
|
||||
BOOL m_bTextureScrollbar;
|
||||
BOOL m_bDisplayLists;
|
||||
BOOL m_bShowShaders;
|
||||
int m_nShader;
|
||||
BOOL m_bNoStipple;
|
||||
int m_nUndoLevels;
|
||||
//}}AFX_DATA
|
||||
int m_nMouseButtons;
|
||||
int m_nAngleSpeed;
|
||||
int m_nMoveSpeed;
|
||||
int m_nAutoSave;
|
||||
bool m_bCubicClipping;
|
||||
int m_nCubicScale;
|
||||
BOOL m_bSelectCurves;
|
||||
BOOL m_bSelectTerrain;
|
||||
int m_nEntityShowState;
|
||||
int m_nTextureScale;
|
||||
BOOL m_bNormalizeColors;
|
||||
BOOL m_bSwitchClip;
|
||||
BOOL m_bSelectWholeEntities;
|
||||
int m_nTextureQuality;
|
||||
BOOL m_bGLLighting;
|
||||
|
||||
// brush primitive mode
|
||||
//++timo moved into g_qeglobals
|
||||
// BOOL m_bBrushPrimitMode;
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPrefsDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPrefsDlg)
|
||||
afx_msg void OnBtnBrowse();
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK();
|
||||
afx_msg void OnBtnBrowsepak();
|
||||
afx_msg void OnBtnBrowseprefab();
|
||||
afx_msg void OnBtnBrowseuserini();
|
||||
afx_msg void OnSelchangeComboWhatgame();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PREFSDLG_H__DC829122_812D_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#if !defined(AFX_PREFSDLG_H__DC829122_812D_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
#define AFX_PREFSDLG_H__DC829122_812D_11D1_B548_00AA00A410FC__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// PrefsDlg.h : header file
|
||||
//
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPrefsDlg dialog
|
||||
|
||||
#define MAX_TEXTURE_QUALITY 3
|
||||
|
||||
class CPrefsDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
// these mirror what goes in the combo box
|
||||
enum {SHADER_NONE = 0, SHADER_COMMON, SHADER_ALL};
|
||||
void LoadPrefs();
|
||||
void SavePrefs();
|
||||
void SetGamePrefs();
|
||||
CPrefsDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPrefsDlg)
|
||||
enum { IDD = IDD_DLG_PREFS };
|
||||
CSpinButtonCtrl m_wndUndoSpin;
|
||||
CSpinButtonCtrl m_wndFontSpin;
|
||||
CSliderCtrl m_wndTexturequality;
|
||||
CComboBox m_wndWhatGame;
|
||||
CSliderCtrl m_wndCamSpeed;
|
||||
CSpinButtonCtrl m_wndSpin;
|
||||
CString m_strQuake2;
|
||||
int m_nMouse;
|
||||
int m_nView;
|
||||
BOOL m_bTextureLock;
|
||||
BOOL m_bLoadLast;
|
||||
BOOL m_bRunBefore;
|
||||
CString m_strLastProject;
|
||||
CString m_strLastMap;
|
||||
BOOL m_bFace;
|
||||
BOOL m_bInternalBSP;
|
||||
BOOL m_bRightClick;
|
||||
BOOL m_bRunQuake;
|
||||
BOOL m_bSetGame;
|
||||
BOOL m_bVertex;
|
||||
BOOL m_bAutoSave;
|
||||
BOOL m_bNewApplyHandling;
|
||||
CString m_strAutoSave;
|
||||
BOOL m_bPAK;
|
||||
BOOL m_bLoadLastMap;
|
||||
BOOL m_bGatewayHack;
|
||||
BOOL m_bTextureWindow;
|
||||
BOOL m_bSnapShots;
|
||||
float m_fTinySize;
|
||||
BOOL m_bCleanTiny;
|
||||
CString m_strPAKFile;
|
||||
int m_nStatusSize;
|
||||
BOOL m_bCamXYUpdate;
|
||||
BOOL m_bNewLightDraw;
|
||||
CString m_strPrefabPath;
|
||||
int m_nWhatGame;
|
||||
CString m_strWhatGame;
|
||||
BOOL m_bALTEdge;
|
||||
BOOL m_bTextureBar;
|
||||
BOOL m_bFaceColors;
|
||||
BOOL m_bQE4Painting;
|
||||
BOOL m_bSnapTToGrid;
|
||||
BOOL m_bXZVis;
|
||||
BOOL m_bYZVis;
|
||||
BOOL m_bZVis;
|
||||
BOOL m_bSizePaint;
|
||||
BOOL m_bDLLEntities;
|
||||
BOOL m_bRotateLock;
|
||||
BOOL m_bWideToolbar;
|
||||
BOOL m_bNoClamp;
|
||||
CString m_strUserPath;
|
||||
int m_nRotation;
|
||||
BOOL m_bSGIOpenGL;
|
||||
BOOL m_bBuggyICD;
|
||||
BOOL m_bHiColorTextures;
|
||||
BOOL m_bChaseMouse;
|
||||
BOOL m_bTextureScrollbar;
|
||||
BOOL m_bDisplayLists;
|
||||
BOOL m_bShowShaders;
|
||||
int m_nShader;
|
||||
BOOL m_bNoStipple;
|
||||
int m_nUndoLevels;
|
||||
//}}AFX_DATA
|
||||
int m_nMouseButtons;
|
||||
int m_nAngleSpeed;
|
||||
int m_nMoveSpeed;
|
||||
int m_nAutoSave;
|
||||
bool m_bCubicClipping;
|
||||
int m_nCubicScale;
|
||||
BOOL m_bSelectCurves;
|
||||
BOOL m_bSelectTerrain;
|
||||
int m_nEntityShowState;
|
||||
int m_nTextureScale;
|
||||
BOOL m_bNormalizeColors;
|
||||
BOOL m_bSwitchClip;
|
||||
BOOL m_bSelectWholeEntities;
|
||||
int m_nTextureQuality;
|
||||
BOOL m_bGLLighting;
|
||||
|
||||
// brush primitive mode
|
||||
//++timo moved into g_qeglobals
|
||||
// BOOL m_bBrushPrimitMode;
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPrefsDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPrefsDlg)
|
||||
afx_msg void OnBtnBrowse();
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK();
|
||||
afx_msg void OnBtnBrowsepak();
|
||||
afx_msg void OnBtnBrowseprefab();
|
||||
afx_msg void OnBtnBrowseuserini();
|
||||
afx_msg void OnSelchangeComboWhatgame();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PREFSDLG_H__DC829122_812D_11D1_B548_00AA00A410FC__INCLUDED_)
|
||||
|
|
|
|||
1460
q3radiant/QE3.CPP
Normal file → Executable file
1460
q3radiant/QE3.CPP
Normal file → Executable file
File diff suppressed because it is too large
Load diff
1296
q3radiant/QE3.H
Normal file → Executable file
1296
q3radiant/QE3.H
Normal file → Executable file
File diff suppressed because it is too large
Load diff
286
q3radiant/QEDEFS.H
Normal file → Executable file
286
q3radiant/QEDEFS.H
Normal file → Executable file
|
|
@ -19,146 +19,146 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#ifndef __QEDEFS_H__
|
||||
#define __QEDEFS_H__
|
||||
|
||||
#define QE_VERSION 0x0501
|
||||
|
||||
#define QE3_STYLE (WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CHILD)
|
||||
#define QE3_STYLE2 (WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MINIMIZEBOX | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU)
|
||||
#define QE3_CHILDSTYLE (WS_OVERLAPPED | WS_MINIMIZEBOX | WS_THICKFRAME | WS_CAPTION | WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_MAXIMIZEBOX)
|
||||
|
||||
#define QE3_SPLITTER_STYLE (WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS)
|
||||
|
||||
|
||||
|
||||
#define QE_AUTOSAVE_INTERVAL 5 // number of minutes between autosaves
|
||||
|
||||
#define _3DFXCAMERA_WINDOW_CLASS "Q3DFXCamera"
|
||||
#define CAMERA_WINDOW_CLASS "QCamera"
|
||||
#define XY_WINDOW_CLASS "QXY"
|
||||
#define Z_WINDOW_CLASS "QZ"
|
||||
#define ENT_WINDOW_CLASS "QENT"
|
||||
#define TEXTURE_WINDOW_CLASS "QTEX"
|
||||
|
||||
#define ZWIN_WIDTH 40
|
||||
#define CWIN_SIZE (0.4)
|
||||
|
||||
#define MAX_EDGES 512
|
||||
//#define MAX_POINTS 1024
|
||||
#define MAX_POINTS 2048
|
||||
|
||||
#define MAX_TERRA_POINTS 4096
|
||||
|
||||
#define CMD_TEXTUREWAD 60000
|
||||
#define CMD_BSPCOMMAND 61000
|
||||
|
||||
#define PITCH 0
|
||||
#define YAW 1
|
||||
#define ROLL 2
|
||||
|
||||
#define QE_TIMER0 1
|
||||
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
#define ON_EPSILON 0.01
|
||||
|
||||
#define KEY_FORWARD 1
|
||||
#define KEY_BACK 2
|
||||
#define KEY_TURNLEFT 4
|
||||
#define KEY_TURNRIGHT 8
|
||||
#define KEY_LEFT 16
|
||||
#define KEY_RIGHT 32
|
||||
#define KEY_LOOKUP 64
|
||||
#define KEY_LOOKDOWN 128
|
||||
#define KEY_UP 256
|
||||
#define KEY_DOWN 512
|
||||
|
||||
// xy.c
|
||||
#define EXCLUDE_LIGHTS 0x01
|
||||
#define EXCLUDE_ENT 0x02
|
||||
#define EXCLUDE_PATHS 0x04
|
||||
#define EXCLUDE_WATER 0x08
|
||||
#define EXCLUDE_WORLD 0x10
|
||||
#define EXCLUDE_CLIP 0x20
|
||||
#define EXCLUDE_DETAIL 0x40
|
||||
#define EXCLUDE_CURVES 0x80
|
||||
#define INCLUDE_EASY 0x100
|
||||
#define INCLUDE_NORMAL 0x200
|
||||
#define INCLUDE_HARD 0x400
|
||||
#define INCLUDE_DEATHMATCH 0x800
|
||||
#define EXCLUDE_HINT 0x1000
|
||||
#define EXCLUDE_CAULK 0x2000
|
||||
#define EXCLUDE_ANGLES 0x4000
|
||||
#define EXCLUDE_TERRAIN 0x8000
|
||||
|
||||
|
||||
//
|
||||
// menu indexes for modifying menus
|
||||
//
|
||||
#define MENU_VIEW 2
|
||||
#define MENU_BSP 4
|
||||
#define MENU_TEXTURE 6
|
||||
#define MENU_PLUGIN 11
|
||||
|
||||
|
||||
// odd things not in windows header...
|
||||
#define VK_COMMA 188
|
||||
#define VK_PERIOD 190
|
||||
|
||||
/*
|
||||
** window bits
|
||||
*/
|
||||
//++timo moved to qertypes.h
|
||||
// clean
|
||||
/*
|
||||
#define W_CAMERA 0x0001
|
||||
#define W_XY 0x0002
|
||||
#define W_XY_OVERLAY 0x0004
|
||||
#define W_Z 0x0008
|
||||
#define W_TEXTURE 0x0010
|
||||
#define W_Z_OVERLAY 0x0020
|
||||
#define W_CONSOLE 0x0040
|
||||
#define W_ENTITY 0x0080
|
||||
#define W_CAMERA_IFON 0x0100
|
||||
#define W_XZ 0x0200 //--| only used for patch vertex manip stuff
|
||||
#define W_YZ 0x0400 //--|
|
||||
#define W_ALL 0xFFFFFFFF
|
||||
*/
|
||||
|
||||
#define COLOR_TEXTUREBACK 0
|
||||
#define COLOR_GRIDBACK 1
|
||||
#define COLOR_GRIDMINOR 2
|
||||
#define COLOR_GRIDMAJOR 3
|
||||
#define COLOR_CAMERABACK 4
|
||||
#define COLOR_ENTITY 5
|
||||
#define COLOR_GRIDBLOCK 6
|
||||
#define COLOR_GRIDTEXT 7
|
||||
#define COLOR_BRUSHES 8
|
||||
#define COLOR_SELBRUSHES 9
|
||||
#define COLOR_CLIPPER 10
|
||||
#define COLOR_VIEWNAME 11
|
||||
#define COLOR_LAST 12
|
||||
|
||||
// classes
|
||||
#define ENTITY_WIREFRAME 0x00001
|
||||
#define ENTITY_SKIN_MODEL 0x00010
|
||||
#define ENTITY_SELECTED_ONLY 0x00100
|
||||
#define ENTITY_BOXED 0x01000
|
||||
|
||||
// menu settings
|
||||
#define ENTITY_BOX 0x01000
|
||||
#define ENTITY_WIRE 0x00001
|
||||
#define ENTITY_SELECTED 0x00101
|
||||
#define ENTITY_SKINNED 0x00010
|
||||
#define ENTITY_SKINNED_BOXED 0x01010
|
||||
#define ENTITY_SELECTED_SKIN 0x00110
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#ifndef __QEDEFS_H__
|
||||
#define __QEDEFS_H__
|
||||
|
||||
#define QE_VERSION 0x0501
|
||||
|
||||
#define QE3_STYLE (WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CHILD)
|
||||
#define QE3_STYLE2 (WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MINIMIZEBOX | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU)
|
||||
#define QE3_CHILDSTYLE (WS_OVERLAPPED | WS_MINIMIZEBOX | WS_THICKFRAME | WS_CAPTION | WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_MAXIMIZEBOX)
|
||||
|
||||
#define QE3_SPLITTER_STYLE (WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS)
|
||||
|
||||
|
||||
|
||||
#define QE_AUTOSAVE_INTERVAL 5 // number of minutes between autosaves
|
||||
|
||||
#define _3DFXCAMERA_WINDOW_CLASS "Q3DFXCamera"
|
||||
#define CAMERA_WINDOW_CLASS "QCamera"
|
||||
#define XY_WINDOW_CLASS "QXY"
|
||||
#define Z_WINDOW_CLASS "QZ"
|
||||
#define ENT_WINDOW_CLASS "QENT"
|
||||
#define TEXTURE_WINDOW_CLASS "QTEX"
|
||||
|
||||
#define ZWIN_WIDTH 40
|
||||
#define CWIN_SIZE (0.4)
|
||||
|
||||
#define MAX_EDGES 512
|
||||
//#define MAX_POINTS 1024
|
||||
#define MAX_POINTS 2048
|
||||
|
||||
#define MAX_TERRA_POINTS 4096
|
||||
|
||||
#define CMD_TEXTUREWAD 60000
|
||||
#define CMD_BSPCOMMAND 61000
|
||||
|
||||
#define PITCH 0
|
||||
#define YAW 1
|
||||
#define ROLL 2
|
||||
|
||||
#define QE_TIMER0 1
|
||||
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
#define ON_EPSILON 0.01
|
||||
|
||||
#define KEY_FORWARD 1
|
||||
#define KEY_BACK 2
|
||||
#define KEY_TURNLEFT 4
|
||||
#define KEY_TURNRIGHT 8
|
||||
#define KEY_LEFT 16
|
||||
#define KEY_RIGHT 32
|
||||
#define KEY_LOOKUP 64
|
||||
#define KEY_LOOKDOWN 128
|
||||
#define KEY_UP 256
|
||||
#define KEY_DOWN 512
|
||||
|
||||
// xy.c
|
||||
#define EXCLUDE_LIGHTS 0x01
|
||||
#define EXCLUDE_ENT 0x02
|
||||
#define EXCLUDE_PATHS 0x04
|
||||
#define EXCLUDE_WATER 0x08
|
||||
#define EXCLUDE_WORLD 0x10
|
||||
#define EXCLUDE_CLIP 0x20
|
||||
#define EXCLUDE_DETAIL 0x40
|
||||
#define EXCLUDE_CURVES 0x80
|
||||
#define INCLUDE_EASY 0x100
|
||||
#define INCLUDE_NORMAL 0x200
|
||||
#define INCLUDE_HARD 0x400
|
||||
#define INCLUDE_DEATHMATCH 0x800
|
||||
#define EXCLUDE_HINT 0x1000
|
||||
#define EXCLUDE_CAULK 0x2000
|
||||
#define EXCLUDE_ANGLES 0x4000
|
||||
#define EXCLUDE_TERRAIN 0x8000
|
||||
|
||||
|
||||
//
|
||||
// menu indexes for modifying menus
|
||||
//
|
||||
#define MENU_VIEW 2
|
||||
#define MENU_BSP 4
|
||||
#define MENU_TEXTURE 6
|
||||
#define MENU_PLUGIN 11
|
||||
|
||||
|
||||
// odd things not in windows header...
|
||||
#define VK_COMMA 188
|
||||
#define VK_PERIOD 190
|
||||
|
||||
/*
|
||||
** window bits
|
||||
*/
|
||||
//++timo moved to qertypes.h
|
||||
// clean
|
||||
/*
|
||||
#define W_CAMERA 0x0001
|
||||
#define W_XY 0x0002
|
||||
#define W_XY_OVERLAY 0x0004
|
||||
#define W_Z 0x0008
|
||||
#define W_TEXTURE 0x0010
|
||||
#define W_Z_OVERLAY 0x0020
|
||||
#define W_CONSOLE 0x0040
|
||||
#define W_ENTITY 0x0080
|
||||
#define W_CAMERA_IFON 0x0100
|
||||
#define W_XZ 0x0200 //--| only used for patch vertex manip stuff
|
||||
#define W_YZ 0x0400 //--|
|
||||
#define W_ALL 0xFFFFFFFF
|
||||
*/
|
||||
|
||||
#define COLOR_TEXTUREBACK 0
|
||||
#define COLOR_GRIDBACK 1
|
||||
#define COLOR_GRIDMINOR 2
|
||||
#define COLOR_GRIDMAJOR 3
|
||||
#define COLOR_CAMERABACK 4
|
||||
#define COLOR_ENTITY 5
|
||||
#define COLOR_GRIDBLOCK 6
|
||||
#define COLOR_GRIDTEXT 7
|
||||
#define COLOR_BRUSHES 8
|
||||
#define COLOR_SELBRUSHES 9
|
||||
#define COLOR_CLIPPER 10
|
||||
#define COLOR_VIEWNAME 11
|
||||
#define COLOR_LAST 12
|
||||
|
||||
// classes
|
||||
#define ENTITY_WIREFRAME 0x00001
|
||||
#define ENTITY_SKIN_MODEL 0x00010
|
||||
#define ENTITY_SELECTED_ONLY 0x00100
|
||||
#define ENTITY_BOXED 0x01000
|
||||
|
||||
// menu settings
|
||||
#define ENTITY_BOX 0x01000
|
||||
#define ENTITY_WIRE 0x00001
|
||||
#define ENTITY_SELECTED 0x00101
|
||||
#define ENTITY_SKINNED 0x00010
|
||||
#define ENTITY_SKINNED_BOXED 0x01010
|
||||
#define ENTITY_SELECTED_SKIN 0x00110
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
864
q3radiant/QERTYPES.H
Normal file → Executable file
864
q3radiant/QERTYPES.H
Normal file → Executable file
|
|
@ -19,436 +19,436 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// qertypes.h
|
||||
//
|
||||
// common types
|
||||
// merged from brush.h, etc. for plugin support
|
||||
//
|
||||
#ifndef _QERTYPE_H
|
||||
#define _QERTYPE_H
|
||||
|
||||
#ifndef __BYTEBOOL__
|
||||
#define __BYTEBOOL__
|
||||
typedef boolean qboolean;
|
||||
//typedef unsigned char byte;
|
||||
#endif
|
||||
|
||||
#define MAXPOINTS 16
|
||||
|
||||
typedef float vec_t;
|
||||
typedef vec_t vec2_t[2];
|
||||
typedef vec_t vec3_t[3];
|
||||
|
||||
#include "splines/math_vector.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
class texdef_t
|
||||
{
|
||||
public:
|
||||
texdef_t()
|
||||
{
|
||||
name = new char[1];
|
||||
name[0] = '\0';
|
||||
}
|
||||
~texdef_t()
|
||||
{
|
||||
delete []name;
|
||||
name = NULL;
|
||||
}
|
||||
|
||||
const char *Name( void )
|
||||
{
|
||||
if ( name ) {
|
||||
return name;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
void SetName(const char *p)
|
||||
{
|
||||
if (name)
|
||||
{
|
||||
delete []name;
|
||||
}
|
||||
if (p)
|
||||
{
|
||||
name = strcpy(new char[strlen(p)+1], p);
|
||||
}
|
||||
else
|
||||
{
|
||||
name = new char[1];
|
||||
name[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
texdef_t& operator =(const texdef_t& rhs)
|
||||
{
|
||||
if (&rhs != this)
|
||||
{
|
||||
SetName(rhs.name);
|
||||
shift[0] = rhs.shift[0];
|
||||
shift[1] = rhs.shift[1];
|
||||
rotate = rhs.rotate;
|
||||
scale[0] = rhs.scale[0];
|
||||
scale[1] = rhs.scale[1];
|
||||
contents = rhs.contents;
|
||||
flags = rhs.flags;
|
||||
value = rhs.value;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
//char name[128];
|
||||
char *name;
|
||||
float shift[2];
|
||||
float rotate;
|
||||
float scale[2];
|
||||
int contents;
|
||||
int flags;
|
||||
int value;
|
||||
};
|
||||
|
||||
// Timo
|
||||
// new brush primitive texdef
|
||||
typedef struct brushprimit_texdef_s
|
||||
{
|
||||
vec_t coords[2][3];
|
||||
} brushprimit_texdef_t;
|
||||
|
||||
class texturewin_t
|
||||
{
|
||||
public:
|
||||
texturewin_t()
|
||||
{
|
||||
}
|
||||
~texturewin_t()
|
||||
{
|
||||
}
|
||||
int width, height;
|
||||
int originy;
|
||||
// add brushprimit_texdef_t for brush primitive coordinates storage
|
||||
brushprimit_texdef_t brushprimit_texdef;
|
||||
int m_nTotalHeight;
|
||||
// surface plugin, must be casted to a IPluginTexdef*
|
||||
void* pTexdef;
|
||||
texdef_t texdef;
|
||||
};
|
||||
|
||||
#define QER_TRANS 0x00000001
|
||||
#define QER_NOCARVE 0x00000002
|
||||
|
||||
typedef struct qtexture_s
|
||||
{
|
||||
struct qtexture_s *next;
|
||||
char name[64]; // includes partial directory and extension
|
||||
int width, height;
|
||||
int contents;
|
||||
int flags;
|
||||
int value;
|
||||
int texture_number; // gl bind number
|
||||
|
||||
// name of the .shader file
|
||||
char shadername[1024]; // old shader stuff
|
||||
qboolean bFromShader; // created from a shader
|
||||
float fTrans; // amount of transparency
|
||||
int nShaderFlags; // qer_ shader flags
|
||||
vec3_t color; // for flat shade mode
|
||||
qboolean inuse; // true = is present on the level
|
||||
|
||||
// cast this one to an IPluginQTexture if you are using it
|
||||
// NOTE: casting can be done with a GETPLUGINQTEXTURE defined in isurfaceplugin.h
|
||||
// TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginQTexture *pPluginQTexture } kind of thing ?
|
||||
void *pData;
|
||||
|
||||
//++timo FIXME: this is the actual filename of the texture
|
||||
// this will be removed after shader code cleanup
|
||||
char filename[64];
|
||||
|
||||
} qtexture_t;
|
||||
|
||||
// NOTE: don't trust this definition!
|
||||
// you should read float points[..][5]
|
||||
// see NewWinding definition
|
||||
#define MAX_POINTS_ON_WINDING 64
|
||||
typedef struct
|
||||
{
|
||||
int numpoints;
|
||||
int maxpoints;
|
||||
float points[8][5]; // variable sized
|
||||
} winding_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t normal;
|
||||
double dist;
|
||||
int type;
|
||||
} plane_t;
|
||||
|
||||
//++timo texdef and brushprimit_texdef are static
|
||||
// TODO : do dynamic ?
|
||||
typedef struct face_s
|
||||
{
|
||||
struct face_s *next;
|
||||
struct face_s *original; //used for vertex movement
|
||||
vec3_t planepts[3];
|
||||
texdef_t texdef;
|
||||
plane_t plane;
|
||||
|
||||
winding_t *face_winding;
|
||||
|
||||
vec3_t d_color;
|
||||
qtexture_t *d_texture;
|
||||
|
||||
// Timo new brush primit texdef
|
||||
brushprimit_texdef_t brushprimit_texdef;
|
||||
|
||||
// cast this one to an IPluginTexdef if you are using it
|
||||
// NOTE: casting can be done with a GETPLUGINTEXDEF defined in isurfaceplugin.h
|
||||
// TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginTexdef *pPluginTexdef } kind of thing ?
|
||||
void *pData;
|
||||
} face_t;
|
||||
|
||||
typedef struct {
|
||||
vec3_t xyz;
|
||||
float sideST[2];
|
||||
float capST[2];
|
||||
} curveVertex_t;
|
||||
|
||||
typedef struct {
|
||||
curveVertex_t v[2];
|
||||
} sideVertex_t;
|
||||
|
||||
|
||||
#define MIN_PATCH_WIDTH 3
|
||||
#define MIN_PATCH_HEIGHT 3
|
||||
|
||||
#define MAX_PATCH_WIDTH 16
|
||||
#define MAX_PATCH_HEIGHT 16
|
||||
|
||||
// patch type info
|
||||
// type in lower 16 bits, flags in upper
|
||||
// endcaps directly follow this patch in the list
|
||||
|
||||
// types
|
||||
#define PATCH_GENERIC 0x00000000 // generic flat patch
|
||||
#define PATCH_CYLINDER 0x00000001 // cylinder
|
||||
#define PATCH_BEVEL 0x00000002 // bevel
|
||||
#define PATCH_ENDCAP 0x00000004 // endcap
|
||||
#define PATCH_HEMISPHERE 0x00000008 // hemisphere
|
||||
#define PATCH_CONE 0x00000010 // cone
|
||||
#define PATCH_TRIANGLE 0x00000020 // simple tri, assumes 3x3 patch
|
||||
|
||||
// behaviour styles
|
||||
#define PATCH_CAP 0x00001000 // flat patch applied as a cap
|
||||
#define PATCH_SEAM 0x00002000 // flat patch applied as a seam
|
||||
#define PATCH_THICK 0x00004000 // patch applied as a thick portion
|
||||
|
||||
// styles
|
||||
#define PATCH_BEZIER 0x00000000 // default bezier
|
||||
#define PATCH_BSPLINE 0x10000000 // bspline
|
||||
|
||||
#define PATCH_TYPEMASK 0x00000fff //
|
||||
#define PATCH_BTYPEMASK 0x0000f000 //
|
||||
#define PATCH_STYLEMASK 0xffff0000 //
|
||||
|
||||
typedef struct {
|
||||
vec3_t xyz;
|
||||
float st[2];
|
||||
float lightmap[2];
|
||||
vec3_t normal;
|
||||
} drawVert_t;
|
||||
|
||||
// used in brush primitive AND entities
|
||||
typedef struct epair_s
|
||||
{
|
||||
struct epair_s *next;
|
||||
char *key;
|
||||
char *value;
|
||||
} epair_t;
|
||||
|
||||
struct brush_s;
|
||||
typedef struct brush_s brush_t;
|
||||
|
||||
typedef struct {
|
||||
int width, height; // in control points, not patches
|
||||
int contents, flags, value, type;
|
||||
qtexture_t *d_texture;
|
||||
drawVert_t ctrl[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT];
|
||||
brush_t *pSymbiot;
|
||||
qboolean bSelected;
|
||||
qboolean bOverlay;
|
||||
qboolean bDirty;
|
||||
int nListID;
|
||||
epair_t *epairs;
|
||||
// cast this one to an IPluginTexdef if you are using it
|
||||
// NOTE: casting can be done with a GETPLUGINTEXDEF defined in isurfaceplugin.h
|
||||
// TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginTexdef *pPluginTexdef } kind of thing ?
|
||||
void *pData;
|
||||
} patchMesh_t;
|
||||
|
||||
typedef struct {
|
||||
int index;
|
||||
qtexture_t *texture;
|
||||
texdef_t texdef;
|
||||
} terrainFace_t;
|
||||
|
||||
typedef struct {
|
||||
float height;
|
||||
float scale;
|
||||
terrainFace_t tri;
|
||||
vec4_t rgba;
|
||||
vec3_t normal;
|
||||
vec3_t xyz;
|
||||
} terrainVert_t;
|
||||
|
||||
#define MAX_TERRAIN_TEXTURES 128
|
||||
typedef struct {
|
||||
int width, height;
|
||||
|
||||
vec3_t mins, maxs;
|
||||
vec3_t origin;
|
||||
float scale_x;
|
||||
float scale_y;
|
||||
|
||||
int numtextures;
|
||||
qtexture_t *textures[ MAX_TERRAIN_TEXTURES ];
|
||||
|
||||
terrainVert_t *heightmap; // width * height
|
||||
|
||||
epair_t *epairs;
|
||||
|
||||
brush_s *pSymbiot;
|
||||
bool bSelected;
|
||||
bool bDirty;
|
||||
int nListID;
|
||||
} terrainMesh_t;
|
||||
|
||||
typedef struct brush_s
|
||||
{
|
||||
struct brush_s *prev, *next; // links in active/selected
|
||||
struct brush_s *oprev, *onext; // links in entity
|
||||
struct entity_s *owner;
|
||||
vec3_t mins, maxs;
|
||||
face_t *brush_faces;
|
||||
|
||||
qboolean bModelFailed;
|
||||
//
|
||||
// curve brush extensions
|
||||
// all are derived from brush_faces
|
||||
qboolean patchBrush;
|
||||
qboolean hiddenBrush;
|
||||
qboolean terrainBrush;
|
||||
|
||||
//int nPatchID;
|
||||
|
||||
patchMesh_t *pPatch;
|
||||
terrainMesh_t *pTerrain;
|
||||
|
||||
struct entity_s *pUndoOwner;
|
||||
|
||||
int undoId; //undo ID
|
||||
int redoId; //redo ID
|
||||
int ownerId; //entityId of the owner entity for undo
|
||||
|
||||
// TTimo: HTREEITEM is MFC, some plugins really don't like it
|
||||
#ifdef QERTYPES_USE_MFC
|
||||
int numberId; // brush number
|
||||
HTREEITEM itemOwner; // owner for grouping
|
||||
#else
|
||||
int numberId;
|
||||
DWORD itemOwner;
|
||||
#endif
|
||||
|
||||
// brush primitive only
|
||||
epair_t *epairs;
|
||||
|
||||
} brush_t;
|
||||
|
||||
|
||||
#define MAX_FLAGS 8
|
||||
|
||||
|
||||
typedef struct trimodel_t
|
||||
{
|
||||
vec3_t v[3];
|
||||
float st[3][2];
|
||||
} trimodel;
|
||||
|
||||
typedef struct entitymodel_t
|
||||
{
|
||||
struct entitymodel_t *pNext;
|
||||
int nTriCount;
|
||||
trimodel *pTriList;
|
||||
int nTextureBind;
|
||||
int nSkinWidth;
|
||||
int nSkinHeight;
|
||||
int nModelPosition;
|
||||
} entitymodel;
|
||||
|
||||
|
||||
// eclass show flags
|
||||
|
||||
#define ECLASS_LIGHT 0x00000001
|
||||
#define ECLASS_ANGLE 0x00000002
|
||||
#define ECLASS_PATH 0x00000004
|
||||
#define ECLASS_MISCMODEL 0x00000008
|
||||
#define ECLASS_PLUGINENTITY 0x00000010
|
||||
|
||||
typedef struct eclass_s
|
||||
{
|
||||
struct eclass_s *next;
|
||||
char *name;
|
||||
qboolean fixedsize;
|
||||
qboolean unknown; // wasn't found in source
|
||||
vec3_t mins, maxs;
|
||||
vec3_t color;
|
||||
texdef_t texdef;
|
||||
char *comments;
|
||||
char flagnames[MAX_FLAGS][32];
|
||||
|
||||
/*
|
||||
int nTriCount;
|
||||
trimodel *pTriList;
|
||||
int nTextureBind;
|
||||
int nSkinWidth, nSkinHeight;
|
||||
*/
|
||||
entitymodel *model;
|
||||
char *modelpath;
|
||||
char *skinpath;
|
||||
int nFrame;
|
||||
unsigned int nShowFlags;
|
||||
|
||||
HMODULE hPlug;
|
||||
} eclass_t;
|
||||
|
||||
extern eclass_t *eclass;
|
||||
|
||||
/*
|
||||
** window bits
|
||||
*/
|
||||
#define W_CAMERA 0x0001
|
||||
#define W_XY 0x0002
|
||||
#define W_XY_OVERLAY 0x0004
|
||||
#define W_Z 0x0008
|
||||
#define W_TEXTURE 0x0010
|
||||
#define W_Z_OVERLAY 0x0020
|
||||
#define W_CONSOLE 0x0040
|
||||
#define W_ENTITY 0x0080
|
||||
#define W_CAMERA_IFON 0x0100
|
||||
#define W_XZ 0x0200 //--| only used for patch vertex manip stuff
|
||||
#define W_YZ 0x0400 //--|
|
||||
#define W_GROUP 0x0800
|
||||
#define W_MEDIA 0x1000
|
||||
#define W_ALL 0xFFFFFFFF
|
||||
|
||||
// used in some Drawing routines
|
||||
enum VIEWTYPE {YZ, XZ, XY};
|
||||
|
||||
enum terrainnoise_t { NOISE_NONE, NOISE_PLUS, NOISE_PLUSMINUS };
|
||||
enum terrainbrush_t { TERRAIN_BRUSH_CIRCLE, TERRAIN_BRUSH_SQUARE };
|
||||
enum terrainfalloff_t { TERRAIN_FALLOFF_LINEAR, TERRAIN_FALLOFF_CURVED };
|
||||
|
||||
// qertypes.h
|
||||
//
|
||||
// common types
|
||||
// merged from brush.h, etc. for plugin support
|
||||
//
|
||||
#ifndef _QERTYPE_H
|
||||
#define _QERTYPE_H
|
||||
|
||||
#ifndef __BYTEBOOL__
|
||||
#define __BYTEBOOL__
|
||||
typedef boolean qboolean;
|
||||
//typedef unsigned char byte;
|
||||
#endif
|
||||
|
||||
#define MAXPOINTS 16
|
||||
|
||||
typedef float vec_t;
|
||||
typedef vec_t vec2_t[2];
|
||||
typedef vec_t vec3_t[3];
|
||||
|
||||
#include "splines/math_vector.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
class texdef_t
|
||||
{
|
||||
public:
|
||||
texdef_t()
|
||||
{
|
||||
name = new char[1];
|
||||
name[0] = '\0';
|
||||
}
|
||||
~texdef_t()
|
||||
{
|
||||
delete []name;
|
||||
name = NULL;
|
||||
}
|
||||
|
||||
const char *Name( void )
|
||||
{
|
||||
if ( name ) {
|
||||
return name;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
void SetName(const char *p)
|
||||
{
|
||||
if (name)
|
||||
{
|
||||
delete []name;
|
||||
}
|
||||
if (p)
|
||||
{
|
||||
name = strcpy(new char[strlen(p)+1], p);
|
||||
}
|
||||
else
|
||||
{
|
||||
name = new char[1];
|
||||
name[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
texdef_t& operator =(const texdef_t& rhs)
|
||||
{
|
||||
if (&rhs != this)
|
||||
{
|
||||
SetName(rhs.name);
|
||||
shift[0] = rhs.shift[0];
|
||||
shift[1] = rhs.shift[1];
|
||||
rotate = rhs.rotate;
|
||||
scale[0] = rhs.scale[0];
|
||||
scale[1] = rhs.scale[1];
|
||||
contents = rhs.contents;
|
||||
flags = rhs.flags;
|
||||
value = rhs.value;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
//char name[128];
|
||||
char *name;
|
||||
float shift[2];
|
||||
float rotate;
|
||||
float scale[2];
|
||||
int contents;
|
||||
int flags;
|
||||
int value;
|
||||
};
|
||||
|
||||
// Timo
|
||||
// new brush primitive texdef
|
||||
typedef struct brushprimit_texdef_s
|
||||
{
|
||||
vec_t coords[2][3];
|
||||
} brushprimit_texdef_t;
|
||||
|
||||
class texturewin_t
|
||||
{
|
||||
public:
|
||||
texturewin_t()
|
||||
{
|
||||
}
|
||||
~texturewin_t()
|
||||
{
|
||||
}
|
||||
int width, height;
|
||||
int originy;
|
||||
// add brushprimit_texdef_t for brush primitive coordinates storage
|
||||
brushprimit_texdef_t brushprimit_texdef;
|
||||
int m_nTotalHeight;
|
||||
// surface plugin, must be casted to a IPluginTexdef*
|
||||
void* pTexdef;
|
||||
texdef_t texdef;
|
||||
};
|
||||
|
||||
#define QER_TRANS 0x00000001
|
||||
#define QER_NOCARVE 0x00000002
|
||||
|
||||
typedef struct qtexture_s
|
||||
{
|
||||
struct qtexture_s *next;
|
||||
char name[64]; // includes partial directory and extension
|
||||
int width, height;
|
||||
int contents;
|
||||
int flags;
|
||||
int value;
|
||||
int texture_number; // gl bind number
|
||||
|
||||
// name of the .shader file
|
||||
char shadername[1024]; // old shader stuff
|
||||
qboolean bFromShader; // created from a shader
|
||||
float fTrans; // amount of transparency
|
||||
int nShaderFlags; // qer_ shader flags
|
||||
vec3_t color; // for flat shade mode
|
||||
qboolean inuse; // true = is present on the level
|
||||
|
||||
// cast this one to an IPluginQTexture if you are using it
|
||||
// NOTE: casting can be done with a GETPLUGINQTEXTURE defined in isurfaceplugin.h
|
||||
// TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginQTexture *pPluginQTexture } kind of thing ?
|
||||
void *pData;
|
||||
|
||||
//++timo FIXME: this is the actual filename of the texture
|
||||
// this will be removed after shader code cleanup
|
||||
char filename[64];
|
||||
|
||||
} qtexture_t;
|
||||
|
||||
// NOTE: don't trust this definition!
|
||||
// you should read float points[..][5]
|
||||
// see NewWinding definition
|
||||
#define MAX_POINTS_ON_WINDING 64
|
||||
typedef struct
|
||||
{
|
||||
int numpoints;
|
||||
int maxpoints;
|
||||
float points[8][5]; // variable sized
|
||||
} winding_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t normal;
|
||||
double dist;
|
||||
int type;
|
||||
} plane_t;
|
||||
|
||||
//++timo texdef and brushprimit_texdef are static
|
||||
// TODO : do dynamic ?
|
||||
typedef struct face_s
|
||||
{
|
||||
struct face_s *next;
|
||||
struct face_s *original; //used for vertex movement
|
||||
vec3_t planepts[3];
|
||||
texdef_t texdef;
|
||||
plane_t plane;
|
||||
|
||||
winding_t *face_winding;
|
||||
|
||||
vec3_t d_color;
|
||||
qtexture_t *d_texture;
|
||||
|
||||
// Timo new brush primit texdef
|
||||
brushprimit_texdef_t brushprimit_texdef;
|
||||
|
||||
// cast this one to an IPluginTexdef if you are using it
|
||||
// NOTE: casting can be done with a GETPLUGINTEXDEF defined in isurfaceplugin.h
|
||||
// TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginTexdef *pPluginTexdef } kind of thing ?
|
||||
void *pData;
|
||||
} face_t;
|
||||
|
||||
typedef struct {
|
||||
vec3_t xyz;
|
||||
float sideST[2];
|
||||
float capST[2];
|
||||
} curveVertex_t;
|
||||
|
||||
typedef struct {
|
||||
curveVertex_t v[2];
|
||||
} sideVertex_t;
|
||||
|
||||
|
||||
#define MIN_PATCH_WIDTH 3
|
||||
#define MIN_PATCH_HEIGHT 3
|
||||
|
||||
#define MAX_PATCH_WIDTH 16
|
||||
#define MAX_PATCH_HEIGHT 16
|
||||
|
||||
// patch type info
|
||||
// type in lower 16 bits, flags in upper
|
||||
// endcaps directly follow this patch in the list
|
||||
|
||||
// types
|
||||
#define PATCH_GENERIC 0x00000000 // generic flat patch
|
||||
#define PATCH_CYLINDER 0x00000001 // cylinder
|
||||
#define PATCH_BEVEL 0x00000002 // bevel
|
||||
#define PATCH_ENDCAP 0x00000004 // endcap
|
||||
#define PATCH_HEMISPHERE 0x00000008 // hemisphere
|
||||
#define PATCH_CONE 0x00000010 // cone
|
||||
#define PATCH_TRIANGLE 0x00000020 // simple tri, assumes 3x3 patch
|
||||
|
||||
// behaviour styles
|
||||
#define PATCH_CAP 0x00001000 // flat patch applied as a cap
|
||||
#define PATCH_SEAM 0x00002000 // flat patch applied as a seam
|
||||
#define PATCH_THICK 0x00004000 // patch applied as a thick portion
|
||||
|
||||
// styles
|
||||
#define PATCH_BEZIER 0x00000000 // default bezier
|
||||
#define PATCH_BSPLINE 0x10000000 // bspline
|
||||
|
||||
#define PATCH_TYPEMASK 0x00000fff //
|
||||
#define PATCH_BTYPEMASK 0x0000f000 //
|
||||
#define PATCH_STYLEMASK 0xffff0000 //
|
||||
|
||||
typedef struct {
|
||||
vec3_t xyz;
|
||||
float st[2];
|
||||
float lightmap[2];
|
||||
vec3_t normal;
|
||||
} drawVert_t;
|
||||
|
||||
// used in brush primitive AND entities
|
||||
typedef struct epair_s
|
||||
{
|
||||
struct epair_s *next;
|
||||
char *key;
|
||||
char *value;
|
||||
} epair_t;
|
||||
|
||||
struct brush_s;
|
||||
typedef struct brush_s brush_t;
|
||||
|
||||
typedef struct {
|
||||
int width, height; // in control points, not patches
|
||||
int contents, flags, value, type;
|
||||
qtexture_t *d_texture;
|
||||
drawVert_t ctrl[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT];
|
||||
brush_t *pSymbiot;
|
||||
qboolean bSelected;
|
||||
qboolean bOverlay;
|
||||
qboolean bDirty;
|
||||
int nListID;
|
||||
epair_t *epairs;
|
||||
// cast this one to an IPluginTexdef if you are using it
|
||||
// NOTE: casting can be done with a GETPLUGINTEXDEF defined in isurfaceplugin.h
|
||||
// TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginTexdef *pPluginTexdef } kind of thing ?
|
||||
void *pData;
|
||||
} patchMesh_t;
|
||||
|
||||
typedef struct {
|
||||
int index;
|
||||
qtexture_t *texture;
|
||||
texdef_t texdef;
|
||||
} terrainFace_t;
|
||||
|
||||
typedef struct {
|
||||
float height;
|
||||
float scale;
|
||||
terrainFace_t tri;
|
||||
vec4_t rgba;
|
||||
vec3_t normal;
|
||||
vec3_t xyz;
|
||||
} terrainVert_t;
|
||||
|
||||
#define MAX_TERRAIN_TEXTURES 128
|
||||
typedef struct {
|
||||
int width, height;
|
||||
|
||||
vec3_t mins, maxs;
|
||||
vec3_t origin;
|
||||
float scale_x;
|
||||
float scale_y;
|
||||
|
||||
int numtextures;
|
||||
qtexture_t *textures[ MAX_TERRAIN_TEXTURES ];
|
||||
|
||||
terrainVert_t *heightmap; // width * height
|
||||
|
||||
epair_t *epairs;
|
||||
|
||||
brush_s *pSymbiot;
|
||||
bool bSelected;
|
||||
bool bDirty;
|
||||
int nListID;
|
||||
} terrainMesh_t;
|
||||
|
||||
typedef struct brush_s
|
||||
{
|
||||
struct brush_s *prev, *next; // links in active/selected
|
||||
struct brush_s *oprev, *onext; // links in entity
|
||||
struct entity_s *owner;
|
||||
vec3_t mins, maxs;
|
||||
face_t *brush_faces;
|
||||
|
||||
qboolean bModelFailed;
|
||||
//
|
||||
// curve brush extensions
|
||||
// all are derived from brush_faces
|
||||
qboolean patchBrush;
|
||||
qboolean hiddenBrush;
|
||||
qboolean terrainBrush;
|
||||
|
||||
//int nPatchID;
|
||||
|
||||
patchMesh_t *pPatch;
|
||||
terrainMesh_t *pTerrain;
|
||||
|
||||
struct entity_s *pUndoOwner;
|
||||
|
||||
int undoId; //undo ID
|
||||
int redoId; //redo ID
|
||||
int ownerId; //entityId of the owner entity for undo
|
||||
|
||||
// TTimo: HTREEITEM is MFC, some plugins really don't like it
|
||||
#ifdef QERTYPES_USE_MFC
|
||||
int numberId; // brush number
|
||||
HTREEITEM itemOwner; // owner for grouping
|
||||
#else
|
||||
int numberId;
|
||||
DWORD itemOwner;
|
||||
#endif
|
||||
|
||||
// brush primitive only
|
||||
epair_t *epairs;
|
||||
|
||||
} brush_t;
|
||||
|
||||
|
||||
#define MAX_FLAGS 8
|
||||
|
||||
|
||||
typedef struct trimodel_t
|
||||
{
|
||||
vec3_t v[3];
|
||||
float st[3][2];
|
||||
} trimodel;
|
||||
|
||||
typedef struct entitymodel_t
|
||||
{
|
||||
struct entitymodel_t *pNext;
|
||||
int nTriCount;
|
||||
trimodel *pTriList;
|
||||
int nTextureBind;
|
||||
int nSkinWidth;
|
||||
int nSkinHeight;
|
||||
int nModelPosition;
|
||||
} entitymodel;
|
||||
|
||||
|
||||
// eclass show flags
|
||||
|
||||
#define ECLASS_LIGHT 0x00000001
|
||||
#define ECLASS_ANGLE 0x00000002
|
||||
#define ECLASS_PATH 0x00000004
|
||||
#define ECLASS_MISCMODEL 0x00000008
|
||||
#define ECLASS_PLUGINENTITY 0x00000010
|
||||
|
||||
typedef struct eclass_s
|
||||
{
|
||||
struct eclass_s *next;
|
||||
char *name;
|
||||
qboolean fixedsize;
|
||||
qboolean unknown; // wasn't found in source
|
||||
vec3_t mins, maxs;
|
||||
vec3_t color;
|
||||
texdef_t texdef;
|
||||
char *comments;
|
||||
char flagnames[MAX_FLAGS][32];
|
||||
|
||||
/*
|
||||
int nTriCount;
|
||||
trimodel *pTriList;
|
||||
int nTextureBind;
|
||||
int nSkinWidth, nSkinHeight;
|
||||
*/
|
||||
entitymodel *model;
|
||||
char *modelpath;
|
||||
char *skinpath;
|
||||
int nFrame;
|
||||
unsigned int nShowFlags;
|
||||
|
||||
HMODULE hPlug;
|
||||
} eclass_t;
|
||||
|
||||
extern eclass_t *eclass;
|
||||
|
||||
/*
|
||||
** window bits
|
||||
*/
|
||||
#define W_CAMERA 0x0001
|
||||
#define W_XY 0x0002
|
||||
#define W_XY_OVERLAY 0x0004
|
||||
#define W_Z 0x0008
|
||||
#define W_TEXTURE 0x0010
|
||||
#define W_Z_OVERLAY 0x0020
|
||||
#define W_CONSOLE 0x0040
|
||||
#define W_ENTITY 0x0080
|
||||
#define W_CAMERA_IFON 0x0100
|
||||
#define W_XZ 0x0200 //--| only used for patch vertex manip stuff
|
||||
#define W_YZ 0x0400 //--|
|
||||
#define W_GROUP 0x0800
|
||||
#define W_MEDIA 0x1000
|
||||
#define W_ALL 0xFFFFFFFF
|
||||
|
||||
// used in some Drawing routines
|
||||
enum VIEWTYPE {YZ, XZ, XY};
|
||||
|
||||
enum terrainnoise_t { NOISE_NONE, NOISE_PLUS, NOISE_PLUSMINUS };
|
||||
enum terrainbrush_t { TERRAIN_BRUSH_CIRCLE, TERRAIN_BRUSH_SQUARE };
|
||||
enum terrainfalloff_t { TERRAIN_FALLOFF_LINEAR, TERRAIN_FALLOFF_CURVED };
|
||||
|
||||
#endif
|
||||
920
q3radiant/QFILES.H
Normal file → Executable file
920
q3radiant/QFILES.H
Normal file → Executable file
|
|
@ -19,463 +19,463 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
//
|
||||
// qfiles.h: quake file formats
|
||||
// This file must be identical in the quake and utils directories
|
||||
//
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
||||
.MD2 triangle model file format
|
||||
|
||||
========================================================================
|
||||
*/
|
||||
|
||||
#define IDALIASHEADER (('2'<<24)+('P'<<16)+('D'<<8)+'I')
|
||||
#define ALIAS_VERSION 8
|
||||
|
||||
#define MAX_TRIANGLES 4096
|
||||
#define MAX_VERTS 2048
|
||||
#define MAX_FRAMES 512
|
||||
#define MAX_MD2SKINS 32
|
||||
#define MAX_SKINNAME 64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short s;
|
||||
short t;
|
||||
} dstvert_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short index_xyz[3];
|
||||
short index_st[3];
|
||||
} dtriangle_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte v[3]; // scaled byte to fit in frame mins/maxs
|
||||
byte lightnormalindex;
|
||||
} dtrivertx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float scale[3]; // multiply byte verts by this
|
||||
float translate[3]; // then add this
|
||||
char name[16]; // frame name from grabbing
|
||||
dtrivertx_t verts[1]; // variable sized
|
||||
} daliasframe_t;
|
||||
|
||||
|
||||
// the glcmd format:
|
||||
// a positive integer starts a tristrip command, followed by that many
|
||||
// vertex structures.
|
||||
// a negative integer starts a trifan command, followed by -x vertexes
|
||||
// a zero indicates the end of the command list.
|
||||
// a vertex consists of a floating point s, a floating point t,
|
||||
// and an integer vertex index.
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident;
|
||||
int version;
|
||||
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
int framesize; // byte size of each frame
|
||||
|
||||
int num_skins;
|
||||
int num_xyz;
|
||||
int num_st; // greater than num_xyz for seams
|
||||
int num_tris;
|
||||
int num_glcmds; // dwords in strip/fan command list
|
||||
int num_frames;
|
||||
|
||||
int ofs_skins; // each skin is a MAX_SKINNAME string
|
||||
int ofs_st; // byte offset from start for stverts
|
||||
int ofs_tris; // offset for dtriangles
|
||||
int ofs_frames; // offset for first frame
|
||||
int ofs_glcmds;
|
||||
int ofs_end; // end of file
|
||||
|
||||
} dmdl_t;
|
||||
|
||||
#define MD3_IDENT (('3'<<24)+('P'<<16)+('D'<<8)+'I')
|
||||
#define MAX_QPATH 64 // max length of a quake game pathname
|
||||
#define MD3_XYZ_SCALE (1.0/64)
|
||||
|
||||
typedef struct {
|
||||
int ident;
|
||||
int version;
|
||||
|
||||
char name[MAX_QPATH]; // model name
|
||||
|
||||
int flags;
|
||||
|
||||
int numFrames;
|
||||
int numTags;
|
||||
int numSurfaces;
|
||||
|
||||
int numSkins;
|
||||
|
||||
int ofsFrames; // offset for first frame
|
||||
int ofsTags; // numFrames * numTags
|
||||
int ofsSurfaces; // first surface, others follow
|
||||
|
||||
int ofsEnd; // end of file
|
||||
} md3Header_t;
|
||||
|
||||
typedef struct {
|
||||
int ident; //
|
||||
|
||||
char name[MAX_QPATH]; // polyset name
|
||||
|
||||
int flags;
|
||||
int numFrames; // all surfaces in a model should have the same
|
||||
|
||||
int numShaders; // all surfaces in a model should have the same
|
||||
int numVerts;
|
||||
|
||||
int numTriangles;
|
||||
int ofsTriangles;
|
||||
|
||||
int ofsShaders; // offset from start of md3Surface_t
|
||||
int ofsSt; // texture coords are common for all frames
|
||||
int ofsXyzNormals; // numVerts * numFrames
|
||||
|
||||
int ofsEnd; // next surface follows
|
||||
|
||||
} md3Surface_t;
|
||||
|
||||
typedef struct {
|
||||
char name[MAX_QPATH];
|
||||
int shaderIndex; // for in-game use
|
||||
} md3Shader_t;
|
||||
|
||||
typedef struct {
|
||||
int indexes[3];
|
||||
} md3Triangle_t;
|
||||
|
||||
typedef struct {
|
||||
float st[2];
|
||||
} md3St_t;
|
||||
|
||||
typedef struct {
|
||||
short xyz[3];
|
||||
short normal;
|
||||
} md3XyzNormal_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float st[2];
|
||||
int nVertIndex;
|
||||
} glst_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nCount;
|
||||
int ObjectIndex;
|
||||
glst_t GlSt;
|
||||
} gl_t;
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
||||
.SP2 sprite file format
|
||||
|
||||
========================================================================
|
||||
*/
|
||||
|
||||
#define IDSPRITEHEADER (('2'<<24)+('S'<<16)+('D'<<8)+'I')
|
||||
// little-endian "IDS2"
|
||||
#define SPRITE_VERSION 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width, height;
|
||||
int origin_x, origin_y; // raster coordinates inside pic
|
||||
char name[MAX_SKINNAME]; // name of pcx file
|
||||
} dsprframe_t;
|
||||
|
||||
typedef struct {
|
||||
int ident;
|
||||
int version;
|
||||
int numframes;
|
||||
dsprframe_t frames[1]; // variable sized
|
||||
} dsprite_t;
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
.WAL texture file format
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
#define MIPLEVELS 4
|
||||
typedef struct miptex_s
|
||||
{
|
||||
char name[32];
|
||||
unsigned width, height;
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
char animname[32]; // next frame in animation chain
|
||||
int flags;
|
||||
int contents;
|
||||
int value;
|
||||
} miptex_t;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
.BSP file format
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#define IDBSPHEADER (('P'<<24)+('S'<<16)+('B'<<8)+'I')
|
||||
// little-endian "IBSP"
|
||||
|
||||
#define BSPVERSION 36
|
||||
|
||||
|
||||
// upper design bounds
|
||||
// leaffaces, leafbrushes, planes, and verts are still bounded by
|
||||
// 16 bit short limits
|
||||
#define MAX_MAP_MODELS 1024
|
||||
#define MAX_MAP_BRUSHES 8192
|
||||
#define MAX_MAP_ENTITIES 2048
|
||||
#define MAX_MAP_ENTSTRING 0x20000
|
||||
#define MAX_MAP_TEXINFO 8192
|
||||
|
||||
#define MAX_MAP_PLANES 65536
|
||||
#define MAX_MAP_NODES 65536
|
||||
#define MAX_MAP_BRUSHSIDES 65536
|
||||
#define MAX_MAP_LEAFS 65536
|
||||
#define MAX_MAP_VERTS 65536
|
||||
#define MAX_MAP_FACES 65536
|
||||
#define MAX_MAP_LEAFFACES 65536
|
||||
#define MAX_MAP_LEAFBRUSHES 65536
|
||||
#define MAX_MAP_PORTALS 65536
|
||||
#define MAX_MAP_EDGES 128000
|
||||
#define MAX_MAP_SURFEDGES 256000
|
||||
#define MAX_MAP_LIGHTING 0x200000
|
||||
#define MAX_MAP_VISIBILITY 0x100000
|
||||
|
||||
#define MAX_WORLD_COORD ( 128*1024 )
|
||||
#define MIN_WORLD_COORD ( -128*1024 )
|
||||
#define WORLD_SIZE ( MAX_WORLD_COORD - MIN_WORLD_COORD )
|
||||
|
||||
#define MAX_BRUSH_SIZE ( WORLD_SIZE )
|
||||
|
||||
// key / value pair sizes
|
||||
|
||||
#define MAX_KEY 32
|
||||
#define MAX_VALUE 1024
|
||||
|
||||
//=============================================================================
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int fileofs, filelen;
|
||||
} lump_t;
|
||||
|
||||
#define LUMP_ENTITIES 0
|
||||
#define LUMP_PLANES 1
|
||||
#define LUMP_VERTEXES 2
|
||||
#define LUMP_VISIBILITY 3
|
||||
#define LUMP_NODES 4
|
||||
#define LUMP_TEXINFO 5
|
||||
#define LUMP_FACES 6
|
||||
#define LUMP_LIGHTING 7
|
||||
#define LUMP_LEAFS 8
|
||||
#define LUMP_LEAFFACES 9
|
||||
#define LUMP_LEAFBRUSHES 10
|
||||
#define LUMP_EDGES 11
|
||||
#define LUMP_SURFEDGES 12
|
||||
#define LUMP_MODELS 13
|
||||
#define LUMP_BRUSHES 14
|
||||
#define LUMP_BRUSHSIDES 15
|
||||
#define LUMP_POP 16
|
||||
|
||||
#define HEADER_LUMPS 17
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident;
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
} dheader_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float mins[3], maxs[3];
|
||||
float origin[3]; // for sounds or lights
|
||||
int headnode;
|
||||
int firstface, numfaces; // submodels just draw faces
|
||||
// without walking the bsp tree
|
||||
} dmodel_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float point[3];
|
||||
} dvertex_t;
|
||||
|
||||
|
||||
// 0-2 are axial planes
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
|
||||
// 3-5 are non-axial planes snapped to the nearest
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
// planes (x&~1) and (x&~1)+1 are allways opposites
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate
|
||||
} dplane_t;
|
||||
|
||||
|
||||
// contents flags are seperate bits
|
||||
// a given brush can contribute multiple content bits
|
||||
// multiple brushes can be in a single leaf
|
||||
|
||||
// lower bits are stronger, and will eat weaker brushes completely
|
||||
#define CONTENTS_SOLID 1 // an eye is never valid in a solid
|
||||
#define CONTENTS_WINDOW 2 // translucent, but not watery
|
||||
#define CONTENTS_AUX 4
|
||||
#define CONTENTS_LAVA 8
|
||||
#define CONTENTS_SLIME 16
|
||||
#define CONTENTS_WATER 32
|
||||
#define CONTENTS_MIST 64
|
||||
#define LAST_VISIBLE_CONTENTS 64
|
||||
|
||||
// remaining contents are non-visible, and don't eat brushes
|
||||
#define CONTENTS_PLAYERCLIP 0x10000
|
||||
#define CONTENTS_MONSTERCLIP 0x20000
|
||||
|
||||
// currents can be added to any other contents, and may be mixed
|
||||
#define CONTENTS_CURRENT_0 0x40000
|
||||
#define CONTENTS_CURRENT_90 0x80000
|
||||
#define CONTENTS_CURRENT_180 0x100000
|
||||
#define CONTENTS_CURRENT_270 0x200000
|
||||
#define CONTENTS_CURRENT_UP 0x400000
|
||||
#define CONTENTS_CURRENT_DOWN 0x800000
|
||||
|
||||
#define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity
|
||||
|
||||
#define CONTENTS_MONSTER 0x2000000 // should never be on a brush, only in game
|
||||
#define CONTENTS_DEADMONSTER 0x4000000 // corpse
|
||||
#define CONTENTS_DETAIL 0x8000000 // brushes to be added after vis leafs
|
||||
#define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans
|
||||
#define CONTENTS_LADDER 0x20000000 // ladder
|
||||
#define CONTENTS_NEGATIVE_CURVE 0x40000000 // reverse inside / outside
|
||||
|
||||
#define CONTENTS_KEEP (CONTENTS_DETAIL | CONTENTS_NEGATIVE_CURVE)
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int planenum;
|
||||
int children[2]; // negative numbers are -(leafs+1), not nodes
|
||||
short mins[3]; // for frustom culling
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces; // counting both sides
|
||||
} dnode_t;
|
||||
|
||||
|
||||
typedef struct texinfo_s
|
||||
{
|
||||
float vecs[2][4]; // [s/t][xyz offset]
|
||||
int flags; // miptex flags + overrides
|
||||
int value; // light emission, etc
|
||||
char texture[32]; // texture name (textures/*.wal)
|
||||
int nexttexinfo; // for animations, -1 = end of chain
|
||||
} texinfo_t;
|
||||
|
||||
|
||||
#define SURF_LIGHT 0x1 // value will hold the light strength
|
||||
|
||||
#define SURF_SLICK 0x2 // effects game physics
|
||||
|
||||
#define SURF_SKY 0x4 // don't draw, but add to skybox
|
||||
#define SURF_WARP 0x8 // turbulent water warp
|
||||
#define SURF_TRANS33 0x10
|
||||
#define SURF_TRANS66 0x20
|
||||
#define SURF_FLOWING 0x40 // scroll towards angle
|
||||
#define SURF_NODRAW 0x80 // don't bother referencing the texture
|
||||
|
||||
#define SURF_PATCH 0x20000000
|
||||
#define SURF_CURVE_FAKE 0x40000000
|
||||
#define SURF_CURVE 0x80000000
|
||||
#define SURF_KEEP (SURF_CURVE | SURF_CURVE_FAKE | SURF_PATCH)
|
||||
|
||||
// note that edge 0 is never used, because negative edge nums are used for
|
||||
// counterclockwise use of the edge in a face
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2]; // vertex numbers
|
||||
} dedge_t;
|
||||
|
||||
#define MAXLIGHTMAPS 4
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum;
|
||||
short side;
|
||||
|
||||
int firstedge; // we must support > 64k edges
|
||||
short numedges;
|
||||
short texinfo;
|
||||
|
||||
// lighting info
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int lightofs; // start of [numstyles*surfsize] samples
|
||||
} dface_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int contents; // OR of all brushes (not needed?)
|
||||
|
||||
int pvsofs; // -1 = no info
|
||||
int phsofs; // -1 = no info
|
||||
|
||||
short mins[3]; // for frustum culling
|
||||
short maxs[3];
|
||||
|
||||
unsigned short firstleafface;
|
||||
unsigned short numleaffaces;
|
||||
|
||||
unsigned short firstleafbrush;
|
||||
unsigned short numleafbrushes;
|
||||
} dleaf_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum; // facing out of the leaf
|
||||
short texinfo;
|
||||
} dbrushside_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int firstside;
|
||||
int numsides;
|
||||
int contents;
|
||||
} dbrush_t;
|
||||
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
|
||||
|
||||
//
|
||||
// qfiles.h: quake file formats
|
||||
// This file must be identical in the quake and utils directories
|
||||
//
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
||||
.MD2 triangle model file format
|
||||
|
||||
========================================================================
|
||||
*/
|
||||
|
||||
#define IDALIASHEADER (('2'<<24)+('P'<<16)+('D'<<8)+'I')
|
||||
#define ALIAS_VERSION 8
|
||||
|
||||
#define MAX_TRIANGLES 4096
|
||||
#define MAX_VERTS 2048
|
||||
#define MAX_FRAMES 512
|
||||
#define MAX_MD2SKINS 32
|
||||
#define MAX_SKINNAME 64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short s;
|
||||
short t;
|
||||
} dstvert_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short index_xyz[3];
|
||||
short index_st[3];
|
||||
} dtriangle_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte v[3]; // scaled byte to fit in frame mins/maxs
|
||||
byte lightnormalindex;
|
||||
} dtrivertx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float scale[3]; // multiply byte verts by this
|
||||
float translate[3]; // then add this
|
||||
char name[16]; // frame name from grabbing
|
||||
dtrivertx_t verts[1]; // variable sized
|
||||
} daliasframe_t;
|
||||
|
||||
|
||||
// the glcmd format:
|
||||
// a positive integer starts a tristrip command, followed by that many
|
||||
// vertex structures.
|
||||
// a negative integer starts a trifan command, followed by -x vertexes
|
||||
// a zero indicates the end of the command list.
|
||||
// a vertex consists of a floating point s, a floating point t,
|
||||
// and an integer vertex index.
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident;
|
||||
int version;
|
||||
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
int framesize; // byte size of each frame
|
||||
|
||||
int num_skins;
|
||||
int num_xyz;
|
||||
int num_st; // greater than num_xyz for seams
|
||||
int num_tris;
|
||||
int num_glcmds; // dwords in strip/fan command list
|
||||
int num_frames;
|
||||
|
||||
int ofs_skins; // each skin is a MAX_SKINNAME string
|
||||
int ofs_st; // byte offset from start for stverts
|
||||
int ofs_tris; // offset for dtriangles
|
||||
int ofs_frames; // offset for first frame
|
||||
int ofs_glcmds;
|
||||
int ofs_end; // end of file
|
||||
|
||||
} dmdl_t;
|
||||
|
||||
#define MD3_IDENT (('3'<<24)+('P'<<16)+('D'<<8)+'I')
|
||||
#define MAX_QPATH 64 // max length of a quake game pathname
|
||||
#define MD3_XYZ_SCALE (1.0/64)
|
||||
|
||||
typedef struct {
|
||||
int ident;
|
||||
int version;
|
||||
|
||||
char name[MAX_QPATH]; // model name
|
||||
|
||||
int flags;
|
||||
|
||||
int numFrames;
|
||||
int numTags;
|
||||
int numSurfaces;
|
||||
|
||||
int numSkins;
|
||||
|
||||
int ofsFrames; // offset for first frame
|
||||
int ofsTags; // numFrames * numTags
|
||||
int ofsSurfaces; // first surface, others follow
|
||||
|
||||
int ofsEnd; // end of file
|
||||
} md3Header_t;
|
||||
|
||||
typedef struct {
|
||||
int ident; //
|
||||
|
||||
char name[MAX_QPATH]; // polyset name
|
||||
|
||||
int flags;
|
||||
int numFrames; // all surfaces in a model should have the same
|
||||
|
||||
int numShaders; // all surfaces in a model should have the same
|
||||
int numVerts;
|
||||
|
||||
int numTriangles;
|
||||
int ofsTriangles;
|
||||
|
||||
int ofsShaders; // offset from start of md3Surface_t
|
||||
int ofsSt; // texture coords are common for all frames
|
||||
int ofsXyzNormals; // numVerts * numFrames
|
||||
|
||||
int ofsEnd; // next surface follows
|
||||
|
||||
} md3Surface_t;
|
||||
|
||||
typedef struct {
|
||||
char name[MAX_QPATH];
|
||||
int shaderIndex; // for in-game use
|
||||
} md3Shader_t;
|
||||
|
||||
typedef struct {
|
||||
int indexes[3];
|
||||
} md3Triangle_t;
|
||||
|
||||
typedef struct {
|
||||
float st[2];
|
||||
} md3St_t;
|
||||
|
||||
typedef struct {
|
||||
short xyz[3];
|
||||
short normal;
|
||||
} md3XyzNormal_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float st[2];
|
||||
int nVertIndex;
|
||||
} glst_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nCount;
|
||||
int ObjectIndex;
|
||||
glst_t GlSt;
|
||||
} gl_t;
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
||||
.SP2 sprite file format
|
||||
|
||||
========================================================================
|
||||
*/
|
||||
|
||||
#define IDSPRITEHEADER (('2'<<24)+('S'<<16)+('D'<<8)+'I')
|
||||
// little-endian "IDS2"
|
||||
#define SPRITE_VERSION 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width, height;
|
||||
int origin_x, origin_y; // raster coordinates inside pic
|
||||
char name[MAX_SKINNAME]; // name of pcx file
|
||||
} dsprframe_t;
|
||||
|
||||
typedef struct {
|
||||
int ident;
|
||||
int version;
|
||||
int numframes;
|
||||
dsprframe_t frames[1]; // variable sized
|
||||
} dsprite_t;
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
.WAL texture file format
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
#define MIPLEVELS 4
|
||||
typedef struct miptex_s
|
||||
{
|
||||
char name[32];
|
||||
unsigned width, height;
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
char animname[32]; // next frame in animation chain
|
||||
int flags;
|
||||
int contents;
|
||||
int value;
|
||||
} miptex_t;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
.BSP file format
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#define IDBSPHEADER (('P'<<24)+('S'<<16)+('B'<<8)+'I')
|
||||
// little-endian "IBSP"
|
||||
|
||||
#define BSPVERSION 36
|
||||
|
||||
|
||||
// upper design bounds
|
||||
// leaffaces, leafbrushes, planes, and verts are still bounded by
|
||||
// 16 bit short limits
|
||||
#define MAX_MAP_MODELS 1024
|
||||
#define MAX_MAP_BRUSHES 8192
|
||||
#define MAX_MAP_ENTITIES 2048
|
||||
#define MAX_MAP_ENTSTRING 0x20000
|
||||
#define MAX_MAP_TEXINFO 8192
|
||||
|
||||
#define MAX_MAP_PLANES 65536
|
||||
#define MAX_MAP_NODES 65536
|
||||
#define MAX_MAP_BRUSHSIDES 65536
|
||||
#define MAX_MAP_LEAFS 65536
|
||||
#define MAX_MAP_VERTS 65536
|
||||
#define MAX_MAP_FACES 65536
|
||||
#define MAX_MAP_LEAFFACES 65536
|
||||
#define MAX_MAP_LEAFBRUSHES 65536
|
||||
#define MAX_MAP_PORTALS 65536
|
||||
#define MAX_MAP_EDGES 128000
|
||||
#define MAX_MAP_SURFEDGES 256000
|
||||
#define MAX_MAP_LIGHTING 0x200000
|
||||
#define MAX_MAP_VISIBILITY 0x100000
|
||||
|
||||
#define MAX_WORLD_COORD ( 128*1024 )
|
||||
#define MIN_WORLD_COORD ( -128*1024 )
|
||||
#define WORLD_SIZE ( MAX_WORLD_COORD - MIN_WORLD_COORD )
|
||||
|
||||
#define MAX_BRUSH_SIZE ( WORLD_SIZE )
|
||||
|
||||
// key / value pair sizes
|
||||
|
||||
#define MAX_KEY 32
|
||||
#define MAX_VALUE 1024
|
||||
|
||||
//=============================================================================
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int fileofs, filelen;
|
||||
} lump_t;
|
||||
|
||||
#define LUMP_ENTITIES 0
|
||||
#define LUMP_PLANES 1
|
||||
#define LUMP_VERTEXES 2
|
||||
#define LUMP_VISIBILITY 3
|
||||
#define LUMP_NODES 4
|
||||
#define LUMP_TEXINFO 5
|
||||
#define LUMP_FACES 6
|
||||
#define LUMP_LIGHTING 7
|
||||
#define LUMP_LEAFS 8
|
||||
#define LUMP_LEAFFACES 9
|
||||
#define LUMP_LEAFBRUSHES 10
|
||||
#define LUMP_EDGES 11
|
||||
#define LUMP_SURFEDGES 12
|
||||
#define LUMP_MODELS 13
|
||||
#define LUMP_BRUSHES 14
|
||||
#define LUMP_BRUSHSIDES 15
|
||||
#define LUMP_POP 16
|
||||
|
||||
#define HEADER_LUMPS 17
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident;
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
} dheader_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float mins[3], maxs[3];
|
||||
float origin[3]; // for sounds or lights
|
||||
int headnode;
|
||||
int firstface, numfaces; // submodels just draw faces
|
||||
// without walking the bsp tree
|
||||
} dmodel_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float point[3];
|
||||
} dvertex_t;
|
||||
|
||||
|
||||
// 0-2 are axial planes
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
|
||||
// 3-5 are non-axial planes snapped to the nearest
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
// planes (x&~1) and (x&~1)+1 are allways opposites
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate
|
||||
} dplane_t;
|
||||
|
||||
|
||||
// contents flags are seperate bits
|
||||
// a given brush can contribute multiple content bits
|
||||
// multiple brushes can be in a single leaf
|
||||
|
||||
// lower bits are stronger, and will eat weaker brushes completely
|
||||
#define CONTENTS_SOLID 1 // an eye is never valid in a solid
|
||||
#define CONTENTS_WINDOW 2 // translucent, but not watery
|
||||
#define CONTENTS_AUX 4
|
||||
#define CONTENTS_LAVA 8
|
||||
#define CONTENTS_SLIME 16
|
||||
#define CONTENTS_WATER 32
|
||||
#define CONTENTS_MIST 64
|
||||
#define LAST_VISIBLE_CONTENTS 64
|
||||
|
||||
// remaining contents are non-visible, and don't eat brushes
|
||||
#define CONTENTS_PLAYERCLIP 0x10000
|
||||
#define CONTENTS_MONSTERCLIP 0x20000
|
||||
|
||||
// currents can be added to any other contents, and may be mixed
|
||||
#define CONTENTS_CURRENT_0 0x40000
|
||||
#define CONTENTS_CURRENT_90 0x80000
|
||||
#define CONTENTS_CURRENT_180 0x100000
|
||||
#define CONTENTS_CURRENT_270 0x200000
|
||||
#define CONTENTS_CURRENT_UP 0x400000
|
||||
#define CONTENTS_CURRENT_DOWN 0x800000
|
||||
|
||||
#define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity
|
||||
|
||||
#define CONTENTS_MONSTER 0x2000000 // should never be on a brush, only in game
|
||||
#define CONTENTS_DEADMONSTER 0x4000000 // corpse
|
||||
#define CONTENTS_DETAIL 0x8000000 // brushes to be added after vis leafs
|
||||
#define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans
|
||||
#define CONTENTS_LADDER 0x20000000 // ladder
|
||||
#define CONTENTS_NEGATIVE_CURVE 0x40000000 // reverse inside / outside
|
||||
|
||||
#define CONTENTS_KEEP (CONTENTS_DETAIL | CONTENTS_NEGATIVE_CURVE)
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int planenum;
|
||||
int children[2]; // negative numbers are -(leafs+1), not nodes
|
||||
short mins[3]; // for frustom culling
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces; // counting both sides
|
||||
} dnode_t;
|
||||
|
||||
|
||||
typedef struct texinfo_s
|
||||
{
|
||||
float vecs[2][4]; // [s/t][xyz offset]
|
||||
int flags; // miptex flags + overrides
|
||||
int value; // light emission, etc
|
||||
char texture[32]; // texture name (textures/*.wal)
|
||||
int nexttexinfo; // for animations, -1 = end of chain
|
||||
} texinfo_t;
|
||||
|
||||
|
||||
#define SURF_LIGHT 0x1 // value will hold the light strength
|
||||
|
||||
#define SURF_SLICK 0x2 // effects game physics
|
||||
|
||||
#define SURF_SKY 0x4 // don't draw, but add to skybox
|
||||
#define SURF_WARP 0x8 // turbulent water warp
|
||||
#define SURF_TRANS33 0x10
|
||||
#define SURF_TRANS66 0x20
|
||||
#define SURF_FLOWING 0x40 // scroll towards angle
|
||||
#define SURF_NODRAW 0x80 // don't bother referencing the texture
|
||||
|
||||
#define SURF_PATCH 0x20000000
|
||||
#define SURF_CURVE_FAKE 0x40000000
|
||||
#define SURF_CURVE 0x80000000
|
||||
#define SURF_KEEP (SURF_CURVE | SURF_CURVE_FAKE | SURF_PATCH)
|
||||
|
||||
// note that edge 0 is never used, because negative edge nums are used for
|
||||
// counterclockwise use of the edge in a face
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2]; // vertex numbers
|
||||
} dedge_t;
|
||||
|
||||
#define MAXLIGHTMAPS 4
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum;
|
||||
short side;
|
||||
|
||||
int firstedge; // we must support > 64k edges
|
||||
short numedges;
|
||||
short texinfo;
|
||||
|
||||
// lighting info
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int lightofs; // start of [numstyles*surfsize] samples
|
||||
} dface_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int contents; // OR of all brushes (not needed?)
|
||||
|
||||
int pvsofs; // -1 = no info
|
||||
int phsofs; // -1 = no info
|
||||
|
||||
short mins[3]; // for frustum culling
|
||||
short maxs[3];
|
||||
|
||||
unsigned short firstleafface;
|
||||
unsigned short numleaffaces;
|
||||
|
||||
unsigned short firstleafbrush;
|
||||
unsigned short numleafbrushes;
|
||||
} dleaf_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum; // facing out of the leaf
|
||||
short texinfo;
|
||||
} dbrushside_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int firstside;
|
||||
int numsides;
|
||||
int contents;
|
||||
} dbrush_t;
|
||||
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
|
||||
|
|
|
|||
870
q3radiant/QGL.H
Normal file → Executable file
870
q3radiant/QGL.H
Normal file → Executable file
|
|
@ -19,438 +19,438 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
/*
|
||||
** QGL.H
|
||||
*/
|
||||
|
||||
#ifndef __QGL_H__
|
||||
#define __QGL_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <gl/gl.h>
|
||||
#include <gl/glu.h>
|
||||
|
||||
int QGL_Init( const char *dllname, const char* pGluName );
|
||||
void QGL_Shutdown();
|
||||
|
||||
#ifndef APIENTRY
|
||||
# define APIENTRY
|
||||
#endif
|
||||
|
||||
extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
|
||||
extern void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref);
|
||||
extern GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences);
|
||||
extern void ( APIENTRY * qglArrayElement )(GLint i);
|
||||
extern void ( APIENTRY * qglBegin )(GLenum mode);
|
||||
extern void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture);
|
||||
extern void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
|
||||
extern void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor);
|
||||
extern void ( APIENTRY * qglCallList )(GLuint list);
|
||||
extern void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists);
|
||||
extern void ( APIENTRY * qglClear )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
extern void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
extern void ( APIENTRY * qglClearDepth )(GLclampd depth);
|
||||
extern void ( APIENTRY * qglClearIndex )(GLfloat c);
|
||||
extern void ( APIENTRY * qglClearStencil )(GLint s);
|
||||
extern void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation);
|
||||
extern void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue);
|
||||
extern void ( APIENTRY * qglColor3bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue);
|
||||
extern void ( APIENTRY * qglColor3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue);
|
||||
extern void ( APIENTRY * qglColor3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue);
|
||||
extern void ( APIENTRY * qglColor3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue);
|
||||
extern void ( APIENTRY * qglColor3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue);
|
||||
extern void ( APIENTRY * qglColor3ubv )(const GLubyte *v);
|
||||
extern void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue);
|
||||
extern void ( APIENTRY * qglColor3uiv )(const GLuint *v);
|
||||
extern void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue);
|
||||
extern void ( APIENTRY * qglColor3usv )(const GLushort *v);
|
||||
extern void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
|
||||
extern void ( APIENTRY * qglColor4bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
|
||||
extern void ( APIENTRY * qglColor4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
extern void ( APIENTRY * qglColor4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha);
|
||||
extern void ( APIENTRY * qglColor4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha);
|
||||
extern void ( APIENTRY * qglColor4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
extern void ( APIENTRY * qglColor4ubv )(const GLubyte *v);
|
||||
extern void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha);
|
||||
extern void ( APIENTRY * qglColor4uiv )(const GLuint *v);
|
||||
extern void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha);
|
||||
extern void ( APIENTRY * qglColor4usv )(const GLushort *v);
|
||||
extern void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
extern void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode);
|
||||
extern void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
extern void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
extern void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
extern void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
extern void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void ( APIENTRY * qglCullFace )(GLenum mode);
|
||||
extern void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range);
|
||||
extern void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures);
|
||||
extern void ( APIENTRY * qglDepthFunc )(GLenum func);
|
||||
extern void ( APIENTRY * qglDepthMask )(GLboolean flag);
|
||||
extern void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar);
|
||||
extern void ( APIENTRY * qglDisable )(GLenum cap);
|
||||
extern void ( APIENTRY * qglDisableClientState )(GLenum array);
|
||||
extern void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count);
|
||||
extern void ( APIENTRY * qglDrawBuffer )(GLenum mode);
|
||||
extern void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
extern void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglEdgeFlag )(GLboolean flag);
|
||||
extern void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag);
|
||||
extern void ( APIENTRY * qglEnable )(GLenum cap);
|
||||
extern void ( APIENTRY * qglEnableClientState )(GLenum array);
|
||||
extern void ( APIENTRY * qglEnd )(void);
|
||||
extern void ( APIENTRY * qglEndList )(void);
|
||||
extern void ( APIENTRY * qglEvalCoord1d )(GLdouble u);
|
||||
extern void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u);
|
||||
extern void ( APIENTRY * qglEvalCoord1f )(GLfloat u);
|
||||
extern void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u);
|
||||
extern void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v);
|
||||
extern void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u);
|
||||
extern void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v);
|
||||
extern void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u);
|
||||
extern void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2);
|
||||
extern void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
extern void ( APIENTRY * qglEvalPoint1 )(GLint i);
|
||||
extern void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j);
|
||||
extern void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer);
|
||||
extern void ( APIENTRY * qglFinish )(void);
|
||||
extern void ( APIENTRY * qglFlush )(void);
|
||||
extern void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglFogi )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglFrontFace )(GLenum mode);
|
||||
extern void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
extern GLuint ( APIENTRY * qglGenLists )(GLsizei range);
|
||||
extern void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures);
|
||||
extern void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params);
|
||||
extern void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation);
|
||||
extern void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params);
|
||||
extern GLenum ( APIENTRY * qglGetError )(void);
|
||||
extern void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v);
|
||||
extern void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v);
|
||||
extern void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v);
|
||||
extern void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values);
|
||||
extern void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values);
|
||||
extern void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values);
|
||||
extern void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params);
|
||||
extern void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask);
|
||||
extern const GLubyte * ( APIENTRY * qglGetString )(GLenum name);
|
||||
extern void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params);
|
||||
extern void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglHint )(GLenum target, GLenum mode);
|
||||
extern void ( APIENTRY * qglIndexMask )(GLuint mask);
|
||||
extern void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglIndexd )(GLdouble c);
|
||||
extern void ( APIENTRY * qglIndexdv )(const GLdouble *c);
|
||||
extern void ( APIENTRY * qglIndexf )(GLfloat c);
|
||||
extern void ( APIENTRY * qglIndexfv )(const GLfloat *c);
|
||||
extern void ( APIENTRY * qglIndexi )(GLint c);
|
||||
extern void ( APIENTRY * qglIndexiv )(const GLint *c);
|
||||
extern void ( APIENTRY * qglIndexs )(GLshort c);
|
||||
extern void ( APIENTRY * qglIndexsv )(const GLshort *c);
|
||||
extern void ( APIENTRY * qglIndexub )(GLubyte c);
|
||||
extern void ( APIENTRY * qglIndexubv )(const GLubyte *c);
|
||||
extern void ( APIENTRY * qglInitNames )(void);
|
||||
extern void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer);
|
||||
extern GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap);
|
||||
extern GLboolean ( APIENTRY * qglIsList )(GLuint list);
|
||||
extern GLboolean ( APIENTRY * qglIsTexture )(GLuint texture);
|
||||
extern void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern);
|
||||
extern void ( APIENTRY * qglLineWidth )(GLfloat width);
|
||||
extern void ( APIENTRY * qglListBase )(GLuint base);
|
||||
extern void ( APIENTRY * qglLoadIdentity )(void);
|
||||
extern void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m);
|
||||
extern void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m);
|
||||
extern void ( APIENTRY * qglLoadName )(GLuint name);
|
||||
extern void ( APIENTRY * qglLogicOp )(GLenum opcode);
|
||||
extern void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
|
||||
extern void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
|
||||
extern void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
|
||||
extern void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
|
||||
extern void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2);
|
||||
extern void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2);
|
||||
extern void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
extern void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
extern void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglMatrixMode )(GLenum mode);
|
||||
extern void ( APIENTRY * qglMultMatrixd )(const GLdouble *m);
|
||||
extern void ( APIENTRY * qglMultMatrixf )(const GLfloat *m);
|
||||
extern void ( APIENTRY * qglNewList )(GLuint list, GLenum mode);
|
||||
extern void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz);
|
||||
extern void ( APIENTRY * qglNormal3bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz);
|
||||
extern void ( APIENTRY * qglNormal3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
extern void ( APIENTRY * qglNormal3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz);
|
||||
extern void ( APIENTRY * qglNormal3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz);
|
||||
extern void ( APIENTRY * qglNormal3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
extern void ( APIENTRY * qglPassThrough )(GLfloat token);
|
||||
extern void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values);
|
||||
extern void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values);
|
||||
extern void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values);
|
||||
extern void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor);
|
||||
extern void ( APIENTRY * qglPointSize )(GLfloat size);
|
||||
extern void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode);
|
||||
extern void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units);
|
||||
extern void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask);
|
||||
extern void ( APIENTRY * qglPopAttrib )(void);
|
||||
extern void ( APIENTRY * qglPopClientAttrib )(void);
|
||||
extern void ( APIENTRY * qglPopMatrix )(void);
|
||||
extern void ( APIENTRY * qglPopName )(void);
|
||||
extern void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities);
|
||||
extern void ( APIENTRY * qglPushAttrib )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglPushMatrix )(void);
|
||||
extern void ( APIENTRY * qglPushName )(GLuint name);
|
||||
extern void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y);
|
||||
extern void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y);
|
||||
extern void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y);
|
||||
extern void ( APIENTRY * qglRasterPos2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y);
|
||||
extern void ( APIENTRY * qglRasterPos2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z);
|
||||
extern void ( APIENTRY * qglRasterPos3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z);
|
||||
extern void ( APIENTRY * qglRasterPos3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
extern void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
extern void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w);
|
||||
extern void ( APIENTRY * qglRasterPos4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
extern void ( APIENTRY * qglRasterPos4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglReadBuffer )(GLenum mode);
|
||||
extern void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
|
||||
extern void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2);
|
||||
extern void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
extern void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2);
|
||||
extern void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2);
|
||||
extern void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2);
|
||||
extern void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
|
||||
extern void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2);
|
||||
extern GLint ( APIENTRY * qglRenderMode )(GLenum mode);
|
||||
extern void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer);
|
||||
extern void ( APIENTRY * qglShadeModel )(GLenum mode);
|
||||
extern void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask);
|
||||
extern void ( APIENTRY * qglStencilMask )(GLuint mask);
|
||||
extern void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
extern void ( APIENTRY * qglTexCoord1d )(GLdouble s);
|
||||
extern void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord1f )(GLfloat s);
|
||||
extern void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord1i )(GLint s);
|
||||
extern void ( APIENTRY * qglTexCoord1iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord1s )(GLshort s);
|
||||
extern void ( APIENTRY * qglTexCoord1sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t);
|
||||
extern void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t);
|
||||
extern void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t);
|
||||
extern void ( APIENTRY * qglTexCoord2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t);
|
||||
extern void ( APIENTRY * qglTexCoord2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r);
|
||||
extern void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r);
|
||||
extern void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r);
|
||||
extern void ( APIENTRY * qglTexCoord3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r);
|
||||
extern void ( APIENTRY * qglTexCoord3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
|
||||
extern void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
extern void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q);
|
||||
extern void ( APIENTRY * qglTexCoord4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q);
|
||||
extern void ( APIENTRY * qglTexCoord4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param);
|
||||
extern void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params);
|
||||
extern void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y);
|
||||
extern void ( APIENTRY * qglVertex2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y);
|
||||
extern void ( APIENTRY * qglVertex2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex2i )(GLint x, GLint y);
|
||||
extern void ( APIENTRY * qglVertex2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y);
|
||||
extern void ( APIENTRY * qglVertex2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglVertex3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglVertex3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z);
|
||||
extern void ( APIENTRY * qglVertex3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z);
|
||||
extern void ( APIENTRY * qglVertex3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
extern void ( APIENTRY * qglVertex4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
extern void ( APIENTRY * qglVertex4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w);
|
||||
extern void ( APIENTRY * qglVertex4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
extern void ( APIENTRY * qglVertex4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
extern void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value );
|
||||
extern void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value );
|
||||
extern void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * );
|
||||
|
||||
extern void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat );
|
||||
extern void ( APIENTRY * qglSelectTextureSGIS)( GLenum );
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
extern int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglGetPixelFormat)(HDC);
|
||||
extern BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern BOOL ( WINAPI * qwglSwapBuffers)(HDC);
|
||||
|
||||
extern BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT);
|
||||
extern HGLRC ( WINAPI * qwglCreateContext)(HDC);
|
||||
extern HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int);
|
||||
extern BOOL ( WINAPI * qwglDeleteContext)(HGLRC);
|
||||
extern HGLRC ( WINAPI * qwglGetCurrentContext)(VOID);
|
||||
extern HDC ( WINAPI * qwglGetCurrentDC)(VOID);
|
||||
extern PROC ( WINAPI * qwglGetProcAddress)(LPCSTR);
|
||||
extern BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD);
|
||||
|
||||
extern BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT,
|
||||
FLOAT, int, LPGLYPHMETRICSFLOAT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT,
|
||||
LPLAYERPLANEDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int,
|
||||
CONST COLORREF *);
|
||||
extern int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int,
|
||||
COLORREF *);
|
||||
extern BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL);
|
||||
extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval );
|
||||
|
||||
extern BOOL ( WINAPI * qwglGetDeviceGammaRampEXT ) ( unsigned char *pRed, unsigned char *pGreen, unsigned char *pBlue );
|
||||
extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, const unsigned char *pGreen, const unsigned char *pBlue );
|
||||
|
||||
#endif
|
||||
|
||||
// glu stuff.. radiant only uses a couple
|
||||
extern int (APIENTRY* qgluBuild2DMipmaps) (GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data);
|
||||
extern void (APIENTRY* qgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
extern void (APIENTRY* qgluLookAt)(
|
||||
GLdouble eyex,
|
||||
GLdouble eyey,
|
||||
GLdouble eyez,
|
||||
GLdouble centerx,
|
||||
GLdouble centery,
|
||||
GLdouble centerz,
|
||||
GLdouble upx,
|
||||
GLdouble upy,
|
||||
GLdouble upz);
|
||||
|
||||
|
||||
// end of glu stuff
|
||||
|
||||
|
||||
/*
|
||||
** extension constants
|
||||
*/
|
||||
#define GL_POINT_SIZE_MIN_EXT 0x8126
|
||||
#define GL_POINT_SIZE_MAX_EXT 0x8127
|
||||
#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
|
||||
#define GL_DISTANCE_ATTENUATION_EXT 0x8129
|
||||
|
||||
#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
|
||||
|
||||
#define GL_TEXTURE0_SGIS 0x835E
|
||||
#define GL_TEXTURE1_SGIS 0x835F
|
||||
|
||||
#endif
|
||||
/*
|
||||
** QGL.H
|
||||
*/
|
||||
|
||||
#ifndef __QGL_H__
|
||||
#define __QGL_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <gl/gl.h>
|
||||
#include <gl/glu.h>
|
||||
|
||||
int QGL_Init( const char *dllname, const char* pGluName );
|
||||
void QGL_Shutdown();
|
||||
|
||||
#ifndef APIENTRY
|
||||
# define APIENTRY
|
||||
#endif
|
||||
|
||||
extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
|
||||
extern void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref);
|
||||
extern GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences);
|
||||
extern void ( APIENTRY * qglArrayElement )(GLint i);
|
||||
extern void ( APIENTRY * qglBegin )(GLenum mode);
|
||||
extern void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture);
|
||||
extern void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
|
||||
extern void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor);
|
||||
extern void ( APIENTRY * qglCallList )(GLuint list);
|
||||
extern void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists);
|
||||
extern void ( APIENTRY * qglClear )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
extern void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
extern void ( APIENTRY * qglClearDepth )(GLclampd depth);
|
||||
extern void ( APIENTRY * qglClearIndex )(GLfloat c);
|
||||
extern void ( APIENTRY * qglClearStencil )(GLint s);
|
||||
extern void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation);
|
||||
extern void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue);
|
||||
extern void ( APIENTRY * qglColor3bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue);
|
||||
extern void ( APIENTRY * qglColor3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue);
|
||||
extern void ( APIENTRY * qglColor3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue);
|
||||
extern void ( APIENTRY * qglColor3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue);
|
||||
extern void ( APIENTRY * qglColor3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue);
|
||||
extern void ( APIENTRY * qglColor3ubv )(const GLubyte *v);
|
||||
extern void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue);
|
||||
extern void ( APIENTRY * qglColor3uiv )(const GLuint *v);
|
||||
extern void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue);
|
||||
extern void ( APIENTRY * qglColor3usv )(const GLushort *v);
|
||||
extern void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
|
||||
extern void ( APIENTRY * qglColor4bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
|
||||
extern void ( APIENTRY * qglColor4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
extern void ( APIENTRY * qglColor4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha);
|
||||
extern void ( APIENTRY * qglColor4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha);
|
||||
extern void ( APIENTRY * qglColor4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
extern void ( APIENTRY * qglColor4ubv )(const GLubyte *v);
|
||||
extern void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha);
|
||||
extern void ( APIENTRY * qglColor4uiv )(const GLuint *v);
|
||||
extern void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha);
|
||||
extern void ( APIENTRY * qglColor4usv )(const GLushort *v);
|
||||
extern void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
extern void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode);
|
||||
extern void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
extern void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
extern void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
extern void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
extern void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void ( APIENTRY * qglCullFace )(GLenum mode);
|
||||
extern void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range);
|
||||
extern void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures);
|
||||
extern void ( APIENTRY * qglDepthFunc )(GLenum func);
|
||||
extern void ( APIENTRY * qglDepthMask )(GLboolean flag);
|
||||
extern void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar);
|
||||
extern void ( APIENTRY * qglDisable )(GLenum cap);
|
||||
extern void ( APIENTRY * qglDisableClientState )(GLenum array);
|
||||
extern void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count);
|
||||
extern void ( APIENTRY * qglDrawBuffer )(GLenum mode);
|
||||
extern void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
extern void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglEdgeFlag )(GLboolean flag);
|
||||
extern void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag);
|
||||
extern void ( APIENTRY * qglEnable )(GLenum cap);
|
||||
extern void ( APIENTRY * qglEnableClientState )(GLenum array);
|
||||
extern void ( APIENTRY * qglEnd )(void);
|
||||
extern void ( APIENTRY * qglEndList )(void);
|
||||
extern void ( APIENTRY * qglEvalCoord1d )(GLdouble u);
|
||||
extern void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u);
|
||||
extern void ( APIENTRY * qglEvalCoord1f )(GLfloat u);
|
||||
extern void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u);
|
||||
extern void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v);
|
||||
extern void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u);
|
||||
extern void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v);
|
||||
extern void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u);
|
||||
extern void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2);
|
||||
extern void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
extern void ( APIENTRY * qglEvalPoint1 )(GLint i);
|
||||
extern void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j);
|
||||
extern void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer);
|
||||
extern void ( APIENTRY * qglFinish )(void);
|
||||
extern void ( APIENTRY * qglFlush )(void);
|
||||
extern void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglFogi )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglFrontFace )(GLenum mode);
|
||||
extern void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
extern GLuint ( APIENTRY * qglGenLists )(GLsizei range);
|
||||
extern void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures);
|
||||
extern void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params);
|
||||
extern void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation);
|
||||
extern void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params);
|
||||
extern GLenum ( APIENTRY * qglGetError )(void);
|
||||
extern void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v);
|
||||
extern void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v);
|
||||
extern void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v);
|
||||
extern void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values);
|
||||
extern void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values);
|
||||
extern void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values);
|
||||
extern void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params);
|
||||
extern void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask);
|
||||
extern const GLubyte * ( APIENTRY * qglGetString )(GLenum name);
|
||||
extern void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params);
|
||||
extern void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglHint )(GLenum target, GLenum mode);
|
||||
extern void ( APIENTRY * qglIndexMask )(GLuint mask);
|
||||
extern void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglIndexd )(GLdouble c);
|
||||
extern void ( APIENTRY * qglIndexdv )(const GLdouble *c);
|
||||
extern void ( APIENTRY * qglIndexf )(GLfloat c);
|
||||
extern void ( APIENTRY * qglIndexfv )(const GLfloat *c);
|
||||
extern void ( APIENTRY * qglIndexi )(GLint c);
|
||||
extern void ( APIENTRY * qglIndexiv )(const GLint *c);
|
||||
extern void ( APIENTRY * qglIndexs )(GLshort c);
|
||||
extern void ( APIENTRY * qglIndexsv )(const GLshort *c);
|
||||
extern void ( APIENTRY * qglIndexub )(GLubyte c);
|
||||
extern void ( APIENTRY * qglIndexubv )(const GLubyte *c);
|
||||
extern void ( APIENTRY * qglInitNames )(void);
|
||||
extern void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer);
|
||||
extern GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap);
|
||||
extern GLboolean ( APIENTRY * qglIsList )(GLuint list);
|
||||
extern GLboolean ( APIENTRY * qglIsTexture )(GLuint texture);
|
||||
extern void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern);
|
||||
extern void ( APIENTRY * qglLineWidth )(GLfloat width);
|
||||
extern void ( APIENTRY * qglListBase )(GLuint base);
|
||||
extern void ( APIENTRY * qglLoadIdentity )(void);
|
||||
extern void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m);
|
||||
extern void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m);
|
||||
extern void ( APIENTRY * qglLoadName )(GLuint name);
|
||||
extern void ( APIENTRY * qglLogicOp )(GLenum opcode);
|
||||
extern void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
|
||||
extern void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
|
||||
extern void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
|
||||
extern void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
|
||||
extern void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2);
|
||||
extern void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2);
|
||||
extern void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
extern void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
extern void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglMatrixMode )(GLenum mode);
|
||||
extern void ( APIENTRY * qglMultMatrixd )(const GLdouble *m);
|
||||
extern void ( APIENTRY * qglMultMatrixf )(const GLfloat *m);
|
||||
extern void ( APIENTRY * qglNewList )(GLuint list, GLenum mode);
|
||||
extern void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz);
|
||||
extern void ( APIENTRY * qglNormal3bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz);
|
||||
extern void ( APIENTRY * qglNormal3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
extern void ( APIENTRY * qglNormal3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz);
|
||||
extern void ( APIENTRY * qglNormal3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz);
|
||||
extern void ( APIENTRY * qglNormal3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
extern void ( APIENTRY * qglPassThrough )(GLfloat token);
|
||||
extern void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values);
|
||||
extern void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values);
|
||||
extern void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values);
|
||||
extern void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor);
|
||||
extern void ( APIENTRY * qglPointSize )(GLfloat size);
|
||||
extern void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode);
|
||||
extern void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units);
|
||||
extern void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask);
|
||||
extern void ( APIENTRY * qglPopAttrib )(void);
|
||||
extern void ( APIENTRY * qglPopClientAttrib )(void);
|
||||
extern void ( APIENTRY * qglPopMatrix )(void);
|
||||
extern void ( APIENTRY * qglPopName )(void);
|
||||
extern void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities);
|
||||
extern void ( APIENTRY * qglPushAttrib )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglPushMatrix )(void);
|
||||
extern void ( APIENTRY * qglPushName )(GLuint name);
|
||||
extern void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y);
|
||||
extern void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y);
|
||||
extern void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y);
|
||||
extern void ( APIENTRY * qglRasterPos2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y);
|
||||
extern void ( APIENTRY * qglRasterPos2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z);
|
||||
extern void ( APIENTRY * qglRasterPos3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z);
|
||||
extern void ( APIENTRY * qglRasterPos3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
extern void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
extern void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w);
|
||||
extern void ( APIENTRY * qglRasterPos4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
extern void ( APIENTRY * qglRasterPos4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglReadBuffer )(GLenum mode);
|
||||
extern void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
|
||||
extern void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2);
|
||||
extern void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
extern void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2);
|
||||
extern void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2);
|
||||
extern void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2);
|
||||
extern void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
|
||||
extern void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2);
|
||||
extern GLint ( APIENTRY * qglRenderMode )(GLenum mode);
|
||||
extern void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer);
|
||||
extern void ( APIENTRY * qglShadeModel )(GLenum mode);
|
||||
extern void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask);
|
||||
extern void ( APIENTRY * qglStencilMask )(GLuint mask);
|
||||
extern void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
extern void ( APIENTRY * qglTexCoord1d )(GLdouble s);
|
||||
extern void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord1f )(GLfloat s);
|
||||
extern void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord1i )(GLint s);
|
||||
extern void ( APIENTRY * qglTexCoord1iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord1s )(GLshort s);
|
||||
extern void ( APIENTRY * qglTexCoord1sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t);
|
||||
extern void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t);
|
||||
extern void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t);
|
||||
extern void ( APIENTRY * qglTexCoord2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t);
|
||||
extern void ( APIENTRY * qglTexCoord2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r);
|
||||
extern void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r);
|
||||
extern void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r);
|
||||
extern void ( APIENTRY * qglTexCoord3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r);
|
||||
extern void ( APIENTRY * qglTexCoord3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
|
||||
extern void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
extern void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q);
|
||||
extern void ( APIENTRY * qglTexCoord4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q);
|
||||
extern void ( APIENTRY * qglTexCoord4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param);
|
||||
extern void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params);
|
||||
extern void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y);
|
||||
extern void ( APIENTRY * qglVertex2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y);
|
||||
extern void ( APIENTRY * qglVertex2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex2i )(GLint x, GLint y);
|
||||
extern void ( APIENTRY * qglVertex2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y);
|
||||
extern void ( APIENTRY * qglVertex2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglVertex3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglVertex3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z);
|
||||
extern void ( APIENTRY * qglVertex3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z);
|
||||
extern void ( APIENTRY * qglVertex3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
extern void ( APIENTRY * qglVertex4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
extern void ( APIENTRY * qglVertex4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w);
|
||||
extern void ( APIENTRY * qglVertex4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
extern void ( APIENTRY * qglVertex4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
extern void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value );
|
||||
extern void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value );
|
||||
extern void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * );
|
||||
|
||||
extern void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat );
|
||||
extern void ( APIENTRY * qglSelectTextureSGIS)( GLenum );
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
extern int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglGetPixelFormat)(HDC);
|
||||
extern BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern BOOL ( WINAPI * qwglSwapBuffers)(HDC);
|
||||
|
||||
extern BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT);
|
||||
extern HGLRC ( WINAPI * qwglCreateContext)(HDC);
|
||||
extern HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int);
|
||||
extern BOOL ( WINAPI * qwglDeleteContext)(HGLRC);
|
||||
extern HGLRC ( WINAPI * qwglGetCurrentContext)(VOID);
|
||||
extern HDC ( WINAPI * qwglGetCurrentDC)(VOID);
|
||||
extern PROC ( WINAPI * qwglGetProcAddress)(LPCSTR);
|
||||
extern BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD);
|
||||
|
||||
extern BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT,
|
||||
FLOAT, int, LPGLYPHMETRICSFLOAT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT,
|
||||
LPLAYERPLANEDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int,
|
||||
CONST COLORREF *);
|
||||
extern int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int,
|
||||
COLORREF *);
|
||||
extern BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL);
|
||||
extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval );
|
||||
|
||||
extern BOOL ( WINAPI * qwglGetDeviceGammaRampEXT ) ( unsigned char *pRed, unsigned char *pGreen, unsigned char *pBlue );
|
||||
extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, const unsigned char *pGreen, const unsigned char *pBlue );
|
||||
|
||||
#endif
|
||||
|
||||
// glu stuff.. radiant only uses a couple
|
||||
extern int (APIENTRY* qgluBuild2DMipmaps) (GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data);
|
||||
extern void (APIENTRY* qgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
extern void (APIENTRY* qgluLookAt)(
|
||||
GLdouble eyex,
|
||||
GLdouble eyey,
|
||||
GLdouble eyez,
|
||||
GLdouble centerx,
|
||||
GLdouble centery,
|
||||
GLdouble centerz,
|
||||
GLdouble upx,
|
||||
GLdouble upy,
|
||||
GLdouble upz);
|
||||
|
||||
|
||||
// end of glu stuff
|
||||
|
||||
|
||||
/*
|
||||
** extension constants
|
||||
*/
|
||||
#define GL_POINT_SIZE_MIN_EXT 0x8126
|
||||
#define GL_POINT_SIZE_MAX_EXT 0x8127
|
||||
#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
|
||||
#define GL_DISTANCE_ATTENUATION_EXT 0x8129
|
||||
|
||||
#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
|
||||
|
||||
#define GL_TEXTURE0_SGIS 0x835E
|
||||
#define GL_TEXTURE1_SGIS 0x835F
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue