self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) )
def Setup( self ):
- if ( platform == 'local' ):
- # special case, fetch external paks under the local install directory
- self.FetchGamePaks( self.install_directory )
+ if ( platform == 'local' ):
+ # special case, fetch external paks under the local install directory
+ self.FetchGamePaks( self.install_directory )
# NOTE: unrelated to self.setup_platforms - grab support files and binaries and install them
if ( self.platform == 'Windows' ):
depsfile = 'GtkR-deps-1.6-3.zip'
if ( ret != 0 ):
raise Exception( 'unzip dependencies file failed' )
os.chdir( backup_cwd )
-
+
# copy all the dependent runtime data to the install directory
srcdir = os.path.dirname( backup_cwd )
for f in [
#define NUM_TOOLBAR_BUTTONS 4
struct toolbar_button_info_s
{
- char *image;
- char *text;
- char *tip;
+ const char *image;
+ const char *text;
+ const char *tip;
void (*func)();
IToolbarButton::EType type;
};
// Implementation
//////////////////////////////////////////////////////////////////////
-void DEPair::Build(char *pKey, char *pValue)
+void DEPair::Build(const char *pKey, const char *pValue)
{
key = pKey;
value = pValue;
#pragma once
#endif // _MSC_VER > 1000
-class DEPair
+class DEPair
{
public:
DEPair();
virtual ~DEPair();
- void Build(char* pKey, char* pValue);
+ void Build(const char* pKey, const char* pValue);
Str key;
Str value;
ClearBrushes();
ClearEPairs();
-
+
bool build = false;
for(unsigned int i = 0; i < portals.node_count; i++)
{
for(unsigned int j = 0; j < portals.node[i].portal_count; j++)
{
- for(unsigned int k = 0; k < portals.node[i].portal[j].point_count-2; k++)
+ for(unsigned int k = 0; k < portals.node[i].portal[j].point_count-2; k++)
{
vec3_t v1, v2, normal, n;
VectorSubtract(portals.node[i].portal[j].point[k+2].p, portals.node[i].portal[j].point[k+1].p, v1);
CrossProduct(v1, v2, n);
VectorNormalize(n, v2);
- if(k == 0)
+ if(k == 0)
{
VectorCopy(v2, normal);
}
epairList.clear();
}
-void DEntity::AddEPair(char *key, char *value) {
- DEPair* newEPair;
+void DEntity::AddEPair(const char *key, const char *value) {
+ DEPair* newEPair;
newEPair = FindEPairByKey( key );
if(!newEPair) {
newEPair = new DEPair;
{
if(!strcmp(ep->key, "classname"))
SetClassname(ep->value);
- else
+ else
AddEPair(ep->key, ep->value);
ep = ep->next;
}
}
-bool DEntity::ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName,
+bool DEntity::ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName,
int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild)
{
g_FuncTable.m_pfnDeselectAllBrushes();
for(list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++)
{
- bool tmp = (*resetBrush)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
+ bool tmp = (*resetBrush)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation);
if(tmp)
if(rebuild)
{
- entity_t *pE = (*resetBrush)->QER_brush->owner;
+ entity_t *pE = (*resetBrush)->QER_brush->owner;
g_FuncTable.m_pfnDeleteBrushHandle((*resetBrush)->QER_brush);
(*resetBrush)->BuildInRadiant(FALSE, NULL, pE->entityId == 0 ? NULL : pE);
if(rebuild)
{
- entity_t *pE = (*resetPatch)->QER_brush->owner;
+ entity_t *pE = (*resetPatch)->QER_brush->owner;
g_FuncTable.m_pfnDeleteBrushHandle((*resetPatch)->QER_brush);
(*resetPatch)->BuildInRadiant(pE->entityId == 0 ? NULL : pE);
}
#pragma once
#endif // _MSC_VER > 1000
-class DEntity
+class DEntity
{
public:
void RemoveFromRadiant();
// epair functions........
void LoadEPairList(epair_t* epl);
- void AddEPair(char* key, char* value);
+ void AddEPair(const char* key, const char* value);
void ClearEPairs();
DEPair* FindEPairByKey(const char* keyname);
// ---------------------------------------------
bool* BuildDuplicateList();
bool* BuildIntersectList();
// ---------------------------------------------
-
+
// brush operations
void ClearBrushes(); // clears brush list and frees memory for brushes
ClearEntities();
}
-DEntity* DMap::AddEntity(char *classname, int ID)
+DEntity* DMap::AddEntity(const char *classname, int ID)
{
DEntity* newEntity;
if(ID == -1)
newEntity = new DEntity(classname, ID);
entityList.push_back(newEntity);
-
+
return newEntity;
}
else
{
cnt = (*fixEntity)->FixBrushes(FALSE);
-
+
if(cnt && rebuild)
RebuildEntity(*fixEntity);
}
return count;
}
-void DMap::ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName,
+void DMap::ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName,
int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation)
{
for(list<DEntity *>::const_iterator texEntity=entityList.begin(); texEntity!=entityList.end(); texEntity++)
{
if(!stricmp("worldspawn", (*texEntity)->m_Classname))
- (*texEntity)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
+ (*texEntity)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation, TRUE);
else
{
- if((*texEntity)->ResetTextures( textureName, fScale, fShift, rotation, newTextureName,
+ if((*texEntity)->ResetTextures( textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation, FALSE))
RebuildEntity(*texEntity);
}
- }
+ }
}
void DMap::RebuildEntity(DEntity *ent)
#pragma once
#endif // _MSC_VER > 1000
-class DMap
+class DMap
{
public:
static void RebuildEntity(DEntity* ent);
void ClearEntities();
DEntity* DMap::GetEntityForID(int ID);
- DEntity* AddEntity(char* classname = "worldspawn", int ID = -1);
+ DEntity* AddEntity(const char* classname = "worldspawn", int ID = -1);
list<DEntity*> entityList;
_QEREntityTable g_EntityTable;
// plugin name
-char* PLUGIN_NAME = "bobToolz";
+const char* PLUGIN_NAME = "bobToolz";
// commands in the menu
-static char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Turn edge";
+static const char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Turn edge";
// globals
GtkWidget *g_pRadiantWnd = NULL;
GdkBitmap *mask;
GtkWidget *pixmap;
- g_FuncTable.m_pfnLoadBitmap(filename, (void **)&gdkpixmap, (void **)&mask);
+ g_FuncTable.m_pfnLoadBitmap(filename, (void **)&gdkpixmap, (void **)&mask);
pixmap = gtk_pixmap_new (gdkpixmap, mask);
gdk_pixmap_unref (gdkpixmap);
gdk_pixmap_unref (mask);
return pixmap;
-}
+}
class CBobtoolzToolbarButton : public IToolbarButton
{
switch( mIndex ) {
case 3: return eToggleButton;
default: return eButton;
- }
+ }
}
virtual const char* getText() const
{
// CSynapseClient API
bool RequestAPI(APIDescriptor_t *pAPI);
const char* GetInfo();
-
+
CSynapseClientBobtoolz() { }
virtual ~CSynapseClientBobtoolz() { }
};
g_pSynapseServer = pServer;
g_pSynapseServer->IncRef();
Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
-
+
g_SynapseClient.AddAPI(TOOLBAR_MAJOR, BOBTOOLZ_MINOR, sizeof(_QERPlugToolbarTable));
g_SynapseClient.AddAPI(PLUGIN_MAJOR, BOBTOOLZ_MINOR, sizeof(_QERPluginTable));
return FALSE;
}
-bool ValidateTextIntRange(const char* pData, int min, int max, char* error_title, int* value)
+bool ValidateTextIntRange(const char* pData, int min, int max, const char* error_title, int* value)
{
char error_buffer[256];
sprintf(error_buffer, "Please Enter An Integer Between %i and %i", min, max);
}
}
-char* TranslateString (char *buf)
+char* TranslateString (const char *buf)
{
static char buf2[32768];
int i, l;
return buf2;
}
-void Sys_ERROR (char* text, ...)
+void Sys_ERROR (const char* text, ...)
{
va_list argptr;
char buf[32768];
return ++p;
}
-extern char* PLUGIN_NAME;
+extern const char* PLUGIN_NAME;
/*char* GetGameFilename(char* buffer, const char* filename)
{
strcpy(buffer, g_FuncTable.m_pfnGetGamePath());
void FillDefaultTexture(_QERFaceData* faceData, vec3_t va, vec3_t vb, vec3_t vc, const char* texture);
-void Sys_ERROR (char* text, ...);
+void Sys_ERROR (const char* text, ...);
void BuildMiniPrt(list<Str>* exclusionList);
int Bisect(NODE *, int, int, int);
void CalcAngles(NODE *, int *, float *);
void EdgeOnSide(int *, int *, int *);
- int tricall(int, NODE *, int *, TRI **, TRI **, char *);
+ int tricall(int, NODE *, int *, TRI **, TRI **, const char *);
int CheckBorders(int *,int,NODE *,int *,TRI **);
float biggesterror;
Tri = *pTri;
// Sliver-check along borders. Since borders are often linear, the errors
// along borders will often be zero, so no new points will be added. This
- // tends to produce long, thin brushes. For all border triangles, check
+ // tends to produce long, thin brushes. For all border triangles, check
// that minimum angle isn't less than SLIVER_ANGLE. If it is, add another
// vertex.
while(CheckBorders(&NumNodesUsed,NumNodes[0],Node,NumTris,pTri) > 0)
/* tricall Takes an array of nodes, spits out an array of triangles */
/* */
/*****************************************************************************/
-int tricall(int NumNodes, NODE *Node, int *NumTris, TRI **inTri, TRI **Tri, LPSTR Options)
+int tricall(int NumNodes, NODE *Node, int *NumTris, TRI **inTri, TRI **Tri, const char *Options)
{
-
struct triangulateio in, out;
int i, N;
int NumUsedNodes;
/* Make necessary initializations */
out.pointlist = (REAL *) NULL; /* Not needed if -N switch used. */
- out.pointattributelist = (REAL *) NULL; /* Not needed if -N switch used or
+ out.pointattributelist = (REAL *) NULL; /* Not needed if -N switch used or
number of point attributes is zero: */
out.pointmarkerlist = (int *) NULL; /* Not needed if -N or -B switch used. */
out.trianglelist = (int *) NULL; /* Not needed if -E switch used. */
- out.triangleattributelist = (REAL *) NULL; /* Not needed if -E switch used or
- number of triangle attributes is
+ out.triangleattributelist = (REAL *) NULL; /* Not needed if -E switch used or
+ number of triangle attributes is
zero: */
out.trianglearealist = (REAL *) NULL;
out.neighborlist = (int *) NULL; /* Needed only if -n switch used. */
- out.segmentlist = (int *) NULL; /* Needed only if segments are output
+ out.segmentlist = (int *) NULL; /* Needed only if segments are output
(-p or -c) and -P not used: */
- out.segmentmarkerlist = (int *) NULL; /* Needed only if segments are output
+ out.segmentmarkerlist = (int *) NULL; /* Needed only if segments are output
(-p or -c) and -P and -B not used: */
out.edgelist = (int *) NULL; /* Needed only if -e switch used. */
out.edgemarkerlist = (int *) NULL; /* Needed if -e used and -B not used. */
if(UseDetail) contents += CONTENTS_DETAIL;
if(UseLadder) contents += CONTENTS_LADDER;
}
-
+
OpenFuncGroup();
for(i=0; i<NumTris; i++)
{
brush.face[0].v[0][0] = Node[Tri[i].v[0]].p[0];
brush.face[0].v[0][1] = Node[Tri[i].v[0]].p[1];
brush.face[0].v[0][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[0].v[1][0] = Node[Tri[i].v[2]].p[0];
brush.face[0].v[1][1] = Node[Tri[i].v[2]].p[1];
brush.face[0].v[1][2] = Node[Tri[i].v[2]].p[2];
-
+
brush.face[0].v[2][0] = Node[Tri[i].v[1]].p[0];
brush.face[0].v[2][1] = Node[Tri[i].v[1]].p[1];
brush.face[0].v[2][2] = Node[Tri[i].v[1]].p[2];
brush.face[1].v[0][0] = Node[Tri[i].v[0]].p[0];
brush.face[1].v[0][1] = (float)backface;
brush.face[1].v[0][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[1].v[1][0] = Node[Tri[i].v[1]].p[0];
brush.face[1].v[1][1] = (float)backface;
brush.face[1].v[1][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[1].v[2][0] = Node[Tri[i].v[2]].p[0];
brush.face[1].v[2][1] = (float)backface;
brush.face[1].v[2][2] = Node[Tri[i].v[2]].p[2];
-
+
// 0-1 side
brush.face[2].v[0][0] = Node[Tri[i].v[0]].p[0];
brush.face[2].v[0][1] = Node[Tri[i].v[0]].p[1];
brush.face[2].v[0][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[2].v[1][0] = Node[Tri[i].v[1]].p[0];
brush.face[2].v[1][1] = Node[Tri[i].v[1]].p[1];
brush.face[2].v[1][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[2].v[2][0] = Node[Tri[i].v[1]].p[0];
brush.face[2].v[2][1] = (float)backface;
brush.face[2].v[2][2] = Node[Tri[i].v[1]].p[2];
-
+
// 1-2 side
brush.face[3].v[0][0] = Node[Tri[i].v[1]].p[0];
brush.face[3].v[0][1] = Node[Tri[i].v[1]].p[1];
brush.face[3].v[0][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[3].v[1][0] = Node[Tri[i].v[2]].p[0];
brush.face[3].v[1][1] = Node[Tri[i].v[2]].p[1];
brush.face[3].v[1][2] = Node[Tri[i].v[2]].p[2];
-
+
brush.face[3].v[2][0] = Node[Tri[i].v[2]].p[0];
brush.face[3].v[2][1] = (float)backface;
brush.face[3].v[2][2] = Node[Tri[i].v[2]].p[2];
-
+
// 2-0 side
brush.face[4].v[0][0] = Node[Tri[i].v[2]].p[0];
brush.face[4].v[0][1] = Node[Tri[i].v[2]].p[1];
brush.face[4].v[0][2] = Node[Tri[i].v[2]].p[2];
-
+
brush.face[4].v[1][0] = Node[Tri[i].v[0]].p[0];
brush.face[4].v[1][1] = Node[Tri[i].v[0]].p[1];
brush.face[4].v[1][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[4].v[2][0] = Node[Tri[i].v[0]].p[0];
brush.face[4].v[2][1] = (float)backface;
brush.face[4].v[2][2] = Node[Tri[i].v[0]].p[2];
brush.face[1].v[0][0] = (float)backface;
brush.face[1].v[0][1] = Node[Tri[i].v[0]].p[1];
brush.face[1].v[0][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[1].v[1][0] = (float)backface;
brush.face[1].v[1][1] = Node[Tri[i].v[1]].p[1];
brush.face[1].v[1][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[1].v[2][0] = (float)backface;
brush.face[1].v[2][1] = Node[Tri[i].v[2]].p[1];
brush.face[1].v[2][2] = Node[Tri[i].v[2]].p[2];
-
+
// 0-1 side
brush.face[2].v[0][0] = Node[Tri[i].v[0]].p[0];
brush.face[2].v[0][1] = Node[Tri[i].v[0]].p[1];
brush.face[2].v[0][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[2].v[1][0] = Node[Tri[i].v[1]].p[0];
brush.face[2].v[1][1] = Node[Tri[i].v[1]].p[1];
brush.face[2].v[1][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[2].v[2][0] = (float)backface;
brush.face[2].v[2][1] = Node[Tri[i].v[1]].p[1];
brush.face[2].v[2][2] = Node[Tri[i].v[1]].p[2];
-
+
// 1-2 side
brush.face[3].v[0][0] = Node[Tri[i].v[1]].p[0];
brush.face[3].v[0][1] = Node[Tri[i].v[1]].p[1];
brush.face[3].v[0][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[3].v[1][0] = Node[Tri[i].v[2]].p[0];
brush.face[3].v[1][1] = Node[Tri[i].v[2]].p[1];
brush.face[3].v[1][2] = Node[Tri[i].v[2]].p[2];
-
+
brush.face[3].v[2][0] = (float)backface;
brush.face[3].v[2][1] = Node[Tri[i].v[2]].p[1];
brush.face[3].v[2][2] = Node[Tri[i].v[2]].p[2];
-
+
// 2-0 side
brush.face[4].v[0][0] = Node[Tri[i].v[2]].p[0];
brush.face[4].v[0][1] = Node[Tri[i].v[2]].p[1];
brush.face[4].v[0][2] = Node[Tri[i].v[2]].p[2];
-
+
brush.face[4].v[1][0] = Node[Tri[i].v[0]].p[0];
brush.face[4].v[1][1] = Node[Tri[i].v[0]].p[1];
brush.face[4].v[1][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[4].v[2][0] = (float)backface;
brush.face[4].v[2][1] = Node[Tri[i].v[0]].p[1];
brush.face[4].v[2][2] = Node[Tri[i].v[0]].p[2];
brush.face[1].v[0][0] = Node[Tri[i].v[0]].p[0];
brush.face[1].v[0][1] = Node[Tri[i].v[0]].p[1];
brush.face[1].v[0][2] = (float)backface;
-
+
brush.face[1].v[1][0] = Node[Tri[i].v[1]].p[0];
brush.face[1].v[1][1] = Node[Tri[i].v[1]].p[1];
brush.face[1].v[1][2] = (float)backface;
-
+
brush.face[1].v[2][0] = Node[Tri[i].v[2]].p[0];
brush.face[1].v[2][1] = Node[Tri[i].v[2]].p[1];
brush.face[1].v[2][2] = (float)backface;
-
+
// 0-1 side
brush.face[2].v[0][0] = Node[Tri[i].v[0]].p[0];
brush.face[2].v[0][1] = Node[Tri[i].v[0]].p[1];
brush.face[2].v[0][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[2].v[1][0] = Node[Tri[i].v[1]].p[0];
brush.face[2].v[1][1] = Node[Tri[i].v[1]].p[1];
brush.face[2].v[1][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[2].v[2][0] = Node[Tri[i].v[1]].p[0];
brush.face[2].v[2][1] = Node[Tri[i].v[1]].p[1];
brush.face[2].v[2][2] = (float)backface;
-
+
// 1-2 side
brush.face[3].v[0][0] = Node[Tri[i].v[1]].p[0];
brush.face[3].v[0][1] = Node[Tri[i].v[1]].p[1];
brush.face[3].v[0][2] = Node[Tri[i].v[1]].p[2];
-
+
brush.face[3].v[1][0] = Node[Tri[i].v[2]].p[0];
brush.face[3].v[1][1] = Node[Tri[i].v[2]].p[1];
brush.face[3].v[1][2] = Node[Tri[i].v[2]].p[2];
-
+
brush.face[3].v[2][0] = Node[Tri[i].v[2]].p[0];
brush.face[3].v[2][1] = Node[Tri[i].v[2]].p[1];
brush.face[3].v[2][2] = (float)backface;
-
+
// 2-0 side
brush.face[4].v[0][0] = Node[Tri[i].v[2]].p[0];
brush.face[4].v[0][1] = Node[Tri[i].v[2]].p[1];
brush.face[4].v[0][2] = Node[Tri[i].v[2]].p[2];
-
+
brush.face[4].v[1][0] = Node[Tri[i].v[0]].p[0];
brush.face[4].v[1][1] = Node[Tri[i].v[0]].p[1];
brush.face[4].v[1][2] = Node[Tri[i].v[0]].p[2];
-
+
brush.face[4].v[2][0] = Node[Tri[i].v[0]].p[0];
brush.face[4].v[2][1] = Node[Tri[i].v[0]].p[1];
brush.face[4].v[2][2] = (float)backface;
}
-
+
for(j=0; j<5; j++)
{
strcpy(brush.face[j].texture,
default:
front = MoreThan(zmax,32.);
}
-
+
for(i=0; i<NumTris; i++)
Tri[i].flag = 0;
-
+
switch(Plane)
{
case PLANE_XZ0:
j1 = 0;
j2 = 1;
}
-
+
brush.Number = 0;
brush.NumFaces = 6;
MaxHints = NH*NV-1;
brush.face[0].v[0][0] = Node[q[2]].p[0];
brush.face[0].v[0][1] = (float)front;
brush.face[0].v[0][2] = Node[q[2]].p[2];
-
+
brush.face[0].v[1][0] = Node[q[1]].p[0];
brush.face[0].v[1][1] = (float)front;
brush.face[0].v[1][2] = Node[q[1]].p[2];
-
+
brush.face[0].v[2][0] = Node[q[0]].p[0];
brush.face[0].v[2][1] = (float)front;
brush.face[0].v[2][2] = Node[q[0]].p[2];
-
+
// back
brush.face[1].v[0][0] = Node[q[0]].p[0];
brush.face[1].v[0][1] = (float)backface;
brush.face[1].v[0][2] = Node[q[0]].p[2];
-
+
brush.face[1].v[1][0] = Node[q[1]].p[0];
brush.face[1].v[1][1] = (float)backface;
brush.face[1].v[1][2] = Node[q[1]].p[2];
-
+
brush.face[1].v[2][0] = Node[q[2]].p[0];
brush.face[1].v[2][1] = (float)backface;
brush.face[1].v[2][2] = Node[q[2]].p[2];
-
+
for(k0=0; k0<brush.NumFaces-2; k0++)
{
k =k0+2;
k1=(k0+1) % (brush.NumFaces-2);
-
+
brush.face[k].v[0][0] = Node[q[k0]].p[0];
brush.face[k].v[0][1] = (float)front;
brush.face[k].v[0][2] = Node[q[k0]].p[2];
-
+
brush.face[k].v[1][0] = Node[q[k1]].p[0];
brush.face[k].v[1][1] = (float)front;
brush.face[k].v[1][2] = Node[q[k1]].p[2];
-
+
brush.face[k].v[2][0] = Node[q[k1]].p[0];
brush.face[k].v[2][1] = (float)backface;
brush.face[k].v[2][2] = Node[q[k1]].p[2];
brush.face[0].v[0][0] = (float)front;
brush.face[0].v[0][1] = Node[q[2]].p[1];
brush.face[0].v[0][2] = Node[q[2]].p[2];
-
+
brush.face[0].v[1][0] = (float)front;
brush.face[0].v[1][1] = Node[q[1]].p[1];
brush.face[0].v[1][2] = Node[q[1]].p[2];
-
+
brush.face[0].v[2][0] = (float)front;
brush.face[0].v[2][1] = Node[q[0]].p[1];
brush.face[0].v[2][2] = Node[q[0]].p[2];
-
+
// back
brush.face[1].v[0][0] = (float)backface;
brush.face[1].v[0][1] = Node[q[0]].p[1];
brush.face[1].v[0][2] = Node[q[0]].p[2];
-
+
brush.face[1].v[1][0] = (float)backface;
brush.face[1].v[1][1] = Node[q[1]].p[1];
brush.face[1].v[1][2] = Node[q[1]].p[2];
-
+
brush.face[1].v[2][0] = (float)backface;
brush.face[1].v[2][1] = Node[q[2]].p[1];
brush.face[1].v[2][2] = Node[q[2]].p[2];
-
+
for(k0=0; k0<brush.NumFaces-2; k0++)
{
k =k0+2;
k1=(k0+1) % (brush.NumFaces-2);
-
+
brush.face[k].v[0][0] = (float)front;
brush.face[k].v[0][1] = Node[q[k0]].p[1];
brush.face[k].v[0][2] = Node[q[k0]].p[2];
-
+
brush.face[k].v[1][0] = (float)front;
brush.face[k].v[1][1] = Node[q[k1]].p[1];
brush.face[k].v[1][2] = Node[q[k1]].p[2];
-
+
brush.face[k].v[2][0] = (float)backface;
brush.face[k].v[2][1] = Node[q[k1]].p[1];
brush.face[k].v[2][2] = Node[q[k1]].p[2];
brush.face[0].v[0][0] = Node[q[2]].p[0];
brush.face[0].v[0][1] = Node[q[2]].p[1];
brush.face[0].v[0][2] = (float)front;
-
+
brush.face[0].v[1][0] = Node[q[1]].p[0];
brush.face[0].v[1][1] = Node[q[1]].p[1];
brush.face[0].v[1][2] = (float)front;
-
+
brush.face[0].v[2][0] = Node[q[0]].p[0];
brush.face[0].v[2][1] = Node[q[0]].p[1];
brush.face[0].v[2][2] = (float)front;
-
+
// back
brush.face[1].v[0][0] = Node[q[0]].p[0];
brush.face[1].v[0][1] = Node[q[0]].p[1];
brush.face[1].v[0][2] = (float)backface;
-
+
brush.face[1].v[1][0] = Node[q[1]].p[0];
brush.face[1].v[1][1] = Node[q[1]].p[1];
brush.face[1].v[1][2] = (float)backface;
-
+
brush.face[1].v[2][0] = Node[q[2]].p[0];
brush.face[1].v[2][1] = Node[q[2]].p[1];
brush.face[1].v[2][2] = (float)backface;
-
+
for(k0=0; k0<brush.NumFaces-2; k0++)
{
k =k0+2;
k1=(k0+1) % (brush.NumFaces-2);
-
+
brush.face[k].v[0][0] = Node[q[k0]].p[0];
brush.face[k].v[0][1] = Node[q[k0]].p[1];
brush.face[k].v[0][2] = (float)front;
-
+
brush.face[k].v[1][0] = Node[q[k1]].p[0];
brush.face[k].v[1][1] = Node[q[k1]].p[1];
brush.face[k].v[1][2] = (float)front;
-
+
brush.face[k].v[2][0] = Node[q[k1]].p[0];
brush.face[k].v[2][1] = Node[q[k1]].p[1];
brush.face[k].v[2][2] = (float)backface;
int i, j, x, y;
float inv = 1.0f/128;
- char *charlines[16] = {
+ const char *charlines[16] = {
"abcdefghijklmn", "opqrstuvwxyz0", "123456789ABC", "DEFGHIJKLMN",
"OPQRSTUVWX", "YZ,.!;:<>/?{}@$%", "&*()-+=_[] #" };
unsigned char lefts[7][17] = {
GtkObject *adj;
GSList *group;
int i;
- char *games[] = { "Quake 2", "Half-Life", "SiN", "Heretic 2", "Kingpin", "Genesis3D", "Quake 3 Arena" };
- char *waveforms[] = { "Alternating hill/valley", "Cylindrical left-to-right", "Cylindrical top-to-bottom",
+ const char *games[] = { "Quake 2", "Half-Life", "SiN", "Heretic 2", "Kingpin", "Genesis3D", "Quake 3 Arena" };
+ const char *waveforms[] = { "Alternating hill/valley", "Cylindrical left-to-right", "Cylindrical top-to-bottom",
"From bitmap", "Fractal" };
- char *orientations[] = { "Ground surface", "Ceiling", "Wall facing 0", "Wall facing 90",
+ const char *orientations[] = { "Ground surface", "Ceiling", "Wall facing 0", "Wall facing 90",
"Wall facing 180","Wall facing 270" };
g_pWnd = dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
FIXME: make this buffer size safe someday
============
*/
-char *va (char *format, ...)
+char *va (const char *format, ...)
{
va_list argptr;
static char string[1024];
#include "version.h"
CRadiantImageManager g_ImageManager;
-CRadiantPluginManager g_PluginsManager;
+CRadiantPluginManager g_PluginsManager;
_QERPlugSurfaceTable g_SurfaceTable;
_QERFileSystemTable g_FileSystemTable;
GetFileTypeRegistry()->addType(MAP_MAJOR, g_pattern_mapq3);
GetFileTypeRegistry()->addType(MAP_MAJOR, g_pattern_mapxml);
-
+
GetFileTypeRegistry()->addType("region", g_pattern_regq3);
/*
GetFileTypeRegistry()->addType(MODEL_MAJOR, g_pattern_modelmd3);
return &elem->m_model;
}
}
-
+
elem = new CModelWrapper(id, version);
g_ptr_array_add(m_ptrs, elem);
}
mAPIs.clear();
}
-
+
// CSynapseAPIManager interface -------------------
APIDescriptor_t* BuildRequireAPI(APIDescriptor_t* pAPI)
{
for(i=mAPIs.begin(); i!=mAPIs.end(); i++)
AddItem((_QERPlugToolbarTable*)(*i)->mpTable);
}
-
+
private:
void AddItem(_QERPlugToolbarTable* pTable)
}
return;
}
-
+
// start walking the interfaces
list<CImageTableSlot *>::iterator iSlot;
for(iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++)
/* plugin manager --------------------------------------- */
APIDescriptor_t* CRadiantPluginManager::BuildRequireAPI(APIDescriptor_t *pAPI)
-{
+{
CPluginSlot *pSlot = new CPluginSlot(pAPI);
mSlots.push_front(pSlot);
return pSlot->GetDescriptor();
}
else if (strcmp(type,"xmap")==0)
{
- g_MapTable2.m_pfnMap_Read(in, ents);
+ g_MapTable2.m_pfnMap_Read(in, ents);
}
else
Sys_FPrintf(SYS_WRN, "WARNING: no module found for map interface type '%s'\n", type);
}
CPluginSlot::~CPluginSlot()
-{
+{
delete mpAPI;
delete mpTable;
while (m_CommandStrings)
{
if (!m_bReady)
Init();
- return g_slist_length (m_CommandStrings);
+ return g_slist_length (m_CommandStrings);
}
-
+
const char* CPluginSlot::getCommand(int n)
{
if (!m_bReady)
Init();
- return (char*)g_slist_nth_data (m_CommandStrings, n);
+ return (char*)g_slist_nth_data (m_CommandStrings, n);
}
void CPluginSlot::addMenuID(int n)
path += g_strModulesDir;
// SYNAPSE
g_pParentWnd->GetSynapseServer().AddSearchPath(path);
- }
+ }
}
-static const XMLConfigEntry_t manager_entries[] =
- {
+static const XMLConfigEntry_t manager_entries[] =
+ {
{ VFS_MAJOR, SYN_REQUIRE, sizeof(g_FileSystemTable), &g_FileSystemTable },
{ SHADERS_MAJOR, SYN_REQUIRE, sizeof(g_ShadersTable), &g_ShadersTable },
{ MAP_MAJOR, SYN_REQUIRE, sizeof(g_MapTable), &g_MapTable },
void CPlugInManager::Init()
{
Str synapse_config;
-
+
Cleanup();
-
+
// set some globals
g_qeglobals.bBSPFrontendPlugin = false;
synapse_config += "synapse.config";
if (!g_pParentWnd->GetSynapseServer().Initialize(synapse_config.GetBuffer(), &Sys_Printf_VA))
Error("Synpase server initialization failed (see console)\n");
-
+
// builtin modules
g_pParentWnd->GetSynapseServer().EnumerateBuiltinModule(&eclass_def);
-
+
// APIs we provide
g_pParentWnd->GetSynapseClient().AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1));
g_pParentWnd->GetSynapseClient().AddAPI(SCRIPLIB_MAJOR, NULL, sizeof(_QERScripLibTable));
g_pParentWnd->GetSynapseClient().AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(_QERSelectedFaceTable));
g_pParentWnd->GetSynapseClient().AddAPI(APPSURFACEDIALOG_MAJOR, NULL, sizeof(_QERAppSurfaceTable));
g_pParentWnd->GetSynapseClient().AddAPI(UNDO_MAJOR, NULL, sizeof(_QERUndoTable));
- g_pParentWnd->GetSynapseClient().AddAPI(UI_MAJOR, NULL, sizeof(_QERUITable));
- g_pParentWnd->GetSynapseClient().AddAPI(UIGTK_MAJOR, NULL, sizeof(_QERUIGtkTable));
- g_pParentWnd->GetSynapseClient().AddAPI(CAMERA_MAJOR, NULL, sizeof(_QERCameraTable));
-
+ g_pParentWnd->GetSynapseClient().AddAPI(UI_MAJOR, NULL, sizeof(_QERUITable));
+ g_pParentWnd->GetSynapseClient().AddAPI(UIGTK_MAJOR, NULL, sizeof(_QERUIGtkTable));
+ g_pParentWnd->GetSynapseClient().AddAPI(CAMERA_MAJOR, NULL, sizeof(_QERCameraTable));
+
// modules configured by XML
if ( !g_pParentWnd->GetSynapseClient().ConfigXML( &g_pParentWnd->GetSynapseServer(), "core", manager_entries ) ) {
Error("Synapse server initialization failed (see console)\n");
}
-
+
// adding a manager is a special case that ConfigXML doesn't take care of
g_pParentWnd->GetSynapseServer().SelectClientConfig( "core" );
char *minor;
}
g_ImageManager.SetMatchAPI( IMAGE_MAJOR, minor );
g_pParentWnd->GetSynapseClient().AddManager( &g_ImageManager );
-
+
// SYN_REQUIRE entries which are still hardcoded
g_pParentWnd->GetSynapseClient().AddAPI(MAP_MAJOR, "mapxml", sizeof(g_MapTable2), SYN_REQUIRE, &g_MapTable2);
g_pParentWnd->GetSynapseClient().AddAPI(ENTITY_MAJOR, NULL, sizeof(g_EntityTable), SYN_REQUIRE, &g_EntityTable);
-
+
// plugins: load anything that claims to be a plugin
// minor becomes some kind of matching pattern
// g_PluginsManager is an API any class, it receives several function tables as needed
void CPlugInManager::CommitBrushHandleToMap(void * vp)
{
- g_bScreenUpdates = false;
+ g_bScreenUpdates = false;
for (int i = 0; i < m_BrushHandles.GetSize(); i++)
{
brush_t *pb = reinterpret_cast<brush_t*>(m_BrushHandles.GetAt(i));
Select_Brush(pb);
}
}
- g_bScreenUpdates = true;
+ g_bScreenUpdates = true;
Sys_UpdateWindows(W_ALL);
}
VectorCopy( origin, g_pParentWnd->GetCamWnd()->Camera()->origin );
VectorCopy( angles, g_pParentWnd->GetCamWnd()->Camera()->angles );
- Sys_UpdateWindows( W_ALL ); // specify
+ Sys_UpdateWindows( W_ALL ); // specify
g_pParentWnd->OnTimer();
}
return static_cast<void*>(pe);
}
-epair_t* WINAPI QERApp_AllocateEpair( char *key, char *val )
+epair_t* WINAPI QERApp_AllocateEpair( const char *key, const char *val )
{
epair_t *e = (epair_t*)qmalloc (sizeof(*e));
e->key = (char*)qmalloc(strlen(key)+1);
return pEp;
}
-IEpair* WINAPI QERApp_IEpairForProjectKeys()
+IEpair* WINAPI QERApp_IEpairForProjectKeys()
{
CEpairsWrapper *pEp = new CEpairsWrapper(g_qeglobals.d_project_entity);
pEp->IncRef();
void WINAPI QERApp_SetScreenUpdate(int bScreenUpdates)
{
- g_bScreenUpdates = bScreenUpdates;
+ g_bScreenUpdates = bScreenUpdates;
}
texturewin_t* QERApp_QeglobalsTexturewin()
gettimeofday(&tp, &tzp);
if (!basetime)
basetime = tp.tv_sec;
- return (tp.tv_sec-basetime) + tp.tv_usec/1000;
+ return (tp.tv_sec-basetime) + tp.tv_usec/1000;
#endif
}
pShadersTable->m_pfnTexture_ShowInuse = Texture_ShowInuse;
pShadersTable->m_pfnBuildShaderList = &BuildShaderList;
pShadersTable->m_pfnPreloadShaders = &PreloadShaders;
-
+
return true;
}
if (!strcmp(pAPI->major_name, QGL_MAJOR))
pQglTable->m_pfn_qglDeleteTextures = qglDeleteTextures;
pQglTable->m_pfn_qglDrawElements = qglDrawElements;
pQglTable->m_pfn_qglEnable = qglEnable;
- pQglTable->m_pfn_qglEnableClientState = qglEnableClientState;
+ pQglTable->m_pfn_qglEnableClientState = qglEnableClientState;
pQglTable->m_pfn_qglEnd = qglEnd;
pQglTable->m_pfn_qglEndList = qglEndList;
pQglTable->m_pfn_qglFogf = qglFogf;
pDataTable->m_pfnSelectedBrushes = QERApp_SelectedBrushes;
pDataTable->m_pfnFilteredBrushes = QERApp_FilteredBrushes;
pDataTable->m_pfnLstSkinCache = QERApp_LstSkinCache;
-
+
return true;
}
if (!strcmp(pAPI->major_name, PATCH_MAJOR))
pPatchTable->m_pfnPatch_Alloc = &Patch_Alloc;
pPatchTable->m_pfnAddBrushForPatch = &AddBrushForPatch;
pPatchTable->m_pfnMakeNewPatch = &MakeNewPatch;
-
+
return true;
}
if (!strcmp(pAPI->major_name, ECLASSMANAGER_MAJOR))
{
_EClassManagerTable *pEClassManTable = static_cast<_EClassManagerTable *>(pAPI->mpTable);
-
+
pEClassManTable->m_pfnEclass_InsertAlphabetized = &Eclass_InsertAlphabetized;
pEClassManTable->m_pfnGet_Eclass_E = &Get_EClass_E;
pEClassManTable->m_pfnSet_Eclass_Found = &Set_Eclass_Found;
pEClassManTable->m_pfnGet_Parsing_Single = &Get_Parsing_Single;
pEClassManTable->m_pfnEClass_Create = &EClass_Create;
pEClassManTable->m_pfnEclass_ForName = &Eclass_ForName;
-
+
return true;
}
if (!strcmp(pAPI->major_name, SELECTEDFACE_MAJOR))
- {
+ {
_QERSelectedFaceTable *pSelectedFaceTable = static_cast<_QERSelectedFaceTable *>(pAPI->mpTable);
pSelectedFaceTable->m_pfnGetSelectedFaceCount = &QERApp_GetSelectedFaceCount;
return true;
}
if (!strcmp(pAPI->major_name, UNDO_MAJOR))
- {
+ {
_QERUndoTable *pUndoTable = static_cast<_QERUndoTable *>(pAPI->mpTable);
pUndoTable->m_pfnUndo_Start = &Undo_Start;
return true;
}
if (!strcmp(pAPI->major_name, UI_MAJOR))
- {
+ {
_QERUITable *pUITable = static_cast<_QERUITable *>(pAPI->mpTable);
pUITable->m_pfnCreateGLWindow = QERApp_CreateGLWindow;
return true;
}
if (!strcmp(pAPI->major_name, UIGTK_MAJOR))
- {
+ {
_QERUIGtkTable *pUIGtkTable = static_cast<_QERUIGtkTable *>(pAPI->mpTable);
pUIGtkTable->m_pfn_GetQeglobalsGLWidget = &QERApp_GetQeGlobalsGLWidget;