Add --init-scale option
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
EXT = .exe
|
||||
CFLAGS = -O2 -ggdb -I3p/glad/include -I3p/glfw-3.4.bin.WIN64/include -L3p/glfw-3.4.bin.WIN64/lib-mingw-w64
|
||||
CFLAGS = -O2 -DNDEBUG -I3p/glad/include -I3p/glfw-3.4.bin.WIN64/include -L3p/glfw-3.4.bin.WIN64/lib-mingw-w64
|
||||
LDFLAGS = -lglfw3 -lopengl32 -lgdi32
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
EXT =
|
||||
CFLAGS = -O2 -ggdb -I3p/glad/include -fsanitize=thread,undefined
|
||||
CFLAGS = -O2 -DNDEBUG -I3p/glad/include
|
||||
LDFLAGS = -lglfw -lm
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
|
||||
+13
-2
@@ -881,8 +881,20 @@ void update_frame_texture(void)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
num_columns = -1;
|
||||
init_scale = 8;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "--threads")) {
|
||||
if (!strcmp(argv[i], "--init-scale")) {
|
||||
i++;
|
||||
if (i == argc) {
|
||||
fprintf(stderr, "Error: --threads option is missing the count\n");
|
||||
return -1;
|
||||
}
|
||||
init_scale = atoi(argv[i]);
|
||||
if (init_scale != 1 && init_scale != 2 && init_scale != 4 && init_scale != 8 && init_scale != 16) {
|
||||
fprintf(stderr, "Error: Invalid value for --init-scale. It must be a power of 2 between 1 and 16 (included)\n");
|
||||
return -1;
|
||||
}
|
||||
} else if (!strcmp(argv[i], "--threads")) {
|
||||
i++;
|
||||
if (i == argc) {
|
||||
fprintf(stderr, "Error: --threads option is missing the count\n");
|
||||
@@ -903,7 +915,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
if (num_columns > MAX_COLUMNS)
|
||||
num_columns = MAX_COLUMNS;
|
||||
init_scale = 8;
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user