2018-07-04 17:00:21 +08:00
|
|
|
#include "..\e2dbase.h"
|
2018-07-05 01:35:50 +08:00
|
|
|
#include "..\e2dtool.h"
|
2018-07-04 17:00:21 +08:00
|
|
|
|
|
|
|
|
e2d::Config::Config()
|
|
|
|
|
: _gameName()
|
2018-07-05 01:35:50 +08:00
|
|
|
, _soundEnabled(true)
|
2018-07-24 12:49:32 +08:00
|
|
|
, _frameInterval(15)
|
2018-07-17 12:32:20 +08:00
|
|
|
, _showFps(false)
|
2018-07-28 18:44:37 +08:00
|
|
|
, _vSyncEnabled(true)
|
2018-07-07 18:04:18 +08:00
|
|
|
, _outlineVisible(false)
|
2018-07-04 17:00:21 +08:00
|
|
|
, _collisionEnabled(false)
|
2018-07-07 01:48:39 +08:00
|
|
|
, _colliderVisible(false)
|
2018-07-04 17:00:21 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
e2d::Config::~Config()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void e2d::Config::setGameName(const String & name)
|
|
|
|
|
{
|
|
|
|
|
_gameName = name;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 12:32:20 +08:00
|
|
|
void e2d::Config::showFps(bool show)
|
|
|
|
|
{
|
|
|
|
|
_showFps = show;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-24 20:21:25 +08:00
|
|
|
void e2d::Config::setVSyncEnabled(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
_vSyncEnabled = enabled;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-24 12:49:32 +08:00
|
|
|
void e2d::Config::setFrameInterval(int interval)
|
|
|
|
|
{
|
|
|
|
|
_frameInterval = interval;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-07 18:04:18 +08:00
|
|
|
void e2d::Config::setOutlineVisible(bool visible)
|
|
|
|
|
{
|
|
|
|
|
_outlineVisible = visible;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-05 01:35:50 +08:00
|
|
|
void e2d::Config::setSoundEnabled(bool enabled)
|
|
|
|
|
{
|
2018-07-24 12:49:32 +08:00
|
|
|
_soundEnabled = enabled;
|
2018-07-05 01:35:50 +08:00
|
|
|
}
|
|
|
|
|
|
2018-07-04 17:00:21 +08:00
|
|
|
void e2d::Config::setCollisionEnabled(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
_collisionEnabled = enabled;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-07 01:48:39 +08:00
|
|
|
void e2d::Config::setColliderVisible(bool visible)
|
2018-07-05 00:35:12 +08:00
|
|
|
{
|
2018-07-07 01:48:39 +08:00
|
|
|
_colliderVisible = visible;
|
2018-07-05 00:35:12 +08:00
|
|
|
}
|
|
|
|
|
|
2018-07-04 17:00:21 +08:00
|
|
|
e2d::String e2d::Config::getGameName() const
|
|
|
|
|
{
|
|
|
|
|
return _gameName;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-05 01:35:50 +08:00
|
|
|
bool e2d::Config::isSoundEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return _soundEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-24 20:21:25 +08:00
|
|
|
bool e2d::Config::isVSyncEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return _vSyncEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 12:32:20 +08:00
|
|
|
bool e2d::Config::isFpsShow() const
|
|
|
|
|
{
|
|
|
|
|
return _showFps;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-24 12:49:32 +08:00
|
|
|
int e2d::Config::getFrameInterval() const
|
|
|
|
|
{
|
|
|
|
|
return _frameInterval;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-07 18:04:18 +08:00
|
|
|
bool e2d::Config::isOutlineVisible() const
|
|
|
|
|
{
|
|
|
|
|
return _outlineVisible;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-04 17:00:21 +08:00
|
|
|
bool e2d::Config::isCollisionEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return _collisionEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-07 01:48:39 +08:00
|
|
|
bool e2d::Config::isColliderVisible() const
|
2018-07-05 00:35:12 +08:00
|
|
|
{
|
2018-07-07 01:48:39 +08:00
|
|
|
return _colliderVisible;
|
2018-07-05 00:35:12 +08:00
|
|
|
}
|