|
9 | 9 | #ifndef AI_DEBUG_TEXT_TREE_H_INCLUDED |
10 | 10 | #define AI_DEBUG_TEXT_TREE_H_INCLUDED |
11 | 11 |
|
| 12 | +IC xr_string __cdecl make_xrstr(pcstr format, ...) |
| 13 | +{ |
| 14 | + va_list args; |
| 15 | + va_start(args, format); |
| 16 | + |
| 17 | + char temp[4096]; |
| 18 | + vsprintf(temp, format, args); |
| 19 | + |
| 20 | + va_end(args); |
| 21 | + return xr_string(temp); |
| 22 | +} |
| 23 | + |
| 24 | +IC xr_string __cdecl make_xrstr(bool b) { return b ? "+" : "-"; } |
| 25 | +IC xr_string __cdecl make_xrstr(float f) { return make_xrstr("%f", f); } |
| 26 | +IC xr_string __cdecl make_xrstr(s32 d) { return make_xrstr("%i", d); } |
| 27 | +IC xr_string __cdecl make_xrstr(u32 d) { return make_xrstr("%u", d); } |
| 28 | +IC xr_string __cdecl make_xrstr(s64 d) { return make_xrstr("%i", d); } |
| 29 | +IC xr_string __cdecl make_xrstr(u64 d) { return make_xrstr("%u", d); } |
| 30 | +IC xr_string __cdecl make_xrstr(Fvector3 v) { return make_xrstr("[%f][%f][%f]", v.x, v.y, v.z); } |
| 31 | +IC xr_string __cdecl make_xrstr(const xr_string& s) { return s; } |
| 32 | + |
12 | 33 | namespace debug |
13 | 34 | { |
14 | 35 | class text_tree |
@@ -79,25 +100,4 @@ void log_text_tree(text_tree& tree); |
79 | 100 | #include "debug_text_tree_inline.h" |
80 | 101 |
|
81 | 102 | } // namespace debug |
82 | | - |
83 | | -IC xr_string __cdecl make_xrstr(pcstr format, ...) |
84 | | -{ |
85 | | - va_list args; |
86 | | - va_start(args, format); |
87 | | - |
88 | | - char temp[4096]; |
89 | | - vsprintf(temp, format, args); |
90 | | - |
91 | | - va_end(args); |
92 | | - return xr_string(temp); |
93 | | -} |
94 | | - |
95 | | -IC xr_string __cdecl make_xrstr(bool b) { return b ? "+" : "-"; } |
96 | | -IC xr_string __cdecl make_xrstr(float f) { return make_xrstr("%f", f); } |
97 | | -IC xr_string __cdecl make_xrstr(s32 d) { return make_xrstr("%i", d); } |
98 | | -IC xr_string __cdecl make_xrstr(u32 d) { return make_xrstr("%u", d); } |
99 | | -IC xr_string __cdecl make_xrstr(s64 d) { return make_xrstr("%i", d); } |
100 | | -IC xr_string __cdecl make_xrstr(u64 d) { return make_xrstr("%u", d); } |
101 | | -IC xr_string __cdecl make_xrstr(Fvector3 v) { return make_xrstr("[%f][%f][%f]", v.x, v.y, v.z); } |
102 | | -IC xr_string __cdecl make_xrstr(const xr_string& s) { return s; } |
103 | 103 | #endif // defined(AI_DEBUG_TEXT_TREE_H_INCLUDED) |
0 commit comments