本文整理汇总了C++中Log_Print函数的典型用法代码示例。如果您正苦于以下问题:C++ Log_Print函数的具体用法?C++ Log_Print怎么用?C++ Log_Print使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Log_Print函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: AAS_HashVec
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
unsigned AAS_HashVec( vec3_t vec ) {
int x, y;
x = ( MAX_MAP_BOUNDS + (int)( vec[0] + 0.5 ) ) >> VERTEX_HASH_SHIFT;
y = ( MAX_MAP_BOUNDS + (int)( vec[1] + 0.5 ) ) >> VERTEX_HASH_SHIFT;
if ( x < 0 || x >= VERTEX_HASH_SIZE || y < 0 || y >= VERTEX_HASH_SIZE ) {
Log_Print( "WARNING! HashVec: point %f %f %f outside valid range\n", vec[0], vec[1], vec[2] );
Log_Print( "This should never happen!\n" );
return -1;
} //end if
return y * VERTEX_HASH_SIZE + x;
} //end of the function AAS_HashVec
开发者ID:chegestar,项目名称:omni-bot,代码行数:20,代码来源:aas_store.c
示例2: LoadCfgFile
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
int LoadCfgFile( char *filename ) {
source_t *source;
token_t token;
int settingsdefined;
source = LoadSourceFile( filename );
if ( !source ) {
Log_Print( "couldn't open cfg file %s\n", filename );
return false;
} //end if
settingsdefined = false;
memset( &cfg, 0, sizeof( cfg_t ) );
while ( PC_ReadToken( source, &token ) )
{
if ( !stricmp( token.string, "bbox" ) ) {
if ( cfg.numbboxes >= AAS_MAX_BBOXES ) {
SourceError( source, "too many bounding box volumes defined" );
} //end if
if ( !ReadStructure( source, &bbox_struct, (char *) &cfg.bboxes[cfg.numbboxes] ) ) {
FreeSource( source );
return false;
} //end if
cfg.allpresencetypes |= cfg.bboxes[cfg.numbboxes].presencetype;
cfg.numbboxes++;
} //end if
else if ( !stricmp( token.string, "settings" ) ) {
if ( settingsdefined ) {
SourceWarning( source, "settings already defined\n" );
} //end if
settingsdefined = true;
if ( !ReadStructure( source, &cfg_struct, (char *) &cfg ) ) {
FreeSource( source );
return false;
} //end if
} //end else if
} //end while
if ( VectorLength( cfg.phys_gravitydirection ) < 0.9 || VectorLength( cfg.phys_gravitydirection ) > 1.1 ) {
SourceError( source, "invalid gravity direction specified" );
} //end if
if ( cfg.numbboxes <= 0 ) {
SourceError( source, "no bounding volumes specified" );
} //end if
FreeSource( source );
SetCfgLibVars();
Log_Print( "using cfg file %s\n", filename );
return true;
} //end of the function LoadCfgFile
开发者ID:JackalFrost,项目名称:RTCW-WSGF,代码行数:55,代码来源:aas_cfg.c
示例3: Q2_LoadMapFile
/*
================
LoadMapFile
================
*/
void Q2_LoadMapFile(char *filename)
{
int i;
script_t *script;
Log_Print("-- Q2_LoadMapFile --\n");
#ifdef ME
//loaded map type
loadedmaptype = MAPTYPE_QUAKE2;
//reset the map loading
ResetMapLoading();
#endif //ME
script = LoadScriptFile(filename);
if (!script)
{
Log_Print("couldn't open %s\n", filename);
return;
} //end if
//white spaces and escape characters inside a string are not allowed
SetScriptFlags(script, SCFL_NOSTRINGWHITESPACES |
SCFL_NOSTRINGESCAPECHARS |
SCFL_PRIMITIVE);
nummapbrushsides = 0;
num_entities = 0;
while (Q2_ParseMapEntity(script))
{
}
ClearBounds (map_mins, map_maxs);
for (i=0 ; i<entities[0].numbrushes ; i++)
{
if (mapbrushes[i].mins[0] > 4096)
continue; // no valid points
AddPointToBounds (mapbrushes[i].mins, map_mins, map_maxs);
AddPointToBounds (mapbrushes[i].maxs, map_mins, map_maxs);
} //end for
PrintMapInfo();
//free the script
FreeScript(script);
// TestExpandBrushes ();
//
Q2_CreateMapTexinfo();
} //end of the function Q2_LoadMapFile
开发者ID:kingtiger01,项目名称:openmohaa-1,代码行数:53,代码来源:map_q2.c
示例4: AAS_TestSplitPlane
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
int AAS_TestSplitPlane(tmp_area_t *tmparea, vec3_t normal, float dist,
int *facesplits, int *groundsplits, int *epsilonfaces)
{
int j, side, front, back, planenum;
float d, d_front, d_back;
tmp_face_t *face;
winding_t *w;
*facesplits = *groundsplits = *epsilonfaces = 0;
planenum = FindFloatPlane(normal, dist);
w = AAS_SplitWinding(tmparea, planenum);
if (!w) return false;
FreeWinding(w);
//
for (face = tmparea->tmpfaces; face; face = face->next[side])
{
//side of the face the area is on
side = face->frontarea != tmparea;
if ((face->planenum & ~1) == (planenum & ~1))
{
Log_Print("AAS_TestSplitPlane: tried face plane as splitter\n");
return false;
} //end if
w = face->winding;
//reset distance at front and back side of plane
d_front = d_back = 0;
//reset front and back flags
front = back = 0;
for (j = 0; j < w->numpoints; j++)
{
d = DotProduct(w->p[j], normal) - dist;
if (d > d_front) d_front = d;
if (d < d_back) d_back = d;
if (d > 0.4) // PLANESIDE_EPSILON)
front = 1;
if (d < -0.4) // PLANESIDE_EPSILON)
back = 1;
} //end for
//check for an epsilon face
if ( (d_front > FACECLIP_EPSILON && d_front < FACE_EPSILON)
|| (d_back < -FACECLIP_EPSILON && d_back > -FACE_EPSILON) )
{
(*epsilonfaces)++;
} //end if
//if the face has points at both sides of the plane
if (front && back)
{
(*facesplits)++;
if (face->faceflags & FACE_GROUND)
{
(*groundsplits)++;
} //end if
} //end if
} //end for
return true;
} //end of the function AAS_TestSplitPlane
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:66,代码来源:aas_gsubdiv.c
示例5: ThreadSetupLock
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void ThreadSetupLock( void ) {
Log_Print( "Win32 multi-threading\n" );
InitializeCriticalSection( &crit );
threaded = true; //Stupid me... forgot this!!!
currentnumthreads = 0;
currentthreadid = 0;
} //end of the function ThreadInitLock
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:13,代码来源:l_threads.c
示例6: ScriptWarning
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void QDECL ScriptWarning( script_t *script, const char *str, ... ) {
char text[1024];
va_list ap;
if ( script->flags & SCFL_NOWARNINGS ) {
return;
}
va_start( ap, str );
#if !defined RTCW_ET
vsprintf( text, str, ap );
#else
Q_vsnprintf( text, sizeof( text ), str, ap );
#endif // RTCW_XX
va_end( ap );
#ifdef BOTLIB
botimport.Print( PRT_WARNING, "file %s, line %d: %s\n", script->filename, script->line, text );
#endif //BOTLIB
#ifdef MEQCC
printf( "warning: file %s, line %d: %s\n", script->filename, script->line, text );
#endif //MEQCC
#ifdef BSPC
Log_Print( "warning: file %s, line %d: %s\n", script->filename, script->line, text );
#endif //BSPC
} //end of the function ScriptWarning
开发者ID:bibendovsky,项目名称:rtcw,代码行数:33,代码来源:l_script.cpp
示例7: SetAreaPortalAreas_r
//===========================================================================
// Just decend the tree, and for each node that hasn't had an
// area set, flood fill out from there
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void SetAreaPortalAreas_r(node_t *node)
{
bspbrush_t *b;
entity_t *e;
if(node->planenum != PLANENUM_LEAF)
{
SetAreaPortalAreas_r(node->children[0]);
SetAreaPortalAreas_r(node->children[1]);
return;
} //end if
if(node->contents == CONTENTS_AREAPORTAL)
{
if(node->area)
{
return; // allready set
}
b = node->brushlist;
e = &entities[b->original->entitynum];
node->area = e->portalareas[0];
if(!e->portalareas[1])
{
Log_Print("WARNING: areaportal entity %i doesn't touch two areas\n", b->original->entitynum);
return;
} //end if
} //end if
} //end of the function SetAreaPortalAreas_r
开发者ID:Diskutant,项目名称:RTCW-SP,代码行数:39,代码来源:portals.c
示例8: ContentDir_Create
/*****************************************************************************
* ContentDir_Create
*****************************************************************************/
ContentDir*
ContentDir_Create (void* talloc_context,
UpnpClient_Handle ctrlpt_handle,
IXML_Element* serviceDesc,
const char* base_url)
{
OBJECT_SUPER_CONSTRUCT (ContentDir, Service_Create, talloc_context,
ctrlpt_handle, serviceDesc, base_url);
if (self == NULL)
goto error; // ---------->
if (CACHE_SIZE > 0 && CACHE_TIMEOUT > 0) {
self->cache = Cache_Create (self, CACHE_SIZE, CACHE_TIMEOUT,
cache_free_expired_data);
if (self->cache == NULL)
goto error; // ---------->
ithread_mutex_init (&self->cache_mutex, NULL);
}
return self; // ---------->
error:
Log_Print (LOG_ERROR, "ContentDir_Create error");
if (self)
talloc_free (self);
return NULL;
}
开发者ID:Boxee,项目名称:djmount,代码行数:30,代码来源:content_dir.c
示例9: ThreadSetupLock
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void ThreadSetupLock(void)
{
pthread_mutexattr_t mattrib;
Log_Print("pthread multi-threading\n");
if (!my_mutex)
{
my_mutex = GetMemory(sizeof(*my_mutex));
if (pthread_mutexattr_create (&mattrib) == -1)
Error ("pthread_mutex_attr_create failed");
if (pthread_mutexattr_setkind_np (&mattrib, MUTEX_FAST_NP) == -1)
Error ("pthread_mutexattr_setkind_np failed");
if (pthread_mutex_init (my_mutex, mattrib) == -1)
Error ("pthread_mutex_init failed");
}
if (pthread_attr_create (&attrib) == -1)
Error ("pthread_attr_create failed");
if (pthread_attr_setstacksize (&attrib, 0x100000) == -1)
Error ("pthread_attr_setstacksize failed");
threaded = true;
currentnumthreads = 0;
currentthreadid = 0;
} //end of the function ThreadInitLock
开发者ID:Cpasjuste,项目名称:quake3_pandora_gles,代码行数:32,代码来源:l_threads.c
示例10: AAS_CalcReachAndClusters
void AAS_CalcReachAndClusters( struct quakefile_s *qf ) {
float time;
Log_Print( "loading collision map...\n" );
//
if ( !qf->pakfile[0] ) {
strcpy( qf->pakfile, qf->filename );
}
//load the map
CM_LoadMap( (char *) qf, qfalse, &( *aasworld ).bspchecksum );
//get a handle to the world model
worldmodel = CM_InlineModel( 0 ); // 0 = world, 1 + are bmodels
//initialize bot import structure
AAS_InitBotImport();
//load the BSP entity string
AAS_LoadBSPFile();
//init physics settings
AAS_InitSettings();
//initialize AAS link heap
AAS_InitAASLinkHeap();
//initialize the AAS linked entities for the new map
AAS_InitAASLinkedEntities();
//reset all reachabilities and clusters
( *aasworld ).reachabilitysize = 0;
( *aasworld ).numclusters = 0;
//set all view portals as cluster portals in case we re-calculate the reachabilities and clusters (with -reach)
AAS_SetViewPortalsAsClusterPortals();
//calculate reachabilities
AAS_InitReachability();
time = 0;
while ( AAS_ContinueInitReachability( time ) ) time++;
//calculate clusters
AAS_InitClustering();
} //end of the function AAS_CalcReachAndClusters
开发者ID:JackalFrost,项目名称:RTCW-WSGF,代码行数:34,代码来源:be_aas_bspc.c
示例11: Q1_LoadMapFromBSP
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void Q1_LoadMapFromBSP(char *filename, int offset, int length)
{
int i, modelnum;
char *model, *classname;
Log_Print("-- Q1_LoadMapFromBSP --\n");
//the loaded map type
loadedmaptype = MAPTYPE_QUAKE1;
//
qprintf("loading map from %s at %d\n", filename, offset);
//load the Half-Life BSP file
Q1_LoadBSPFile(filename, offset, length);
//
q1_numclipbrushes = 0;
//CreatePath(path);
//Q1_CreateQ2WALFiles(path);
//parse the entities from the BSP
Q1_ParseEntities();
//clear the map mins and maxs
ClearBounds(map_mins, map_maxs);
//
qprintf("creating Quake1 brushes\n");
if (lessbrushes)
{
qprintf("creating minimum number of brushes\n");
}
else
{
qprintf("placing textures correctly\n");
}
//
for (i = 0; i < num_entities; i++)
{
entities[i].firstbrush = nummapbrushes;
entities[i].numbrushes = 0;
//
classname = ValueForKey(&entities[i], "classname");
if (classname && !strcmp(classname, "worldspawn"))
{
modelnum = 0;
} //end if
else
{
//
model = ValueForKey(&entities[i], "model");
if (!model || *model != '*')
{
continue;
}
model++;
modelnum = atoi(model);
} //end else
//create map brushes for the entity
Q1_CreateMapBrushes(&entities[i], modelnum);
} //end for
//
qprintf("%5d map brushes\n", nummapbrushes);
qprintf("%5d clip brushes\n", q1_numclipbrushes);
} //end of the function Q1_LoadMapFromBSP
开发者ID:morsik,项目名称:war-territory,代码行数:65,代码来源:map_q1.c
示例12: AAS_FlipAreaFaces
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_FlipAreaFaces(tmp_area_t *tmparea)
{
int side;
tmp_face_t *face;
plane_t *plane;
vec3_t wcenter, acenter = {0, 0, 0};
//winding_t *w;
float n;
for (n = 0, face = tmparea->tmpfaces; face; face = face->next[side])
{
if (!face->frontarea) Error("face %d has no front area\n", face->num);
//side of the face the area is on
side = face->frontarea != tmparea;
WindingCenter(face->winding, wcenter);
VectorAdd(acenter, wcenter, acenter);
n++;
} //end for
n = 1 / n;
VectorScale(acenter, n, acenter);
for (face = tmparea->tmpfaces; face; face = face->next[side])
{
//side of the face the area is on
side = face->frontarea != tmparea;
plane = &mapplanes[face->planenum ^ side];
if (DotProduct(plane->normal, acenter) - plane->dist < 0)
{
Log_Print("area %d face %d flipped: front area %d, back area %d\n", tmparea->areanum, face->num,
face->frontarea ? face->frontarea->areanum : 0,
face->backarea ? face->backarea->areanum : 0);
/*
face->planenum = face->planenum ^ 1;
w = face->winding;
face->winding = ReverseWinding(w);
FreeWinding(w);
*/
} //end if
#ifdef L_DEBUG
{
float dist;
vec3_t normal;
//check if the winding plane is the same as the face plane
WindingPlane(face->winding, normal, &dist);
plane = &mapplanes[face->planenum];
if (fabs(dist - plane->dist) > 0.4 ||
fabs(normal[0] - plane->normal[0]) > 0.0001 ||
fabs(normal[1] - plane->normal[1]) > 0.0001 ||
fabs(normal[2] - plane->normal[2]) > 0.0001)
{
Log_Write("area %d face %d winding plane unequal to face plane\r\n",
tmparea->areanum, face->num);
} //end if
}
#endif
} //end for
} //end of the function AAS_FlipAreaFaces
开发者ID:ArtanAhmeti,项目名称:lab,代码行数:65,代码来源:aas_create.c
示例13: RunThreadsOn
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void RunThreadsOn(int workcnt, qboolean showpacifier, void(*func)(int))
{
int i;
pthread_t work_threads[MAX_THREADS];
pthread_addr_t status;
pthread_attr_t attrib;
pthread_mutexattr_t mattrib;
int start, end;
Log_Print("pthread multi-threading\n");
start = I_FloatTime ();
dispatch = 0;
workcount = workcnt;
oldf = -1;
pacifier = showpacifier;
threaded = true;
if (numthreads < 1 || numthreads > MAX_THREADS) numthreads = 1;
if (pacifier)
setbuf (stdout, NULL);
if (!my_mutex)
{
my_mutex = GetMemory(sizeof(*my_mutex));
if (pthread_mutexattr_create (&mattrib) == -1)
Error ("pthread_mutex_attr_create failed");
if (pthread_mutexattr_setkind_np (&mattrib, MUTEX_FAST_NP) == -1)
Error ("pthread_mutexattr_setkind_np failed");
if (pthread_mutex_init (my_mutex, mattrib) == -1)
Error ("pthread_mutex_init failed");
}
if (pthread_attr_create (&attrib) == -1)
Error ("pthread_attr_create failed");
if (pthread_attr_setstacksize (&attrib, 0x100000) == -1)
Error ("pthread_attr_setstacksize failed");
for (i=0 ; i<numthreads ; i++)
{
if (pthread_create(&work_threads[i], attrib
, (pthread_startroutine_t)func, (pthread_addr_t)i) == -1)
Error ("pthread_create failed");
}
for (i=0 ; i<numthreads ; i++)
{
if (pthread_join (work_threads[i], &status) == -1)
Error ("pthread_join failed");
}
threaded = false;
end = I_FloatTime ();
if (pacifier)
printf (" (%i)\n", end-start);
} //end of the function RunThreadsOn
开发者ID:Cpasjuste,项目名称:quake3_pandora_gles,代码行数:64,代码来源:l_threads.c
示例14: CountTriangles
/*
=============
CountTriangles
=============
*/
void CountTriangles( void ) {
int i, numTris, numPatchTris;
dsurface_t *surface;
numTris = numPatchTris = 0;
for ( i = 0; i < q3_numDrawSurfaces; i++ ) {
surface = &drawSurfaces[i];
numTris += surface->numIndexes / 3;
if ( surface->patchWidth ) {
numPatchTris += surface->patchWidth * surface->patchHeight * 2;
}
}
Log_Print( "%6d triangles\n", numTris );
Log_Print( "%6d patch tris\n", numPatchTris );
}
开发者ID:tkmorris,项目名称:OpenMOHAA,代码行数:23,代码来源:l_bsp_q3.c
示例15: RunThreadsOn
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )(int) ) {
int threadid[MAX_THREADS];
HANDLE threadhandle[MAX_THREADS];
int i;
int start, end;
Log_Print( "Win32 multi-threading\n" );
start = I_FloatTime();
dispatch = 0;
workcount = workcnt;
oldf = -1;
pacifier = showpacifier;
threaded = true;
if ( numthreads == -1 ) {
ThreadSetDefault();
}
if ( numthreads < 1 || numthreads > MAX_THREADS ) {
numthreads = 1;
}
//
// run threads in parallel
//
InitializeCriticalSection( &crit );
numwaitingthreads = 0;
if ( numthreads == 1 ) { // use same thread
func( 0 );
} //end if
else
{
// printf("starting %d threads\n", numthreads);
for ( i = 0; i < numthreads; i++ )
{
threadhandle[i] = CreateThread(
NULL, // LPSECURITY_ATTRIBUTES lpsa,
0, // DWORD cbStack,
(LPTHREAD_START_ROUTINE)func, // LPTHREAD_START_ROUTINE lpStartAddr,
(LPVOID)i, // LPVOID lpvThreadParm,
0, // DWORD fdwCreate,
&threadid[i] );
// printf("started thread %d\n", i);
} //end for
for ( i = 0; i < numthreads; i++ )
WaitForSingleObject( threadhandle[i], INFINITE );
} //end else
DeleteCriticalSection( &crit );
threaded = false;
end = I_FloatTime();
if ( pacifier ) {
printf( " (%i)\n", end - start );
}
} //end of the function RunThreadsOn
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:63,代码来源:l_threads.c
示例16: Q2_LoadMapFromBSP
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void Q2_LoadMapFromBSP(char *filename, int offset, int length)
{
int i;
Log_Print("-- Q2_LoadMapFromBSP --\n");
//loaded map type
loadedmaptype = MAPTYPE_QUAKE2;
Log_Print("Loading map from %s...\n", filename);
//load the bsp file
Q2_LoadBSPFile(filename, offset, length);
//create an index from bsp planes to map planes
//DPlanes2MapPlanes();
//clear brush model numbers
for (i = 0; i < MAX_MAPFILE_BRUSHES; i++)
brushmodelnumbers[i] = -1;
nummapbrushsides = 0;
num_entities = 0;
Q2_ParseEntities();
//
for (i = 0; i < num_entities; i++)
{
Q2_ParseBSPEntity(i);
} //end for
//get the map mins and maxs from the world model
ClearBounds(map_mins, map_maxs);
for (i = 0; i < entities[0].numbrushes; i++)
{
if (mapbrushes[i].mins[0] > 4096)
{
continue; //no valid points
}
AddPointToBounds(mapbrushes[i].mins, map_mins, map_maxs);
AddPointToBounds(mapbrushes[i].maxs, map_mins, map_maxs);
} //end for
PrintMapInfo();
//
Q2_CreateMapTexinfo();
} //end of the function Q2_LoadMapFromBSP
开发者ID:morsik,项目名称:war-territory,代码行数:50,代码来源:map_q2.c
示例17: Q1_FixContentsTextures
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void Q1_FixContentsTextures(bspbrush_t *brushlist)
{
int i, texinfonum;
bspbrush_t *brush;
for (brush = brushlist; brush; brush = brush->next)
{
//only fix the textures of water, slime and lava brushes
if (brush->side != CONTENTS_WATER &&
brush->side != CONTENTS_SLIME &&
brush->side != CONTENTS_LAVA) continue;
//
for (i = 0; i < brush->numsides; i++)
{
texinfonum = brush->sides[i].texinfo;
if (Q1_TextureContents(map_texinfo[texinfonum].texture) == brush->side) break;
} //end for
//if no specific contents texture was found
if (i >= brush->numsides)
{
texinfonum = -1;
for (i = 0; i < map_numtexinfo; i++)
{
if (Q1_TextureContents(map_texinfo[i].texture) == brush->side)
{
texinfonum = i;
break;
} //end if
} //end for
} //end if
//
if (texinfonum >= 0)
{
//give all the brush sides this contents texture
for (i = 0; i < brush->numsides; i++)
{
brush->sides[i].texinfo = texinfonum;
} //end for
} //end if
else Log_Print("brush contents %d with wrong textures\n", brush->side);
//
} //end for
/*
for (brush = brushlist; brush; brush = brush->next)
{
//give all the brush sides this contents texture
for (i = 0; i < brush->numsides; i++)
{
if (Q1_TextureContents(map_texinfo[texinfonum].texture) != brush->side)
{
Error("brush contents %d with wrong contents textures %s\n", brush->side,
Q1_TextureContents(map_texinfo[texinfonum].texture));
} //end if
} //end for
} //end for*/
} //end of the function Q1_FixContentsTextures
开发者ID:he110world,项目名称:quake3-ios,代码行数:62,代码来源:map_q1.c
示例18: CheckBSPBrush
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void CheckBSPBrush(bspbrush_t *brush)
{
int i, j;
plane_t *plane1, *plane2;
//check if the brush is convex... flipped planes make a brush non-convex
for (i = 0; i < brush->numsides; i++)
{
for (j = 0; j < brush->numsides; j++)
{
if (i == j) continue;
plane1 = &mapplanes[brush->sides[i].planenum];
plane2 = &mapplanes[brush->sides[j].planenum];
//
if (WindingsNonConvex(brush->sides[i].winding,
brush->sides[j].winding,
plane1->normal, plane2->normal,
plane1->dist, plane2->dist))
{
Log_Print("non convex brush");
break;
} //end if
} //end for
} //end for
BoundBrush(brush);
//check for out of bound brushes
for (i = 0; i < 3; i++)
{
if (brush->mins[i] < -MAX_MAP_BOUNDS || brush->maxs[i] > MAX_MAP_BOUNDS)
{
Log_Print("brush: bounds out of range\n");
Log_Print("ob->mins[%d] = %f, ob->maxs[%d] = %f\n", i, brush->mins[i], i, brush->maxs[i]);
break;
} //end if
if (brush->mins[i] > MAX_MAP_BOUNDS || brush->maxs[i] < -MAX_MAP_BOUNDS)
{
Log_Print("brush: no visible sides on brush\n");
Log_Print("ob->mins[%d] = %f, ob->maxs[%d] = %f\n", i, brush->mins[i], i, brush->maxs[i]);
break;
} //end if
} //end for
} //end of the function CheckBSPBrush
开发者ID:Cpasjuste,项目名称:quake3_pandora_gles,代码行数:48,代码来源:csg.c
示例19: FloodPortals_r
void FloodPortals_r(node_t *node, int dist)
{
portal_t *p;
int s;
// int i;
Log_Print("\r%6d", ++numrec);
if(node->occupied)
{
Error("FloodPortals_r: node already occupied\n");
}
if(!node)
{
Error("FloodPortals_r: NULL node\n");
} //end if*/
node->occupied = dist;
for(p = node->portals; p; p = p->next[s])
{
s = (p->nodes[1] == node);
//if the node at the other side of the portal is occupied already
if(p->nodes[!s]->occupied)
{
continue;
}
//if it isn't possible to flood through this portal
if(!Portal_EntityFlood(p, s))
{
continue;
}
//flood recursively through the current portal
FloodPortals_r(p->nodes[!s], dist + 1);
} //end for
Log_Print("\r%6d", --numrec);
} //end of the function FloodPortals_r
开发者ID:Diskutant,项目名称:RTCW-SP,代码行数:42,代码来源:portals.c
示例20: Tree_Free
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void Tree_Free( tree_t *tree ) {
//if no tree just return
if ( !tree ) {
return;
}
//
freedtreemem = 0;
//
Tree_FreePortals_r( tree->headnode );
Tree_Free_r( tree->headnode );
#ifdef ME
freedtreemem += MemorySize( tree );
#endif //ME
FreeMemory( tree );
#ifdef ME
Log_Print( "freed " );
PrintMemorySize( freedtreemem );
Log_Print( " of tree memory\n" );
#endif //ME
} //end of the function Tree_Free
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:26,代码来源:tree.c
注:本文中的Log_Print函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论