re-record Episode 3 battle test
This commit is contained in:
+16
-14
@@ -652,21 +652,23 @@ void ServerState::parse_config(const JSON& json) {
|
|||||||
.card_name = it.first});
|
.card_name = it.first});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& it : json.get("Episode3LobbyBanners", JSON::list()).as_list()) {
|
if (!this->is_replay) {
|
||||||
Image img("system/ep3/banners/" + it->at(2).as_string());
|
for (const auto& it : json.get("Episode3LobbyBanners", JSON::list()).as_list()) {
|
||||||
string gvm = encode_gvm(img, img.get_has_alpha() ? GVRDataFormat::RGB5A3 : GVRDataFormat::RGB565);
|
Image img("system/ep3/banners/" + it->at(2).as_string());
|
||||||
if (gvm.size() > 0x37000) {
|
string gvm = encode_gvm(img, img.get_has_alpha() ? GVRDataFormat::RGB5A3 : GVRDataFormat::RGB565);
|
||||||
throw runtime_error(string_printf("banner %s is too large (0x%zX bytes; maximum size is 0x37000 bytes)", it->at(2).as_string().c_str(), gvm.size()));
|
if (gvm.size() > 0x37000) {
|
||||||
|
throw runtime_error(string_printf("banner %s is too large (0x%zX bytes; maximum size is 0x37000 bytes)", it->at(2).as_string().c_str(), gvm.size()));
|
||||||
|
}
|
||||||
|
string compressed = prs_compress_optimal(gvm.data(), gvm.size());
|
||||||
|
if (compressed.size() > 0x3800) {
|
||||||
|
throw runtime_error(string_printf("banner %s cannot be compressed small enough (0x%zX bytes; maximum size is 0x3800 bytes compressed)", it->at(2).as_string().c_str(), compressed.size()));
|
||||||
|
}
|
||||||
|
config_log.info("Loaded Episode 3 lobby banner %s (0x%zX -> 0x%zX bytes)", it->at(2).as_string().c_str(), gvm.size(), compressed.size());
|
||||||
|
this->ep3_lobby_banners.emplace_back(
|
||||||
|
Ep3LobbyBannerEntry{.type = static_cast<uint32_t>(it->at(0).as_int()),
|
||||||
|
.which = static_cast<uint32_t>(it->at(1).as_int()),
|
||||||
|
.data = std::move(compressed)});
|
||||||
}
|
}
|
||||||
string compressed = prs_compress_optimal(gvm.data(), gvm.size());
|
|
||||||
if (compressed.size() > 0x3800) {
|
|
||||||
throw runtime_error(string_printf("banner %s cannot be compressed small enough (0x%zX bytes; maximum size is 0x3800 bytes compressed)", it->at(2).as_string().c_str(), compressed.size()));
|
|
||||||
}
|
|
||||||
config_log.info("Loaded Episode 3 lobby banner %s (0x%zX -> 0x%zX bytes)", it->at(2).as_string().c_str(), gvm.size(), compressed.size());
|
|
||||||
this->ep3_lobby_banners.emplace_back(
|
|
||||||
Ep3LobbyBannerEntry{.type = static_cast<uint32_t>(it->at(0).as_int()),
|
|
||||||
.which = static_cast<uint32_t>(it->at(1).as_int()),
|
|
||||||
.data = std::move(compressed)});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
+74023
-33395
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user