void FEditorCommonDrawHelper::Draw(const FSceneView* View,class FPrimitiveDrawInterface* PDI) { if( !PDI->IsHitTesting() ) { if(bDrawBaseInfo) { DrawBaseInfo(View, PDI); } // Only draw the pivot if an actor is selected if( bDrawPivot && GEditor->GetSelectedActors()->CountSelections<AActor>() > 0 && View->Family->EngineShowFlags.Pivot ) { DrawPivot(View, PDI); } if( View->Family->EngineShowFlags.Grid && bDrawGrid) { bool bShouldUseNewLevelGrid = CVarEditorNewLevelGrid.GetValueOnGameThread() != 0; if(!View->IsPerspectiveProjection()) { // 3D looks better with the old grid (no thick lines) bShouldUseNewLevelGrid = false; } if(bShouldUseNewLevelGrid) { if(!GridWidget) { // defer creation to avoid GC issues GridWidget = new FGridWidget; } GridWidget->DrawNewGrid(View, PDI); } else { DrawOldGrid(View, PDI); } } } }
void TEnterprise::Draw_Navigation(Universe * a_pUniverse) { // To_Do: Implement Long range screen ! int XStart = 50; int YStart = 50; int XEnd = 688; int YEnd = 688; int DeltaX = XEnd - XStart; int DeltaY = YEnd - YStart; int StepX = DeltaX / 11; int StepY = DeltaY / 11; int CenterX = StepX / 2; int CenterY = StepY / 2; DrawNavigationLegenda(700, 50); for (int y=0;y<=11;y++) { al_draw_line(XStart,YStart + (y*StepY),XEnd,YStart + (y*StepY),m_pEngine->m_clRED,2); for (int x=0; x<=11;x++) { al_draw_line(XStart+ (x*StepX),YStart ,XStart+ (x*StepX),YEnd ,m_pEngine->m_clRED,2); if ((x>0) && (y>0)) { int nColumn = x+m_nNavigationXOffset; int nRow = y+m_nNavigationYOffset; if (nColumn >= UNIVERSE_SIZE) { nColumn -= UNIVERSE_SIZE; } else if (nColumn <0) { nColumn += UNIVERSE_SIZE; } if (nRow >= UNIVERSE_SIZE) { nRow -= UNIVERSE_SIZE; } else if (nRow <0) { nRow += UNIVERSE_SIZE; } // Draw the Sector Info // plot enterprise position if ((nColumn == m_nSectorPositionX)&& (nRow == m_nSectorPositionY)) { al_draw_filled_circle(x*StepX+15,y*StepY+7,5,m_pEngine->m_clWHITE); al_draw_filled_rectangle(x*StepX+3,y*StepY+5,x*StepX+17,y*StepY+9,m_pEngine->m_clWHITE); al_draw_filled_rectangle(x*StepX,y*StepY-1,x*StepX+8,y*StepY+2,m_pEngine->m_clWHITE); al_draw_filled_rectangle(x*StepX,y*StepY+12,x*StepX+8,y*StepY+15,m_pEngine->m_clWHITE); } if ((a_pUniverse->m_nSector[nColumn][nRow].m_blKnown)||(g_blGodMode)) { switch (m_NavigationMode) { case NAV_TOPO: DrawPlanetInfo(a_pUniverse->m_nSector[nColumn][nRow],x*StepX+CenterX,y*StepY+CenterY); break; case NAV_TACTICAL: DrawTacticalInfo(a_pUniverse->m_nSector[nColumn][nRow],x*StepX,y*StepY,StepX,StepY); break; case NAV_OCCUPATION: DrawOccupationInfo(a_pUniverse->m_nSector[nColumn][nRow],x*StepX,y*StepY,StepX,StepY); DrawBaseInfo(a_pUniverse->m_nSector[nColumn][nRow],x*StepX+CenterX-4,y*StepY+CenterY+4); break; default: break; } } else { if (m_NavigationMode==NAV_OCCUPATION) { DrawOccupationInfo(a_pUniverse->m_nSector[nColumn][nRow],x*StepX,y*StepY,StepX,StepY); } else { al_draw_text(FontManager::GetFont(FONT::SMALL),m_pEngine->m_clWHITE, x*StepX+(CenterX/2),y*StepY+(CenterY/2), 0,"?"); } } } } } int nVal = m_lstHealth[HLT_COMPUTER]+m_lstHealth[HLT_SENSOR]; for (int i=0;i< (150 - nVal) ;i++) { int nX = rand() % 800; int nY = rand() % 800; al_draw_filled_circle(nX,nY,(150 - nVal),m_pEngine->m_clBLACK); } //al_draw_rectangle(XStart+ (5*StepX),YStart + (5*StepY),XStart+ (6*StepX),YStart + (6*StepY),m_pEngine->m_clBLUE,2); }