mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 08:53:54 +00:00
DrawState workaround
This commit is contained in:
parent
6277e39216
commit
fe86ce5a2c
6 changed files with 13 additions and 17 deletions
|
@ -102,7 +102,7 @@ private:
|
|||
{
|
||||
if (windows.isGuiMode()) return;
|
||||
|
||||
MWMechanics::DrawState state = player.getDrawState();
|
||||
MWMechanics::DrawState_ state = player.getDrawState();
|
||||
if (state == MWMechanics::DrawState_Weapon || state == MWMechanics::DrawState_Nothing)
|
||||
{
|
||||
player.setDrawState(MWMechanics::DrawState_Spell);
|
||||
|
@ -119,7 +119,7 @@ private:
|
|||
{
|
||||
if (windows.isGuiMode()) return;
|
||||
|
||||
MWMechanics::DrawState state = player.getDrawState();
|
||||
MWMechanics::DrawState_ state = player.getDrawState();
|
||||
if (state == MWMechanics::DrawState_Spell || state == MWMechanics::DrawState_Nothing)
|
||||
{
|
||||
player.setDrawState(MWMechanics::DrawState_Weapon);
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
#ifndef GAME_MWMECHANICS_DRAWSTATE_H
|
||||
#define GAME_MWMECHANICS_DRAWSTATE_H
|
||||
|
||||
#undef DrawState
|
||||
|
||||
namespace MWMechanics
|
||||
{
|
||||
enum DrawState
|
||||
/// \note The _ suffix is required to avoid a collision with a Windoze macro. Die, Microsoft! Die!
|
||||
enum DrawState_
|
||||
{
|
||||
DrawState_Weapon = 0,
|
||||
DrawState_Spell = 1,
|
||||
|
|
|
@ -16,12 +16,12 @@ MWMechanics::NpcStats::NpcStats()
|
|||
: mMovementFlags (0), mDrawState (DrawState_Nothing)
|
||||
{}
|
||||
|
||||
MWMechanics::DrawState MWMechanics::NpcStats::getDrawState() const
|
||||
MWMechanics::DrawState_ MWMechanics::NpcStats::getDrawState() const
|
||||
{
|
||||
return mDrawState;
|
||||
}
|
||||
|
||||
void MWMechanics::NpcStats::setDrawState (DrawState state)
|
||||
void MWMechanics::NpcStats::setDrawState (DrawState_ state)
|
||||
{
|
||||
mDrawState = state;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace MWMechanics
|
|||
/// \note the faction key must be in lowercase
|
||||
std::map<std::string, int> mFactionRank;
|
||||
|
||||
DrawState mDrawState;
|
||||
DrawState_ mDrawState;
|
||||
unsigned int mMovementFlags;
|
||||
Stat<float> mSkill[27];
|
||||
|
||||
|
@ -49,9 +49,9 @@ namespace MWMechanics
|
|||
|
||||
NpcStats();
|
||||
|
||||
DrawState getDrawState() const;
|
||||
DrawState_ getDrawState() const;
|
||||
|
||||
void setDrawState (DrawState state);
|
||||
void setDrawState (DrawState_ state);
|
||||
|
||||
bool getMovementFlag (Flag flag) const;
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace MWWorld
|
|||
mClass = new_class;
|
||||
}
|
||||
|
||||
void Player::setDrawState (MWMechanics::DrawState state)
|
||||
void Player::setDrawState (MWMechanics::DrawState_ state)
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
MWWorld::Class::get(ptr).getNpcStats(ptr).setDrawState (state);
|
||||
|
@ -111,7 +111,7 @@ namespace MWWorld
|
|||
MWWorld::Class::get (ptr).setStance (ptr, MWWorld::Class::Run, !running);
|
||||
}
|
||||
|
||||
MWMechanics::DrawState Player::getDrawState()
|
||||
MWMechanics::DrawState_ Player::getDrawState()
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
return MWWorld::Class::get(ptr).getNpcStats(ptr).getDrawState();
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
|
||||
#include "../mwmechanics/drawstate.hpp"
|
||||
|
||||
#undef DrawState // How did this get defined again?
|
||||
// Maybe it's defined by default in every file for windows?
|
||||
|
||||
namespace MWBase
|
||||
{
|
||||
class World;
|
||||
|
@ -86,7 +83,7 @@ namespace MWWorld
|
|||
|
||||
void setClass (const ESM::Class& class_);
|
||||
|
||||
void setDrawState (MWMechanics::DrawState state);
|
||||
void setDrawState (MWMechanics::DrawState_ state);
|
||||
|
||||
std::string getName() const
|
||||
{
|
||||
|
@ -118,7 +115,7 @@ namespace MWWorld
|
|||
return mAutoMove;
|
||||
}
|
||||
|
||||
MWMechanics::DrawState getDrawState(); /// \todo constness
|
||||
MWMechanics::DrawState_ getDrawState(); /// \todo constness
|
||||
|
||||
void setAutoMove (bool enable);
|
||||
|
||||
|
|
Loading…
Reference in a new issue