* updated ShTLTerrainSceneNode to official irr 1.4 version (with some changes)
* some renderer settings can now be modified via conf * disabled irrlicht logger console spam
This commit is contained in:
parent
d2dc2b82a2
commit
170006b659
@ -22,3 +22,48 @@ shadows=1
|
|||||||
|
|
||||||
// color depth; 16 or 32 bit
|
// color depth; 16 or 32 bit
|
||||||
depth=32
|
depth=32
|
||||||
|
|
||||||
|
|
||||||
|
//================================================================================================
|
||||||
|
// Expert options: Renderer finetuning
|
||||||
|
// Uncomment/Adjust the following settings if you really know what you do or if you need some extra performance!
|
||||||
|
// Set a value to 0 or comment it out to use the default setting.
|
||||||
|
//------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// The terrain is split into sectors, here you can specify how many will be used on every axis.
|
||||||
|
// Each sector is seperately culled if not visible, removing GPU load, but the culling test takes up some CPU.
|
||||||
|
// If the terrain draw size is very large, it might be better to increase the sector amount. [Default: 5]
|
||||||
|
//TerrainSectors=5
|
||||||
|
|
||||||
|
// The higher this value is, the more CPU+GPU power is needed to render the terrain.
|
||||||
|
// Note that if you set it too low, you will get hard terrin cut-offs in some distance.
|
||||||
|
// It looks best if this value is larger then <fogfar>. [Default: <farclip> * 0.33]
|
||||||
|
//TerrainDrawSize=300
|
||||||
|
|
||||||
|
// The terrain gets updated after walking some distance over it. Updating needs some CPU, but the more often
|
||||||
|
// it is updated the smoother it will look like. If the fog starts early enough and covers places where there is no terrain drawn yet
|
||||||
|
// (depends also on <TerrainDrawSize>) there will be no real visual disadvantages. [Default: 1 (min: 1, max: 50)]
|
||||||
|
//TerrainUpdateStep=3
|
||||||
|
|
||||||
|
// The distance until the driver will stop drawing. This value has the most impact on the framerate, but setting it too low
|
||||||
|
// will end up in a very short view distance. If your hardware is good enough, set it as high as possible, but don't forget to
|
||||||
|
// adjust terrain drawing and fog distances if you do! [Default: 533.33]
|
||||||
|
//farclip=533.33
|
||||||
|
|
||||||
|
// The fog gets 100% thickness in the distance specified here. [Default: <farclip> * 0.7]
|
||||||
|
//fogfar=380
|
||||||
|
|
||||||
|
// The fog starts here, getting thicker until reaching <fogfar>. [Default: <fogfar> * 0.75]
|
||||||
|
//fognear=280
|
||||||
|
|
||||||
|
// Field of view. The higher the FOV is the more of the scene is visible on the screen, but the more distorted the scene will be!
|
||||||
|
// Examples: < 0.5 is like looking through a sniper scope
|
||||||
|
// > 1.0 is the best setting for a "normal" field of view
|
||||||
|
// > 1.4 is like looking through a fish's eye
|
||||||
|
// > 2 offers a very high but still playable field of view, but can cause extreme headache after a while
|
||||||
|
// 2.5 isn't a reasonable value anymore (psychotic)
|
||||||
|
// at around 3 it starts f***ing up the renderer
|
||||||
|
// Note that the FOV also has a great impact on the framerate, the higher the value is, the less frames per sec.
|
||||||
|
// [Default: 1.25]
|
||||||
|
//FOV=1.1
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,6 @@
|
|||||||
#include "CM2MeshFileLoader.h"
|
#include "CM2MeshFileLoader.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
#define DEBUG(code) code;
|
|
||||||
#else
|
|
||||||
#define DEBUG(code) ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
@ -204,7 +198,7 @@ for(u32 i=0; i<M2MTextureDef.size(); i++)
|
|||||||
file->seek(M2MTextureDef[i].texFileOfs);
|
file->seek(M2MTextureDef[i].texFileOfs);
|
||||||
file->read((void*)tempTexFileName.c_str(),M2MTextureDef[i].texFileLen);
|
file->read((void*)tempTexFileName.c_str(),M2MTextureDef[i].texFileLen);
|
||||||
M2MTextureFiles.push_back(tempTexFileName.c_str());
|
M2MTextureFiles.push_back(tempTexFileName.c_str());
|
||||||
std::cout<<M2MTextureFiles.size()<<"-"<<M2MTextureFiles[i].c_str()<<"\n";
|
DEBUG(logdebug("Texture: %u (%s)",M2MTextureFiles.size(),M2MTextureFiles[i].c_str()));
|
||||||
}
|
}
|
||||||
// std::cout << "Read "<<M2MTextureFiles.size()<<"/"<<M2MTextureDef.size()<<" Texture file names\n";
|
// std::cout << "Read "<<M2MTextureFiles.size()<<"/"<<M2MTextureDef.size()<<" Texture file names\n";
|
||||||
|
|
||||||
|
|||||||
@ -121,6 +121,9 @@ void PseuGUI::_Init(void)
|
|||||||
_timer = _device->getTimer();
|
_timer = _device->getTimer();
|
||||||
//...
|
//...
|
||||||
|
|
||||||
|
// disable crappy irrlicht logging
|
||||||
|
_device->getLogger()->setLogLevel(ELL_NONE);
|
||||||
|
|
||||||
// register external loaders for not supported filetypes
|
// register external loaders for not supported filetypes
|
||||||
video::CImageLoaderBLP* BLPloader = new video::CImageLoaderBLP();
|
video::CImageLoaderBLP* BLPloader = new video::CImageLoaderBLP();
|
||||||
_driver->addExternalImageLoader(BLPloader);
|
_driver->addExternalImageLoader(BLPloader);
|
||||||
|
|||||||
@ -108,8 +108,6 @@ private:
|
|||||||
ZThread::FastMutex mutex;
|
ZThread::FastMutex mutex;
|
||||||
PseuGUI *gui;
|
PseuGUI *gui;
|
||||||
uint32 map_gridX, map_gridY;
|
uint32 map_gridX, map_gridY;
|
||||||
s32 mapsize, meshsize;
|
|
||||||
f32 tilesize;
|
|
||||||
WorldSession *wsession;
|
WorldSession *wsession;
|
||||||
World *world;
|
World *world;
|
||||||
MapMgr *mapmgr;
|
MapMgr *mapmgr;
|
||||||
|
|||||||
@ -24,9 +24,6 @@ SceneWorld::SceneWorld(PseuGUI *g) : Scene(g)
|
|||||||
world = wsession->GetWorld();
|
world = wsession->GetWorld();
|
||||||
mapmgr = world->GetMapMgr();
|
mapmgr = world->GetMapMgr();
|
||||||
|
|
||||||
// TODO: hardcoded for now, make this adjustable later
|
|
||||||
float fogdist = 150;
|
|
||||||
|
|
||||||
ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(0,0,0), SColorf(255, 255, 255, 255), 1000.0f);
|
ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(0,0,0), SColorf(255, 255, 255, 255), 1000.0f);
|
||||||
SLight ldata = light->getLightData();
|
SLight ldata = light->getLightData();
|
||||||
ldata.AmbientColor = video::SColorf(0.2f,0.2f,0.2f);
|
ldata.AmbientColor = video::SColorf(0.2f,0.2f,0.2f);
|
||||||
@ -40,7 +37,19 @@ SceneWorld::SceneWorld(PseuGUI *g) : Scene(g)
|
|||||||
|
|
||||||
camera = new MCameraFPS(smgr);
|
camera = new MCameraFPS(smgr);
|
||||||
camera->setNearValue(0.1f);
|
camera->setNearValue(0.1f);
|
||||||
camera->setFarValue(TILESIZE); // TODO: make this configurable later
|
|
||||||
|
f32 farclip = instance->GetConf()->farclip;
|
||||||
|
if(farclip < 50)
|
||||||
|
farclip = TILESIZE;
|
||||||
|
|
||||||
|
f32 fov = instance->GetConf()->fov;
|
||||||
|
if(!iszero(fov))
|
||||||
|
{
|
||||||
|
logdetail("Camera: Field of view (FOV) = %.3f",fov);
|
||||||
|
camera->setFOV(fov);
|
||||||
|
}
|
||||||
|
|
||||||
|
camera->setFarValue(farclip);
|
||||||
|
|
||||||
debugText = guienv->addStaticText(L"< debug text >",rect<s32>(0,0,driver->getScreenSize().Width,30),true,true,0,-1,true);
|
debugText = guienv->addStaticText(L"< debug text >",rect<s32>(0,0,driver->getScreenSize().Width,30),true,true,0,-1,true);
|
||||||
|
|
||||||
@ -56,8 +65,16 @@ SceneWorld::SceneWorld(PseuGUI *g) : Scene(g)
|
|||||||
sky->remove(); // thus we grab the sky node while removing it from rendering.
|
sky->remove(); // thus we grab the sky node while removing it from rendering.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
f32 fogfar = camera->getFarValue() * 0.7f;
|
f32 fogfar = instance->GetConf()->fogfar;
|
||||||
f32 fognear = fogfar * 0.75f;
|
if(fogfar < 30)
|
||||||
|
fogfar = farclip * 0.7f;
|
||||||
|
|
||||||
|
f32 fognear = instance->GetConf()->fognear;
|
||||||
|
if(fognear < 10)
|
||||||
|
fognear = fogfar * 0.75f;
|
||||||
|
|
||||||
|
logdetail("GUI: Using farclip=%.2f fogfar=%.2f fognear=%.2f", farclip, fogfar, fognear);
|
||||||
|
|
||||||
driver->setFog(envBasicColor, true, fognear, fogfar, 0.02f);
|
driver->setFog(envBasicColor, true, fognear, fogfar, 0.02f);
|
||||||
|
|
||||||
// setup cursor
|
// setup cursor
|
||||||
@ -212,6 +229,10 @@ void SceneWorld::OnUpdate(s32 timediff)
|
|||||||
str += (int)terrain->getSectorsRendered();
|
str += (int)terrain->getSectorsRendered();
|
||||||
str += L" / ";
|
str += L" / ";
|
||||||
str += (int)terrain->getSectorCount();
|
str += (int)terrain->getSectorCount();
|
||||||
|
str += L" (";
|
||||||
|
str += (u32)(((f32)terrain->getSectorsRendered()/(f32)terrain->getSectorCount())*100.0f);
|
||||||
|
str += L"%)";
|
||||||
|
|
||||||
str += L"\n";
|
str += L"\n";
|
||||||
|
|
||||||
|
|
||||||
@ -273,17 +294,28 @@ void SceneWorld::InitTerrain(void)
|
|||||||
gui->SetSceneState(SCENESTATE_GUISTART);
|
gui->SetSceneState(SCENESTATE_GUISTART);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
s32 mapsize = (8 * 16 * 3) - 1; // 9-1 height floats in 16 chunks per tile per axis in 3 MapTiles
|
||||||
|
|
||||||
mapsize = (8 * 16 * 3) - 1; // 9-1 height floats in 16 chunks per tile per axis in 3 MapTiles
|
// terrain rendering settings
|
||||||
tilesize = UNITSIZE;
|
u32 rendersize = instance->GetConf()->terrainrendersize;
|
||||||
meshsize = (s32)TILESIZE/3;
|
if(!rendersize)
|
||||||
|
rendersize = camera->getFarValue() / 3.0f;
|
||||||
|
|
||||||
//camera->setPosition(core::vector3df(mapsize*tilesize/2, 0, mapsize*tilesize/2) + terrainPos);
|
u32 sectors = instance->GetConf()->terrainsectors;
|
||||||
|
if(!sectors)
|
||||||
|
sectors = 5;
|
||||||
|
|
||||||
terrain = new ShTlTerrainSceneNode(smgr,mapsize,mapsize,tilesize,meshsize);
|
u32 step = instance->GetConf()->terrainupdatestep;
|
||||||
|
if(!step || step > 50)
|
||||||
|
step = 1;
|
||||||
|
|
||||||
|
logdetail("Terrain: Using %ux%u sectors, rendersize=%u, updatestep=%u",sectors,sectors,rendersize,step);
|
||||||
|
|
||||||
|
terrain = new ShTlTerrainSceneNode(smgr,mapsize,mapsize,UNITSIZE,rendersize,sectors);
|
||||||
terrain->drop();
|
terrain->drop();
|
||||||
|
terrain->setStep(step);
|
||||||
terrain->follow(camera->getNode());
|
terrain->follow(camera->getNode());
|
||||||
terrain->getMaterial(0).setTexture(0, driver->getTexture("data/misc/dirt_test.jpg"));
|
terrain->getMaterial(0).setTexture(1,driver->getTexture("data/misc/dirt_test.jpg"));
|
||||||
terrain->getMaterial(0).setFlag(video::EMF_LIGHTING, true);
|
terrain->getMaterial(0).setFlag(video::EMF_LIGHTING, true);
|
||||||
terrain->getMaterial(0).setFlag(video::EMF_FOG_ENABLE, true);
|
terrain->getMaterial(0).setFlag(video::EMF_FOG_ENABLE, true);
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,23 @@
|
|||||||
|
/*-----------------------------------------------------------------------------*
|
||||||
|
| sourcefile ShTlTerrainSceneNode.cpp |
|
||||||
|
| |
|
||||||
|
| version 2.20 |
|
||||||
|
| date: (17.04.2008) |
|
||||||
|
| |
|
||||||
|
| author: Michal Švantner |
|
||||||
|
| |
|
||||||
|
| Shifting Tiled Terrain Scene Node |
|
||||||
|
| |
|
||||||
|
| Writen for Irrlicht engine version 1.4 |
|
||||||
|
*-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "ShTlTerrainSceneNode.h"
|
#include "ShTlTerrainSceneNode.h"
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
ShTlTerrainSceneNode::ShTlTerrainSceneNode(scene::ISceneManager* pSceneManager,
|
ShTlTerrainSceneNode::ShTlTerrainSceneNode(scene::ISceneManager* smgr,
|
||||||
s32 width, s32 height, f32 tilesize, s32 visiblesize,
|
s32 width, s32 height, f32 tilesize, s32 visiblesize, s32 sect,
|
||||||
scene::ISceneNode* parent, s32 id)
|
scene::ISceneNode* parent, s32 id)
|
||||||
: scene::ISceneNode(pSceneManager->getRootSceneNode(), pSceneManager, id)
|
: scene::ISceneNode(smgr->getRootSceneNode(), smgr, id)
|
||||||
{
|
{
|
||||||
Size.Width = width;
|
Size.Width = width;
|
||||||
Size.Height = height;
|
Size.Height = height;
|
||||||
@ -51,12 +64,16 @@ ShTlTerrainSceneNode::ShTlTerrainSceneNode(scene::ISceneManager* pSceneManager,
|
|||||||
|
|
||||||
// calculate number of sectors
|
// calculate number of sectors
|
||||||
// terrain mesh will be split to 1 or 3 or 5 sectors on each axis depending on size
|
// terrain mesh will be split to 1 or 3 or 5 sectors on each axis depending on size
|
||||||
s32 w = 1;
|
s32 w,h;
|
||||||
s32 h = 1;
|
w = h = sect;
|
||||||
if(MeshSize.Width >= 30) w = 3;
|
if(!(w && h))
|
||||||
if(MeshSize.Height >= 30) h = 3;
|
{
|
||||||
if(MeshSize.Width >= 50) w = 5;
|
w = h = 1;
|
||||||
if(MeshSize.Height >= 50) h = 5;
|
if(MeshSize.Width >= 30) w = 3;
|
||||||
|
if(MeshSize.Height >= 30) h = 3;
|
||||||
|
if(MeshSize.Width >= 50) w = 5;
|
||||||
|
if(MeshSize.Height >= 50) h = 5;
|
||||||
|
}
|
||||||
|
|
||||||
// create sectors
|
// create sectors
|
||||||
Sector.reset(w, h);
|
Sector.reset(w, h);
|
||||||
@ -67,16 +84,16 @@ ShTlTerrainSceneNode::ShTlTerrainSceneNode(scene::ISceneManager* pSceneManager,
|
|||||||
|
|
||||||
for(s32 j=0; j<Sector.height(); j++)
|
for(s32 j=0; j<Sector.height(); j++)
|
||||||
for(s32 i=0; i<Sector.width(); i++)
|
for(s32 i=0; i<Sector.width(); i++)
|
||||||
Sector(i,j).Size = core::dimension2d<u32>(w, h);
|
Sector(i,j).Size = core::dimension2d<s32>(w, h);
|
||||||
|
|
||||||
// find size of center sector in tiles
|
// find size of center sector in tiles
|
||||||
w = MeshSize.Width - Sector(0,0).Size.Width * (Sector.width()-1);
|
w = MeshSize.Width - Sector(0,0).Size.Width * (Sector.width()-1);
|
||||||
h = MeshSize.Height - Sector(0,0).Size.Height * (Sector.height()-1);
|
h = MeshSize.Height - Sector(0,0).Size.Height * (Sector.height()-1);
|
||||||
|
|
||||||
{s32 j= Sector.height()/2;
|
{s32 j=Sector.height()/2;
|
||||||
for(s32 i=0; i<Sector.width(); i++) Sector(i,j).Size.Height = h;}
|
for(s32 i=0; i<Sector.width(); i++) Sector(i,j).Size.Height = h;}
|
||||||
|
|
||||||
{s32 i= Sector.width()/2;
|
{s32 i=Sector.width()/2;
|
||||||
for(s32 j=0; j<Sector.height(); j++) Sector(i,j).Size.Width = w;}
|
for(s32 j=0; j<Sector.height(); j++) Sector(i,j).Size.Width = w;}
|
||||||
|
|
||||||
// find offset of sectors in tiles
|
// find offset of sectors in tiles
|
||||||
@ -122,13 +139,13 @@ ShTlTerrainSceneNode::ShTlTerrainSceneNode(scene::ISceneManager* pSceneManager,
|
|||||||
for(s32 j=0; j<Sector.height(); j++)
|
for(s32 j=0; j<Sector.height(); j++)
|
||||||
for(s32 i=0; i<Sector.width(); i++)
|
for(s32 i=0; i<Sector.width(); i++)
|
||||||
{
|
{
|
||||||
u32 k = 0;
|
s32 k = 0;
|
||||||
|
|
||||||
for(u32 n=0; n<Sector(i,j).Size.Height; n++)
|
for(s32 n=0; n<Sector(i,j).Size.Height; n++)
|
||||||
for(u32 m=0; m<Sector(i,j).Size.Width; m++)
|
for(s32 m=0; m<Sector(i,j).Size.Width; m++)
|
||||||
{
|
{
|
||||||
u32 x = m + Sector(i,j).Offset.X;
|
s32 x = m + Sector(i,j).Offset.X;
|
||||||
u32 y = n + Sector(i,j).Offset.Y;
|
s32 y = n + Sector(i,j).Offset.Y;
|
||||||
|
|
||||||
Tile(x,y).Vertex[0] = &Sector(i,j).Vertex[k];
|
Tile(x,y).Vertex[0] = &Sector(i,j).Vertex[k];
|
||||||
k++;
|
k++;
|
||||||
@ -182,23 +199,23 @@ ShTlTerrainSceneNode::ShTlTerrainSceneNode(scene::ISceneManager* pSceneManager,
|
|||||||
|
|
||||||
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, mmflag);
|
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, mmflag);
|
||||||
|
|
||||||
Material[0].TextureLayer[1].Texture = CTexture;
|
Material[0].TextureLayer[0].Texture = CTexture;
|
||||||
Material[0].TextureLayer[1].TextureWrap = video::ETC_CLAMP_TO_EDGE;
|
Material[0].TextureLayer[0].TextureWrap = video::ETC_CLAMP_TO_EDGE;
|
||||||
|
|
||||||
// setup UV coordinates of vertices on 2nd texture layer
|
// setup UV coordinates of vertices on 2nd texture layer
|
||||||
f32 ax = (f32)MeshSize.Width / CTexture->getSize().Width / MeshSize.Width;
|
f32 ax = (f32)MeshSize.Width / CTexture->getSize().Width / MeshSize.Width;
|
||||||
f32 ay = (f32)MeshSize.Height/ CTexture->getSize().Height / MeshSize.Height;
|
f32 ay = (f32)MeshSize.Height/ CTexture->getSize().Height / MeshSize.Height;
|
||||||
f32 ry = 1.0f - (f32)MeshSize.Height/ CTexture->getSize().Height;
|
f32 ry = 1.0f - (f32)MeshSize.Height/ CTexture->getSize().Height;
|
||||||
|
|
||||||
u32 n = MeshSize.Height-1;
|
s32 n = MeshSize.Height-1;
|
||||||
for(s32 j=0; j<MeshSize.Height; j++)
|
for(s32 j=0; j<MeshSize.Height; j++)
|
||||||
{
|
{
|
||||||
for(s32 i=0; i<MeshSize.Width; i++)
|
for(s32 i=0; i<MeshSize.Width; i++)
|
||||||
{
|
{
|
||||||
Tile(i,n).Vertex[0]->TCoords2 = core::vector2d<f32>(i*ax, ry+(j+1)*ay);
|
Tile(i,n).Vertex[0]->TCoords = core::vector2d<f32>(i*ax, ry+(j+1)*ay);
|
||||||
Tile(i,n).Vertex[1]->TCoords2 = core::vector2d<f32>(i*ax, ry+j*ay);
|
Tile(i,n).Vertex[1]->TCoords = core::vector2d<f32>(i*ax, ry+j*ay);
|
||||||
Tile(i,n).Vertex[3]->TCoords2 = core::vector2d<f32>((i+1)*ax, ry+(j+1)*ay);
|
Tile(i,n).Vertex[3]->TCoords = core::vector2d<f32>((i+1)*ax, ry+(j+1)*ay);
|
||||||
Tile(i,n).Vertex[2]->TCoords2 = core::vector2d<f32>((i+1)*ax, ry+j*ay);
|
Tile(i,n).Vertex[2]->TCoords = core::vector2d<f32>((i+1)*ax, ry+j*ay);
|
||||||
}
|
}
|
||||||
n--;
|
n--;
|
||||||
}
|
}
|
||||||
@ -231,7 +248,6 @@ ShTlTerrainSceneNode::ShTlTerrainSceneNode(scene::ISceneManager* pSceneManager,
|
|||||||
// culling will be done by terrain itself, sector by sector so that sectors
|
// culling will be done by terrain itself, sector by sector so that sectors
|
||||||
// which are not on screen will not be renderd to save time
|
// which are not on screen will not be renderd to save time
|
||||||
setAutomaticCulling( scene::EAC_OFF );
|
setAutomaticCulling( scene::EAC_OFF );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -372,10 +388,11 @@ void ShTlTerrainSceneNode::render()
|
|||||||
for (u32 n = 0; n<Sector(i,j).Vertex.size(); ++n )
|
for (u32 n = 0; n<Sector(i,j).Vertex.size(); ++n )
|
||||||
{
|
{
|
||||||
core::vector3df h = v[n].Normal * (TileSize/2);
|
core::vector3df h = v[n].Normal * (TileSize/2);
|
||||||
driver->draw3DLine ( v[n].Pos, v[n].Pos + h, c );
|
driver->draw3DLine ( v[n].Pos, v[n].Pos + h, c );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -425,7 +442,7 @@ void ShTlTerrainSceneNode::recalculateBoundingBox()
|
|||||||
|
|
||||||
|
|
||||||
// returns amount of materials used by terrain
|
// returns amount of materials used by terrain
|
||||||
u32 ShTlTerrainSceneNode::getMaterialCount()
|
u32 ShTlTerrainSceneNode::getMaterialCount() const
|
||||||
{
|
{
|
||||||
return Material.size();
|
return Material.size();
|
||||||
}
|
}
|
||||||
@ -451,7 +468,7 @@ s32 ShTlTerrainSceneNode::getStep()
|
|||||||
// set number of tiles to skip before terrain mesh gets updated
|
// set number of tiles to skip before terrain mesh gets updated
|
||||||
// default is 1
|
// default is 1
|
||||||
// updating slows down rendering and seting step higher will cause terrain to update less ofthen
|
// updating slows down rendering and seting step higher will cause terrain to update less ofthen
|
||||||
void ShTlTerrainSceneNode::setStep(u32 newstep)
|
void ShTlTerrainSceneNode::setStep(s32 newstep)
|
||||||
{
|
{
|
||||||
ShStep = newstep;
|
ShStep = newstep;
|
||||||
}
|
}
|
||||||
@ -496,7 +513,7 @@ core::dimension2d<s32> ShTlTerrainSceneNode::getRenderedSize()
|
|||||||
|
|
||||||
|
|
||||||
// return number of sectors
|
// return number of sectors
|
||||||
u32 ShTlTerrainSceneNode::getSectorCount()
|
s32 ShTlTerrainSceneNode::getSectorCount()
|
||||||
{
|
{
|
||||||
return Sector.width() * Sector.height();
|
return Sector.width() * Sector.height();
|
||||||
}
|
}
|
||||||
@ -504,7 +521,7 @@ u32 ShTlTerrainSceneNode::getSectorCount()
|
|||||||
|
|
||||||
|
|
||||||
// returns numner of sectors rendered last frame
|
// returns numner of sectors rendered last frame
|
||||||
u32 ShTlTerrainSceneNode::getSectorsRendered()
|
s32 ShTlTerrainSceneNode::getSectorsRendered()
|
||||||
{
|
{
|
||||||
return SectorsRendered;
|
return SectorsRendered;
|
||||||
}
|
}
|
||||||
@ -512,7 +529,7 @@ u32 ShTlTerrainSceneNode::getSectorsRendered()
|
|||||||
|
|
||||||
|
|
||||||
// return height of terrain spot at terrain coordinates
|
// return height of terrain spot at terrain coordinates
|
||||||
f32 ShTlTerrainSceneNode::getHeight(u32 w, u32 h)
|
f32 ShTlTerrainSceneNode::getHeight(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
return Data(w,h).Height;
|
return Data(w,h).Height;
|
||||||
}
|
}
|
||||||
@ -565,7 +582,7 @@ f32 ShTlTerrainSceneNode::getHeight(core::vector3df pos)
|
|||||||
|
|
||||||
|
|
||||||
// set relative height of terrain spot at terrain coordinates
|
// set relative height of terrain spot at terrain coordinates
|
||||||
void ShTlTerrainSceneNode::setHeight(u32 w, u32 h, f32 newheight)
|
void ShTlTerrainSceneNode::setHeight(s32 w, s32 h, f32 newheight)
|
||||||
{
|
{
|
||||||
Data(w,h).Height = newheight;
|
Data(w,h).Height = newheight;
|
||||||
|
|
||||||
@ -593,7 +610,7 @@ void ShTlTerrainSceneNode::setHeight(u32 w, u32 h, f32 newheight)
|
|||||||
|
|
||||||
|
|
||||||
// return normal of terrain at terrain coordinates
|
// return normal of terrain at terrain coordinates
|
||||||
core::vector3df ShTlTerrainSceneNode::getNormal(u32 w, u32 h)
|
core::vector3df ShTlTerrainSceneNode::getNormal(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
return Data(w,h).Normal;
|
return Data(w,h).Normal;
|
||||||
}
|
}
|
||||||
@ -601,7 +618,7 @@ core::vector3df ShTlTerrainSceneNode::getNormal(u32 w, u32 h)
|
|||||||
// set normal of terrain at terrain coordinates
|
// set normal of terrain at terrain coordinates
|
||||||
void ShTlTerrainSceneNode::setNormal(s32 w, s32 h, core::vector3df newnormal)
|
void ShTlTerrainSceneNode::setNormal(s32 w, s32 h, core::vector3df newnormal)
|
||||||
{
|
{
|
||||||
Data(w,h).Normal = newnormal;
|
Data(w,h).Normal = newnormal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -697,15 +714,15 @@ void ShTlTerrainSceneNode::smoothNormals()
|
|||||||
|
|
||||||
|
|
||||||
// get texture coordinates of tile corner
|
// get texture coordinates of tile corner
|
||||||
core::vector2d<f32> ShTlTerrainSceneNode::getTileUV(u32 w, u32 h, TILE_VERTEX corner)
|
core::vector2d<f32> ShTlTerrainSceneNode::getTileUV(s32 w, s32 h, TILE_VERTEX corner)
|
||||||
{
|
{
|
||||||
return UVdata(w,h).Vertex[corner];
|
return UVdata(w,h).Vertex[corner];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// set texture coordinates of tile
|
// set texture coordinates of tile
|
||||||
void ShTlTerrainSceneNode::setTileUV(u32 w, u32 h, core::vector2d<f32> UVlowerLeft,
|
void ShTlTerrainSceneNode::setTileUV(s32 w, s32 h, core::vector2d<f32> UVlowerLeft,
|
||||||
core::vector2d<f32> UVupperLeft, core::vector2d<f32> UVupperRight,
|
core::vector2d<f32> UVupperLeft, core::vector2d<f32> UVupperRight,
|
||||||
core::vector2d<f32> UVlowerRight)
|
core::vector2d<f32> UVlowerRight)
|
||||||
{
|
{
|
||||||
@ -723,7 +740,7 @@ void ShTlTerrainSceneNode::stretchTexture(core::vector2d<f32> scale)
|
|||||||
f32 ax = scale.X / Size.Width;
|
f32 ax = scale.X / Size.Width;
|
||||||
f32 ay = scale.X / Size.Height;
|
f32 ay = scale.X / Size.Height;
|
||||||
|
|
||||||
u32 n = Size.Height-1;
|
s32 n = Size.Height-1;
|
||||||
for(s32 j=0; j<Size.Height; j++)
|
for(s32 j=0; j<Size.Height; j++)
|
||||||
{
|
{
|
||||||
for(s32 i=0; i<Size.Width; i++)
|
for(s32 i=0; i<Size.Width; i++)
|
||||||
@ -755,7 +772,7 @@ void ShTlTerrainSceneNode::stretchTextureOverTile(core::vector2d<f32> scale)
|
|||||||
|
|
||||||
|
|
||||||
// rotate texture of tile 90 degrees
|
// rotate texture of tile 90 degrees
|
||||||
void ShTlTerrainSceneNode::rotateTileTexture90(u32 w, u32 h)
|
void ShTlTerrainSceneNode::rotateTileTexture90(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
||||||
|
|
||||||
@ -768,7 +785,7 @@ void ShTlTerrainSceneNode::rotateTileTexture90(u32 w, u32 h)
|
|||||||
|
|
||||||
|
|
||||||
// rotate texture of tile 180 degrees
|
// rotate texture of tile 180 degrees
|
||||||
void ShTlTerrainSceneNode::rotateTileTexture180(u32 w, u32 h)
|
void ShTlTerrainSceneNode::rotateTileTexture180(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
||||||
|
|
||||||
@ -784,7 +801,7 @@ void ShTlTerrainSceneNode::rotateTileTexture180(u32 w, u32 h)
|
|||||||
|
|
||||||
|
|
||||||
// rotate texture of tile 270 degrees
|
// rotate texture of tile 270 degrees
|
||||||
void ShTlTerrainSceneNode::rotateTileTexture270(u32 w, u32 h)
|
void ShTlTerrainSceneNode::rotateTileTexture270(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
||||||
|
|
||||||
@ -797,7 +814,7 @@ void ShTlTerrainSceneNode::rotateTileTexture270(u32 w, u32 h)
|
|||||||
|
|
||||||
|
|
||||||
// flip (mirror) texture of tile horizontaly
|
// flip (mirror) texture of tile horizontaly
|
||||||
void ShTlTerrainSceneNode::flipTileTextureHorizontal(u32 w, u32 h)
|
void ShTlTerrainSceneNode::flipTileTextureHorizontal(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
||||||
|
|
||||||
@ -813,7 +830,7 @@ void ShTlTerrainSceneNode::flipTileTextureHorizontal(u32 w, u32 h)
|
|||||||
|
|
||||||
|
|
||||||
// flip (mirror) texture of tile verticaly
|
// flip (mirror) texture of tile verticaly
|
||||||
void ShTlTerrainSceneNode::flipTileTextureVertical(u32 w, u32 h)
|
void ShTlTerrainSceneNode::flipTileTextureVertical(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
core::vector2d<f32> tmp = UVdata(w,h).Vertex[3];
|
||||||
|
|
||||||
@ -829,7 +846,7 @@ void ShTlTerrainSceneNode::flipTileTextureVertical(u32 w, u32 h)
|
|||||||
|
|
||||||
|
|
||||||
// get color of tile at terrain coordinates
|
// get color of tile at terrain coordinates
|
||||||
video::SColor ShTlTerrainSceneNode::getColor(u32 w, u32 h)
|
video::SColor ShTlTerrainSceneNode::getColor(s32 w, s32 h)
|
||||||
{
|
{
|
||||||
return Data(w,h).Color;
|
return Data(w,h).Color;
|
||||||
}
|
}
|
||||||
@ -837,7 +854,7 @@ video::SColor ShTlTerrainSceneNode::getColor(u32 w, u32 h)
|
|||||||
|
|
||||||
|
|
||||||
// set color of tile at terrain coordinates
|
// set color of tile at terrain coordinates
|
||||||
void ShTlTerrainSceneNode::setColor(u32 w, u32 h, video::SColor newcolor)
|
void ShTlTerrainSceneNode::setColor(s32 w, s32 h, video::SColor newcolor)
|
||||||
{
|
{
|
||||||
Data(w,h).Color = newcolor;
|
Data(w,h).Color = newcolor;
|
||||||
}
|
}
|
||||||
@ -1052,7 +1069,7 @@ bool ShTlTerrainSceneNode::getIntersectionWithLine( core::line3d<f32> line, core
|
|||||||
|
|
||||||
|
|
||||||
// load height data from texture
|
// load height data from texture
|
||||||
void ShTlTerrainSceneNode::loadHeightMap(const c8 *filename, f32 scale, u32 w, u32 h)
|
void ShTlTerrainSceneNode::loadHeightMap(const c8 *filename, f32 scale, s32 w, s32 h)
|
||||||
{
|
{
|
||||||
video::IVideoDriver* driver = SceneManager->getVideoDriver();
|
video::IVideoDriver* driver = SceneManager->getVideoDriver();
|
||||||
if(!driver) return;
|
if(!driver) return;
|
||||||
@ -1095,7 +1112,7 @@ void ShTlTerrainSceneNode::loadHeightMap(const c8 *filename, f32 scale, u32 w, u
|
|||||||
|
|
||||||
|
|
||||||
// load color data from texture
|
// load color data from texture
|
||||||
void ShTlTerrainSceneNode::loadColorMap(const c8 *filename, u32 w, u32 h)
|
void ShTlTerrainSceneNode::loadColorMap(const c8 *filename, s32 w, s32 h)
|
||||||
{
|
{
|
||||||
video::IVideoDriver* driver = SceneManager->getVideoDriver();
|
video::IVideoDriver* driver = SceneManager->getVideoDriver();
|
||||||
if(!driver) return;
|
if(!driver) return;
|
||||||
@ -1103,8 +1120,8 @@ void ShTlTerrainSceneNode::loadColorMap(const c8 *filename, u32 w, u32 h)
|
|||||||
video::IImage *image = driver->createImageFromFile(filename);
|
video::IImage *image = driver->createImageFromFile(filename);
|
||||||
if(!image) return;
|
if(!image) return;
|
||||||
|
|
||||||
s32 tw = (u32)image->getDimension().Width;
|
s32 tw = image->getDimension().Width;
|
||||||
s32 th = (u32)image->getDimension().Height;
|
s32 th = image->getDimension().Height;
|
||||||
|
|
||||||
s32 we = w + tw;
|
s32 we = w + tw;
|
||||||
if(we > Size.Width+1) we = Size.Width+1;
|
if(we > Size.Width+1) we = Size.Width+1;
|
||||||
@ -1120,7 +1137,7 @@ void ShTlTerrainSceneNode::loadColorMap(const c8 *filename, u32 w, u32 h)
|
|||||||
{
|
{
|
||||||
video::SColor color = image->getPixel(tw, th);
|
video::SColor color = image->getPixel(tw, th);
|
||||||
|
|
||||||
Data(i,j).Color = color;
|
setColor(i,j, color);
|
||||||
|
|
||||||
tw++;
|
tw++;
|
||||||
}
|
}
|
||||||
@ -1145,32 +1162,32 @@ bool ShTlTerrainSceneNode::isSectorOnScreen(TlTSector* sctr)
|
|||||||
|
|
||||||
// get camera frustrum planes
|
// get camera frustrum planes
|
||||||
const scene::SViewFrustum* frustrum = SceneManager->getActiveCamera()->getViewFrustum();
|
const scene::SViewFrustum* frustrum = SceneManager->getActiveCamera()->getViewFrustum();
|
||||||
core::plane3d<f32> Left = frustrum->planes[scene::SViewFrustum::VF_LEFT_PLANE];
|
core::plane3d<f32> left = frustrum->planes[scene::SViewFrustum::VF_LEFT_PLANE];
|
||||||
core::plane3d<f32> Right = frustrum->planes[scene::SViewFrustum::VF_RIGHT_PLANE];
|
core::plane3d<f32> right = frustrum->planes[scene::SViewFrustum::VF_RIGHT_PLANE];
|
||||||
core::plane3d<f32> Top = frustrum->planes[scene::SViewFrustum::VF_TOP_PLANE];
|
core::plane3d<f32> top = frustrum->planes[scene::SViewFrustum::VF_TOP_PLANE];
|
||||||
core::plane3d<f32> Bottom = frustrum->planes[scene::SViewFrustum::VF_BOTTOM_PLANE];
|
core::plane3d<f32> bottom = frustrum->planes[scene::SViewFrustum::VF_BOTTOM_PLANE];
|
||||||
core::plane3d<f32> Near = frustrum->planes[scene::SViewFrustum::VF_NEAR_PLANE];
|
core::plane3d<f32> near = frustrum->planes[scene::SViewFrustum::VF_NEAR_PLANE];
|
||||||
core::plane3d<f32> Far = frustrum->planes[scene::SViewFrustum::VF_FAR_PLANE];
|
core::plane3d<f32> far = frustrum->planes[scene::SViewFrustum::VF_FAR_PLANE];
|
||||||
|
|
||||||
// test sector bounding box against planes
|
// test sector bounding box against planes
|
||||||
s32 leftRel, rightRel, topRel, bottomRel, nearRel, farRel;
|
s32 leftRel, rightRel, topRel, bottomRel, nearRel, farRel;
|
||||||
|
|
||||||
nearRel = box.classifyPlaneRelation(Near);
|
nearRel = box.classifyPlaneRelation(near);
|
||||||
if(nearRel == core::ISREL3D_FRONT) return false;
|
if(nearRel == core::ISREL3D_FRONT) return false;
|
||||||
|
|
||||||
leftRel = box.classifyPlaneRelation(Left);
|
leftRel = box.classifyPlaneRelation(left);
|
||||||
if(leftRel == core::ISREL3D_FRONT) return false;
|
if(leftRel == core::ISREL3D_FRONT) return false;
|
||||||
|
|
||||||
rightRel = box.classifyPlaneRelation(Right);
|
rightRel = box.classifyPlaneRelation(right);
|
||||||
if(rightRel == core::ISREL3D_FRONT) return false;
|
if(rightRel == core::ISREL3D_FRONT) return false;
|
||||||
|
|
||||||
bottomRel = box.classifyPlaneRelation(Bottom);
|
bottomRel = box.classifyPlaneRelation(bottom);
|
||||||
if(bottomRel == core::ISREL3D_FRONT) return false;
|
if(bottomRel == core::ISREL3D_FRONT) return false;
|
||||||
|
|
||||||
farRel = box.classifyPlaneRelation(Far);
|
farRel = box.classifyPlaneRelation(far);
|
||||||
if(farRel == core::ISREL3D_FRONT) return false;
|
if(farRel == core::ISREL3D_FRONT) return false;
|
||||||
|
|
||||||
topRel = box.classifyPlaneRelation(Top);
|
topRel = box.classifyPlaneRelation(top);
|
||||||
if(topRel == core::ISREL3D_FRONT) return false;
|
if(topRel == core::ISREL3D_FRONT) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1181,15 +1198,12 @@ bool ShTlTerrainSceneNode::isSectorOnScreen(TlTSector* sctr)
|
|||||||
// update vertices of sector
|
// update vertices of sector
|
||||||
void ShTlTerrainSceneNode::updateVertices(TlTSector §or)
|
void ShTlTerrainSceneNode::updateVertices(TlTSector §or)
|
||||||
{
|
{
|
||||||
scene::SMeshBuffer* MeshBuffer=new scene::SMeshBuffer();
|
for(s32 j=sector.Offset.Y; j<sector.Offset.Y+sector.Size.Height; j++)
|
||||||
scene::SMesh* Mesh=new scene::SMesh();
|
for(s32 i=sector.Offset.X; i<sector.Offset.X+sector.Size.Width; i++)
|
||||||
|
|
||||||
for(u32 j=sector.Offset.Y; j<sector.Offset.Y+sector.Size.Height; j++)
|
|
||||||
for(u32 i=sector.Offset.X; i<sector.Offset.X+sector.Size.Width; i++)
|
|
||||||
{
|
{
|
||||||
// positon of tile relative to terrain
|
// positon of tile relative to terrain
|
||||||
u32 x = i + MeshPosition.X;
|
s32 x = i + MeshPosition.X;
|
||||||
u32 y = j + MeshPosition.Y;
|
s32 y = j + MeshPosition.Y;
|
||||||
|
|
||||||
// update position
|
// update position
|
||||||
Tile(i,j).Vertex[0]->Pos = core::vector3df(x*TileSize, Data(x,y).Height, y*TileSize);
|
Tile(i,j).Vertex[0]->Pos = core::vector3df(x*TileSize, Data(x,y).Height, y*TileSize);
|
||||||
@ -1198,33 +1212,17 @@ void ShTlTerrainSceneNode::updateVertices(TlTSector §or)
|
|||||||
Tile(i,j).Vertex[3]->Pos = core::vector3df( (x+1)*TileSize, Data(x+1,y).Height, y*TileSize);
|
Tile(i,j).Vertex[3]->Pos = core::vector3df( (x+1)*TileSize, Data(x+1,y).Height, y*TileSize);
|
||||||
|
|
||||||
// update normals
|
// update normals
|
||||||
Tile(i,j).Vertex[0]->Normal = Data(x,y).Normal;
|
Tile(i,j).Vertex[0]->Normal = getNormal(x,y);
|
||||||
Tile(i,j).Vertex[1]->Normal = Data(x,y+1).Normal;
|
Tile(i,j).Vertex[1]->Normal = getNormal(x,y+1);
|
||||||
Tile(i,j).Vertex[2]->Normal = Data(x+1,y+1).Normal;
|
Tile(i,j).Vertex[2]->Normal = getNormal(x+1,y+1);
|
||||||
Tile(i,j).Vertex[3]->Normal = Data(x+1,y).Normal;
|
Tile(i,j).Vertex[3]->Normal = getNormal(x+1,y);
|
||||||
|
|
||||||
// update texture coordinates
|
// update texture coordinates
|
||||||
Tile(i,j).Vertex[0]->TCoords = UVdata(x,y).Vertex[0];
|
Tile(i,j).Vertex[0]->TCoords2 = getTileUV(x,y,LOWER_LEFT);
|
||||||
Tile(i,j).Vertex[1]->TCoords = UVdata(x,y).Vertex[1];
|
Tile(i,j).Vertex[1]->TCoords2 = getTileUV(x,y,UPPER_LEFT);
|
||||||
Tile(i,j).Vertex[2]->TCoords = UVdata(x,y).Vertex[2];
|
Tile(i,j).Vertex[2]->TCoords2 = getTileUV(x,y,UPPER_RIGHT);
|
||||||
Tile(i,j).Vertex[3]->TCoords = UVdata(x,y).Vertex[3];
|
Tile(i,j).Vertex[3]->TCoords2 = getTileUV(x,y,LOWER_RIGHT);
|
||||||
|
|
||||||
for (int z=0;z<4;z++)
|
|
||||||
MeshBuffer->Vertices.push_back(video::S3DVertex(
|
|
||||||
Tile(i,j).Vertex[z]->Pos,
|
|
||||||
core::vector3df(0,0,0), video::SColor(0,0,0,0), core::vector2df(0,0)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 z=0;z<sector.Index.size();z++)
|
|
||||||
{
|
|
||||||
MeshBuffer->Indices.push_back(
|
|
||||||
sector.Index[z]);
|
|
||||||
}
|
|
||||||
|
|
||||||
Mesh->addMeshBuffer(MeshBuffer);
|
|
||||||
MeshBuffer->drop();
|
|
||||||
|
|
||||||
Mesh->drop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1232,24 +1230,24 @@ void ShTlTerrainSceneNode::updateVertices(TlTSector §or)
|
|||||||
// update 2nd texture layer
|
// update 2nd texture layer
|
||||||
void ShTlTerrainSceneNode::updateTexture(u32* p, TlTSector §or)
|
void ShTlTerrainSceneNode::updateTexture(u32* p, TlTSector §or)
|
||||||
{
|
{
|
||||||
u32 x, y;
|
s32 x, y;
|
||||||
|
|
||||||
// in case created texure is larger than terrain mesh, update one more pixel
|
// in case created texure is larger than terrain mesh, update one more pixel
|
||||||
// on each axis to get rid of unused pixels at the border blended in to used ones
|
// on each axis to get rid of unused pixels at the border blended in to used ones
|
||||||
u32 w = 0;
|
s32 w = 0;
|
||||||
if(MeshSize.Width < CTexture->getSize().Width) w = 1;
|
if(MeshSize.Width < CTexture->getSize().Width) w = 1;
|
||||||
u32 h = 0;
|
s32 h = 0;
|
||||||
if(MeshSize.Height < CTexture->getSize().Height) h = 1;
|
if(MeshSize.Height < CTexture->getSize().Height) h = 1;
|
||||||
|
|
||||||
for(u32 j=sector.Offset.Y; j<sector.Offset.Y + sector.Size.Height + h; j++)
|
for(s32 j=sector.Offset.Y; j<sector.Offset.Y + sector.Size.Height + h; j++)
|
||||||
{
|
{
|
||||||
u32 n = CTexture->getSize().Height-1 - j;
|
s32 n = CTexture->getSize().Height-1 - j;
|
||||||
for(u32 i=sector.Offset.X; i<sector.Offset.X + sector.Size.Width + w; i++)
|
for(s32 i=sector.Offset.X; i<sector.Offset.X + sector.Size.Width + w; i++)
|
||||||
{
|
{
|
||||||
x = i + MeshPosition.X;
|
x = i + MeshPosition.X;
|
||||||
y = j + MeshPosition.Y;
|
y = j + MeshPosition.Y;
|
||||||
|
|
||||||
p[n*CTexture->getSize().Width + i] = Data(x,y).Color.color;
|
p[n*CTexture->getSize().Width + i] = getColor(x,y).color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*-----------------------------------------------------------------------------*
|
/*-----------------------------------------------------------------------------*
|
||||||
| headerfile ShTlTerrainSceneNode.h |
|
| headerfile ShTlTerrainSceneNode.h |
|
||||||
| |
|
| |
|
||||||
| version 2.00 |
|
| version 2.20 |
|
||||||
| date: (29.04.2007) |
|
| date: (17.04.2008) |
|
||||||
| |
|
| |
|
||||||
| author: Michal Švantner |
|
| author: Michal Švantner |
|
||||||
| |
|
| |
|
||||||
@ -43,7 +43,7 @@
|
|||||||
| Rendered mesh is split in to seweral sectors which are culled individualy. |
|
| Rendered mesh is split in to seweral sectors which are culled individualy. |
|
||||||
| This exclude around 60% of polygoons from rendering. |
|
| This exclude around 60% of polygoons from rendering. |
|
||||||
| |
|
| |
|
||||||
| Writen for Irrlicht engine version 1.3 |
|
| Writen for Irrlicht engine version 1.4 |
|
||||||
*-----------------------------------------------------------------------------*/
|
*-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef SHTLTERRAINSCENENODE_H
|
#ifndef SHTLTERRAINSCENENODE_H
|
||||||
@ -94,7 +94,7 @@ class ShTlTerrainSceneNode : public scene::ISceneNode
|
|||||||
video::ITexture* CTexture;
|
video::ITexture* CTexture;
|
||||||
|
|
||||||
// number of sectors rendered last frame
|
// number of sectors rendered last frame
|
||||||
u32 SectorsRendered;
|
s32 SectorsRendered;
|
||||||
|
|
||||||
// howe many tiles should be skiped before terrain mesh gets updated
|
// howe many tiles should be skiped before terrain mesh gets updated
|
||||||
s32 ShStep;
|
s32 ShStep;
|
||||||
@ -122,8 +122,8 @@ public:
|
|||||||
// \param rendersize -size of rendered terrain mesh in tiles
|
// \param rendersize -size of rendered terrain mesh in tiles
|
||||||
// \param parent -parent scene node
|
// \param parent -parent scene node
|
||||||
// \param id -ID number
|
// \param id -ID number
|
||||||
ShTlTerrainSceneNode(scene::ISceneManager* pSceneManager, s32 width, s32 height,
|
ShTlTerrainSceneNode(scene::ISceneManager* smgr, s32 width, s32 height,
|
||||||
f32 tilesize, s32 rendersize, scene::ISceneNode* parent = 0, s32 id = -1);
|
f32 tilesize, s32 rendersize, s32 sect = 0, scene::ISceneNode* parent = 0, s32 id = -1);
|
||||||
|
|
||||||
// destructor
|
// destructor
|
||||||
~ShTlTerrainSceneNode();
|
~ShTlTerrainSceneNode();
|
||||||
@ -142,7 +142,7 @@ public:
|
|||||||
|
|
||||||
// returns amount of materials used by terrain
|
// returns amount of materials used by terrain
|
||||||
// this terrain uses only one material
|
// this terrain uses only one material
|
||||||
virtual u32 getMaterialCount();
|
virtual u32 getMaterialCount() const;
|
||||||
|
|
||||||
// returns the material of terrain based on the zero based index
|
// returns the material of terrain based on the zero based index
|
||||||
// \param i -index of material to return
|
// \param i -index of material to return
|
||||||
@ -154,7 +154,7 @@ public:
|
|||||||
// set number of tiles to skip before terrain mesh gets updated, default is 1
|
// set number of tiles to skip before terrain mesh gets updated, default is 1
|
||||||
// updating slows down rendering and seting step higher will cause terrain to update less ofthen
|
// updating slows down rendering and seting step higher will cause terrain to update less ofthen
|
||||||
// \param newstep -amount of tiles to skip before updating
|
// \param newstep -amount of tiles to skip before updating
|
||||||
virtual void setStep(u32 newstep);
|
virtual void setStep(s32 newstep);
|
||||||
|
|
||||||
// return dimensions of whole terrain in tiles
|
// return dimensions of whole terrain in tiles
|
||||||
virtual core::dimension2d<s32> getSize();
|
virtual core::dimension2d<s32> getSize();
|
||||||
@ -170,15 +170,15 @@ public:
|
|||||||
virtual core::dimension2d<s32> getRenderedSize();
|
virtual core::dimension2d<s32> getRenderedSize();
|
||||||
|
|
||||||
// return number of sectors into which terrain mesh is divided
|
// return number of sectors into which terrain mesh is divided
|
||||||
virtual u32 getSectorCount();
|
virtual s32 getSectorCount();
|
||||||
|
|
||||||
// returns sectors rendered last frame
|
// returns sectors rendered last frame
|
||||||
virtual u32 getSectorsRendered();
|
virtual s32 getSectorsRendered();
|
||||||
|
|
||||||
// return relative height of terrain spot at terrain coordinates
|
// return relative height of terrain spot at terrain coordinates
|
||||||
// \param w -width coordinate of spot in tiles
|
// \param w -width coordinate of spot in tiles
|
||||||
// \param h -height coordinate of spot in tiles
|
// \param h -height coordinate of spot in tiles
|
||||||
virtual f32 getHeight(u32 w, u32 h);
|
virtual f32 getHeight(s32 w, s32 h);
|
||||||
|
|
||||||
// return height of terrain at any position
|
// return height of terrain at any position
|
||||||
// \param pos -3d coordinates at which to get height of terrain
|
// \param pos -3d coordinates at which to get height of terrain
|
||||||
@ -188,12 +188,12 @@ public:
|
|||||||
// \param w -width coordinate of spot in tiles
|
// \param w -width coordinate of spot in tiles
|
||||||
// \param h -height coordinate of spot in tiles
|
// \param h -height coordinate of spot in tiles
|
||||||
// \param newheight -new height of spot
|
// \param newheight -new height of spot
|
||||||
virtual void setHeight(u32 w, u32 h, f32 newheight);
|
virtual void setHeight(s32 w, s32 h, f32 newheight);
|
||||||
|
|
||||||
// return normal of terrain at terrain coordinates
|
// return normal of terrain at terrain coordinates
|
||||||
// \param w -width coordinate of spot in tiles
|
// \param w -width coordinate of spot in tiles
|
||||||
// \param h -height coordinate of spot in tiles
|
// \param h -height coordinate of spot in tiles
|
||||||
virtual core::vector3df getNormal(u32 w, u32 h);
|
virtual core::vector3df getNormal(s32 w, s32 h);
|
||||||
|
|
||||||
// set normal of terrain at terrain coordinates
|
// set normal of terrain at terrain coordinates
|
||||||
// \param w -width coordinate of spot in tiles
|
// \param w -width coordinate of spot in tiles
|
||||||
@ -213,7 +213,7 @@ public:
|
|||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
// \param corner -tile corner, can be LOWER_LEFT, UPPER_LEFT, UPPER_RIGHT, LOWER_RIGHT
|
// \param corner -tile corner, can be LOWER_LEFT, UPPER_LEFT, UPPER_RIGHT, LOWER_RIGHT
|
||||||
virtual core::vector2d<f32> getTileUV(u32 w, u32 h, TILE_VERTEX corner);
|
virtual core::vector2d<f32> getTileUV(s32 w, s32 h, TILE_VERTEX corner);
|
||||||
|
|
||||||
// set texture coordinates of tile
|
// set texture coordinates of tile
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
@ -222,7 +222,7 @@ public:
|
|||||||
// \param UVUpperLeft -UV coordinates of upper left corner
|
// \param UVUpperLeft -UV coordinates of upper left corner
|
||||||
// \param UVUpperRight -UV coordinates of upper right corner
|
// \param UVUpperRight -UV coordinates of upper right corner
|
||||||
// \param UVLowerRight -UV coordinates of lower right corner
|
// \param UVLowerRight -UV coordinates of lower right corner
|
||||||
virtual void setTileUV(u32 w, u32 h, core::vector2d<f32> UVLowerLeft,
|
virtual void setTileUV(s32 w, s32 h, core::vector2d<f32> UVLowerLeft,
|
||||||
core::vector2d<f32> UVUpperLeft, core::vector2d<f32> UVUpperRight,
|
core::vector2d<f32> UVUpperLeft, core::vector2d<f32> UVUpperRight,
|
||||||
core::vector2d<f32> UVLowerRight);
|
core::vector2d<f32> UVLowerRight);
|
||||||
|
|
||||||
@ -237,38 +237,38 @@ public:
|
|||||||
// rotate texture of tile 90 degrees
|
// rotate texture of tile 90 degrees
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
virtual void rotateTileTexture90(u32 w, u32 h);
|
virtual void rotateTileTexture90(s32 w, s32 h);
|
||||||
|
|
||||||
// rotate texture of tile 180 degrees
|
// rotate texture of tile 180 degrees
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
virtual void rotateTileTexture180(u32 w, u32 h);
|
virtual void rotateTileTexture180(s32 w, s32 h);
|
||||||
|
|
||||||
// rotate texture of tile 270 degrees
|
// rotate texture of tile 270 degrees
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
virtual void rotateTileTexture270(u32 w, u32 h);
|
virtual void rotateTileTexture270(s32 w, s32 h);
|
||||||
|
|
||||||
// flip (mirror) texture of tile horizontaly
|
// flip (mirror) texture of tile horizontaly
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
virtual void flipTileTextureHorizontal(u32 w, u32 h);
|
virtual void flipTileTextureHorizontal(s32 w, s32 h);
|
||||||
|
|
||||||
// flip (mirror) texture of tile verticaly
|
// flip (mirror) texture of tile verticaly
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
virtual void flipTileTextureVertical(u32 w, u32 h);
|
virtual void flipTileTextureVertical(s32 w, s32 h);
|
||||||
|
|
||||||
// get color of tile at terrain coordinates
|
// get color of tile at terrain coordinates
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
virtual video::SColor getColor(u32 w, u32 h);
|
virtual video::SColor getColor(s32 w, s32 h);
|
||||||
|
|
||||||
// set color of tile at terrain coordinates
|
// set color of tile at terrain coordinates
|
||||||
// \param w -width coordinate of tile
|
// \param w -width coordinate of tile
|
||||||
// \param h -height coordinate of tile
|
// \param h -height coordinate of tile
|
||||||
// \param newcolor -new color of tile
|
// \param newcolor -new color of tile
|
||||||
virtual void setColor(u32 w, u32 h, video::SColor newcolor);
|
virtual void setColor(s32 w, s32 h, video::SColor newcolor);
|
||||||
|
|
||||||
// set rendered mesh position relative to terrain
|
// set rendered mesh position relative to terrain
|
||||||
// note that origin of mesh is in its lower left corner
|
// note that origin of mesh is in its lower left corner
|
||||||
@ -304,7 +304,7 @@ public:
|
|||||||
// \param scale -scale to apply at height data, if you want white color to be height of 10.5 set scale to 10.5
|
// \param scale -scale to apply at height data, if you want white color to be height of 10.5 set scale to 10.5
|
||||||
// \param w -width coordinate of tile were to start loading
|
// \param w -width coordinate of tile were to start loading
|
||||||
// \param h -height coordinate of tile were to start loading
|
// \param h -height coordinate of tile were to start loading
|
||||||
virtual void loadHeightMap(const c8 *filename, f32 scale, u32 w = 0, u32 h = 0);
|
virtual void loadHeightMap(const c8 *filename, f32 scale, s32 w = 0, s32 h = 0);
|
||||||
|
|
||||||
// load color data from texture
|
// load color data from texture
|
||||||
// parameters allow to specify place where to load data, which makes possible
|
// parameters allow to specify place where to load data, which makes possible
|
||||||
@ -312,6 +312,6 @@ public:
|
|||||||
// \param filename -filename of texture
|
// \param filename -filename of texture
|
||||||
// \param w -width coordinate of tile were to start loading
|
// \param w -width coordinate of tile were to start loading
|
||||||
// \param h -height coordinate of tile were to start loading
|
// \param h -height coordinate of tile were to start loading
|
||||||
virtual void loadColorMap(const c8 *filename, u32 w = 0, u32 h = 0);
|
virtual void loadColorMap(const c8 *filename, s32 w = 0, s32 h = 0);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
/*-----------------------------------------------------------------------------*
|
/*-----------------------------------------------------------------------------*
|
||||||
| headerfile TLTMesh.h |
|
| headerfile TLTMesh.h |
|
||||||
| |
|
| |
|
||||||
| version 1.00 |
|
| version 1.10 |
|
||||||
| date: (17.04.2007) |
|
| date: (07.04.2008) |
|
||||||
| |
|
| |
|
||||||
| author: Michal Švantner |
|
| author: Michal Švantner |
|
||||||
| |
|
| |
|
||||||
| Some structures used for Tiled Terrain |
|
| Some structures used for Tiled Terrain |
|
||||||
| Writen for Irrlicht engine version 1.3 |
|
| Writen for Irrlicht engine version 1.4 |
|
||||||
*-----------------------------------------------------------------------------*/
|
*-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef TLTMESH_H
|
#ifndef TLTMESH_H
|
||||||
#define TLTMESH_H
|
#define TLTMESH_H
|
||||||
|
|
||||||
#include <irrlicht/irrlicht.h>
|
#include "irrlicht/irrlicht.h"
|
||||||
using namespace irr;
|
using namespace irr;
|
||||||
|
|
||||||
|
|
||||||
@ -21,58 +21,58 @@ using namespace irr;
|
|||||||
// dynamic 2d array
|
// dynamic 2d array
|
||||||
template <class T> class array2d
|
template <class T> class array2d
|
||||||
{
|
{
|
||||||
T** data;
|
T** data;
|
||||||
s32 w, h;
|
s32 w, h;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
array2d() : w(0), h(0) {}
|
array2d() : w(0), h(0) {}
|
||||||
|
|
||||||
array2d(int width, int height) : w(width), h(height)
|
array2d(s32 width, s32 height) : w(width), h(height)
|
||||||
{
|
{
|
||||||
data = new T*[w];
|
data = new T*[w];
|
||||||
for(int i=0; i<w; i++) data[i] = new T[h];
|
for(int i=0; i<w; i++) data[i] = new T[h];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void reset(int width, int height)
|
virtual ~array2d()
|
||||||
{
|
{
|
||||||
if(w && h)
|
if(w && h)
|
||||||
{
|
{
|
||||||
for(int i=0; i<w; i++) delete data[i];
|
for(int i=0; i<w; i++) delete [] data[i];
|
||||||
delete [] data;
|
delete [] data;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(width && height)
|
virtual void reset(int width, int height)
|
||||||
{
|
{
|
||||||
w = width;
|
if(w && h)
|
||||||
h = height;
|
{
|
||||||
|
for(int i=0; i<w; i++) delete data[i];
|
||||||
|
delete [] data;
|
||||||
|
}
|
||||||
|
|
||||||
data = new T*[w];
|
if(width && height)
|
||||||
for(int i=0; i<w; i++) data[i] = new T[h];
|
{
|
||||||
}
|
w = width;
|
||||||
else
|
h = height;
|
||||||
{
|
|
||||||
w = 0;
|
|
||||||
h = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~array2d()
|
data = new T*[w];
|
||||||
{
|
for(int i=0; i<w; i++) data[i] = new T[h];
|
||||||
if(w && h)
|
}
|
||||||
{
|
else
|
||||||
for(int i=0; i<w; i++) delete [] data[i];
|
{
|
||||||
delete [] data;
|
w = 0;
|
||||||
}
|
h = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual T& operator ()(u32 index1, u32 index2)
|
virtual T& operator ()(s32 index1, s32 index2)
|
||||||
{
|
{
|
||||||
return data[index1][index2];
|
return data[index1][index2];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual s32 width() {return w;}
|
virtual s32 width() {return w;}
|
||||||
|
|
||||||
virtual s32 height() {return h;}
|
virtual s32 height() {return h;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -116,16 +116,13 @@ struct TlTData
|
|||||||
|
|
||||||
|
|
||||||
// structure which is used as meshbuffer for Tiled Terrain
|
// structure which is used as meshbuffer for Tiled Terrain
|
||||||
class TlTSector
|
struct TlTSector
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
TlTSector() {};
|
|
||||||
~TlTSector() {};
|
|
||||||
// position relative to whole mesh of which sector is part in tiles
|
// position relative to whole mesh of which sector is part in tiles
|
||||||
core::vector2d<s32> Offset;
|
core::vector2d<s32> Offset;
|
||||||
|
|
||||||
// dimension of sector in tiles
|
// dimension of sector in tiles
|
||||||
core::dimension2d<u32> Size;
|
core::dimension2d<s32> Size;
|
||||||
|
|
||||||
// array of vertices
|
// array of vertices
|
||||||
core::array<video::S3DVertex2TCoords> Vertex;
|
core::array<video::S3DVertex2TCoords> Vertex;
|
||||||
|
|||||||
130
src/Client/GUI/TlTSector.h
Normal file
130
src/Client/GUI/TlTSector.h
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
#ifndef TLMESH_H
|
||||||
|
#define TLMESH_H
|
||||||
|
|
||||||
|
#include <irrlicht.h>
|
||||||
|
using namespace irr;
|
||||||
|
|
||||||
|
template <class T> class array2d
|
||||||
|
{
|
||||||
|
T** data;
|
||||||
|
u32 w, h;
|
||||||
|
|
||||||
|
public:
|
||||||
|
array2d() : w(0), h(0) {}
|
||||||
|
|
||||||
|
array2d(int width, int height) : w(width), h(height)
|
||||||
|
{
|
||||||
|
data = new T*[w];
|
||||||
|
for(int i=0; i<w; i++) data[i] = new T[h];
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void reset(int width, int height)
|
||||||
|
{
|
||||||
|
if(w && h)
|
||||||
|
{
|
||||||
|
for(int i=0; i<w; i++) delete data[i];
|
||||||
|
delete [] data;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(width && height)
|
||||||
|
{
|
||||||
|
w = width;
|
||||||
|
h = height;
|
||||||
|
|
||||||
|
data = new T*[w];
|
||||||
|
for(int i=0; i<w; i++) data[i] = new T[h];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
w = 0;
|
||||||
|
h = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
~array2d()
|
||||||
|
{
|
||||||
|
if(w && h)
|
||||||
|
{
|
||||||
|
for(int i=0; i<w; i++) delete data[i];
|
||||||
|
delete [] data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual T& operator ()(u32 index1, u32 index2)
|
||||||
|
{
|
||||||
|
return data[index1][index2];
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual u32 width() {return w;}
|
||||||
|
|
||||||
|
virtual u32 height() {return h;}
|
||||||
|
};
|
||||||
|
|
||||||
|
enum TILE_VERTEX
|
||||||
|
{
|
||||||
|
LOWER_LEFT = 0,
|
||||||
|
UPPER_LEFT,
|
||||||
|
UPPER_RIGHT,
|
||||||
|
LOWER_RIGHT,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TlTTile
|
||||||
|
{
|
||||||
|
video::S3DVertex2TCoords* Vertex[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TlTCoords
|
||||||
|
{
|
||||||
|
core::vector2d<f32> Vertex[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TlTData
|
||||||
|
{
|
||||||
|
f32 Height;
|
||||||
|
core::vector3df Normal;
|
||||||
|
video::SColor Color;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TlTSector
|
||||||
|
{
|
||||||
|
core::vector2d<s32> Offset;
|
||||||
|
core::dimension2d<u32> Size;
|
||||||
|
core::array<video::S3DVertex2TCoords> Vertex;
|
||||||
|
core::array<u16> Index;
|
||||||
|
core::aabbox3d<f32> BoundingBox;
|
||||||
|
|
||||||
|
array2d<TlTTile> Tile;
|
||||||
|
|
||||||
|
virtual void addTile()
|
||||||
|
{
|
||||||
|
u32 n = Vertex.size();
|
||||||
|
|
||||||
|
video::S3DVertex2TCoords v;
|
||||||
|
|
||||||
|
Vertex.push_back(v);
|
||||||
|
Vertex.push_back(v);
|
||||||
|
Vertex.push_back(v);
|
||||||
|
Vertex.push_back(v);
|
||||||
|
|
||||||
|
Index.push_back(n);
|
||||||
|
Index.push_back(n+1);
|
||||||
|
Index.push_back(n+2);
|
||||||
|
|
||||||
|
Index.push_back(n);
|
||||||
|
Index.push_back(n+2);
|
||||||
|
Index.push_back(n+3);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void recalculateBoundingBox()
|
||||||
|
{
|
||||||
|
if(Vertex.empty())
|
||||||
|
BoundingBox.reset(0,0,0);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BoundingBox.reset(Vertex[0].Pos);
|
||||||
|
for(u32 i=1; i<Vertex.size(); ++i)
|
||||||
|
BoundingBox.addInternalPoint(Vertex[i].Pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
@ -488,6 +488,15 @@ void PseuInstanceConf::ApplyFromVarSet(VarSet &v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GUI related
|
||||||
|
terrainsectors = atoi(v.Get("GUI::TERRAINSECTORS").c_str());
|
||||||
|
terrainrendersize = atoi(v.Get("GUI::TERRAINRENDERSIZE").c_str());
|
||||||
|
terrainupdatestep = atoi(v.Get("GUI::TERRAINUPDATESTEP").c_str());
|
||||||
|
farclip = atof(v.Get("GUI::FARCLIP").c_str());
|
||||||
|
fogfar = atof(v.Get("GUI::FOGFAR").c_str());
|
||||||
|
fognear = atof(v.Get("GUI::FOGNEAR").c_str());
|
||||||
|
fov = atof(v.Get("GUI::FOV").c_str());
|
||||||
|
|
||||||
log_setloglevel(debug);
|
log_setloglevel(debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,13 @@ class PseuInstanceConf
|
|||||||
|
|
||||||
// gui related
|
// gui related
|
||||||
bool enablegui;
|
bool enablegui;
|
||||||
// need more here
|
uint32 terrainsectors;
|
||||||
|
uint32 terrainrendersize;
|
||||||
|
uint32 terrainupdatestep;
|
||||||
|
float farclip;
|
||||||
|
float fogfar;
|
||||||
|
float fognear;
|
||||||
|
float fov;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -489,6 +489,9 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath=".\Client\Gui\TlTMesh.h">
|
RelativePath=".\Client\Gui\TlTMesh.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Client\Gui\TlTSector.h">
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user