duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

gsvector_formatter.h (585B)


      1 // SPDX-FileCopyrightText: 2024 Connor McLaughlin <stenzek@gmail.com>
      2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
      3 
      4 #pragma once
      5 
      6 #include "gsvector.h"
      7 #include "small_string.h"
      8 
      9 #include "fmt/format.h"
     10 
     11 template<>
     12 struct fmt::formatter<GSVector4i> : formatter<std::string_view>
     13 {
     14   auto format(const GSVector4i& rc, format_context& ctx) const
     15   {
     16     const TinyString str =
     17       TinyString::from_format("{},{} => {},{} ({}x{})", rc.left, rc.top, rc.right, rc.bottom, rc.width(), rc.height());
     18 
     19     return fmt::formatter<std::string_view>::format(str.view(), ctx);
     20   }
     21 };