11#include < cstdio>
22#include < cstdlib>
33#include < ctime>
4+ #include < chrono>
45#include < charconv>
56#include < limits>
7+ #include < format>
68#include < wiiuse/wpad.h>
79#include < ogc/conf.h>
810#include < ogc/lwp_watchdog.h>
911#include " grrlib.h"
1012#include " grrlib_class.h"
11- #include " fmt/format.h"
12- #include " fmt/chrono.h"
1313#include " tools.h"
1414#include " grid.h"
1515#include " audio.h"
@@ -138,10 +138,10 @@ Game::Game(u16 GameScreenWidth, u16 GameScreenHeight) :
138138 // Build Start Screen background
139139 SplashImg->Draw (0 , 0 );
140140 GRRLIB_PrintfTTF (50 , 310 , DefaultFont,
141- fmt ::format (fmt::runtime (Lang->String (" Programmer: {}" )), " Crayon" ).c_str (),
141+ std ::format (std::runtime_format (Lang->String (" Programmer: {}" )), " Crayon" ).c_str (),
142142 11 , 0xFFFFFFFF );
143143 GRRLIB_PrintfTTF (50 , 330 , DefaultFont,
144- fmt ::format (fmt::runtime (Lang->String (" Graphics: {}" )), " Mr_Nick666" ).c_str (),
144+ std ::format (std::runtime_format (Lang->String (" Graphics: {}" )), " Mr_Nick666" ).c_str (),
145145 11 , 0xFFFFFFFF );
146146 text = Lang->String (" Press The A Button" );
147147 GRRLIB_PrintfTTF ((ScreenWidth / 2 ) - (GRRLIB_WidthTTF (DefaultFont, text.c_str (), 20 ) / 2 ),
@@ -232,7 +232,7 @@ void Game::Paint()
232232 if (ShowFPS == true )
233233 {
234234 CalculateFrameRate ();
235- const auto strFPS = fmt ::format (" FPS: {}" , FPS);
235+ const auto strFPS = std ::format (" FPS: {}" , FPS);
236236 GRRLIB_PrintfTTF (14 , 444 , DefaultFont, strFPS.c_str (), 17 , 0xFFFFFFFF );
237237 GRRLIB_PrintfTTF (16 , 446 , DefaultFont, strFPS.c_str (), 17 , 0x808080FF );
238238 GRRLIB_PrintfTTF (15 , 445 , DefaultFont, strFPS.c_str (), 17 , 0x000000FF );
@@ -484,7 +484,7 @@ void Game::MenuScreen(bool CopyScreen)
484484 Rectangle (0 , 385 , ScreenWidth, 95 , 0x000000FF , 1 );
485485
486486 GRRLIB_PrintfTTF (500 , 40 , DefaultFont,
487- fmt ::format (fmt::runtime (Lang->String (" Ver. {}" )), " 1.1.0" ).c_str (),
487+ std ::format (std::runtime_format (Lang->String (" Ver. {}" )), " 1.1.0" ).c_str (),
488488 12 , 0xFFFFFFFF );
489489
490490 if (CopyScreen == true )
@@ -742,8 +742,8 @@ bool Game::ControllerManager()
742742 WPAD_Rumble (WPAD_CHAN_ALL, 1 ); // Rumble on
743743 WIILIGHT_TurnOn ();
744744
745- const std:: time_t now = std::time ( nullptr );
746- const auto path = fmt ::format (" sd:/Screenshot {:%F %H%M%S}.png" , * std::localtime (& now) );
745+ const auto now = std::chrono::time_point_cast<std::chrono::seconds>( std::chrono::system_clock::now () );
746+ const auto path = std ::format (" sd:/Screenshot {:%F %H%M%S}.png" , now);
747747
748748 if (ScreenShot (path) == true )
749749 {
@@ -774,7 +774,7 @@ void Game::Clear()
774774 GameGrid->Clear ();
775775 CurrentPlayer = PlayerToStart;
776776 PlayerToStart = !PlayerToStart; // Next other player will start
777- text = fmt ::format (fmt::runtime (Lang->GetTurnOverMessage ()), WTTPlayer[CurrentPlayer].GetName ());
777+ text = std ::format (std::runtime_format (Lang->GetTurnOverMessage ()), WTTPlayer[CurrentPlayer].GetName ());
778778 RoundFinished = false ;
779779 Copied = false ;
780780 ChangeCursor ();
@@ -790,7 +790,7 @@ void Game::TurnIsOver()
790790 { // A winner is declare
791791 GameWinner = (GameWinner == WTTPlayer[0 ].GetSign ()) ? 0 : 1 ;
792792 WTTPlayer[GameWinner].IncScore ();
793- text = fmt ::format (fmt::runtime (Lang->GetWinningMessage ()),
793+ text = std ::format (std::runtime_format (Lang->GetWinningMessage ()),
794794 WTTPlayer[GameWinner].GetName (), WTTPlayer[!GameWinner].GetName ());
795795 RoundFinished = true ;
796796 SymbolAlpha = 5 ;
@@ -805,7 +805,7 @@ void Game::TurnIsOver()
805805 else
806806 {
807807 CurrentPlayer = !CurrentPlayer; // Change player's turn
808- text = fmt ::format (fmt::runtime (Lang->GetTurnOverMessage ()), WTTPlayer[CurrentPlayer].GetName ());
808+ text = std ::format (std::runtime_format (Lang->GetTurnOverMessage ()), WTTPlayer[CurrentPlayer].GetName ());
809809 }
810810
811811 Copied = false ;
0 commit comments