Skip to content

Commit 39a9316

Browse files
committed
easyrpg-player: adapt some code for fmtlib 10
XXX: more to do
1 parent b675b50 commit 39a9316

20 files changed

Lines changed: 389 additions & 1 deletion

games/easyrpg-player/distinfo

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1-
$NetBSD: distinfo,v 1.10 2022/01/16 14:32:01 nia Exp $
1+
$NetBSD: distinfo,v 1.11 2023/05/21 06:27:31 wiz Exp $
22

33
BLAKE2s (easyrpg-player-0.7.0.tar.xz) = c1e9805c977cde92314d10ed419c2ff26d63f48e946fe8152bc855e15cb6fa9e
44
SHA512 (easyrpg-player-0.7.0.tar.xz) = 112543adf2e95d68842f21fabeddf9dc5abbf2b2a1b64a5d9da29bf4e2d31c7b85cfb596c453ff1773922260a8e6d7c1cad40ff7bf1d1054a876ec2f5ef24444
55
Size (easyrpg-player-0.7.0.tar.xz) = 4845184 bytes
6+
SHA1 (patch-src_audio__generic.cpp) = 76191a584cfcd1586628841abe4017bade444fac
7+
SHA1 (patch-src_autobattle.cpp) = 1b87ac19f44cd6080cc5cea50fd739542acfbd8e
8+
SHA1 (patch-src_bitmap.cpp) = e9c05fa5743d0c40bf36de02a97d98dec41b5d7d
9+
SHA1 (patch-src_cache.cpp) = 3231d27a97e0374f95cf246a062e345f527f4299
10+
SHA1 (patch-src_dynrpg.cpp) = 99b238882e6564f61de62c7f6724f8638bf05012
11+
SHA1 (patch-src_dynrpg.h) = 3bc50392f13696df0e2e904f2f72c50984c258e0
12+
SHA1 (patch-src_enemyai.cpp) = 0d67b81d4a61a2567b4906e3a8ff2a75044b4061
13+
SHA1 (patch-src_filefinder.cpp) = 6c53511ddd1568f152d6259cf21b3e2aa7a99dd7
14+
SHA1 (patch-src_filefinder__rtp.cpp) = c67401a043bb2d3d84a4803afd9a8451ce693dd6
15+
SHA1 (patch-src_filesystem__root.cpp) = c5e35dc6660b1f46c55588d8564ab062efc24f30
16+
SHA1 (patch-src_game__character.cpp) = f0a8703d93ad158f19c59e7a01cefc9b2a9512c7
17+
SHA1 (patch-src_game__interpreter.cpp) = 142556d79cffcaa2875621c667cac8b68b9da9eb
18+
SHA1 (patch-src_game__interpreter__map.cpp) = 5bc2b652496ae9267601008df62841fc2a8dddb5
19+
SHA1 (patch-src_game__system.cpp) = acf994e16e723a29e56b20a4cb0e29e5736c83f8
20+
SHA1 (patch-src_meta.cpp) = 8d11b9811cd466b18c14f3ec84e21bff599efb2b
21+
SHA1 (patch-src_output.cpp) = 0a86385d32d008b37ca6bbf9be0c618b5e421c19
22+
SHA1 (patch-src_scene__battle__rpg2k.cpp) = 3df7de5bad294dc712575720368dc9c55dec67d3
23+
SHA1 (patch-src_scene__battle__rpg2k3.cpp) = 914273345c28c669a88414678fbc1c2c57fbab44
24+
SHA1 (patch-src_scene__debug.cpp) = db904615b52ced0971af0f18eb4c5abf7796b946
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
$NetBSD: patch-src_audio__generic.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/audio_generic.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/audio_generic.cpp
7+
@@ -167,7 +167,7 @@ void GenericAudio::SE_Play(Filesystem_St
8+
}
9+
}
10+
// FIXME Not displaying as warning because multiple games exhaust free channels available, see #1356
11+
- Output::Debug("Couldn't play {} SE. No free channel available", stream.GetName());
12+
+ Output::Debug("Couldn't play {} SE. No free channel available", std::string(stream.GetName()));
13+
}
14+
15+
void GenericAudio::SE_Stop() {
16+
@@ -191,7 +191,7 @@ bool GenericAudio::PlayOnChannel(BgmChan
17+
chan.stopped = false; // Unstop channel so the audio thread doesn't delete it
18+
19+
if (!filestream) {
20+
- Output::Warning("BGM file not readable: {}", filestream.GetName());
21+
+ Output::Warning("BGM file not readable: {}", std::string(filestream.GetName()));
22+
return false;
23+
}
24+
25+
@@ -247,7 +247,7 @@ bool GenericAudio::PlayOnChannel(BgmChan
26+
27+
return true;
28+
} else {
29+
- Output::Warning("Couldn't play BGM {}. Format not supported", filestream.GetName());
30+
+ Output::Warning("Couldn't play BGM {}. Format not supported", std::string(filestream.GetName()));
31+
}
32+
33+
return false;
34+
@@ -266,7 +266,7 @@ bool GenericAudio::PlayOnChannel(SeChann
35+
chan.paused = false; // Unpause channel -> Play it.
36+
return true;
37+
} else {
38+
- Output::Warning("Couldn't play SE {}. Format not supported", filestream.GetName());
39+
+ Output::Warning("Couldn't play SE {}. Format not supported", std::string(filestream.GetName()));
40+
}
41+
42+
return false;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD: patch-src_autobattle.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/autobattle.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/autobattle.cpp
7+
@@ -54,7 +54,7 @@ std::unique_ptr<AlgorithmBase> CreateAlg
8+
if (Utils::StrICmp(name, RpgRtCompat::name) != 0) {
9+
static bool warned = false;
10+
if (!warned) {
11+
- Output::Debug("Invalid AutoBattle algo name `{}' falling back to {} ...", name, RpgRtCompat::name);
12+
+ Output::Debug("Invalid AutoBattle algo name `{}' falling back to {} ...", std::string(name), RpgRtCompat::name);
13+
warned = true;
14+
}
15+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$NetBSD: patch-src_bitmap.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/bitmap.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/bitmap.cpp
7+
@@ -96,7 +96,7 @@ Bitmap::Bitmap(Filesystem_Stream::InputS
8+
pixman_format = find_format(format);
9+
10+
if (!stream) {
11+
- Output::Error("Couldn't read image file {}", stream.GetName());
12+
+ Output::Error("Couldn't read image file {}", std::string(stream.GetName()));
13+
return;
14+
}
15+
16+
@@ -117,7 +117,7 @@ Bitmap::Bitmap(Filesystem_Stream::InputS
17+
else if (bytes >= 4 && strncmp((char*)(data + 1), "PNG", 3) == 0)
18+
img_okay = ImagePNG::ReadPNG(stream, transparent, w, h, pixels);
19+
else
20+
- Output::Warning("Unsupported image file {} (Magic: {:02X})", stream.GetName(), *reinterpret_cast<uint32_t*>(data));
21+
+ Output::Warning("Unsupported image file {} (Magic: {:02X})", std::string(stream.GetName()), *reinterpret_cast<uint32_t*>(data));
22+
23+
if (!img_okay) {
24+
free(pixels);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
$NetBSD: patch-src_cache.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/cache.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/cache.cpp
7+
@@ -263,9 +263,9 @@ namespace {
8+
9+
if (!is) {
10+
if (s.warn_missing) {
11+
- Output::Warning("Image not found: {}/{}", s.directory, filename);
12+
+ Output::Warning("Image not found: {}/{}", std::string(s.directory), std::string(filename));
13+
} else {
14+
- Output::Debug("Image not found: {}/{}", s.directory, filename);
15+
+ Output::Debug("Image not found: {}/{}", std::string(s.directory), std::string(filename));
16+
bmp = CreateEmpty<T>();
17+
}
18+
} else {
19+
@@ -274,7 +274,7 @@ namespace {
20+
T == Material::System ? Bitmap::Flag_System : 0);
21+
bmp = Bitmap::Create(std::move(is), transparent, flags);
22+
if (!bmp) {
23+
- Output::Warning("Invalid image: {}/{}", s.directory, filename);
24+
+ Output::Warning("Invalid image: {}/{}", std::string(s.directory), std::string(filename));
25+
}
26+
}
27+
}
28+
@@ -307,7 +307,7 @@ namespace {
29+
30+
if (w < min_w || max_w < w || h < min_h || max_h < h) {
31+
Output::Debug("Image size out of bounds: {}/{} ({}x{} < {}x{} < {}x{})",
32+
- s.directory, filename, min_w, min_h, w, h, max_w, max_h);
33+
+ std::string(s.directory), std::string(filename), min_w, min_h, w, h, max_w, max_h);
34+
}
35+
}
36+
37+
@@ -357,7 +357,7 @@ BitmapRef Cache::Faceset(StringView file
38+
}
39+
40+
BitmapRef Cache::Frame(StringView file, bool transparent) {
41+
- return LoadBitmap<Material::Frame>(file, transparent);
42+
+ return LoadBitmap<Material::Frame>(std::string(file), transparent);
43+
}
44+
45+
BitmapRef Cache::Gameover(StringView file) {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$NetBSD: patch-src_dynrpg.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/dynrpg.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/dynrpg.cpp
7+
@@ -63,7 +63,7 @@ std::string DynRpg::ParseVarArg(StringVi
8+
parse_okay = true;
9+
if (index >= static_cast<int>(args.size())) {
10+
parse_okay = false;
11+
- Output::Warning("{}: Vararg {} out of range", func_name, index);
12+
+ Output::Warning("{}: Vararg {} out of range", std::string(func_name), index);
13+
return "";
14+
}
15+
16+
@@ -95,7 +95,7 @@ std::string DynRpg::ParseVarArg(StringVi
17+
else {
18+
// $-ref out of range
19+
parse_okay = false;
20+
- Output::Warning("{}: Vararg $-ref {} out of range", func_name, i);
21+
+ Output::Warning("{}: Vararg $-ref {} out of range", std::string(func_name), i);
22+
return "";
23+
}
24+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$NetBSD: patch-src_dynrpg.h,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/dynrpg.h.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/dynrpg.h
7+
@@ -62,7 +62,7 @@ namespace DynRpg {
8+
iss >> value;
9+
parse_okay = !iss.fail();
10+
if (!parse_okay) {
11+
- Output::Warning("{}: Arg {} ({}) is not numeric", func_name, i, args[i]);
12+
+ Output::Warning("{}: Arg {} ({}) is not numeric", std::string(func_name), i, std::string(args[i]));
13+
parse_okay = false;
14+
}
15+
return parse_okay;
16+
@@ -80,7 +80,7 @@ namespace DynRpg {
17+
iss >> value;
18+
parse_okay = !iss.fail();
19+
if (!parse_okay) {
20+
- Output::Warning("{}: Arg {} ({}) is not an integer", func_name, i, args[i]);
21+
+ Output::Warning("{}: Arg {} ({}) is not an integer", std::string(func_name), i, args[i]);
22+
parse_okay = false;
23+
}
24+
return parse_okay;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD: patch-src_enemyai.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/enemyai.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/enemyai.cpp
7+
@@ -60,7 +60,7 @@ std::unique_ptr<AlgorithmBase> CreateAlg
8+
if (Utils::StrICmp(name, RpgRtCompat::name) != 0) {
9+
static bool warned = false;
10+
if (!warned) {
11+
- Output::Debug("Invalid AutoBattle algo name `{}' falling back to {} ...", name, RpgRtCompat::name);
12+
+ Output::Debug("Invalid AutoBattle algo name `{}' falling back to {} ...", std::string(name), RpgRtCompat::name);
13+
warned = true;
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD: patch-src_filefinder.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/filefinder.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/filefinder.cpp
7+
@@ -172,7 +172,7 @@ std::string FileFinder::MakeCanonical(St
8+
// Ignore, we are in root
9+
--initial_deepness;
10+
} else {
11+
- Output::Debug("Path traversal out of game directory: {}", path);
12+
+ Output::Debug("Path traversal out of game directory: {}", std::string(path));
13+
}
14+
} else if (path_comp.empty() || path_comp == ".") {
15+
// ignore
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD: patch-src_filefinder__rtp.cpp,v 1.1 2023/05/21 06:27:31 wiz Exp $
2+
3+
Adapt for fmtlib 10.
4+
5+
--- src/filefinder_rtp.cpp.orig 2021-10-29 19:42:00.000000000 +0000
6+
+++ src/filefinder_rtp.cpp
7+
@@ -170,7 +170,7 @@ void FileFinder_RTP::AddPath(StringView
8+
using namespace FileFinder;
9+
auto fs = FileFinder::Root().Create(FileFinder::MakeCanonical(p));
10+
if (fs) {
11+
- Output::Debug("Adding {} to RTP path", p);
12+
+ Output::Debug("Adding {} to RTP path", std::string(p));
13+
14+
auto hit_info = RTP::Detect(fs, Player::EngineVersion());
15+

0 commit comments

Comments
 (0)