mirror of
https://github.com/open-goal/jak-project
synced 2026-09-03 02:14:07 -04:00
[decompiler] decompile particle defs using specialized macros (#1077)
* [decompiler] `defpart` and `defpartgroup` * support sounds in part defs natively * make `meters_to_string` * update refs * clang * make macros in pair only work inside `(unquote ...` * update source * update finish * fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/goal_constants.h"
|
||||
#include "third-party/dragonbox.h"
|
||||
#include "print_float.h"
|
||||
#include "common/util/assert.h"
|
||||
@@ -19,6 +19,14 @@ std::string float_to_string(float value, bool append_trailing_decimal) {
|
||||
return {buff};
|
||||
}
|
||||
|
||||
/*!
|
||||
* Wrapper around float_to_string, for printing meters. Unlike float_to_string, it does not append
|
||||
* decimals by default.
|
||||
*/
|
||||
std::string meters_to_string(float value, bool append_trailing_decimal) {
|
||||
return float_to_string(value / METER_LENGTH, append_trailing_decimal);
|
||||
}
|
||||
|
||||
int float_to_cstr(float value, char* buffer, bool append_trailing_decimal) {
|
||||
assert(std::isfinite(value));
|
||||
// dragonbox gives us:
|
||||
|
||||
Reference in New Issue
Block a user