Skip to content

Commit

Permalink
Fix crashes in console mode. Update language.ini!
Browse files Browse the repository at this point in the history
Fix crashes in console mode. Update language.ini is required!
  • Loading branch information
UnrealKaraulov committed Dec 10, 2023
1 parent 898e678 commit 497a485
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 121 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ vs-project/fmt/fmt.dir/Release/fmt.vcxproj.FileListAbsolute.txt
*.lit
vs-project/Release/newbspguy.zip
vs-project/Release/language.ini
vs-project/log.txt
10 changes: 5 additions & 5 deletions cfg/language.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ LANG_0030 = Generating minidump at path {}\n
LANG_0031 = Crash\n WINAPI_LASTERROR:{}.\n Exception code: {}.\n Exception address: {}.\n Main module address: {}\n
LANG_0032 = Open editor with empty map.
LANG_0033 = Load settings from : {}\n
LANG_0034 = ERROR: File not found: {}
LANG_0034 = ERROR: File not found: {}\n
LANG_0035 = Loaded empty map.\n
LANG_0036 = ERROR: {} not found\n
LANG_0037 = {} is not a valid BSP file\n
Expand Down Expand Up @@ -105,9 +105,9 @@ LANG_0103 = {}.bsp ent data (line {}): Unexpected '{'\n
LANG_0104 = {}.bsp ent data (line {}): Unexpected '}'\n
LANG_0105 = Found unknown classname entity. Skip it.\n
LANG_0106 = First entity has classname different from 'woldspawn', we do fixup it\n
LANG_0107 = {:-12s}
LANG_0107 = {:>12}
LANG_0108 = (OVERFLOW!!!)
LANG_0109 = {:-26s} {:-26s} *{:-6d} {:9d}
LANG_0109 = {:>26} {:>26} *{:>6d} {:9d}
LANG_0110 = Bad face reference in marksurf {}: {} / {}\n
LANG_0111 = Bad edge reference in surfedge {}: {} / {}\n
LANG_0112 = Bad texture reference in textureinfo {}: {} / {}\n
Expand Down Expand Up @@ -136,7 +136,7 @@ LANG_0134 = Error: found memory leak in texture->name of {} texture.\n
LANG_0135 = Warning: texture data buffer overrun in {} texture. {} > {}.\n
LANG_0136 = Tex size {}. Tex name "{}". Tex offset {}. Data offset {}. \n
LANG_0137 = Unable to show model stats while BSP limits are exceeded.\n
LANG_0138 = Classname Targetname Model {:-10s} Usage\n
LANG_0138 = Classname Targetname Model {:>10} Usage\n
LANG_0139 = Data Type Current / Max Fullness\n
LANG_0140 = NODE ({:.2f}, {:.2f}, {:.2f} @ {:.2}\n
LANG_0141 = Invalid hull number. Clipnode hull numbers are 0 - {}\n
Expand Down Expand Up @@ -264,7 +264,7 @@ LANG_0262 = Converted WADTEX to RGBA name {} size {}/{}\n
LANG_0263 = Convert BSPMIPTEX to RGBA name {} size {}/{}\n
LANG_0264 = Converted BSPMIPTEX to RGBA name {} size {}/{}\n
LANG_0265 = ERROR: invalid number of coordinates for option {}\n
LANG_0266 = \r {:-32s} {:.0f}%
LANG_0266 = \r {:>32} {:.0f}%
LANG_0267 = Move camera to first entity...\n
LANG_0268 = Missing WAD: {}\n
LANG_0269 = Loading WAD {}\n
Expand Down
2 changes: 1 addition & 1 deletion src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3919,7 +3919,7 @@ void Bsp::print_stat(const std::string& name, unsigned int val, unsigned int max
}
else
{
logf("{:8u} / {:-8u}", val, max);
logf("{:8} / {:>8}", val, max);
}
logf(" {:6.1f}%", percent);

Expand Down
2 changes: 1 addition & 1 deletion src/bsp/BspMerger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void BspMerger::merge(MAPBLOCK& dst, MAPBLOCK& src, std::string resultType)
std::string thisName = dst.merge_name.size() ? dst.merge_name : dst.map->bsp_name;
std::string otherName = src.merge_name.size() ? src.merge_name : src.map->bsp_name;
dst.merge_name = std::move(resultType);
logf(" {:-8s} = {} + {}\n", dst.merge_name, thisName, otherName);
logf(" {:>8} = {} + {}\n", dst.merge_name, thisName, otherName);

merge(*dst.map, *src.map);
}
Expand Down
3 changes: 1 addition & 2 deletions src/cli/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#endif
CommandLine::CommandLine(int argc, char* argv[])
{
askingForHelp = argc <= 1;

askingForHelp = false;
for (int i = 0; i < argc; i++)
{
std::string arg = argv[i];
Expand Down
1 change: 1 addition & 0 deletions src/cli/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class CommandLine
std::vector<std::string> options;
bool askingForHelp;

CommandLine() = default;
CommandLine(int argc, char* argv[]);

bool hasOption(const std::string& optionName);
Expand Down
2 changes: 1 addition & 1 deletion src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8530,7 +8530,7 @@ ModelInfo Gui::calcModelStat(Bsp* map, STRUCTUSAGE* modelInfo, unsigned int val,
tmp = fmt::format("{:8.1f}", val / meg);
stat.val = std::to_string(val);

tmp = fmt::format("{:-5.1f} MB", max / meg);
tmp = fmt::format("{:>5.1f} MB", max / meg);
stat.usage = tmp;
}
else
Expand Down
3 changes: 0 additions & 3 deletions src/editor/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ Renderer::Renderer()
return;
}

g_settings.loadDefault();
g_settings.load();

gui = new Gui(this);

loadSettings();
Expand Down
4 changes: 3 additions & 1 deletion src/editor/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ std::string g_current_dir = ".";
std::string g_game_dir = "";
std::string g_working_dir = "";

AppSettings g_settings;
AppSettings g_settings{};

void AppSettings::loadDefault()
{
Expand Down Expand Up @@ -160,6 +160,8 @@ void AppSettings::reset()

void AppSettings::load()
{
set_localize_lang("EN");

std::ifstream file(g_settings_path);
if (!file.is_open())
{
Expand Down
Loading

0 comments on commit 497a485

Please sign in to comment.