10#include <SFML/Graphics.hpp>
29#if defined(DF_NO_DEPRECATED_WARNINGS)
34#elif defined(_MSC_VER)
40#define DF_DEPRECATED __declspec(deprecated)
42#elif defined(__GNUC__)
45#define DF_DEPRECATED __attribute__ ((deprecated))
52#pragma message("DF_DEPRECATED not supported by your compiler")
96 int getWindowHorizontalPixels()
const;
97 int getWindowVerticalPixels()
const;
98 int getWindowHorizontalChars()
const;
99 int getWindowVerticalChars()
const;
100 enum Color getWindowBackgroundColor()
const;
101 int getWindowStyle()
const;
102 sf::State getWindowState()
const;
103 int getFrameTime()
const;
104 float getFontScale()
const;
105 std::string getWindowTitle()
const;
106 bool getShowMouse()
const;
107 bool getHeadless()
const;
108 std::string getFontFile()
const;
109 std::string getLogFile()
const;
110 int getRandomSeed()
const;
112 bool getNetworking()
const;
114 int getQuadtreeDepth()
const;
115 int getQuadtreeThreshold()
const;
116 int getGridWidth()
const;
117 int getGridHeight()
const;
118 bool getSignals()
const;
122 std::string
match(std::string find)
const;
126 void setWindowHorizontalPixels(
int window_horizontal_pixels);
127 void setWindowVerticalPixels(
int window_vertical_pixels);
128 void setWindowHorizontalChars(
int window_horizontal_chars);
129 void setWindowVerticalChars(
int window_vertical_chars);
130 void setWindowBackgroundColor(
enum Color window_background_color);
131 void setWindowStyle(
int window_style);
132 void setWindowState(sf::State window_state);
133 void setFrameTime(
int frame_time);
134 void setFontScale(
float font_scale);
135 void setWindowTitle(std::string window_title);
136 void setHeadless(
bool headless=
true);
137 void setShowMouse(
bool show_mouse=
true);
138 void setFontFile(std::string font_file);
139 void setLogFile(std::string logfile);
140 void setRandomSeed(
int random_seed);
142 void setNetworking(
bool networking);
144 void setQuadtreeDepth(
int quadtree_thresh);
145 void setQuadtreeThreshold(
int quadtree_depth);
146 void setGridWidth(
int grid_width);
147 void setGridHeight(
int grid_height);
148 void setSignals(
bool signals);
151 void writeToLog()
const;
160 std::string readConfig();
164 void loadConfig(std::string str=
"");
static Config & getInstance()
Get the singleton instance of the Config.
bool m_signals
True if catch signals.
Definition: Config.h:88
std::string m_font_file
Filename for graphics fonts.
Definition: Config.h:78
std::string getConfig() const
Get attributes.
Config()
Private since a singleton.
int m_quadtree_depth
Max depth for quadtree.
Definition: Config.h:85
int m_window_vertical_chars
Vertical ASCII spaces in window.
Definition: Config.h:69
Config(Config const &)
Don't allow copy.
float m_font_scale
Font scale multiplier.
Definition: Config.h:74
std::string m_config
Aggregate string from config file.
Definition: Config.h:65
bool m_networking
True if networking enabled.
Definition: Config.h:82
int m_random_seed
Seed for random number generation.
Definition: Config.h:80
int m_frame_time
Target time for 1 game loop (in mlsecs).
Definition: Config.h:73
int m_window_style
Window style (default title + close).
Definition: Config.h:70
int m_grid_height
Grid height.
Definition: Config.h:87
std::string m_window_title
Title of window.
Definition: Config.h:75
std::string match(std::string find) const
Match key:value pair in global configuration, returning value.
enum Color m_window_background_color
Window background color.
Definition: Config.h:72
int m_window_horizontal_pixels
Horizontal pixels in window.
Definition: Config.h:66
void operator=(Config const &)
Don't allow assignment.
int m_window_horizontal_chars
Horizontal ASCII spaces in window.
Definition: Config.h:68
int m_grid_width
Grid width.
Definition: Config.h:86
int m_quadtree_threshold
Object threshold for quadtree split.
Definition: Config.h:84
void setConfig(std::string config)
Set attributes.
int m_window_vertical_pixels
Vertical pixels in window.
Definition: Config.h:67
sf::State m_window_state
Window state (full/windowed).
Definition: Config.h:71
bool m_headless
True if run without graphics or input.
Definition: Config.h:77
bool m_show_mouse
True if should show mouse cursor.
Definition: Config.h:76
std::string m_logfile
Filename for dragonfly log.
Definition: Config.h:79
An animation for a sprite.
Definition: Animation.h:15
Color
Colors Dragonfly recognizes.
Definition: Color.h:11