Commit efb56250 authored by mercury233's avatar mercury233

add gameConf.use_image_scale_multi_thread

parent a6004cea
...@@ -1326,6 +1326,8 @@ void Game::LoadConfig() { ...@@ -1326,6 +1326,8 @@ void Game::LoadConfig() {
gameConf.use_d3d = std::strtol(valbuf, nullptr, 10) > 0; gameConf.use_d3d = std::strtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "use_image_scale")) { } else if(!std::strcmp(strbuf, "use_image_scale")) {
gameConf.use_image_scale = std::strtol(valbuf, nullptr, 10) > 0; gameConf.use_image_scale = std::strtol(valbuf, nullptr, 10) > 0;
} else if (!std::strcmp(strbuf, "use_image_scale_multi_thread")) {
gameConf.use_image_scale_multi_thread = std::strtol(valbuf, nullptr, 10) > 0;
} else if (!std::strcmp(strbuf, "use_image_load_background_thread")) { } else if (!std::strcmp(strbuf, "use_image_load_background_thread")) {
gameConf.use_image_load_background_thread = std::strtol(valbuf, nullptr, 10) > 0; gameConf.use_image_load_background_thread = std::strtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "errorlog")) { } else if(!std::strcmp(strbuf, "errorlog")) {
...@@ -1459,6 +1461,7 @@ void Game::SaveConfig() { ...@@ -1459,6 +1461,7 @@ void Game::SaveConfig() {
char linebuf[CONFIG_LINE_SIZE]; char linebuf[CONFIG_LINE_SIZE];
std::fprintf(fp, "use_d3d = %d\n", gameConf.use_d3d ? 1 : 0); std::fprintf(fp, "use_d3d = %d\n", gameConf.use_d3d ? 1 : 0);
std::fprintf(fp, "use_image_scale = %d\n", gameConf.use_image_scale ? 1 : 0); std::fprintf(fp, "use_image_scale = %d\n", gameConf.use_image_scale ? 1 : 0);
std::fprintf(fp, "use_image_scale_multi_thread = %d\n", gameConf.use_image_scale_multi_thread ? 1 : 0);
std::fprintf(fp, "use_image_load_background_thread = %d\n", gameConf.use_image_load_background_thread ? 1 : 0); std::fprintf(fp, "use_image_load_background_thread = %d\n", gameConf.use_image_load_background_thread ? 1 : 0);
std::fprintf(fp, "antialias = %d\n", gameConf.antialias); std::fprintf(fp, "antialias = %d\n", gameConf.antialias);
std::fprintf(fp, "errorlog = %u\n", enable_log); std::fprintf(fp, "errorlog = %u\n", enable_log);
......
...@@ -49,6 +49,7 @@ bool IsExtension(const char* filename, const char(&extension)[N]) { ...@@ -49,6 +49,7 @@ bool IsExtension(const char* filename, const char(&extension)[N]) {
struct Config { struct Config {
bool use_d3d{ false }; bool use_d3d{ false };
bool use_image_scale{ true }; bool use_image_scale{ true };
bool use_image_scale_multi_thread{ true };
bool use_image_load_background_thread{ false }; bool use_image_load_background_thread{ false };
unsigned short antialias{ 0 }; unsigned short antialias{ 0 };
unsigned short serverport{ 7911 }; unsigned short serverport{ 7911 };
......
...@@ -138,7 +138,7 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) { ...@@ -138,7 +138,7 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
const double rx = (double)srcDim.Width / destDim.Width; const double rx = (double)srcDim.Width / destDim.Width;
const double ry = (double)srcDim.Height / destDim.Height; const double ry = (double)srcDim.Height / destDim.Height;
#pragma omp parallel #pragma omp parallel if(mainGame->gameConf.use_image_scale_multi_thread)
{ {
double sx, sy, minsx, maxsx, minsy, maxsy, area, ra, ga, ba, aa, pw, ph, pa; double sx, sy, minsx, maxsx, minsy, maxsy, area, ra, ga, ba, aa, pw, ph, pa;
irr::video::SColor pxl, npxl; irr::video::SColor pxl, npxl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment