fclose(fh);
}
+string format_time(float seconds)
+{
+ float days, hours, minutes;
+ seconds = floor(seconds + 0.5);
+ days = floor(seconds / 864000);
+ seconds -= days * 864000;
+ hours = floor(seconds / 36000);
+ seconds -= hours * 36000;
+ minutes = floor(seconds / 600);
+ seconds -= minutes * 600;
+ if (days > 0)
+ return sprintf(_("%d days, %02d:%02d:%02d"), days, hours, minutes, seconds);
+ else
+ return sprintf(_("%02d:%02d:%02d"), hours, minutes, seconds);
+}
+
string mmsss(float tenths)
{
float minutes;
}
// todo: this sucks, lets find a better way to do backtraces?
-#ifndef MENUQC
void backtrace(string msg)
{
float dev, war;
cvar_set("developer", ftos(dev));
cvar_set("prvm_backtraceforwarnings", ftos(war));
}
-#endif
// color code replace, place inside of sprintf and parse the string
string CCR(string input)
return CONTENT_EMPTY;
}
#endif
+
+ vector bezier_quadratic_getpoint(vector a, vector b, vector c, float t)
+ {
+ return
+ (c - 2 * b + a) * (t * t) +
+ (b - a) * (2 * t) +
+ a;
+ }
+
+ vector bezier_quadratic_getderivative(vector a, vector b, vector c, float t)
+ {
+ return
+ (c - 2 * b + a) * (2 * t) +
+ (b - a) * 2;
+ }
#endif
#define TIME_TO_NTHS(t,n) floor((t) * (n) + 0.4)
+string format_time(float seconds);
string mmsss(float t);
string mmssss(float t);
#define fprintf(file, ...) fputs(file, sprintf(__VA_ARGS__))
#define bprintf(...) bprint(sprintf(__VA_ARGS__))
-#ifndef MENUQC
+//#ifndef MENUQC
void backtrace(string msg);
-#endif
+//#endif
// color code replace, place inside of sprintf and parse the string... defaults described as constants
// foreground/normal colors
float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents);
float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents);
#endif
+
+ // Quadratic splines (bezier)
+ vector bezier_quadratic_getpoint(vector a, vector p, vector b, float t);
+ vector bezier_quadratic_getderivative(vector a, vector p, vector b, float t);