Skip to content

Commit

Permalink
Update.Tried to fix saveSettings missing some text
Browse files Browse the repository at this point in the history
Update.Tried to fix saveSettings missing some text. Added more alpha to sprites. Remove unused mdl_studio code (lighting). Press & hold 'ALT' key for see sprites axes and boxes.
  • Loading branch information
UnrealKaraulov committed Dec 17, 2024
1 parent 0865a84 commit 3ceedda
Show file tree
Hide file tree
Showing 88 changed files with 1,544 additions and 851 deletions.
2 changes: 1 addition & 1 deletion fmt/.github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Set timezone
run: tzutil /s "Ekaterinburg Standard Time"
shell: cmd
- uses: msys2/setup-msys2@5df0ca6cbf14efcd08f8d5bd5e049a3cc8e07fd2 # v2.24.0
- uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2.25.0
with:
release: false
msystem: ${{matrix.sys}}
Expand Down
105 changes: 105 additions & 0 deletions fmt/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,111 @@

- Improved debug codegen.

- Improved C++20 module support
(https://github.com/fmtlib/fmt/pull/4083,
https://github.com/fmtlib/fmt/pull/4084,
https://github.com/fmtlib/fmt/pull/4152,
https://github.com/fmtlib/fmt/pull/4169).
Thanks @kamrann.

- Made `std::expected<void, E>` formattable
(https://github.com/fmtlib/fmt/issues/4145,
https://github.com/fmtlib/fmt/pull/4148).
For example ([godbolt](https://www.godbolt.org/z/hrj5c6G86)):

```c++
fmt::print("{}", std::expected<void, int>());
```
prints
```
expected()
```
Thanks @phprus.
- Added support for `_BitInt` formatting when using clang
(https://github.com/fmtlib/fmt/issues/4007,
https://github.com/fmtlib/fmt/pull/4072,
https://github.com/fmtlib/fmt/pull/4176).
For example ([godbolt](https://www.godbolt.org/z/KWjbWec5z)):
```c++
using int42 = _BitInt(42);
fmt::print("{}", int42(100));
```

Thanks @Arghnews.

- Added the `n` specifier for tuples and pairs
(https://github.com/fmtlib/fmt/pull/4107). Thanks @someonewithpc.

- Made more types formattable at compile time
(https://github.com/fmtlib/fmt/pull/4127). Thanks @AnthonyVH.

- Implemented a more efficient compile-time `fmt::formatted_size`
(https://github.com/fmtlib/fmt/issues/4102,
https://github.com/fmtlib/fmt/pull/4103). Thanks @phprus.

- Added a formatter for `std::reference_wrapper`
(https://github.com/fmtlib/fmt/pull/4163,
https://github.com/fmtlib/fmt/pull/4164). Thanks @yfeldblum and @phprus.

- Added experimental padding support (glibc `strftime` extension) to `%m`, `%j`
and `%Y`. (https://github.com/fmtlib/fmt/pull/4161). Thanks @KKhanhH.

- Fixed an unreleased regression in transcoding of surrogate pairs
(https://github.com/fmtlib/fmt/issues/4094,
https://github.com/fmtlib/fmt/pull/4095). Thanks @phprus.

- Made `fmt::appender` satisfy `std::output_iterator` concept
(https://github.com/fmtlib/fmt/issues/4092,
https://github.com/fmtlib/fmt/pull/4093). Thanks @phprus.

- Made `std::iterator_traits<fmt::appender>` standard-conforming
(https://github.com/fmtlib/fmt/pull/4185). Thanks @CaseyCarter.

- Made it easier to reuse `formatter<std::string_view>` for types with implicit
conversion to `std::string_view` (https://github.com/fmtlib/fmt/issues/4036,
https://github.com/fmtlib/fmt/pull/4055). Thanks @Arghnews.

- Fixed compile-time formatting of some string types
(https://github.com/fmtlib/fmt/pull/4065). Thanks @torshepherd.

- Made it possible to disable `<filesystem>` use via `FMT_CPP_LIB_FILESYSTEM`
for compatibility with some video game console SDKs, e.g. Nintendo Switch SDK
(https://github.com/fmtlib/fmt/issues/4257,
https://github.com/fmtlib/fmt/pull/4258,
https://github.com/fmtlib/fmt/pull/4259). Thanks @W4RH4WK and @phprus.

- Fixed compatibility with platforms that use 80-bit `long double`
(https://github.com/fmtlib/fmt/issues/4245,
https://github.com/fmtlib/fmt/pull/4246). Thanks @jsirpoma.

- Improved include directory ordering to reduce the chance of including
incorrect headers when using multiple versions of {fmt}
(https://github.com/fmtlib/fmt/pull/4116). Thanks @cdzhan.

- Improved documentation and README (https://github.com/fmtlib/fmt/pull/4066).
Thanks @zyctree.

- Improved the documentation generator (https://github.com/fmtlib/fmt/pull/4110,
https://github.com/fmtlib/fmt/pull/4115). Thanks @rturrado.

- Improved CI (https://github.com/fmtlib/fmt/pull/4155,
https://github.com/fmtlib/fmt/pull/4151). Thanks @phprus.

- Fixed various warnings and compilation issues
(https://github.com/fmtlib/fmt/issues/4129,
https://github.com/fmtlib/fmt/pull/4130,
https://github.com/fmtlib/fmt/pull/4131,
https://github.com/fmtlib/fmt/pull/4132,
https://github.com/fmtlib/fmt/pull/4159,
https://github.com/fmtlib/fmt/pull/4170,
https://github.com/fmtlib/fmt/pull/4188).
Thanks @torsten48, @Arghnews, @tinfoilboy, @aminya, @Ottani, @c4v4.

# 11.0.2 - 2024-07-20

- Fixed compatibility with non-POSIX systems
Expand Down
4 changes: 2 additions & 2 deletions fmt/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ hide:
</p>
<p>
The library is highly portable and requires only a minimal <b>subset of
C++11</b> features which are available in GCC 4.9, Clang 3.4, MSVC 19.0
(2015) and later. Newer compiler and standard library features are used
C++11</b> features which are available in GCC 4.9, Clang 3.4, MSVC 19.10
(2017) and later. Newer compiler and standard library features are used
if available, and enable additional functionality.
</p>
<p>
Expand Down
6 changes: 3 additions & 3 deletions fmt/doc/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,12 +706,12 @@ The available padding modifiers (*padding_modifier*) are:

| Type | Meaning |
|-------|-----------------------------------------|
| `'-'` | Pad a numeric result with spaces. |
| `'_'` | Do not pad a numeric result string. |
| `'_'` | Pad a numeric result with spaces. |
| `'-'` | Do not pad a numeric result string. |
| `'0'` | Pad a numeric result string with zeros. |

These modifiers are only supported for the `'H'`, `'I'`, `'M'`, `'S'`, `'U'`,
`'V'`, `'W'`, `'m'`, `'j'`, `'Y'` presentation types.
`'V'`, `'W'`, `'Y'`, `'d'`, `'j'` and `'m'` presentation types.

## Range Format Specifications

Expand Down
10 changes: 5 additions & 5 deletions fmt/include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,17 +419,17 @@ template <> constexpr auto num_bits<uint128_fallback>() -> int { return 128; }
// and 128-bit pointers to uint128_fallback.
template <typename To, typename From, FMT_ENABLE_IF(sizeof(To) > sizeof(From))>
inline auto bit_cast(const From& from) -> To {
constexpr auto size = static_cast<int>(sizeof(From) / sizeof(unsigned));
constexpr auto size = static_cast<int>(sizeof(From) / sizeof(unsigned short));
struct data_t {
unsigned value[static_cast<unsigned>(size)];
unsigned short value[static_cast<unsigned>(size)];
} data = bit_cast<data_t>(from);
auto result = To();
if (const_check(is_big_endian())) {
for (int i = 0; i < size; ++i)
result = (result << num_bits<unsigned>()) | data.value[i];
result = (result << num_bits<unsigned short>()) | data.value[i];
} else {
for (int i = size - 1; i >= 0; --i)
result = (result << num_bits<unsigned>()) | data.value[i];
result = (result << num_bits<unsigned short>()) | data.value[i];
}
return result;
}
Expand Down Expand Up @@ -891,7 +891,7 @@ class basic_memory_buffer : public detail::buffer<T> {
using memory_buffer = basic_memory_buffer<char>;

template <size_t SIZE>
FMT_NODISCARD auto to_string(basic_memory_buffer<char, SIZE>& buf)
FMT_NODISCARD auto to_string(const basic_memory_buffer<char, SIZE>& buf)
-> std::string {
auto size = buf.size();
detail::assume(size < std::string().max_size());
Expand Down
81 changes: 37 additions & 44 deletions fmt/include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,9 @@ template <typename R>
using maybe_const_range =
conditional_t<has_const_begin_end<R>::value, const R, R>;

// Workaround a bug in MSVC 2015 and earlier.
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910
template <typename R, typename Char>
struct is_formattable_delayed
: is_formattable<uncvref_type<maybe_const_range<R>>, Char> {};
#endif
} // namespace detail

template <typename...> struct conjunction : std::true_type {};
Expand Down Expand Up @@ -498,13 +495,8 @@ struct formatter<
range_format_kind<R, Char>::value != range_format::disabled &&
range_format_kind<R, Char>::value != range_format::map &&
range_format_kind<R, Char>::value != range_format::string &&
range_format_kind<R, Char>::value != range_format::debug_string>
// Workaround a bug in MSVC 2015 and earlier.
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910
,
detail::is_formattable_delayed<R, Char>
#endif
>::value>> {
range_format_kind<R, Char>::value != range_format::debug_string>,
detail::is_formattable_delayed<R, Char>>::value>> {
private:
using range_type = detail::maybe_const_range<R>;
range_formatter<detail::uncvref_type<range_type>, Char> range_formatter_;
Expand Down Expand Up @@ -646,9 +638,9 @@ struct formatter<join_view<It, Sentinel, Char>, Char> {
#endif
formatter<remove_cvref_t<value_type>, Char> value_formatter_;

using view_ref = conditional_t<std::is_copy_constructible<It>::value,
const join_view<It, Sentinel, Char>&,
join_view<It, Sentinel, Char>&&>;
using view = conditional_t<std::is_copy_constructible<It>::value,
const join_view<It, Sentinel, Char>,
join_view<It, Sentinel, Char>>;

public:
using nonlocking = void;
Expand All @@ -658,9 +650,10 @@ struct formatter<join_view<It, Sentinel, Char>, Char> {
}

template <typename FormatContext>
auto format(view_ref& value, FormatContext& ctx) const
-> decltype(ctx.out()) {
auto it = std::forward<view_ref>(value).begin;
auto format(view& value, FormatContext& ctx) const -> decltype(ctx.out()) {
using iter =
conditional_t<std::is_copy_constructible<view>::value, It, It&>;
iter it = value.begin;
auto out = ctx.out();
if (it == value.end) return out;
out = value_formatter_.format(*it, ctx);
Expand All @@ -675,34 +668,6 @@ struct formatter<join_view<It, Sentinel, Char>, Char> {
}
};

/// Returns a view that formats the iterator range `[begin, end)` with elements
/// separated by `sep`.
template <typename It, typename Sentinel>
auto join(It begin, Sentinel end, string_view sep) -> join_view<It, Sentinel> {
return {std::move(begin), end, sep};
}

/**
* Returns a view that formats `range` with elements separated by `sep`.
*
* **Example**:
*
* auto v = std::vector<int>{1, 2, 3};
* fmt::print("{}", fmt::join(v, ", "));
* // Output: 1, 2, 3
*
* `fmt::join` applies passed format specifiers to the range elements:
*
* fmt::print("{:02}", fmt::join(v, ", "));
* // Output: 01, 02, 03
*/
template <typename Range, FMT_ENABLE_IF(!is_tuple_like<Range>::value)>
auto join(Range&& r, string_view sep)
-> join_view<decltype(detail::range_begin(r)),
decltype(detail::range_end(r))> {
return {detail::range_begin(r), detail::range_end(r), sep};
}

template <typename Char, typename Tuple> struct tuple_join_view : detail::view {
const Tuple& tuple;
basic_string_view<Char> sep;
Expand Down Expand Up @@ -819,6 +784,34 @@ struct formatter<

FMT_BEGIN_EXPORT

/// Returns a view that formats the iterator range `[begin, end)` with elements
/// separated by `sep`.
template <typename It, typename Sentinel>
auto join(It begin, Sentinel end, string_view sep) -> join_view<It, Sentinel> {
return {std::move(begin), end, sep};
}

/**
* Returns a view that formats `range` with elements separated by `sep`.
*
* **Example**:
*
* auto v = std::vector<int>{1, 2, 3};
* fmt::print("{}", fmt::join(v, ", "));
* // Output: 1, 2, 3
*
* `fmt::join` applies passed format specifiers to the range elements:
*
* fmt::print("{:02}", fmt::join(v, ", "));
* // Output: 01, 02, 03
*/
template <typename Range, FMT_ENABLE_IF(!is_tuple_like<Range>::value)>
auto join(Range&& r, string_view sep)
-> join_view<decltype(detail::range_begin(r)),
decltype(detail::range_end(r))> {
return {detail::range_begin(r), detail::range_end(r), sep};
}

/**
* Returns an object that formats `std::tuple` with elements separated by `sep`.
*
Expand Down
3 changes: 2 additions & 1 deletion fmt/include/fmt/std.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

// Check FMT_CPLUSPLUS to suppress a bogus warning in MSVC.
# if FMT_CPLUSPLUS >= 201703L
# if FMT_HAS_INCLUDE(<filesystem>)
# if FMT_HAS_INCLUDE(<filesystem>) && \
(!defined(FMT_CPP_LIB_FILESYSTEM) || FMT_CPP_LIB_FILESYSTEM != 0)
# include <filesystem>
# endif
# if FMT_HAS_INCLUDE(<variant>)
Expand Down
29 changes: 11 additions & 18 deletions fmt/test/base-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,7 @@ TEST(base_test, is_formattable) {
EXPECT_TRUE(fmt::is_formattable<const const_formattable&>::value);

EXPECT_TRUE(fmt::is_formattable<nonconst_formattable&>::value);
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910
EXPECT_FALSE(fmt::is_formattable<const nonconst_formattable&>::value);
#endif

EXPECT_FALSE(fmt::is_formattable<convertible_to_pointer>::value);
const auto f = convertible_to_pointer_formattable();
Expand Down Expand Up @@ -745,19 +743,6 @@ TEST(base_test, no_implicit_conversion_to_string_view) {
fmt::is_formattable<implicitly_convertible_to_string_view>::value);
}

#ifdef FMT_USE_STRING_VIEW
struct implicitly_convertible_to_std_string_view {
operator std::string_view() const { return "foo"; }
};

TEST(base_test, no_implicit_conversion_to_std_string_view) {
EXPECT_FALSE(
fmt::is_formattable<implicitly_convertible_to_std_string_view>::value);
}
#endif

// std::is_constructible is broken in MSVC until version 2015.
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1900
struct explicitly_convertible_to_string_view {
explicit operator fmt::string_view() const { return "foo"; }
};
Expand All @@ -769,7 +754,16 @@ TEST(base_test, format_explicitly_convertible_to_string_view) {
!fmt::is_formattable<explicitly_convertible_to_string_view>::value, "");
}

# ifdef FMT_USE_STRING_VIEW
#if FMT_CPLUSPLUS >= 201703L
struct implicitly_convertible_to_std_string_view {
operator std::string_view() const { return "foo"; }
};

TEST(base_test, no_implicit_conversion_to_std_string_view) {
EXPECT_FALSE(
fmt::is_formattable<implicitly_convertible_to_std_string_view>::value);
}

struct explicitly_convertible_to_std_string_view {
explicit operator std::string_view() const { return "foo"; }
};
Expand All @@ -781,8 +775,7 @@ TEST(base_test, format_explicitly_convertible_to_std_string_view) {
!fmt::is_formattable<explicitly_convertible_to_std_string_view>::value,
"");
}
# endif
#endif
#endif // FMT_CPLUSPLUS >= 201703L

TEST(base_test, has_formatter) {
EXPECT_TRUE((fmt::detail::has_formatter<const const_formattable, char>()));
Expand Down
Loading

0 comments on commit 3ceedda

Please sign in to comment.