From: <sv...@ww...> - 2004-07-29 04:05:26
|
Author: mkrose Date: 2004-07-28 21:05:19 -0700 (Wed, 28 Jul 2004) New Revision: 1193 Added: trunk/CSP/CSPSim/Data/Models/Runway/runway01.jpg Removed: trunk/CSP/CSPSim/Data/Models/Runway/RUNWAY.jpg Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/Models/Runway/runway01.osg trunk/CSP/CSPSim/Source/InputEvent.cpp trunk/CSP/CSPSim/Source/Makefile.in trunk/CSP/CSPSim/Source/ObjectModel.cpp trunk/CSP/CSPSim/Source/Theater/RandomBillboardModel.cpp trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile Log: Removed a couple obsolete files from the Makefile, and added InputEvent. Added missing std:: prefix in InputEvent.cpp. Fixed a compiler warning in RandomBillboardModel. Temporary hack to CSPSim/Tools/Terrain/*/Makefile to find SimData in relative path. These build files are in poor shape. Renamed Data/Models/Runway/RUNWAY.jpg to runway01.jpg. The OSG model loader was tripping on case sensitivity. Reordered the static constructor calls in ObjectModel.cpp. There's an ugly bug in the way that Enum<> and Enumeration bind as far as static construction goes. The Enumeration of an Enum<> must be created first, but this isn't guaranteed for static constructors (as in a class static Enumeration and the static ObjectInterface for importing Enum<> values from XML (which is a common case). This "fix" may break under Windows (you'll see an assert in Enum.h if so). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1193 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/CHANGES.current 2004-07-29 04:05:19 UTC (rev 1193) @@ -1,6 +1,32 @@ Version 0.4.0 (in progress) =========================== +2004-07-29: onsight + * Removed a couple obsolete files from the Makefile, and added InputEvent. + + * Added missing std:: prefix in InputEvent.cpp. + + * Fixed a compiler warning in RandomBillboardModel. + + * Temporary hack to CSPSim/Tools/Terrain/*/Makefile to find SimData in + relative path. These build files are in poor shape. + + * Renamed Data/Models/Runway/RUNWAY.jpg to runway01.jpg. The OSG model + loader was tripping on case sensitivity. + + * Reordered the static constructor calls in ObjectModel.cpp. There's an + ugly bug in the way that Enum<> and Enumeration bind as far as static + construction goes. The Enumeration of an Enum<> must be created first, + but this isn't guaranteed for static constructors (as in a class static + Enumeration and the static ObjectInterface for importing Enum<> values + from XML (which is a common case). This "fix" may break under Windows + (you'll see an assert in Enum.h if so). + + * Added Terrain link on my local client. Right now we die when the + terrain files aren't found without printing a helpful diagnostic + message. You can track down the cause in the logs (below level 5), + but this isn't a great way to handle a common failure mode. + 2004-07-29: delta * Added a filter_value member in ObjectModel's interface. Deleted: trunk/CSP/CSPSim/Data/Models/Runway/RUNWAY.jpg =================================================================== (Binary files differ) Copied: trunk/CSP/CSPSim/Data/Models/Runway/runway01.jpg (from rev 1192, trunk/CSP/CSPSim/Data/Models/Runway/RUNWAY.jpg) Modified: trunk/CSP/CSPSim/Data/Models/Runway/runway01.osg =================================================================== --- trunk/CSP/CSPSim/Data/Models/Runway/runway01.osg 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/Data/Models/Runway/runway01.osg 2004-07-29 04:05:19 UTC (rev 1193) @@ -88,7 +88,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "RUNWAY.JPG" + file "runway01.jpg" wrap_s REPEAT wrap_t REPEAT wrap_r REPEAT Modified: trunk/CSP/CSPSim/Source/InputEvent.cpp =================================================================== --- trunk/CSP/CSPSim/Source/InputEvent.cpp 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/Source/InputEvent.cpp 2004-07-29 04:05:19 UTC (rev 1193) @@ -71,17 +71,17 @@ bool Replay::operator()(SDL_Event& event) { SDL_Event e; - bool result = SDL_PollEvent(&e) !=0; + bool result = SDL_PollEvent(&e) != 0; if (e.type != SDL_QUIT && (e.type != SDL_KEYDOWN || e.key.keysym.sym != SDLK_ESCAPE)) { float d2 = CSPSim::theSim->getElapsedTime(); if (d2 - m_EventTime > 2*m_Sampling) { m_if.read(reinterpret_cast<char*>(&event),sizeof(SDL_Event)); m_if.read(reinterpret_cast<char*>(&m_EventTime),sizeof(float)); } + } else { + event = e; } - else - event = e; - return true; + return result; } InputEvent::InputEvent() { @@ -99,7 +99,7 @@ break; } } - catch(const exception& e) { + catch(const std::exception& e) { std::cerr << "\nException caught in InputEvent::InputEvent(): " << e.what() << ".\n"; std::cerr << "Using play handle.\n" << std::endl; m_Handle.reset(new Play); Modified: trunk/CSP/CSPSim/Source/Makefile.in =================================================================== --- trunk/CSP/CSPSim/Source/Makefile.in 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/Source/Makefile.in 2004-07-29 04:05:19 UTC (rev 1193) @@ -39,7 +39,6 @@ AircraftPhysicsModel.cpp \ Animation.cpp \ Atmosphere.cpp \ - base.cpp \ BaseDynamics.cpp \ BaseScreen.cpp \ ChunkLodTerrain.cpp \ @@ -63,6 +62,7 @@ FlightModel.cpp \ GameScreen.cpp \ HID.cpp \ + InputEvent.cpp \ InputInterface.cpp \ KineticsChannels.cpp \ LandingGear.cpp \ @@ -108,7 +108,6 @@ Theater/RandomBillboardModel.cpp \ Theater/RandomForestModel.cpp \ Tools.cpp \ - trees.cpp \ Views/CameraAgent.cpp \ Views/CameraKinematics.cpp \ Views/View.cpp \ Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-07-29 04:05:19 UTC (rev 1193) @@ -61,6 +61,9 @@ */ + +const simdata::Enumeration ObjectModel::EffectItems("None SpecularHighlights"); + SIMDATA_REGISTER_INTERFACE(ObjectModel) @@ -199,8 +202,6 @@ std::string g_ModelPath = ""; -const simdata::Enumeration ObjectModel::EffectItems("None SpecularHighlights"); - ObjectModel::ObjectModel(): simdata::Object() { m_Axis0 = simdata::Vector3::XAXIS; m_Axis1 = simdata::Vector3::ZAXIS; Modified: trunk/CSP/CSPSim/Source/Theater/RandomBillboardModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Theater/RandomBillboardModel.cpp 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/Source/Theater/RandomBillboardModel.cpp 2004-07-29 04:05:19 UTC (rev 1193) @@ -96,8 +96,8 @@ END_SIMDATA_XML_INTERFACE RectangularCurve(float width = 20.0f, float height = 50.0f): - m_Width(width != 0.0f ? abs(width) : 20.0f), - m_Height(height != 0.0f ? abs(height) : 50.0f) { + m_Width(width != 0.0f ? fabs(width) : 20.0f), + m_Height(height != 0.0f ? fabs(height) : 50.0f) { if (width * height == 0.0f) { CSP_LOG(APP, WARNING, "Rectangle: [" << width << "," << height << "corrected to 20x50]"); } Modified: trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile =================================================================== --- trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile 2004-07-29 04:05:19 UTC (rev 1193) @@ -1,21 +1,22 @@ -PYTHONLIB = /usr/lib/python2.3/site-packages -PYTHONINC = /usr/include/python2.3 +CSP_PATH = ../../../.. +SIMDATA_INC = $(CSP_PATH)/SimData/Include +SIMDATA_LIB = $(CSP_PATH)/SimData/SimData CXX = g++ -CXXFLAGS = -O2 -g -W -Wall +CXXFLAGS = -O2 -g -W -Wall -I$(SIMDATA_INC) SWIG = swig all: dem2dat dem2dat: dem2dat.cpp dem2dat.h - $(CXX) $(CXXFLAGS) dem2dat.cpp -o dem2dat -I$(PYTHONINC) -L$(PYTHONLIB)/SimData -lSimData -lz + $(CXX) $(CXXFLAGS) dem2dat.cpp -o dem2dat -L$(SIMDATA_LIB) -lSimData -lz -lpthread python: dem2dat_wrap.o - $(CXX) -shared -lswigpy -ldl -o _dem2dat.so dem2dat_wrap.o -L$(PYTHONLIB)/SimData -lSimData -lz + $(CXX) -shared -lswigpy -ldl -o _dem2dat.so dem2dat_wrap.o -L$(SIMDATA_LIB) -lSimData -lz dem2dat_wrap.o: dem2dat_wrap.cxx - $(CXX) -c -fPIC $(CXXFLAGS) dem2dat_wrap.cxx -I$(PYTHONINC) + $(CXX) -c -fPIC $(CXXFLAGS) dem2dat_wrap.cxx dem2dat_wrap.cxx: dem2dat.i dem2dat.h - $(SWIG) -c -c++ -python -noexcept -I$(PYTHONINC) dem2dat.i + $(SWIG) -c -c++ -python -noexcept dem2dat.i Modified: trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile =================================================================== --- trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile 2004-07-28 23:34:50 UTC (rev 1192) +++ trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile 2004-07-29 04:05:19 UTC (rev 1193) @@ -1,9 +1,10 @@ -PYTHONLIB = /usr/lib/python2.2/site-packages -PYTHONINC = /usr/include/python2.2 +CSP_PATH = ../../../.. +SIMDATA_INC = $(CSP_PATH)/SimData/Include +SIMDATA_LIB = $(CSP_PATH)/SimData/SimData all: csptile csptile: tile.cpp - g++ -W -Wall -O2 -g $^ -o $@ -I$(PYTHONINC) -L$(PYTHONLIB)/SimData -lSimData -lz + g++ -W -Wall -O2 -g $^ -o $@ -I$(SIMDATA_INC) -L$(SIMDATA_LIB) -lSimData -lz -lpthread |