本文整理汇总了C++中botlib_import_t::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ botlib_import_t::Print方法的具体用法?C++ botlib_import_t::Print怎么用?C++ botlib_import_t::Print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botlib_import_t
的用法示例。
在下文中一共展示了botlib_import_t::Print方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AAS_FindPossiblePortals
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_FindPossiblePortals(void)
{
int i, numpossibleportals;
numpossibleportals = 0;
for (i = 1; i < aasworld.numareas; i++)
{
numpossibleportals += AAS_CheckAreaForPossiblePortals(i);
} //end for
botimport.Print(PRT_MESSAGE, "\r%6d possible portal areas\n", numpossibleportals);
} //end of the function AAS_FindPossiblePortals
示例2: ValidClientNumber
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
qboolean ValidClientNumber(int num, char *str)
{
if (num < 0 || num > botlibglobals.maxclients)
{
//weird: the disabled stuff results in a crash
botimport.Print(PRT_ERROR, "%s: invalid client number %d, [0, %d]\n",
str, num, botlibglobals.maxclients);
return qfalse;
} //end if
return qtrue;
} //end of the function BotValidateClientNumber
示例3: PrintContents
void PrintContents(int contents)
{
int i;
for(i = 0; contentnames[i].value; i++)
{
if(contents & contentnames[i].value)
{
botimport.Print(PRT_MESSAGE, "%s\n", contentnames[i].name);
} //end if
} //end for
} //end of the function PrintContents
示例4: Export_BotLibSetup
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
int Export_BotLibSetup(void)
{
int errnum;
botDeveloper = LibVarGetValue("bot_developer");
memset( &botlibglobals, 0, sizeof(botlibglobals) );
//initialize byte swapping (litte endian etc.)
// Swap_Init();
if(botDeveloper)
{
char *homedir, *gamedir;
char logfilename[MAX_OSPATH];
homedir = LibVarGetString("homedir");
gamedir = LibVarGetString("gamedir");
if (*homedir)
{
if(*gamedir)
Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, gamedir, PATH_SEP);
else
Com_sprintf(logfilename, sizeof(logfilename), "%s%c" BASEGAME "%cbotlib.log", homedir, PATH_SEP, PATH_SEP);
}
else
Com_sprintf(logfilename, sizeof(logfilename), "botlib.log");
Log_Open(logfilename);
}
botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n");
botlibglobals.maxclients = (int) LibVarValue("maxclients", "128");
botlibglobals.maxentities = (int) LibVarValue("maxentities", "1024");
errnum = AAS_Setup(); //be_aas_main.c
if (errnum != BLERR_NOERROR) return errnum;
errnum = EA_Setup(); //be_ea.c
if (errnum != BLERR_NOERROR) return errnum;
errnum = BotSetupWeaponAI(); //be_ai_weap.c
if (errnum != BLERR_NOERROR)return errnum;
errnum = BotSetupGoalAI(); //be_ai_goal.c
if (errnum != BLERR_NOERROR) return errnum;
errnum = BotSetupChatAI(); //be_ai_chat.c
if (errnum != BLERR_NOERROR) return errnum;
errnum = BotSetupMoveAI(); //be_ai_move.c
if (errnum != BLERR_NOERROR) return errnum;
botlibsetup = qtrue;
botlibglobals.botlibsetup = qtrue;
return BLERR_NOERROR;
} //end of the function Export_BotLibSetup
示例5: AAS_CountForcedClusterPortals
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_CountForcedClusterPortals(void)
{
int num, i;
num = 0;
for (i = 1; i < aasworld.numareas; i++)
{
if (aasworld.areasettings[i].contents & AREACONTENTS_CLUSTERPORTAL)
{
Log_Write("area %d is a forced portal area\r\n", i);
num++;
} //end if
} //end for
botimport.Print(PRT_MESSAGE, "%6d forced portal areas\n", num);
} //end of the function AAS_CountForcedClusterPortals
示例6: Export_BotLibLoadMap
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
int Export_BotLibLoadMap(const char *mapname)
{
#ifdef DEBUG
int starttime = Sys_MilliSeconds();
#endif
int errnum;
if (!BotLibSetup("BotLoadMap")) return BLERR_LIBRARYNOTSETUP;
//
botimport.Print(PRT_MESSAGE, "------------ Map Loading ------------\n");
//startup AAS for the current map, model and sound index
errnum = AAS_LoadMap(mapname);
if (errnum != BLERR_NOERROR) return errnum;
//initialize the items in the level
BotInitLevelItems(); //be_ai_goal.h
BotSetBrushModelTypes(); //be_ai_move.h
//
botimport.Print(PRT_MESSAGE, "-------------------------------------\n");
#ifdef DEBUG
botimport.Print(PRT_MESSAGE, "map loaded in %d msec\n", Sys_MilliSeconds() - starttime);
#endif
//
return BLERR_NOERROR;
} //end of the function Export_BotLibLoadMap
示例7: AAS_InsideFace
//===========================================================================
// tests if the given point is within the face boundaries
//
// Parameter: face : face to test if the point is in it
// pnormal : normal of the plane to use for the face
// point : point to test if inside face boundaries
// Returns: qtrue if the point is within the face boundaries
// Changes Globals: -
//===========================================================================
qboolean AAS_InsideFace( aas_face_t *face, vec3_t pnormal, vec3_t point, float epsilon ) {
int i, firstvertex, edgenum;
vec3_t v0;
vec3_t edgevec, pointvec, sepnormal;
aas_edge_t *edge;
#ifdef AAS_SAMPLE_DEBUG
int lastvertex = 0;
#endif //AAS_SAMPLE_DEBUG
if ( !( *aasworld ).loaded ) {
return qfalse;
}
for ( i = 0; i < face->numedges; i++ )
{
edgenum = ( *aasworld ).edgeindex[face->firstedge + i];
edge = &( *aasworld ).edges[abs( edgenum )];
//get the first vertex of the edge
firstvertex = edgenum < 0;
VectorCopy( ( *aasworld ).vertexes[edge->v[firstvertex]], v0 );
//edge vector
VectorSubtract( ( *aasworld ).vertexes[edge->v[!firstvertex]], v0, edgevec );
//
#ifdef AAS_SAMPLE_DEBUG
if ( lastvertex && lastvertex != edge->v[firstvertex] ) {
botimport.Print( PRT_MESSAGE, "winding not counter clockwise\n" );
} //end if
lastvertex = edge->v[!firstvertex];
#endif //AAS_SAMPLE_DEBUG
//vector from first edge point to point possible in face
VectorSubtract( point, v0, pointvec );
//get a vector pointing inside the face orthogonal to both the
//edge vector and the normal vector of the plane the face is in
//this vector defines a plane through the origin (first vertex of
//edge) and through both the edge vector and the normal vector
//of the plane
AAS_OrthogonalToVectors( edgevec, pnormal, sepnormal );
//check on wich side of the above plane the point is
//this is done by checking the sign of the dot product of the
//vector orthogonal vector from above and the vector from the
//origin (first vertex of edge) to the point
//if the dotproduct is smaller than zero the point is outside the face
if ( DotProduct( pointvec, sepnormal ) < -epsilon ) {
return qfalse;
}
} //end for
return qtrue;
} //end of the function AAS_InsideFace
示例8:
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
aas_link_t *AAS_AllocAASLink( void ) {
aas_link_t *link;
link = ( *aasworld ).freelinks;
if ( !link ) {
botimport.Print( PRT_FATAL, "empty aas link heap\n" );
return NULL;
} //end if
if ( ( *aasworld ).freelinks ) {
( *aasworld ).freelinks = ( *aasworld ).freelinks->next_ent;
}
if ( ( *aasworld ).freelinks ) {
( *aasworld ).freelinks->prev_ent = NULL;
}
return link;
} //end of the function AAS_AllocAASLink
示例9: AAS_TestMovementPrediction
void AAS_TestMovementPrediction(int entnum, vector3 *origin, vector3 *dir) {
vector3 velocity, cmdmove;
aas_clientmove_t move;
VectorClear(&velocity);
if (!AAS_Swimming(origin)) dir->z = 0;
VectorNormalize(dir);
VectorScale(dir, 400, &cmdmove);
cmdmove.z = 224;
AAS_ClearShownDebugLines();
AAS_PredictClientMovement(&move, entnum, origin, PRESENCE_NORMAL, qtrue,
&velocity, &cmdmove, 13, 13, 0.1f, SE_HITGROUND, 0, qtrue);//SE_LEAVEGROUND);
if (move.stopevent & SE_LEAVEGROUND)
{
botimport.Print(PRT_MESSAGE, "leave ground\n");
}
}
示例10: AAS_PresenceTypeBoundingBox
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_PresenceTypeBoundingBox(int presencetype, vec3_t mins, vec3_t maxs)
{
int index;
//bounding box size for each presence type
vec3_t boxmins[3] = {{0, 0, 0}, {-15, -15, -24}, {-15, -15, -24}};
vec3_t boxmaxs[3] = {{0, 0, 0}, { 15, 15, 32}, { 15, 15, 8}};
if (presencetype == PRESENCE_NORMAL) index = 1;
else if (presencetype == PRESENCE_CROUCH) index = 2;
else
{
botimport.Print(PRT_FATAL, "AAS_PresenceTypeBoundingBox: unknown presence type\n");
index = 2;
} //end if
VectorCopy(boxmins[index], mins);
VectorCopy(boxmaxs[index], maxs);
} //end of the function AAS_PresenceTypeBoundingBox
示例11:
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
aas_link_t *AAS_AllocAASLink(void)
{
aas_link_t *link;
link = aasworld.freelinks;
if (!link)
{
#ifndef BSPC
if (botDeveloper)
#endif
{
botimport.Print(PRT_FATAL, "empty aas link heap\n");
} //end if
return NULL;
} //end if
if (aasworld.freelinks) aasworld.freelinks = aasworld.freelinks->next_ent;
if (aasworld.freelinks) aasworld.freelinks->prev_ent = NULL;
numaaslinks--;
return link;
} //end of the function AAS_AllocAASLink
示例12: AAS_AreaInfo
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
int AAS_AreaInfo( int areanum, aas_areainfo_t *info )
{
aas_areasettings_t *settings;
if (!info)
return 0;
if (areanum <= 0 || areanum >= aasworld.numareas)
{
botimport.Print(PRT_ERROR, "AAS_AreaInfo: areanum %d out of range\n", areanum);
return 0;
} //end if
settings = &aasworld.areasettings[areanum];
info->cluster = settings->cluster;
info->contents = settings->contents;
info->flags = settings->areaflags;
info->presencetype = settings->presencetype;
VectorCopy(aasworld.areas[areanum].mins, info->mins);
VectorCopy(aasworld.areas[areanum].maxs, info->maxs);
VectorCopy(aasworld.areas[areanum].center, info->center);
return sizeof(aas_areainfo_t);
} //end of the function AAS_AreaInfo
示例13: AAS_TestMovementPrediction
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_TestMovementPrediction(int entnum, vec3_t origin, vec3_t dir)
{
vec3_t velocity, cmdmove;
aas_clientmove_t move;
VectorClear(velocity);
if (!AAS_Swimming(origin))
{
dir[2] = 0;
}
VectorNormalize(dir);
VectorScale(dir, 400, cmdmove);
cmdmove[2] = 224;
AAS_ClearShownDebugLines();
AAS_PredictClientMovement(&move, entnum, origin, PRESENCE_NORMAL, qtrue,
velocity, cmdmove, 13, 13, 0.1, SE_HITGROUND, 0, qtrue); //SE_LEAVEGROUND);
if (move.stopevent & SE_LEAVEGROUND)
{
botimport.Print(PRT_MESSAGE, "leave ground\n");
} //end if
} //end of the function TestMovementPrediction
示例14: sizeof
/*
============
GetBotLibAPI
============
*/
botlib_export_t *GetBotLibAPI( int apiVersion, botlib_import_t *import ) {
botimport = *import;
memset( &be_botlib_export, 0, sizeof( be_botlib_export ) );
if ( apiVersion != BOTLIB_API_VERSION ) {
botimport.Print( PRT_ERROR, "Mismatched BOTLIB_API_VERSION: expected %i, got %i\n", BOTLIB_API_VERSION, apiVersion );
return NULL;
}
Init_AAS_Export( &be_botlib_export.aas );
Init_EA_Export( &be_botlib_export.ea );
Init_AI_Export( &be_botlib_export.ai );
be_botlib_export.BotLibSetup = Export_BotLibSetup;
be_botlib_export.BotLibShutdown = Export_BotLibShutdown;
be_botlib_export.BotLibVarSet = Export_BotLibVarSet;
be_botlib_export.BotLibVarGet = Export_BotLibVarGet;
be_botlib_export.PC_AddGlobalDefine = PC_AddGlobalDefine;
#if defined RTCW_ET
be_botlib_export.PC_RemoveAllGlobalDefines = PC_RemoveAllGlobalDefines;
#endif // RTCW_XX
be_botlib_export.PC_LoadSourceHandle = PC_LoadSourceHandle;
be_botlib_export.PC_FreeSourceHandle = PC_FreeSourceHandle;
be_botlib_export.PC_ReadTokenHandle = PC_ReadTokenHandle;
be_botlib_export.PC_SourceFileAndLine = PC_SourceFileAndLine;
#if defined RTCW_ET
be_botlib_export.PC_UnreadLastTokenHandle = PC_UnreadLastTokenHandle;
#endif // RTCW_XX
be_botlib_export.BotLibStartFrame = Export_BotLibStartFrame;
be_botlib_export.BotLibLoadMap = Export_BotLibLoadMap;
be_botlib_export.BotLibUpdateEntity = Export_BotLibUpdateEntity;
be_botlib_export.Test = BotExportTest;
return &be_botlib_export;
}
示例15: assert
/*
============
GetBotLibAPI
============
*/
botlib_export_t *GetBotLibAPI(int apiVersion, botlib_import_t *import) {
assert(import); // bk001129 - this wasn't set for base/
botimport = *import;
assert(botimport.Print); // bk001129 - pars pro toto
Com_Memset( &be_botlib_export, 0, sizeof( be_botlib_export ) );
if ( apiVersion != BOTLIB_API_VERSION ) {
botimport.Print( PRT_ERROR, "Mismatched BOTLIB_API_VERSION: expected %i, got %i\n", BOTLIB_API_VERSION, apiVersion );
return NULL;
}
Init_AAS_Export(&be_botlib_export.aas);
Init_EA_Export(&be_botlib_export.ea);
Init_AI_Export(&be_botlib_export.ai);
be_botlib_export.BotLibSetup = Export_BotLibSetup;
be_botlib_export.BotLibShutdown = Export_BotLibShutdown;
be_botlib_export.BotLibVarSet = Export_BotLibVarSet;
be_botlib_export.BotLibVarGet = Export_BotLibVarGet;
be_botlib_export.PC_AddGlobalDefine = PC_AddGlobalDefine;
be_botlib_export.PC_LoadSourceHandle = PC_LoadSourceHandle;
be_botlib_export.PC_FreeSourceHandle = PC_FreeSourceHandle;
be_botlib_export.PC_ReadTokenHandle = PC_ReadTokenHandle;
be_botlib_export.PC_SourceFileAndLine = PC_SourceFileAndLine;
be_botlib_export.PC_LoadGlobalDefines = PC_LoadGlobalDefines;
be_botlib_export.PC_RemoveAllGlobalDefines = PC_RemoveAllGlobalDefines;
be_botlib_export.BotLibStartFrame = Export_BotLibStartFrame;
be_botlib_export.BotLibLoadMap = Export_BotLibLoadMap;
be_botlib_export.BotLibUpdateEntity = Export_BotLibUpdateEntity;
be_botlib_export.Test = BotExportTest;
return &be_botlib_export;
}