//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int Export_BotLibShutdown( void ) { static int recursive = 0; if ( !BotLibSetup( "BotLibShutdown" ) ) { return BLERR_LIBRARYNOTSETUP; } // if ( recursive ) { return BLERR_NOERROR; } recursive = 1; // shutdown all AI subsystems BotShutdownChatAI(); //be_ai_chat.c BotShutdownMoveAI(); //be_ai_move.c BotShutdownGoalAI(); //be_ai_goal.c BotShutdownWeaponAI(); //be_ai_weap.c BotShutdownWeights(); //be_ai_weight.c BotShutdownCharacters(); //be_ai_char.c // shutdown AAS AAS_Shutdown(); // shutdown bot elemantary actions EA_Shutdown(); // free all libvars LibVarDeAllocAll(); // remove all global defines from the pre compiler PC_RemoveAllGlobalDefines(); // shut down library log file Log_Shutdown(); // botlibsetup = qfalse; botlibglobals.botlibsetup = qfalse; recursive = 0; // print any files still open PC_CheckOpenSourceHandles(); // #ifdef _DEBUG Log_AlwaysOpen( "memory.log" ); PrintMemoryLabels(); Log_Shutdown(); #endif return BLERR_NOERROR; } //end of the function Export_BotLibShutdown
//=========================================================================== // called at the start of every frame // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_StartFrame(float time) { aasworld.time = time; //unlink all entities that were not updated last frame AAS_UnlinkInvalidEntities(); //invalidate the entities AAS_InvalidateEntities(); //initialize AAS AAS_ContinueInit(time); // aasworld.frameroutingupdates = 0; // if (bot_developer) { if (LibVarGetValue("showcacheupdates")) { AAS_RoutingInfo(); LibVarSet("showcacheupdates", "0"); } //end if if (LibVarGetValue("showmemoryusage")) { PrintUsedMemorySize(); LibVarSet("showmemoryusage", "0"); } //end if if (LibVarGetValue("memorydump")) { PrintMemoryLabels(); LibVarSet("memorydump", "0"); } //end if } //end if // if (saveroutingcache->value) { AAS_WriteRouteCache(); LibVarSet("saveroutingcache", "0"); } //end if // aasworld.numframes++; return BLERR_NOERROR; } //end of the function AAS_StartFrame
//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int Export_BotLibShutdown(void) { if (!BotLibSetup("BotLibShutdown")) return BLERR_LIBRARYNOTSETUP; #ifndef DEMO //DumpFileCRCs(); #endif //DEMO // BotShutdownChatAI(); //be_ai_chat.c BotShutdownMoveAI(); //be_ai_move.c BotShutdownGoalAI(); //be_ai_goal.c BotShutdownWeaponAI(); //be_ai_weap.c BotShutdownWeights(); //be_ai_weight.c BotShutdownCharacters(); //be_ai_char.c //shud down aas AAS_Shutdown(); //shut down bot elemantary actions EA_Shutdown(); //free all libvars LibVarDeAllocAll(); //remove all global defines from the pre compiler PC_RemoveAllGlobalDefines(); //dump all allocated memory // DumpMemory(); #ifdef DEBUG PrintMemoryLabels(); #endif //shut down library log file Log_Shutdown(); // botlibsetup = qfalse; botlibglobals.botlibsetup = qfalse; // print any files still open PC_CheckOpenSourceHandles(); // return BLERR_NOERROR; } //end of the function Export_BotLibShutdown