about summary refs log tree commit diff
path: root/src/game/client/components/broadcast.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2010-05-29 07:25:38 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2010-05-29 07:25:38 +0000
commit72c06a258940696093f255fb1061beb58e1cdd0b (patch)
tree36b9a7712eec2d4f07837eab9c38ef1c5af85319 /src/game/client/components/broadcast.cpp
parente56feb597bc743677633432f77513b02907fd169 (diff)
downloadzcatch-72c06a258940696093f255fb1061beb58e1cdd0b.tar.gz
zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.zip
copied refactor to trunk
Diffstat (limited to 'src/game/client/components/broadcast.cpp')
-rw-r--r--src/game/client/components/broadcast.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/game/client/components/broadcast.cpp b/src/game/client/components/broadcast.cpp
index b86ed658..c3eb3b56 100644
--- a/src/game/client/components/broadcast.cpp
+++ b/src/game/client/components/broadcast.cpp
@@ -1,36 +1,36 @@
-#include <engine/e_client_interface.h>
-#include <engine/e_config.h>
-#include <engine/client/graphics.h>
-#include <game/generated/g_protocol.hpp>
-#include <game/generated/gc_data.hpp>
+#include <engine/shared/config.h>
+#include <engine/graphics.h>
+#include <engine/textrender.h>
+#include <game/generated/protocol.h>
+#include <game/generated/client_data.h>
 
-#include <game/client/gameclient.hpp>
+#include <game/client/gameclient.h>
 
-#include "broadcast.hpp"
+#include "broadcast.h"
 	
-void BROADCAST::on_reset()
+void CBroadcast::OnReset()
 {
-	broadcast_time = 0;
+	m_BroadcastTime = 0;
 }
 
-void BROADCAST::on_render()
+void CBroadcast::OnRender()
 {
 	Graphics()->MapScreen(0, 0, 300*Graphics()->ScreenAspect(), 300);
 		
-	if(time_get() < broadcast_time)
+	if(time_get() < m_BroadcastTime)
 	{
-		float w = gfx_text_width(0, 14, broadcast_text, -1);
-		gfx_text(0, 150*Graphics()->ScreenAspect()-w/2, 35, 14, broadcast_text, -1);
+		float w = TextRender()->TextWidth(0, 14, m_aBroadcastText, -1);
+		TextRender()->Text(0, 150*Graphics()->ScreenAspect()-w/2, 35, 14, m_aBroadcastText, -1);
 	}
 }
 
-void BROADCAST::on_message(int msgtype, void *rawmsg)
+void CBroadcast::OnMessage(int MsgType, void *pRawMsg)
 {
-	if(msgtype == NETMSGTYPE_SV_BROADCAST)
+	if(MsgType == NETMSGTYPE_SV_BROADCAST)
 	{
-		NETMSG_SV_BROADCAST *msg = (NETMSG_SV_BROADCAST *)rawmsg;
-		str_copy(broadcast_text, msg->message, sizeof(broadcast_text));
-		broadcast_time = time_get()+time_freq()*10;
+		CNetMsg_Sv_Broadcast *pMsg = (CNetMsg_Sv_Broadcast *)pRawMsg;
+		str_copy(m_aBroadcastText, pMsg->m_pMessage, sizeof(m_aBroadcastText));
+		m_BroadcastTime = time_get()+time_freq()*10;
 	}
 }