#include "DebugInfoShower.h" void DebugInfoShower::InfoGroup::Reset() { aInfo.DelAll(); } void DebugInfoShower::InfoGroup::AddInfo(const InfoCommon & info) { aInfo.Add( info ); } DebugInfoShower::DebugInfoShower() : m_aGroup( _FL_ ) { m_dwCounter = 0; } DebugInfoShower::~DebugInfoShower() { m_aGroup.DelAll(); m_dwCounter = 0; } bool DebugInfoShower::Create(MOPReader & reader) { SetUpdate(&DebugInfoShower::Work, ML_DEBUG); return true; } void _cdecl DebugInfoShower::Work(float fDeltaTime, long level) { // перейдем к новому кадру m_dwCounter++; // выведем сохраненную дебаг инфу for( long n=0; n=0 ) return n; n = m_aGroup.Add(); m_aGroup[n].sID = pcGroupID; m_aGroup[n].type = type; m_aGroup[n].dwLastCounter = m_dwCounter; return n; } void DebugInfoShower::ShowGroup(long ngrp) { if( ngrp<0 || ngrp>=m_aGroup ) return; switch( m_aGroup[ngrp].type ) { case it_line: ShowLines( m_aGroup[ngrp].aInfo ); break; case it_sphere: ShowSpheres( m_aGroup[ngrp].aInfo ); break; case it_poligon4: ShowPoligons4( m_aGroup[ngrp].aInfo ); break; } } void DebugInfoShower::ShowLines(array & aInfo) { for( long n=0; n & aInfo) { for( long n=0; n & aInfo) { for( long n=0; nFindObject( id_DebugInfoShower, safeptr ); if( !safeptr.Ptr() || !safeptr.Ptr()->Is(id_DebugInfoShower) ) return NULL; return (DebugInfoShower*)safeptr.Ptr(); } void DebugInfoShower::AddPoligon4(MissionObject* mo, const char* grpID, const char* addictID, dword col, Vector& v1, Vector& v2, Vector& v3, Vector& v4) { DebugInfoShower* pmo = FindShower(mo); if( pmo ) { string sID = grpID; sID += addictID; InfoCommon info; info.col = col; info.v4[0] = v1; info.v4[1] = v2; info.v4[2] = v3; info.v4[3] = v4; pmo->AddInfo(sID,it_poligon4,info); } } void DebugInfoShower::AddLine(MissionObject* mo, const char* grpID, const char* addictID, dword col, Vector& src, Vector& dst) { DebugInfoShower* pmo = FindShower(mo); if( pmo ) { string sID = grpID; sID += addictID; InfoCommon info; info.col = col; info.src = src; info.dst = dst; pmo->AddInfo(sID,it_line,info); } } void DebugInfoShower::AddSphere(MissionObject* mo, const char* grpID, const char* addictID, dword col, Vector& center, float rad) { DebugInfoShower* pmo = FindShower(mo); if( pmo ) { string sID = grpID; sID += addictID; InfoCommon info; info.col = col; info.centr = center; info.rad = rad; pmo->AddInfo(sID,it_sphere,info); } } MOP_BEGINLISTCG(DebugInfoShower, "DebugInfoShower", '1.00', 100, "Object for collect and output debug info", "Arcade Sea"); MOP_ENDLIST(DebugInfoShower)