[Gcblue-commits] gcb_wx/src/sim Game.cpp,1.78,1.79 tc3DViewer.cpp,1.29,1.30 tcCreditView.cpp,1.10,1.
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-05-14 23:37:19
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1674/src/sim Modified Files: Game.cpp tc3DViewer.cpp tcCreditView.cpp tcEditControl.cpp tcObjectControl.cpp tcTime.cpp Log Message: Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCreditView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcCreditView.cpp 20 Mar 2004 18:46:46 -0000 1.10 --- tcCreditView.cpp 14 May 2004 23:37:08 -0000 1.11 *************** *** 1,6 **** /* ! ** tcCreditView.cpp ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- /* ! ** @file tcCreditView.cpp ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 33,36 **** --- 33,37 ---- #include "tcString.h" #include "wxcommands.h" + #include "tcTime.h" using namespace Gdiplus; *************** *** 38,302 **** void tcCreditView::AddCredit(tcString& s, float afTrailSpace, int effect) { ! if (mnCredits >= MAX_CREDITS) {return;} ! maCredit[mnCredits].mfTrailSpace = afTrailSpace; ! maCredit[mnCredits].mnEffect = effect; ! maCredit[mnCredits++].mzCaption = s; } /*******************************************************************************/ bool tcCreditView::Init() { ! tcString s; ! s = "------- C R E D I T S -------"; ! AddCredit(s, 40.0f, 1); ! s = "Dewitt \"Cole\" Colclough"; ! AddCredit(s, 25.0f, 1); ! s = "Project manager and lead developer\n"; ! AddCredit(s, 80.0f, 0); ! s = "Marcelo C\341ceres (op4_delta)"; ! AddCredit(s, 25.0f, 1); ! s = "3D art"; ! AddCredit(s, 60.0f, 0); ! s = "Marco Belli"; ! AddCredit(s, 25.0f, 1); ! s = "Developer - Sound, Linux port"; ! AddCredit(s, 60.0f, 0); ! s = "Jason Morris"; ! AddCredit(s, 25.0f, 1); ! s = "Developer"; ! AddCredit(s, 60.0f, 0); ! s = "Test\n"; ! AddCredit(s, 23.0f, 1); ! AddCredit(tcString("Marco Belli"), 12.0f, 2); ! AddCredit(tcString("Marcelo C\341ceres"), 12.0f, 2); ! AddCredit(tcString("Rob Carpenter"), 12.0f, 2); ! AddCredit(tcString("Paul Daly"), 12.0f, 2); ! AddCredit(tcString("Dust"), 12.0f, 2); ! AddCredit(tcString("Jason Morris"), 12.0f, 2); ! AddCredit(tcString("Andrew Platfoot"), 12.0f, 2); ! AddCredit(tcString("Justin Priestman"), 12.0f, 2); ! AddCredit(tcString("Gregg Smith"), 38.0f+12.0f, 2); ! s = "Some 2D art courtesy of U.S. Navy, www.news.navy.mil/view_galleries.asp \n"; ! AddCredit(s, 60.0f, 0); ! s = "3D sky code\n"; ! AddCredit(s, 25.0f, 0); ! s = "Combat Simulator Project, csp.sourceforge.net \n"; ! AddCredit(s, 60.0f, 1); ! s = "Map data based on GTOPO30 archive distributed by the \nLand Processes Distributed Active Archive Center (LP DAAC)\nlpdaac.usgs.gov \n"; ! AddCredit(s, 100.0f, 0); ! s = "Thanks to the developers of these software libraries:\n"; ! AddCredit(s, 30.0f, 0); ! s = "wxWindows\n"; ! AddCredit(s, 20.0f, 0); ! s = "www.wxwindows.org\n"; ! AddCredit(s, 30.0f, 0); ! s = "Python 2.3\n"; ! AddCredit(s, 20.0f, 0); ! s = "www.python.org\n"; ! AddCredit(s, 30.0f, 0); ! s = "Boost Python\n"; ! AddCredit(s, 20.0f, 0); ! s = "www.boost.org\n"; ! AddCredit(s, 30.0f, 0); ! s = "OpenSceneGraph\n"; ! AddCredit(s, 20.0f, 0); ! s = "openscenegraph.sourceforge.net\n"; ! AddCredit(s, 60.0f, 0); ! s = "Special thanks to:"; ! AddCredit(s, 30.0f, 0); ! s = "Harpoon HQ, www.harpoonhq.com\n"; ! AddCredit(s, 30.0f, 0); ! s = "Mille-Sabords, www.mille-sabords.com\n"; ! AddCredit(s, 30.0f, 0); ! s = "Seawolves Surface Division, www.seawolves.org/fc\n"; ! AddCredit(s, 30.0f, 0); ! s = "and\n"; ! AddCredit(s, 30.0f, 0); ! ! s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; ! AddCredit(s, 120.0f, 0); - s = "GLOBAL CONFLICT BLUE"; - AddCredit(s, 20.0f, 0); ! s = "An open source project"; ! AddCredit(s, 20.0f, 0); ! s = "www.gcblue.com"; ! AddCredit(s, 20.0f, 0); ! s = "Copyright (C) 2002-2004, All rights reserved.\n"; ! AddCredit(s, 60.0f, 0); - FontFamily ff(L"Arial"); - mpFont = new Font(&ff,16,FontStyleRegular,UnitPixel); - if (mpFont == NULL) { - WTL("tcCreditView - mpFont creation failed\n"); - return false; - } - mpFontLarge = new Font(&ff,20,FontStyleBold,UnitPixel); - if (mpFontLarge == NULL) { - WTL("tcCreditView - mpFontLarge creation failed\n"); - return false; - } - mpFontSmall = new Font(&ff,12,FontStyleRegular,UnitPixel); - if (mpFontSmall == NULL) { - WTL("tcCreditView - mpFontSmall creation failed\n"); - return false; - } ! mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB ! if (mpBrush == NULL) { ! WTL("tcCreditView - mpBrush creation failed\n"); ! return false; ! } ! mpPen = new Pen(Color(255,200,200,200),2); ! if (mpPen == NULL) { ! WTL("tcCreditView - mpPen creation failed\n"); ! return false; ! } ! Rewind(); ! return true; } /*******************************************************************************/ ! int tcCreditView::Draw() { ! static WCHAR szwchar[256]; ! UINT32 nDeltaTime = mcTime.snCount_30Hz - mnStartTime; ! ! Graphics *pGraphics; ! Erase(); ! if (!GetGraphics(pGraphics)) { ! return false; ! } ! DrawBackground(pGraphics); ! // Get the text rendering hint. ! TextRenderingHint oldhint = pGraphics->GetTextRenderingHint(); ! // Set the text rendering hint to TextRenderingHintAntiAlias. ! pGraphics->SetTextRenderingHint(TextRenderingHintAntiAlias); - float fY = (float)mnHeight - 2*0.5f*(float)nDeltaTime; - float fX = 0.5f*(float)mnWidth; - - const UINT32 nColorFade = 0x8E328032; - const UINT32 nColorBright = 0xFE64FF64; - mpBrush->SetColor(Color(nColorBright)); // font color - //DrawTextCentered(pGraphics, mpFont, mpBrush, crawlstring.GetBuffer(), fX,fY); - static int nFlashId = -1; - static bool bFlash = false; - static UINT32 snFocusTime; - static tcString szFocus; ! // reset static variables if rewind occured ! if (mbDrawRewind) { ! nFlashId = -1; ! bFlash = false; ! mbDrawRewind = false; ! } ! if (bFlash) ! { ! if (nFlashId >= 0) {szFocus = maCredit[nFlashId].mzCaption;} ! snFocusTime = mcTime.snCount_30Hz; ! mpBrush->SetColor(Color(255,255,255,255)); ! pGraphics->FillRectangle(mpBrush,0,0,mnWidth,mnHeight); ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); ! } ! if (nFlashId >= 0) { ! UINT32 nDeltaFocusTime = (mcTime.snCount_30Hz - snFocusTime); ! } ! for (int n=0;n<(int)mnCredits;n++) { ! tcString s = maCredit[n].mzCaption; ! const float fEffectZone = 60.0f; ! float dyeffect = fY - ((float)mnHeight - fEffectZone); ! if ((dyeffect >= 0)&&(dyeffect <= fEffectZone)) { ! mpBrush->SetColor(Color(nColorFade)); // font color ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 40.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 40.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 30.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 30.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 20.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 20.0f*dyeffect,fY); ! mpBrush->SetColor(Color(nColorBright)); // font color ! } ! else if (fY <= (float)mnHeight) { ! if ((n > nFlashId)&&(maCredit[n].mnEffect == 1)) { ! nFlashId = n; ! bFlash = true; ! } ! else { ! bFlash = false; ! } ! Font *pFont = mpFont; ! if (maCredit[n].mnEffect == 1) ! { ! pFont = mpFontLarge; ! } ! else if (maCredit[n].mnEffect == 2) ! { ! pFont = mpFontSmall; ! } ! mpBrush->SetColor(Color(nColorFade)); // font color ! ! DrawTextCentered(pGraphics, pFont, mpBrush, s.GetBuffer(), ! fX + 1.0f,fY + 1.0f); ! mpBrush->SetColor(Color(nColorBright)); // font color ! DrawTextCentered(pGraphics, pFont, mpBrush, s.GetBuffer(), fX,fY); ! } ! fY += maCredit[n].mfTrailSpace; ! } ! pGraphics->SetTextRenderingHint(oldhint); ! ReleaseGraphics(pGraphics); ! DrawBorder(); ! // rewind after credits are done crawling ! if (fY < -100.0f) { ! Rewind(); ! } ! return true; } --- 39,312 ---- void tcCreditView::AddCredit(tcString& s, float afTrailSpace, int effect) { ! if (mnCredits >= MAX_CREDITS) {return;} ! maCredit[mnCredits].mfTrailSpace = afTrailSpace; ! maCredit[mnCredits].mnEffect = effect; ! maCredit[mnCredits++].mzCaption = s; } /*******************************************************************************/ bool tcCreditView::Init() { ! tcString s; ! s = "------- C R E D I T S -------"; ! AddCredit(s, 40.0f, 1); ! s = "Dewitt \"Cole\" Colclough"; ! AddCredit(s, 25.0f, 1); ! s = "Project manager and lead developer\n"; ! AddCredit(s, 80.0f, 0); ! s = "Marcelo C\341ceres (op4_delta)"; ! AddCredit(s, 25.0f, 1); ! s = "3D art"; ! AddCredit(s, 60.0f, 0); ! s = "Marco Belli"; ! AddCredit(s, 25.0f, 1); ! s = "Developer - Sound, Linux port"; ! AddCredit(s, 60.0f, 0); ! s = "Jason Morris"; ! AddCredit(s, 25.0f, 1); ! s = "Developer"; ! AddCredit(s, 60.0f, 0); ! s = "Test\n"; ! AddCredit(s, 23.0f, 1); ! AddCredit(tcString("Marco Belli"), 12.0f, 2); ! AddCredit(tcString("Marcelo C\341ceres"), 12.0f, 2); ! AddCredit(tcString("Rob Carpenter"), 12.0f, 2); ! AddCredit(tcString("Paul Daly"), 12.0f, 2); ! AddCredit(tcString("Dust"), 12.0f, 2); ! AddCredit(tcString("Jason Morris"), 12.0f, 2); ! AddCredit(tcString("Andrew Platfoot"), 12.0f, 2); ! AddCredit(tcString("Justin Priestman"), 12.0f, 2); ! AddCredit(tcString("Gregg Smith"), 38.0f+12.0f, 2); ! s = "Some 2D art courtesy of U.S. Navy, www.news.navy.mil/view_galleries.asp \n"; ! AddCredit(s, 60.0f, 0); ! s = "3D sky code\n"; ! AddCredit(s, 25.0f, 0); ! s = "Combat Simulator Project, csp.sourceforge.net \n"; ! AddCredit(s, 60.0f, 1); ! s = "Map data based on GTOPO30 archive distributed by the \nLand Processes Distributed Active Archive Center (LP DAAC)\nlpdaac.usgs.gov \n"; ! AddCredit(s, 100.0f, 0); ! s = "Thanks to the developers of these software libraries:\n"; ! AddCredit(s, 30.0f, 0); ! s = "wxWindows\n"; ! AddCredit(s, 20.0f, 0); ! s = "www.wxwindows.org\n"; ! AddCredit(s, 30.0f, 0); ! s = "Python 2.3\n"; ! AddCredit(s, 20.0f, 0); ! s = "www.python.org\n"; ! AddCredit(s, 30.0f, 0); ! s = "Boost Python\n"; ! AddCredit(s, 20.0f, 0); ! s = "www.boost.org\n"; ! AddCredit(s, 30.0f, 0); ! s = "OpenSceneGraph\n"; ! AddCredit(s, 20.0f, 0); ! s = "openscenegraph.sourceforge.net\n"; ! AddCredit(s, 60.0f, 0); ! s = "Special thanks to:"; ! AddCredit(s, 30.0f, 0); ! s = "Harpoon HQ, www.harpoonhq.com\n"; ! AddCredit(s, 30.0f, 0); ! s = "Mille-Sabords, www.mille-sabords.com\n"; ! AddCredit(s, 30.0f, 0); ! s = "Seawolves Surface Division, www.seawolves.org/fc\n"; ! AddCredit(s, 30.0f, 0); ! s = "and\n"; ! AddCredit(s, 30.0f, 0); + s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; + AddCredit(s, 120.0f, 0); ! s = "GLOBAL CONFLICT BLUE"; ! AddCredit(s, 20.0f, 0); ! s = "An open source project"; ! AddCredit(s, 20.0f, 0); ! s = "www.gcblue.com"; ! AddCredit(s, 20.0f, 0); + s = "Copyright (C) 2002-2004, All rights reserved.\n"; + AddCredit(s, 60.0f, 0); ! FontFamily ff(L"Arial"); ! mpFont = new Font(&ff,16,FontStyleRegular,UnitPixel); ! if (mpFont == NULL) { ! WTL("tcCreditView - mpFont creation failed\n"); ! return false; ! } ! mpFontLarge = new Font(&ff,20,FontStyleBold,UnitPixel); ! if (mpFontLarge == NULL) { ! WTL("tcCreditView - mpFontLarge creation failed\n"); ! return false; ! } ! mpFontSmall = new Font(&ff,12,FontStyleRegular,UnitPixel); ! if (mpFontSmall == NULL) { ! WTL("tcCreditView - mpFontSmall creation failed\n"); ! return false; ! } ! mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB ! if (mpBrush == NULL) { ! WTL("tcCreditView - mpBrush creation failed\n"); ! return false; ! } ! mpPen = new Pen(Color(255,200,200,200),2); ! if (mpPen == NULL) { ! WTL("tcCreditView - mpPen creation failed\n"); ! return false; ! } ! ! Rewind(); ! return true; } /*******************************************************************************/ ! int tcCreditView::Draw() ! { ! static WCHAR szwchar[256]; ! UINT32 nDeltaTime = tcTime::Get()->Get30HzCount() - mnStartTime; ! Graphics *pGraphics; ! Erase(); ! if (!GetGraphics(pGraphics)) ! { ! return false; ! } ! DrawBackground(pGraphics); ! // Get the text rendering hint. ! TextRenderingHint oldhint = pGraphics->GetTextRenderingHint(); + // Set the text rendering hint to TextRenderingHintAntiAlias. + pGraphics->SetTextRenderingHint(TextRenderingHintAntiAlias); ! float fY = (float)mnHeight - 2*0.5f*(float)nDeltaTime; ! float fX = 0.5f*(float)mnWidth; ! const UINT32 nColorFade = 0x8E328032; ! const UINT32 nColorBright = 0xFE64FF64; ! mpBrush->SetColor(Color(nColorBright)); // font color ! //DrawTextCentered(pGraphics, mpFont, mpBrush, crawlstring.GetBuffer(), fX,fY); ! static int nFlashId = -1; ! static bool bFlash = false; ! static UINT32 snFocusTime; ! static tcString szFocus; ! // reset static variables if rewind occured ! if (mbDrawRewind) ! { ! nFlashId = -1; ! bFlash = false; ! mbDrawRewind = false; ! } ! if (bFlash) ! { ! if (nFlashId >= 0) {szFocus = maCredit[nFlashId].mzCaption;} ! snFocusTime = tcTime::Get()->Get30HzCount(); ! mpBrush->SetColor(Color(255,255,255,255)); ! pGraphics->FillRectangle(mpBrush,0,0,mnWidth,mnHeight); ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); ! } ! if (nFlashId >= 0) ! { ! UINT32 nDeltaFocusTime = (tcTime::Get()->Get30HzCount() - snFocusTime); ! } ! for (int n=0;n<(int)mnCredits;n++) ! { ! tcString s = maCredit[n].mzCaption; ! const float fEffectZone = 60.0f; ! float dyeffect = fY - ((float)mnHeight - fEffectZone); ! if ((dyeffect >= 0)&&(dyeffect <= fEffectZone)) { ! mpBrush->SetColor(Color(nColorFade)); // font color ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 40.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 40.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 30.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 30.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 20.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 20.0f*dyeffect,fY); ! mpBrush->SetColor(Color(nColorBright)); // font color ! } ! else if (fY <= (float)mnHeight) ! { ! if ((n > nFlashId)&&(maCredit[n].mnEffect == 1)) ! { ! nFlashId = n; ! bFlash = true; ! } ! else ! { ! bFlash = false; ! } ! Font *pFont = mpFont; ! if (maCredit[n].mnEffect == 1) ! { ! pFont = mpFontLarge; ! } ! else if (maCredit[n].mnEffect == 2) ! { ! pFont = mpFontSmall; ! } ! mpBrush->SetColor(Color(nColorFade)); // font color ! ! DrawTextCentered(pGraphics, pFont, mpBrush, s.GetBuffer(), ! fX + 1.0f,fY + 1.0f); ! mpBrush->SetColor(Color(nColorBright)); // font color ! DrawTextCentered(pGraphics, pFont, mpBrush, s.GetBuffer(), fX,fY); ! } ! fY += maCredit[n].mfTrailSpace; ! } ! ! pGraphics->SetTextRenderingHint(oldhint); ! ReleaseGraphics(pGraphics); ! DrawBorder(); ! ! // rewind after credits are done crawling ! if (fY < -100.0f) ! { ! Rewind(); ! } ! return true; } *************** *** 313,318 **** void tcCreditView::Rewind() { ! mnStartTime = mcTime.snCount_30Hz; ! mbDrawRewind = true; } --- 323,328 ---- void tcCreditView::Rewind() { ! mnStartTime = tcTime::Get()->Get30HzCount(); ! mbDrawRewind = true; } *************** *** 328,346 **** : tcWindow(parent, pos, size, name, sharedSurface) { ! mpFont = NULL; ! mpFontLarge = NULL; ! mpFontSmall = NULL; ! mpBrush = NULL; ! mnCredits = 0; ! mbDrawRewind = false; } tcCreditView::~tcCreditView() { ! if (mpFont != NULL) {delete mpFont;} ! if (mpFontLarge != NULL) {delete mpFontLarge;} ! if (mpFontSmall != NULL) {delete mpFontSmall;} ! if (mpBrush != NULL) {delete mpBrush;} ! if (mpPen != NULL) {delete mpPen;} } --- 338,356 ---- : tcWindow(parent, pos, size, name, sharedSurface) { ! mpFont = NULL; ! mpFontLarge = NULL; ! mpFontSmall = NULL; ! mpBrush = NULL; ! mnCredits = 0; ! mbDrawRewind = false; } tcCreditView::~tcCreditView() { ! if (mpFont != NULL) {delete mpFont;} ! if (mpFontLarge != NULL) {delete mpFontLarge;} ! if (mpFontSmall != NULL) {delete mpFontSmall;} ! if (mpBrush != NULL) {delete mpBrush;} ! if (mpPen != NULL) {delete mpPen;} } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Game.cpp 9 May 2004 20:40:23 -0000 1.78 --- Game.cpp 14 May 2004 23:37:08 -0000 1.79 *************** *** 363,367 **** void tcGame::Init() { - tcTime::Init(); startTime = wxDateTime::Now(); --- 363,366 ---- *************** *** 1081,1085 **** static teScreenMode lastMode = NONE; ! tcTime::Update(); tcMultiplayerInterface::Get()->Update(); --- 1080,1084 ---- static teScreenMode lastMode = NONE; ! tcTime::Get()->Update(); tcMultiplayerInterface::Get()->Update(); *************** *** 1233,1237 **** briefingConsoleBottom->SetActive(false); optionsView->SetActive(true); ! networkView->SetActive(false); tacticalMap->SetActive(false); infoConsole->SetActive(false); --- 1232,1236 ---- briefingConsoleBottom->SetActive(false); optionsView->SetActive(true); ! //networkView->SetActive(false); tacticalMap->SetActive(false); infoConsole->SetActive(false); *************** *** 1247,1251 **** briefingConsoleLeft->SetActive(false); briefingConsoleBottom->SetActive(false); ! optionsView->SetActive(false); networkView->SetActive(true); tacticalMap->SetActive(false); --- 1246,1250 ---- briefingConsoleLeft->SetActive(false); briefingConsoleBottom->SetActive(false); ! //optionsView->SetActive(false); networkView->SetActive(true); tacticalMap->SetActive(false); *************** *** 1262,1266 **** bool tcGame::UpdateFrame() { ! tcTime::Update(); if (meGameMode == GM_START) --- 1261,1265 ---- bool tcGame::UpdateFrame() { ! tcTime::Get()->Update(); if (meGameMode == GM_START) *************** *** 1285,1288 **** --- 1284,1288 ---- const float dateZuluScale = 1.0f; // for testing sky effects static std::string dateTimeString = "---"; + bool isLagging = false; if (nLastCount == 0) *************** *** 1323,1327 **** QueryPerformanceCounter(&nPerformanceCount); ! if ((nPerformanceCount.QuadPart-nLastCount) >= ndt) { SynchTimeAcceleration(); --- 1323,1330 ---- QueryPerformanceCounter(&nPerformanceCount); ! unsigned long deltaCount = nPerformanceCount.QuadPart-nLastCount; ! isLagging = (deltaCount > 8*ndt); // true if cannot maintain real time ! ! if (deltaCount >= ndt) { SynchTimeAcceleration(); *************** *** 1361,1364 **** --- 1364,1371 ---- dateTimeString += buff; } + if (isLagging) + { + dateTimeString += "[LAG]"; + } tacticalMap->SetDateTime(dateTimeString); *************** *** 1401,1404 **** --- 1408,1413 ---- } + ProcessCommandList(); + mcGameView.Update(gameTime); *************** *** 1408,1413 **** } - ProcessCommandList(); - // Draw 2D windows UpdateForScreenMode(); --- 1417,1420 ---- *************** *** 1432,1436 **** viewer->Update(gameDateZulu); ! if (directorTime > 0.1f) { mpGraphicsEngine->RenderAll(); --- 1439,1444 ---- viewer->Update(gameDateZulu); ! // skip frames if lagging and server ! if ((directorTime > 0.1f) && (!isLagging || !tcMultiplayerInterface::Get()->IsServer())) { mpGraphicsEngine->RenderAll(); Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcObjectControl.cpp 29 Feb 2004 22:51:36 -0000 1.14 --- tcObjectControl.cpp 14 May 2004 23:37:08 -0000 1.15 *************** *** 948,952 **** } ! if (tcTime::snCount_30Hz % 30 > 15) // blink { mpBrush->SetColor(0xFFFF6464); --- 948,952 ---- } ! if (tcTime::Get()->snCount_30Hz % 30 > 15) // blink { mpBrush->SetColor(0xFFFF6464); Index: tcTime.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTime.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcTime.cpp 18 Feb 2004 23:55:51 -0000 1.5 --- tcTime.cpp 14 May 2004 23:37:08 -0000 1.6 *************** *** 27,40 **** #include "tcTime.h" ! LARGE_INTEGER tcTime::snFrequency = {0}; ! DWORD tcTime::snDeltaCount = 0; ! DWORD tcTime::snLastCount = 0; ! UINT32 tcTime::snCount_30Hz = 0; /** * Assumes tcTime::Update() is being called from main loop. * @return 30 Hz counter count value */ ! UINT32 tcTime::Get30HzCount() { return snCount_30Hz; --- 27,48 ---- #include "tcTime.h" ! ! /** ! * Accessor for singleton instance ! */ ! tcTime* tcTime::Get() ! { ! static tcTime instance; ! ! return &instance; ! } ! /** * Assumes tcTime::Update() is being called from main loop. + * Use tcTime::GetUpdate30HzCount to update before reading counter * @return 30 Hz counter count value */ ! unsigned tcTime::Get30HzCount() { return snCount_30Hz; *************** *** 42,45 **** --- 50,63 ---- /** + * Calls tcTime::Update() to update counter value + * @return 30 Hz counter count value + */ + unsigned tcTime::GetUpdated30HzCount() + { + Update(); + return snCount_30Hz; + } + + /** * Initializes the tcTime object. */ *************** *** 74,81 **** * tcTime constructor. */ ! tcTime::tcTime(void) {} /** * tcTime destructor. */ ! tcTime::~tcTime(void) {} \ No newline at end of file --- 92,108 ---- * tcTime constructor. */ ! tcTime::tcTime() : ! snDeltaCount(0), ! snLastCount(0), ! snCount_30Hz(0) ! { ! Init(); ! ! } /** * tcTime destructor. */ ! tcTime::~tcTime() ! { ! } \ No newline at end of file Index: tcEditControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcEditControl.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcEditControl.cpp 30 Nov 2003 17:23:52 -0000 1.5 --- tcEditControl.cpp 14 May 2004 23:37:08 -0000 1.6 *************** *** 24,27 **** --- 24,28 ---- #include "tcEditControl.h" + #include "tcTime.h" using namespace Gdiplus; *************** *** 34,46 **** if (!mbActive) {return true;} ! if (!GetGraphics(pGraphics)) { WTL("Failed to get Graphics in tcEditControl::Draw()\n"); return false; } ! if (IsBackgroundLoaded()) { DrawBackground(pGraphics); } ! else { // erase mpBrush->SetColor(Color(255,0,15,50)); --- 35,50 ---- if (!mbActive) {return true;} ! if (!GetGraphics(pGraphics)) ! { WTL("Failed to get Graphics in tcEditControl::Draw()\n"); return false; } ! if (IsBackgroundLoaded()) ! { DrawBackground(pGraphics); } ! else ! { // erase mpBrush->SetColor(Color(255,0,15,50)); *************** *** 63,70 **** SizeF size; MeasureText(pGraphics, mpFont, mzBuffer, size); ! if (mcTime.snCount_30Hz % 30 >= 15){ mpPen->SetColor(Color(254,0,0,0)); } ! else { mpPen->SetColor(Color(254,255,255,255)); } --- 67,75 ---- SizeF size; MeasureText(pGraphics, mpFont, mzBuffer, size); ! if (tcTime::Get()->Get30HzCount() % 30 >= 15){ mpPen->SetColor(Color(254,0,0,0)); } ! else ! { mpPen->SetColor(Color(254,255,255,255)); } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tc3DViewer.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tc3DViewer.cpp 18 Feb 2004 18:53:55 -0000 1.29 --- tc3DViewer.cpp 14 May 2004 23:37:08 -0000 1.30 *************** *** 928,934 **** } - UpdateSky(dateZulu); frameStamp->setFrameNumber(frameStamp->getFrameNumber()+1); frameStamp->setReferenceTime(gameTime); --- 928,935 ---- } UpdateSky(dateZulu); + terrainManager->Update(); + frameStamp->setFrameNumber(frameStamp->getFrameNumber()+1); frameStamp->setReferenceTime(gameTime); |