mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 03:15:32 +00:00
Merge remote branch 'zini/master' into sound
This commit is contained in:
commit
33a63d88a5
3 changed files with 37 additions and 9 deletions
|
@ -142,8 +142,8 @@ namespace MWScript
|
||||||
InterpreterContext& context
|
InterpreterContext& context
|
||||||
= static_cast<InterpreterContext&> (runtime.getContext());
|
= static_cast<InterpreterContext&> (runtime.getContext());
|
||||||
|
|
||||||
const ESM::Cell *cell = context.getWorld().getPlayer().getPlayer().getCell()->cell;
|
MWWorld::Ptr::CellStore *cell = context.getWorld().getPlayer().getPlayer().getCell();
|
||||||
runtime.push (cell->water);
|
runtime.push (cell->mWaterLevel);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -441,6 +441,27 @@ void OpenAL_Output::init(const std::string &devname)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ALCuint maxtotal = std::min<ALCuint>(maxmono+maxstereo, 256);
|
ALCuint maxtotal = std::min<ALCuint>(maxmono+maxstereo, 256);
|
||||||
|
if (maxtotal == 0) // workaround for broken implementations
|
||||||
|
{
|
||||||
|
maxtotal = 256;
|
||||||
|
bool stop = false;
|
||||||
|
for(size_t i = 0;i < maxtotal && !stop;i++) // generate source until error returned
|
||||||
|
{
|
||||||
|
ALuint src = 0;
|
||||||
|
alGenSources(1, &src);
|
||||||
|
ALenum err = alGetError();
|
||||||
|
if(err != AL_NO_ERROR)
|
||||||
|
{
|
||||||
|
stop = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mFreeSources.push_back(src);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // normal case
|
||||||
|
{
|
||||||
for(size_t i = 0;i < maxtotal;i++)
|
for(size_t i = 0;i < maxtotal;i++)
|
||||||
{
|
{
|
||||||
ALuint src = 0;
|
ALuint src = 0;
|
||||||
|
@ -449,6 +470,7 @@ void OpenAL_Output::init(const std::string &devname)
|
||||||
mFreeSources.push_back(src);
|
mFreeSources.push_back(src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch(std::exception &e)
|
catch(std::exception &e)
|
||||||
{
|
{
|
||||||
std::cout <<"Error: "<<e.what()<<", trying to continue"<< std::endl;
|
std::cout <<"Error: "<<e.what()<<", trying to continue"<< std::endl;
|
||||||
|
|
|
@ -21,8 +21,14 @@ void Cell::load(ESMReader &esm)
|
||||||
if (data.flags & Interior)
|
if (data.flags & Interior)
|
||||||
{
|
{
|
||||||
// Interior cells
|
// Interior cells
|
||||||
|
if (esm.isNextSub("INTV"))
|
||||||
esm.getHNT(water, "WHGT", 4);
|
{
|
||||||
|
int waterl;
|
||||||
|
esm.getHT(waterl);
|
||||||
|
water = (float) waterl;
|
||||||
|
}
|
||||||
|
else if (esm.isNextSub("WHGT"))
|
||||||
|
esm.getHT(water);
|
||||||
|
|
||||||
// Quasi-exterior cells have a region (which determines the
|
// Quasi-exterior cells have a region (which determines the
|
||||||
// weather), pure interior cells have ambient lighting
|
// weather), pure interior cells have ambient lighting
|
||||||
|
|
Loading…
Reference in a new issue