git repos / blockattack-game

commit 16476649

Poul Sander · 2022-01-09 10:29
1647664906f24787fd521ea359b214c07e18afb0 patch · browse files
parent 325b4507160aa8f7df2ee54b4eda1d93c6414846

Use {fmt} for internal formatting (#31)

* Start using libfmt for internal formatting
* Update README with libfmt info
* Remove the SPrintCF that we do not need anymore

Changed files

M .github/workflows/main.yml before
M CHANGELOG.md before
M CMakeLists.txt before
M README.md before
M source/code/DialogBox.cpp before
M source/code/ScoresDisplay.cpp before
M source/code/ScoresDisplay.hpp before
M source/code/ShowFileState.cpp before
M source/code/ShowFileState.hpp before
M source/code/common.cpp before
M source/code/common.h before
M source/code/highscore.cpp before
M source/code/levelselect.cpp before
M source/code/main.cpp before
M source/code/menudef.cpp before
D source/misc/docker/Dockerfile.Fedora25build before
M source/misc/docker/Dockerfile.Fedora29build before
M source/misc/docker/Dockerfile.Ubuntu18.04build before
M source/misc/docker/Dockerfile.Ubuntu20.04build before
M source/misc/standalone/compile_requirements.sh before
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d589ab3..dd85d2e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml
@@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- name: Check lint
run: bash source/misc/lint/runLint.sh
- - name: Test Fedora 25
- run: docker build -f source/misc/docker/Dockerfile.Fedora25build . -t blockattack_test
+ - name: Test Fedora 29
+ run: docker build -f source/misc/docker/Dockerfile.Fedora29build . -t blockattack_test
- name: Test Windows MXE
run: docker build -f source/misc/docker/Dockerfile.WindoesBuild . -t blockattack_test
diff --git a/CHANGELOG.md b/CHANGELOG.md index 15f21f5..09f4a87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
# Changelog
+## Unreleased
+
+### Changed
+ - Now uses libfmt for internal formatting
+
## [2.7.0] - 2021-10-23
### Added
diff --git a/CMakeLists.txt b/CMakeLists.txt index fde8f42..6f9244c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -88,6 +88,7 @@ include_directories("source/code/Libs/include/cereal/external") #Contains rapid
#building/compiling/linking
add_executable(blockattack ${GUI_TYPE} ${SOURCES} ${RES_FILES})
target_link_libraries( blockattack ${SDL2_LIBRARIES})
+target_link_libraries( blockattack fmt)
target_link_libraries( blockattack physfs)
target_link_libraries( blockattack ${SDL2MIXER_LIBRARIES} ${SDL2IMAGE_LIBRARIES} ${SDL2TTF_LIBRARIES})
target_link_libraries( blockattack ${Boost_LIBRARIES} )
diff --git a/README.md b/README.md index 1e38c57..cf7caad 100644 --- a/README.md +++ b/README.md
@@ -15,6 +15,7 @@ Source: <https://github.com/blockattack/blockattack-game>
* libSDL2_mixer
* libSDL2_ttf
* libphysfs
+* libfmt
* libboost (only needed for compiling)
* libboost-program-options
@@ -40,15 +41,8 @@ You can also choose to install it with
sudo make install
```
-Windows build uses MXE (mxe.cc) with these installed:
-```
-sdl2 sdl2_image sdl2_mixer sdl2_ttf physfs libtool gettext freetype zlib boost
-```
+Windows build uses MXE (mxe.cc) and Docker. See "Building with Docker".
-Compiled with:
-```
-i686-w64-mingw32.static-cmake -DCMAKE_BUILD_TYPE=Release . && make
-```
## Building using Docker
diff --git a/source/code/DialogBox.cpp b/source/code/DialogBox.cpp index 67627e3..83127d3 100644 --- a/source/code/DialogBox.cpp +++ b/source/code/DialogBox.cpp
@@ -28,6 +28,7 @@ http://www.blockattack.net
#include "utf8.h"
#include "MenuSystem.h"
#include <unordered_map>
+#include <fmt/core.h>
static void setButtonFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text) {
field.SetHolder(holder);
@@ -54,7 +55,7 @@ static void draw_rect_cache_clear() {
static void DrawRect(SDL_Renderer* target, int topx, int topy, int height, int width, const std::string& name) {
const int size = 32;
SDL_Rect dstrect = { topx, topy, width, height };
- std::string key_name = SPrintStringF("%s-%d-%d", name.c_str(),width, height);
+ std::string key_name = fmt::format("{}-{}-{}", name, width, height);
Uint64 new_version = globalData.spriteHolder->GetDataHolder().getVersion();
if (draw_rect_cache_version != new_version) {
draw_rect_cache_clear();
diff --git a/source/code/ScoresDisplay.cpp b/source/code/ScoresDisplay.cpp index 3de3bb7..785c9ea 100644 --- a/source/code/ScoresDisplay.cpp +++ b/source/code/ScoresDisplay.cpp
@@ -26,6 +26,7 @@ http://www.blockattack.net
#include "common.h"
#include "stats.h"
#include "MenuSystem.h"
+#include <fmt/core.h>
const int buttonOffsetX = 140;
const int buttonOffsetY = 180;
@@ -55,6 +56,11 @@ void ScoresDisplay::Write(SDL_Renderer* target, int x, int y, const char* text)
getCachedText(text)->Draw(target, x, y);
}
+
+void ScoresDisplay::Write(SDL_Renderer* target, int x, int y, const std::string& text) {
+ Write(target, x, y, text.c_str());
+}
+
const int numberOfPages = 7;
void ScoresDisplay::DrawBackgroundAndCalcPlacements() {
@@ -149,26 +155,26 @@ void ScoresDisplay::DrawStats() {
Write(globalData.screen, 10,y, _("Run time: ") );
commonTime ct = TimeHandler::peekTime("totalTime",TimeHandler::ms2ct(SDL_GetTicks()));
y+=y_spacing;
- Write(globalData.screen, 10, y, SPrintCF( _("Days: %i"), ct.days) );
+ Write(globalData.screen, 10, y, fmt::format( _("Days: {}"), ct.days) );
y+=y_spacing;
- Write(globalData.screen, 10, y, SPrintCF( _("Hours: %i"), ct.hours) );
+ Write(globalData.screen, 10, y, fmt::format( _("Hours: {:02}"), ct.hours) );
y+=y_spacing;
- Write(globalData.screen, 10, y, SPrintCF( _("Minutes: %i"), ct.minutes) );
+ Write(globalData.screen, 10, y, fmt::format( _("Minutes: {:02}"), ct.minutes) );
y+=y_spacing;
- Write(globalData.screen, 10, y, SPrintCF( _("Seconds: %i"), ct.seconds) );
+ Write(globalData.screen, 10, y, fmt::format( _("Seconds: {:02}"), ct.seconds) );
y-=y_spacing*4; //Four rows back
const int x_offset3 = globalData.xsize/3+10; //Ofset for three rows
Write(globalData.screen, x_offset3,y, _("Play time: ") );
ct = TimeHandler::getTime("playTime");
y+=y_spacing;
- Write(globalData.screen, x_offset3, y, SPrintCF( _("Days: %i"), ct.days) );
+ Write(globalData.screen, x_offset3, y, fmt::format( _("Days: {}"), ct.days) );
y+=y_spacing;
- Write(globalData.screen, x_offset3, y, SPrintCF( _("Hours: %i"), ct.hours) );
+ Write(globalData.screen, x_offset3, y, fmt::format( _("Hours: {:02}"), ct.hours) );
y+=y_spacing;
- Write(globalData.screen, x_offset3, y, SPrintCF( _("Minutes: %i"), ct.minutes) );
+ Write(globalData.screen, x_offset3, y, fmt::format( _("Minutes: {:02}"), ct.minutes) );
y+=y_spacing;
- Write(globalData.screen, x_offset3, y, SPrintCF( _("Seconds: %i"), ct.seconds) );
+ Write(globalData.screen, x_offset3, y, fmt::format( _("Seconds: {:02}"), ct.seconds) );
const int x_offset = globalData.xsize/2+10;
y = 5+y_spacing*2;
@@ -225,7 +231,7 @@ void ScoresDisplay::Draw(SDL_Renderer*) {
nextLabel.Draw(globalData.screen, nextX+60, nextY+10, sago::SagoTextField::Alignment::center);
//Draw page number
- std::string pageXofY = SPrintStringF(_("Page %i of %i"), page+1, numberOfPages);
+ std::string pageXofY = fmt::format(_("Page {} of {}"), page+1, numberOfPages);
getCachedText(pageXofY)->Draw(globalData.screen, globalData.xsize/2, globalData.ysize-60, sago::SagoTextField::Alignment::center);
}
@@ -286,4 +292,4 @@ void ScoresDisplay::Update() {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/source/code/ScoresDisplay.hpp b/source/code/ScoresDisplay.hpp index 8c4d42b..104762f 100644 --- a/source/code/ScoresDisplay.hpp +++ b/source/code/ScoresDisplay.hpp
@@ -35,12 +35,12 @@ public:
ScoresDisplay();
ScoresDisplay(const ScoresDisplay& orig) = delete;
virtual ~ScoresDisplay();
-
+
bool IsActive() override;
void Draw(SDL_Renderer* target) override;
void ProcessInput(const SDL_Event& event, bool &processed) override;
void Update() override;
-
+
int page = 0;
//button coodinates:
int scoreX = 0;
@@ -58,6 +58,7 @@ private:
void DrawStats();
void DrawBackgroundAndCalcPlacements();
void Write(SDL_Renderer* target, int x, int y, const char* text);
+ void Write(SDL_Renderer* target, int x, int y, const std::string& text);
sago::SagoTextField* getCachedText(const std::string& text);
std::map<std::string, std::shared_ptr<sago::SagoTextField> > fieldCache;
bool isActive = true;
diff --git a/source/code/ShowFileState.cpp b/source/code/ShowFileState.cpp index dfd574f..d965343 100644 --- a/source/code/ShowFileState.cpp +++ b/source/code/ShowFileState.cpp
@@ -23,6 +23,7 @@ https://blockattack.net
#include "global.hpp"
#include "common.h"
#include "MenuSystem.h"
+#include <fmt/core.h>
const int buttonOffset = 160;
extern sago::SagoSprite bExit;
@@ -45,6 +46,12 @@ ShowFileState::ShowFileState() {
ShowFileState::~ShowFileState() {
}
+void ShowFileState::SetData(const std::string& filename, const std::string& header) {
+ titleField.SetText(header);
+ infoBox.SetText(sago::GetFileContent(filename));
+ filenameField.SetText(fmt::format(_("Showing content of: {}"), filename));
+}
+
bool ShowFileState::IsActive() {
return isActive;
}
diff --git a/source/code/ShowFileState.hpp b/source/code/ShowFileState.hpp index 19b8be4..d41e0e2 100644 --- a/source/code/ShowFileState.hpp +++ b/source/code/ShowFileState.hpp
@@ -33,18 +33,14 @@ public:
ShowFileState();
ShowFileState(const ShowFileState& orig) = delete;
virtual ~ShowFileState();
-
+
bool IsActive() override;
void Draw(SDL_Renderer* target) override;
void ProcessInput(const SDL_Event& event, bool &processed) override;
void Update() override;
- void SetData(const std::string& filename, const std::string& header) {
- titleField.SetText(header);
- infoBox.SetText(sago::GetFileContent(filename));
- filenameField.SetText(SPrintStringF(_("Showing content of: %s"), filename.c_str()));
- }
-
+ void SetData(const std::string& filename, const std::string& header);
+
private:
bool isActive = true;
bool bMouseUp = true;
diff --git a/source/code/common.cpp b/source/code/common.cpp index 134d90e..70f06eb 100644 --- a/source/code/common.cpp +++ b/source/code/common.cpp
@@ -49,25 +49,6 @@ double str2double(const std::string& str2parse) {
}
}
-std::string SPrintStringF(const char* fmt, ...) {
- std::string ret;
- char buffer[1024];
- va_list args;
- va_start(args, fmt);
- vsnprintf(buffer, sizeof(buffer), fmt, args);
- ret = buffer;
- va_end(args);
- return ret;
-}
-
-const char* SPrintCF(const char* fmt, ...) {
- static char buffer[1024];
- va_list args;
- va_start(args, fmt);
- vsnprintf(buffer, sizeof(buffer), fmt, args);
- va_end(args);
- return buffer;
-}
int str2int(const std::string& str2parse) {
try {
diff --git a/source/code/common.h b/source/code/common.h index c72650e..446db22 100644 --- a/source/code/common.h +++ b/source/code/common.h
@@ -66,24 +66,6 @@ void dieOnNullptr(bool, const char* msg);
*/
double str2double(const std::string &str2parse) __attribute__((const));
-/**
- * Does the equivalent to snprintf but returns a C++ string
- * @param fmt The format string
- * @param ... Additional parameters for the place holders
- * @return A string with the result
- */
-std::string SPrintStringF(const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
-
-/**
- * Prints to an internal C-buffer
- * Because it uses an internal buffer the returned buffer is only valid until the next call
- * The String is cut at 1024 chars (including the 0 terminator)
- * @param fmt The format string
- * @param ... Additional parameters for the place holders
- * @return Pointer to an internal buffer
- */
-const char* SPrintCF(const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
-
class TimeHandler
{
public:
diff --git a/source/code/highscore.cpp b/source/code/highscore.cpp index 758177f..c7d1479 100644 --- a/source/code/highscore.cpp +++ b/source/code/highscore.cpp
@@ -29,6 +29,7 @@ https://blockattack.net
#include "sago/SagoMisc.hpp"
#include <algorithm>
#include "common.h"
+#include <fmt/core.h>
namespace cereal {
@@ -53,11 +54,8 @@ bool record_sorter (const record& i,const record& j) {
Highscore::Highscore(const std::string& type, double speed) : filename(type+".json.dat"), type(type), speed(speed) {
if (speed < 0.4) {
- std::string old_locale = setlocale (LC_NUMERIC, nullptr);
- setlocale (LC_NUMERIC, "C");
//Use special filenames for higher speeds (higher speed = lower number)
- filename = SPrintStringF("%s_%.4f.json.dat", type.c_str(), speed);
- setlocale(LC_NUMERIC, old_locale.c_str());
+ filename = fmt::format("{}_{:.4f}.json.dat", type, speed);
}
std::string readFileContent = sago::GetFileContent(filename.c_str());
if (readFileContent.length() > 0) {
diff --git a/source/code/levelselect.cpp b/source/code/levelselect.cpp index 004a385..8a193f9 100644 --- a/source/code/levelselect.cpp +++ b/source/code/levelselect.cpp
@@ -28,6 +28,7 @@ https://blockattack.net
#include "puzzlehandler.hpp"
#include "stageclearhandler.hpp"
#include "MenuSystem.h"
+#include <fmt/core.h>
static bool bMouseUp; //true if the mouse(1) is unpressed
@@ -190,16 +191,16 @@ int PuzzleLevelSelect(int Type) {
}
if (Type == 1) {
- std::string scoreString = SPrintStringF(_("Best score: %i"), GetStageScores(selected)) ;
- std::string timeString = SPrintStringF(_("Time used: %s"),"-- : --");
+ std::string scoreString = fmt::format(_("Best score: {}"), GetStageScores(selected)) ;
+ std::string timeString = fmt::format(_("Time used: {}"),"-- : --");
if (GetStageTime(selected)>0) {
- timeString = SPrintStringF(_("Time used: %d : %02d"), GetStageTime(selected)/1000/60, (GetStageTime(selected)/1000)%60);
+ timeString = fmt::format(_("Time used: {} : {:02}"), GetStageTime(selected)/1000/60, (GetStageTime(selected)/1000)%60);
}
Write(globalData.screen, 200,200,scoreString.c_str());
Write(globalData.screen, 200,250,timeString.c_str());
- std::string totalString = SPrintStringF(_("Total score: %i in %i:%02i"), totalScore, totalTime/1000/60, ((totalTime/1000)%60) );
+ std::string totalString = fmt::format(_("Total score: {} in {}:{:02}"), totalScore, totalTime/1000/60, ((totalTime/1000)%60) );
Write(globalData.screen, 200,600,totalString.c_str());
}
diff --git a/source/code/main.cpp b/source/code/main.cpp index 670d015..c6d7b0a 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -28,6 +28,7 @@ https://blockattack.net
#include "os.hpp"
#include <string.h>
+#include <fmt/core.h>
#include "version.h"
@@ -862,10 +863,10 @@ static void ParseArguments(int argc, char* argv[], globalConfig& conf) {
#ifdef REPLAY_IMPLEMENTED
("play-replay", boost::program_options::value<std::string>(), "Start a replay")
#endif
- ("bind-text-domain", boost::program_options::value<std::string>(), SPrintStringF("Overwrites the bind text domain used for finding translations. "
- "Default: \"%s\"", LOCALEDIR).c_str())
- ("homepath", boost::program_options::value<std::string>(), SPrintStringF("Set the home folder where settings are saved. The directory will be created if it does not exist."
- " Default: \"%s\"", getPathToSaveFiles().c_str()).c_str())
+ ("bind-text-domain", boost::program_options::value<std::string>(), fmt::format("Overwrites the bind text domain used for finding translations. "
+ "Default: \"{}\"", LOCALEDIR).c_str())
+ ("homepath", boost::program_options::value<std::string>(), fmt::format("Set the home folder where settings are saved. The directory will be created if it does not exist."
+ " Default: \"{}\"", getPathToSaveFiles()).c_str())
("mod,m", boost::program_options::value<std::vector<std::string> >(), "Loads a mod. Later mods have preference")
;
@@ -897,9 +898,9 @@ static void ParseArguments(int argc, char* argv[], globalConfig& conf) {
conf.savepath = getPathToSaveFiles();
}
if (vm.count("help")) {
- std::cout << SPrintStringF("Block Attack - Rise of the blocks %s\n\n"
+ std::cout << fmt::format("Block Attack - Rise of the blocks {}\n\n"
"Block Attack - Rise of the Blocks is a puzzle/blockfall game inspired by Tetris Attack for the SNES.\n\n"
- "%s\n\n", VERSION_NUMBER, "www.blockattack.net");
+ "{}\n\n", VERSION_NUMBER, "www.blockattack.net");
std::cout << "Usage: "<< commandname << " [OPTION]..." << "\n";
std::cout << desc << "\n";
std::cout << "Examples:" << "\n";
@@ -914,7 +915,7 @@ static void ParseArguments(int argc, char* argv[], globalConfig& conf) {
if (vm.count("version")) {
std::cout << "blockattack " << VERSION_NUMBER << "\n";
std::cout << "\n";
- std::cout << "Copyright (C) 2005-2016 Poul Sander" << "\n";
+ std::cout << "Copyright (C) 2005-2022 Poul Sander" << "\n";
std::cout << "License GPLv2+: GNU GPL version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> or later <http://gnu.org/licenses/gpl.html>" << "\n";
std::cout << "This is free software: you are free to change and redistribute it." << "\n";
std::cout << "There is NO WARRANTY, to the extent permitted by law." << "\n";
@@ -1048,7 +1049,7 @@ int main(int argc, char* argv[]) {
if (globalData.verboseLevel) {
//Copyright notice:
- std::cout << "Block Attack - Rise of the Blocks (" << VERSION_NUMBER << ")" << "\n" << "http://www.blockattack.net" << "\n" << "Copyright 2004-2016 Poul Sander" << "\n" <<
+ std::cout << "Block Attack - Rise of the Blocks (" << VERSION_NUMBER << ")" << "\n" << "http://www.blockattack.net" << "\n" << "Copyright 2004-2022 Poul Sander" << "\n" <<
"A SDL2 based game (see www.libsdl.org)" << "\n" <<
"The game is available under the GPL, see COPYING for details." << "\n";
std::cout << "-------------------------------------------" << "\n";
@@ -1271,7 +1272,7 @@ int main(int argc, char* argv[]) {
commonTime ct = TimeHandler::ms2ct(SDL_GetTicks());
if (globalData.verboseLevel) {
- std::cout << SPrintStringF("Block Attack - Rise of the Blocks ran for: %i hours %i mins and %i secs", ct.hours, ct.minutes, ct.seconds) << "\n";
+ std::cout << fmt::format("Block Attack - Rise of the Blocks ran for: {} hours {:02} minutes and {:02} seconds", ct.hours, ct.minutes, ct.seconds) << "\n";
}
/*std::string modListString;
@@ -1283,7 +1284,7 @@ int main(int argc, char* argv[]) {
}*/
ct = TimeHandler::addTime("totalTime",ct);
if (globalData.verboseLevel) {
- std::cout << "Total run time is now: " << ct.days << " days " << ct.hours << " hours " << ct.minutes << " mins and " << ct.seconds << " secs" << "\n";
+ std::cout << fmt::format("Total run time is now: {} days, {} hours, {:02} minutes and {:02} seconds\n", ct.days, ct.hours, ct.minutes, ct.seconds);
//std::cout << "Mods loaded: " << modListString << "\n";
}
//sago::WriteFileContent(MODLIST_TXT, modListString);
diff --git a/source/code/menudef.cpp b/source/code/menudef.cpp index 75d7e12..1886ef6 100644 --- a/source/code/menudef.cpp +++ b/source/code/menudef.cpp
@@ -30,6 +30,7 @@ http://blockattack.net
#include "HelpAboutState.hpp"
#include "ShowFileState.hpp"
#include "ModConfigMenuState.hpp"
+#include <fmt/core.h>
#if 0
@@ -146,7 +147,7 @@ Button_confirmVolume::Button_confirmVolume(const char* cvar) : cvar{cvar} {
const std::string& Button_confirmVolume::getLabel() const {
int volumePct = Config::getInstance()->getInt(cvar)*100.0/MIX_MAX_VOLUME;
- this->volumeLabel = SPrintStringF(_("Volume: %d%%"), volumePct); // std::string(_("Volume: "))+ std::to_string(volumePct)+"%" ;
+ this->volumeLabel = fmt::format(_("Volume: {}%"), volumePct); // std::string(_("Volume: "))+ std::to_string(volumePct)+"%" ;
return volumeLabel;
}
@@ -170,7 +171,7 @@ Button_increaseVolume::Button_increaseVolume(const char* cvar, int incrementValu
value = -incrementValue;
}
value = value*100.0/MIX_MAX_VOLUME;
- setLabel(SPrintStringF("%c%.2f", prefix, value));
+ setLabel(fmt::format("{}{:.2f}", prefix, value));
}
void Button_increaseVolume::doAction() {
diff --git a/source/misc/docker/Dockerfile.Fedora25build b/source/misc/docker/Dockerfile.Fedora25build deleted file mode 100644 index 1215fe3..0000000 --- a/source/misc/docker/Dockerfile.Fedora25build +++ /dev/null
@@ -1,22 +0,0 @@
-FROM fedora:25
-
-RUN dnf -y install cmake \
-make \
-gcc-c++ \
-SDL2-devel \
-boost-devel \
-physfs-devel \
-SDL2_image-devel SDL2_ttf-devel SDL2_mixer-devel \
-findutils \
-gettext \
-zip \
-&& dnf -y clean all
-
-COPY . /staging/blockattack-game
-
-ENV BLOCKATTACK_VERSION 2.8.0-SNAPSHOT
-
-RUN cd /staging/blockattack-game && \
-./packdata.sh && \
-cmake . && \
-make
diff --git a/source/misc/docker/Dockerfile.Fedora29build b/source/misc/docker/Dockerfile.Fedora29build index 624eb81..fc27fda 100644 --- a/source/misc/docker/Dockerfile.Fedora29build +++ b/source/misc/docker/Dockerfile.Fedora29build
@@ -5,6 +5,7 @@ make \
gcc-c++ \
SDL2-devel \
boost-devel \
+fmt-devel \
physfs-devel \
SDL2_image-devel SDL2_ttf-devel SDL2_mixer-devel \
findutils \
diff --git a/source/misc/docker/Dockerfile.Ubuntu18.04build b/source/misc/docker/Dockerfile.Ubuntu18.04build index 9a3416b..44e3583 100644 --- a/source/misc/docker/Dockerfile.Ubuntu18.04build +++ b/source/misc/docker/Dockerfile.Ubuntu18.04build
@@ -1,6 +1,6 @@
FROM ubuntu:18.04
-RUN apt-get update && apt-get install -yy build-essential libphysfs-dev libboost-dev cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libboost-program-options-dev libutfcpp-dev zip gettext
+RUN apt-get update && apt-get install -yy build-essential libphysfs-dev libboost-dev libfmt-dev cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libboost-program-options-dev libutfcpp-dev zip gettext
RUN mkdir -p /staging/blockattack-game
diff --git a/source/misc/docker/Dockerfile.Ubuntu20.04build b/source/misc/docker/Dockerfile.Ubuntu20.04build index 93a1b73..68fe880 100644 --- a/source/misc/docker/Dockerfile.Ubuntu20.04build +++ b/source/misc/docker/Dockerfile.Ubuntu20.04build
@@ -5,7 +5,7 @@ ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-RUN apt-get update && apt-get install -yy build-essential libphysfs-dev libboost-dev cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libboost-program-options-dev libutfcpp-dev zip gettext
+RUN apt-get update && apt-get install -yy build-essential libphysfs-dev libboost-dev libfmt-dev cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libboost-program-options-dev libutfcpp-dev zip gettext
RUN mkdir -p /staging/blockattack-game
diff --git a/source/misc/standalone/compile_requirements.sh b/source/misc/standalone/compile_requirements.sh index 101dbca..3428065 100755 --- a/source/misc/standalone/compile_requirements.sh +++ b/source/misc/standalone/compile_requirements.sh
@@ -31,3 +31,7 @@ pushd boost_1_65_1
./bootstrap.sh --with-libraries=program_options
./b2 install -j 2 --prefix=/usr link=static
popd
+curl https://files.poulsander.com/~poul19/public_files/fmt-8.1.0.tar.gz | tar -xz
+pushd fmt-8.1.0
+cmake . -DFMT_TEST=OFF -DFMT_INSTALL=ON -DFMT_MASTER_PROJECT=OFF && make && make install
+popd