1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-19 01:39:39 +00:00

Merge remote-tracking branch 'greye/rc0-17'

This commit is contained in:
Marc Zinnschlag 2012-08-19 15:36:35 +02:00
commit e9b80c34fe
5 changed files with 6 additions and 16 deletions

View file

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

View file

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

View file

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

View file

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

View file

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