You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <de...@us...> - 2003-01-11 10:54:09
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv23111 Modified Files: HudTextElement.cpp Log Message: no message Index: HudTextElement.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/HudTextElement.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HudTextElement.cpp 14 Dec 2002 18:49:07 -0000 1.4 --- HudTextElement.cpp 11 Jan 2003 10:54:06 -0000 1.5 *************** *** 75,78 **** --- 75,79 ---- setDrawMode( osgText::Text::TEXT ); setAlignment(osgText::Text::LEFT_BOTTOM); + //setAxisAlignment(XZ_PLANE); setColor(fontColor); setPosition(p_position); *************** *** 178,182 **** { AirplaneObject * pplayerPlane = dynamic_cast<AirplaneObject*>(g_pPlayerObject); ! SetValue ( RadiansToDegrees(pplayerPlane->getAngleOfAttack()) ); } --- 179,183 ---- { AirplaneObject * pplayerPlane = dynamic_cast<AirplaneObject*>(g_pPlayerObject); ! SetValue ( osg::RadiansToDegrees(pplayerPlane->getAngleOfAttack()) ); } |
From: <de...@us...> - 2003-01-11 10:53:33
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv22997 Modified Files: trees.cpp Log Message: Tree class implementation Index: trees.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/trees.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** trees.cpp 14 Dec 2002 18:50:41 -0000 1.4 --- trees.cpp 11 Jan 2003 10:53:30 -0000 1.5 *************** *** 1,13 **** #include <sstream> #include <osg/Billboard> #include <osg/BlendFunc> - #include <osg/Geometry> #include <osg/Texture2D> #include <osgDB/ReadFile> - #include "VirtualBattlefield.h" #ifdef _MSC_VER --- 1,17 ---- + #include <fstream> #include <sstream> #include <osg/Billboard> #include <osg/BlendFunc> #include <osg/Texture2D> + #ifdef _WIN32 + #include <osgDB/FileUtils> + #endif + #include <osgDB/ReadFile> + #include "Trees.h" #ifdef _MSC_VER *************** *** 16,33 **** #endif using namespace osg; ! /** ! * struct _tree ! */ ! struct _tree { ! int n; ! float x, y, z; ! float w, h; ! }; ! static Geometry *makeTree( _tree const &p_tree)//, StateSet *dstate ) { float vv[][3] = --- 20,100 ---- #endif + extern double g_LatticeXDist; + extern double g_LatticeYDist; + using namespace osg; ! TreesFactory::TreesFactory() ! { ! std::vector<std::string> treefileName; ! ! std::string dirBase("../Data/Images/"); ! ! // read tree textures from file ! ifstream iStream("../Data/Scripts/Trees.csp"); ! std::string str; ! while (iStream >> str) ! treefileName.push_back(dirBase + str); ! ! iStream.close(); ! ! m_treesNumber = treefileName.size(); ! ! // we don't need this on Linux since libs are usually ! // installed in /usr/local/lib/osgPlugins or /usr/lib/osgPlugins. ! // OSG can find itself the plugins. ! #ifdef _WIN32 ! osgDB::setLibraryFilePathList("../Bin"); ! #endif ! ! _tree aTree; ! for (unsigned short i=0;i<m_treesNumber;++i) ! { ! // makes a generic tree geometry ! aTree.h = 7.0 + 3.0 * i / m_treesNumber; ! aTree.w = aTree.h ; ! m_treesArray.push_back(MakeAGeomTree(aTree)); ! ! // picks a texture ! Texture2D * aTex = new Texture2D; ! osg::Image * image = osgDB::readImageFile ( treefileName[i] ); ! aTex->setImage(image); ! ! // makes a generic state ! ref_ptr<StateSet> dstate = new StateSet; ! dstate->setTextureAttributeAndModes(0, aTex, StateAttribute::ON ); ! dstate->setTextureAttribute(0, new TexEnv ); ! dstate->setAttributeAndModes( new BlendFunc, StateAttribute::ON ); ! AlphaFunc* alphaFunc = new AlphaFunc; ! alphaFunc->setFunction(AlphaFunc::GEQUAL,0.05f); ! dstate->setAttributeAndModes( alphaFunc, StateAttribute::ON ); ! dstate->setMode( GL_LIGHTING, StateAttribute::OFF ); ! dstate->setRenderingHint( StateSet::TRANSPARENT_BIN ); ! m_statesArray.push_back(dstate); ! } ! } ! ! Geometry const * TreesFactory::GetTree() const { ! return m_treesArray[static_cast<size_t>(UnsignedRandomNumber() * m_treesNumber)].get(); ! } ! ! StateSet const * TreesFactory::GetState() const ! { ! return m_statesArray[static_cast<size_t>(UnsignedRandomNumber() * m_treesNumber)].get(); ! } + StateSet const * TreesFactory::GetState(size_t const indice) const + { + return m_statesArray[indice].get(); + } ! size_t TreesFactory::GetTreesNumber() const ! { ! return m_treesNumber; ! } ! ! ! Geometry * TreesFactory::MakeAGeomTree( _tree const &p_tree) const { float vv[][3] = *************** *** 35,51 **** { -p_tree.w/2.0, 0.0, 0.0 }, { p_tree.w/2.0, 0.0, 0.0 }, ! { p_tree.w/2.0, 0.0, 2 * p_tree.h }, ! { -p_tree.w/2.0, 0.0, 2 * p_tree.h }, }; ! Vec3Array& v = *(osgNew Vec3Array(4)); ! Vec2Array& t = *(osgNew Vec2Array(4)); ! Vec4Array& l = *(osgNew Vec4Array(1)); ! ! int i; ! ! l[0][0] = l[0][1] = l[0][2] = l[0][3] = 1; ! for( i = 0; i < 4; i++ ) { v[i][0] = vv[i][0]; --- 102,113 ---- { -p_tree.w/2.0, 0.0, 0.0 }, { p_tree.w/2.0, 0.0, 0.0 }, ! { p_tree.w/2.0, 0.0, 2.0 * p_tree.h }, ! { -p_tree.w/2.0, 0.0, 2.0 * p_tree.h }, }; ! Vec3Array& v = *(new Vec3Array(4)); ! Vec2Array& t = *(new Vec2Array(4)); ! for(unsigned short i = 0; i < 4; i++ ) { v[i][0] = vv[i][0]; *************** *** 59,63 **** t[3][0] = 0.0; t[3][1] = 1.0; ! Geometry *geom = osgNew Geometry; geom->setVertexArray( &v ); --- 121,125 ---- t[3][0] = 0.0; t[3][1] = 1.0; ! Geometry * geom = new Geometry; geom->setVertexArray( &v ); *************** *** 65,199 **** geom->setTexCoordArray( 0, &t ); - geom->setColorArray( &l ); geom->setColorBinding( Geometry::BIND_OVERALL ); ! geom->addPrimitiveSet( osgNew DrawArrays(PrimitiveSet::QUADS,0,4) ); ! ! //geom->setStateSet( dstate ); ! return geom; } ! float RandomNumber() ! { ! float fnum = static_cast<float>(rand())/RAND_MAX; ! return fnum; ! } ! std::vector<Geometry*> MakeBaseTreeArray(unsigned short p_ustypeTreeNumber, std::vector<StateSet *> p_pstate) { ! float const treeWidthFactor = 1.0; ! float const treeHeightFactor = 1.0; ! ! _tree aTree; ! std::vector<Geometry*> treesArray; ! ! for (unsigned short i=0;i<p_ustypeTreeNumber;++i) { ! aTree.h = treeHeightFactor * 8.0; ! aTree.w = treeWidthFactor * 8.0; ! treesArray.push_back(makeTree( aTree));//, osgNew StateSet(*p_pstate[i % 3]) )); } ! ! return treesArray; } ! std::vector<Geometry *> g_treesBase; ! Node *makeTreesPatch( float xoff, float yoff, float spacing, float width, ! float height, VirtualBattlefield * pBattlefield) { ! Group *group = osgNew Group; ! unsigned int i,j, icnt, jcnt; ! std::vector<std::string> treefileName; ! treefileName.push_back("Images/tree0.rgba"); ! for (i=5;i<15;++i) ! { ! std::ostringstream osStream; ! osStream << "Images/tree" << i << ".png"; ! string a = osStream.str(); ! treefileName.push_back(osStream.str()); ! } ! ! treefileName.push_back("Images/tree1.gif"); ! treefileName.push_back("Images/tree2.gif"); ! treefileName.push_back("Images/tree3.gif"); ! treefileName.push_back("Images/tree4.gif"); ! ! unsigned short typeTreeNumber = treefileName.size(); - std::vector<Texture2D*> tex; - - for (i=0;i<typeTreeNumber;++i) - { - Texture2D* aTex = osgNew Texture2D; - osg::Image *image = osgDB::readImageFile ( treefileName[i] ); - aTex->setImage(image); - tex.push_back(aTex); - } - - std::vector<StateSet*> state; - for (i=0;i<typeTreeNumber;++i) - { - StateSet *dstate = osgNew StateSet; ! dstate->setTextureAttributeAndModes(0, tex[i], StateAttribute::ON ); ! ! dstate->setTextureAttribute(0, osgNew TexEnv ); ! ! dstate->setAttributeAndModes( osgNew BlendFunc, StateAttribute::ON ); ! ! AlphaFunc* alphaFunc = osgNew AlphaFunc; ! alphaFunc->setFunction(AlphaFunc::GEQUAL,0.05f); ! dstate->setAttributeAndModes( alphaFunc, StateAttribute::ON ); ! ! dstate->setMode( GL_LIGHTING, StateAttribute::OFF ); ! dstate->setRenderingHint( StateSet::TRANSPARENT_BIN ); ! state.push_back(dstate); ! } ! ! icnt = 10; //width/spacing; ! jcnt = 10; //height/spacing; ! ! if (g_treesBase.empty()) ! { ! g_treesBase = MakeBaseTreeArray(typeTreeNumber,state); ! } ! ! unsigned short count = 0; ! float baseRadius = 64.0 + 32.0 * RandomNumber(); ! ! unsigned short iState = static_cast<unsigned short>(RandomNumber() * typeTreeNumber); ! ! for (j=0;j<jcnt;++j) ! { ! Billboard *bb = osgNew Billboard; ! //bb->setMode(osg::Billboard::POINT_ROT_EYE ); ! for (i=0;i<icnt;++i) { ! float angle = 2 * PI * RandomNumber(); ! spacing = RandomNumber() * 128.0 + baseRadius; ! float x = xoff + spacing * ( cos(angle)); ! float y = yoff + spacing * ( sin(angle) ); ! float z = pBattlefield->getElevation(x, y); ! x = fmod(x, 64000.0f); ! y = fmod(y, 64000.0f); ! Vec3 pos(x,y,z); ! unsigned short indice = (2 * count) % typeTreeNumber; ! Geometry * aGSet = osgNew Geometry(*g_treesBase[indice]); ! bb->addDrawable( aGSet, pos ); ! ++count; } ! group->addChild( bb ); } - group->setStateSet( state[iState] ); - return group; } --- 127,275 ---- geom->setTexCoordArray( 0, &t ); geom->setColorBinding( Geometry::BIND_OVERALL ); ! geom->addPrimitiveSet( new DrawArrays(PrimitiveSet::QUADS,0,4) ); return geom; } ! TreesFactory const Forest::m_treesFactory; ! float const Forest::sizePatch = 128.0; ! Group * Forest::MakePatchForest(Vec2 const & p_center, float const p_length) const { ! const unsigned short treePerPatchNumber = 2; ! ! Group * patchForest = new Group; ! ! float baseRadius = p_length / 4.0; ! ! unsigned long count = 0; ! for (unsigned short i = 0; i < treePerPatchNumber;++i) { ! //abTree->setMode(osg::Billboard::POINT_ROT_EYE ); ! float angle = 2.0 * PI * UnsignedRandomNumber(); ! float spacing = (1.0 + UnsignedRandomNumber()) * baseRadius; ! float x = p_center.x() + spacing * cos(angle); ! float y = p_center.y() + spacing * sin(angle); ! if ( Predicate(Vec2(x,y)) ) ! { ! float z = m_virtualBattlefield->getElevation(x, y); ! x = fmod(x, g_LatticeXDist); ! y = fmod(y, g_LatticeYDist); ! Vec3 pos(x,y,z); ! Geometry * agTree = new Geometry(*m_treesFactory.GetTree()); ! Billboard *abTree = new Billboard; ! abTree->addDrawable( agTree, pos ); ! patchForest->addChild( abTree); ! ++count; ! } } ! if (count == 0) ! return 0; ! return patchForest; } ! float Forest::f(float x, float y) const ! { ! return x*x+y*y-1.0; ! } ! float Forest::g(float x, float y) const { ! float r = m_randomParam; ! return (x-1.0)*(x-1.0)+y*y-r*r/4.0; ! } ! float Forest::HeightField(Vec2 const & p_p) const ! { // f:D'(0,1)->R ! Vec3 p = m_randomRotation * Vec3(p_p.x(), p_p.y(),0); ! float x = p.x(); ! float y = p.y(); ! float a = f(x,y); ! float b = g(x,y); ! float h = exp(-a*a)*a+exp(-b*b)*b; ! return h; ! } ! bool Forest::Predicate(Vec2 const & p_p) const ! { ! if (HeightField((p_p - m_center)*2.0/m_length) < 0) ! return true; ! else ! return false; ! } ! Group * Forest::MakeForest(Vec2 const p_center, float const p_length) const ! { ! if ( p_length < sizePatch ) ! { ! Group * aForestPatch = MakePatchForest(p_center, p_length); ! if (aForestPatch) ! { ! aForestPatch->setStateSet(m_state); ! return aForestPatch; ! } ! else ! return 0; ! } ! else ! { ! float length_2 = p_length / 2.0; ! float length_4 = length_2 / 2.0; ! Vec2 NEOffset = Vec2(length_4, length_4); ! Vec2 NWOffset = Vec2(-length_4, length_4); ! osg::Group * NWForest = MakeForest(p_center + NWOffset, length_2); ! osg::Group * NEForest = MakeForest(p_center + NEOffset, length_2); ! osg::Group * SWForest = MakeForest(p_center - NEOffset, length_2); ! osg::Group * SEForest = MakeForest(p_center - NWOffset, length_2); + osg::Group * forest = new osg::Group; + bool empty = true; ! if (NWForest) { ! empty = false; ! forest->addChild(NWForest); } ! if (NEForest) ! { ! empty = false; ! forest->addChild(NEForest); ! } ! if (SWForest) ! { ! empty = false; ! forest->addChild(SWForest); ! } ! if (SEForest) ! { ! empty = false; ! forest->addChild(SEForest); ! } ! if (empty) ! return 0; ! else ! return forest; } } + + Forest::Forest(Vec2 const p_center, float const p_length, VirtualBattlefield * pBattlefield, short const p_state) + { + m_virtualBattlefield = pBattlefield; + m_randomParam = SignedRandomNumber(); + m_center = p_center; + m_length = p_length; + m_randomRotation.makeRotate(m_randomParam * PI, Z_AXIS); + unsigned short iState; + if ( p_state == -1 ) + iState = static_cast<unsigned short>(UnsignedRandomNumber() * m_treesFactory.GetTreesNumber()); + else + iState = p_state % m_treesFactory.GetTreesNumber(); + m_state = new StateSet(*m_treesFactory.GetState(iState)); + addChild(MakeForest(p_center,p_length)); + } \ No newline at end of file |
From: <de...@us...> - 2003-01-11 10:53:02
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv22856 Added Files: Trees.h Log Message: Tree class header --- NEW FILE: Trees.h --- #ifndef __TREES_H__ #define __TREES_H__ #include <osg/Geometry> #include "VirtualBattlefield.h" class TreesFactory { struct _tree { float h,w; }; size_t m_treesNumber; std::vector<osg::ref_ptr<osg::Geometry> > m_treesArray; std::vector<osg::ref_ptr<osg::StateSet> > m_statesArray; osg::Geometry * MakeAGeomTree( _tree const &p_tree) const; public: osg::Geometry const * GetTree() const; osg::StateSet const * GetState() const; osg::StateSet const * GetState(size_t const indice) const; size_t GetTreesNumber() const; TreesFactory(); }; class Forest:public osg::Group { VirtualBattlefield * m_virtualBattlefield; float static const sizePatch; TreesFactory static const m_treesFactory; osg::Vec2 m_center; float m_length; float m_randomParam; osg::Matrix m_randomRotation; osg::StateSet * m_state; float f(float x, float y) const; float g(float x, float y) const; float HeightField (osg::Vec2 const & p_p) const; bool Predicate (osg::Vec2 const & p_p) const; osg::Group * MakePatchForest(osg::Vec2 const & p_center, float const p_length) const; osg::Group * MakeForest(osg::Vec2 const p_center, float const p_length) const; public: Forest(osg::Vec2 const p_center, float const length, VirtualBattlefield * pBattlefield, short const p_state = -1); }; #endif // __TREES_H__ |
From: <de...@us...> - 2003-01-11 10:52:20
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv22677 Modified Files: TypesMath.h Log Message: Adding completly naive random number functions Index: TypesMath.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include/TypesMath.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TypesMath.h 7 Dec 2002 12:14:13 -0000 1.3 --- TypesMath.h 11 Jan 2003 10:52:18 -0000 1.4 *************** *** 53,66 **** }; ! ! ! inline double DegreesToRadians(double deg) ! { ! return deg * pi / 180.0f; } ! inline double RadiansToDegrees(double rad) ! { ! return rad * 180.0f / pi; } --- 53,64 ---- }; ! inline double RadiansToDegrees(double rad) ! { ! return rad * 180.0 / pi; } ! inline double DegreesToRadians(double deg) ! { ! return deg * pi / 180.0; } *************** *** 85,88 **** --- 83,90 ---- double Atan(double const p_a, double const p_b); + + float UnsignedRandomNumber(); + + float SignedRandomNumber(); #endif // __TYPESMATH_H__ |
From: <de...@us...> - 2003-01-11 10:51:06
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts In directory sc8-pr-cvs1:/tmp/cvs-serv22437 Modified Files: HudM2k.csp Log Message: new hud elements positions Index: HudM2k.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/HudM2k.csp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HudM2k.csp 20 Dec 2002 13:10:11 -0000 1.2 --- HudM2k.csp 11 Jan 2003 10:51:03 -0000 1.3 *************** *** 1,16 **** # M2k-5 Hud# File description '#' is also default value for string or char data # Element Name x y z Static string Static string position (prefix/sufix/unique) Font name Size Value Format ! KT -0.1 0.0 0.1 # p # 16 431 0 ! MACH -0.1 0.0 0.07 # p # 16 0.67 2 ! G -0.12 0.0 -0.16 G p # 16 1.0 1 ! AOA -0.12 0.0 -0.19 a p greek 16 3.0 1 ! HEAD -0.0 0.0 0.12 # p # 16 101112 0 ! altft 0.1 0.0 0.1 # p # 16 1110 0 ! altr 0.11 0.0 0.07 H s # 16 800 0 ! alts 0.11 0.0 0.04 SH s # 16 200 0 ! nwp 0.1 0.0 -0.08 DEST p # 16 10 0 ! wph 0.06 0.0 -0.11 / s # 16 160 0 ! wpd 0.13 0.0 -0.11 NM s # 16 9.0 1 ! palt1 0.1 0.0 -0.16 # p # 16 6000 0 ! palt2 0.1 0.0 -0.19 ASEL u # 16 0 0 ! RPM 0.1 0.0 -0.25 RPM p # 16 75 0 --- 1,16 ---- # M2k-5 Hud# File description '#' is also default value for string or char data # Element Name x y z Static string Static string position (prefix/sufix/unique) Font name Size Value Format ! KT -0.41 0.0 0.22 # p # 16 431 0 ! MACH -0.41 0.0 0.13 # p # 16 0.67 2 ! G -0.48 0.0 -0.27 G p # 16 1.0 1 ! AOA -0.57 0.0 -0.44 a p greek 16 3.0 1 ! HEAD -0.17 0.0 0.3 # p # 16 350001 0 ! altft 0.35 0.0 0.22 # p # 16 1110 0 ! altr 0.35 0.0 0.13 H s # 16 800 0 ! alts 0.35 0.0 0.04 SH s # 16 200 0 ! nwp 0.35 0.0 -0.15 DEST p # 16 10 0 ! wph 0.3 0.0 -0.24 / s # 16 160 0 ! wpd 0.53 0.0 -0.24 NM s # 16 9.0 1 ! palt1 0.35 0.0 -0.39 # p # 16 6000 0 ! palt2 0.37 0.0 -0.48 ASEL u # 16 0 0 ! RPM 0.35 0.0 -0.62 RPM p # 16 75 0 |
From: <de...@us...> - 2003-01-11 10:50:10
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts In directory sc8-pr-cvs1:/tmp/cvs-serv22215 Added Files: Trees.csp Log Message: Trees texture files name --- NEW FILE: Trees.csp --- tree0.rgba tree1.gif tree2.gif tree3.gif tree4.gif tree5.png tree6.png tree7.png tree8.png tree9.png tree10.png tree11.png tree12.png tree13.png tree14.png tree15.png |
From: <de...@us...> - 2003-01-11 10:48:04
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv21730 Modified Files: AirplaneInput.cpp Log Message: Cleaning code Adding Smooth method Index: AirplaneInput.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/AirplaneInput.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AirplaneInput.cpp 12 Dec 2002 21:13:45 -0000 1.3 --- AirplaneInput.cpp 11 Jan 2003 10:48:01 -0000 1.4 *************** *** 4,7 **** --- 4,9 ---- #include "AirplaneObject.h" + extern double frameSeconds(); + double const AirplaneInput::offsetControl = 0.05; *************** *** 12,38 **** m_foffsetRudder = 0.0; m_foffsetThrottle = 0.0; } ! void AirplaneInput::SetObject(BaseObject * pObject) { m_pAirplaneObject = dynamic_cast<AirplaneObject* >(pObject); } double AirplaneInput::Clamp(double p_setting) const { ! if ( p_setting < - 1.0) ! p_setting = - 1.0; ! else ! if ( p_setting > 1.0 ) ! p_setting = 1.0; ! return p_setting; } ! void AirplaneInput::OnUpdate() const { if (m_foffsetAileron != 0.0) { double setting = m_pAirplaneObject->getAileron() + m_foffsetAileron; ! setting = Clamp(setting); m_pAirplaneObject->setAileron( setting ); } --- 14,49 ---- m_foffsetRudder = 0.0; m_foffsetThrottle = 0.0; + m_oldsetting = 0.0; } ! void AirplaneInput::SetObject(BaseObject * pObject) { m_pAirplaneObject = dynamic_cast<AirplaneObject* >(pObject); } + double AirplaneInput::Smooth(double p_setting) + { + double u = 0.8 * frameSeconds(); + p_setting = u * m_oldsetting + (1.0 - u) * p_setting; + m_oldsetting = p_setting; + return p_setting; + } + double AirplaneInput::Clamp(double p_setting) const { ! if ( p_setting < - 1.0) ! p_setting = - 1.0; ! else ! if ( p_setting > 1.0 ) ! p_setting = 1.0; ! return p_setting; } ! void AirplaneInput::OnUpdate() { if (m_foffsetAileron != 0.0) { double setting = m_pAirplaneObject->getAileron() + m_foffsetAileron; ! setting = Smooth(Clamp(setting)); m_pAirplaneObject->setAileron( setting ); } *************** *** 42,46 **** { double setting = m_pAirplaneObject->getElevator() + m_foffsetElevator; ! setting = Clamp(setting); m_pAirplaneObject->setElevator( setting ); } --- 53,57 ---- { double setting = m_pAirplaneObject->getElevator() + m_foffsetElevator; ! setting = Smooth(Clamp(setting)); m_pAirplaneObject->setElevator( setting ); } *************** *** 50,54 **** { double setting = m_pAirplaneObject->getRudder() + m_foffsetRudder; ! setting = Clamp(setting); m_pAirplaneObject->setRudder( setting ); } --- 61,65 ---- { double setting = m_pAirplaneObject->getRudder() + m_foffsetRudder; ! setting = Smooth(Clamp(setting)); m_pAirplaneObject->setRudder( setting ); } *************** *** 57,61 **** { double setting = m_pAirplaneObject->getThrottle() + m_foffsetThrottle; ! setting = Clamp(setting); m_pAirplaneObject->setThrottle( setting ); } --- 68,72 ---- { double setting = m_pAirplaneObject->getThrottle() + m_foffsetThrottle; ! setting = Smooth(Clamp(setting)); m_pAirplaneObject->setThrottle( setting ); } *************** *** 147,151 **** << ", axis: " << axis << ", val: " << val ); ! float setting = val / 32768.0; switch ( joynum ) --- 158,162 ---- << ", axis: " << axis << ", val: " << val ); ! float setting = Smooth(val / 32768.0); switch ( joynum ) |
From: <de...@us...> - 2003-01-11 10:47:41
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv21631 Modified Files: AirplaneInput.h Log Message: Cleaning code Adding Smooth method Index: AirplaneInput.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include/AirplaneInput.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AirplaneInput.h 7 Dec 2002 11:27:15 -0000 1.3 --- AirplaneInput.h 11 Jan 2003 10:47:38 -0000 1.4 *************** *** 50,54 **** virtual void OnJoystickHatMotion(int joynum, int hat, int val); virtual void OnJoystickButtonDown(int joynum, int butnum); ! virtual void OnUpdate() const; virtual void SetObject(BaseObject * ); --- 50,54 ---- virtual void OnJoystickHatMotion(int joynum, int hat, int val); virtual void OnJoystickButtonDown(int joynum, int butnum); ! virtual void OnUpdate(); virtual void SetObject(BaseObject * ); *************** *** 57,61 **** --- 57,63 ---- AirplaneObject * m_pAirplaneObject; double Clamp(double p_setting) const; + double Smooth(double p_setting); + double m_oldsetting; double m_foffsetAileron; double m_foffsetElevator; |
From: <mk...@us...> - 2003-01-04 23:49:54
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv16793/Source Added Files: Tag: simdata HID.cpp Log Message: initial version of a new virtual human interface device --- NEW FILE: HID.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file HID.cpp * **/ #include "HID.h" ///////////////////////////////////////////////////////////////////////////// // class EventMapping int EventMapping::getKeyID(SDL_keysym &key, EDir dir, int mode) const { int press = (dir == PRESS) ? (1 << 28) : 0; return (key.sym & 0xFFF) + ((key.mod & 0xFFF) << 12) + ((mode & 0x00F) << 24) + press; } int EventMapping::getJoystickButtonID(int device, int button, EDir dir, int mode) const { int press = (dir == PRESS) ? (1 << 28) : 0; return (device & 0xFFF) + ((button & 0xFFF) << 12) + ((mode & 0x00F) << 24) + press; } int EventMapping::getMouseButtonID(int device, int button, EDir dir, int kmod, int mode) const { int press = (dir == PRESS) ? (1 << 28) : 0; return (device & 0xF) + ((button & 0xFF) << 4) + ((kmod & 0xFFF) << 12) + ((mode & 0xF) << 24) + press; } int EventMapping::getMouseMotionID(int device, int state, int kmod, int mode) const { return (device & 0xF) + ((state & 0xFF) << 4) + ((kmod & 0xFFF) << 12) + ((mode & 0xF) << 24); } EventMapping::Script const *EventMapping::getKeyScript(SDL_keysym &key, EDir dir, int mode) const { int id = getKeyID(key, dir, mode); EventScript kScript = m_KeyMap.find(id); if (kScript == m_KeyMap.end()) return NULL; return &(kScript->second); } EventMapping::Script const *EventMapping::getJoystickButtonScript(int device, int button, EDir dir, int mode) const { int id = getJoystickButtonID(device, button, dir, mode); EventScript bScript = m_JoystickButtonMap.find(id); if (bScript == m_JoystickButtonMap.end()) return NULL; return &(bScript->second); } EventMapping::Axis const *EventMapping::getJoystickAxis(int device, int axis) const { return &(m_JoystickAxisMap[device & 3][axis & 7]); } void EventMapping::addJoystickAxisMap(int device, int axis, Axis const &a) { assert(device >= 0 && device < 4); assert(axis >= 0 && axis < 8); m_JoystickAxisMap[device][axis] = a; } void EventMapping::addKeyMap(SDL_keysym &key, EDir dir, int mode, Script const &s) { int id = getKeyID(key, dir, mode); m_KeyMap[id] = s; } void EventMapping::addJoystickButtonMap(int device, int button, EDir dir, int mode, Script const &s) { int id = getJoystickButtonID(device, button, dir, mode); m_JoystickButtonMap[id] = s; } void EventMapping::addMouseMotionMap(int device, int state, int kmod, int mode, int map_to) { int id = getMouseMotionID(device, state, kmod, mode); m_MouseMotionMap[id] = map_to; } // convenience method for testing purposes only void EventMapping::addKeyMap(SDLKey vkey, SDLMod kmod, EDir dir, int mode, int action, double time) { SDL_keysym key; key.sym = vkey; key.mod = kmod; Script s; Action a; a.id = action; a.time = time; s.push_back(a); addKeyMap(key, dir, mode, s); } // convenience method for testing purposes only void EventMapping::addJoystickButtonMap(int device, int button, EDir dir, int mode, int action, double time) { Script s; Action a; a.id = action; a.time = time; s.push_back(a); addJoystickButtonMap(device, button, dir, mode, s); } EventMapping::Script const *EventMapping::getMouseButtonScript(int device, int button, EDir dir, int kmod, int mode) const { int id = getMouseButtonID(device, button, dir, kmod, mode); EventScript mScript = m_MouseButtonMap.find(id); if (mScript == m_MouseButtonMap.end()) return NULL; return &(mScript->second); } int EventMapping::getMouseMotion(int device, int state, int kmod, int mode) const { int id = getMouseMotionID(device, state, kmod, mode); motion_map::const_iterator map = m_MouseMotionMap.find(id); if (map == m_MouseMotionMap.end()) return -1; return map->second; } ///////////////////////////////////////////////////////////////////////////// // class VirtualHID: public HID VirtualHID::VirtualHID() { m_Map = 0; m_VirtualMode = 0; m_ActiveScript = 0; m_LastMouseMoveID = -1; } VirtualHID::~VirtualHID() {} void VirtualHID::setMapping(EventMapping const & map) { m_Map = ↦ } void VirtualHID::bindObject(SimObject *object) { m_Object = object; } bool VirtualHID::OnKeyDown(SDL_keysym &key) { if (!m_Object || !m_Map) return false; EventMapping::Script const *s = m_Map->getKeyScript(key, EventMapping::PRESS, 0); if (s == NULL) return false; setScript(s); return true; } bool VirtualHID::OnKeyUp(SDL_keysym &key) { if (!m_Object || !m_Map) return false; EventMapping::Script const *s = m_Map->getKeyScript(key, EventMapping::RELEASE, 0); if (s == NULL) return false; setScript(s); return true; } bool VirtualHID::OnJoystickButtonDown(int joynum, int butnum) { if (!m_Object || !m_Map) return false; EventMapping::Script const *s = m_Map->getJoystickButtonScript(joynum, butnum, EventMapping::PRESS, m_VirtualMode); if (s == NULL) return false; setScript(s); return true; } bool VirtualHID::OnJoystickButtonUp(int joynum, int butnum) { if (!m_Object || !m_Map) return false; EventMapping::Script const *s = m_Map->getJoystickButtonScript(joynum, butnum, EventMapping::RELEASE, m_VirtualMode); if (s == NULL) return false; setScript(s); return true; } void VirtualHID::OnJoystickAxisMotion(int joynum, int axis, int val) { if (!m_Object || !m_Map) return; EventMapping::Axis const *Axis = m_Map->getJoystickAxis(joynum, axis); int id = Axis->id; if (id < 0 || id > m_Axes.size()) return; AxisAdapter adapter = m_Axes[id]; if (adapter) adapter(m_Object, val); } void VirtualHID::setVirtualMode(int mode) { m_VirtualMode = mode; } bool VirtualHID::OnMouseMove(SDL_MouseMotionEvent const &event) { if (!m_Object || !m_Map) return false; int kmod = SDL_GetModState(); int id = m_Map->getMouseMotion(event.which, event.state, kmod, m_VirtualMode); if (id != m_LastMouseMoveID) { m_LastMouseMoveID = id; m_LastMouseMoveAdapter = NULL; MotionMap::const_iterator map = m_Motions.find(id); if (map == m_Motions.end()) return false; m_LastMouseMoveAdapter = map->second; } MotionAdapter adapter = m_LastMouseMoveAdapter; if (!adapter) return false; adapter(m_Object, event.x, event.y, event.xrel, event.yrel); return true; } bool VirtualHID::OnMouseButtonDown(SDL_MouseButtonEvent const &event) { if (!m_Object || !m_Map) return false; int kmod = SDL_GetModState(); EventMapping::Script const *s = m_Map->getMouseButtonScript(event.which, event.button, EventMapping::PRESS, kmod, m_VirtualMode); if (s == NULL) return false; setScript(s, event.x, event.y); return true; } bool VirtualHID::OnMouseButtonUp(SDL_MouseButtonEvent const &event) { if (!m_Object || !m_Map) return false; int kmod = SDL_GetModState(); EventMapping::Script const *s = m_Map->getMouseButtonScript(event.which, event.button, EventMapping::RELEASE, kmod, m_VirtualMode); if (s == NULL) return false; setScript(s, event.x, event.y); return true; } void VirtualHID::OnUpdate(double dt) { if (!m_ActiveScript) return; m_ScriptTime += dt; while (m_ScriptAction->time <= m_ScriptTime) { int id = m_ScriptAction->id; if (id < -15) { // nop } else if (id < 0) { setVirtualMode(-id); } else { // FIXME: don't use [] ActionAdapter adapter = m_Actions[id]; if (adapter) adapter(m_Object, m_MouseEventX, m_MouseEventY); } if (++m_ScriptAction == m_ActiveScript->end()) { m_ActiveScript = 0; break; } } } void VirtualHID::setScript(EventMapping::Script const *s, int x, int y) { m_MouseEventX = x; m_MouseEventY = y; m_ActiveScript = s; m_ScriptAction = s->begin(); m_ScriptTime = 0.0; OnUpdate(0.0); } //////////////////////////////////////////////////////////////////// // class AircraftInterface: public VirtualHID AircraftInterface::AircraftInterface(): VirtualHID() { // temparory for testing... bindObject(new AircraftObject()); bindEvents(); } void AircraftInterface::bindEvents() { m_Actions.clear(); m_Axes.clear(); m_Axes.resize(16, NULL); BIND_ACTION(AircraftObject, RETRACT_GEAR, RetractGear); BIND_ACTION(AircraftObject, EXTEND_GEAR, ExtendGear); BIND_ACTION(AircraftObject, TOGGLE_GEAR, ToggleGear); BIND_MOTION(AircraftObject, PAN_VIEW, PanView); BIND_AXIS(AircraftObject, THROTTLE, Throttle); } |
From: <mk...@us...> - 2003-01-04 23:49:54
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv16793/Include Added Files: Tag: simdata HID.h Log Message: initial version of a new virtual human interface device --- NEW FILE: HID.h --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file HID.h * **/ #ifndef __HID_H__ #define __HID_H__ #include "SDL_events.h" #include "SDL_keysym.h" #include "SDL_keyboard.h" #include <vector> #include <hash_map> #include "SimObject.h" /** * class HID - Base class for Human Interface Device mapping and scripting. * */ class HID { public: virtual bool OnKeyDown(SDL_keysym &key) = 0; virtual bool OnKeyUp(SDL_keysym &key) = 0; virtual bool OnJoystickButtonDown(int joynum, int butnum) = 0; virtual bool OnJoystickButtonUp(int joynum, int butnum) = 0; virtual void OnJoystickAxisMotion(int joynum, int axis, int val) = 0; virtual bool OnMouseMove(SDL_MouseMotionEvent const &) = 0; virtual bool OnMouseButtonDown(SDL_MouseButtonEvent const &) = 0; virtual bool OnMouseButtonUp(SDL_MouseButtonEvent const &) = 0; /* virtual void OnJoystickHatMotion(int joynum, int hat, int val) = 0; */ virtual void OnUpdate(double) = 0; virtual void bindObject(SimObject *) = 0; }; class EventMapping { public: typedef enum { RELEASE, PRESS } EDir; struct LinearCorrection { int low, high; int offset; double scale; }; struct Axis { Axis(int id_ = -1): id(id_) {} int id; }; struct Action { double time; int id; }; typedef std::vector<Action> Script; typedef std::hash_map<int, Script> script_map; typedef script_map::const_iterator EventScript; typedef std::hash_map<int, int> motion_map; int getKeyID(SDL_keysym &key, EDir dir, int mode) const; int getJoystickButtonID(int device, int button, EDir dir, int mode) const; int getMouseButtonID(int device, int button, EDir dir, int kmode, int mode) const; int getMouseMotionID(int device, int state, int kmode, int mode) const; Script const *getKeyScript(SDL_keysym &key, EDir dir, int mode) const; Script const *getJoystickButtonScript(int device, int button, EDir dir, int mode) const; Script const *getMouseButtonScript(int device, int button, EDir dir, int kmode, int mode) const; Axis const *getJoystickAxis(int device, int axis) const; int getMouseMotion(int device, int state, int kmode, int mode) const; void addKeyMap(SDL_keysym &key, EDir dir, int mode, Script const &s); void addJoystickButtonMap(int device, int button, EDir dir, int mode, Script const &s); void addJoystickAxisMap(int device, int axis, Axis const &a); void addMouseMotionMap(int device, int state, int kmod, int mode, int map_to); // convenience method for testing purposes only void addKeyMap(SDLKey vkey, SDLMod kmode, EDir dir, int mode, int action, double time); // convenience method for testing purposes only void addJoystickButtonMap(int device, int button, EDir dir, int mode, int action, double time); private: script_map m_KeyMap; script_map m_JoystickButtonMap; script_map m_MouseButtonMap; motion_map m_MouseMotionMap; Axis m_JoystickAxisMap[4][8]; }; class VirtualHID: public HID { public: typedef void (*ActionAdapter)(SimObject *, int, int); typedef void (*MotionAdapter)(SimObject *, int, int, int, int); typedef void (*AxisAdapter)(SimObject *, int); VirtualHID(); virtual ~VirtualHID(); virtual void setMapping(EventMapping const & map); virtual void bindObject(SimObject *object); virtual bool OnKeyDown(SDL_keysym &key); virtual bool OnKeyUp(SDL_keysym &key); virtual bool OnJoystickButtonDown(int joynum, int butnum); virtual bool OnJoystickButtonUp(int joynum, int butnum); virtual void OnJoystickAxisMotion(int joynum, int axis, int val); virtual bool OnMouseMove(SDL_MouseMotionEvent const &event); virtual bool OnMouseButtonDown(SDL_MouseButtonEvent const &event); virtual bool OnMouseButtonUp(SDL_MouseButtonEvent const &event); virtual void OnUpdate(double dt); protected: virtual void setScript(EventMapping::Script const *s, int x = -1, int y = -1); virtual void bindEvents() = 0; virtual void setVirtualMode(int mode); typedef std::hash_map<int, ActionAdapter> ActionMap; typedef std::hash_map<int, MotionAdapter> MotionMap; typedef std::vector<AxisAdapter> AxisMap; ActionMap m_Actions; MotionMap m_Motions; AxisMap m_Axes; int m_VirtualMode; const EventMapping *m_Map; SimObject *m_Object; EventMapping::Script const *m_ActiveScript; EventMapping::Script::const_iterator m_ScriptAction; double m_ScriptTime; int m_LastMouseMoveID; MotionAdapter m_LastMouseMoveAdapter; int m_MouseEventX; int m_MouseEventY; }; #define ACTION_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int, int) {\ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->method();\ } #define CLICK_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int x, int y) {\ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->method(x, y);\ } #define MOTION_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int x, int y, int dx, int dy) {\ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->method(x, y, dx, dy);\ } #define AXIS_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int value) {\ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->set##method(value);\ } class AircraftObject: public SimObject { public: virtual void RetractGear() { cout << "retracting gear\n"; } virtual void ExtendGear() { cout << "extending gear\n"; } virtual void ToggleGear() { cout << "toggling gear\n"; } virtual void setThrottle(double x) { cout << "throttle = " << x << endl; } virtual void PanView(int x, int y, int dx, int dy) { cout << "mouse " << x << ", " << y << " (" << dx << ", " << dy << ")\n"; } virtual void dump() {} virtual void OnUpdate(double) {} virtual void initialize() {} virtual unsigned int OnRender() {} ACTION_INTERFACE(AircraftObject, RetractGear); ACTION_INTERFACE(AircraftObject, ExtendGear); ACTION_INTERFACE(AircraftObject, ToggleGear); MOTION_INTERFACE(AircraftObject, PanView); AXIS_INTERFACE(AircraftObject, Throttle); }; #define BIND_ACTION(obj_class, id, method) \ m_Actions[id] = &obj_class::on##method; #define BIND_AXIS(obj_class, id, method) \ m_Axes[id] = &obj_class::on##method; #define BIND_MOTION(obj_class, id, method) \ m_Motions[id] = &obj_class::on##method; class AircraftInterface: public VirtualHID { public: enum { RETRACT_GEAR, EXTEND_GEAR, TOGGLE_GEAR }; enum { THROTTLE, AILERONS, ELEVATORS, RUDDER }; enum { PAN_VIEW }; AircraftInterface(); protected: virtual void bindEvents(); }; /* Right now identifiers like THROTTLE and EXTEND_GEAR are class static enums. In principle they are only needed for the bindEvents method. External tools need to access these values as STRING:INT pairs, and I don't see a safe/easy way to do this right now. Moreover, when a class is extended the resulting enums must be set higher than the parent enum range (which may change!). This is rather inelegant. It would be better if we could do something like string concatination to grow the list of ID's in derived classes. Spacing the ranges in derived classes probably a good thing, so that the base class id list can grow without breaking other ids. Once defined an id would ideally never change, since such changes require rebuilding of all binary map images. */ /* map scripts want: define RETRACT_GEAR 0 define EXTEND_GEAR 1 define TOGGLE_GEAR 2 which has to be generated somehow. the id numbers only have to be unique within a given class inheritance chain. internally we have enums, #defines, const int, etc. to work with. it would be ideal to keep these values within the classes they refer to rather than a namespace so that changes can be made locally. this makes generation of the map defines much harder though. for namespaces we'd have something like: namespace map_AircraftObject { const int RETRACT_GEAR = 0; const int EXTEND_GEAR = 1; } which doesn't really solve the problem, introduces unnecessary variables, and separates the constants from their associated class. considering that the script namespace is flat, we are "guaranteed" that the ids are unique. so we can put them in a separate file and #include them directly into the class? given a suitable file extension it would be easy to scan them all and extract the necessary define commands. this works pretty well: class A { public: enum { #include "A.map" }; ... }; with A.map in the form: X = 2000, Y, Z, which can easily be converted to define X 2000 define Y 2001 define Z 2002 the converter should check for duplicate id names with different id values and spew copious warnings if any are found. probably commenting should be enforced by the converter, so you would have to write: X = 2000, // Do X blah blah Y, // Do Y blah blah Z, // Do something else which would then translate to define X 2000 # Do X blah blah define Y 2001 # Do Y blah blah define Z 2002 # Do something else the filename will match the classname so it should be fairly clear what each id is used for. the enum lists should always end with a comma so they can be concatinated with multiple #include directives. */ /* map x36.axis0 to THROTTLE map x36.axis4 to HUDSCALE in NAV band HUDSCALE map band.HUDSCALE 0.0 script map band.HUDSCALE 0.1 script map band.HUDSCALE 0.5 script */ #endif // __HID_H__ |
From: <mk...@us...> - 2003-01-02 18:59:03
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Docs In directory sc8-pr-cvs1:/tmp/cvs-serv28417 Modified Files: manual.txt Log Message: fixed line endings Index: manual.txt =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Docs/manual.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** manual.txt 24 Sep 2002 21:59:35 -0000 1.1.1.1 --- manual.txt 2 Jan 2003 18:58:56 -0000 1.2 *************** *** 1,83 **** ! CSP Flight Sim ! ! keys ! 1 - In plane view ! 2 - External view behind plane ! 3-7 Other views. ! ! F9 - Toggles command console mode ! F10 - Toggles Statistics ! ! ESC - Quit ! ! Joystick - up/down - right/left ! Button One - fires missile ! Hat - rotates view ! ! Commands ( Console and Script ) ! ! Basic commands ! ! Keywords are in uppercase. ! non keywords are in mixed case. ! ! ADD - Add something to the world/game. ! DELETE - Delete something from the World/game. ! LIST - Display a world/game list. ! GET - Display a World/Game variable. ! SET - Set a World/Game variable. ! RUN - Execute a Script ! ! Command Details ! ADD ! ADD TYPE Base name - Adds a new object type of BASE type. ! Current base types are TANK, AIRPLANE, PROJECTILE, ! MISSILE and STATIC. ! ADD OBJECT Type name - Adds an object to the world with Name and of Type. ! ADD AERO name - Adds an aero parameter set. ! ADD TERRAIN name - Adds terrain. ! ! DELETE ! DELETE OBJECT name ! DELETE TYPE name ! ! RUN ! RUN Scriptfile ! ! GET ! GET PLAYER_POSITION|P_POS - Displays the players current position. ! GET OBJECT_POSITION|OBJ_POS - Displays an objects current position. ! ! SET ! SET name Property Value - used to set a property to value for name. ! Properties depend on the type of name. ! Properties for Objects include: ! POSITION|POS x y z - sets the position of the object. ! VELOCITY|VELO Vx Vy Vz - sets the velocity of the object. ! ORIENTATION|ORI heading pitch roll - sets the orientation of the object. ! FREEZE|SLEEP ON|OFF - sets the freeze state of the object. ! COMPLEX_PHYSICS ON|OFF - toggles between physics modes. ! ! Properties for types include: ! Model filename - Sets the model for a type. ! Aero aeroname - Sets the aero param set for a type. ! ! Properties for aero include: ! [ TO DO ] ! ! Properties for terrain include ! Active ON|OFF - Activates the terrain, Other properties must be set first. ! Lattice True|False - Uses a Lattice if True, single terrain file if false ! DetailThreshold value - Sets the detail threshold value. ! ! ! Properties for system variables ! SET WIREFRAME ON|OFF ! SET FOG ON|OFF ! SET FOG_START Value ! SET FOG_END Value ! SET VIEW_DISTANCE Value ! SET TERRAIN_THRESHOLD Value ! ! ! --- 1,83 ---- ! CSP Flight Sim ! ! keys ! 1 - In plane view ! 2 - External view behind plane ! 3-7 Other views. ! ! F9 - Toggles command console mode ! F10 - Toggles Statistics ! ! ESC - Quit ! ! Joystick - up/down - right/left ! Button One - fires missile ! Hat - rotates view ! ! Commands ( Console and Script ) ! ! Basic commands ! ! Keywords are in uppercase. ! non keywords are in mixed case. ! ! ADD - Add something to the world/game. ! DELETE - Delete something from the World/game. ! LIST - Display a world/game list. ! GET - Display a World/Game variable. ! SET - Set a World/Game variable. ! RUN - Execute a Script ! ! Command Details ! ADD ! ADD TYPE Base name - Adds a new object type of BASE type. ! Current base types are TANK, AIRPLANE, PROJECTILE, ! MISSILE and STATIC. ! ADD OBJECT Type name - Adds an object to the world with Name and of Type. ! ADD AERO name - Adds an aero parameter set. ! ADD TERRAIN name - Adds terrain. ! ! DELETE ! DELETE OBJECT name ! DELETE TYPE name ! ! RUN ! RUN Scriptfile ! ! GET ! GET PLAYER_POSITION|P_POS - Displays the players current position. ! GET OBJECT_POSITION|OBJ_POS - Displays an objects current position. ! ! SET ! SET name Property Value - used to set a property to value for name. ! Properties depend on the type of name. ! Properties for Objects include: ! POSITION|POS x y z - sets the position of the object. ! VELOCITY|VELO Vx Vy Vz - sets the velocity of the object. ! ORIENTATION|ORI heading pitch roll - sets the orientation of the object. ! FREEZE|SLEEP ON|OFF - sets the freeze state of the object. ! COMPLEX_PHYSICS ON|OFF - toggles between physics modes. ! ! Properties for types include: ! Model filename - Sets the model for a type. ! Aero aeroname - Sets the aero param set for a type. ! ! Properties for aero include: ! [ TO DO ] ! ! Properties for terrain include ! Active ON|OFF - Activates the terrain, Other properties must be set first. ! Lattice True|False - Uses a Lattice if True, single terrain file if false ! DetailThreshold value - Sets the detail threshold value. ! ! ! Properties for system variables ! SET WIREFRAME ON|OFF ! SET FOG ON|OFF ! SET FOG_START Value ! SET FOG_END Value ! SET VIEW_DISTANCE Value ! SET TERRAIN_THRESHOLD Value ! ! ! |
From: <mk...@us...> - 2003-01-02 18:56:32
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/BuildMSVC In directory sc8-pr-cvs1:/tmp/cvs-serv27424 Modified Files: CSPFlightSim.dsw Log Message: fixed line endings Index: CSPFlightSim.dsw =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/BuildMSVC/CSPFlightSim.dsw,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CSPFlightSim.dsw 24 Sep 2002 21:59:35 -0000 1.1.1.1 --- CSPFlightSim.dsw 2 Jan 2003 18:56:28 -0000 1.2 *************** *** 1,29 **** ! Microsoft Developer Studio Workspace File, Format Version 6.00 ! # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ! ! ############################################################################### ! ! Project: "CSPFlightSim"=.\CSPFlightSim.dsp - Package Owner=<4> ! ! Package=<5> ! {{{ ! }}} ! ! Package=<4> ! {{{ ! }}} ! ! ############################################################################### ! ! Global: ! ! Package=<5> ! {{{ ! }}} ! ! Package=<3> ! {{{ ! }}} ! ! ############################################################################### ! --- 1,29 ---- ! Microsoft Developer Studio Workspace File, Format Version 6.00 ! # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ! ! ############################################################################### ! ! Project: "CSPFlightSim"=.\CSPFlightSim.dsp - Package Owner=<4> ! ! Package=<5> ! {{{ ! }}} ! ! Package=<4> ! {{{ ! }}} ! ! ############################################################################### ! ! Global: ! ! Package=<5> ! {{{ ! }}} ! ! Package=<3> ! {{{ ! }}} ! ! ############################################################################### ! |
From: <sto...@us...> - 2003-01-01 20:55:12
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet/RAW2txt In directory sc8-pr-cvs1:/tmp/cvs-serv8303 Added Files: RAW2txt.dsp raw2txt.cpp Log Message: no message --- NEW FILE: RAW2txt.dsp --- # Microsoft Developer Studio Project File - Name="RAW2txt" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=RAW2txt - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "RAW2txt.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "RAW2txt.mak" CFG="RAW2txt - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "RAW2txt - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "RAW2txt - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "RAW2txt - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "RAW2txt - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "RAW2txt - Win32 Release" # Name "RAW2txt - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\raw2txt.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: raw2txt.cpp --- // Combat Simulator Project - RAW2txt - writes RAW data to a text file // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * This tool can be used to verify the result of the fractal * generator. It converts the binary data from a RAW file * to text. This text file can either be opened with an editor, * or the data can be imported to Excel. This was used during * the development of the fractal tool, mostly to track down * bugs by analyzing the output of the fractal routines. * * @author Martin "Stormbringer" Hoffmann <sto...@gm...> */ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "io.h" #include "fcntl.h" #include "SYS\STAT.H" #include "math.h" short *aiHeightmap, *fract_map; int iWidth, iHeight; char cSourceFileName[256], cDestFileName[256], cPosX[256], cPosY[256], cStringBuffer[256], cSize[256]; long iSourceFileHandle, iDestFileHandle; int LoadRAWTerrain(int iFile) { int success; long lsize; short *buffer; float fwidth; int iWidth, iHeight; // Load SCN data and save to internal structure lsize = _filelength(iFile); lsize /= 2; // SCN uses 16bit height values, so we have to divide by 2 // to get the real number of height map values fwidth = (float)sqrt((double)lsize); // compute terrain width from size of file iWidth = (int)fwidth; iHeight = (int)fwidth; aiHeightmap = new short[lsize]; buffer = new short[lsize]; fract_map = new short[lsize]; success = _read(iFile, buffer, (lsize*sizeof(short))); for (int y=0; y<iWidth; y++) for (int x=0; x<iWidth; x++) { fract_map[y*iWidth+x] = (short)buffer[y*iWidth+x]; } delete []buffer; return iWidth; } /** * ConvertRAWtoTXT - writes RAW data to a text file * * This function can be used to verify the result of the fractal * generator. It converts the binary data from a RAW file * to text. This text file can either be opened with an editor, * or the data can be imported to Excel. This was used during * the development of the fractal tool, mostly to track down * bugs by analyzing the output of the fractal routines. * * @author Martin "Stormbringer" Hoffmann <sto...@gm...> */ int ConvertRAWtoTXT(int iDestFileHandle, int iSourceFileHandle) { char cValue[100], cBuffer[100]; int countX, countY, intbuffer, Success; int uiCurrentQuadWidth = (int)(sqrt((float)_filelength(iSourceFileHandle)/2)); for(countY=0;countY<uiCurrentQuadWidth;countY++) { for(countX=0;countX<uiCurrentQuadWidth;countX++) { intbuffer = (int)fract_map[countY*uiCurrentQuadWidth+countX]; cBuffer[0] = (char)0; itoa(intbuffer, cValue, 10); int diff=0; diff = 6 - strlen(cValue); for(int i=0;i<diff;i++) { strcat(cBuffer, "0"); } if(intbuffer < 0) { _strnset(cBuffer, '-', 1); _strnset(cValue, '0', 1); } else { _strnset(cBuffer, ' ', 1); } strcat(cBuffer, cValue); Success = _write(iDestFileHandle, cBuffer, strlen(cBuffer)); strcpy(cValue, ", "); Success = _write(iDestFileHandle, cValue, strlen(cValue)); } strcpy(cValue, "\n"); Success = write(iDestFileHandle, cValue, strlen(cValue)); } _chmod(cDestFileName, _S_IREAD | _S_IWRITE); _close(iDestFileHandle); return 1; } int main(int argc, char* argv[]) { if(argc < 2) { printf("Not enough parameters!\n"); return -1; } // Source and Destination file names strcpy(cSourceFileName, argv[1]); strcpy(cDestFileName, argv[2]); iSourceFileHandle = _open(cSourceFileName, _O_BINARY); if(iSourceFileHandle==-1) { printf("unable to open '%s'!\n", cSourceFileName); char text[100]; gets(text); return -1; } iDestFileHandle = _open(cDestFileName, _O_CREAT | _O_RDWR, _S_IREAD | _S_IWRITE); if(iDestFileHandle==-1) { printf("unable to open '%s'!\n", cDestFileName); char text[100]; gets(text); _close(iSourceFileHandle); return -1; } LoadRAWTerrain(iSourceFileHandle); ConvertRAWtoTXT(iDestFileHandle, iSourceFileHandle); _close(iSourceFileHandle); _close(iDestFileHandle); return 0; } |
From: <sto...@us...> - 2003-01-01 20:54:41
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet/RAWExtract In directory sc8-pr-cvs1:/tmp/cvs-serv8139 Added Files: RAWExtract.dsp RAWExtract.cpp Log Message: no message --- NEW FILE: RAWExtract.dsp --- # Microsoft Developer Studio Project File - Name="RAWExtract" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=RAWExtract - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "RAWExtract.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "RAWExtract.mak" CFG="RAWExtract - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "RAWExtract - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "RAWExtract - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "RAWExtract - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "RAWExtract - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "RAWExtract - Win32 Release" # Name "RAWExtract - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\RAWExtract.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: RAWExtract.cpp --- // Combat Simulator Project - RAWExtract - RAW Data Extraction Tool // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * This tool extracts a block of any size as a file of its * own from a larger RAW file. The resulting file can either be imported * Photoshop or any other image processing program, or converted to text * using RAW2txt. * * @author Martin "Stormbringer" Hoffmann <sto...@gm...> */ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "io.h" #include "fcntl.h" #include "SYS\STAT.H" #include "math.h" short *aiHeightmap, *fract_map; int iWidth, iHeight; char cSourceFileName[256], cDestFileName[256], cPosX[256], cPosY[256], cStringBuffer[256], cSize[256]; long iSourceFileHandle, iDestFileHandle; int LoadTerrain(int iFile, int start_x, int start_y, int dest_width) { int success; long lsize; short *buffer; float fwidth; int iWidth, iHeight; // Load SCN data and save to internal structure lsize = _filelength(iFile); lsize /= 2; // SCN uses 16bit height values, so we have to divide by 2 // to get the real number of height map values fwidth = (float)sqrt((double)lsize); // compute terrain width from size of file iWidth = (int)fwidth; iHeight = (int)fwidth; aiHeightmap = new short[lsize]; buffer = new short[lsize]; fract_map = new short[dest_width*dest_width]; success = _read(iFile, buffer, (lsize*sizeof(short))); for (int y=start_y; y<start_y+dest_width; y++) for (int x=start_x; x<start_x+dest_width; x++) { fract_map[(y-start_y)*dest_width+x-start_x] = (short)buffer[y*iHeight+x]; } delete []buffer; return iWidth; } int SaveTerrain(int iDestFileHandle, int size) { int success; success = _write(iDestFileHandle, fract_map, size); _chmod(cDestFileName, _S_IREAD | _S_IWRITE); _close(iDestFileHandle); return 1; } int main(int argc, char* argv[]) { printf("CSP - RAW Data Extractor\n" "Copyright (C) 2002 The Combat Simulator Project\n" "http://csp.sourceforge.net\n\n"); if(argc < 5) { printf("ERROR: Not enough parameters!\n\n" "Usage: RAWExtract sourcefile destfile XPos YPos Size\n\n"); return -1; } // Source and Destination file names strcpy(cSourceFileName, argv[1]); strcpy(cDestFileName, argv[2]); strcpy(cPosX, argv[3]); strcpy(cPosY, argv[4]); strcpy(cSize, argv[5]); iSourceFileHandle = _open(cSourceFileName, _O_BINARY); if(iSourceFileHandle==-1) { printf("unable to open '%s'!\n", cSourceFileName); char text[100]; gets(text); return -1; } iDestFileHandle = _open(cDestFileName, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD | _S_IWRITE); if(iDestFileHandle==-1) { printf("unable to open '%s'!\n", cDestFileName); char text[100]; gets(text); _close(iSourceFileHandle); return -1; } LoadTerrain(iSourceFileHandle, atoi(cPosX), atoi(cPosY), atoi(cSize)); SaveTerrain(iDestFileHandle, sizeof(short)*(atoi(cSize)*atoi(cSize))); _close(iSourceFileHandle); _close(iDestFileHandle); return 0; } |
From: <sto...@us...> - 2003-01-01 20:54:11
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet/FracBuild In directory sc8-pr-cvs1:/tmp/cvs-serv7986 Added Files: Smooth.cpp FracBuild.h FracBuild.dsp FracBuild.cpp Log Message: no message --- NEW FILE: Smooth.cpp --- // Combat Simulator Project - FracBuild - Fractal Terrain Generator // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file Smooth.cpp * **/ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "io.h" #include "fcntl.h" #include "SYS\STAT.H" #include "math.h" extern char cSourceFileName[256], cDestFileName[256], cStringBuffer[256]; extern long iSourceFileHandle, iDestFileHandle; extern float fFactorD; void Smooth(float fSmoothFactor) { int iWidthX, iWidthY, x, y; float fA, fB, fC, fD, fX; int iFileLenght, iWidth, iHeight, iSuccess, i, current_width; short sBuffer; float fWidth; iFileLenght = _filelength(iSourceFileHandle); fWidth = (float)sqrt((float)iFileLenght/2); // compute terrain width from size of file iWidth = (int)fWidth; iHeight = (int)fWidth; for(i=0; i<(iFileLenght/2); i++) { _lseek(iSourceFileHandle, i*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, (sizeof(short))); // printf("Count: %d, Value: %d\n",i,sBuffer); } iWidthX = iWidthY = (int)fWidth; current_width = iWidthX; printf("\ncopying source map to destination map.\n"); for(y=0;y<current_width;y++) { printf("Processing row %d of %d\r",y,current_width); for(x=0;x<current_width;x++) { // m_pFractMap[y*fract_width*dist_factor+x*dist_factor] = // m_pTerrainData->m_pHeightmap[y*current_width+x]; _lseek(iSourceFileHandle, (y*current_width+x)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); _lseek(iDestFileHandle, (y*current_width+x)*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); } } // fHeightmap = m_pTerrainData->m_pHeightmap; // X is the point to smooth, B is its left, C its right neighbour // on the actual heightmap level // A is B's left neighbour, D is c's right neighbour // on the previous heightmap level, // so the index for A and D is -3;+3. -2;+2 would reference // values from the actual level // smooth every 2nd point in the heightmap, X direction printf("performing smoothing step in X direction.\n"); for(y=0;y<iWidthY;y++) { printf("Processing row %d of %d\r",y,iWidthY); for(x=1;x<iWidthX-1;x+=2) { // calculate index for heightmap array i = y*iWidthX+x; // check if there is a valid B, if not, set B = X if((x-1) < 0) { // fB = fHeightmap[i]; _lseek(iSourceFileHandle, i*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fB = (float)sBuffer; } else { // fB = fHeightmap[i-1]; _lseek(iSourceFileHandle, (i-1)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fB = (float)sBuffer; } // check if there is a valid A, if not, set A = B if((x-3) < 0) fA = fB; else { // fA = fHeightmap[i-3]; _lseek(iSourceFileHandle, (i-3)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fA = (float)sBuffer; } // check if there is a valid C, if not, set C = X if((x+1) > (iWidthX-1)) { // fC = fHeightmap[i]; _lseek(iSourceFileHandle, i*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fC = (float)sBuffer; } else { // fC = fHeightmap[i+1]; _lseek(iSourceFileHandle, (i+1)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fC = (float)sBuffer; } // check if there is a valid D, if not, set D = C if((x+3) > (iWidthX-1)) fD = fC; else { // fD = fHeightmap[i+3]; _lseek(iSourceFileHandle, (i+3)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fD = (float)sBuffer; } fX = ((fB-fA)+(fC-fD))*fSmoothFactor; if(fX < 0.0) fX = 0.0; // fHeightmap[i] = ((fB+fC)/2)+fX; sBuffer = (short)((fB+fC)/2)+fX; _lseek(iDestFileHandle, i*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); } } // smooth every 2nd point in the heightmap, Y direction printf("performing smoothing step in Y direction.\n"); for(x=0; x<iWidthX; x++) { printf("Processing row %d of %d\r",x,iWidthX); for(y=1; y<iWidthY-1; y+=2) { // calculate index for heightmap array i = y*iWidthX+x; // check if there is a valid B, if not, set B = X if((y-1) < 0) { // fB = fHeightmap[i]; _lseek(iSourceFileHandle, i*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fB = (float)sBuffer; } else { // fB = fHeightmap[i-iWidthX]; _lseek(iSourceFileHandle, (i-iWidthX)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fB = (float)sBuffer; } // check if there is a valid A, if not, set A = B if((y-3) < 0) fA = fB; else { // fA = fHeightmap[i-3*iWidthX]; _lseek(iSourceFileHandle, (i-3*iWidthX)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fA = (float)sBuffer; } // check if there is a valid C, if not, set C = X if((y+1) > (iWidthY-1)) { // fC = fHeightmap[i]; _lseek(iSourceFileHandle, i*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fC = (float)sBuffer; } else { // fC = fHeightmap[i+iWidthX]; _lseek(iSourceFileHandle, (i+iWidthX)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fC = (float)sBuffer; } // check if there is a valid D, if not, set D = C if((y+3) > (iWidthY-1)) fD = fC; else { // fD = fHeightmap[i+3*iWidthY]; _lseek(iSourceFileHandle, (i+3*iWidthY)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); fD = (float)sBuffer; } fX = ((fB-fA)+(fC-fD))*fSmoothFactor; if(fX < 0.0) fX = 0.0; // fHeightmap[i] = ((fB+fC)/2)+fX; sBuffer = (short)((fB+fC)/2)+fX; _lseek(iDestFileHandle, i*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); } } return; } --- NEW FILE: FracBuild.h --- // Combat Simulator Project - FracBuild - Fractal Terrain Generator // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Combat Simulator Project - FracBuild - Fractal Terrain Generator // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file FracBuild.h * **/ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #ifndef ITERATE #define ITERATE 1 #define STANDARD 2 #define GAUSS 3 #define TO24 4 #endif void Smooth(float fSmoothFactor); --- NEW FILE: FracBuild.dsp --- # Microsoft Developer Studio Project File - Name="FracBuild" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=FracBuild - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "FracBuild.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "FracBuild.mak" CFG="FracBuild - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "FracBuild - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "FracBuild - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "FracBuild - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "FracBuild - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "FracBuild - Win32 Release" # Name "FracBuild - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\FracBuild.cpp # End Source File # Begin Source File SOURCE=.\Smooth.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\FracBuild.h # End Source File # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: FracBuild.cpp --- // Combat Simulator Project - FracBuild - Fractal Terrain Generator // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file FracBuild.cpp * **/ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "io.h" #include "fcntl.h" #include "SYS\STAT.H" #include "math.h" #include "FracBuild.h" char cSourceFileName[256], cDestFileName[256], cStringBuffer[256]; long iSourceFileHandle, iDestFileHandle; float fFactorD; /** * Iterate - Implementation of the Diamond Square algorithm * * This function reads a heightmap in 16bit RAW format and * writes a new map with twice the size in both directions. * The new points are created by interpolation and random * displacement of the original map's points. * The function uses direct disc access for reading and writing * points instead of caching them in memory. This makes it * independent from system memory when processing huge maps. * * fFactorD controls the maximum deviation from the actual result * of the interpolation of a group of points. * * @author Martin "Stormbringer" Hoffmann <sto...@gm...> */ int Iterate(float fFactorD) { int iFileLenght, iWidth, iHeight, iSuccess; short sBuffer; float fWidth; iFileLenght = _filelength(iSourceFileHandle); fWidth = (float)sqrt((float)iFileLenght/2); // compute terrain width from size of file iWidth = (int)fWidth; iHeight = (int)fWidth; srand(1); float a, b, c, d, e, f, g, h, i, j, k; float highest, lowest, rnd, interval; int cpos = 0, cneg = 0, x, y; int fract_width, current_width, dist_factor; int higher = 0, _lower = 0, between = 0; // fract_width = width of the destination map fract_width = (iWidth-1) * 2 + 1; // dist_factor determines the spacing between height-values in dest map depending on the source/dest-resolution // example: 129 points source map, 1025 dest map => every 8th point in dest map comes from source map // resolution of dest map is determined by the number of iterations dist_factor = (fract_width-1) / ((fract_width-1) / 2); current_width = iWidth; printf("\nIteration process started. This may take a while.\n\n"); printf("Filesize Source:\t%d Bytes\n", _filelength(iSourceFileHandle)); // copy height values from source map to destination map (fract_map) printf("\ncopying source map to destination map.\n"); for(y=0;y<current_width;y++) { printf("Processing row %d of %d\r",y,current_width); for(x=0;x<current_width;x++) { // m_pFractMap[y*fract_width*dist_factor+x*dist_factor] = // m_pTerrainData->m_pHeightmap[y*current_width+x]; _lseek(iSourceFileHandle, (y*current_width+x)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); _lseek(iDestFileHandle, (y*fract_width*dist_factor+x*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); } } // THE DIAMOND STEP printf("\nperforming diamond step.\n"); for(y=0;y<current_width-1;y++) { printf("processing row %d of %d\r",y,current_width); for(x=0;x<current_width-1;x++) { _lseek(iDestFileHandle, (y*fract_width*dist_factor+x*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); a = (float)sBuffer; _lseek(iDestFileHandle, (y*fract_width*dist_factor+(x+1)*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); b = (float)sBuffer; _lseek(iDestFileHandle, ((y+1)*fract_width*dist_factor+x*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); c = (float)sBuffer; _lseek(iDestFileHandle, ((y+1)*fract_width*dist_factor+(x+1)*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); d = (float)sBuffer; // interval is the difference between the highest and the lowest corner point highest = max(a, max(b, max(c, d))); lowest = min(a, min(b, min(c, d))); interval = abs(highest - lowest)*fFactorD; // generate the random displacement value and scale it to [-interval, interval] rnd = rand() % (unsigned long)(interval - -interval +1) - interval; // calculate the average height value of the four quad corners // and add the random value to the point in the middle of the quad e = (a+b+c+d)/4 + rnd; if(e<0) e=0; sBuffer = (short)e; _lseek(iDestFileHandle, (y*fract_width*dist_factor+(fract_width*dist_factor/2)+ x*dist_factor+(dist_factor/2))*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); #ifdef DEBUG printf("a: %.2f, b: %.2f, c: %.2f, d: %.2f, e: %.2f, buf (e): %d\n", a, b, c, d, e, sBuffer); #endif } } // THE SQUARE STEP printf("\nperforming square step.\n"); for(y=0;y<current_width-1;y++) { printf("processing row %d of %d\r",y,current_width); for(x=0;x<current_width-1;x++) { _lseek(iDestFileHandle, (y*fract_width*dist_factor+x*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); a = (float)sBuffer; _lseek(iDestFileHandle, (y*fract_width*dist_factor+(x+1)*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); b = (float)sBuffer; _lseek(iDestFileHandle, ((y+1)*fract_width*dist_factor+x*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); c = (float)sBuffer; _lseek(iDestFileHandle, ((y+1)*fract_width*dist_factor+(x+1)*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); d = (float)sBuffer; _lseek(iDestFileHandle, (y*fract_width*dist_factor+(fract_width*dist_factor/2)+ x*dist_factor+(dist_factor/2))*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); e = (float)sBuffer; // check if there's a left neighbor for f if(x==0) { // no! highest = max(a, max(c, e)); lowest = min(a, min(c, e)); interval = abs(highest - lowest)*fFactorD; rnd = rand() % (unsigned long)(interval - -interval +1) - interval; // f = (a+c+e)/3 + (rnd * fFactorD); f = (a+c+e)/3 + rnd; #ifdef DEBUG printf("a: %.2f, c: %.2f, e: %.2f, f: %.2f, ", a, c, e, f); #endif } // there is a left neighbor, so get the value! else { _lseek(iDestFileHandle, (y*fract_width*dist_factor+(fract_width*dist_factor/2)+ x*dist_factor-(dist_factor/2))*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); j = (float)sBuffer; highest = max(a, max(c, max(e, j))); lowest = min(a, min(c, min(e, j))); interval = abs(highest - lowest)*fFactorD; rnd = rand() % (unsigned long)(interval - -interval +1) - interval; f = (a+c+e+j)/4 + rnd; #ifdef DEBUG printf("a: %.2f, c: %.2f, e: %.2f, j: %.2f, f: %.2f ", a, c, e, j, f); #endif } if(f<0) f=0; sBuffer = (short)f; _lseek(iDestFileHandle, (y*fract_width*dist_factor+(fract_width*dist_factor/2)+ x*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); #ifdef DEBUG printf("buf (f): %d\n", sBuffer); #endif // check if there's an upper neighbor for g if(y==0) { // no! highest = max(a, max(b, e)); lowest = min(a, min(b, e)); interval = abs(highest - lowest)*fFactorD; rnd = rand() % (unsigned long)(interval - -interval +1) - interval; g = (a+b+e)/3 + rnd; #ifdef DEBUG printf("a: %.2f, b: %.2f, e: %.2f, g: %.2f, ", a, b, e, g); #endif } // there is a upper neighbor, so get the value! else { _lseek(iDestFileHandle, (y*fract_width*dist_factor-(fract_width*dist_factor/2)+ x*dist_factor+(dist_factor/2))*sizeof(short), SEEK_SET); iSuccess = _read(iDestFileHandle, &sBuffer, sizeof(short)); k = (float)sBuffer; highest = max(a, max(b, max(e, k))); lowest = min(a, min(b, min(e, k))); interval = abs(highest - lowest)*fFactorD; rnd = rand() % (unsigned long)(interval - -interval +1) - interval; g = (a+b+e+k)/4 + rnd; #ifdef DEBUG printf("a: %.2f, b: %.2f, e: %.2f, g: %.2f, k: %.2f, ", a, b, e, g, k); #endif } if(g<0) g=0; sBuffer = (short)g; _lseek(iDestFileHandle, (y*fract_width*dist_factor+x*dist_factor+(dist_factor/2))*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); #ifdef DEBUG printf("buf (g): %d\n",sBuffer); #endif // do we have to calculate i? if(y==current_width-2) { //yes highest = max(c, max(d, e)); lowest = min(c, min(d, e)); interval = abs(highest - lowest)*fFactorD; rnd = rand() % (unsigned long)(interval - -interval +1) - interval; i = (c+d+e)/3 + rnd; if(i<0) i=0; #ifdef DEBUG printf("c: %.2f, d: %.2f, e: %.2f, i: %.2f, ", c, d, e, i); #endif sBuffer = (short)i; _lseek(iDestFileHandle, ((y+1)*fract_width*dist_factor+x*dist_factor+(dist_factor/2))*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); #ifdef DEBUG printf("buf (i): %d\n", sBuffer); #endif } // do we have to calculate h? if(x==current_width-2) { highest = max(b, max(d, e)); lowest = min(b, min(d, e)); interval = abs(highest - lowest)*fFactorD; rnd = rand() % (unsigned long)(interval - -interval +1) - interval; h = (b+d+e)/3 + rnd; if(h<0) h=0; sBuffer = (short)h; _lseek(iDestFileHandle, (y*fract_width*dist_factor+(fract_width*dist_factor/2)+ (x+1)*dist_factor)*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); #ifdef DEBUG printf("b: %.2f, d: %.2f, e: %.2f, h: %.2f, buf (h): %d\n", b, d, e, h, sBuffer); #endif } } // end of square step } printf("\nopeartion finished.\n"); printf("filesize destination:\t%d bytes\n", _filelength(iDestFileHandle)); return 0; } void Gauss() { /* Iterate - Implementation of the Diamond Square algorithm * * Blurs the heightmap image with a Gaussian filter algorithm, * outputs to dst using a filter kernel which must be a 2D float * array of size [2*k+1][2*k+1] * * The algorithm used is based on sample code from a gamasutra-article */ int k=3, width, iFileLength, iSuccess; float fWidth; short sBuffer; double fFilterKernel[] = { .00, .00, .00, .05, .00, .00, .00, .00, .05, .18, .32, .18, .05, .00, .00, .18, .64, 1.00, .64, .18, .00, .05, .32, 1.00, 1.00, 1.00, .32, .05, .00, .18, .64, 1.00, .64, .18, .00, .00, .05, .18, .32, .18, .05, .00, .00, .00, .00, .05, .00, .00, .00, }; iFileLength = _filelength(iSourceFileHandle); fWidth = (float)sqrt((float)iFileLength/2); // compute terrain width from size of file width = (int)fWidth; // the gauss algorithm itself for (int y=0;y<width;y++) { for (int x=0;x<width;x++) { float total=0; double *kp=fFilterKernel; int offset; for (int j=-k;j<=k;j++) for (int i=-k;i<=k;i++) { int x2=x+i; int y2=y+j; offset=y2*width+x; if(offset<0) offset=0; _lseek(iSourceFileHandle, (offset)*sizeof(short), SEEK_SET); iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); if (x2>=0 && x2<width && y2>=0 && y2<width) total+=(float)kp[0]*sBuffer; kp++; } total /= 7; if (total<0) total=0; else if (total>60000) total=60000; // dst[y*width+x]=total; sBuffer = (short)total; _lseek(iDestFileHandle, (y*width+x)*sizeof(short), SEEK_SET); iSuccess = _write(iDestFileHandle, &sBuffer, sizeof(short)); } } return; } void ConvertTo24Bit() { int i, width, iFileLength, iSuccess, iNumPoints; float fWidth; short sBuffer; char cZero=0, cHiByte, cLoByte; iFileLength = _filelength(iSourceFileHandle); iNumPoints = iFileLength/2; fWidth = (float)sqrt((float)iFileLength/2); // compute terrain width from size of file width = (int)fWidth; for(i=0;i<iNumPoints;i++) { iSuccess = _read(iSourceFileHandle, &sBuffer, sizeof(short)); cHiByte = (char)sBuffer & 0xFF; cLoByte = (char)(sBuffer >> 8); iSuccess = _write(iDestFileHandle, &cZero, sizeof(char)); iSuccess = _write(iDestFileHandle, &cLoByte, sizeof(char)); iSuccess = _write(iDestFileHandle, &cHiByte, sizeof(char)); } printf("Dest file width: %d\n Bytes", width); } int main(int argc, char* argv[]) { int operation, i; printf("CSP - Fractal Terrain Builder\n" "Copyright (C) 2002 The Combat Simulator Project\n" "http://csp.sourceforge.net\n\n"); if(argc < 4) { printf("ERROR: Not enough parameters!\n\n" "Usage: FracBuild sourcefile destfile operation [factor]\n\n" "Operations:\n\n" "-iterate\tcreates one iteration level. x and y resolution of the heightmap" "\t\tare doubled. the destination file is four times larger than\n" "\t\tthe source, so be careful with large maps! `factor`\n" "\t\tindicates the maximum random deviation of an interpolated\n" "\t\tpoint. Example: 0.10 generates fractal points which are no more\n" "\t\tthan 10%% higher or lower as the interpolated value. Keeping the\n" "\t\tfactor low makes sure that the resulting fractal map keeps the\n" "\t\tshape of the source map.\n\n" "-s:standard\tsmoothes the map. this is necessary because fractalisation\n" "\t\tsometimes causes rough edges, which make the terrain look\n" "\t\tartificial. `factor` has the similar meaning as with `iterate`.\n\n" "-s:gauss\tis another smoothing method, using a gaussian filter. this\n" "\t\tfilter modifies not only the fractally generated points, but\n" "\t\tthe original values as well. no factor parameter is required.\n\n" "-to24\t\tconverts a RAW format heightmap to the 24bit format required\n" "\t\tfor use with demeter. the file size will be increased, without\n" "\t\timproving image quality, so it makes no sense using this\n" "\t\tfunction without demeter.\n"); return -1; } // Source and Destination file names strcpy(cSourceFileName, argv[1]); strcpy(cDestFileName, argv[2]); // check for other paramters for(i=0; i<argc-3; i++) { strcpy(cStringBuffer, argv[i+3]); if((stricmp(cStringBuffer, "-s:gauss"))==0) { operation = GAUSS; break; } if((stricmp(cStringBuffer, "-s:standard"))==0) { operation = STANDARD; strcpy(cStringBuffer, argv[i+4]); fFactorD = (float)atof(cStringBuffer); break; } if((stricmp(cStringBuffer, "-to24"))==0) { operation = TO24; break; } if((stricmp(cStringBuffer, "-iterate"))==0) { operation = ITERATE; strcpy(cStringBuffer, argv[i+4]); fFactorD = (float)atof(cStringBuffer); break; } } iSourceFileHandle = _open(cSourceFileName, _O_BINARY); if(iSourceFileHandle==-1) { printf("ERROR: unable to open '%s'!\n", cSourceFileName); char text[100]; gets(text); return -1; } iDestFileHandle = _open(cDestFileName, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD | _S_IWRITE); if(iDestFileHandle==-1) { printf("ERROR: unable to open '%s'!\n", cDestFileName); char text[100]; gets(text); _close(iSourceFileHandle); return -1; } switch(operation) { case ITERATE: Iterate(fFactorD); break; case GAUSS: Gauss(); break; case STANDARD: Smooth(fFactorD); break; case TO24: ConvertTo24Bit(); break; } _close(iSourceFileHandle); _close(iDestFileHandle); return 0; } |
From: <sto...@us...> - 2003-01-01 20:53:43
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet In directory sc8-pr-cvs1:/tmp/cvs-serv7841 Added Files: GuideToTerrainGeneration.txt Log Message: no message --- NEW FILE: GuideToTerrainGeneration.txt --- A quick guide to CSP terrain generation Building a terrain for the CSP Flight Simulator or the CSP Terrain Demo needs several steps, which are described in this document. The easiest way is converting an existing Falcon 4.0 terrain set to the CSP terrain format, and enhancing its detail with the CSP terrain tools. If you want to model an area which isn't covered by one of the Falcon 4.0 mod groups, you will first have to build this landscape from any DEM data source in the Falcon 4.0 format. Very good instructions on this topic can be found at http://falcon4.nekromantix.com/docs/terrain.php As soon as you have got your Falcon 4.0 terrain set, you can convert it to the CSP format. For this task you need the F4Map2CSP map converter. Select your new F4 map file as source, and specify the name of the CSP map you want to create as destination. Then select "L2" as the level. Falcon stores several detail levels of each map, where L2 contains the original DEM data, so this is the one we want. The other levels contain either less detail, or are artificially enhanced by simple interpolation. After the conversion you should find the resulting .raw file. If you have Adobe Photo Shop or any other image processing tool capable of reading 16bit raw data, you can load your map in there and have a look at it (hint: in photoshop you first have to select 16bit, one channel, ibm byte order to load the map properly, and then apply "auto contrast" before you can see anything). This map can already be used as a data source for the CSP Terrain Demo. However, it won't look very convincing. You have to consider that the distance between two points on this map is as much as 1km in the real world! What we want to do now is to enhance the map's detail. There are only few sources for high resolution elevation data on the WWW, most of them not freely available. So we have to add artificial detail to our map. We want this detail to look "natural", and therefore we use a fractal methods to get it. These methods are based on the "diamond square" or "midpoint displacement" algorithm. Detailed descriptions of this algorithm are available on the web. All operations needed for this task can be done with the FracBuild tool. Open a dos shell and start FracBuild without any parameters. A description with the command line parameters will be displayed. You'll have to call FracBuild several times, beacuse every call builds one iteration on the map, halving the distance between two points on the map. So in our example the point distance after the first iteration will be 500m, instead of 1000m. To learn about how the resulting map is influenced by the scaling factor you have to specify when running FracBuild, i recommend TerrainLab as a testing environment. Here you can see the result on a very small map in real time, while FracBuild may need hours to finish a continental size terrain. As the last step we want to smooth our map. This reduces artifacs created by the fractalisation. Smoothing is also done by FracBuild, calling it with the "s:standard" or "s:gauss" option. As mentioned above every .raw file can be used with the CSP Terrain Demo. Creating a new terrain for the CSP Flight Simulator is a bit more complicated. [Delta or Wolverine, could you please write a few lines about that?] |
From: <sto...@us...> - 2003-01-01 20:53:28
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet In directory sc8-pr-cvs1:/tmp/cvs-serv7755 Added Files: TerrainToolSet.dsw TerrainToolSet.dsp Log Message: no message --- NEW FILE: TerrainToolSet.dsw --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TerrainToolSet.dsp --- # Microsoft Developer Studio Project File - Name="TerrainToolSet" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=TerrainToolSet - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "TerrainToolSet.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "TerrainToolSet.mak" CFG="TerrainToolSet - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "TerrainToolSet - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "TerrainToolSet - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "TerrainToolSet - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "TerrainToolSet - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "TerrainToolSet - Win32 Release" # Name "TerrainToolSet - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project |
From: <sto...@us...> - 2003-01-01 20:52:33
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet/FracBuild In directory sc8-pr-cvs1:/tmp/cvs-serv7459/FracBuild Log Message: Directory /cvsroot/csp/APPLICATIONS/TerrainToolSet/FracBuild added to the repository |
From: <sto...@us...> - 2003-01-01 20:52:23
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet/RAW2txt In directory sc8-pr-cvs1:/tmp/cvs-serv7404/RAW2txt Log Message: Directory /cvsroot/csp/APPLICATIONS/TerrainToolSet/RAW2txt added to the repository |
From: <sto...@us...> - 2003-01-01 20:52:13
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet/RAWExtract In directory sc8-pr-cvs1:/tmp/cvs-serv7328/RAWExtract Log Message: Directory /cvsroot/csp/APPLICATIONS/TerrainToolSet/RAWExtract added to the repository |
From: <sto...@us...> - 2003-01-01 20:51:10
|
Update of /cvsroot/csp/APPLICATIONS/TerrainToolSet In directory sc8-pr-cvs1:/tmp/cvs-serv7002/TerrainToolSet Log Message: Directory /cvsroot/csp/APPLICATIONS/TerrainToolSet added to the repository |
From: <de...@us...> - 2002-12-31 16:31:41
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/BuildMSVC In directory sc8-pr-cvs1:/tmp/cvs-serv26420 Modified Files: CSPFlightSim.dsp Log Message: no message Index: CSPFlightSim.dsp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/BuildMSVC/CSPFlightSim.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CSPFlightSim.dsp 14 Dec 2002 18:44:55 -0000 1.3 --- CSPFlightSim.dsp 31 Dec 2002 16:31:37 -0000 1.4 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GR /GX /Zi /Od /Ob2 /I "../Include" /I "../../../THIRDPARTYLIBS/Include" /I "../../../THIRDPARTYLIBS/demeter" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_STLP_USE_OWN_NAMESPACE" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GR /GX /Zi /Od /I "../Include" /I "../../../THIRDPARTYLIBS/Include" /I "../../../THIRDPARTYLIBS/demeter" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_STLP_USE_OWN_NAMESPACE" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 55,60 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 ! # ADD LINK32 osgparticle.lib osgtext.lib demetervisualc6.lib osg.lib osgUtil.lib osgDb.lib SDL.lib SDLMain.lib opengl32.lib glaux.lib glu32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib DemeterVisualC6.lib SDL_Console.lib gdal_i.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../Bin/CSPFlightSim_Release.exe" /pdbtype:sept /libpath:"../../../THIRDPARTYLIBS/lib" ! # SUBTRACT LINK32 /map !ELSEIF "$(CFG)" == "CSPFlightSim - Win32 Debug" --- 55,60 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 ! # ADD LINK32 osgparticle.lib osgtext.lib demetervisualc6.lib osg.lib osgUtil.lib osgDb.lib SDL.lib SDLMain.lib opengl32.lib glaux.lib glu32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib DemeterVisualC6.lib SDL_Console.lib gdal_i.lib /nologo /subsystem:windows /pdb:"../Bin/CSPFlightSim_Release.pdb" /debug /machine:I386 /out:"../Bin/CSPFlightSim_Release.exe" /pdbtype:sept /libpath:"../../../THIRDPARTYLIBS/lib" ! # SUBTRACT LINK32 /pdb:none /map !ELSEIF "$(CFG)" == "CSPFlightSim - Win32 Debug" *************** *** 83,87 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 osgParticled.lib gdal_i.lib osgd.lib osgDBd.lib SDL_console.lib SDLd.lib opengl32.lib osgTextd.lib DemeterVisualC6d.lib osgUtild.lib SDLmaind.lib /nologo /subsystem:windows /incremental:no /pdb:"../DemoPackage/CSPFlightSim_Debug.pdb" /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../Bin/CSPFlightSim_Debug.exe" /pdbtype:sept /libpath:"..\..\..\THIRDPARTYLIBS\lib" # SUBTRACT LINK32 /pdb:none --- 83,87 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 osgParticled.lib gdal_i.lib osgd.lib osgDBd.lib SDL_console.lib SDLd.lib opengl32.lib osgTextd.lib DemeterVisualC6d.lib osgUtild.lib SDLmaind.lib /nologo /subsystem:windows /incremental:no /pdb:"../Bin/CSPFlightSim_Debug.pdb" /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../Bin/CSPFlightSim_Debug.exe" /pdbtype:sept /libpath:"..\..\..\THIRDPARTYLIBS\lib" # SUBTRACT LINK32 /pdb:none *************** *** 581,584 **** --- 581,588 ---- SOURCE=..\Include\Tools.h + # End Source File + # Begin Source File + + SOURCE=..\Include\Trees.h # End Source File # Begin Source File |
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts In directory sc8-pr-cvs1:/tmp/cvs-serv25334 Modified Files: AddModels.csp AeroF4.csp AeroM3c.csp BalkanLatticeTerrain.csp BalkanTerrain.csp BalkanTestTerrain.csp Start.csp Log Message: Fixed eol Index: AddModels.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/AddModels.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AddModels.csp 15 Dec 2002 00:52:19 -0000 1.1 --- AddModels.csp 20 Dec 2002 13:30:31 -0000 1.2 *************** *** 1,50 **** ! REM AddModels.csp ! REM Load all the Models and create the types for the Sim. ! ! ADD TYPE AIRPLANE F22 ! SET F22 MODEL f22.osg ! SET F22 AERO F4_aero ! ! ADD TYPE AIRPLANE F15 ! SET F15 MODEL f15.osg ! SET F15 AERO F4_aero ! ! ADD TYPE AIRPLANE A10 ! SET A10 MODEL a10.osg ! SET A10 AERO F4_aero ! ! ADD TYPE AIRPLANE MIG17 ! SET MIG17 MODEL mig17.osg ! SET MIG17 AERO F4_aero ! ! ADD TYPE AIRPLANE F16 ! SET F16 MODEL f16.osg ! SET F16 AERO F4_aero ! ! ADD TYPE AIRPLANE M2K ! SET M2K MODEL m2k2g.3DS ! REM SET M2K MODEL mirage2000.osg ! SET M2K AERO M2K_aero ! ! ADD TYPE AIRPLANE M3C ! SET M3C MODEL m3c.osg ! SET M3C AERO M3C_aero ! ! ADD TYPE AIRPLANE F4 ! SET F4 MODEL f4.osg ! SET F4 AERO F4_aero ! ! ADD TYPE MISSILE AMRAAM ! SET AMRAAM MODEL amraam.osg ! ! ADD TYPE MISSILE AIM9L ! SET AIM9L MODEL aim9l.osg ! ! ADD TYPE MISSILE AIM7 ! SET AIM7 MODEL aim7.osg ! ! ADD TYPE MISSILE ATOLL ! SET ATOLL MODEL atoll.osg ! ! ADD TYPE TANK T62 ! SET T62 MODEL t62.osg --- 1,50 ---- ! REM AddModels.csp ! REM Load all the Models and create the types for the Sim. ! ! ADD TYPE AIRPLANE F22 ! SET F22 MODEL f22.osg ! SET F22 AERO F4_aero ! ! ADD TYPE AIRPLANE F15 ! SET F15 MODEL f15.osg ! SET F15 AERO F4_aero ! ! ADD TYPE AIRPLANE A10 ! SET A10 MODEL a10.osg ! SET A10 AERO F4_aero ! ! ADD TYPE AIRPLANE MIG17 ! SET MIG17 MODEL mig17.osg ! SET MIG17 AERO F4_aero ! ! ADD TYPE AIRPLANE F16 ! SET F16 MODEL f16.osg ! SET F16 AERO F4_aero ! ! ADD TYPE AIRPLANE M2K ! SET M2K MODEL m2k2g.3DS ! REM SET M2K MODEL mirage2000.osg ! SET M2K AERO M2K_aero ! ! ADD TYPE AIRPLANE M3C ! SET M3C MODEL m3c.osg ! SET M3C AERO M3C_aero ! ! ADD TYPE AIRPLANE F4 ! SET F4 MODEL f4.osg ! SET F4 AERO F4_aero ! ! ADD TYPE MISSILE AMRAAM ! SET AMRAAM MODEL amraam.osg ! ! ADD TYPE MISSILE AIM9L ! SET AIM9L MODEL aim9l.osg ! ! ADD TYPE MISSILE AIM7 ! SET AIM7 MODEL aim7.osg ! ! ADD TYPE MISSILE ATOLL ! SET ATOLL MODEL atoll.osg ! ! ADD TYPE TANK T62 ! SET T62 MODEL t62.osg Index: AeroF4.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/AeroF4.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AeroF4.csp 15 Dec 2002 00:52:19 -0000 1.1 --- AeroF4.csp 20 Dec 2002 13:30:31 -0000 1.2 *************** *** 1,77 **** ! REM F4 aerodynamics model ! REM Reference UIUC Model from FlightGear ! ! REM Units currently in English need to convert ! REM 1 slug = 14.60567 kg ! REM 1 feet = 0.3048 m ! ! REM Cruise Conditions ! REM altitude 35000 ft ! REM Alpha 2.6 deg ! REM Velocity 518.7 kts 0.9 Mach ! REM Dyanmic_pressure 283.2 lb/ft^2 ! ! Add Aero F4_aero ! ! REM Wing geometry ! set F4_aero WingSpan 27.5 ! Set F4_aero WingChord 10.8 ! Set F4_aero WingArea 260 ! ! REM Control surfaces min/max angles ! Set F4_aero demax +20 ! Set F4_aero demin -20 ! Set F4_aero damax +20 ! Set F4_aero damin -20 ! Set F4_aero drmax +20 ! Set F4_aero drmin -20 ! ! REM Mass/Inertial properties ! Set F4_aero Mass 546 ! Set F4_aero I_XX 25900 ! Set F4_aero I_YY 8090 ! Set F4_aero I_ZZ 29200 ! Set F4_aero I_XZ 1300 ! ! REM Engine Thrust ! Set F4_aero ThrustMax 8000 ! ! REM Drag Parameters ! Set F4_aero CD0 0.03 ! Set F4_aero CD_a 0.3 ! Set F4_aero CD_de 0 ! ! REM Lift Parameters ! Set F4_aero CL0 0.28 ! Set F4_aero CL_a 3.45 ! Set F4_aero CL_adot 0.72 ! Set F4_aero CL_q 0 ! Set F4_aero CL_de 0.36 ! ! REM Pitch Moment Parameters ! Set F4_aero CM0 0 ! Set F4_aero CM_a -0.38 ! Set F4_aero CM_adot -1.1 ! Set F4_aero CM_q -3.6 ! Set F4_aero CM_de 0.5 ! ! REM Side Force Parameters ! Set F4_aero CY_Beta -0.98 ! Set F4_aero CY_p 0 ! Set F4_aero CY_r 0 ! Set F4_aero CY_da 0 ! Set F4_aero CY_dr 0.17 ! ! REM Roll moment parameters ! Set F4_aero CI_beta -0.12 ! Set F4_aero CI_p -0.26 ! Set F4_aero CI_r 0.14 ! Set F4_aero CI_da 0.08 ! Set F4_aero CI_dr 0.105 ! ! Rem Yaw Moment Parameters ! Set F4_aero Cn_beta 0.25 ! Set F4_aero Cn_p 0.022 ! Set F4_aero Cn_r -0.35 ! Set F4_aero Cn_da 0.06 ! Set F4_aero Cn_dr 0.032 --- 1,77 ---- ! REM F4 aerodynamics model ! REM Reference UIUC Model from FlightGear ! ! REM Units currently in English need to convert ! REM 1 slug = 14.60567 kg ! REM 1 feet = 0.3048 m ! ! REM Cruise Conditions ! REM altitude 35000 ft ! REM Alpha 2.6 deg ! REM Velocity 518.7 kts 0.9 Mach ! REM Dyanmic_pressure 283.2 lb/ft^2 ! ! Add Aero F4_aero ! ! REM Wing geometry ! set F4_aero WingSpan 27.5 ! Set F4_aero WingChord 10.8 ! Set F4_aero WingArea 260 ! ! REM Control surfaces min/max angles ! Set F4_aero demax +20 ! Set F4_aero demin -20 ! Set F4_aero damax +20 ! Set F4_aero damin -20 ! Set F4_aero drmax +20 ! Set F4_aero drmin -20 ! ! REM Mass/Inertial properties ! Set F4_aero Mass 546 ! Set F4_aero I_XX 25900 ! Set F4_aero I_YY 8090 ! Set F4_aero I_ZZ 29200 ! Set F4_aero I_XZ 1300 ! ! REM Engine Thrust ! Set F4_aero ThrustMax 8000 ! ! REM Drag Parameters ! Set F4_aero CD0 0.03 ! Set F4_aero CD_a 0.3 ! Set F4_aero CD_de 0 ! ! REM Lift Parameters ! Set F4_aero CL0 0.28 ! Set F4_aero CL_a 3.45 ! Set F4_aero CL_adot 0.72 ! Set F4_aero CL_q 0 ! Set F4_aero CL_de 0.36 ! ! REM Pitch Moment Parameters ! Set F4_aero CM0 0 ! Set F4_aero CM_a -0.38 ! Set F4_aero CM_adot -1.1 ! Set F4_aero CM_q -3.6 ! Set F4_aero CM_de 0.5 ! ! REM Side Force Parameters ! Set F4_aero CY_Beta -0.98 ! Set F4_aero CY_p 0 ! Set F4_aero CY_r 0 ! Set F4_aero CY_da 0 ! Set F4_aero CY_dr 0.17 ! ! REM Roll moment parameters ! Set F4_aero CI_beta -0.12 ! Set F4_aero CI_p -0.26 ! Set F4_aero CI_r 0.14 ! Set F4_aero CI_da 0.08 ! Set F4_aero CI_dr 0.105 ! ! Rem Yaw Moment Parameters ! Set F4_aero Cn_beta 0.25 ! Set F4_aero Cn_p 0.022 ! Set F4_aero Cn_r -0.35 ! Set F4_aero Cn_da 0.06 ! Set F4_aero Cn_dr 0.032 Index: AeroM3c.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/AeroM3c.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AeroM3c.csp 15 Dec 2002 00:52:19 -0000 1.1 --- AeroM3c.csp 20 Dec 2002 13:30:31 -0000 1.2 *************** *** 1,77 **** ! REM F4 aerodynamics model ! REM Reference UIUC Model from FlightGear ! ! REM Units currently in English need to convert ! REM 1 slug = 14.60567 kg ! REM 1 feet = 0.3048 m ! ! REM Cruise Conditions ! REM altitude 35000 ft ! REM Alpha 2.6 deg ! REM Velocity 518.7 kts 0.9 Mach ! REM Dyanmic_pressure 283.2 lb/ft^2 ! ! Add Aero M3C_aero ! ! REM Wing geometry ! set M3C_aero WingSpan 27.5 ! Set M3C_aero WingChord 10.8 ! Set M3C_aero WingArea 260 ! ! REM Control surfaces min/max angles ! Set M3C_aero demax +20 ! Set M3C_aero demin -20 ! Set M3C_aero damax +20 ! Set M3C_aero damin -20 ! Set M3C_aero drmax +20 ! Set M3C_aero drmin -20 ! ! REM Mass/Inertial properties ! Set M3C_aero Mass 546 ! Set M3C_aero I_XX 8090 ! Set M3C_aero I_YY 25900 ! Set M3C_aero I_ZZ 29200 ! Set M3C_aero I_XZ 1300 ! ! REM Engine Thrust ! Set M3C_aero ThrustMax 8000 ! ! REM Drag Parameters ! Set M3C_aero CD0 0.03 ! Set M3C_aero CD_a 0.3 ! Set M3C_aero CD_de 0.03 ! ! REM Lift Parameters ! Set M3C_aero CL0 0.28 ! Set M3C_aero CL_a 3.45 ! Set M3C_aero CL_adot 0.72 ! Set M3C_aero CL_q 0 ! Set M3C_aero CL_de 0.36 ! ! REM Pitch Moment Parameters ! Set M3C_aero CM0 0 ! Set M3C_aero CM_a -0.38 ! Set M3C_aero CM_adot -1.1 ! Set M3C_aero CM_q -3.6 ! Set M3C_aero CM_de -0.5 ! ! REM Side Force Parameters ! Set M3C_aero CY_Beta -0.98 ! Set M3C_aero CY_p 0 ! Set M3C_aero CY_r 0 ! Set M3C_aero CY_da 0 ! Set M3C_aero CY_dr 0.17 ! ! REM Roll moment parameters ! Set M3C_aero CI_beta -0.12 ! Set M3C_aero CI_p -0.26 ! Set M3C_aero CI_r 0.14 ! Set M3C_aero CI_da 0.105 ! Set M3C_aero CI_dr 0.08 ! ! Rem Yaw Moment Parameters ! Set M3C_aero Cn_beta 0.25 ! Set M3C_aero Cn_p 0.022 ! Set M3C_aero Cn_r -0.35 ! Set M3C_aero Cn_da 0.06 ! Set M3C_aero Cn_dr 0.032 --- 1,77 ---- ! REM F4 aerodynamics model ! REM Reference UIUC Model from FlightGear ! ! REM Units currently in English need to convert ! REM 1 slug = 14.60567 kg ! REM 1 feet = 0.3048 m ! ! REM Cruise Conditions ! REM altitude 35000 ft ! REM Alpha 2.6 deg ! REM Velocity 518.7 kts 0.9 Mach ! REM Dyanmic_pressure 283.2 lb/ft^2 ! ! Add Aero M3C_aero ! ! REM Wing geometry ! set M3C_aero WingSpan 27.5 ! Set M3C_aero WingChord 10.8 ! Set M3C_aero WingArea 260 ! ! REM Control surfaces min/max angles ! Set M3C_aero demax +20 ! Set M3C_aero demin -20 ! Set M3C_aero damax +20 ! Set M3C_aero damin -20 ! Set M3C_aero drmax +20 ! Set M3C_aero drmin -20 ! ! REM Mass/Inertial properties ! Set M3C_aero Mass 546 ! Set M3C_aero I_XX 8090 ! Set M3C_aero I_YY 25900 ! Set M3C_aero I_ZZ 29200 ! Set M3C_aero I_XZ 1300 ! ! REM Engine Thrust ! Set M3C_aero ThrustMax 8000 ! ! REM Drag Parameters ! Set M3C_aero CD0 0.03 ! Set M3C_aero CD_a 0.3 ! Set M3C_aero CD_de 0.03 ! ! REM Lift Parameters ! Set M3C_aero CL0 0.28 ! Set M3C_aero CL_a 3.45 ! Set M3C_aero CL_adot 0.72 ! Set M3C_aero CL_q 0 ! Set M3C_aero CL_de 0.36 ! ! REM Pitch Moment Parameters ! Set M3C_aero CM0 0 ! Set M3C_aero CM_a -0.38 ! Set M3C_aero CM_adot -1.1 ! Set M3C_aero CM_q -3.6 ! Set M3C_aero CM_de -0.5 ! ! REM Side Force Parameters ! Set M3C_aero CY_Beta -0.98 ! Set M3C_aero CY_p 0 ! Set M3C_aero CY_r 0 ! Set M3C_aero CY_da 0 ! Set M3C_aero CY_dr 0.17 ! ! REM Roll moment parameters ! Set M3C_aero CI_beta -0.12 ! Set M3C_aero CI_p -0.26 ! Set M3C_aero CI_r 0.14 ! Set M3C_aero CI_da 0.105 ! Set M3C_aero CI_dr 0.08 ! ! Rem Yaw Moment Parameters ! Set M3C_aero Cn_beta 0.25 ! Set M3C_aero Cn_p 0.022 ! Set M3C_aero Cn_r -0.35 ! Set M3C_aero Cn_da 0.06 ! Set M3C_aero Cn_dr 0.032 Index: BalkanLatticeTerrain.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/BalkanLatticeTerrain.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BalkanLatticeTerrain.csp 15 Dec 2002 00:52:19 -0000 1.1 --- BalkanLatticeTerrain.csp 20 Dec 2002 13:30:31 -0000 1.2 *************** *** 1,19 **** ! ADD TERRAIN balkanLatticeTerrain ! ! SET balkanLatticeTerrain LATTICE TRUE ! SET balkanLatticeTerrain DETAILTHRESHOLD 8 ! SET balkanLatticeTerrain DETAILTEXTUREFILE Stone4.bmp ! SET balkanLatticeTerrain LATTICEBASENAME balkanMap ! SET balkanLatticeTerrain LATTICEELEVEXT bmp ! SET balkanLatticeTerrain LATTICETEXEXT bmp ! SET balkanLatticeTerrain LATTICEWIDTH 16 ! SET balkanLatticeTerrain LATTICEHEIGHT 16 ! SET balkanLatticeTerrain VERTEXHEIGHT 0.38 ! SET balkanLatticeTerrain VERTEXSPACING 250 ! SET balkanLatticeTerrain MAXTRIANGLES 60000 ! SET balkanLatticeTerrain DYNAMICTEXTURES FALSE ! SET balkanLatticeTerrain TEXTURECOMPRESSION TRUE ! SET balkanLatticeTerrain PRELOADTEXTURES TRUE ! ! REM ACTIVE properly should be set last. ! SET balkanLatticeTerrain ACTIVE TRUE --- 1,19 ---- ! ADD TERRAIN balkanLatticeTerrain ! ! SET balkanLatticeTerrain LATTICE TRUE ! SET balkanLatticeTerrain DETAILTHRESHOLD 8 ! SET balkanLatticeTerrain DETAILTEXTUREFILE Stone4.bmp ! SET balkanLatticeTerrain LATTICEBASENAME balkanMap ! SET balkanLatticeTerrain LATTICEELEVEXT bmp ! SET balkanLatticeTerrain LATTICETEXEXT bmp ! SET balkanLatticeTerrain LATTICEWIDTH 16 ! SET balkanLatticeTerrain LATTICEHEIGHT 16 ! SET balkanLatticeTerrain VERTEXHEIGHT 0.38 ! SET balkanLatticeTerrain VERTEXSPACING 250 ! SET balkanLatticeTerrain MAXTRIANGLES 60000 ! SET balkanLatticeTerrain DYNAMICTEXTURES FALSE ! SET balkanLatticeTerrain TEXTURECOMPRESSION TRUE ! SET balkanLatticeTerrain PRELOADTEXTURES TRUE ! ! REM ACTIVE properly should be set last. ! SET balkanLatticeTerrain ACTIVE TRUE Index: BalkanTerrain.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/BalkanTerrain.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BalkanTerrain.csp 15 Dec 2002 00:52:19 -0000 1.1 --- BalkanTerrain.csp 20 Dec 2002 13:30:31 -0000 1.2 *************** *** 1,16 **** ! ADD TERRAIN balkanTerrain ! ! SET balkanTerrain LATTICE FALSE ! SET balkanTerrain DETAILTHRESHOLD 0 ! SET balkanTerrain DETAILTEXTUREFILE Stone4.bmp ! SET balkanTerrain TEXTUREFILE italy_coast_2_tex.png ! SET balkanTerrain ELEVFILE italy_coast.png ! SET balkanTerrain VERTEXHEIGHT 0.38 ! SET balkanTerrain VERTEXSPACING 250 ! SET balkanTerrain MAXTRIANGLES 50000 ! SET balkanTerrain DYNAMICTEXTURES FALSE ! SET balkanTerrain TEXTURECOMPRESSION TRUE ! SET balkanTerrain PRELOADTEXTURES TRUE ! ! REM ACTIVE properly should be set last. ! SET balkanTerrain ACTIVE TRUE --- 1,16 ---- ! ADD TERRAIN balkanTerrain ! ! SET balkanTerrain LATTICE FALSE ! SET balkanTerrain DETAILTHRESHOLD 0 ! SET balkanTerrain DETAILTEXTUREFILE Stone4.bmp ! SET balkanTerrain TEXTUREFILE italy_coast_2_tex.png ! SET balkanTerrain ELEVFILE italy_coast.png ! SET balkanTerrain VERTEXHEIGHT 0.38 ! SET balkanTerrain VERTEXSPACING 250 ! SET balkanTerrain MAXTRIANGLES 50000 ! SET balkanTerrain DYNAMICTEXTURES FALSE ! SET balkanTerrain TEXTURECOMPRESSION TRUE ! SET balkanTerrain PRELOADTEXTURES TRUE ! ! REM ACTIVE properly should be set last. ! SET balkanTerrain ACTIVE TRUE Index: BalkanTestTerrain.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/BalkanTestTerrain.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BalkanTestTerrain.csp 15 Dec 2002 00:52:19 -0000 1.1 --- BalkanTestTerrain.csp 20 Dec 2002 13:30:31 -0000 1.2 *************** *** 1,16 **** ! ADD TERRAIN balkanTerrain ! ! SET balkanTerrain LATTICE FALSE ! SET balkanTerrain DETAILTHRESHOLD 35 ! SET balkanTerrain DETAILTEXTUREFILE STONE4.bmp ! SET balkanTerrain TEXTUREFILE BalkanMapTex.0-0.bmp ! SET balkanTerrain ELEVFILE BalkanMapElev.0-0.bmp ! SET balkanTerrain VERTEXHEIGHT 0.38 ! SET balkanTerrain VERTEXSPACING 250 ! SET balkanTerrain MAXTRIANGLES 50000 ! SET balkanTerrain DYNAMICTEXTURES FALSE ! SET balkanTerrain TEXTURECOMPRESSION TRUE ! SET balkanTerrain PRELOADTEXTURES TRUE ! ! REM ACTIVE properly should be set last. ! SET balkanTerrain ACTIVE TRUE --- 1,16 ---- ! ADD TERRAIN balkanTerrain ! ! SET balkanTerrain LATTICE FALSE ! SET balkanTerrain DETAILTHRESHOLD 35 ! SET balkanTerrain DETAILTEXTUREFILE STONE4.bmp ! SET balkanTerrain TEXTUREFILE BalkanMapTex.0-0.bmp ! SET balkanTerrain ELEVFILE BalkanMapElev.0-0.bmp ! SET balkanTerrain VERTEXHEIGHT 0.38 ! SET balkanTerrain VERTEXSPACING 250 ! SET balkanTerrain MAXTRIANGLES 50000 ! SET balkanTerrain DYNAMICTEXTURES FALSE ! SET balkanTerrain TEXTURECOMPRESSION TRUE ! SET balkanTerrain PRELOADTEXTURES TRUE ! ! REM ACTIVE properly should be set last. ! SET balkanTerrain ACTIVE TRUE Index: Start.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/Start.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Start.csp 15 Dec 2002 00:52:19 -0000 1.1 --- Start.csp 20 Dec 2002 13:30:31 -0000 1.2 *************** *** 1,35 **** ! REM Start.csp ! REM Startup script for CSPFlightSim ! ! REM Load Flight Models ! Run AeroF4.csp ! Run AeroM2k.csp ! Run AeroM3c.csp ! ! REM Load Terrain ! REM RUN BalkanTerrain.csp ! REM RUN BalkanTestTerrain.csp ! RUN BalkanLatticeTerrain.csp ! ! REM Load models ! Run AddModels.csp ! ! REM Load Planes ! Run AddPlanes.csp ! ! REM Load Tanks ! Run AddTanks.csp ! ! REM Set player ! Run SetPlayer.csp ! ! REM Set fog start distance ! Set FOG_START 20000 ! ! Set FOG_END 35000 ! ! Set View_DISTANCE 35000 ! ! Set wireframe off ! ! set FOG On --- 1,35 ---- ! REM Start.csp ! REM Startup script for CSPFlightSim ! ! REM Load Flight Models ! Run AeroF4.csp ! Run AeroM2k.csp ! Run AeroM3c.csp ! ! REM Load Terrain ! REM RUN BalkanTerrain.csp ! REM RUN BalkanTestTerrain.csp ! RUN BalkanLatticeTerrain.csp ! ! REM Load models ! Run AddModels.csp ! ! REM Load Planes ! Run AddPlanes.csp ! ! REM Load Tanks ! Run AddTanks.csp ! ! REM Set player ! Run SetPlayer.csp ! ! REM Set fog start distance ! Set FOG_START 20000 ! ! Set FOG_END 35000 ! ! Set View_DISTANCE 35000 ! ! Set wireframe off ! ! set FOG On |
From: <mk...@us...> - 2002-12-20 13:30:20
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data In directory sc8-pr-cvs1:/tmp/cvs-serv25235 Modified Files: CSPFlightSim.ini Log Message: Fixed eol Index: CSPFlightSim.ini =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/CSPFlightSim.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CSPFlightSim.ini 15 Dec 2002 00:52:19 -0000 1.1 --- CSPFlightSim.ini 20 Dec 2002 13:30:17 -0000 1.2 *************** *** 1,15 **** ! <ScreenWidth> ! 1024 ! ! <ScreenHeight> ! 768 ! ! <FullScreen> ! 0 ! ! <LoggingLevel> ! 3 ! ! <StartupScript> ! Start.csp ! --- 1,15 ---- ! <ScreenWidth> ! 1024 ! ! <ScreenHeight> ! 768 ! ! <FullScreen> ! 0 ! ! <LoggingLevel> ! 3 ! ! <StartupScript> ! Start.csp ! |
From: <mk...@us...> - 2002-12-20 13:24:46
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts In directory sc8-pr-cvs1:/tmp/cvs-serv23040 Modified Files: SetPlayer.csp Log Message: Changed eol Index: SetPlayer.csp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Data/Scripts/SetPlayer.csp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SetPlayer.csp 15 Dec 2002 00:52:19 -0000 1.1 --- SetPlayer.csp 20 Dec 2002 13:24:43 -0000 1.2 *************** *** 1,7 **** ! add OBJECT M2K PLAYER ! Set PLAYER POSITION 483000 499000 2000 ! REM set player position 486985 469198 3000 ! Set PLAYER VELOCITY 0 150 0 ! Set PLAYER ORIENTATION 0 0 0 ! set PLAYER COMPLEX_PHYSICS on ! --- 1,7 ---- ! add OBJECT M2K PLAYER ! Set PLAYER POSITION 483000 499000 2000 ! REM set player position 486985 469198 3000 ! Set PLAYER VELOCITY 0 150 0 ! Set PLAYER ORIENTATION 0 0 0 ! set PLAYER COMPLEX_PHYSICS on ! |