Browse files

Applied patch #3016030: Multiline Drawing for Player and Stage

  • Loading branch information...
1 parent 241008d commit 0a829cfe77b73e21cd6a1cd9669686d0863fa284 Rich Mattes committed with Sep 15, 2010
Showing with 20 additions and 0 deletions.
  1. +20 −0 libstageplugin/p_graphics.cc
View
20 libstageplugin/p_graphics.cc
@@ -232,6 +232,8 @@ int InterfaceGraphics2d::ProcessMessage(QueuePointer & resp_queue,
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_POLYLINE, this->addr)
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
+ PLAYER_GRAPHICS2D_CMD_MULTILINE, this->addr)
+ || Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_POLYGON, this->addr)) {
Message msg(*hdr, data);
vis->AppendItem(resp_queue.get(), msg);
@@ -270,6 +272,24 @@ void PlayerGraphics2dVis::RenderItem(Message & item) {
glEnd();
}
break;
+
+ case PLAYER_GRAPHICS2D_CMD_MULTILINE: {
+ player_graphics2d_cmd_multiline_t
+ & data =
+ *reinterpret_cast<player_graphics2d_cmd_multiline_t*> (item.GetPayload());
+ glPlayerColour(data.color);
+ glBegin(GL_LINES);
+ for (unsigned ii = 0; ii < data.points_count; ++ii)
+ glVertex3f(data.points[ii].px, data.points[ii].py, 0);
+ glEnd();
+ }
+ break;
+
+
+
+
+
+
case PLAYER_GRAPHICS2D_CMD_POLYGON: {
player_graphics2d_cmd_polygon_t
& data =

0 comments on commit 0a829cf

Please sign in to comment.