Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv26892
Modified Files:
ScreenInfoManager.cpp ObjectModel.cpp main.cpp GameScreen.cpp
CSPSim.cpp Console.cpp AircraftObject.cpp
Log Message:
added a toggle function for contact marks
added initialization of pause indicator
Index: ScreenInfoManager.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ScreenInfoManager.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScreenInfoManager.cpp 22 Mar 2003 02:24:58 -0000 1.3
--- ScreenInfoManager.cpp 24 Mar 2003 10:37:01 -0000 1.4
***************
*** 26,30 ****
#include <osg/MatrixTransform>
- #include "CSPSim.h"
#include "ScreenInfoManager.h"
--- 26,29 ----
***************
*** 34,38 ****
//float textWidth = bitmapFont->getWidth(pause->getEncodedText());
osg::ref_ptr<ScreenInfo> pause = new ScreenInfo(ScreenWidth - 5 * 8, ScreenHeight,"PAUSE", "PAUSE");
- pause->setStatus(CSPSim::theSim->isPaused());
osg::ref_ptr<GeneralStats> generalStats = new GeneralStats(0, ScreenHeight / 3);
--- 33,36 ----
Index: ObjectModel.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ObjectModel.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ObjectModel.cpp 21 Mar 2003 20:07:55 -0000 1.5
--- ObjectModel.cpp 24 Mar 2003 10:37:02 -0000 1.6
***************
*** 181,185 ****
//stateSet->setGlobalDefaults();
//m_rpNode->setStateSet(stateSet);
!
if (m_Smooth) {
osgUtil::SmoothingVisitor sv;
--- 181,185 ----
//stateSet->setGlobalDefaults();
//m_rpNode->setStateSet(stateSet);
!
if (m_Smooth) {
osgUtil::SmoothingVisitor sv;
Index: main.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/main.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** main.cpp 22 Mar 2003 02:24:58 -0000 1.6
--- main.cpp 24 Mar 2003 10:37:02 -0000 1.7
***************
*** 9,16 ****
CSPSim app;
! app.Init();
! app.Run();
! app.Cleanup();
! app.Exit();
return 0;
--- 9,16 ----
CSPSim app;
! app.init();
! app.run();
! app.cleanup();
! app.quit();
return 0;
Index: GameScreen.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/GameScreen.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** GameScreen.cpp 21 Mar 2003 20:07:55 -0000 1.9
--- GameScreen.cpp 24 Mar 2003 10:37:03 -0000 1.10
***************
*** 188,191 ****
--- 188,192 ----
m_ScreenInfoManager = new ScreenInfoManager(ScreenWidth,ScreenHeight);
m_ScreenInfoManager->setName("ScreenInfoManager");
+ m_ScreenInfoManager->setStatus("PAUSE", CSPSim::theSim->isPaused());
m_Console = new PyConsole(ScreenWidth, ScreenHeight);
Index: CSPSim.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** CSPSim.cpp 22 Mar 2003 12:42:59 -0000 1.14
--- CSPSim.cpp 24 Mar 2003 10:37:04 -0000 1.15
***************
*** 171,175 ****
}
! VirtualBattlefield * const CSPSim::getBattlefield() const
{
return m_Battlefield;
--- 171,175 ----
}
! VirtualBattlefield* const CSPSim::getBattlefield() const
{
return m_Battlefield;
***************
*** 227,231 ****
m_ActiveTerrain = m_DataArchive->getObject("terrain.balkan");
m_ActiveTerrain->activate(m_Battlefield);
!
// get view parameters from configuration file. ultimately there should
// be an in-game ui for this and probably a separate config file.
--- 227,231 ----
m_ActiveTerrain = m_DataArchive->getObject("terrain.balkan");
m_ActiveTerrain->activate(m_Battlefield);
!
// get view parameters from configuration file. ultimately there should
// be an in-game ui for this and probably a separate config file.
***************
*** 392,399 ****
// Swap OpenGL buffers
Py_BEGIN_ALLOW_THREADS;
SDL_GL_SwapBuffers();
Py_END_ALLOW_THREADS;
!
// remove marked objects, this should be done at the end of the main loop.
m_Battlefield->removeObjectsMarkedForDelete();
--- 392,402 ----
// Swap OpenGL buffers
+ #ifndef __CSPSIM_EXE__
Py_BEGIN_ALLOW_THREADS;
SDL_GL_SwapBuffers();
Py_END_ALLOW_THREADS;
! #else
! SDL_GL_SwapBuffers();
! #endif
// remove marked objects, this should be done at the end of the main loop.
m_Battlefield->removeObjectsMarkedForDelete();
Index: Console.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Console.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Console.cpp 22 Mar 2003 02:24:58 -0000 1.2
--- Console.cpp 24 Mar 2003 10:37:04 -0000 1.3
***************
*** 57,60 ****
--- 57,61 ----
text_->setColor(osg::Vec4(1, 1, 1, 1));
text_->setAlignment(osgText::Text::LEFT_TOP);
+ token_->setAlignment(osgText::Text::LEFT_TOP);
}
***************
*** 215,219 ****
//cursor_x_ = text_->getFont()->getWidth(&text);
token_->setText(left);
! cursor_x_ -= text_->getFont()->getWidth(token_->getEncodedText());
dirtyDisplayList();
}
--- 216,220 ----
//cursor_x_ = text_->getFont()->getWidth(&text);
token_->setText(left);
! cursor_x_ = text_->getFont()->getWidth(token_->getEncodedText());
dirtyDisplayList();
}
Index: AircraftObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AircraftObject.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** AircraftObject.cpp 21 Mar 2003 22:16:12 -0000 1.8
--- AircraftObject.cpp 24 Mar 2003 10:37:04 -0000 1.9
***************
*** 100,103 ****
--- 100,105 ----
BIND_ACTION("WHEEL_BRAKE_OFF", WheelBrakeOff);
BIND_AXIS("WHEEL_BRAKE", setWheelBrake);
+ BIND_ACTION("GEAR_UP", GearUp);
+ BIND_ACTION("GEAR_DOWN", GearDown);
CSP_LOG(CSP_APP, CSP_DEBUG, "... AircraftObject::AircraftObject()");
***************
*** 332,336 ****
--- 334,354 ----
m_BrakeInput = x;
}
+
+ void AircraftObject::setGearStatus(bool on) {
+ if (on)
+ m_Gear->Extend();
+ else
+ m_Gear->Retract();
+ m_Model->showContactMarkers(on);
+ }
+ void AircraftObject::GearUp() {
+ setGearStatus(false);
+ }
+
+ void AircraftObject::GearDown() {
+ setGearStatus(true);
+ }
+
void AircraftObject::setOrientation(double heading, double pitch, double roll)
{
|