1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:29:55 +00:00

Terrain: remove debug code

This commit is contained in:
scrawl 2015-11-06 20:21:39 +01:00
parent ef18f4217f
commit 7ca8e45d5d
3 changed files with 2 additions and 16 deletions

View file

@ -1,7 +1,6 @@
#include "storage.hpp" #include "storage.hpp"
#include <set> #include <set>
#include <iostream>
#include <osg/Image> #include <osg/Image>
#include <osg/Plane> #include <osg/Plane>
@ -343,13 +342,6 @@ namespace ESMTerrain
// So we're always adding _land_default.dds as the base layer here, even if it's not referenced in this cell. // So we're always adding _land_default.dds as the base layer here, even if it's not referenced in this cell.
textureIndices.insert(std::make_pair(0,0)); textureIndices.insert(std::make_pair(0,0));
/*
_________
| | | | - | | | | -
| | | | - | | | | -
*/
for (int y=colStart; y<colEnd; ++y) for (int y=colStart; y<colEnd; ++y)
for (int x=rowStart; x<rowEnd; ++x) for (int x=rowStart; x<rowEnd; ++x)
{ {

View file

@ -1,7 +1,6 @@
#include "buffercache.hpp" #include "buffercache.hpp"
#include <cassert> #include <cassert>
#include <iostream>
#include <osg/PrimitiveSet> #include <osg/PrimitiveSet>
@ -209,8 +208,6 @@ namespace Terrain
{ {
unsigned int verts = mNumVerts; unsigned int verts = mNumVerts;
std::cout << "getting index buffer for " << verts << std::endl;
if (mIndexBufferMap.find(flags) != mIndexBufferMap.end()) if (mIndexBufferMap.find(flags) != mIndexBufferMap.end())
{ {
return mIndexBufferMap[flags]; return mIndexBufferMap[flags];

View file

@ -1,8 +1,6 @@
#include "terraingrid.hpp" #include "terraingrid.hpp"
#include <memory> #include <memory>
#include <osg/io_utils>
#include <iostream>
#include <components/resource/resourcesystem.hpp> #include <components/resource/resourcesystem.hpp>
#include <components/resource/texturemanager.hpp> #include <components/resource/texturemanager.hpp>
@ -77,7 +75,7 @@ osg::ref_ptr<osg::Node> TerrainGrid::buildTerrain (osg::Group* parent, float chu
osg::ref_ptr<osg::Group> group (new osg::Group); osg::ref_ptr<osg::Group> group (new osg::Group);
if (parent) if (parent)
parent->addChild(group); parent->addChild(group);
std::cout << "splitting " << chunkSize << " " << std::endl;
float newChunkSize = chunkSize/2.f; float newChunkSize = chunkSize/2.f;
buildTerrain(group, newChunkSize, chunkCenter + osg::Vec2f(newChunkSize/2.f, newChunkSize/2.f)); buildTerrain(group, newChunkSize, chunkCenter + osg::Vec2f(newChunkSize/2.f, newChunkSize/2.f));
buildTerrain(group, newChunkSize, chunkCenter + osg::Vec2f(newChunkSize/2.f, -newChunkSize/2.f)); buildTerrain(group, newChunkSize, chunkCenter + osg::Vec2f(newChunkSize/2.f, -newChunkSize/2.f));
@ -91,8 +89,6 @@ osg::ref_ptr<osg::Node> TerrainGrid::buildTerrain (osg::Group* parent, float chu
if (!mStorage->getMinMaxHeights(chunkSize, chunkCenter, minH, maxH)) if (!mStorage->getMinMaxHeights(chunkSize, chunkCenter, minH, maxH))
return NULL; // no terrain defined return NULL; // no terrain defined
std::cout << "creating " << chunkSize << " " << chunkCenter << std::endl;
osg::Vec2f worldCenter = chunkCenter*mStorage->getCellWorldSize(); osg::Vec2f worldCenter = chunkCenter*mStorage->getCellWorldSize();
osg::ref_ptr<osg::PositionAttitudeTransform> transform (new osg::PositionAttitudeTransform); osg::ref_ptr<osg::PositionAttitudeTransform> transform (new osg::PositionAttitudeTransform);
transform->setPosition(osg::Vec3f(worldCenter.x(), worldCenter.y(), 0.f)); transform->setPosition(osg::Vec3f(worldCenter.x(), worldCenter.y(), 0.f));
@ -194,6 +190,7 @@ void TerrainGrid::loadCell(int x, int y)
element->mNode = terrainNode; element->mNode = terrainNode;
mTerrainRoot->addChild(element->mNode); mTerrainRoot->addChild(element->mNode);
// kdtree probably not needed with mNumSplits=4
/* /*
// build a kdtree to speed up intersection tests with the terrain // build a kdtree to speed up intersection tests with the terrain
// Note, the build could be optimized using a custom kdtree builder, since we know that the terrain can be represented by a quadtree // Note, the build could be optimized using a custom kdtree builder, since we know that the terrain can be represented by a quadtree