mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-13 22:22:27 +00:00
[gamecode] Support the l flag for %v and %q
This makes it much easier to print double vector types (for 3 and 4 components, at least).
This commit is contained in:
parent
77c1b584ea
commit
81b57903fc
1 changed files with 9 additions and 3 deletions
|
@ -1058,7 +1058,8 @@ fmt_state_modifiers (fmt_state_t *state)
|
|||
// no modifiers supported
|
||||
if (state->c[0] == 'l'
|
||||
&& (state->c[1] == 'i' || state->c[1] == 'd' || state->c[1] == 'x'
|
||||
|| state->c[1] == 'u')) {
|
||||
|| state->c[1] == 'u'
|
||||
|| state->c[1] == 'v' || state->c[1] == 'q')) {
|
||||
(*state->fi)->flags |= FMT_LONG;
|
||||
state->c++;
|
||||
}
|
||||
|
@ -1183,8 +1184,13 @@ fmt_state_conversion (fmt_state_t *state)
|
|||
(*state->fi)->precision = precision;
|
||||
(*state->fi)->minFieldWidth = minWidth;
|
||||
(*state->fi)->type = 'g';
|
||||
(*state->fi)->data.float_var =
|
||||
P_VECTOR (pr, state->fmt_count)[i];
|
||||
if (flags & FMT_LONG) {
|
||||
(*state->fi)->data.double_var
|
||||
= (&P_var (pr, state->fmt_count, double))[i];
|
||||
} else {
|
||||
(*state->fi)->data.float_var =
|
||||
P_VECTOR (pr, state->fmt_count)[i];
|
||||
}
|
||||
|
||||
fmt_append_item (state);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue