Revision: 2144 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2144&view=rev Author: rorthomas Date: 2011-08-22 12:36:07 +0000 (Mon, 22 Aug 2011)
Log Message: ----------- finally removed hydrax Modified Paths: -------------- trunk/CMakeDependenciesConfig.txt trunk/source/main/CMakeLists.txt trunk/source/main/gameplay/RoRFrameListener.cpp Removed Paths: ------------- trunk/source/main/gfx/HydraxWater.cpp trunk/source/main/gfx/HydraxWater.h Modified: trunk/CMakeDependenciesConfig.txt =================================================================== --- trunk/CMakeDependenciesConfig.txt 2011-08-21 13:31:28 UTC (rev 2143) +++ trunk/CMakeDependenciesConfig.txt 2011-08-22 12:36:07 UTC (rev 2144) @@ -24,8 +24,6 @@ # set some defaults IF(WIN32) - # options only available under windows - set(ROR_USE_HYDRAX "FALSE" CACHE BOOL "use hydrax water system") set(ROR_USE_OIS_G27 "FALSE" CACHE BOOL "use OIS With G27 patches") set(ROR_USE_MOFILEREADER "FALSE" CACHE BOOL "use mofilereader") set(ROR_BUILD_UPDATER "FALSE" CACHE BOOL "build the updater") @@ -148,13 +146,6 @@ set(ANGELSCRIPT_LIBRARIES "angelscript.lib" CACHE STRING "The AngelScript libs to link against") endif(ROR_USE_ANGELSCRIPT) - if(ROR_USE_HYDRAX) - set(HYDRAX_INCLUDE_DIRS "${ROR_DEPENDENCIES_DIR}/include/Hydrax;${ROR_DEPENDENCIES_DIR}/include/" CACHE PATH "The Hydrax include paths to use") - set(HYDRAX_LIBRARY_DIRS "${ROR_DEPENDENCIES_DIR}/lib/Hydrax" CACHE PATH "The Hydrax lib path to use") - set(HYDRAX_LIBRARIES "Hydrax.lib" CACHE STRING "The Hydrax lib to link against") - copy_files(${ROR_DEPENDENCIES_DIR}/bin/Hydrax ${EXECUTABLE_OUTPUT_PATH}) - endif(ROR_USE_HYDRAX) - if(ROR_USE_LITESQL) set(LITESQL_INCLUDE_DIRS "${ROR_DEPENDENCIES_DIR}/include/litesql" CACHE PATH "The litesql include path to use") set(LITESQL_LIBRARY_DIRS "${ROR_DEPENDENCIES_DIR}/lib/litesql" CACHE PATH "The litesql lib path to use") @@ -250,17 +241,6 @@ set(ROR_USE_CAELUM OFF) endif(CAELUM_INCLUDE_DIRS) - # Hydrax - # WIP! - find_path(HYDRAX_INCLUDE_DIRS "Hydrax/Hydrax.h") - if(HYDRAX_INCLUDE_DIRS) - set(HYDRAX_INCLUDE_DIRS "${HYDRAX_INCLUDE_DIRS}/Hydrax") - find_library(HYDRAX_LIBRARIES "Hydrax" PATH /usr/local/lib) - set(ROR_USE_HYDRAX ON) - else() - set(ROR_USE_HYDRAX OFF) - endif(HYDRAX_INCLUDE_DIRS) - # Angelscript find_path(ANGELSCRIPT_INCLUDE_DIRS "angelscript.h") if(ANGELSCRIPT_INCLUDE_DIRS) @@ -274,5 +254,4 @@ set(ROR_USE_CRASHRPT FALSE) set(ROR_USE_OIS_G27 FALSE) - set(ROR_USE_HYDRAX FALSE) ENDIF(WIN32) Modified: trunk/source/main/CMakeLists.txt =================================================================== --- trunk/source/main/CMakeLists.txt 2011-08-21 13:31:28 UTC (rev 2143) +++ trunk/source/main/CMakeLists.txt 2011-08-22 12:36:07 UTC (rev 2144) @@ -72,7 +72,6 @@ setup_lib(PAGED) setup_lib(CAELUM) setup_lib(ANGELSCRIPT) - setup_lib(HYDRAX) if(ROR_USE_ANGELSCRIPT) add_definitions("-DAS_USE_NAMESPACE") Modified: trunk/source/main/gameplay/RoRFrameListener.cpp =================================================================== --- trunk/source/main/gameplay/RoRFrameListener.cpp 2011-08-21 13:31:28 UTC (rev 2143) +++ trunk/source/main/gameplay/RoRFrameListener.cpp 2011-08-22 12:36:07 UTC (rev 2144) @@ -68,10 +68,6 @@ #include "Settings.h" -#ifdef USE_HYDRAX -# include "HydraxWater.h" -#endif - #include "dashboard.h" #include "Heathaze.h" #ifdef HAS_EDITOR @@ -4413,9 +4409,6 @@ mCamera->setPosition(Vector3(cx,cy,cz)); //water! - bool useHydrax = (BSETTING("Hydrax")); - String hydraxConfig = "hydrax_default.hdx"; - if (waterline != -9999) { bool usewaves=(BSETTING("Waves")); @@ -4424,30 +4417,17 @@ if(net) usewaves=false; -#ifndef HYDRAX - useHydrax=false; -#endif - - if(useHydrax) - { -#ifdef USE_HYDRAX - w = new HydraxWater(WATER_BASIC, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); -#endif + if (SSETTING("Water effects")=="None") + w=0; + else if (SSETTING("Water effects")=="Basic (fastest)") + w=new WaterOld(WATER_BASIC, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); + else if (SSETTING("Water effects")=="Reflection") + w=new WaterOld(WATER_REFLECT, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); + else if (SSETTING("Water effects")=="Reflection + refraction (speed optimized)") + w=new WaterOld(WATER_FULL_SPEED, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); + else if (SSETTING("Water effects")=="Reflection + refraction (quality optimized)") + w=new WaterOld(WATER_FULL_QUALITY, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); } - else if(!useHydrax) - { - if (SSETTING("Water effects")=="None") - w=0; - else if (SSETTING("Water effects")=="Basic (fastest)") - w=new WaterOld(WATER_BASIC, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); - else if (SSETTING("Water effects")=="Reflection") - w=new WaterOld(WATER_REFLECT, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); - else if (SSETTING("Water effects")=="Reflection + refraction (speed optimized)") - w=new WaterOld(WATER_FULL_SPEED, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); - else if (SSETTING("Water effects")=="Reflection + refraction (quality optimized)") - w=new WaterOld(WATER_FULL_QUALITY, mCamera, mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves); - } - } if(w) w->setFadeColour(fadeColour); if(person) person->setWater(w); BeamFactory::getSingleton().w = w; @@ -4615,19 +4595,6 @@ n->setVisible(true); } -#ifdef USE_HYDRAX - if (!strncmp("hydraxconfig", line, 12)) - { - char tmp[256]=""; - int res = sscanf(line, "hydraxconfig %s", tmp); - if(res < 1) - { - LOG("error reading hydraxconfig command!"); - continue; - } - hydraxConfig=String(tmp); - } -#endif //HYDRAX if (!strncmp("mpspawn", line, 7)) { spawn_location_t spl; @@ -5066,11 +5033,6 @@ } } -#ifdef USE_HYDRAX - if(w && useHydrax) - ((HydraxWater*)w)->loadConfig(hydraxConfig); -#endif // HYDRAX - if(debugCollisions) collisions->createCollisionDebugVisualization(); Deleted: trunk/source/main/gfx/HydraxWater.cpp =================================================================== --- trunk/source/main/gfx/HydraxWater.cpp 2011-08-21 13:31:28 UTC (rev 2143) +++ trunk/source/main/gfx/HydraxWater.cpp 2011-08-22 12:36:07 UTC (rev 2144) @@ -1,207 +0,0 @@ -/* -This source file is part of Rigs of Rods -Copyright 2005-2011 Pierre-Michel Ricordel -Copyright 2007-2011 Thomas Fischer - -For more information, see http://www.rigsofrods.com/ - -Rigs of Rods is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License version 3, as -published by the Free Software Foundation. - -Rigs of Rods 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 Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. -*/ -#ifdef USE_HYDRAX - -#include "HydraxWater.h" -//#include "OgreTerrainSceneManager.h" // for some cast in order to get the terrain material = ILLEGAL to link to a plugin! - -HydraxWater::HydraxWater(int type, Camera *camera, SceneManager *mSceneMgr, RenderWindow *mWindow, float _wheight, float *mapsizex, float *mapsizez, bool usewaves) : waternoise(0), mHydrax(0) -{ - LOG("* loading Hydrax..."); - mCamera = camera; - wheight = _wheight; - waveStrength = 30.5f; - mHydrax = new Hydrax::Hydrax(mSceneMgr, mCamera, mWindow->getViewport(0)); -} - -int HydraxWater::loadConfig(Ogre::String configfile) -{ - waternoise = new Hydrax::Noise::Perlin(/*Generic one*/); - - // Create our projected grid module - Hydrax::Module::ProjectedGrid *mModule - = new Hydrax::Module::ProjectedGrid(// Hydrax parent pointer - mHydrax, - // Noise module - waternoise, - // Base plane - Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,0,0)), - // Normal mode - Hydrax::MaterialManager::NM_VERTEX, - // Projected grid options - Hydrax::Module::ProjectedGrid::Options(264)); - - // Set our module - mHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule)); - - // Load all parameters from config file - // Remarks: The config file must be in Hydrax resource group. - // All parameters can be set/updated directly by code(Like previous versions), - // but due to the high number of customizable parameters, Hydrax 0.4 allows save/load config files. - mHydrax->loadCfg(configfile); - - // Set our shader mode -#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 - // directx - mHydrax->setShaderMode(Hydrax::MaterialManager::SM_HLSL); -#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX - // opengl - mHydrax->setShaderMode(Hydrax::MaterialManager::SM_CG); -#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE - // opengl - mHydrax->setShaderMode(Hydrax::MaterialManager::SM_CG); -#endif - - // water height is always overwritten - mHydrax->setPosition(Ogre::Vector3(0, wheight, 0)); - - // Create water - mHydrax->create(); - - -/* - // Adjust some options - mHydrax->setPosition(Ogre::Vector3(0, wheight, 0)); - mHydrax->setPlanesError(waveStrength*0.33); - mHydrax->setDepthLimit(10); //30m - mHydrax->setNormalDistortion(0.025); -// mHydrax->setDepthColor(Ogre::Vector3(0.04,0.135,0.185)); - mHydrax->setSmoothPower(30); - mHydrax->setCausticsScale(12); - mHydrax->setGlobalTransparency(0); - mHydrax->setFullReflectionDistance(99999997952.0); - //mHydrax->setPolygonMode(Ogre::PM_WIREFRAME); - //mHydrax->setFoamScale(0.1); // Or something else - //mHydrax->setFoamStart(-0.5); // Must be negative - //mHydrax->setFoamMaxDistance(100); -*/ - // XXX: TODO: check for custom terrain material - -// MaterialPtr mat = ((TerrainSceneManager*)mSceneMgr)->getTerrainMaterial(); //can't do that - - - // Add our hydrax depth technique to island material - // (Because the terrain mesh is not an Ogre::Entity) - MaterialPtr mat = (MaterialPtr)(MaterialManager::getSingleton().getByName("TerrainSceneManager/Terrain")); - if(!mat.isNull()) - { - mHydrax->getMaterialManager()->addDepthTechnique(mat->createTechnique()); - } - - // fog override for the water! - MaterialPtr mathydrax = mHydrax->getMaterialManager()->getMaterial(Hydrax::MaterialManager::MAT_WATER); - if(!mathydrax.isNull()) - for(int i=0; i<mathydrax->getNumTechniques();i++) - for(int j=0; j<mathydrax->getTechnique(i)->getNumPasses();j++) - mathydrax->getTechnique(i)->getPass(j)->setFog(true); - /* - // test for decals - for(int x=0; x<1000; x+=10) - { - Hydrax::Decal* mDecal = mHydrax->getDecalsManager()->add("searose.png"); - mDecal->setPosition(Ogre::Vector2(x,x)); - mDecal->setSize(Vector2(0.001, 0.001)); - mDecal->setTransparency(0.8); - } - */ - LOG("* Hydrax loaded with config "+configfile); - return 0; -} - -void HydraxWater::moveTo(Camera *cam, float centerheight) -{ -} - -bool HydraxWater::allowUnderWater() -{ - return true; -} - -void HydraxWater::showWave(Vector3 refpos) -{ -} - -void HydraxWater::update() -{ -} - -void HydraxWater::prepareShutdown() -{ -} - -float HydraxWater::getHeight() -{ - return wheight; -} - -void HydraxWater::setHeight(float value) -{ - wheight = value; -} - -void HydraxWater::setVisible(bool value) -{ - if(mHydrax) - mHydrax->setVisible(value); -} - -float HydraxWater::getHeightWaves(Vector3 pos) -{ - // TODO: fix hydrax crash! - /* - if(waternoise) - { - float nv = waternoise->getValue(pos.x, pos.z); - return this->wheight + nv * waveStrength; - } - */ - return wheight; -} - -Vector3 HydraxWater::getVelocity(Vector3 pos) -{ - // TODO: FIX THIS! - return Vector3(0, 0, 0); -} - -void HydraxWater::updateReflectionPlane(float h) -{ -} - -void HydraxWater::setFadeColour(ColourValue ambient) -{ - if(mHydrax) - mHydrax->setSunColor(Vector3(ambient.r, ambient.g, ambient.b)); -} - - -void HydraxWater::setSunPosition(Ogre::Vector3 pos) -{ - if(mHydrax) - mHydrax->setSunPosition(pos); -} - -void HydraxWater::framestep(float dt) -{ - if(mHydrax) - mHydrax->update(dt); -} - -#endif //HYDRAX Deleted: trunk/source/main/gfx/HydraxWater.h =================================================================== --- trunk/source/main/gfx/HydraxWater.h 2011-08-21 13:31:28 UTC (rev 2143) +++ trunk/source/main/gfx/HydraxWater.h 2011-08-22 12:36:07 UTC (rev 2144) @@ -1,76 +0,0 @@ -/* -This source file is part of Rigs of Rods -Copyright 2005-2011 Pierre-Michel Ricordel -Copyright 2007-2011 Thomas Fischer - -For more information, see http://www.rigsofrods.com/ - -Rigs of Rods is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License version 3, as -published by the Free Software Foundation. - -Rigs of Rods 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 Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. -*/ -// Thomas Fischer, 23 of April 2008 - -#ifdef USE_HYDRAX - -#ifndef HYDRAXWATER_H_ -#define HYDRAXWATER_H_ - -#include "RoRPrerequisites.h" -// this is a workaround for fixing compilation/linking issues in conjunction with Caelum -#undef DllExport -#include "Hydrax/Prerequisites.h" -#include "Hydrax/Hydrax.h" -#include "Hydrax/MaterialManager.h" -#include "Hydrax/Noise/Noise.h" -#include "Hydrax/Noise/Perlin/Perlin.h" -#include "Hydrax/Modules/ProjectedGrid/ProjectedGrid.h" -#include "Hydrax/Modules/SimpleGrid/SimpleGrid.h" -#undef DllExport - -#include "Ogre.h" -#include "water.h" - -using namespace Ogre; - -class HydraxWater : public Water -{ -protected: - Hydrax::Hydrax *mHydrax; - Hydrax::Noise::Noise *waternoise; - Ogre::Camera *mCamera; - float wheight; - float waveStrength; - -public: - HydraxWater(int type, Camera *camera, SceneManager *mSceneMgr, RenderWindow *mWindow, float wheight, float *mapsizex, float *mapsizez, bool usewaves); - void moveTo(Camera *cam, float centerheight); - void showWave(Vector3 refpos); - void update(); - void prepareShutdown(); - float getHeight(); - bool visible; - void setVisible(bool value); - float getHeightWaves(Vector3 pos); - Vector3 getVelocity(Vector3 pos); - void updateReflectionPlane(float h); - void setFadeColour(ColourValue ambient); - void setSunPosition(Ogre::Vector3); - void framestep(float dt); - bool allowUnderWater(); - int loadConfig(Ogre::String configfile); - void setHeight(float value); -}; - - - -#endif -#endif //HYDRAX This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Rigsofrods-devel mailing list Rigsofrods-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel