@@ -415,7 +415,9 @@ void DrawingGameVisitor::visit(Road& road) {
415415 auto cosPerp = std::cos (roadPerpAngle);
416416 auto sinPerp = std::sin (roadPerpAngle);
417417
418- glColor3d (0 ., 0 ., 0 .);
418+ float * color = road.getOwner ().getColor ();
419+ glColor3d (color[0 ], color[1 ], color[2 ]);
420+
419421 glBindTexture (GL_TEXTURE_2D, 0 );
420422 glBegin (GL_QUADS);
421423 glVertex2d (startScreenPos.first - cosPerp * roadWidth, startScreenPos.second - sinPerp * roadWidth);
@@ -435,7 +437,9 @@ void DrawingGameVisitor::visit(Settlement& settlement) {
435437 auto centerScreenPos = coordToScreen (settlement.getLocation ());
436438
437439 glBindTexture (GL_TEXTURE_2D, 0 );
438- glColor3d (0 ., 0 ., 0 .);
440+ float * color = settlement.getOwner ().getColor ();
441+ glColor3d (color[0 ], color[1 ], color[2 ]);
442+
439443 glBegin (GL_QUADS);
440444 glVertex2d (centerScreenPos.first , centerScreenPos.second + settlementRadius);
441445 glVertex2d (centerScreenPos.first + settlementRadius, centerScreenPos.second );
@@ -454,7 +458,10 @@ void DrawingGameVisitor::visit(City& city) {
454458 auto centerScreenPos = coordToScreen (city.getLocation ());
455459
456460 glBindTexture (GL_TEXTURE_2D, 0 );
457- glColor3d (0 ., 0 ., 0 .);
461+
462+ float * color = city.getOwner ().getColor ();
463+ glColor3d (color[0 ], color[1 ], color[2 ]);
464+
458465 glBegin (GL_QUADS);
459466 glVertex2d (centerScreenPos.first + cityRadius, centerScreenPos.second + cityRadius);
460467 glVertex2d (centerScreenPos.first + cityRadius, centerScreenPos.second - cityRadius);
@@ -473,7 +480,10 @@ void DrawingGameVisitor::visit(Wonder& wonder) {
473480 auto centerScreenPos = coordToScreen (wonder.getLocation ());
474481
475482 glBindTexture (GL_TEXTURE_2D, 0 );
476- glColor3d (0 ., 0 ., 0 .);
483+
484+ float * color = wonder.getOwner ().getColor ();
485+ glColor3d (color[0 ], color[1 ], color[2 ]);
486+
477487 glBegin (GL_QUADS);
478488 glVertex2d (centerScreenPos.first + wonderRadius, centerScreenPos.second + wonderRadius);
479489 glVertex2d (centerScreenPos.first + wonderRadius, centerScreenPos.second - wonderRadius);
0 commit comments