diff --git a/src/editor/Gui.cpp b/src/editor/Gui.cpp index 69140fc3..57abc9fc 100644 --- a/src/editor/Gui.cpp +++ b/src/editor/Gui.cpp @@ -37,7 +37,7 @@ Gui::Gui(Renderer* app) void Gui::init() { - iniPath = getConfigDir() + "imgui.ini"; + iniPath = g_config_dir + "imgui.ini"; // Setup Dear ImGui context IMGUI_CHECKVERSION(); ImGui::CreateContext(); diff --git a/src/editor/Renderer.cpp b/src/editor/Renderer.cpp index d084b8e9..62ff89ab 100644 --- a/src/editor/Renderer.cpp +++ b/src/editor/Renderer.cpp @@ -642,9 +642,10 @@ void Renderer::renderLoop() } int glerror = glGetError(); - if (glerror != GL_NO_ERROR) + while (glerror != GL_NO_ERROR) { logf(get_localized_string(LANG_0905),glerror); + glerror = glGetError(); } if (updatePickCount) diff --git a/src/gl/Texture.cpp b/src/gl/Texture.cpp index cd3d216e..d550d8d5 100644 --- a/src/gl/Texture.cpp +++ b/src/gl/Texture.cpp @@ -55,7 +55,7 @@ Texture::~Texture() glDeleteTextures(1, &id); delete[] data; - std::remove(dumpTextures.begin(), dumpTextures.end(), this); + dumpTextures.erase(std::remove(dumpTextures.begin(), dumpTextures.end(), this), dumpTextures.end()); } void Texture::upload(int _format, bool lightmap) diff --git a/src/main.cpp b/src/main.cpp index c155b868..dd3d3ac0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -896,8 +896,8 @@ int main(int argc, char* argv[]) g_settings_path = GetCurrentDir() + "bspguy.cfg"; g_config_dir = GetCurrentDir(); #else - g_settings_path = fileExists(getConfigDir() + "bspguy.cfg") ? getConfigDir() + "bspguy.cfg" : GetCurrentDir() + "bspguy.cfg"; - g_config_dir = fileExists(getConfigDir() + "bspguy.cfg") ? getConfigDir() : GetCurrentDir(); + g_settings_path = GetCurrentDir() + "bspguy.cfg"; + g_config_dir = GetCurrentDir(); #endif // test svencoop merge //return test(); diff --git a/src/mdl/mdl_studio.h b/src/mdl/mdl_studio.h index 9dab1cb3..cbabbcc3 100644 --- a/src/mdl/mdl_studio.h +++ b/src/mdl/mdl_studio.h @@ -33,21 +33,9 @@ Studio models are position independent, so the cache manager can move them. ============================================================================== */ #pragma pack(push, 1) -#define MAXSTUDIOTRIANGLES 20000 // TODO: tune this +#define MAXSTUDIOTRIANGLES 32768 // TODO: tune this #define MAXSTUDIOVERTS 16384 // TODO: tune this -#define MAXSTUDIOSEQUENCES 2048 // total animation sequences -- KSH incremented -#define MAXSTUDIOSKINS 256 // total textures -#define MAXSTUDIOSRCBONES 512 // bones allowed at source movement -#define MAXSTUDIOBONES 128 // total bones actually used -#define MAXSTUDIOMODELS 32 // sub-models per model -#define MAXSTUDIOBODYPARTS 32 -#define MAXSTUDIOGROUPS 16 -#define MAXSTUDIOANIMATIONS 2048 -#define MAXSTUDIOMESHES 256 -#define MAXSTUDIOEVENTS 1024 -#define MAXSTUDIOPIVOTS 256 -#define MAXSTUDIOCONTROLLERS 32 - +#define MAXSTUDIOBONES 128 #define MAX_TRIS_PER_BODYGROUP MAXSTUDIOTRIANGLES @@ -83,17 +71,6 @@ Studio models are position independent, so the cache manager can move them. #define STUDIO_TYPES 0x7FFF #define STUDIO_RLOOP 0x8000 // controller that wraps shortest distance -// sequence flags -#define STUDIO_LOOPING 0x0001 - -// bone flags -#define STUDIO_HAS_NORMALS 0x0001 -#define STUDIO_HAS_VERTICES 0x0002 -#define STUDIO_HAS_BBOX 0x0004 -#define STUDIO_HAS_CHROME 0x0008 // if any of the textures have chrome on them - -#define RAD_TO_STUDIO (32768.0/M_PI) -#define STUDIO_TO_RAD (M_PI/32768.0) #define MAXEVENTSTRING 64 typedef struct diff --git a/src/util/util.cpp b/src/util/util.cpp index 01bec716..7190a89c 100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -1206,13 +1206,6 @@ void print_color(int colors) colors = colors ? colors : (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); SetConsoleTextAttribute(console, (WORD)colors); } - -std::string getConfigDir() -{ - wchar_t path[1024]; - SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, path); - return fs::path(path).string() + "/AppData/Roaming/bspguy/"; -} #else void print_color(int colors) { @@ -1235,11 +1228,6 @@ void print_color(int colors) } logf(get_localized_string(LANG_1015),mode,color); } - -std::string getConfigDir() -{ - return getenv("HOME") + std::string("/.config/bspguy/"); -} #endif diff --git a/src/util/util.h b/src/util/util.h index 416fa4b7..75be65e6 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -60,9 +60,11 @@ inline void logf(const std::string & format, Args ...args) noexcept outfile.flush(); #endif - std::cout << log_line; - g_log_buffer.push_back(log_line); - + if (g_log_buffer.size() == 0 || g_log_buffer[g_log_buffer.size() - 1] != log_line) + { + std::cout << log_line; + g_log_buffer.push_back(log_line); + } g_mutex_list[0].unlock(); } @@ -164,8 +166,6 @@ void replaceAll(std::string& str, const std::string& from, const std::string& to void WriteBMP(const std::string& fileName, unsigned char* pixels, int width, int height, int bytesPerPixel); -std::string getConfigDir(); - extern fs::path g_current_dir; std::string GetCurrentDir(); std::string GetWorkDir();