Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

bsp_debug_X.cpp

Go to the documentation of this file.
00001 #pragma warning(disable: 4786) 00002 /*------------------------------------ Includes ---------------------------------------------*/ 00003 #include "bsp_debug_X.h" 00004 #include "draw_line.h" 00005 00006 00007 #define COLOR_GRAPH 0x50 00008 #define COLOR_CENTRE_TO_WALL 0xf0 00009 #define COLOR_CENTRE_TO_PORTAL 0x12 00010 #define COLOR_ROOMS_BOUNDS 0x08 00011 00012 00013 /****************************************************************************************************/ 00014 // class cGame_World_Debug_Displayer 00015 /****************************************************************************************************/ 00016 void cGame_World_Debug_Displayer::Display_Areas(CDisplay & display , cGame_World & world) 00017 { 00018 // on parcours toutes les pieces pour les afficher 00019 std::vector<cSquare_Area*>::iterator Areas_Itr; 00020 for(Areas_Itr = world.List_Areas.begin() ; Areas_Itr != world.List_Areas.end() ; Areas_Itr++) 00021 Area_Displayer.Display(display, *(*Areas_Itr) ); 00022 00023 } 00024 00025 00026 /*--------------------------------------------------------------------------------------------------*/ 00027 void cGame_World_Debug_Displayer::Display_Graph(CDisplay & display , cGame_World & world) 00028 { 00029 00030 std::vector<cPortal*>::iterator portals_itr; 00031 cList_A_Star_Nodes::iterator voisins_itr; 00032 cList_A_Star_Nodes voisinage; 00033 // on parcours tous les portails 00034 for(portals_itr = world.List_Portals.begin() ; portals_itr != world.List_Portals.end() ; portals_itr++) 00035 { 00036 // on trace un segment entre ce portail et son voisin 00037 (*portals_itr)->Get_List_Neighbors(voisinage); 00038 for( voisins_itr = voisinage.begin(); voisins_itr != voisinage.end() ; voisins_itr++) 00039 { 00040 Draw_Line( g_pDisplay , (*portals_itr)->Position , (*voisins_itr)->Position , COLOR_GRAPH ); 00041 } 00042 } 00043 00044 } 00045 00046 /*--------------------------------------------------------------------------------------------------*/ 00047 void cSquare_Area_Debug_Displayer::Display(CDisplay & display , cSquare_Area & area) 00048 { 00049 cHV_Seg cote; 00050 cPoint2D center; 00051 cPoint2D p; 00052 00053 // affiche le contour de la piece 00054 area.Bounds.Get_Est_Seg(cote); 00055 Draw_Line( g_pDisplay ,cote.Get_p0(),cote.Get_p1(),COLOR_ROOMS_BOUNDS ); 00056 00057 area.Bounds.Get_Nord_Seg(cote); 00058 Draw_Line( g_pDisplay ,cote.Get_p0(),cote.Get_p1(),COLOR_ROOMS_BOUNDS ); 00059 00060 area.Bounds.Get_Ouest_Seg(cote); 00061 Draw_Line( g_pDisplay ,cote.Get_p0(),cote.Get_p1(),COLOR_ROOMS_BOUNDS ); 00062 00063 area.Bounds.Get_Sud_Seg(cote); 00064 Draw_Line( g_pDisplay ,cote.Get_p0(),cote.Get_p1(),COLOR_ROOMS_BOUNDS ); 00065 00066 area.Bounds.Get_Centre(center); 00067 00068 // affiche une ligne entre le centre de la piece et chaque portal 00069 std::vector<cPortal*>::iterator portals_itr; 00070 for( portals_itr = area.List_Portals.begin(); portals_itr != area.List_Portals.end(); portals_itr++) 00071 { 00072 Draw_Line( g_pDisplay ,center,(*portals_itr)->Position,COLOR_CENTRE_TO_PORTAL ); 00073 } 00074 00075 // affiche une ligne entre le centre de la piece et chaque mur 00076 std::vector<cHV_Seg*>::iterator walls_itr; 00077 for(walls_itr = area.List_Walls.begin() ; walls_itr != area.List_Walls.end() ; walls_itr++) 00078 { 00079 (*walls_itr)->Get_Middle(p); 00080 Draw_Line( g_pDisplay , center , p , COLOR_CENTRE_TO_WALL); 00081 } 00082 } 00083

Generated on Fri May 21 19:22:36 2004 for LIBELL by doxygen 1.3.7