diff --git a/src/cache.cpp b/src/cache.cpp index e5c93fef3c..afc411270f 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -174,30 +174,30 @@ namespace { struct Spec { char const* directory; + DummyRenderer dummy_renderer; bool transparent; int min_width , max_width; int min_height, max_height; - DummyRenderer dummy_renderer; bool oob_check; bool warn_missing; }; constexpr Spec spec[] = { - { "Backdrop", false, 320, 320, 160, 240, DrawCheckerboard, true, true }, - { "Battle", true, 480, 480, 96, 480, DrawCheckerboard, true, true }, - { "CharSet", true, 288, 288, 256, 256, DrawCheckerboard, true, true }, - { "ChipSet", true, 480, 480, 256, 256, DrawCheckerboard, true, true }, - { "FaceSet", true, 192, 192, 192, 192, DrawCheckerboard, true, true}, - { "GameOver", false, 320, 320, 240, 240, DrawCheckerboard, true, true }, - { "Monster", true, 16, 320, 16, 160, DrawCheckerboard, false, false }, - { "Panorama", false, 80, 640, 80, 480, DrawCheckerboard, false, true }, - { "Picture", true, 1, 640, 1, 480, DrawCheckerboard, false, true }, - { "System", true, 160, 160, 80, 80, DummySystem, true, true }, - { "Title", false, 320, 320, 240, 240, DrawCheckerboard, true, true }, - { "System2", true, 80, 80, 96, 96, DrawCheckerboard, true, true }, - { "Battle2", true, 640, 640, 640, 640, DrawCheckerboard, true, true }, - { "BattleCharSet", true, 144, 144, 384, 384, DrawCheckerboard, true, false }, - { "BattleWeapon", true, 192, 192, 512, 512, DrawCheckerboard, true, false }, - { "Frame", true, 320, 320, 240, 240, DrawCheckerboard, true, true }, + { "Backdrop", DrawCheckerboard, false, 320, 320, 160, 240, true, true }, + { "Battle", DrawCheckerboard, true, 96, 480, 96, 480, true, true }, + { "CharSet", DrawCheckerboard, true, 288, 288, 256, 256, true, true }, + { "ChipSet", DrawCheckerboard, true, 480, 480, 256, 256, true, true }, + { "FaceSet", DrawCheckerboard, true, 192, 192, 192, 192, true, true}, + { "GameOver", DrawCheckerboard, false, 320, 320, 240, 240, true, true }, + { "Monster", DrawCheckerboard, true, 16, 320, 16, 160, false, false }, + { "Panorama", DrawCheckerboard, false, 80, 640, 80, 480, false, true }, + { "Picture", DrawCheckerboard, true, 1, 640, 1, 480, false, true }, + { "System", DummySystem, true, 160, 160, 80, 80, true, true }, + { "Title", DrawCheckerboard, false, 320, 320, 240, 240, true, true }, + { "System2", DrawCheckerboard, true, 80, 80, 96, 96, true, true }, + { "Battle2", DrawCheckerboard, true, 640, 640, 640, 640, true, true }, + { "BattleCharSet", DrawCheckerboard, true, 144, 144, 384, 384, true, false }, + { "BattleWeapon", DrawCheckerboard, true, 192, 192, 512, 512, true, false }, + { "Frame", DrawCheckerboard, true, 320, 320, 240, 240, true, true }, }; template @@ -312,9 +312,15 @@ namespace { max_h = min_h = Player::IsRPG2k() ? 160 : 240; } + // EasyRPG extensions add support for large charsets; size is spoofed to ignore the error + if (!filename.empty() && filename.front() == '$' && T == Material::Charset && Player::HasEasyRpgExtensions()) { + w = 288; + h = 256; + } + if (w < min_w || max_w < w || h < min_h || max_h < h) { Output::Debug("Image size out of bounds: {}/{} ({}x{} < {}x{} < {}x{})", - s.directory, filename, min_w, min_h, w, h, max_w, max_h); + s.directory, filename, min_w, min_h, w, h, max_w, max_h); } }