mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 04:15:31 +00:00
Merge pull request #429 from OpenMW/master
Add OpenMW commits up to 16 May 2018
This commit is contained in:
commit
dc9a3bf73f
4 changed files with 17 additions and 10 deletions
|
@ -1368,13 +1368,15 @@ QVariant CSMWorld::CreatureAttackRefIdAdapter::getNestedData (const RefIdColumn
|
|||
|
||||
const ESM::Creature& creature = record.get();
|
||||
|
||||
if (subRowIndex < 0 || subRowIndex > 2 || subColIndex < 0 || subColIndex > 2)
|
||||
if (subRowIndex < 0 || subRowIndex > 2)
|
||||
throw std::runtime_error ("index out of range");
|
||||
|
||||
if (subColIndex == 0)
|
||||
return subRowIndex + 1;
|
||||
else if (subColIndex < 3) // 1 or 2
|
||||
else if (subColIndex == 1 || subColIndex == 2)
|
||||
return creature.mData.mAttack[(subRowIndex * 2) + (subColIndex - 1)];
|
||||
else
|
||||
throw std::runtime_error ("index out of range");
|
||||
}
|
||||
|
||||
void CSMWorld::CreatureAttackRefIdAdapter::setNestedData (const RefIdColumn *column,
|
||||
|
|
|
@ -325,7 +325,10 @@ namespace MWClass
|
|||
// add reach and attack speed for melee weapon
|
||||
if (ref->mBase->mData.mType < 9 && Settings::Manager::getBool("show melee info", "Game"))
|
||||
{
|
||||
text += MWGui::ToolTips::getPercentString(ref->mBase->mData.mReach, "#{sRange}");
|
||||
// 64 game units = 1 yard = 3 ft, display value in feet
|
||||
const float combatDistance = store.get<ESM::GameSetting>().find("fCombatDistance")->getFloat() * ref->mBase->mData.mReach;
|
||||
text += MWGui::ToolTips::getWeightString(combatDistance*3/64, "#{sRange}");
|
||||
text += " #{sFeet}";
|
||||
|
||||
text += MWGui::ToolTips::getPercentString(ref->mBase->mData.mSpeed, "#{sAttributeSpeed}");
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace MWRender
|
|||
{
|
||||
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 texelX = (x-mMinX) * mCellSize + cellX;
|
||||
|
@ -158,9 +158,9 @@ namespace MWRender
|
|||
|
||||
float y2 = 0;
|
||||
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
|
||||
y2 = (SCHAR_MIN << 4) / 2048.f;
|
||||
y2 = SCHAR_MIN / 128.f;
|
||||
if (y2 < 0)
|
||||
{
|
||||
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();
|
||||
|
||||
std::vector<char> data;
|
||||
ALenum format;
|
||||
int srate;
|
||||
ALenum format = AL_NONE;
|
||||
int srate = 0;
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
DecoderPtr decoder = mManager.getDecoder();
|
||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue