____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include "stratagus.h"
#include <stdlib.h>
#include "pathfinder.h"
Go to the source code of this file.
Classes | |
| struct | Node |
| struct | Open |
| struct | StatsNode |
Defines | |
| #define | AStarCosts(sx, sy, ex, ey) std::max(abs(sx - ex), abs(sy - ey)) |
| heuristic cost function for a* | |
| #define | MAX_CLOSE_SET_RATIO 4 |
| #define | MAX_OPEN_SET_RATIO 8 |
| #define | ProfileInit() |
| #define | ProfileBegin(f) |
| #define | ProfileEnd(f) |
| #define | ProfilePrint() |
| #define | AStarFindMinimum() (OpenSetSize - 1) |
Functions | |
| static | int (STDCALL *CostMoveToCallback)(int x |
| static void | InitVisionTable (void) |
| void | InitAStar (int mapWidth, int mapHeight, int(STDCALL *costMoveTo)(int x, int y, void *data)) |
| < Init the a* data structures | |
| void | FreeAStar (void) |
| Find and a* path for a unit. | |
| static void | AStarPrepare (void) |
| static void | AStarCleanUp () |
| static void | AStarRemoveMinimum (int pos) |
| static int | AStarAddNode (int x, int y, int o, int costs) |
| static void | AStarReplaceNode (int pos, int costs) |
| static int | AStarFindNode (int eo) |
| static void | AStarAddToClose (int node) |
| static int | CostMoveTo (int x, int y, void *data) |
| static int | AStarMarkGoal (int gx, int gy, int gw, int gh, int tilesizex, int tilesizey, int minrange, int maxrange, void *data) |
| static int | AStarSavePath (int startX, int startY, int endX, int endY, char *path, int pathLen) |
| static int | AStarFindSimplePath (int sx, int sy, int gx, int gy, int gw, int gh, int tilesizex, int tilesizey, int minrange, int maxrange, char *path, int pathlen, void *data) |
| int | AStarFindPath (int sx, int sy, int gx, int gy, int gw, int gh, int tilesizex, int tilesizey, int minrange, int maxrange, char *path, int pathlen, void *data) |
| StatsNode * | AStarGetStats () |
| void | AStarFreeStats (StatsNode *stats) |
| void | SetAStarFixedUnitCrossingCost (int cost) |
| int | GetAStarFixedUnitCrossingCost () |
| void | SetAStarMovingUnitCrossingCost (int cost) |
| int | GetAStarMovingUnitCrossingCost () |
| void | SetAStarUnknownTerrainCost (int cost) |
| int | GetAStarUnknownTerrainCost () |
Variables | |
| const int | Heading2X [9] = { 0,+1,+1,+1, 0,-1,-1,-1, 0 } |
| const int | Heading2Y [9] = { -1,-1, 0,+1,+1,+1, 0,-1, 0 } |
| const int | XY2Heading [3][3] = { {7,6,5},{0,0,4},{1,2,3}} |
| static Node * | AStarMatrix |
| cost matrix | |
| static int * | CloseSet |
| a list of close nodes, helps to speed up the matrix cleaning | |
| static int | CloseSetSize |
| static int | Threshold |
| static int | OpenSetMaxSize |
| static int | AStarMatrixSize |
| int | AStarFixedUnitCrossingCost |
| see pathfinder.h | |
| int | AStarMovingUnitCrossingCost = 5 |
| Whether to have knowledge of terrain that we haven't visited yet. | |
| bool | AStarKnowUnseenTerrain = false |
| Cost of using a square we haven't seen before. | |
| int | AStarUnknownTerrainCost = 2 |
| static int | AStarMapWidth |
| static int | AStarMapHeight |
| static int | AStarGoalX |
| static int | AStarGoalY |
| static Open * | OpenSet |
| The set of Open nodes. | |
| static int | OpenSetSize |
| The size of the open node set. | |
| static unsigned char * | VisionTable [3] |
| static int * | VisionLookup |
| static int | y |
| static int void * | data |
| static int * | CostMoveToCache |
| static const int | CacheNotSet = -5 |
Definition in file astar.cpp.
| #define AStarCosts | ( | sx, | |||
| sy, | |||||
| ex, | |||||
| ey | ) | std::max(abs(sx - ex), abs(sy - ey)) |
heuristic cost function for a*
Definition at line 61 of file astar.cpp.
Referenced by AStarFindPath().
| #define AStarFindMinimum | ( | ) | (OpenSetSize - 1) |
Find the best node in the current open node set Returns the position of this node in the open node set
Definition at line 385 of file astar.cpp.
Referenced by AStarFindPath().
| #define MAX_CLOSE_SET_RATIO 4 |
| #define MAX_OPEN_SET_RATIO 8 |
| #define ProfileBegin | ( | f | ) |
Definition at line 184 of file astar.cpp.
Referenced by AStarAddNode(), AStarCleanUp(), AStarFindNode(), AStarFindPath(), AStarFindSimplePath(), AStarMarkGoal(), AStarReplaceNode(), AStarSavePath(), and InitVisionTable().
| #define ProfileEnd | ( | f | ) |
Definition at line 185 of file astar.cpp.
Referenced by AStarAddNode(), AStarCleanUp(), AStarFindNode(), AStarFindPath(), AStarFindSimplePath(), AStarMarkGoal(), AStarReplaceNode(), AStarSavePath(), and InitVisionTable().
| #define ProfileInit | ( | ) |
| #define ProfilePrint | ( | ) |
| static int AStarAddNode | ( | int | x, | |
| int | y, | |||
| int | o, | |||
| int | costs | |||
| ) | [static] |
Add a new node to the open set (and update the heap structure)
Definition at line 403 of file astar.cpp.
References AStarGoalX, AStarGoalY, Open::Costs, Node::CostToGoal, Open::O, OpenSetMaxSize, OpenSetSize, PF_FAILED, ProfileBegin, ProfileEnd, Open::X, and Open::Y.
Referenced by AStarFindPath(), and AStarReplaceNode().
| static void AStarAddToClose | ( | int | node | ) | [static] |
Add a node to the closed set
Definition at line 515 of file astar.cpp.
References CloseSet, CloseSetSize, and Threshold.
Referenced by AStarFindPath(), and AStarMarkGoal().
| static void AStarCleanUp | ( | ) | [static] |
Clean up A*
Definition at line 365 of file astar.cpp.
References AStarPrepare(), CloseSet, CloseSetSize, Node::CostFromStart, Node::InGoal, ProfileBegin, ProfileEnd, and Threshold.
Referenced by AStarFindPath().
| static int AStarFindNode | ( | int | eo | ) | [static] |
Check if a node is already in the open set.
Definition at line 498 of file astar.cpp.
References OpenSetSize, ProfileBegin, and ProfileEnd.
Referenced by AStarFindPath().
| int AStarFindPath | ( | int | sx, | |
| int | sy, | |||
| int | gx, | |||
| int | gy, | |||
| int | gw, | |||
| int | gh, | |||
| int | tilesizex, | |||
| int | tilesizey, | |||
| int | minrange, | |||
| int | maxrange, | |||
| char * | path, | |||
| int | pathlen, | |||
| void * | data | |||
| ) |
Find path.
Definition at line 823 of file astar.cpp.
References AStarAddNode(), AStarAddToClose(), AStarCleanUp(), AStarCosts, AstarDebugPrint, AStarFindMinimum, AStarFindNode(), AStarFindSimplePath(), AStarGoalX, AStarGoalY, AStarMapHeight, AStarMapWidth, AStarMarkGoal(), AStarRemoveMinimum(), AStarReplaceNode(), AStarSavePath(), CacheNotSet, CloseSetSize, Node::CostFromStart, CostMoveTo(), CostMoveToCache, Node::CostToGoal, Node::Direction, Heading2X, Heading2Y, int(), Open::O, OpenSetSize, PF_FAILED, PF_REACHED, PF_UNREACHABLE, ProfileBegin, ProfileEnd, Open::X, Open::Y, and y.
Referenced by NewPath(), and PlaceReachable().
| static int AStarFindSimplePath | ( | int | sx, | |
| int | sy, | |||
| int | gx, | |||
| int | gy, | |||
| int | gw, | |||
| int | gh, | |||
| int | tilesizex, | |||
| int | tilesizey, | |||
| int | minrange, | |||
| int | maxrange, | |||
| char * | path, | |||
| int | pathlen, | |||
| void * | data | |||
| ) | [static] |
Optimization to find a simple path Check if we're at the goal or if it's 1 tile away
Definition at line 776 of file astar.cpp.
References CostMoveTo(), isqrt(), PF_FAILED, PF_REACHED, PF_UNREACHABLE, ProfileBegin, ProfileEnd, and XY2Heading.
Referenced by AStarFindPath().
| StatsNode* AStarGetStats | ( | ) |
Definition at line 1036 of file astar.cpp.
References AStarMapHeight, AStarMapWidth, Node::CostFromStart, StatsNode::CostFromStart, Open::Costs, StatsNode::Costs, Node::CostToGoal, StatsNode::CostToGoal, Node::Direction, StatsNode::Direction, Node::InGoal, StatsNode::InGoal, Open::O, and OpenSetSize.
| static int AStarMarkGoal | ( | int | gx, | |
| int | gy, | |||
| int | gw, | |||
| int | gh, | |||
| int | tilesizex, | |||
| int | tilesizey, | |||
| int | minrange, | |||
| int | maxrange, | |||
| void * | data | |||
| ) | [static] |
MarkAStarGoal
Definition at line 545 of file astar.cpp.
References AStarAddToClose(), AStarMapHeight, AStarMapWidth, CostMoveTo(), Node::InGoal, ProfileBegin, ProfileEnd, VisionLookup, VisionTable, and y.
Referenced by AStarFindPath().
| static void AStarPrepare | ( | void | ) | [static] |
Prepare pathfinder.
Definition at line 357 of file astar.cpp.
References AStarMatrixSize.
Referenced by AStarCleanUp().
| static void AStarRemoveMinimum | ( | int | pos | ) | [static] |
Remove the minimum from the open node set
Definition at line 391 of file astar.cpp.
References Assert, and OpenSetSize.
Referenced by AStarFindPath().
| static void AStarReplaceNode | ( | int | pos, | |
| int | costs | |||
| ) | [static] |
Change the cost associated to an open node. Can be further optimised knowing that the new cost MUST BE LOWER than the old one.
Definition at line 475 of file astar.cpp.
References AStarAddNode(), Open::Costs, Open::O, OpenSetSize, ProfileBegin, ProfileEnd, Open::X, and Open::Y.
Referenced by AStarFindPath().
| static int AStarSavePath | ( | int | startX, | |
| int | startY, | |||
| int | endX, | |||
| int | endY, | |||
| char * | path, | |||
| int | pathLen | |||
| ) | [static] |
Save the path
Definition at line 731 of file astar.cpp.
References AStarMapWidth, Node::Direction, Heading2X, Heading2Y, ProfileBegin, and ProfileEnd.
Referenced by AStarFindPath().
| static int CostMoveTo | ( | int | x, | |
| int | y, | |||
| void * | data | |||
| ) | [static] |
Compute the cost of crossing tile (x,y)
| x | X tile where to move. | |
| y | Y tile where to move. | |
| data | user data. |
Definition at line 533 of file astar.cpp.
References AStarMapWidth, CacheNotSet, and CostMoveToCache.
Referenced by AStarFindPath(), AStarFindSimplePath(), AStarMarkGoal(), and InitPathfinder().
| void FreeAStar | ( | void | ) |
Find and a* path for a unit.
Free A* data structure
Definition at line 329 of file astar.cpp.
References CloseSet, CloseSetSize, CostMoveToCache, OpenSetSize, ProfilePrint, VisionLookup, and VisionTable.
Referenced by FreePathfinder().
| int GetAStarFixedUnitCrossingCost | ( | ) |
Definition at line 1075 of file astar.cpp.
References AStarFixedUnitCrossingCost.
Referenced by tolua_get_AStarFixedUnitCrossingCost().
| int GetAStarMovingUnitCrossingCost | ( | ) |
Definition at line 1085 of file astar.cpp.
References AStarMovingUnitCrossingCost.
Referenced by tolua_get_AStarMovingUnitCrossingCost().
| int GetAStarUnknownTerrainCost | ( | ) |
Definition at line 1097 of file astar.cpp.
References AStarUnknownTerrainCost.
Referenced by tolua_get_AStarUnknownTerrainCost().
< Init the a* data structures
Init A* data structures
Definition at line 301 of file astar.cpp.
References Assert, AStarMapHeight, AStarMapWidth, AStarMatrixSize, CloseSet, CostMoveToCache, InitVisionTable(), MAX_CLOSE_SET_RATIO, MAX_OPEN_SET_RATIO, OpenSetMaxSize, ProfileInit, and Threshold.
Referenced by InitPathfinder().
| static void InitVisionTable | ( | void | ) | [static] |
Definition at line 194 of file astar.cpp.
References AStarMapWidth, isqrt(), ProfileBegin, ProfileEnd, VisionLookup, and VisionTable.
| static int | ( | STDCALL * | CostMoveToCallback | ) | [static] |
Referenced by MultiLineLabel::adjustSize(), AiAssignFreeUnitsToForce(), AiAttackWithForce(), AiAttackWithForceAt(), AiCheckBelongsToForce(), AiCheckUnits(), AiCleanForce(), AiCollectResources(), AiCountUnitBuilders(), AiEachCycle(), AiForceAttacks(), AiForceManager(), AiHelpMe(), AiInit(), AiMakeUnit(), AiPlanAttack(), AiReduceMadeInBuilt(), AiRepairUnit(), AStarFindPath(), AutoCast(), CalculateMaxIconSize(), CChunkParticle::CChunkParticle(), CclAiDump(), CclAiForce(), CclAiWait(), CclDefineAi(), CclDefineAiPlayer(), CclDefineCursor(), CclDefineViewports(), CclGetUnit(), CclGroup(), CclStratagusMap(), CclUnit(), gcn::FocusHandler::checkHotKey(), CleanButtons(), CleanFonts(), CleanUserInterface(), gcn::SDLInput::convertKeyCharacter(), DoDrawText(), CButtonPanel::DoKey(), gcn::Window::draw(), MultiLineLabel::draw(), CDecoVarSpriteBar::Draw(), CButtonPanel::Draw(), gcn::ImageFont::drawGlyph(), linedraw_gl::DrawLineClip(), DrawPatchTileIcons(), DrawPieMenu(), EditorUpdateDisplay(), FindLabel(), FixLabels(), gcn::FocusHandler::focusNext(), gcn::FocusHandler::focusPrevious(), FormatNumber(), FreeAi(), FreeOpenGLFonts(), GetNextOrder(), CParticleManager::getScreenPos(), GetSpriteIndex(), gcn::TextBox::getText(), gcn::ImageFont::getWidth(), HandleMouseOn(), gcn::ImageFont::ImageFont(), InitAiHelper(), InitButtons(), gcn::TextBox::keyPress(), CUserInterface::Load(), LoadFonts(), LoadGraphicPNG(), LoadVorbis(), MakeFontColorTextures(), MixMusicToStereo32(), MixSampleToStereo32(), NextPathElement(), gcn::Color::operator*(), PatchEditorCallbackMouse(), ReadDataDirectory(), RecalculateShownUnits(), ReloadFonts(), CGraphic::Resize(), SaveAiPlayer(), gcn::TextBox::setCaretPosition(), StartReplay(), gcn::FocusHandler::tabNext(), gcn::FocusHandler::tabPrevious(), tolua_get_stratagus_AlliedUnitRecyclingEfficiency(), tolua_get_stratagus_CFontColor_Colors(), tolua_get_stratagus_CMapInfo_PlayerType(), tolua_get_stratagus_CPieMenu_X(), tolua_get_stratagus_CPieMenu_Y(), tolua_get_stratagus_CPlayer_Units(), tolua_get_stratagus_CPlayer_UnitTypesCount(), tolua_get_stratagus_CServerSetup_CompOpt(), tolua_get_stratagus_CServerSetup_LastFrame(), tolua_get_stratagus_CServerSetup_Ready(), tolua_get_stratagus_CUserInterface_Resources(), tolua_get_stratagus_EnemyUnitRecyclingEfficiency(), tolua_get_stratagus_Hosts(), tolua_get_stratagus_Players(), tolua_get_stratagus_Settings_Presets(), tolua_set_CButtonPanel_X(), tolua_set_CButtonPanel_Y(), tolua_set_CFiller_X(), tolua_set_CFiller_Y(), tolua_set_CIcon_Frame(), tolua_set_CInfoPanel_X(), tolua_set_CInfoPanel_Y(), tolua_set_CMapArea_EndX(), tolua_set_CMapArea_EndY(), tolua_set_CMapArea_ScrollPaddingBottom(), tolua_set_CMapArea_ScrollPaddingLeft(), tolua_set_CMapArea_ScrollPaddingRight(), tolua_set_CMapArea_ScrollPaddingTop(), tolua_set_CMapArea_X(), tolua_set_CMapArea_Y(), tolua_set_CMapInfo_MapHeight(), tolua_set_CMapInfo_MapWidth(), tolua_set_CMinimap_H(), tolua_set_CMinimap_W(), tolua_set_CMinimap_X(), tolua_set_CMinimap_Y(), tolua_set_Color_a(), tolua_set_Color_b(), tolua_set_Color_g(), tolua_set_Color_r(), tolua_set_CPieMenu_MouseButton(), tolua_set_CPlayer_AiEnabled(), tolua_set_CPlayer_BuildingLimit(), tolua_set_CPlayer_Index(), tolua_set_CPlayer_NumBuildings(), tolua_set_CPlayer_Score(), tolua_set_CPlayer_StartX(), tolua_set_CPlayer_StartY(), tolua_set_CPlayer_TotalBuildings(), tolua_set_CPlayer_TotalKills(), tolua_set_CPlayer_TotalNumUnits(), tolua_set_CPlayer_TotalRazings(), tolua_set_CPlayer_TotalUnitLimit(), tolua_set_CPlayer_TotalUnits(), tolua_set_CPlayer_Type(), tolua_set_CPlayer_UnitLimit(), tolua_set_CPreference_unsigned_ShowOrders(), tolua_set_CResourceInfo_IconFrame(), tolua_set_CResourceInfo_IconX(), tolua_set_CResourceInfo_IconY(), tolua_set_CResourceInfo_TextX(), tolua_set_CResourceInfo_TextY(), tolua_set_CStatusLine_TextX(), tolua_set_CStatusLine_TextY(), tolua_set_CStatusLine_Width(), tolua_set_CUIButton_X(), tolua_set_CUIButton_Y(), tolua_set_CUITimer_X(), tolua_set_CUITimer_Y(), tolua_set_CUnit_X(), tolua_set_CUnit_Y(), tolua_set_CUnitType_MinAttackRange(), tolua_set_CursorX(), tolua_set_CursorY(), tolua_set_CUserInterface_MaxSelectedTextX(), tolua_set_CUserInterface_MaxSelectedTextY(), tolua_set_CUserInterface_MessageScrollSpeed(), tolua_set_CVideo_Depth(), tolua_set_CVideo_Height(), tolua_set_CVideo_Width(), tolua_set_NetLocalHostsSlot(), tolua_set_Settings_Difficulty(), tolua_set_Settings_GameType(), tolua_set_Settings_MapRichness(), tolua_set_Settings_NetGameType(), tolua_set_Settings_NumUnits(), tolua_set_Settings_Opponents(), tolua_set_Settings_Resources(), tolua_set_Settings_RevealMap(), tolua_set_SettingsPresets_Team(), tolua_set_SettingsPresets_Type(), tolua_set_stratagus_AlliedUnitRecyclingEfficiency(), tolua_set_stratagus_CFontColor_Colors(), tolua_set_stratagus_CMapInfo_PlayerType(), tolua_set_stratagus_CPieMenu_X(), tolua_set_stratagus_CPieMenu_Y(), tolua_set_stratagus_CPlayer_Units(), tolua_set_stratagus_CServerSetup_CompOpt(), tolua_set_stratagus_CServerSetup_LastFrame(), tolua_set_stratagus_CServerSetup_Ready(), tolua_set_stratagus_CUserInterface_Resources(), tolua_set_stratagus_EnemyUnitRecyclingEfficiency(), tolua_set_stratagus_Hosts(), tolua_set_stratagus_Players(), tolua_set_stratagus_Settings_Presets(), tolua_stratagus_ActionSetTimer00(), tolua_stratagus_CFont_Height00(), tolua_stratagus_CFont_Width00(), tolua_stratagus_CGraphic_New00(), tolua_stratagus_CGraphic_Resize00(), tolua_stratagus_CMenuScreen_run00(), tolua_stratagus_CMenuScreen_stop00(), tolua_stratagus_CMenuScreen_stopAll00(), tolua_stratagus_Color_new00(), tolua_stratagus_Color_new00_local(), tolua_stratagus_Container_add00(), tolua_stratagus_CPatch_getX00(), tolua_stratagus_CPatch_getY00(), tolua_stratagus_CPatch_setPos00(), tolua_stratagus_CPatch_setX00(), tolua_stratagus_CPatch_setY00(), tolua_stratagus_CPatchManager_add00(), tolua_stratagus_CPatchManager_getPatch00(), tolua_stratagus_CPatchManager_newPatchType00(), tolua_stratagus_CPatchType_getFlag00(), tolua_stratagus_CPatchType_getTileHeight00(), tolua_stratagus_CPatchType_getTileWidth00(), tolua_stratagus_CPieMenu_SetRadius00(), tolua_stratagus_CPlayer_SetStartView00(), tolua_stratagus_CPlayerColorGraphic_New00(), tolua_stratagus_CPosition_new00(), tolua_stratagus_CPosition_new00_local(), tolua_stratagus_CVideo_ResizeScreen00(), tolua_stratagus_CViewport_Viewport2MapX00(), tolua_stratagus_CViewport_Viewport2MapY00(), tolua_stratagus_DropDown_getSelected00(), tolua_stratagus_DropDown_setSelected00(), tolua_stratagus_DropDownWidget_setSize00(), tolua_stratagus_EditorSaveMap00(), tolua_stratagus_Exit00(), tolua_stratagus_GetDoubleClickDelay00(), tolua_stratagus_GetEffectsVolume00(), tolua_stratagus_GetGameSpeed00(), tolua_stratagus_GetHoldClickDelay00(), tolua_stratagus_GetMusicVolume00(), tolua_stratagus_GetNetworkState00(), tolua_stratagus_GetNumOpponents00(), tolua_stratagus_GetTimer00(), tolua_stratagus_GraphicAnimation_new00(), tolua_stratagus_GraphicAnimation_new00_local(), tolua_stratagus_Label_getAlignment00(), tolua_stratagus_Label_setAlignment00(), tolua_stratagus_ListBoxWidget_getSelected00(), tolua_stratagus_ListBoxWidget_new00(), tolua_stratagus_ListBoxWidget_new00_local(), tolua_stratagus_ListBoxWidget_setSelected00(), tolua_stratagus_MultiLineLabel_getAlignment00(), tolua_stratagus_MultiLineLabel_getLineWidth00(), tolua_stratagus_MultiLineLabel_getVerticalAlignment00(), tolua_stratagus_MultiLineLabel_setAlignment00(), tolua_stratagus_MultiLineLabel_setLineWidth00(), tolua_stratagus_MultiLineLabel_setVerticalAlignment00(), tolua_stratagus_NetworkInitServerConnect00(), tolua_stratagus_NetworkSetupServerAddress00(), tolua_stratagus_PlayFile00(), tolua_stratagus_PlayMusic00(), tolua_stratagus_SaveReplay00(), tolua_stratagus_ScrollArea_getScrollbarWidth00(), tolua_stratagus_ScrollArea_setScrollbarWidth00(), tolua_stratagus_ScrollingWidget_add00(), tolua_stratagus_ScrollingWidget_new00(), tolua_stratagus_ScrollingWidget_new00_local(), tolua_stratagus_SetChannelStereo00(), tolua_stratagus_SetChannelVolume00(), tolua_stratagus_SetDoubleClickDelay00(), tolua_stratagus_SetEffectsVolume00(), tolua_stratagus_SetGameSpeed00(), tolua_stratagus_SetHoldClickDelay00(), tolua_stratagus_SetMusicVolume00(), tolua_stratagus_SetTrigger00(), tolua_stratagus_Slider_getMarkerLength00(), tolua_stratagus_Slider_getOrientation00(), tolua_stratagus_Slider_setMarkerLength00(), tolua_stratagus_Slider_setOrientation00(), tolua_stratagus_StatBoxWidget_getPercent00(), tolua_stratagus_StatBoxWidget_new00(), tolua_stratagus_StatBoxWidget_new00_local(), tolua_stratagus_StatBoxWidget_setPercent00(), tolua_stratagus_StopChannel00(), tolua_stratagus_SyncRand00(), tolua_stratagus_SyncRand01(), tolua_stratagus_vector_CFiller___geti00(), tolua_stratagus_vector_CFiller___geti01(), tolua_stratagus_vector_CFiller___seti00(), tolua_stratagus_vector_CFiller__assign00(), tolua_stratagus_vector_CFiller__at00(), tolua_stratagus_vector_CFiller__at01(), tolua_stratagus_vector_CFiller__size00(), tolua_stratagus_vector_CUIButton___geti00(), tolua_stratagus_vector_CUIButton___geti01(), tolua_stratagus_vector_CUIButton___seti00(), tolua_stratagus_vector_CUIButton__assign00(), tolua_stratagus_vector_CUIButton__at00(), tolua_stratagus_vector_CUIButton__at01(), tolua_stratagus_vector_CUIButton__size00(), tolua_stratagus_vector_string___geti00(), tolua_stratagus_vector_string___geti01(), tolua_stratagus_vector_string___seti00(), tolua_stratagus_vector_string__assign00(), tolua_stratagus_vector_string__at00(), tolua_stratagus_vector_string__at01(), tolua_stratagus_vector_string__size00(), tolua_stratagus_Widget_getBorderSize00(), tolua_stratagus_Widget_getHeight00(), tolua_stratagus_Widget_getHotKey00(), tolua_stratagus_Widget_getWidth00(), tolua_stratagus_Widget_getX00(), tolua_stratagus_Widget_getY00(), tolua_stratagus_Widget_setBorderSize00(), tolua_stratagus_Widget_setHeight00(), tolua_stratagus_Widget_setHotKey00(), tolua_stratagus_Widget_setPosition00(), tolua_stratagus_Widget_setSize00(), tolua_stratagus_Widget_setWidth00(), tolua_stratagus_Widget_setX00(), tolua_stratagus_Widget_setY00(), tolua_stratagus_Window_getAlignment00(), tolua_stratagus_Window_getPadding00(), tolua_stratagus_Window_getTitleBarHeight00(), tolua_stratagus_Window_setAlignment00(), tolua_stratagus_Window_setPadding00(), tolua_stratagus_Window_setTitleBarHeight00(), tolua_stratagus_Windows_add00(), tolua_stratagus_Windows_new00(), tolua_stratagus_Windows_new00_local(), UpdateButtonPanelMultipleUnits(), UpdateButtonPanelSingleUnit(), UpdateDisplay(), gcn::Slider::valueToMarkerPosition(), VideoDrawNumber(), VideoDrawNumberClip(), VideoDrawReverseNumber(), and VideoDrawReverseNumberClip().
| void SetAStarFixedUnitCrossingCost | ( | int | cost | ) |
| void SetAStarMovingUnitCrossingCost | ( | int | cost | ) |
| void SetAStarUnknownTerrainCost | ( | int | cost | ) |
Definition at line 1090 of file astar.cpp.
References AStarUnknownTerrainCost.
Referenced by tolua_set_AStarUnknownTerrainCost().
see pathfinder.h
< cost associated to move on a tile occupied by a fixed unit
Definition at line 86 of file astar.cpp.
Referenced by GetAStarFixedUnitCrossingCost().
int AStarGoalX [static] |
int AStarGoalY [static] |
| bool AStarKnowUnseenTerrain = false |
Cost of using a square we haven't seen before.
Definition at line 88 of file astar.cpp.
Referenced by CostMoveTo(), tolua_get_AStarKnowUnseenTerrain(), and tolua_set_AStarKnowUnseenTerrain().
int AStarMapHeight [static] |
Definition at line 92 of file astar.cpp.
Referenced by AStarFindPath(), AStarGetStats(), AStarMarkGoal(), and InitAStar().
int AStarMapWidth [static] |
Definition at line 91 of file astar.cpp.
Referenced by AStarFindPath(), AStarGetStats(), AStarMarkGoal(), AStarSavePath(), CostMoveTo(), InitAStar(), and InitVisionTable().
Node* AStarMatrix [static] |
int AStarMatrixSize [static] |
| int AStarMovingUnitCrossingCost = 5 |
Whether to have knowledge of terrain that we haven't visited yet.
Definition at line 87 of file astar.cpp.
Referenced by CostMoveTo(), and GetAStarMovingUnitCrossingCost().
| int AStarUnknownTerrainCost = 2 |
Definition at line 89 of file astar.cpp.
Referenced by CostMoveTo(), GetAStarUnknownTerrainCost(), and SetAStarUnknownTerrainCost().
const int CacheNotSet = -5 [static] |
int* CloseSet [static] |
a list of close nodes, helps to speed up the matrix cleaning
Definition at line 77 of file astar.cpp.
Referenced by AStarAddToClose(), AStarCleanUp(), FreeAStar(), and InitAStar().
int CloseSetSize [static] |
Definition at line 78 of file astar.cpp.
Referenced by AStarAddToClose(), AStarCleanUp(), AStarFindPath(), and FreeAStar().
int* CostMoveToCache [static] |
Definition at line 111 of file astar.cpp.
Referenced by AStarFindPath(), CostMoveTo(), FreeAStar(), and InitAStar().
| int void* data |
Definition at line 110 of file astar.cpp.
Referenced by CclDefineGameSounds(), CclGetSound(), CclGetUnitType(), CclMakeSound(), CclMakeSoundGroup(), CclSoundForName(), gcn::ImageFont::ImageFont(), LoadWav(), PlayMovie(), and CGraphic::Resize().
| const int Heading2X[9] = { 0,+1,+1,+1, 0,-1,-1,-1, 0 } |
Definition at line 69 of file astar.cpp.
Referenced by AStarFindPath(), AStarSavePath(), DoActionMove(), and NextPathElement().
| const int Heading2Y[9] = { -1,-1, 0,+1,+1,+1, 0,-1, 0 } |
Definition at line 70 of file astar.cpp.
Referenced by AStarFindPath(), AStarSavePath(), DoActionMove(), and NextPathElement().
int OpenSetMaxSize [static] |
int OpenSetSize [static] |
The size of the open node set.
Definition at line 105 of file astar.cpp.
Referenced by AStarAddNode(), AStarFindNode(), AStarFindPath(), AStarGetStats(), AStarRemoveMinimum(), AStarReplaceNode(), and FreeAStar().
int Threshold [static] |
Definition at line 79 of file astar.cpp.
Referenced by AStarAddToClose(), AStarCleanUp(), and InitAStar().
int* VisionLookup [static] |
unsigned char* VisionTable[3] [static] |
| const int XY2Heading[3][3] = { {7,6,5},{0,0,4},{1,2,3}} |
| int y |
Definition at line 110 of file astar.cpp.
Referenced by gcn::Widget::_mouseInputMessage(), AiAttackWithForce(), AiBuildBuilding(), AiFindBuildingPlace2(), AiFindTarget(), AiForceAttacks(), AiMarkWaterTransporter(), AiMoveUnitInTheWay(), AiPlanAttack(), AiSendExplorers(), AStarFindPath(), AStarMarkGoal(), AttackUnitsInDistance(), CclDefineAiPlayer(), CclMissile(), CclUnit(), CheckCanBuild(), CommandSharedVision(), DoActionMove(), DoRightButton(), CUnit::Draw(), gcn::TextField::draw(), gcn::ListBox::draw(), DrawBuildingCursor(), gcn::DropDown::drawButton(), CMinimap::DrawCursor(), DrawEditorPanel(), DrawFogOfWarTile(), DrawInfoPanelNoneSelected(), gcn::SDLGraphics::drawLine(), linedraw_sdl::DrawLine(), linedraw_sdl::DrawLineClip(), CViewport::DrawMapBackgroundInViewport(), DrawMapCursor(), Missile::DrawMissile(), DrawPatchIcons(), DrawPatchTileIcons(), DrawPieMenu(), DrawPlayers(), DrawPopup(), DrawStartLocations(), DrawUnitIcons(), DrawUnitInfo(), DrawUnitSelection(), DrawUnitStats(), DropOutNearest(), DropOutOnSide(), FindRangeAttack(), FireMissile(), GetColor(), GetPieUnderCursor(), CParticleManager::getScreenPos(), HandleActionUnload(), HitUnit(), gcn::ImageFont::ImageFont(), CUnit::IsVisibleInViewport(), CFont::MeasureWidths(), MissileHit(), MissileVisibleInViewport(), MoveToTransporter(), NearestOfUnit(), ParabolicMissile(), PointToPointMissile(), CMap::Reveal(), SelectTargetUnitsOfAutoCast(), SendResource(), ShowTitleImage(), StartBuilding(), tolua_stratagus_Container_add00(), tolua_stratagus_CPatch_setPos00(), tolua_stratagus_CPatch_setY00(), tolua_stratagus_CPatchManager_add00(), tolua_stratagus_CPatchManager_getPatch00(), tolua_stratagus_CPatchType_getFlag00(), tolua_stratagus_CPlayer_SetStartView00(), tolua_stratagus_CPosition_new00(), tolua_stratagus_CPosition_new00_local(), tolua_stratagus_CViewport_Viewport2MapY00(), tolua_stratagus_ScrollingWidget_add00(), tolua_stratagus_Widget_setPosition00(), tolua_stratagus_Widget_setY00(), tolua_stratagus_Windows_add00(), UiCenterOnGroup(), UiCenterOnSelected(), UIHandleButtonDown(), UnitCountSeen(), UnloadUnit(), and ViewPointDistanceToMissile().
1.5.6