mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-18 13:12:50 +00:00
Merge branch 'iterator' of https://github.com/zinnschlag/openmw into inventoryGUI
This commit is contained in:
commit
8a0c859c16
@ -496,6 +496,8 @@ void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell)
|
||||
const ESM::Region* region = MWBase::Environment::get().getWorld()->getStore().regions.search(cell->cell->region);
|
||||
if (region)
|
||||
name = region->name;
|
||||
else
|
||||
name = getGameSettingString("sDefaultCellname", "Wilderness");
|
||||
}
|
||||
|
||||
map->setCellName( name );
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "../mwworld/world.hpp" // these includes can be removed once the static-hack is gone
|
||||
#include "../mwworld/ptr.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include <components/esm/loadstat.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
@ -229,7 +230,10 @@ void RenderingManager::update (float duration){
|
||||
mWater->update();
|
||||
}
|
||||
void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){
|
||||
if(store->cell->data.flags & store->cell->HasWater){
|
||||
if(store->cell->data.flags & store->cell->HasWater
|
||||
|| ((!(store->cell->data.flags & ESM::Cell::Interior))
|
||||
&& !MWBase::Environment::get().getWorld()->getStore().lands.search(store->cell->data.gridX,store->cell->data.gridY) )) // always use water, if the cell does not have land.
|
||||
{
|
||||
if(mWater == 0)
|
||||
mWater = new MWRender::Water(mRendering.getCamera(), mSkyManager, store->cell);
|
||||
else
|
||||
@ -238,7 +242,6 @@ void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){
|
||||
}
|
||||
else
|
||||
removeWater();
|
||||
|
||||
}
|
||||
|
||||
void RenderingManager::setWaterHeight(const float height)
|
||||
|
@ -110,12 +110,12 @@ namespace MWRender
|
||||
const int cellY = store->cell->getGridY();
|
||||
|
||||
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cellX, cellY);
|
||||
if ( land != NULL )
|
||||
if (land == NULL) // no land data means we're not going to create any terrain.
|
||||
return;
|
||||
|
||||
if (!land->dataLoaded)
|
||||
{
|
||||
if (!land->dataLoaded)
|
||||
{
|
||||
land->loadData();
|
||||
}
|
||||
land->loadData();
|
||||
}
|
||||
|
||||
//split the cell terrain into four segments
|
||||
@ -138,25 +138,18 @@ namespace MWRender
|
||||
mLandSize*mLandSize,
|
||||
MEMCATEGORY_GEOMETRY);
|
||||
|
||||
if ( land != NULL )
|
||||
//copy the height data row by row
|
||||
for ( int terrainCopyY = 0; terrainCopyY < mLandSize; terrainCopyY++ )
|
||||
{
|
||||
//copy the height data row by row
|
||||
for ( int terrainCopyY = 0; terrainCopyY < mLandSize; terrainCopyY++ )
|
||||
{
|
||||
//the offset of the current segment
|
||||
const size_t yOffset = y * (mLandSize-1) * ESM::Land::LAND_SIZE +
|
||||
//offset of the row
|
||||
terrainCopyY * ESM::Land::LAND_SIZE;
|
||||
const size_t xOffset = x * (mLandSize-1);
|
||||
//the offset of the current segment
|
||||
const size_t yOffset = y * (mLandSize-1) * ESM::Land::LAND_SIZE +
|
||||
//offset of the row
|
||||
terrainCopyY * ESM::Land::LAND_SIZE;
|
||||
const size_t xOffset = x * (mLandSize-1);
|
||||
|
||||
memcpy(&terrainData.inputFloat[terrainCopyY*mLandSize],
|
||||
&land->landData->heights[yOffset + xOffset],
|
||||
mLandSize*sizeof(float));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(terrainData.inputFloat, 0, mLandSize*mLandSize*sizeof(float));
|
||||
memcpy(&terrainData.inputFloat[terrainCopyY*mLandSize],
|
||||
&land->landData->heights[yOffset + xOffset],
|
||||
mLandSize*sizeof(float));
|
||||
}
|
||||
|
||||
std::map<uint16_t, int> indexes;
|
||||
@ -179,7 +172,7 @@ namespace MWRender
|
||||
terrain->setVisibilityFlags(RV_Terrain);
|
||||
terrain->setRenderQueueGroup(RQG_Main);
|
||||
|
||||
if ( land && land->landData->usingColours )
|
||||
if ( land->landData->usingColours )
|
||||
{
|
||||
// disable or enable global colour map (depends on available vertex colours)
|
||||
mActiveProfile->setGlobalColourMapEnabled(true);
|
||||
@ -196,10 +189,6 @@ namespace MWRender
|
||||
//mat = terrain->_getCompositeMapMaterial();
|
||||
//mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName( vertex->getName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
mActiveProfile->setGlobalColourMapEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -215,8 +204,10 @@ namespace MWRender
|
||||
{
|
||||
for ( int y = 0; y < 2; y++ )
|
||||
{
|
||||
mTerrainGroup.unloadTerrain(store->cell->getGridX() * 2 + x,
|
||||
store->cell->getGridY() * 2 + y);
|
||||
int terrainX = store->cell->getGridX() * 2 + x;
|
||||
int terrainY = store->cell->getGridY() * 2 + y;
|
||||
if (mTerrainGroup.getTerrain(terrainX, terrainY) != NULL)
|
||||
mTerrainGroup.unloadTerrain(terrainX, terrainY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -433,7 +433,10 @@ namespace MWSound
|
||||
total = 0;
|
||||
}
|
||||
|
||||
const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.find(regionName);
|
||||
const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.search(regionName);
|
||||
if (regn == NULL)
|
||||
return;
|
||||
|
||||
std::vector<ESM::Region::SoundRef>::const_iterator soundIter;
|
||||
if(total == 0)
|
||||
{
|
||||
|
@ -265,6 +265,11 @@ MWWorld::ContainerStoreIterator::ContainerStoreIterator (int mask, ContainerStor
|
||||
: mType (0), mMask (mask), mContainer (container)
|
||||
{
|
||||
nextType();
|
||||
|
||||
if (mType==-1 || (**this).getRefData().getCount())
|
||||
return;
|
||||
|
||||
++*this;
|
||||
}
|
||||
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList<ESM::Potion, RefData>::List::iterator iterator)
|
||||
@ -311,7 +316,7 @@ void MWWorld::ContainerStoreIterator::nextType()
|
||||
{
|
||||
incType();
|
||||
|
||||
if (mType & mMask)
|
||||
if ((mType & mMask) && mType>0)
|
||||
if (resetIterator())
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user