forked from mirror/openmw-tes3mp
commit
67c381df4e
2 changed files with 9 additions and 7 deletions
|
@ -125,7 +125,7 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
for (int cellX=0; cellX<mCellSize; ++cellX)
|
for (int cellX=0; cellX<mCellSize; ++cellX)
|
||||||
{
|
{
|
||||||
int vertexX = static_cast<int>(float(cellX)/float(mCellSize) * 9);
|
int vertexX = static_cast<int>(float(cellX) / float(mCellSize) * 9);
|
||||||
int vertexY = static_cast<int>(float(cellY) / float(mCellSize) * 9);
|
int vertexY = static_cast<int>(float(cellY) / float(mCellSize) * 9);
|
||||||
|
|
||||||
int texelX = (x-mMinX) * mCellSize + cellX;
|
int texelX = (x-mMinX) * mCellSize + cellX;
|
||||||
|
@ -135,9 +135,9 @@ namespace MWRender
|
||||||
|
|
||||||
float y2 = 0;
|
float y2 = 0;
|
||||||
if (land && (land->mDataTypes & ESM::Land::DATA_WNAM))
|
if (land && (land->mDataTypes & ESM::Land::DATA_WNAM))
|
||||||
y2 = (land->mWnam[vertexY * 9 + vertexX] << 4) / 2048.f;
|
y2 = land->mWnam[vertexY * 9 + vertexX] / 128.f;
|
||||||
else
|
else
|
||||||
y2 = (SCHAR_MIN << 4) / 2048.f;
|
y2 = SCHAR_MIN / 128.f;
|
||||||
if (y2 < 0)
|
if (y2 < 0)
|
||||||
{
|
{
|
||||||
r = static_cast<unsigned char>(14 * y2 + 38);
|
r = static_cast<unsigned char>(14 * y2 + 38);
|
||||||
|
|
|
@ -951,10 +951,11 @@ std::pair<Sound_Handle,size_t> OpenAL_Output::loadSound(const std::string &fname
|
||||||
getALError();
|
getALError();
|
||||||
|
|
||||||
std::vector<char> data;
|
std::vector<char> data;
|
||||||
ALenum format;
|
ALenum format = AL_NONE;
|
||||||
int srate;
|
int srate = 0;
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
DecoderPtr decoder = mManager.getDecoder();
|
DecoderPtr decoder = mManager.getDecoder();
|
||||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
||||||
if(decoder->mResourceMgr->exists(fname))
|
if(decoder->mResourceMgr->exists(fname))
|
||||||
|
@ -974,7 +975,8 @@ std::pair<Sound_Handle,size_t> OpenAL_Output::loadSound(const std::string &fname
|
||||||
format = getALFormat(chans, type);
|
format = getALFormat(chans, type);
|
||||||
if(format) decoder->readAll(data);
|
if(format) decoder->readAll(data);
|
||||||
}
|
}
|
||||||
catch(std::exception &e) {
|
catch(std::exception &e)
|
||||||
|
{
|
||||||
std::cerr<< "Failed to load audio from "<<fname<<": "<<e.what() <<std::endl;
|
std::cerr<< "Failed to load audio from "<<fname<<": "<<e.what() <<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue