本文整理汇总了C++中Sys_Status函数的典型用法代码示例。如果您正苦于以下问题:C++ Sys_Status函数的具体用法?C++ Sys_Status怎么用?C++ Sys_Status使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Sys_Status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QE_CheckAutoSave
/*
=======================================================================================================================
QE_CheckAutoSave If five minutes have passed since making a change and the map hasn't been saved, save it out.
=======================================================================================================================
*/
void QE_CheckAutoSave(void) {
static bool inAutoSave = false;
static bool autoToggle = false;
if (inAutoSave) {
Sys_Status("Did not autosave due recursive entry into autosave routine\n");
return;
}
if ( !mapModified ) {
return;
}
inAutoSave = true;
if ( g_PrefsDlg.m_bAutoSave ) {
CString strMsg = g_PrefsDlg.m_bSnapShots ? "Autosaving snapshot..." : "Autosaving...";
Sys_Status(strMsg.GetBuffer(0), 0);
if (g_PrefsDlg.m_bSnapShots && stricmp(currentmap, "unnamed.map") != 0) {
Map_Snapshot();
} else {
Map_SaveFile(ValueForKey(g_qeglobals.d_project_entity, (autoToggle == 0) ? "autosave1" : "autosave2" ), false, true);
autoToggle ^= 1;
}
Sys_Status("Autosaving...Saved.", 0);
mapModified = 0; // DHM - _D3XP
} else {
common->Printf("Autosave skipped...\n");
Sys_Status("Autosave skipped...", 0);
}
inAutoSave = false;
}
示例2: SelectVertexByRay
/*
=======================================================================================================================
=======================================================================================================================
*/
void SelectVertexByRay(idVec3 org, idVec3 dir) {
int i, besti;
float d, bestd;
idVec3 temp;
float scale = g_pParentWnd->ActiveXY()->Scale();
// find the point closest to the ray
besti = -1;
bestd = 8 / scale / 2;
for (i = 0; i < g_qeglobals.d_numpoints; i++) {
temp = g_qeglobals.d_points[i] - org;
d = temp * dir;
temp = org + d * dir;
temp = g_qeglobals.d_points[i] - temp;
d = temp.Length();
if ( d < bestd ) {
bestd = d;
besti = i;
}
}
if (besti == -1 || bestd > 8 / scale / 2 ) {
Sys_Status("Click didn't hit a vertex\n");
return;
}
Sys_Status("hit vertex\n");
g_qeglobals.d_move_points[g_qeglobals.d_num_move_points++] = &g_qeglobals.d_points[besti];
// SelectVertex (besti);
}
示例3: Undo_AddBrush
/*
=============
Undo_AddBrush
=============
*/
void Undo_AddBrush(brush_t *pBrush)
{
if (!g_lastundo)
{
Sys_Status("Undo_AddBrushList: no last undo.\n");
return;
}
if (g_lastundo->entitylist.next != &g_lastundo->entitylist)
{
Sys_Status("Undo_AddBrushList: WARNING adding brushes after entity.\n");
}
//if the brush is already in the undo
if (Undo_BrushInUndo(g_lastundo, pBrush))
return;
//clone the brush
brush_t* pClone = Brush_FullClone(pBrush);
//save the ID of the owner entity
pClone->ownerId = pBrush->owner->entityId;
if (pBrush->owner && !(pBrush->owner->eclass->nShowFlags & ECLASS_WORLDSPAWN)) {
Undo_AddEntity(pBrush->owner);
}
//save the old undo ID for previous undos
pClone->undoId = pBrush->undoId;
Brush_AddToList (pClone, &g_lastundo->brushlist);
//
g_undoMemorySize += Brush_MemorySize(pClone);
}
示例4: SelectBrush
void SelectBrush (int entitynum, int brushnum)
{
entity_t *e;
brush_t *b;
int i;
if (entitynum == 0)
e = world_entity;
else
{
e = entities.next;
while (--entitynum)
{
e=e->next;
if (e == &entities)
{
Sys_Status ("No such entity.", 0);
return;
}
}
}
b = e->brushes.onext;
if (b == &e->brushes)
{
Sys_Status ("No such brush.", 0);
return;
}
while (brushnum--)
{
b=b->onext;
if (b == &e->brushes)
{
Sys_Status ("No such brush.", 0);
return;
}
}
Brush_RemoveFromList (b);
Brush_AddToList (b, &selected_brushes);
Sys_UpdateWindows (W_ALL);
for (i=0 ; i<3 ; i++)
{
if (g_pParentWnd->GetXYWnd())
g_pParentWnd->GetXYWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2;
if (g_pParentWnd->GetXZWnd())
g_pParentWnd->GetXZWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2;
if (g_pParentWnd->GetYZWnd())
g_pParentWnd->GetYZWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2;
}
Sys_Status ("Selected.", 0);
}
示例5: ConnectEntities
/*
===============
ConnectEntities
Sets target / targetname on the two entities selected
from the first selected to the secon
===============
*/
void ConnectEntities( void ){
entity_t *e1, *e2;
const char *target;
char *newtarg = NULL;
if ( g_qeglobals.d_select_count != 2 ) {
Sys_Status( "Must have two brushes selected", 0 );
Sys_Beep();
return;
}
e1 = g_qeglobals.d_select_order[0]->owner;
e2 = g_qeglobals.d_select_order[1]->owner;
if ( e1 == world_entity || e2 == world_entity ) {
Sys_Status( "Can't connect to the world", 0 );
Sys_Beep();
return;
}
if ( e1 == e2 ) {
Sys_Status( "Brushes are from same entity", 0 );
Sys_Beep();
return;
}
target = ValueForKey( e1, "target" );
if ( target && target[0] ) {
newtarg = g_strdup( target );
}
else
{
target = ValueForKey( e2, "targetname" );
if ( target && target[0] ) {
newtarg = g_strdup( target );
}
else{
Entity_Connect( e1, e2 );
}
}
if ( newtarg != NULL ) {
SetKeyValue( e1, "target", newtarg );
SetKeyValue( e2, "targetname", newtarg );
g_free( newtarg );
}
Sys_UpdateWindows( W_XY | W_CAMERA );
Select_Deselect();
Select_Brush( g_qeglobals.d_select_order[1] );
}
示例6: SelectEdgeByRay
/*
=======================================================================================================================
=======================================================================================================================
*/
void SelectEdgeByRay(idVec3 org, idVec3 dir) {
int i, j, besti;
float d, bestd;
idVec3 mid, temp;
pedge_t *e;
// find the edge closest to the ray
besti = -1;
bestd = 8;
for (i = 0; i < g_qeglobals.d_numedges; i++) {
for (j = 0; j < 3; j++) {
mid[j] = 0.5 * (g_qeglobals.d_points[g_qeglobals.d_edges[i].p1][j] + g_qeglobals.d_points[g_qeglobals.d_edges[i].p2][j]);
}
temp = mid - org;
d = temp * dir;
temp = org + d * dir;
temp = mid - temp;
d = temp.Length();
if ( d < bestd ) {
bestd = d;
besti = i;
}
}
if (besti == -1) {
Sys_Status("Click didn't hit an edge\n");
return;
}
Sys_Status("hit edge\n");
//
// make the two faces that border the edge use the two edge points as primary drag
// points
//
g_qeglobals.d_num_move_points = 0;
e = &g_qeglobals.d_edges[besti];
#ifdef NEWEDGESEL
for (brush_t * b = selected_brushes.next; b != &selected_brushes; b = b->next) {
SelectFaceEdge(b, e->f1, e->p1, e->p2);
SelectFaceEdge(b, e->f2, e->p2, e->p1);
}
#else
SelectFaceEdge(e->f1, e->p1, e->p2);
SelectFaceEdge(e->f2, e->p2, e->p1);
#endif
}
示例7: Drag_MouseUp
/*
================
Drag_MouseUp
================
*/
void Drag_MouseUp(int nButtons) {
Sys_Status("drag completed.", 0);
if (g_qeglobals.d_select_mode == sel_area) {
Patch_SelectAreaPoints();
g_qeglobals.d_select_mode = sel_curvepoint;
Sys_UpdateWindows(W_ALL);
}
if (g_qeglobals.d_select_translate[0] || g_qeglobals.d_select_translate[1] || g_qeglobals.d_select_translate[2]) {
Select_Move(g_qeglobals.d_select_translate);
VectorCopy(vec3_origin, g_qeglobals.d_select_translate);
Sys_UpdateWindows(W_CAMERA);
}
g_pParentWnd->SetStatusText(3, "");
/*
if (g_pParentWnd->GetCamera()->UpdateRenderEntities()) {
Sys_UpdateWindows(W_CAMERA);
}
*/
Undo_EndBrushList(&selected_brushes);
Undo_End();
}
示例8: Map_RegionSelectedBrushes
/*
=======================================================================================================================
Map_RegionSelectedBrushes
=======================================================================================================================
*/
void Map_RegionSelectedBrushes(void) {
Map_RegionOff();
if (selected_brushes.next == &selected_brushes) { // nothing selected
Sys_Status("Tried to region with no selection...\n");
return;
}
region_active = true;
Select_GetBounds(region_mins, region_maxs);
// move the entire active_brushes list to filtered_brushes
filtered_brushes.next = active_brushes.next;
filtered_brushes.prev = active_brushes.prev;
filtered_brushes.next->prev = &filtered_brushes;
filtered_brushes.prev->next = &filtered_brushes;
Patch_Deselect();
// move the entire selected_brushes list to active_brushes
active_brushes.next = selected_brushes.next;
active_brushes.prev = selected_brushes.prev;
active_brushes.next->prev = &active_brushes;
active_brushes.prev->next = &active_brushes;
// clear selected_brushes
selected_brushes.next = selected_brushes.prev = &selected_brushes;
Sys_UpdateWindows(W_ALL);
}
示例9: Select_Ungroup
/* Turn the currently selected entity back into normal brushes
*/
void Select_Ungroup (void)
{
entity_t *e;
brush_t *b;
e = selected_brushes.next->owner;
if (!e || e == world_entity || e->eclass->fixedsize)
{
Sys_Status ("Not a grouped entity.", 0);
return;
}
for (b=e->brushes.onext ; b != &e->brushes ; b=e->brushes.onext)
{
Brush_RemoveFromList (b);
Brush_AddToList (b, &active_brushes);
Entity_UnlinkBrush (b);
Entity_LinkBrush (world_entity, b);
Brush_Build( b );
b->owner = world_entity;
}
Entity_Free (e);
Sys_UpdateWindows (W_ALL);
}
示例10: Undo_AddEntity
/*
=============
Undo_AddEntity
=============
*/
void Undo_AddEntity(entity_t *entity)
{
entity_t* pClone;
if (!g_lastundo)
{
Sys_Status("Undo_AddEntity: no last undo.\n");
return;
}
//if the entity is already in the undo
if (Undo_EntityInUndo(g_lastundo, entity))
return;
//clone the entity
pClone = Entity_Clone(entity);
//NOTE: Entity_Clone adds the entity to the entity list
// so we remove it from that list here
Entity_RemoveFromList(pClone);
//save the old undo ID for previous undos
pClone->undoId = entity->undoId;
//save the entity ID (we need a full clone)
pClone->entityId = entity->entityId;
//
Entity_AddToList(pClone, &g_lastundo->entitylist);
//
g_undoMemorySize += Entity_MemorySize(pClone);
}
示例11: SelectSplinePointByRay
/*
=======================================================================================================================
=======================================================================================================================
*/
void SelectSplinePointByRay(const idVec3 &org, const idVec3 &dir, int buttons) {
int i, besti;
float d, bestd;
idVec3 temp;
// find the point closest to the ray
besti = -1;
bestd = 8;
for (i = 0; i < g_qeglobals.d_numpoints; i++) {
temp = g_qeglobals.d_points[i] - org;
d = temp * dir;
temp = org + d * dir;
temp = g_qeglobals.d_points[i] - temp;
d = temp.Length();
if ( d <= bestd ) {
bestd = d;
besti = i;
}
}
if (besti == -1) {
return;
}
Sys_Status("hit curve point\n");
g_qeglobals.d_num_move_points = 0;
g_qeglobals.d_move_points[g_qeglobals.d_num_move_points++] = &g_qeglobals.d_points[besti];
// g_splineList->setSelectedPoint(&g_qeglobals.d_points[besti]);
}
示例12: Entity_Connect
/*!
connects two entities creating a unique target/targetname value
*/
void Entity_Connect(entity_t *e1, entity_t *e2)
{
const char *maptarget;
char newtarget[16];
int maxtarget=0; // highest t# value in the map
entity_t *e; // map entities
if (e1 == e2)
{
#ifdef _DEBUG
Sys_Status ("Entity_Connect: Brushes are from same entity.", 0);
#endif
return;
}
for (e=entities.next ; e != &entities ; e=e->next)
{
maptarget = ValueForKey (e, "target");
if (maptarget && maptarget[0])
{
int targetnum = atoi(maptarget+1);
if (targetnum > maxtarget)
maxtarget = targetnum;
}
}
sprintf (newtarget, "t%i", maxtarget+1);
#ifdef _DEBUG
Sys_Printf("Connecting entities with new target/targetname: %s\n", newtarget);
#endif
SetKeyValue (e1, "target", newtarget);
SetKeyValue (e2, "targetname", newtarget);
}
示例13: Sys_UpdateStatusBar
void Sys_UpdateStatusBar( void )
{
extern int g_numbrushes, g_numentities;
char numbrushbuffer[100] = "";
sprintf( numbrushbuffer, "Brushes: %d Entities: %d", g_numbrushes, g_numentities );
Sys_Status( numbrushbuffer, 2 );
}
示例14: QE_CheckAutoSave
void QE_CheckAutoSave( void )
{
static clock_t s_start;
clock_t now;
now = clock();
if ( modified != 1 || !s_start)
{
s_start = now;
return;
}
if ( now - s_start > ( CLOCKS_PER_SEC * 60 * g_PrefsDlg.m_nAutoSave))
{
if (g_PrefsDlg.m_bAutoSave)
{
CString strMsg = g_PrefsDlg.m_bSnapShots ? "Autosaving snapshot..." : "Autosaving...";
Sys_Printf(strMsg.GetBuffer(0));
Sys_Printf("\n");
Sys_Status (strMsg.GetBuffer(0),0);
// only snapshot if not working on a default map
if (g_PrefsDlg.m_bSnapShots && stricmp(currentmap, "unnamed.map") != 0)
{
Map_Snapshot();
}
else
{
Map_SaveFile (ValueForKey(g_qeglobals.d_project_entity, "autosave"), false);
}
Sys_Status ("Autosaving...Saved.", 0 );
modified = 2;
}
else
{
Sys_Printf ("Autosave skipped...\n");
Sys_Status ("Autosave skipped...", 0 );
}
s_start = now;
}
}
示例15: QE_SingleBrush
/*
=======================================================================================================================
=======================================================================================================================
*/
bool QE_SingleBrush(bool bQuiet, bool entityOK) {
if ((selected_brushes.next == &selected_brushes) || (selected_brushes.next->next != &selected_brushes)) {
if (!bQuiet) {
Sys_Status("Error: you must have a single brush selected\n");
}
return false;
}
if (!entityOK && selected_brushes.next->owner->eclass->fixedsize) {
if (!bQuiet) {
Sys_Status("Error: you cannot manipulate fixed size entities\n");
}
return false;
}
return true;
}