Permalink
Browse files

Added workaround for compiling libstageplugin against versions of Pla…

…yer without PLAYER_GRAPHICS2D_CMD_MULTILINE. The multiline message was added in Player SVN leading up to version 3.1, this maintains compatibility for 3.0 and earlier.
  • Loading branch information...
Rich Mattes
Rich Mattes committed Sep 15, 2010
1 parent f816200 commit 549c578301299364927e4f3df17eee746b7b56a1
Showing with 6 additions and 2 deletions.
  1. +6 −2 libstageplugin/p_graphics.cc
@@ -211,8 +211,11 @@ int InterfaceGraphics2d::ProcessMessage(QueuePointer & resp_queue,
PLAYER_GRAPHICS2D_CMD_POINTS, this->addr)
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_POLYLINE, this->addr)
+// Draw Multiline is new in Player 3.1, this ifdef allows Stage to build against older versions of Player
+#if defined PLAYER_GRAPHICS2D_CMD_MULTILINE
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_MULTILINE, this->addr)
+#endif
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_POLYGON, this->addr)) {
Message msg(*hdr, data);
@@ -252,7 +255,8 @@ void PlayerGraphics2dVis::RenderItem(Message & item) {
glEnd();
}
break;
-
+// Draw Multiline is new in Player 3.1, this ifdef allows Stage to build against older versions of Player
+#if defined PLAYER_GRAPHICS2D_CMD_MULTILINE
case PLAYER_GRAPHICS2D_CMD_MULTILINE: {
player_graphics2d_cmd_multiline_t
& data =
@@ -265,7 +269,7 @@ void PlayerGraphics2dVis::RenderItem(Message & item) {
}
break;
-
+#endif

0 comments on commit 549c578

Please sign in to comment.