Skip to content

Commit

Permalink
Merge branch 'master' into pineapple/fix-video-incomplete-type-2
Browse files Browse the repository at this point in the history
Resolve merge issues related to CHANGELOG.md

* master:
  Optimize skinning (task #4605)
  Update changelog
  Update some comments
  Set the OpenAL source offset after setting the buffer
  Make Move and MoveWorld console commands move actors standing on moving object (bug OpenMW#2274)
  Adding Changelog entry
  Allow messageboxes arguments to have newline characters (bug #3836)
  Check for impact immediately when launch a projectile (bug OpenMW#3059)
  Fix gold count calculation in pickupObject (bug #4604)
  Correct special case soundgen comparisons
  Move "land" check earlier
  Fixes #3681
  Play landing sound manually and ignore land soundgen textkeys (bug OpenMW#2256)
  Make some more optimizations to actor processing loops
  Fix freeze in getActorsSidingWith
  Addiong missing "to" word
  Adding common problems that were previous on the site FAQ
  Treat <> and << operators as < and  >< and >> as > in scripts
  stage1: priorities for event music and other minor improvements to the music system

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
pineapplemachine committed Aug 26, 2018
2 parents 9e253f6 + 327f36b commit a1e076a
Show file tree
Hide file tree
Showing 20 changed files with 257 additions and 120 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Bug #1990: Sunrise/sunset not set correct
Bug #2131: Lustidrike's spell misses the player every time
Bug #2222: Fatigue's effect on selling price is backwards
Bug #2256: Landing sound not playing when jumping immediately after landing
Bug #2274: Thin platform clips through player character instead of lifting
Bug #2326: After a bound item expires the last equipped item of that type is not automatically re-equipped
Bug #2455: Creatures attacks degrade armor
Bug #2562: Forcing AI to activate a teleport door sometimes causes a crash
Expand All @@ -15,14 +17,17 @@
Bug #2872: Tab completion in console doesn't work with explicit reference
Bug #2971: Compiler did not reject lines with naked expressions beginning with x.y
Bug #3049: Drain and Fortify effects are not properly applied on health, magicka and fatigue
Bug #3059: Unable to hit with marksman weapons when too close to an enemy
Bug #3072: Fatal error on AddItem <item> that has a script containing Equip <item>
Bug #3249: Fixed revert function not updating views properly
Bug #3374: Touch spells not hitting kwama foragers
Bug #3486: [Mod] NPC Commands does not work
Bug #3533: GetSpellEffects should detect effects with zero duration
Bug #3591: Angled hit distance too low
Bug #3629: DB assassin attack never triggers creature spawning
Bug #3681: OpenMW-CS: Clicking Scripts in Preferences spawns many color pickers
Bug #3788: GetPCInJail and GetPCTraveling do not work as in vanilla
Bug #3836: Script fails to compile when command argument contains "\n"
Bug #3876: Landscape texture painting is misaligned
Bug #3897: Have Goodbye give all choices the effects of Goodbye
Bug #3911: [macOS] Typing in the "Content List name" dialog box produces double characters
Expand Down Expand Up @@ -98,6 +103,8 @@
Bug #4575: Weird result of attack animation blending with movement animations
Bug #4576: Reset of idle animations when attack can not be started
Bug #4591: Attack strength should be 0 if player did not hold the attack button
Bug #4597: <> operator causes a compile error
Bug #4604: Picking up gold from the ground only makes 1 grabbed
Feature #1645: Casting effects from objects
Feature #2606: Editor: Implemented (optional) case sensitive global search
Feature #3083: Play animation when NPC is casting spell via script
Expand All @@ -123,6 +130,8 @@
Feature #4581: Use proper logging system
Task #2490: Don't open command prompt window on Release-mode builds automatically
Task #4545: Enable is_pod string test
Task #4605: Optimize skinning
Task #4606: Support Rapture3D's OpenAL driver
Task #4613: Incomplete type errors when compiling with g++ on OSX 10.9

0.44.0
Expand Down
19 changes: 1 addition & 18 deletions apps/opencs/view/widget/coloreditor.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#include "coloreditor.hpp"

#include <QApplication>
#include <QColor>
#include <QColorDialog>
#include <QDesktopWidget>
#include <QPainter>
#include <QRect>
#include <QShowEvent>

#include "colorpickerpopup.hpp"
Expand All @@ -27,9 +25,7 @@ CSVWidget::ColorEditor::ColorEditor(QWidget *parent, const bool popupOnStart)
mColorPicker(new ColorPickerPopup(this)),
mPopupOnStart(popupOnStart)
{
setCheckable(true);
connect(this, SIGNAL(clicked()), this, SLOT(showPicker()));
connect(mColorPicker, SIGNAL(hid()), this, SLOT(pickerHid()));
connect(mColorPicker, SIGNAL(colorChanged(const QColor &)), this, SLOT(pickerColorChanged(const QColor &)));
}

Expand Down Expand Up @@ -85,20 +81,7 @@ void CSVWidget::ColorEditor::setColor(const int colorInt)

void CSVWidget::ColorEditor::showPicker()
{
if (isChecked())
{
mColorPicker->showPicker(calculatePopupPosition(), mColor);
}
else
{
mColorPicker->hide();
}
}

void CSVWidget::ColorEditor::pickerHid()
{
setChecked(false);
emit pickingFinished();
mColorPicker->showPicker(calculatePopupPosition(), mColor);
}

void CSVWidget::ColorEditor::pickerColorChanged(const QColor &color)
Expand Down
1 change: 0 additions & 1 deletion apps/opencs/view/widget/coloreditor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ namespace CSVWidget

private slots:
void showPicker();
void pickerHid();
void pickerColorChanged(const QColor &color);

signals:
Expand Down
13 changes: 3 additions & 10 deletions apps/opencs/view/widget/colorpickerpopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <QPushButton>
#include <QEvent>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QLayout>
#include <QStyleOption>

Expand All @@ -19,7 +18,6 @@ CSVWidget::ColorPickerPopup::ColorPickerPopup(QWidget *parent)
mColorPicker->setWindowFlags(Qt::Widget);
mColorPicker->setOptions(QColorDialog::NoButtons | QColorDialog::DontUseNativeDialog);
mColorPicker->installEventFilter(this);
mColorPicker->open();
connect(mColorPicker,
SIGNAL(currentColorChanged(const QColor &)),
this,
Expand All @@ -39,8 +37,9 @@ void CSVWidget::ColorPickerPopup::showPicker(const QPoint &position, const QColo
geometry.moveTo(position);
setGeometry(geometry);

mColorPicker->setCurrentColor(initialColor);
show();
// Calling getColor() creates a blocking dialog that will continue execution once the user chooses OK or Cancel
QColor color = mColorPicker->getColor(initialColor);
mColorPicker->setCurrentColor(color);
}

void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent *event)
Expand All @@ -63,12 +62,6 @@ void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent *event)
QFrame::mousePressEvent(event);
}

void CSVWidget::ColorPickerPopup::hideEvent(QHideEvent *event)
{
QFrame::hideEvent(event);
emit hid();
}

bool CSVWidget::ColorPickerPopup::eventFilter(QObject *object, QEvent *event)
{
if (object == mColorPicker && event->type() == QEvent::KeyPress)
Expand Down
2 changes: 0 additions & 2 deletions apps/opencs/view/widget/colorpickerpopup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ namespace CSVWidget

protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void hideEvent(QHideEvent *event);
virtual bool eventFilter(QObject *object, QEvent *event);

signals:
void hid();
void colorChanged(const QColor &color);
};
}
Expand Down
5 changes: 3 additions & 2 deletions apps/openmw/mwbase/world.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ namespace MWBase
/// @note throws an exception when invoked on a teleport door
virtual void activateDoor(const MWWorld::Ptr& door, int state) = 0;

virtual void getActorsStandingOn (const MWWorld::ConstPtr& object, std::vector<MWWorld::Ptr> &actors) = 0; ///< get a list of actors standing on \a object
virtual bool getPlayerStandingOn (const MWWorld::ConstPtr& object) = 0; ///< @return true if the player is standing on \a object
virtual bool getActorStandingOn (const MWWorld::ConstPtr& object) = 0; ///< @return true if any actor is standing on \a object
virtual bool getPlayerCollidingWith(const MWWorld::ConstPtr& object) = 0; ///< @return true if the player is colliding with \a object
Expand Down Expand Up @@ -490,8 +491,8 @@ namespace MWBase
virtual void castSpell (const MWWorld::Ptr& actor, bool manualSpell=false) = 0;

virtual void launchMagicBolt (const std::string& spellId, const MWWorld::Ptr& caster, const osg::Vec3f& fallbackDirection) = 0;
virtual void launchProjectile (MWWorld::Ptr actor, MWWorld::ConstPtr projectile,
const osg::Vec3f& worldPos, const osg::Quat& orient, MWWorld::Ptr bow, float speed, float attackStrength) = 0;
virtual void launchProjectile (MWWorld::Ptr& actor, MWWorld::Ptr& projectile,
const osg::Vec3f& worldPos, const osg::Quat& orient, MWWorld::Ptr& bow, float speed, float attackStrength) = 0;

virtual void applyLoopingParticles(const MWWorld::Ptr& ptr) = 0;

Expand Down
7 changes: 3 additions & 4 deletions apps/openmw/mwclass/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,11 +1241,10 @@ namespace MWClass
{
MWBase::World *world = MWBase::Environment::get().getWorld();
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
if (world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
return "DefaultLandWater";
if(world->isOnGround(ptr))
return "DefaultLand";
return "";

return "DefaultLand";
}
if(name == "swimleft")
return "Swim Left";
Expand Down
2 changes: 2 additions & 0 deletions apps/openmw/mwgui/inventorywindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ namespace MWGui
return;

int count = object.getRefData().getCount();
if (object.getClass().isGold(object))
count *= object.getClass().getValue(object);

MWWorld::Ptr player = MWMechanics::getPlayer();
MWBase::Environment::get().getWorld()->breakInvisibility(player);
Expand Down
20 changes: 12 additions & 8 deletions apps/openmw/mwmechanics/actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,8 @@ namespace MWMechanics
if (iteratedActor == getPlayer())
continue;

const bool sameActor = (iteratedActor == actor);

const CreatureStats &stats = iteratedActor.getClass().getCreatureStats(iteratedActor);
if (stats.isDead())
continue;
Expand All @@ -1790,14 +1792,13 @@ namespace MWMechanics
// Actors that are targeted by this actor's Follow or Escort packages also side with them
for (auto package = stats.getAiSequence().begin(); package != stats.getAiSequence().end(); ++package)
{
const MWWorld::Ptr &target = (*package)->getTarget();
if ((*package)->sideWithTarget() && !target.isEmpty())
if ((*package)->sideWithTarget() && !(*package)->getTarget().isEmpty())
{
if (iteratedActor == actor)
if (sameActor)
{
list.push_back(target);
list.push_back((*package)->getTarget());
}
else if (target == actor)
else if ((*package)->getTarget() == actor)
{
list.push_back(iteratedActor);
}
Expand All @@ -1816,7 +1817,7 @@ namespace MWMechanics
for(PtrActorMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
{
const MWWorld::Ptr &iteratedActor = iter->first;
if (iteratedActor == getPlayer())
if (iteratedActor == getPlayer() || iteratedActor == actor)
continue;

const CreatureStats &stats = iteratedActor.getClass().getCreatureStats(iteratedActor);
Expand Down Expand Up @@ -1879,7 +1880,7 @@ namespace MWMechanics
for(PtrActorMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
{
const MWWorld::Ptr &iteratedActor = iter->first;
if (iteratedActor == getPlayer())
if (iteratedActor == getPlayer() || iteratedActor == actor)
continue;

const CreatureStats &stats = iteratedActor.getClass().getCreatureStats(iteratedActor);
Expand Down Expand Up @@ -1909,8 +1910,11 @@ namespace MWMechanics
getObjectsInRange(position, aiProcessingDistance, neighbors);
for(auto neighbor = neighbors.begin(); neighbor != neighbors.end(); ++neighbor)
{
if (*neighbor == actor)
continue;

const CreatureStats &stats = neighbor->getClass().getCreatureStats(*neighbor);
if (stats.isDead() || *neighbor == actor)
if (stats.isDead())
continue;

if (stats.getAiSequence().isInCombat(actor))
Expand Down
11 changes: 10 additions & 1 deletion apps/openmw/mwmechanics/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,14 @@ void CharacterController::handleTextKey(const std::string &groupname, const std:
}
}

if (soundgen == "land") // Morrowind ignores land soundgen for some reason
return;

std::string sound = mPtr.getClass().getSoundIdFromSndGen(mPtr, soundgen);
if(!sound.empty())
{
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
if(evt.compare(10, evt.size()-10, "left") == 0 || evt.compare(10, evt.size()-10, "right") == 0 || evt.compare(10, evt.size()-10, "land") == 0)
if(soundgen == "left" || soundgen == "right")
{
// Don't make foot sounds local for the player, it makes sense to keep them
// positioned on the ground.
Expand Down Expand Up @@ -2027,6 +2030,12 @@ void CharacterController::update(float duration)
cls.skillUsageSucceeded(mPtr, ESM::Skill::Acrobatics, 1);
}
}

// Play landing sound
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
std::string sound = cls.getSoundIdFromSndGen(mPtr, "land");
if (!sound.empty())
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
}
else
{
Expand Down
9 changes: 6 additions & 3 deletions apps/openmw/mwrender/weaponanimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ void WeaponAnimation::releaseArrow(MWWorld::Ptr actor, float attackStrength)
float fThrownWeaponMaxSpeed = gmst.find("fThrownWeaponMaxSpeed")->getFloat();
float speed = fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * attackStrength;

MWBase::Environment::get().getWorld()->launchProjectile(actor, *weapon, launchPos, orient, *weapon, speed, attackStrength);
MWWorld::Ptr weaponPtr = *weapon;
MWBase::Environment::get().getWorld()->launchProjectile(actor, weaponPtr, launchPos, orient, weaponPtr, speed, attackStrength);

showWeapon(false);

Expand All @@ -149,9 +150,11 @@ void WeaponAnimation::releaseArrow(MWWorld::Ptr actor, float attackStrength)
float fProjectileMaxSpeed = gmst.find("fProjectileMaxSpeed")->getFloat();
float speed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * attackStrength;

MWBase::Environment::get().getWorld()->launchProjectile(actor, *ammo, launchPos, orient, *weapon, speed, attackStrength);
MWWorld::Ptr weaponPtr = *weapon;
MWWorld::Ptr ammoPtr = *ammo;
MWBase::Environment::get().getWorld()->launchProjectile(actor, ammoPtr, launchPos, orient, weaponPtr, speed, attackStrength);

inv.remove(*ammo, 1, actor);
inv.remove(ammoPtr, 1, actor);
mAmmunition.reset();
}
}
Expand Down
35 changes: 25 additions & 10 deletions apps/openmw/mwscript/transformationextensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ namespace MWScript
{
namespace Transformation
{
void moveStandingActors(const MWWorld::Ptr &ptr, const osg::Vec3f& diff)
{
std::vector<MWWorld::Ptr> actors;
MWBase::Environment::get().getWorld()->getActorsStandingOn (ptr, actors);
for (auto& actor : actors)
{
osg::Vec3f actorPos(actor.getRefData().getPosition().asVec3());
actorPos += diff;
MWBase::Environment::get().getWorld()->moveObject(actor, actorPos.x(), actorPos.y(), actorPos.z());
}
}

template<class R>
class OpSetScale : public Interpreter::Opcode0
{
Expand Down Expand Up @@ -666,6 +678,10 @@ namespace MWScript
osg::Vec3f diff = ptr.getRefData().getBaseNode()->getAttitude() * posChange;
osg::Vec3f worldPos(ptr.getRefData().getPosition().asVec3());
worldPos += diff;

// We should move actors, standing on moving object, too.
// This approach can be used to create elevators.
moveStandingActors(ptr, diff);
MWBase::Environment::get().getWorld()->moveObject(ptr, worldPos.x(), worldPos.y(), worldPos.z());
}
};
Expand All @@ -688,22 +704,21 @@ namespace MWScript
runtime.pop();

const float *objPos = ptr.getRefData().getPosition().pos;
osg::Vec3f diff;

MWWorld::Ptr updated;
if (axis == "x")
{
updated = MWBase::Environment::get().getWorld()->moveObject(ptr, objPos[0]+movement, objPos[1], objPos[2]);
}
diff.x() += movement;
else if (axis == "y")
{
updated = MWBase::Environment::get().getWorld()->moveObject(ptr, objPos[0], objPos[1]+movement, objPos[2]);
}
diff.y() += movement;
else if (axis == "z")
{
updated = MWBase::Environment::get().getWorld()->moveObject(ptr, objPos[0], objPos[1], objPos[2]+movement);
}
diff.z() += movement;
else
throw std::runtime_error ("invalid movement axis: " + axis);

// We should move actors, standing on moving object, too.
// This approach can be used to create elevators.
moveStandingActors(ptr, diff);
MWBase::Environment::get().getWorld()->moveObject(ptr, objPos[0]+diff.x(), objPos[1]+diff.y(), objPos[2]+diff.z());
}
};

Expand Down
Loading

0 comments on commit a1e076a

Please sign in to comment.