2014-06-18 20:10:46 +00:00
|
|
|
#include "RenderConfig.h"
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
RenderConfig::RenderConfig(int width, int height, int antialias, int quality)
|
|
|
|
: width(width), height(height), antialias(antialias), quality(quality) {
|
|
|
|
if (this->width <= 0) {
|
2014-06-18 20:10:46 +00:00
|
|
|
this->width = 400;
|
|
|
|
}
|
2015-11-09 21:30:46 +00:00
|
|
|
if (this->height <= 0) {
|
2014-06-18 20:10:46 +00:00
|
|
|
this->height = this->width * 4 / 3;
|
|
|
|
}
|
2015-11-09 21:30:46 +00:00
|
|
|
if (this->antialias < 1) {
|
2014-06-18 20:10:46 +00:00
|
|
|
this->antialias = 1;
|
|
|
|
}
|
2015-11-09 21:30:46 +00:00
|
|
|
if (this->antialias > 4) {
|
2014-06-18 20:10:46 +00:00
|
|
|
this->antialias = 4;
|
|
|
|
}
|
2015-11-09 21:30:46 +00:00
|
|
|
if (this->quality < 1) {
|
2014-06-18 20:10:46 +00:00
|
|
|
this->quality = 1;
|
|
|
|
}
|
2015-11-09 21:30:46 +00:00
|
|
|
if (this->quality > 10) {
|
2014-06-18 20:10:46 +00:00
|
|
|
this->quality = 10;
|
|
|
|
}
|
|
|
|
}
|