/* dependencies */
#include "q3map2.h"
+#if GDEF_OS_POSIX
+#include <sys/ioctl.h>
+#endif // GDEF_OS_POSIX
-
-unsigned terminalColumns = 80;
+static unsigned terminalColumns = 80;
struct HelpOption
{
const char* description;
};
+// FIXME: low column width cause an endless loop
void HelpOptions(const char* group_name, int indentation, int width, struct HelpOption* options, int count)
{
indentation *= 2;
{"-fastlightmapsearch", "Deprecated alias for `-fastallocate`"},
{"-fast", "Ignore tiny light contributions"},
{"-fill", "Fill lightmap colors from surrounding pixels to improve JPEG compression"},
- {"-filter", "Lightmap filtering"},
+ {"-filter", "Lightmap filtering, doesn't play nice with some other effects, don't use it, use `-samples` instead"},
{"-floodlight", "Enable floodlight (zero-effort somewhat decent lighting)"},
{"-gamma <F>", "Lightmap gamma"},
{"-gridambientdirectionality <F>", "Ambient directional lighting received (default: 0.0)"},
{"-sRGBtex", "Treat textures as sRGB colorspace"},
{"-style, -styles", "Enable support for light styles"},
{"-sunonly", "Only compute sun light"},
- {"-super <N, `-supersample` N>", "Ordered grid supersampling quality"},
+ {"-super <N, `-supersample` N>", "Ordered grid supersampling quality, much slower than `-samples`"},
{"-thresh <F>", "Triangle subdivision threshold"},
{"-trianglecheck", "Broken check that should ensure luxels apply to the right triangle"},
{"-trisoup", "Convert brush faces to triangle soup"},
{"-fs_nohomepath", "Do not load home path in VFS"},
{"-fs_pakpath <path>", "Specify a package directory (can be used more than once to look in multiple paths)"},
{"-game <gamename>", "Load settings for the given game (default: quake3)"},
- {"-subdivisions <F>", "multiplier for patch subdivisions quality"},
- {"-threads <N>", "number of threads to use"},
+ {"-subdivisions <F>", "Multiplier for patch subdivisions quality"},
+ {"-threads <N>", "Number of threads to use"},
{"-v", "Verbose mode"},
{"-werror", "Make all warnings into errors"}
};
printf("\n\n");
}
-#include <termcap.h>
-
void HelpMain(const char* arg)
{
printf("Usage: q3map2 [stage] [common options...] [stage options...] [stage source file]\n");
printf(" q3map2 -help [stage]\n");
printf(" q3map2 -help all\n\n");
- static char termbuf[2048];
- char *termtype = getenv("TERM");
- if (tgetent(termbuf, termtype) >= 0) {
- terminalColumns = tgetnum("co");
+#if GDEF_OS_POSIX
+ struct winsize ws;
+ ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
+ if (ws.ws_col > 60) {
+ terminalColumns = ws.ws_col;
}
+#endif // GDEF_OS_POSIX
HelpCommon();