modified code style

This commit is contained in:
Lexxy Fox 2023-11-01 16:30:35 -05:00
parent a36ead2ceb
commit 32e512a798
3 changed files with 11 additions and 9 deletions

View File

@ -1,7 +1,7 @@
AlignAfterOpenBracket: BlockIndent AlignAfterOpenBracket: BlockIndent
AlignConsecutiveMacros: true AlignConsecutiveMacros: true
AllowShortIfStatementsOnASingleLine: true AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: true AllowShortLoopsOnASingleLine: false
BasedOnStyle: LLVM BasedOnStyle: LLVM
BinPackArguments: false BinPackArguments: false
BinPackParameters: false BinPackParameters: false

View File

@ -1,3 +1,5 @@
VERSION ?= 9.0.1
prefix ?= /usr/local prefix ?= /usr/local
exec_prefix ?= $(prefix) exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin bindir ?= $(exec_prefix)/bin

View File

@ -225,14 +225,16 @@ static void draw(void) {
fflush(stdout); fflush(stdout);
T0 = t; T0 = t;
Frames = 0; Frames = 0;
if ((t >= 999.0 * autoexit) && (autoexit)) cleanup(); if ((t >= 999.0 * autoexit) && (autoexit))
cleanup();
} }
} }
static void idle(void) { static void idle(void) {
static double t0 = -1.; static double t0 = -1.;
double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
if (t0 < 0.0) t0 = t; if (t0 < 0.0)
t0 = t;
dt = t - t0; dt = t - t0;
t0 = t; t0 = t;
@ -268,7 +270,7 @@ static void key(unsigned char k, int, int) {
Animate = !Animate; Animate = !Animate;
update_idle_func(); update_idle_func();
break; break;
case 27: /* Escape */ case '\e':
cleanup(); cleanup();
default: default:
return; return;
@ -351,7 +353,7 @@ static void visible(int vis) {
} }
void parse_args(int argc, char *argv[]) { void parse_args(int argc, char *argv[]) {
for (GLint i = 1; i < argc; i++) { for (GLint i = 1; i < argc; i++)
if (strcmp(argv[i], "-info") == 0) { if (strcmp(argv[i], "-info") == 0) {
printf("GL_VENDOR = %s\n", (char *)glGetString(GL_VENDOR)); printf("GL_VENDOR = %s\n", (char *)glGetString(GL_VENDOR));
printf("GL_RENDERER = %s\n", (char *)glGetString(GL_RENDERER)); printf("GL_RENDERER = %s\n", (char *)glGetString(GL_RENDERER));
@ -362,10 +364,8 @@ void parse_args(int argc, char *argv[]) {
autoexit = 30; autoexit = 30;
printf("Auto Exit after %i seconds.\n", autoexit); printf("Auto Exit after %i seconds.\n", autoexit);
fflush(stdout); fflush(stdout);
} else if (strcmp(argv[i], "-noanim") == 0) { } else if (strcmp(argv[i], "-noanim") == 0)
Animate = GL_FALSE; Animate = GL_FALSE;
}
}
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {