void GameWorldView::DrawBoundaryStone(const MapPoint& pt, const DrawPoint pos, Visibility vis) { if(vis == VIS_INVISIBLE) return; bool isFoW = vis == VIS_FOW; const BoundaryStones& boundary_stones = isFoW ? gwv.GetYoungestFOWNode(pt).boundary_stones : GetWorld().GetNode(pt).boundary_stones; unsigned char owner = boundary_stones[0]; if(!owner) return; unsigned nation = GetWorld().GetPlayer(owner - 1).nation; unsigned player_color = GetWorld().GetPlayer(owner - 1).color; if(isFoW) player_color = CalcPlayerFOWDrawColor(player_color); LOADER.boundary_stone_cache[nation].draw(pos, isFoW ? FOW_DRAW_COLOR : COLOR_WHITE, player_color); for(unsigned i = 0; i < 3; ++i) { if(boundary_stones[i + 1]) { DrawPoint tmp = pos - DrawPoint((gwv.GetTerrainRenderer().GetNodePos(pt) - gwv.GetTerrainRenderer().GetNeighbourPos(pt, 3 + i)) / 2.0f); LOADER.boundary_stone_cache[nation].draw( tmp, isFoW ? FOW_DRAW_COLOR : COLOR_WHITE, player_color); } } }
void GameWorldView::DrawBoundaryStone(const int x, const int y, const MapCoord tx, const MapCoord ty, const int xpos, const int ypos, Visibility vis) { if(vis == VIS_INVISIBLE) // schwarz/unsichtbar, nichts zeichnen return; bool fow = !(vis == VIS_VISIBLE); unsigned char* boundary_stones = fow ? gwv->GetNode(tx, ty).fow[gwv->GetYoungestFOWNodePlayer(Point<MapCoord>(tx, ty))].boundary_stones : gwv->GetNode(tx, ty).boundary_stones; unsigned char owner = boundary_stones[0]; if(owner) { unsigned nation = gwv->GetPlayer(owner - 1)->nation; unsigned player_color = COLORS[gwv->GetPlayer(owner - 1)->color]; Loader::boundary_stone_cache[nation].draw(xpos, ypos, fow ? FOW_DRAW_COLOR : COLOR_WHITE, fow ? CalcPlayerFOWDrawColor(player_color) : player_color); for(unsigned i = 0; i < 3; ++i) { if(boundary_stones[i + 1]) { Loader::boundary_stone_cache[nation].draw( xpos - static_cast<int>((gwv->GetTerrainRenderer()->GetTerrainX(tx, ty) - gwv->GetTerrainRenderer()->GetTerrainXAround(tx, ty, 3 + i)) / 2.0f), ypos - static_cast<int>((gwv->GetTerrainRenderer()->GetTerrainY(tx, ty) - gwv->GetTerrainRenderer()->GetTerrainYAround(tx, ty, 3 + i)) / 2.0f), fow ? FOW_DRAW_COLOR : COLOR_WHITE, fow ? CalcPlayerFOWDrawColor(player_color) : player_color); Loader::boundary_stone_cache[nation].draw( xpos - static_cast<int>((gwv->GetTerrainRenderer()->GetTerrainX(tx, ty) - gwv->GetTerrainRenderer()->GetTerrainXAround(tx, ty, 3 + i)) / 2.0f), ypos - static_cast<int>((gwv->GetTerrainRenderer()->GetTerrainY(tx, ty) - gwv->GetTerrainRenderer()->GetTerrainYAround(tx, ty, 3 + i)) / 2.0f), fow ? FOW_DRAW_COLOR : COLOR_WHITE, fow ? CalcPlayerFOWDrawColor(player_color) : player_color); } } } }
void fowFlag::Draw(int x, int y) const { GameClientPlayer& owner = GAMECLIENT.GetPlayer(player); // Flagge LOADER.flag_cache[owner.nation][flag_type][0].draw(x, y, FOW_DRAW_COLOR, CalcPlayerFOWDrawColor(owner.color)); }
void fowFlag::Draw(int x, int y) const { // Flagge LOADER.GetNationImageN(GAMECLIENT.GetPlayer(player)->nation, 100 + flag_type * 20)->Draw(x, y, 0, 0, 0, 0, 0, 0, FOW_DRAW_COLOR, CalcPlayerFOWDrawColor(COLORS[GAMECLIENT.GetPlayer(player)->color])); // Schatten LOADER.GetNationImageN(GAMECLIENT.GetPlayer(player)->nation, 100 + flag_type * 20 + 10)->Draw(x, y, 0, 0, 0, 0, 0, 0, COLOR_SHADOW); }
fowFlag::fowFlag(const unsigned playerColor, const Nation nation, const FlagType flag_type) : color(CalcPlayerFOWDrawColor(playerColor)), nation(nation), flag_type(flag_type) {}