From 549c578301299364927e4f3df17eee746b7b56a1 Mon Sep 17 00:00:00 2001
From: Rich Mattes <jpgr87@gmail>
Date: Tue, 14 Sep 2010 23:53:50 -0400
Subject: [PATCH] Added workaround for compiling libstageplugin against
versions of Player 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.
---
libstageplugin/p_graphics.cc | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/libstageplugin/p_graphics.cc b/libstageplugin/p_graphics.cc
index d1bae68..20d70c8 100644
--- a/libstageplugin/p_graphics.cc
+++ b/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
--
1.7.5.2