Merge branch 'next' into quick_keys

actorid
scrawl 13 years ago
commit 5ebcaeb098

@ -115,7 +115,9 @@ endif()
if(APPLE)
find_library(CARBON_FRAMEWORK Carbon)
target_link_libraries(openmw ${CARBON_FRAMEWORK})
find_library(COCOA_FRAMEWORK Cocoa)
find_library(IOKIT_FRAMEWORK IOKit)
target_link_libraries(openmw ${CARBON_FRAMEWORK} ${COCOA_FRAMEWORK} ${IOKIT_FRAMEWORK})
endif(APPLE)
if(DPKG_PROGRAM)

@ -254,7 +254,6 @@ namespace MWBase
virtual bool toggleVanityMode(bool enable, bool force) = 0;
virtual void allowVanityMode(bool allow) = 0;
virtual void togglePlayerLooking(bool enable) = 0;
virtual bool isVanityEnabled() = 0;
virtual void renderPlayer() = 0;
};

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -63,10 +62,12 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Apparatus::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(
new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Apparatus::getScript (const MWWorld::Ptr& ptr) const

@ -7,7 +7,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -66,10 +65,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Armor::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
bool Armor::hasItemHealth (const MWWorld::Ptr& ptr) const
@ -271,9 +271,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Armor::use (const MWWorld::Ptr& ptr) const
{
MWBase::Environment::get().getSoundManager()->playSound (getUpSoundId(ptr), 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionEquip(ptr));
return action;
}
MWWorld::Ptr

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -62,12 +61,13 @@ namespace MWClass
}
boost::shared_ptr<MWWorld::Action> Clothing::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Clothing::getScript (const MWWorld::Ptr& ptr) const
@ -222,9 +222,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Clothing::use (const MWWorld::Ptr& ptr) const
{
MWBase::Environment::get().getSoundManager()->playSound (getUpSoundId(ptr), 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionEquip(ptr));
return action;
}
MWWorld::Ptr

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -93,8 +92,9 @@ namespace MWClass
{
// TODO check for key
std::cout << "Locked container" << std::endl;
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, lockedSound, 1.0, 1.0);
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::NullAction);
action->setSound(lockedSound);
return action;
}
else
{
@ -109,9 +109,10 @@ namespace MWClass
{
// Trap activation goes here
std::cout << "Activated trap: " << ptr.getCellRef().trap << std::endl;
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, trapActivationSound, 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::NullAction);
action->setSound(trapActivationSound);
ptr.getCellRef().trap = "";
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
return action;
}
}
}

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/player.hpp"
@ -80,17 +79,25 @@ namespace MWClass
// TODO check for key
// TODO report failure to player (message, sound?). Look up behaviour of original MW.
std::cout << "Locked!" << std::endl;
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, lockedSound, 1.0, 1.0);
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::NullAction);
action->setSound(lockedSound);
return action;
}
if(!ptr.getCellRef().trap.empty())
{
// Trap activation
std::cout << "Activated trap: " << ptr.getCellRef().trap << std::endl;
MWBase::Environment::get().getSoundManager()->playSound3D(ptr, trapActivationSound, 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::NullAction);
action->setSound(trapActivationSound);
ptr.getCellRef().trap = "";
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
return action;
}
if (ref->ref.teleport)
@ -99,11 +106,11 @@ namespace MWClass
/// \todo remove this if clause once ActionTeleport can also support other actors
if (MWBase::Environment::get().getWorld()->getPlayer().getPlayer()==actor)
{
// the player is using the door
// The reason this is not 3D is that it would get interrupted when you teleport
MWBase::Environment::get().getSoundManager()->playSound(openSound, 1.0, 1.0);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTeleport (ref->ref.destCell, ref->ref.doorDest));
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ref->ref.destCell, ref->ref.doorDest));
action->setSound(openSound);
return action;
}
else
{
@ -117,8 +124,11 @@ namespace MWClass
// TODO return action for rotating the door
// This is a little pointless, but helps with testing
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, openSound, 1.0, 1.0);
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::NullAction);
action->setSound(openSound);
return action;
}
}

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -62,10 +61,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Ingredient::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Ingredient::getScript (const MWWorld::Ptr& ptr) const

@ -94,10 +94,11 @@ namespace MWClass
if (!(ref->base->data.flags & ESM::Light::Carry))
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Light::getScript (const MWWorld::Ptr& ptr) const
@ -191,9 +192,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Light::use (const MWWorld::Ptr& ptr) const
{
MWBase::Environment::get().getSoundManager()->playSound (getUpSoundId(ptr), 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionEquip(ptr));
return action;
}
MWWorld::Ptr

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -64,10 +63,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Lockpick::getScript (const MWWorld::Ptr& ptr) const
@ -160,9 +160,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Lockpick::use (const MWWorld::Ptr& ptr) const
{
MWBase::Environment::get().getSoundManager()->playSound (getUpSoundId(ptr), 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionEquip(ptr));
return action;
}
MWWorld::Ptr

@ -7,7 +7,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -67,10 +66,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Miscellaneous::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Miscellaneous::getScript (const MWWorld::Ptr& ptr) const

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -64,10 +63,12 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Potion::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(
new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound (getUpSoundId(ptr));
return action;
}
std::string Potion::getScript (const MWWorld::Ptr& ptr) const

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -63,10 +62,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Probe::getScript (const MWWorld::Ptr& ptr) const
@ -159,9 +159,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Probe::use (const MWWorld::Ptr& ptr) const
{
MWBase::Environment::get().getSoundManager()->playSound (getUpSoundId(ptr), 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionEquip(ptr));
return action;
}
MWWorld::Ptr

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -62,10 +61,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Repair::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
std::string Repair::getScript (const MWWorld::Ptr& ptr) const

@ -5,7 +5,6 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/ptr.hpp"
@ -64,10 +63,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Weapon::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
action->setSound(getUpSoundId(ptr));
return action;
}
bool Weapon::hasItemHealth (const MWWorld::Ptr& ptr) const
@ -360,9 +360,11 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Weapon::use (const MWWorld::Ptr& ptr) const
{
MWBase::Environment::get().getSoundManager()->playSound (getUpSoundId(ptr), 1.0, 1.0);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionEquip(ptr));
return action;
}
MWWorld::Ptr

@ -424,8 +424,15 @@ namespace MWInput
bool InputManager::keyPressed( const OIS::KeyEvent &arg )
{
mInputCtrl->keyPressed (arg);
unsigned int text = arg.text;
#ifdef __APPLE__ // filter \016 symbol for F-keys on OS X
if ((arg.key >= OIS::KC_F1 && arg.key <= OIS::KC_F10) ||
(arg.key >= OIS::KC_F11 && arg.key <= OIS::KC_F15)) {
text = 0;
}
#endif
MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::Enum(arg.key), arg.text);
MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::Enum(arg.key), text);
return true;
}

@ -107,10 +107,6 @@ namespace MWRender
void getSightAngles(float &pitch, float &yaw);
void togglePlayerLooking(bool enable);
bool isVanityEnabled() {
return mVanity.enabled;
}
};
}

@ -68,10 +68,6 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
return mPlayer->toggleVanityMode(enable, force);
}
bool isVanityEnabled() {
return mPlayer->isVanityEnabled();
}
void allowVanityMode(bool allow) {
mPlayer->allowVanityMode(allow);
}

@ -209,6 +209,8 @@ namespace MWScript
class OpToggleVanityMode : public Interpreter::Opcode0
{
static bool sActivate;
public:
virtual void execute(Interpreter::Runtime &runtime)
@ -219,16 +221,17 @@ namespace MWScript
MWBase::World *world =
MWBase::Environment::get().getWorld();
bool value = !world->isVanityEnabled();
if (world->toggleVanityMode(value, true)) {
if (world->toggleVanityMode(sActivate, true)) {
context.report(
(value) ? "Vanity Mode -> On" : "Vanity Mode -> Off"
(sActivate) ? "Vanity Mode -> On" : "Vanity Mode -> Off"
);
sActivate = !sActivate;
} else {
context.report("Vanity Mode -> No");
}
}
};
bool OpToggleVanityMode::sActivate = true;
const int opcodeXBox = 0x200000c;
const int opcodeOnActivate = 0x200000d;

@ -2,17 +2,31 @@
#include "action.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
MWWorld::Action::Action() {}
MWWorld::Action::Action (bool teleport) : mTeleport (teleport)
{}
MWWorld::Action::~Action() {}
void MWWorld::Action::execute (const Ptr& actor)
{
if (!mSoundId.empty())
MWBase::Environment::get().getSoundManager()->playSound3D (actor, mSoundId, 1.0, 1.0,
MWBase::SoundManager::Play_NoTrack);
{
if (mTeleport == true)
{
//this is a teleport action, so we need to call playSound
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
MWBase::SoundManager::Play_NoTrack);
}
else
{
MWBase::Environment::get().getSoundManager()->playSound3D (actor, mSoundId, 1.0, 1.0,
MWBase::SoundManager::Play_NoTrack);
}
}
executeImp (actor);
}

@ -11,6 +11,7 @@ namespace MWWorld
class Action
{
std::string mSoundId;
bool mTeleport;
// not implemented
Action (const Action& action);
@ -18,9 +19,10 @@ namespace MWWorld
virtual void executeImp (const Ptr& actor) = 0;
public:
public:
Action();
Action (bool teleport = false);
///< \param teleport action will teleport the actor
virtual ~Action();

@ -8,8 +8,9 @@ namespace MWWorld
{
ActionTeleport::ActionTeleport (const std::string& cellName,
const ESM::Position& position)
: mCellName (cellName), mPosition (position)
{}
: Action (true), mCellName (cellName), mPosition (position)
{
}
void ActionTeleport::executeImp (const Ptr& actor)
{

@ -298,10 +298,6 @@ namespace MWWorld
}
virtual void renderPlayer();
virtual bool isVanityEnabled() {
return mRendering->isVanityEnabled();
}
};
}

File diff suppressed because it is too large Load Diff

@ -16,6 +16,7 @@ Artem Kotsynyak (greye)
athile
BrotherBrick
Cris Mihalache (Mirceam)
Douglas Diniz (Dgdiniz)
Eli2
gugus / gus
Jacob Essex (Yacoby)

@ -112,6 +112,7 @@ Bug #341: Building with Ogre Debug libraries does not use debug version of plugi
Bug #347: Crash when running openmw with --start="XYZ"
Bug #353: FindMyGUI.cmake breaks path on Windows
Bug #359: WindowManager throws exception at destruction
Bug #364: Laggy input on OS X due to bug in Ogre's event pump implementation
Feature #33: Allow objects to cross cell-borders
Feature #59: Dropping Items (replaced stopgap implementation with a proper one)
Feature #93: Main Menu

Loading…
Cancel
Save