Skip to content

Commit 2215192

Browse files
committed
Merge branch 'refactor'
2 parents 49ac17c + be40c1f commit 2215192

File tree

20 files changed

+136
-164
lines changed

20 files changed

+136
-164
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
- Remove dependency on libfmt
78
- Library update
8-
- fmt 11.2.0
9-
- GRRMOD (670f84601a5086c4d3eeb03bd3041e3c0a7f0ace)
10-
- GRRLIB (c3f2acfee7a4a93e35ade02408daa1508c9309f5)
9+
- GRRMOD (eaebb7a92dcacd4e74ec600b2d0056a5fac408c7)
10+
- GRRLIB (8feae891610ccd08ea2d2cb5d987fc74c47ad57c)
1111

1212
## 1.1.0
1313

CMakeLists.txt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.24)
1+
cmake_minimum_required(VERSION 3.25)
22
project(Wii-Tac-Toe)
33

44
find_library(AESND aesnd
@@ -17,21 +17,17 @@ pkg_check_modules(FREETYPE REQUIRED freetype2)
1717
pkg_check_modules(MXML REQUIRED mxml)
1818

1919
include(FetchContent)
20-
FetchContent_Declare(fmt
21-
URL https://github.com/fmtlib/fmt/archive/refs/tags/11.2.0.tar.gz
22-
)
2320
FetchContent_Declare(grrlib
2421
GIT_REPOSITORY https://github.com/GRRLIB/GRRLIB.git
25-
GIT_TAG c3f2acfee7a4a93e35ade02408daa1508c9309f5
22+
GIT_TAG 8feae891610ccd08ea2d2cb5d987fc74c47ad57c
2623
)
2724
FetchContent_Declare(grrmod
28-
URL https://codeload.github.com/GRRLIB/GRRMOD/tar.gz/670f84601a5086c4d3eeb03bd3041e3c0a7f0ace
25+
URL https://codeload.github.com/GRRLIB/GRRMOD/tar.gz/eaebb7a92dcacd4e74ec600b2d0056a5fac408c7
2926
)
30-
set(FMT_INSTALL OFF CACHE BOOL "Don't install" FORCE)
3127
set(GRRLIB_INSTALL OFF CACHE BOOL "Don't install" FORCE)
3228
set(GRRMOD_INSTALL OFF CACHE BOOL "Don't install" FORCE)
3329
set(GRRMOD_USE_MP3 OFF CACHE BOOL "Don't use MP3" FORCE)
34-
FetchContent_MakeAvailable(fmt grrlib grrmod)
30+
FetchContent_MakeAvailable(grrlib grrmod)
3531

3632
file(GLOB_RECURSE SRC_FILES
3733
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp"
@@ -44,15 +40,17 @@ file(GLOB_RECURSE BIN_FILES
4440

4541
add_executable(Wii-Tac-Toe)
4642

47-
target_compile_features(Wii-Tac-Toe PRIVATE cxx_std_23)
43+
target_compile_features(Wii-Tac-Toe PRIVATE cxx_std_26)
4844

4945
target_compile_options(Wii-Tac-Toe PRIVATE
5046
-Werror
5147
-Wall
48+
-Wextra
5249
-Wunused
5350
-Wmisleading-indentation
5451
-Wduplicated-cond
5552
-Wduplicated-branches
53+
-Wsuggest-override
5654
)
5755

5856
target_sources(Wii-Tac-Toe PRIVATE
@@ -70,7 +68,6 @@ dkp_add_embedded_binary_library(data
7068

7169
target_link_libraries(Wii-Tac-Toe PRIVATE
7270
data
73-
fmt::fmt
7471
grrlib
7572
grrmod
7673
${PNG_LIBRARIES}

CMakePresets.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"name": "base",
66
"generator": "Ninja",
77
"binaryDir": "${sourceDir}/build/${presetName}",
8-
"hidden": true
8+
"hidden": true,
9+
"cacheVariables": {
10+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
11+
}
912
},
1013
{
1114
"name": "wiiu",

languages/english.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<turn_over>
4141
<message text="{}, it's your turn." />
4242
<message text="Waiting for {}." />
43-
<message text="{} is thinking of is next move." />
43+
<message text="{} is thinking of his next move." />
4444
<message text="{} should take the Wii Remote and play." />
4545
<message text="{}, let's play." />
4646
<message text="{} should play now." />

languages/spanish.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<language type="spanish" translator="Duhow">
33
<translation from="Programmer: {}" to="Programador: {}" />
4-
<translation from="Graphics: {}" to="Graficos: {}" />
5-
<translation from="Press The A Button" to="Pulsa el boton A" />
4+
<translation from="Graphics: {}" to="Gráficos: {}" />
5+
<translation from="Press The A Button" to="Pulsa el botón A" />
66

77
<translation from="Ver. {}" to="Ver. {}" />
88
<translation from="2 Players (1 Wiimote)" to="2 Jugadores (1 Wii Remote)" />

source/audio.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@ static constexpr Sound RollOverSound(VOICE_MONO16, std::span{button_rollover_raw
2121
/**
2222
* Constructor for the Audio class.
2323
*/
24-
Audio::Audio() :
25-
Paused(false)
24+
Audio::Audio()
2625
{
2726
AESND_Init();
2827
AESND_Pause(false);
2928

3029
GRRMOD_Init(true);
3130
GRRMOD_SetMOD(tic_tac_mod, sizeof(tic_tac_mod));
3231

33-
ScreenVoice = new Voice();
34-
ButtonVoice = new Voice();
32+
ScreenVoice = std::make_unique<Voice>();
33+
ButtonVoice = std::make_unique<Voice>();
3534
}
3635

3736
/**
@@ -42,9 +41,6 @@ Audio::~Audio()
4241
GRRMOD_Unload();
4342
GRRMOD_End();
4443
AESND_Pause(true);
45-
46-
delete ScreenVoice;
47-
delete ButtonVoice;
4844
}
4945

5046
/**

source/audio.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#ifndef AudioH
77
#define AudioH
88
//---------------------------------------------------------------------------
9+
#include <memory>
10+
911
// Forward declarations
1012
class Voice;
1113

@@ -26,9 +28,9 @@ class Audio
2628
void PlaySoundScreenChange(u16 Volume);
2729
void PlaySoundButton(u16 Volume);
2830
private:
29-
bool Paused;
30-
Voice *ScreenVoice;
31-
Voice *ButtonVoice;
31+
bool Paused{false};
32+
std::unique_ptr<Voice> ScreenVoice;
33+
std::unique_ptr<Voice> ButtonVoice;
3234
};
3335
//---------------------------------------------------------------------------
3436
#endif

source/button.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@
1313
* @param[in] NewType Button type.
1414
*/
1515
Button::Button(buttonType NewType) : Object(),
16-
Focused(false),
17-
Selected(false),
18-
Caption(""),
19-
Font(nullptr),
20-
TextWidth(100), // random value
21-
TextHeight(14),
22-
TextTop(0),
23-
TextLeft(0),
24-
TextColor(0x000000FF),
2516
Type(NewType)
2617
{
2718
switch(Type)

source/button.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ enum class buttonType : u8 {
2828
class Button : public Object
2929
{
3030
public:
31-
Button(buttonType = buttonType::StdMenu);
31+
Button() = delete;
32+
Button(buttonType NewType);
3233
Button(Button const&) = delete;
3334
~Button() = default;
3435
Button& operator=(Button const&) = delete;
@@ -40,16 +41,16 @@ class Button : public Object
4041
void SetTextColor(u32 NewColor);
4142
void SetTextHeight(unsigned int NewHeight);
4243
private:
43-
bool Focused;
44-
bool Selected;
45-
std::string Caption;
46-
GRRLIB_ttfFont *Font;
47-
unsigned int TextWidth;
48-
unsigned int TextHeight;
49-
unsigned int TextTop;
50-
unsigned int TextLeft;
51-
u32 TextColor;
52-
buttonType Type;
44+
bool Focused{false};
45+
bool Selected{false};
46+
std::string Caption{};
47+
GRRLIB_ttfFont *Font{nullptr};
48+
unsigned int TextWidth{100}; // random default value
49+
unsigned int TextHeight{14};
50+
unsigned int TextTop{0};
51+
unsigned int TextLeft{0};
52+
u32 TextColor{0x000000FF};
53+
buttonType Type{buttonType::StdMenu};
5354
std::unique_ptr<Texture> ButtonImgOn;
5455
std::unique_ptr<Texture> ButtonImgOff;
5556
std::unique_ptr<Texture> ButtonSelected;

0 commit comments

Comments
 (0)