diff --git a/CMake/Assets.cmake b/CMake/Assets.cmake index 73e6d3b59..a68ac42fb 100644 --- a/CMake/Assets.cmake +++ b/CMake/Assets.cmake @@ -41,107 +41,107 @@ if (Gettext_FOUND) endif() set(devilutionx_assets - data/boxleftend.pcx - data/boxmiddle.pcx - data/boxrightend.pcx + data/boxleftend.clx + data/boxmiddle.clx + data/boxrightend.clx data/charbg.pcx - data/dirtybuc.pcx - data/dirtybucp.pcx - data/healthbox.pcx - data/health.pcx - data/hintbox.pcx - data/hintboxbackground.pcx - data/hinticons.pcx - data/monstertags.pcx - data/panel8buc.pcx + data/dirtybuc.clx + data/dirtybucp.clx + data/healthbox.clx + data/health.clx + data/hintbox.clx + data/hintboxbackground.clx + data/hinticons.clx + data/monstertags.clx + data/panel8buc.clx data/panel8bucp.pcx - data/resistance.pcx - data/stash.pcx - data/stashnavbtns.pcx + data/resistance.clx + data/stash.clx + data/stashnavbtns.clx data/talkbutton.pcx - data/xpbar.pcx + data/xpbar.clx fonts/12-00.bin - fonts/12-00.pcx + fonts/12-00.clx fonts/12-01.bin - fonts/12-01.pcx + fonts/12-01.clx fonts/12-02.bin - fonts/12-02.pcx + fonts/12-02.clx fonts/12-03.bin - fonts/12-03.pcx + fonts/12-03.clx fonts/12-04.bin - fonts/12-04.pcx - fonts/12-1f4.pcx - fonts/12-1f6.pcx - fonts/12-1f9.pcx + fonts/12-04.clx + fonts/12-1f4.clx + fonts/12-1f6.clx + fonts/12-1f9.clx fonts/12-20.bin - fonts/12-20.pcx - fonts/12-26.pcx + fonts/12-20.clx + fonts/12-26.clx fonts/22-00.bin - fonts/22-00.pcx + fonts/22-00.clx fonts/22-01.bin - fonts/22-01.pcx + fonts/22-01.clx fonts/22-02.bin - fonts/22-02.pcx + fonts/22-02.clx fonts/22-03.bin - fonts/22-03.pcx + fonts/22-03.clx fonts/22-04.bin - fonts/22-04.pcx + fonts/22-04.clx fonts/22-05.bin - fonts/22-05.pcx + fonts/22-05.clx fonts/22-20.bin - fonts/22-20.pcx + fonts/22-20.clx fonts/24-00.bin - fonts/24-00.pcx + fonts/24-00.clx fonts/24-01.bin - fonts/24-01.pcx + fonts/24-01.clx fonts/24-02.bin - fonts/24-02.pcx + fonts/24-02.clx fonts/24-03.bin - fonts/24-03.pcx + fonts/24-03.clx fonts/24-04.bin - fonts/24-04.pcx - fonts/24-1f4.pcx - fonts/24-1f6.pcx - fonts/24-1f9.pcx + fonts/24-04.clx + fonts/24-1f4.clx + fonts/24-1f6.clx + fonts/24-1f9.clx fonts/24-20.bin - fonts/24-20.pcx - fonts/24-26.pcx + fonts/24-20.clx + fonts/24-26.clx fonts/30-00.bin - fonts/30-00.pcx + fonts/30-00.clx fonts/30-01.bin - fonts/30-01.pcx + fonts/30-01.clx fonts/30-02.bin - fonts/30-02.pcx + fonts/30-02.clx fonts/30-03.bin - fonts/30-03.pcx + fonts/30-03.clx fonts/30-04.bin - fonts/30-04.pcx + fonts/30-04.clx fonts/30-20.bin - fonts/30-20.pcx + fonts/30-20.clx fonts/42-00.bin - fonts/42-00.pcx + fonts/42-00.clx fonts/42-01.bin - fonts/42-01.pcx + fonts/42-01.clx fonts/42-02.bin - fonts/42-02.pcx + fonts/42-02.clx fonts/42-03.bin - fonts/42-03.pcx + fonts/42-03.clx fonts/42-04.bin - fonts/42-04.pcx + fonts/42-04.clx fonts/42-20.bin - fonts/42-20.pcx + fonts/42-20.clx fonts/46-00.bin - fonts/46-00.pcx + fonts/46-00.clx fonts/46-01.bin - fonts/46-01.pcx + fonts/46-01.clx fonts/46-02.bin - fonts/46-02.pcx + fonts/46-02.clx fonts/46-03.bin - fonts/46-03.pcx + fonts/46-03.clx fonts/46-04.bin - fonts/46-04.pcx + fonts/46-04.clx fonts/46-20.bin - fonts/46-20.pcx + fonts/46-20.clx fonts/black.trn fonts/blue.trn fonts/buttonface.trn @@ -154,21 +154,21 @@ set(devilutionx_assets fonts/whitegold.trn fonts/white.trn fonts/yellowdialog.trn - gendata/cutportlw.pcx - gendata/cutportrw.pcx - gendata/cutstartw.pcx + gendata/cutportlw.clx + gendata/cutportrw.clx + gendata/cutstartw.clx Levels/L1Data/SklKngT.dun Levels/L2Data/BonechaT.dun NLevels/L5Data/cornerstone.dun NLevels/L5Data/uberroom.dun ui_art/black_diablo.pcx ui_art/black_hellfire.pcx - ui_art/creditsw.pcx - ui_art/dvl_but_sml.pcx - ui_art/dvl_lrpopup.pcx - ui_art/hf_titlew.pcx - ui_art/mainmenuw.pcx - ui_art/supportw.pcx) + ui_art/creditsw.clx + ui_art/dvl_but_sml.clx + ui_art/dvl_lrpopup.clx + ui_art/hf_titlew.clx + ui_art/mainmenuw.clx + ui_art/supportw.clx) if(NOT USE_SDL1 AND NOT VITA) list(APPEND devilutionx_assets diff --git a/Packaging/resources/assets/data/boxleftend.clx b/Packaging/resources/assets/data/boxleftend.clx new file mode 100644 index 000000000..1609f55f0 Binary files /dev/null and b/Packaging/resources/assets/data/boxleftend.clx differ diff --git a/Packaging/resources/assets/data/boxleftend.pcx b/Packaging/resources/assets/data/boxleftend.pcx deleted file mode 100644 index 0e45fbdb2..000000000 Binary files a/Packaging/resources/assets/data/boxleftend.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/boxmiddle.clx b/Packaging/resources/assets/data/boxmiddle.clx new file mode 100644 index 000000000..afc9886b6 Binary files /dev/null and b/Packaging/resources/assets/data/boxmiddle.clx differ diff --git a/Packaging/resources/assets/data/boxmiddle.pcx b/Packaging/resources/assets/data/boxmiddle.pcx deleted file mode 100644 index 274a781e9..000000000 Binary files a/Packaging/resources/assets/data/boxmiddle.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/boxrightend.clx b/Packaging/resources/assets/data/boxrightend.clx new file mode 100644 index 000000000..6612b154b Binary files /dev/null and b/Packaging/resources/assets/data/boxrightend.clx differ diff --git a/Packaging/resources/assets/data/boxrightend.pcx b/Packaging/resources/assets/data/boxrightend.pcx deleted file mode 100644 index dda897390..000000000 Binary files a/Packaging/resources/assets/data/boxrightend.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/dirtybuc.clx b/Packaging/resources/assets/data/dirtybuc.clx new file mode 100644 index 000000000..1c457b452 Binary files /dev/null and b/Packaging/resources/assets/data/dirtybuc.clx differ diff --git a/Packaging/resources/assets/data/dirtybuc.pcx b/Packaging/resources/assets/data/dirtybuc.pcx deleted file mode 100644 index 3b61d560a..000000000 Binary files a/Packaging/resources/assets/data/dirtybuc.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/dirtybucp.clx b/Packaging/resources/assets/data/dirtybucp.clx new file mode 100644 index 000000000..62de432a4 Binary files /dev/null and b/Packaging/resources/assets/data/dirtybucp.clx differ diff --git a/Packaging/resources/assets/data/dirtybucp.pcx b/Packaging/resources/assets/data/dirtybucp.pcx deleted file mode 100644 index a67529fd1..000000000 Binary files a/Packaging/resources/assets/data/dirtybucp.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/health.clx b/Packaging/resources/assets/data/health.clx new file mode 100644 index 000000000..ae14ebbb3 Binary files /dev/null and b/Packaging/resources/assets/data/health.clx differ diff --git a/Packaging/resources/assets/data/health.pcx b/Packaging/resources/assets/data/health.pcx deleted file mode 100644 index 196e20c03..000000000 Binary files a/Packaging/resources/assets/data/health.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/healthbox.clx b/Packaging/resources/assets/data/healthbox.clx new file mode 100644 index 000000000..8db460c7d Binary files /dev/null and b/Packaging/resources/assets/data/healthbox.clx differ diff --git a/Packaging/resources/assets/data/healthbox.pcx b/Packaging/resources/assets/data/healthbox.pcx deleted file mode 100644 index 233e3cbd5..000000000 Binary files a/Packaging/resources/assets/data/healthbox.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/hintbox.clx b/Packaging/resources/assets/data/hintbox.clx new file mode 100644 index 000000000..1da8d4c30 Binary files /dev/null and b/Packaging/resources/assets/data/hintbox.clx differ diff --git a/Packaging/resources/assets/data/hintbox.pcx b/Packaging/resources/assets/data/hintbox.pcx deleted file mode 100644 index 0d0e869d2..000000000 Binary files a/Packaging/resources/assets/data/hintbox.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/hintboxbackground.clx b/Packaging/resources/assets/data/hintboxbackground.clx new file mode 100644 index 000000000..6b684a441 Binary files /dev/null and b/Packaging/resources/assets/data/hintboxbackground.clx differ diff --git a/Packaging/resources/assets/data/hintboxbackground.pcx b/Packaging/resources/assets/data/hintboxbackground.pcx deleted file mode 100644 index e6e327222..000000000 Binary files a/Packaging/resources/assets/data/hintboxbackground.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/hinticons.clx b/Packaging/resources/assets/data/hinticons.clx new file mode 100644 index 000000000..958e8de79 Binary files /dev/null and b/Packaging/resources/assets/data/hinticons.clx differ diff --git a/Packaging/resources/assets/data/hinticons.pcx b/Packaging/resources/assets/data/hinticons.pcx deleted file mode 100644 index c284f7200..000000000 Binary files a/Packaging/resources/assets/data/hinticons.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/monstertags.clx b/Packaging/resources/assets/data/monstertags.clx new file mode 100644 index 000000000..018b3452e Binary files /dev/null and b/Packaging/resources/assets/data/monstertags.clx differ diff --git a/Packaging/resources/assets/data/monstertags.pcx b/Packaging/resources/assets/data/monstertags.pcx deleted file mode 100644 index b43dcf95a..000000000 Binary files a/Packaging/resources/assets/data/monstertags.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/panel8buc.clx b/Packaging/resources/assets/data/panel8buc.clx new file mode 100644 index 000000000..9bdaa0454 Binary files /dev/null and b/Packaging/resources/assets/data/panel8buc.clx differ diff --git a/Packaging/resources/assets/data/panel8buc.pcx b/Packaging/resources/assets/data/panel8buc.pcx deleted file mode 100644 index a0fd004e5..000000000 Binary files a/Packaging/resources/assets/data/panel8buc.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/resistance.clx b/Packaging/resources/assets/data/resistance.clx new file mode 100644 index 000000000..8a817f239 Binary files /dev/null and b/Packaging/resources/assets/data/resistance.clx differ diff --git a/Packaging/resources/assets/data/resistance.pcx b/Packaging/resources/assets/data/resistance.pcx deleted file mode 100644 index c6b2e3bb1..000000000 Binary files a/Packaging/resources/assets/data/resistance.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/stash.clx b/Packaging/resources/assets/data/stash.clx new file mode 100644 index 000000000..5e10025a1 Binary files /dev/null and b/Packaging/resources/assets/data/stash.clx differ diff --git a/Packaging/resources/assets/data/stash.pcx b/Packaging/resources/assets/data/stash.pcx deleted file mode 100644 index 46bc0ffea..000000000 Binary files a/Packaging/resources/assets/data/stash.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/stashnavbtns.clx b/Packaging/resources/assets/data/stashnavbtns.clx new file mode 100644 index 000000000..7165bfa2f Binary files /dev/null and b/Packaging/resources/assets/data/stashnavbtns.clx differ diff --git a/Packaging/resources/assets/data/stashnavbtns.pcx b/Packaging/resources/assets/data/stashnavbtns.pcx deleted file mode 100644 index b2200007b..000000000 Binary files a/Packaging/resources/assets/data/stashnavbtns.pcx and /dev/null differ diff --git a/Packaging/resources/assets/data/xpbar.clx b/Packaging/resources/assets/data/xpbar.clx new file mode 100644 index 000000000..154f132a0 Binary files /dev/null and b/Packaging/resources/assets/data/xpbar.clx differ diff --git a/Packaging/resources/assets/data/xpbar.pcx b/Packaging/resources/assets/data/xpbar.pcx deleted file mode 100644 index 085fc8f43..000000000 Binary files a/Packaging/resources/assets/data/xpbar.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-00.clx b/Packaging/resources/assets/fonts/12-00.clx new file mode 100644 index 000000000..ab14905af Binary files /dev/null and b/Packaging/resources/assets/fonts/12-00.clx differ diff --git a/Packaging/resources/assets/fonts/12-00.pcx b/Packaging/resources/assets/fonts/12-00.pcx deleted file mode 100644 index 0ca905d7b..000000000 Binary files a/Packaging/resources/assets/fonts/12-00.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-01.clx b/Packaging/resources/assets/fonts/12-01.clx new file mode 100644 index 000000000..b39a06788 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-01.clx differ diff --git a/Packaging/resources/assets/fonts/12-01.pcx b/Packaging/resources/assets/fonts/12-01.pcx deleted file mode 100644 index 73256f1b5..000000000 Binary files a/Packaging/resources/assets/fonts/12-01.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-02.clx b/Packaging/resources/assets/fonts/12-02.clx new file mode 100644 index 000000000..85373443f Binary files /dev/null and b/Packaging/resources/assets/fonts/12-02.clx differ diff --git a/Packaging/resources/assets/fonts/12-02.pcx b/Packaging/resources/assets/fonts/12-02.pcx deleted file mode 100644 index 254c0f397..000000000 Binary files a/Packaging/resources/assets/fonts/12-02.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-03.clx b/Packaging/resources/assets/fonts/12-03.clx new file mode 100644 index 000000000..45c78c15e Binary files /dev/null and b/Packaging/resources/assets/fonts/12-03.clx differ diff --git a/Packaging/resources/assets/fonts/12-03.pcx b/Packaging/resources/assets/fonts/12-03.pcx deleted file mode 100644 index 2b55fc944..000000000 Binary files a/Packaging/resources/assets/fonts/12-03.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-04.clx b/Packaging/resources/assets/fonts/12-04.clx new file mode 100644 index 000000000..33e294a19 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-04.clx differ diff --git a/Packaging/resources/assets/fonts/12-04.pcx b/Packaging/resources/assets/fonts/12-04.pcx deleted file mode 100644 index f4ce5e8f6..000000000 Binary files a/Packaging/resources/assets/fonts/12-04.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-1f1.clx b/Packaging/resources/assets/fonts/12-1f1.clx new file mode 100644 index 000000000..2b9f4d56e Binary files /dev/null and b/Packaging/resources/assets/fonts/12-1f1.clx differ diff --git a/Packaging/resources/assets/fonts/12-1f1.pcx b/Packaging/resources/assets/fonts/12-1f1.pcx deleted file mode 100644 index cd18b0dc7..000000000 Binary files a/Packaging/resources/assets/fonts/12-1f1.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-1f3.clx b/Packaging/resources/assets/fonts/12-1f3.clx new file mode 100644 index 000000000..bb131f4e8 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-1f3.clx differ diff --git a/Packaging/resources/assets/fonts/12-1f3.pcx b/Packaging/resources/assets/fonts/12-1f3.pcx deleted file mode 100644 index 8b89d5824..000000000 Binary files a/Packaging/resources/assets/fonts/12-1f3.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-1f4.clx b/Packaging/resources/assets/fonts/12-1f4.clx new file mode 100644 index 000000000..41388aab4 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-1f4.clx differ diff --git a/Packaging/resources/assets/fonts/12-1f4.pcx b/Packaging/resources/assets/fonts/12-1f4.pcx deleted file mode 100644 index 1f18a7c54..000000000 Binary files a/Packaging/resources/assets/fonts/12-1f4.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-1f5.clx b/Packaging/resources/assets/fonts/12-1f5.clx new file mode 100644 index 000000000..e7aab111b Binary files /dev/null and b/Packaging/resources/assets/fonts/12-1f5.clx differ diff --git a/Packaging/resources/assets/fonts/12-1f5.pcx b/Packaging/resources/assets/fonts/12-1f5.pcx deleted file mode 100644 index 5f74f699a..000000000 Binary files a/Packaging/resources/assets/fonts/12-1f5.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-1f6.clx b/Packaging/resources/assets/fonts/12-1f6.clx new file mode 100644 index 000000000..9699e95a5 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-1f6.clx differ diff --git a/Packaging/resources/assets/fonts/12-1f6.pcx b/Packaging/resources/assets/fonts/12-1f6.pcx deleted file mode 100644 index 5cf4eb0ae..000000000 Binary files a/Packaging/resources/assets/fonts/12-1f6.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-1f9.clx b/Packaging/resources/assets/fonts/12-1f9.clx new file mode 100644 index 000000000..d1c0b5e13 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-1f9.clx differ diff --git a/Packaging/resources/assets/fonts/12-1f9.pcx b/Packaging/resources/assets/fonts/12-1f9.pcx deleted file mode 100644 index 9787d01e6..000000000 Binary files a/Packaging/resources/assets/fonts/12-1f9.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-20.clx b/Packaging/resources/assets/fonts/12-20.clx new file mode 100644 index 000000000..6e7c75d94 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-20.clx differ diff --git a/Packaging/resources/assets/fonts/12-20.pcx b/Packaging/resources/assets/fonts/12-20.pcx deleted file mode 100644 index 5f61c2c05..000000000 Binary files a/Packaging/resources/assets/fonts/12-20.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/12-26.clx b/Packaging/resources/assets/fonts/12-26.clx new file mode 100644 index 000000000..eff942aa7 Binary files /dev/null and b/Packaging/resources/assets/fonts/12-26.clx differ diff --git a/Packaging/resources/assets/fonts/12-26.pcx b/Packaging/resources/assets/fonts/12-26.pcx deleted file mode 100644 index 83ac67246..000000000 Binary files a/Packaging/resources/assets/fonts/12-26.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/22-00.clx b/Packaging/resources/assets/fonts/22-00.clx new file mode 100644 index 000000000..8fc660b2c Binary files /dev/null and b/Packaging/resources/assets/fonts/22-00.clx differ diff --git a/Packaging/resources/assets/fonts/22-00.pcx b/Packaging/resources/assets/fonts/22-00.pcx deleted file mode 100644 index 6ed9e916f..000000000 Binary files a/Packaging/resources/assets/fonts/22-00.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/22-01.clx b/Packaging/resources/assets/fonts/22-01.clx new file mode 100644 index 000000000..1064716cc Binary files /dev/null and b/Packaging/resources/assets/fonts/22-01.clx differ diff --git a/Packaging/resources/assets/fonts/22-01.pcx b/Packaging/resources/assets/fonts/22-01.pcx deleted file mode 100644 index 63edb55b1..000000000 Binary files a/Packaging/resources/assets/fonts/22-01.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/22-02.clx b/Packaging/resources/assets/fonts/22-02.clx new file mode 100644 index 000000000..9882f0757 Binary files /dev/null and b/Packaging/resources/assets/fonts/22-02.clx differ diff --git a/Packaging/resources/assets/fonts/22-02.pcx b/Packaging/resources/assets/fonts/22-02.pcx deleted file mode 100644 index bd9b13e63..000000000 Binary files a/Packaging/resources/assets/fonts/22-02.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/22-03.clx b/Packaging/resources/assets/fonts/22-03.clx new file mode 100644 index 000000000..4f0e4ba2a Binary files /dev/null and b/Packaging/resources/assets/fonts/22-03.clx differ diff --git a/Packaging/resources/assets/fonts/22-03.pcx b/Packaging/resources/assets/fonts/22-03.pcx deleted file mode 100644 index 3d81a6929..000000000 Binary files a/Packaging/resources/assets/fonts/22-03.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/22-04.clx b/Packaging/resources/assets/fonts/22-04.clx new file mode 100644 index 000000000..e4524b9a0 Binary files /dev/null and b/Packaging/resources/assets/fonts/22-04.clx differ diff --git a/Packaging/resources/assets/fonts/22-04.pcx b/Packaging/resources/assets/fonts/22-04.pcx deleted file mode 100644 index ad65613d6..000000000 Binary files a/Packaging/resources/assets/fonts/22-04.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/22-05.clx b/Packaging/resources/assets/fonts/22-05.clx new file mode 100644 index 000000000..2d149c66d Binary files /dev/null and b/Packaging/resources/assets/fonts/22-05.clx differ diff --git a/Packaging/resources/assets/fonts/22-05.pcx b/Packaging/resources/assets/fonts/22-05.pcx deleted file mode 100644 index 6bc7da472..000000000 Binary files a/Packaging/resources/assets/fonts/22-05.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/22-20.clx b/Packaging/resources/assets/fonts/22-20.clx new file mode 100644 index 000000000..2037c9e5f Binary files /dev/null and b/Packaging/resources/assets/fonts/22-20.clx differ diff --git a/Packaging/resources/assets/fonts/22-20.pcx b/Packaging/resources/assets/fonts/22-20.pcx deleted file mode 100644 index 593b8b4be..000000000 Binary files a/Packaging/resources/assets/fonts/22-20.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-00.clx b/Packaging/resources/assets/fonts/24-00.clx new file mode 100644 index 000000000..0a6fce291 Binary files /dev/null and b/Packaging/resources/assets/fonts/24-00.clx differ diff --git a/Packaging/resources/assets/fonts/24-00.pcx b/Packaging/resources/assets/fonts/24-00.pcx deleted file mode 100644 index 5f11988e1..000000000 Binary files a/Packaging/resources/assets/fonts/24-00.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-01.clx b/Packaging/resources/assets/fonts/24-01.clx new file mode 100644 index 000000000..1946e437d Binary files /dev/null and b/Packaging/resources/assets/fonts/24-01.clx differ diff --git a/Packaging/resources/assets/fonts/24-01.pcx b/Packaging/resources/assets/fonts/24-01.pcx deleted file mode 100644 index e194bf957..000000000 Binary files a/Packaging/resources/assets/fonts/24-01.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-02.clx b/Packaging/resources/assets/fonts/24-02.clx new file mode 100644 index 000000000..c52741473 Binary files /dev/null and b/Packaging/resources/assets/fonts/24-02.clx differ diff --git a/Packaging/resources/assets/fonts/24-02.pcx b/Packaging/resources/assets/fonts/24-02.pcx deleted file mode 100644 index a841d15cc..000000000 Binary files a/Packaging/resources/assets/fonts/24-02.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-03.clx b/Packaging/resources/assets/fonts/24-03.clx new file mode 100644 index 000000000..2c4ad28ad Binary files /dev/null and b/Packaging/resources/assets/fonts/24-03.clx differ diff --git a/Packaging/resources/assets/fonts/24-03.pcx b/Packaging/resources/assets/fonts/24-03.pcx deleted file mode 100644 index 10c29a7ae..000000000 Binary files a/Packaging/resources/assets/fonts/24-03.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-04.clx b/Packaging/resources/assets/fonts/24-04.clx new file mode 100644 index 000000000..2d30a530e Binary files /dev/null and b/Packaging/resources/assets/fonts/24-04.clx differ diff --git a/Packaging/resources/assets/fonts/24-04.pcx b/Packaging/resources/assets/fonts/24-04.pcx deleted file mode 100644 index f55d40d77..000000000 Binary files a/Packaging/resources/assets/fonts/24-04.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-1f1.clx b/Packaging/resources/assets/fonts/24-1f1.clx new file mode 100644 index 000000000..dae7e10d2 Binary files /dev/null and b/Packaging/resources/assets/fonts/24-1f1.clx differ diff --git a/Packaging/resources/assets/fonts/24-1f1.pcx b/Packaging/resources/assets/fonts/24-1f1.pcx deleted file mode 100644 index 162aa15e3..000000000 Binary files a/Packaging/resources/assets/fonts/24-1f1.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-1f3.clx b/Packaging/resources/assets/fonts/24-1f3.clx new file mode 100644 index 000000000..c59180680 Binary files /dev/null and b/Packaging/resources/assets/fonts/24-1f3.clx differ diff --git a/Packaging/resources/assets/fonts/24-1f3.pcx b/Packaging/resources/assets/fonts/24-1f3.pcx deleted file mode 100644 index 72ab4ed6b..000000000 Binary files a/Packaging/resources/assets/fonts/24-1f3.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-1f4.clx b/Packaging/resources/assets/fonts/24-1f4.clx new file mode 100644 index 000000000..e72fb61c4 Binary files /dev/null and b/Packaging/resources/assets/fonts/24-1f4.clx differ diff --git a/Packaging/resources/assets/fonts/24-1f4.pcx b/Packaging/resources/assets/fonts/24-1f4.pcx deleted file mode 100644 index 32a42e079..000000000 Binary files a/Packaging/resources/assets/fonts/24-1f4.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-1f5.clx b/Packaging/resources/assets/fonts/24-1f5.clx new file mode 100644 index 000000000..788b3d466 Binary files /dev/null and b/Packaging/resources/assets/fonts/24-1f5.clx differ diff --git a/Packaging/resources/assets/fonts/24-1f5.pcx b/Packaging/resources/assets/fonts/24-1f5.pcx deleted file mode 100644 index c7c4ae409..000000000 Binary files a/Packaging/resources/assets/fonts/24-1f5.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-1f6.clx b/Packaging/resources/assets/fonts/24-1f6.clx new file mode 100644 index 000000000..9762ec021 Binary files /dev/null and b/Packaging/resources/assets/fonts/24-1f6.clx differ diff --git a/Packaging/resources/assets/fonts/24-1f6.pcx b/Packaging/resources/assets/fonts/24-1f6.pcx deleted file mode 100644 index 57091d486..000000000 Binary files a/Packaging/resources/assets/fonts/24-1f6.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-1f9.clx b/Packaging/resources/assets/fonts/24-1f9.clx new file mode 100644 index 000000000..91479d26b Binary files /dev/null and b/Packaging/resources/assets/fonts/24-1f9.clx differ diff --git a/Packaging/resources/assets/fonts/24-1f9.pcx b/Packaging/resources/assets/fonts/24-1f9.pcx deleted file mode 100644 index cd150ce08..000000000 Binary files a/Packaging/resources/assets/fonts/24-1f9.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-20.clx b/Packaging/resources/assets/fonts/24-20.clx new file mode 100644 index 000000000..6bce5708e Binary files /dev/null and b/Packaging/resources/assets/fonts/24-20.clx differ diff --git a/Packaging/resources/assets/fonts/24-20.pcx b/Packaging/resources/assets/fonts/24-20.pcx deleted file mode 100644 index a1a007b05..000000000 Binary files a/Packaging/resources/assets/fonts/24-20.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/24-26.clx b/Packaging/resources/assets/fonts/24-26.clx new file mode 100644 index 000000000..217df511d Binary files /dev/null and b/Packaging/resources/assets/fonts/24-26.clx differ diff --git a/Packaging/resources/assets/fonts/24-26.pcx b/Packaging/resources/assets/fonts/24-26.pcx deleted file mode 100644 index cf19f8e57..000000000 Binary files a/Packaging/resources/assets/fonts/24-26.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/30-00.clx b/Packaging/resources/assets/fonts/30-00.clx new file mode 100644 index 000000000..3259ebced Binary files /dev/null and b/Packaging/resources/assets/fonts/30-00.clx differ diff --git a/Packaging/resources/assets/fonts/30-00.pcx b/Packaging/resources/assets/fonts/30-00.pcx deleted file mode 100644 index 7be7baa0f..000000000 Binary files a/Packaging/resources/assets/fonts/30-00.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/30-01.clx b/Packaging/resources/assets/fonts/30-01.clx new file mode 100644 index 000000000..284c0339b Binary files /dev/null and b/Packaging/resources/assets/fonts/30-01.clx differ diff --git a/Packaging/resources/assets/fonts/30-01.pcx b/Packaging/resources/assets/fonts/30-01.pcx deleted file mode 100644 index 8d45c53d9..000000000 Binary files a/Packaging/resources/assets/fonts/30-01.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/30-02.clx b/Packaging/resources/assets/fonts/30-02.clx new file mode 100644 index 000000000..03e92942d Binary files /dev/null and b/Packaging/resources/assets/fonts/30-02.clx differ diff --git a/Packaging/resources/assets/fonts/30-02.pcx b/Packaging/resources/assets/fonts/30-02.pcx deleted file mode 100644 index 4579f7cdc..000000000 Binary files a/Packaging/resources/assets/fonts/30-02.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/30-03.clx b/Packaging/resources/assets/fonts/30-03.clx new file mode 100644 index 000000000..80d12ff39 Binary files /dev/null and b/Packaging/resources/assets/fonts/30-03.clx differ diff --git a/Packaging/resources/assets/fonts/30-03.pcx b/Packaging/resources/assets/fonts/30-03.pcx deleted file mode 100644 index 0338685b3..000000000 Binary files a/Packaging/resources/assets/fonts/30-03.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/30-04.clx b/Packaging/resources/assets/fonts/30-04.clx new file mode 100644 index 000000000..f623a0a31 Binary files /dev/null and b/Packaging/resources/assets/fonts/30-04.clx differ diff --git a/Packaging/resources/assets/fonts/30-04.pcx b/Packaging/resources/assets/fonts/30-04.pcx deleted file mode 100644 index 756977d47..000000000 Binary files a/Packaging/resources/assets/fonts/30-04.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/30-20.clx b/Packaging/resources/assets/fonts/30-20.clx new file mode 100644 index 000000000..bdd77bf31 Binary files /dev/null and b/Packaging/resources/assets/fonts/30-20.clx differ diff --git a/Packaging/resources/assets/fonts/30-20.pcx b/Packaging/resources/assets/fonts/30-20.pcx deleted file mode 100644 index b808bdbc1..000000000 Binary files a/Packaging/resources/assets/fonts/30-20.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/42-00.clx b/Packaging/resources/assets/fonts/42-00.clx new file mode 100644 index 000000000..181c38bfd Binary files /dev/null and b/Packaging/resources/assets/fonts/42-00.clx differ diff --git a/Packaging/resources/assets/fonts/42-00.pcx b/Packaging/resources/assets/fonts/42-00.pcx deleted file mode 100644 index a1e4536ba..000000000 Binary files a/Packaging/resources/assets/fonts/42-00.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/42-01.clx b/Packaging/resources/assets/fonts/42-01.clx new file mode 100644 index 000000000..8f2cf9965 Binary files /dev/null and b/Packaging/resources/assets/fonts/42-01.clx differ diff --git a/Packaging/resources/assets/fonts/42-01.pcx b/Packaging/resources/assets/fonts/42-01.pcx deleted file mode 100644 index e8947f0c7..000000000 Binary files a/Packaging/resources/assets/fonts/42-01.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/42-02.clx b/Packaging/resources/assets/fonts/42-02.clx new file mode 100644 index 000000000..36850cd92 Binary files /dev/null and b/Packaging/resources/assets/fonts/42-02.clx differ diff --git a/Packaging/resources/assets/fonts/42-02.pcx b/Packaging/resources/assets/fonts/42-02.pcx deleted file mode 100644 index 2affd3995..000000000 Binary files a/Packaging/resources/assets/fonts/42-02.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/42-03.clx b/Packaging/resources/assets/fonts/42-03.clx new file mode 100644 index 000000000..3cf817773 Binary files /dev/null and b/Packaging/resources/assets/fonts/42-03.clx differ diff --git a/Packaging/resources/assets/fonts/42-03.pcx b/Packaging/resources/assets/fonts/42-03.pcx deleted file mode 100644 index 56a036b0d..000000000 Binary files a/Packaging/resources/assets/fonts/42-03.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/42-04.clx b/Packaging/resources/assets/fonts/42-04.clx new file mode 100644 index 000000000..effc7dd1a Binary files /dev/null and b/Packaging/resources/assets/fonts/42-04.clx differ diff --git a/Packaging/resources/assets/fonts/42-04.pcx b/Packaging/resources/assets/fonts/42-04.pcx deleted file mode 100644 index 81633bf6e..000000000 Binary files a/Packaging/resources/assets/fonts/42-04.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/42-20.clx b/Packaging/resources/assets/fonts/42-20.clx new file mode 100644 index 000000000..523c6a375 Binary files /dev/null and b/Packaging/resources/assets/fonts/42-20.clx differ diff --git a/Packaging/resources/assets/fonts/42-20.pcx b/Packaging/resources/assets/fonts/42-20.pcx deleted file mode 100644 index 5eeca1b63..000000000 Binary files a/Packaging/resources/assets/fonts/42-20.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/46-00.clx b/Packaging/resources/assets/fonts/46-00.clx new file mode 100644 index 000000000..965501e40 Binary files /dev/null and b/Packaging/resources/assets/fonts/46-00.clx differ diff --git a/Packaging/resources/assets/fonts/46-00.pcx b/Packaging/resources/assets/fonts/46-00.pcx deleted file mode 100644 index 34153c956..000000000 Binary files a/Packaging/resources/assets/fonts/46-00.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/46-01.clx b/Packaging/resources/assets/fonts/46-01.clx new file mode 100644 index 000000000..779aa0c64 Binary files /dev/null and b/Packaging/resources/assets/fonts/46-01.clx differ diff --git a/Packaging/resources/assets/fonts/46-01.pcx b/Packaging/resources/assets/fonts/46-01.pcx deleted file mode 100644 index 7fc572980..000000000 Binary files a/Packaging/resources/assets/fonts/46-01.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/46-02.clx b/Packaging/resources/assets/fonts/46-02.clx new file mode 100644 index 000000000..8bc2cb745 Binary files /dev/null and b/Packaging/resources/assets/fonts/46-02.clx differ diff --git a/Packaging/resources/assets/fonts/46-02.pcx b/Packaging/resources/assets/fonts/46-02.pcx deleted file mode 100644 index 6e25212a1..000000000 Binary files a/Packaging/resources/assets/fonts/46-02.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/46-03.clx b/Packaging/resources/assets/fonts/46-03.clx new file mode 100644 index 000000000..66cdb3a01 Binary files /dev/null and b/Packaging/resources/assets/fonts/46-03.clx differ diff --git a/Packaging/resources/assets/fonts/46-03.pcx b/Packaging/resources/assets/fonts/46-03.pcx deleted file mode 100644 index 38935aac0..000000000 Binary files a/Packaging/resources/assets/fonts/46-03.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/46-04.clx b/Packaging/resources/assets/fonts/46-04.clx new file mode 100644 index 000000000..77ded68dc Binary files /dev/null and b/Packaging/resources/assets/fonts/46-04.clx differ diff --git a/Packaging/resources/assets/fonts/46-04.pcx b/Packaging/resources/assets/fonts/46-04.pcx deleted file mode 100644 index f5190be35..000000000 Binary files a/Packaging/resources/assets/fonts/46-04.pcx and /dev/null differ diff --git a/Packaging/resources/assets/fonts/46-20.clx b/Packaging/resources/assets/fonts/46-20.clx new file mode 100644 index 000000000..5230f1d58 Binary files /dev/null and b/Packaging/resources/assets/fonts/46-20.clx differ diff --git a/Packaging/resources/assets/fonts/46-20.pcx b/Packaging/resources/assets/fonts/46-20.pcx deleted file mode 100644 index efe75f513..000000000 Binary files a/Packaging/resources/assets/fonts/46-20.pcx and /dev/null differ diff --git a/Packaging/resources/assets/gendata/cutportlw.clx b/Packaging/resources/assets/gendata/cutportlw.clx new file mode 100644 index 000000000..4f347d01a Binary files /dev/null and b/Packaging/resources/assets/gendata/cutportlw.clx differ diff --git a/Packaging/resources/assets/gendata/cutportlw.pcx b/Packaging/resources/assets/gendata/cutportlw.pcx deleted file mode 100644 index b9f050123..000000000 Binary files a/Packaging/resources/assets/gendata/cutportlw.pcx and /dev/null differ diff --git a/Packaging/resources/assets/gendata/cutportrw.clx b/Packaging/resources/assets/gendata/cutportrw.clx new file mode 100644 index 000000000..81483f1e4 Binary files /dev/null and b/Packaging/resources/assets/gendata/cutportrw.clx differ diff --git a/Packaging/resources/assets/gendata/cutportrw.pcx b/Packaging/resources/assets/gendata/cutportrw.pcx deleted file mode 100644 index 70143b48b..000000000 Binary files a/Packaging/resources/assets/gendata/cutportrw.pcx and /dev/null differ diff --git a/Packaging/resources/assets/gendata/cutstartw.clx b/Packaging/resources/assets/gendata/cutstartw.clx new file mode 100644 index 000000000..22b508f01 Binary files /dev/null and b/Packaging/resources/assets/gendata/cutstartw.clx differ diff --git a/Packaging/resources/assets/gendata/cutstartw.pcx b/Packaging/resources/assets/gendata/cutstartw.pcx deleted file mode 100644 index 683474cc2..000000000 Binary files a/Packaging/resources/assets/gendata/cutstartw.pcx and /dev/null differ diff --git a/Packaging/resources/assets/ui_art/creditsw.clx b/Packaging/resources/assets/ui_art/creditsw.clx new file mode 100644 index 000000000..d0c54fe81 Binary files /dev/null and b/Packaging/resources/assets/ui_art/creditsw.clx differ diff --git a/Packaging/resources/assets/ui_art/creditsw.pcx b/Packaging/resources/assets/ui_art/creditsw.pcx deleted file mode 100644 index ebd3cf7df..000000000 Binary files a/Packaging/resources/assets/ui_art/creditsw.pcx and /dev/null differ diff --git a/Packaging/resources/assets/ui_art/dvl_but_sml.clx b/Packaging/resources/assets/ui_art/dvl_but_sml.clx new file mode 100644 index 000000000..827855673 Binary files /dev/null and b/Packaging/resources/assets/ui_art/dvl_but_sml.clx differ diff --git a/Packaging/resources/assets/ui_art/dvl_but_sml.pcx b/Packaging/resources/assets/ui_art/dvl_but_sml.pcx deleted file mode 100644 index b69dd6a6f..000000000 Binary files a/Packaging/resources/assets/ui_art/dvl_but_sml.pcx and /dev/null differ diff --git a/Packaging/resources/assets/ui_art/dvl_lrpopup.clx b/Packaging/resources/assets/ui_art/dvl_lrpopup.clx new file mode 100644 index 000000000..d98921946 Binary files /dev/null and b/Packaging/resources/assets/ui_art/dvl_lrpopup.clx differ diff --git a/Packaging/resources/assets/ui_art/dvl_lrpopup.pcx b/Packaging/resources/assets/ui_art/dvl_lrpopup.pcx deleted file mode 100644 index dea87199f..000000000 Binary files a/Packaging/resources/assets/ui_art/dvl_lrpopup.pcx and /dev/null differ diff --git a/Packaging/resources/assets/ui_art/hf_titlew.clx b/Packaging/resources/assets/ui_art/hf_titlew.clx new file mode 100644 index 000000000..bef879e52 Binary files /dev/null and b/Packaging/resources/assets/ui_art/hf_titlew.clx differ diff --git a/Packaging/resources/assets/ui_art/hf_titlew.pcx b/Packaging/resources/assets/ui_art/hf_titlew.pcx deleted file mode 100644 index fee1590ae..000000000 Binary files a/Packaging/resources/assets/ui_art/hf_titlew.pcx and /dev/null differ diff --git a/Packaging/resources/assets/ui_art/mainmenuw.clx b/Packaging/resources/assets/ui_art/mainmenuw.clx new file mode 100644 index 000000000..a9b690bd7 Binary files /dev/null and b/Packaging/resources/assets/ui_art/mainmenuw.clx differ diff --git a/Packaging/resources/assets/ui_art/mainmenuw.pcx b/Packaging/resources/assets/ui_art/mainmenuw.pcx deleted file mode 100644 index 2d77c4690..000000000 Binary files a/Packaging/resources/assets/ui_art/mainmenuw.pcx and /dev/null differ diff --git a/Packaging/resources/assets/ui_art/supportw.clx b/Packaging/resources/assets/ui_art/supportw.clx new file mode 100644 index 000000000..f0b302db3 Binary files /dev/null and b/Packaging/resources/assets/ui_art/supportw.clx differ diff --git a/Packaging/resources/assets/ui_art/supportw.pcx b/Packaging/resources/assets/ui_art/supportw.pcx deleted file mode 100644 index 6f9968d57..000000000 Binary files a/Packaging/resources/assets/ui_art/supportw.pcx and /dev/null differ diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 68fb4d1e2..656a95fd4 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -101,6 +101,7 @@ set(libdevilutionx_SRCS engine/dx.cpp engine/load_cel.cpp engine/load_cl2.cpp + engine/load_clx.cpp engine/load_pcx.cpp engine/palette.cpp engine/path.cpp diff --git a/Source/DiabloUI/button.cpp b/Source/DiabloUI/button.cpp index 55c9d8c74..3f27aa5ac 100644 --- a/Source/DiabloUI/button.cpp +++ b/Source/DiabloUI/button.cpp @@ -2,6 +2,7 @@ #include "DiabloUI/diabloui.h" #include "engine/clx_sprite.hpp" +#include "engine/load_clx.hpp" #include "engine/load_pcx.hpp" #include "engine/render/clx_render.hpp" #include "engine/render/text_render.hpp" @@ -17,7 +18,7 @@ OptionalOwnedClxSpriteList ButtonSprites; void LoadDialogButtonGraphics() { - ButtonSprites = LoadPcxSpriteList("ui_art\\dvl_but_sml.pcx", 2); + ButtonSprites = LoadOptionalClx("ui_art\\dvl_but_sml.clx"); if (!ButtonSprites) { ButtonSprites = LoadPcxSpriteList("ui_art\\but_sml.pcx", 15); } diff --git a/Source/DiabloUI/credits.cpp b/Source/DiabloUI/credits.cpp index 0e48f4431..ff018e522 100644 --- a/Source/DiabloUI/credits.cpp +++ b/Source/DiabloUI/credits.cpp @@ -10,7 +10,7 @@ #include "control.h" #include "controls/input.h" #include "controls/menu_controls.h" -#include "engine/load_pcx.hpp" +#include "engine/load_clx.hpp" #include "engine/render/clx_render.hpp" #include "engine/render/text_render.hpp" #include "hwcursor.hpp" @@ -170,7 +170,7 @@ bool TextDialog(char const *const *text, std::size_t textLines) bool UiCreditsDialog() { - ArtBackgroundWidescreen = LoadPcx("ui_art\\creditsw.pcx"); + ArtBackgroundWidescreen = LoadOptionalClx("ui_art\\creditsw.clx"); LoadBackgroundArt("ui_art\\credits.pcx"); return TextDialog(CreditLines, CreditLinesSize); @@ -179,10 +179,10 @@ bool UiCreditsDialog() bool UiSupportDialog() { if (gbIsHellfire) { - ArtBackgroundWidescreen = LoadPcx("ui_art\\supportw.pcx"); + ArtBackgroundWidescreen = LoadOptionalClx("ui_art\\supportw.clx"); LoadBackgroundArt("ui_art\\support.pcx"); } else { - ArtBackgroundWidescreen = LoadPcx("ui_art\\creditsw.pcx"); + ArtBackgroundWidescreen = LoadOptionalClx("ui_art\\creditsw.clx"); LoadBackgroundArt("ui_art\\credits.pcx"); } diff --git a/Source/DiabloUI/dialogs.cpp b/Source/DiabloUI/dialogs.cpp index 732c1d83b..9d086501f 100644 --- a/Source/DiabloUI/dialogs.cpp +++ b/Source/DiabloUI/dialogs.cpp @@ -9,6 +9,7 @@ #include "controls/menu_controls.h" #include "engine/clx_sprite.hpp" #include "engine/dx.h" +#include "engine/load_clx.hpp" #include "engine/load_pcx.hpp" #include "engine/palette.h" #include "hwcursor.hpp" @@ -40,7 +41,7 @@ OptionalClxSprite LoadDialogSprite(bool hasCaption, bool isError) if (!hasCaption) { ownedDialogSprite = LoadPcx(isError ? "ui_art\\srpopup.pcx" : "ui_art\\spopup.pcx", TransparentColor); } else if (isError) { - ownedDialogSprite = LoadPcx("ui_art\\dvl_lrpopup.pcx", /*transparentColor=*/std::nullopt); + ownedDialogSprite = LoadOptionalClx("ui_art\\dvl_lrpopup.clx"); if (!ownedDialogSprite) { ownedDialogSprite = LoadPcx("ui_art\\lrpopup.pcx", TransparentColor); } diff --git a/Source/DiabloUI/mainmenu.cpp b/Source/DiabloUI/mainmenu.cpp index ce1063cfb..b46193ba5 100644 --- a/Source/DiabloUI/mainmenu.cpp +++ b/Source/DiabloUI/mainmenu.cpp @@ -2,7 +2,7 @@ #include "DiabloUI/diabloui.h" #include "DiabloUI/selok.h" #include "control.h" -#include "engine/load_pcx.hpp" +#include "engine/load_clx.hpp" #include "utils/language.h" namespace devilution { @@ -45,7 +45,7 @@ void MainmenuLoad(const char *name) if (!gbIsSpawn || gbIsHellfire) { if (gbIsHellfire) - ArtBackgroundWidescreen = LoadPcx("ui_art\\mainmenuw.pcx"); + ArtBackgroundWidescreen = LoadOptionalClx("ui_art\\mainmenuw.clx"); LoadBackgroundArt("ui_art\\mainmenu.pcx"); } else { LoadBackgroundArt("ui_art\\swmmenu.pcx"); diff --git a/Source/DiabloUI/selstart.cpp b/Source/DiabloUI/selstart.cpp index 4ddc0daef..e0742fbee 100644 --- a/Source/DiabloUI/selstart.cpp +++ b/Source/DiabloUI/selstart.cpp @@ -2,7 +2,7 @@ #include "DiabloUI/diabloui.h" #include "control.h" -#include "engine/load_pcx.hpp" +#include "engine/load_clx.hpp" #include "options.h" #include "utils/language.h" #include "utils/sdl_geometry.h" @@ -32,7 +32,7 @@ void EscPressed() void UiSelStartUpGameOption() { - ArtBackgroundWidescreen = LoadPcx("ui_art\\mainmenuw.pcx"); + ArtBackgroundWidescreen = LoadOptionalClx("ui_art\\mainmenuw.clx"); LoadBackgroundArt("ui_art\\mainmenu.pcx"); UiAddBackground(&vecDialog); UiAddLogo(&vecDialog); diff --git a/Source/DiabloUI/title.cpp b/Source/DiabloUI/title.cpp index 4988f3070..71b01a320 100644 --- a/Source/DiabloUI/title.cpp +++ b/Source/DiabloUI/title.cpp @@ -3,6 +3,7 @@ #include "controls/input.h" #include "controls/menu_controls.h" #include "discord/discord.h" +#include "engine/load_clx.hpp" #include "engine/load_pcx.hpp" #include "utils/language.h" #include "utils/sdl_geometry.h" @@ -19,7 +20,7 @@ void TitleLoad() { if (gbIsHellfire) { LoadBackgroundArt("ui_art\\hf_logo1.pcx", 16); - ArtBackgroundWidescreen = LoadPcx("ui_art\\hf_titlew.pcx"); + ArtBackgroundWidescreen = LoadOptionalClx("ui_art\\hf_titlew.clx"); } else { LoadBackgroundArt("ui_art\\title.pcx"); DiabloTitleLogo = LoadPcxSpriteList("ui_art\\logo.pcx", /*numFrames=*/15, /*transparentColor=*/250); diff --git a/Source/controls/modifier_hints.cpp b/Source/controls/modifier_hints.cpp index 718044769..a341ec55e 100644 --- a/Source/controls/modifier_hints.cpp +++ b/Source/controls/modifier_hints.cpp @@ -2,13 +2,14 @@ #include -#include "DiabloUI/art_draw.h" #include "DiabloUI/ui_flags.hpp" #include "control.h" #include "controls/controller_motion.h" #include "controls/game_controls.h" #include "controls/plrctrls.h" -#include "engine/load_cel.hpp" +#include "engine/clx_sprite.hpp" +#include "engine/load_clx.hpp" +#include "engine/render/clx_render.hpp" #include "engine/render/text_render.hpp" #include "options.h" #include "panels/spell_icons.hpp" @@ -41,9 +42,9 @@ constexpr int IconSizeTextMarginTop = 2; constexpr int HintBoxSize = 39; constexpr int HintBoxMargin = 5; -Art hintBox; -Art hintBoxBackground; -Art hintIcons; +OptionalOwnedClxSpriteList hintBox; +OptionalOwnedClxSpriteList hintBoxBackground; +OptionalOwnedClxSpriteList hintIcons; enum HintIcon : uint8_t { IconChar, @@ -97,9 +98,9 @@ void DrawCircleMenuHint(const Surface &out, const CircleMenuHint &hint, const Po if (iconIndices[slot] == HintIcon::IconNull) continue; - DrawArt(out, iconPositions[slot], &hintBoxBackground); - DrawArt(out, iconPositions[slot], &hintIcons, iconIndices[slot], 37, 38); - DrawArt(out, hintBoxPositions[slot], &hintBox); + RenderClxSprite(out, (*hintBoxBackground)[0], iconPositions[slot]); + RenderClxSprite(out.subregion(iconPositions[slot].x, iconPositions[slot].y, 37, 38), (*hintIcons)[iconIndices[slot]], { 0, 0 }); + RenderClxSprite(out, (*hintBox)[0], hintBoxPositions[slot]); } } @@ -140,7 +141,7 @@ void DrawSpellsCircleMenuHint(const Surface &out, const Point &origin) SetSpellTrans(splType); DrawSpellCel(out, spellIconPositions[slot], *pSBkIconCels, SpellITbl[splId]); - DrawArt(out, hintBoxPositions[slot], &hintBox); + RenderClxSprite(out, (*hintBox)[0], hintBoxPositions[slot]); } } @@ -171,11 +172,11 @@ void DrawSelectModifierMenu(const Surface &out) void InitModifierHints() { - LoadMaskedArt("data\\hintbox.pcx", &hintBox, 1, 1); - LoadMaskedArt("data\\hintboxbackground.pcx", &hintBoxBackground, 1, 1); - LoadMaskedArt("data\\hinticons.pcx", &hintIcons, 6, 1); + hintBox = LoadOptionalClx("data\\hintbox.clx"); + hintBoxBackground = LoadOptionalClx("data\\hintboxbackground.clx"); + hintIcons = LoadOptionalClx("data\\hinticons.clx"); - if (hintBox.surface == nullptr || hintBoxBackground.surface == nullptr) { + if (!hintBox || !hintBoxBackground || !hintIcons) { app_fatal(_("Failed to load UI resources.\n" "\n" "Make sure devilutionx.mpq is in the game folder and that it is up to date.")); @@ -184,9 +185,9 @@ void InitModifierHints() void FreeModifierHints() { - hintBox.Unload(); - hintBoxBackground.Unload(); - hintIcons.Unload(); + hintIcons = std::nullopt; + hintBoxBackground = std::nullopt; + hintBox = std::nullopt; } void DrawControllerModifierHints(const Surface &out) diff --git a/Source/engine/clx_sprite.hpp b/Source/engine/clx_sprite.hpp index ccc789589..bbfdb7a78 100644 --- a/Source/engine/clx_sprite.hpp +++ b/Source/engine/clx_sprite.hpp @@ -118,6 +118,8 @@ public: ClxSpriteList(const OwnedClxSpriteList &owned); + [[nodiscard]] OwnedClxSpriteList clone() const; + [[nodiscard]] constexpr uint32_t numSprites() const { return LoadLE32(data_); @@ -139,7 +141,7 @@ public: /** @brief The offset to the next sprite sheet, or file size if this is the last sprite sheet. */ [[nodiscard]] constexpr uint32_t nextSpriteSheetOffsetOrFileSize() const { - return LoadLE32(&data_[4 + numSprites()]); + return LoadLE32(&data_[4 + numSprites() * 4]); } [[nodiscard]] constexpr const uint8_t *data() const @@ -350,6 +352,11 @@ public: OwnedClxSpriteList(OwnedClxSpriteList &&) noexcept = default; OwnedClxSpriteList &operator=(OwnedClxSpriteList &&) noexcept = default; + [[nodiscard]] OwnedClxSpriteList clone() const + { + return ClxSpriteList { *this }.clone(); + } + [[nodiscard]] ClxSprite operator[](size_t spriteIndex) const { return ClxSpriteList { *this }[spriteIndex]; @@ -371,6 +378,14 @@ inline ClxSpriteList::ClxSpriteList(const OwnedClxSpriteList &owned) { } +inline OwnedClxSpriteList ClxSpriteList::clone() const +{ + const size_t dataSize = nextSpriteSheetOffsetOrFileSize(); + std::unique_ptr data { new uint8_t[dataSize] }; + memcpy(data.get(), data_, dataSize); + return OwnedClxSpriteList { std::move(data) }; +} + /** * @brief Implicitly convertible to `ClxSpriteSheet` and owns its data. */ diff --git a/Source/engine/load_clx.cpp b/Source/engine/load_clx.cpp new file mode 100644 index 000000000..082e17db1 --- /dev/null +++ b/Source/engine/load_clx.cpp @@ -0,0 +1,31 @@ +#include "engine/load_clx.hpp" + +#include + +#ifdef USE_SDL1 +#include "utils/sdl2_to_1_2_backports.h" +#endif + +#include "engine/assets.hpp" +#include "engine/load_file.hpp" + +namespace devilution { + +OptionalOwnedClxSpriteListOrSheet LoadOptionalClxListOrSheet(const char *path) +{ + SDL_RWops *handle = OpenAsset(path); + if (handle == nullptr) + return std::nullopt; + const size_t size = SDL_RWsize(handle); + std::unique_ptr data { new uint8_t[size] }; + SDL_RWread(handle, data.get(), size, 1); + SDL_RWclose(handle); + return OwnedClxSpriteListOrSheet { std::move(data) }; +} + +OwnedClxSpriteListOrSheet LoadClxListOrSheet(const char *path) +{ + return OwnedClxSpriteListOrSheet { LoadFileInMem(path) }; +} + +} // namespace devilution diff --git a/Source/engine/load_clx.hpp b/Source/engine/load_clx.hpp new file mode 100644 index 000000000..f53476e77 --- /dev/null +++ b/Source/engine/load_clx.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "clx_sprite.hpp" + +namespace devilution { + +OwnedClxSpriteListOrSheet LoadClxListOrSheet(const char *path); + +inline OwnedClxSpriteList LoadClx(const char *path) +{ + return LoadClxListOrSheet(path).list(); +} + +inline OwnedClxSpriteSheet LoadClxSheet(const char *path) +{ + return LoadClxListOrSheet(path).sheet(); +} + +OptionalOwnedClxSpriteListOrSheet LoadOptionalClxListOrSheet(const char *path); + +inline OptionalOwnedClxSpriteList LoadOptionalClx(const char *path) +{ + OptionalOwnedClxSpriteListOrSheet result = LoadOptionalClxListOrSheet(path); + if (!result) + return std::nullopt; + return std::move(*result).list(); +} + +} // namespace devilution diff --git a/Source/engine/render/text_render.cpp b/Source/engine/render/text_render.cpp index 2f37cd06b..60b000138 100644 --- a/Source/engine/render/text_render.cpp +++ b/Source/engine/render/text_render.cpp @@ -17,8 +17,8 @@ #include "DiabloUI/ui_item.h" #include "engine.h" #include "engine/load_cel.hpp" +#include "engine/load_clx.hpp" #include "engine/load_file.hpp" -#include "engine/load_pcx.hpp" #include "engine/palette.h" #include "engine/point.hpp" #include "engine/render/clx_render.hpp" @@ -194,11 +194,10 @@ const OwnedClxSpriteList *LoadFont(GameFontTables size, text_color color, uint16 } char path[32]; - GetFontPath(size, row, "pcx", &path[0]); + GetFontPath(size, row, "clx", &path[0]); OptionalOwnedClxSpriteList &font = Fonts[fontId]; - constexpr unsigned NumFrames = 256; - font = LoadPcxSpriteList(path, NumFrames, /*transparentColor=*/1); + font = LoadOptionalClx(path); if (!font) { LogError("Error loading font: {}", path); return nullptr; diff --git a/Source/interfac.cpp b/Source/interfac.cpp index 50952f91a..d345c9e80 100644 --- a/Source/interfac.cpp +++ b/Source/interfac.cpp @@ -13,7 +13,7 @@ #include "engine/clx_sprite.hpp" #include "engine/dx.h" #include "engine/load_cel.hpp" -#include "engine/load_pcx.hpp" +#include "engine/load_clx.hpp" #include "engine/palette.h" #include "engine/render/clx_render.hpp" #include "hwcursor.hpp" @@ -105,7 +105,7 @@ void LoadCutsceneBackground(interface_mode uMsg) switch (PickCutscene(uMsg)) { case CutStart: - ArtCutsceneWidescreen = LoadPcx("gendata\\cutstartw.pcx"); + ArtCutsceneWidescreen = LoadOptionalClx("gendata\\cutstartw.pcx"); celPath = "Gendata\\Cutstart.cel"; palPath = "Gendata\\Cutstart.pal"; progress_id = 1; @@ -146,13 +146,13 @@ void LoadCutsceneBackground(interface_mode uMsg) progress_id = 1; break; case CutPortal: - ArtCutsceneWidescreen = LoadPcx("gendata\\cutportlw.pcx"); + ArtCutsceneWidescreen = LoadOptionalClx("gendata\\cutportlw.pcx"); celPath = "Gendata\\Cutportl.cel"; palPath = "Gendata\\Cutportl.pal"; progress_id = 1; break; case CutPortalRed: - ArtCutsceneWidescreen = LoadPcx("gendata\\cutportrw.pcx"); + ArtCutsceneWidescreen = LoadOptionalClx("gendata\\cutportrw.pcx"); celPath = "Gendata\\Cutportr.cel"; palPath = "Gendata\\Cutportr.pal"; progress_id = 1; diff --git a/Source/panels/charpanel.cpp b/Source/panels/charpanel.cpp index c0d82adb4..c530d8cde 100644 --- a/Source/panels/charpanel.cpp +++ b/Source/panels/charpanel.cpp @@ -7,6 +7,7 @@ #include "DiabloUI/art.h" #include "DiabloUI/art_draw.h" #include "control.h" +#include "engine/load_clx.hpp" #include "engine/render/clx_render.hpp" #include "engine/render/text_render.hpp" #include "panels/ui_panels.hpp" @@ -199,9 +200,9 @@ PanelEntry panelEntries[] = { []() { return GetResistInfo(MyPlayer->_pLghtResist); } }, }; -Art PanelBoxLeft; -Art PanelBoxMiddle; -Art PanelBoxRight; +OptionalOwnedClxSpriteList PanelBoxLeft; +OptionalOwnedClxSpriteList PanelBoxMiddle; +OptionalOwnedClxSpriteList PanelBoxRight; Art PanelFull; constexpr int PanelFieldHeight = 24; @@ -211,12 +212,12 @@ constexpr int PanelFieldInnerHeight = PanelFieldHeight - PanelFieldPaddingTop - void DrawPanelField(const Surface &out, Point pos, int len) { - DrawArt(out, pos, &PanelBoxLeft); - pos.x += PanelBoxLeft.w(); - len -= PanelBoxLeft.w() + PanelBoxRight.w(); - DrawArt(out, pos, &PanelBoxMiddle, 0, len); + RenderClxSprite(out, (*PanelBoxLeft)[0], pos); + pos.x += (*PanelBoxLeft)[0].width(); + len -= (*PanelBoxLeft)[0].width() + (*PanelBoxRight)[0].width(); + RenderClxSprite(out.subregion(pos.x, pos.y, len, (*PanelBoxMiddle)[0].height()), (*PanelBoxMiddle)[0], Point { 0, 0 }); pos.x += len; - DrawArt(out, pos, &PanelBoxRight); + RenderClxSprite(out, (*PanelBoxRight)[0], pos); } void DrawShadowString(const Surface &out, const PanelEntry &entry) @@ -270,9 +271,9 @@ void LoadCharPanel() { LoadArt("data\\charbg.pcx", &PanelFull); UpdatePalette(&PanelFull); // PanelFull is being used as a render target - LoadArt("data\\boxleftend.pcx", &PanelBoxLeft); - LoadArt("data\\boxmiddle.pcx", &PanelBoxMiddle); - LoadArt("data\\boxrightend.pcx", &PanelBoxRight); + PanelBoxLeft = LoadClx("data\\boxleftend.clx"); + PanelBoxMiddle = LoadClx("data\\boxmiddle.clx"); + PanelBoxRight = LoadClx("data\\boxrightend.clx"); const Surface out(PanelFull.surface.get()); @@ -290,9 +291,9 @@ void LoadCharPanel() DrawShadowString(out, entry); } - PanelBoxLeft.Unload(); - PanelBoxMiddle.Unload(); - PanelBoxRight.Unload(); + PanelBoxRight = std::nullopt; + PanelBoxMiddle = std::nullopt; + PanelBoxLeft = std::nullopt; } void FreeCharPanel() diff --git a/Source/panels/mainpanel.cpp b/Source/panels/mainpanel.cpp index 365cb5203..520ed6259 100644 --- a/Source/panels/mainpanel.cpp +++ b/Source/panels/mainpanel.cpp @@ -1,6 +1,8 @@ #include "panels/mainpanel.hpp" #include "control.h" +#include "engine/clx_sprite.hpp" +#include "engine/load_clx.hpp" #include "engine/render/clx_render.hpp" #include "engine/render/text_render.hpp" #include "utils/display.h" @@ -15,9 +17,9 @@ Art TalkButton; namespace { -Art PanelButton; -Art PanelButtonGrime; -Art PanelButtonDownGrime; +OptionalOwnedClxSpriteList PanelButton; +OptionalOwnedClxSpriteList PanelButtonGrime; +OptionalOwnedClxSpriteList PanelButtonDownGrime; void DrawButtonText(const Surface &out, string_view text, Rectangle placement, UiFlags style, int spacing = 1) { @@ -27,15 +29,15 @@ void DrawButtonText(const Surface &out, string_view text, Rectangle placement, U void DrawButtonOnPanel(Point position, string_view text, int frame) { - DrawArt(*pBtmBuff, position, &PanelButton, frame); + RenderClxSprite(*pBtmBuff, (*PanelButton)[frame], position); int spacing = 2; - int width = std::min(GetLineWidth(text, GameFont12, spacing), PanelButton.w()); + int width = std::min(GetLineWidth(text, GameFont12, spacing), (*PanelButton)[0].width()); if (width > 38) { spacing = 1; - width = std::min(GetLineWidth(text, GameFont12, spacing), PanelButton.w()); + width = std::min(GetLineWidth(text, GameFont12, spacing), (*PanelButton)[0].width()); } - DrawArt(*pBtmBuff, position + Displacement { (PanelButton.w() - width) / 2, 7 }, &PanelButtonGrime, frame, width); - DrawButtonText(*pBtmBuff, text, { position, { PanelButton.w(), 0 } }, UiFlags::ColorButtonface, spacing); + RenderClxSprite(pBtmBuff->subregion(position.x + ((*PanelButton)[0].width() - width) / 2, position.y + 7, width, pBtmBuff->h() - 7), (*PanelButtonGrime)[frame], { 0, 0 }); + DrawButtonText(*pBtmBuff, text, { position, { (*PanelButton)[0].width(), 0 } }, UiFlags::ColorButtonface, spacing); } void RenderMainButton(int buttonId, string_view text, int frame) @@ -48,12 +50,12 @@ void RenderMainButton(int buttonId, string_view text, int frame) const Surface out(PanelButtonDown.surface.get()); Point position { 0, 19 * buttonId }; int spacing = 2; - int width = std::min(GetLineWidth(text, GameFont12, spacing), PanelButton.w()); + int width = std::min(GetLineWidth(text, GameFont12, spacing), (*PanelButton)[0].width()); if (width > 38) { spacing = 1; - width = std::min(GetLineWidth(text, GameFont12, spacing), PanelButton.w()); + width = std::min(GetLineWidth(text, GameFont12, spacing), (*PanelButton)[0].width()); } - DrawArt(out, position + Displacement { (PanelButton.w() - width) / 2, 9 }, &PanelButtonDownGrime, frame, width); + RenderClxSprite(out.subregion(position.x + ((*PanelButton)[0].width() - width) / 2, position.y + 9, width, out.h() - position.y - 9), (*PanelButtonDownGrime)[frame], { 0, 0 }); DrawButtonText(out, text, { position + Displacement { 0, 2 }, { PanelButtonDown.w(), 0 } }, UiFlags::ColorButtonpushed, spacing); } @@ -62,8 +64,8 @@ void DrawTalkButton(int buttonId) string_view text = _("voice"); Point position { 176, GetMainPanel().size.height + 101 + 18 * buttonId }; DrawArt(*pBtmBuff, position, &TalkButton); - int width = std::min(GetLineWidth(text, GameFont12, 1), PanelButton.w()); - DrawArt(*pBtmBuff, position + Displacement { (TalkButton.w() - width) / 2, 6 }, &PanelButtonGrime, 1, width, 9); + int width = std::min(GetLineWidth(text, GameFont12, 1), (*PanelButton)[0].width()); + RenderClxSprite(pBtmBuff->subregion(position.x + (TalkButton.w() - width) / 2, position.y + 6, width, 9), (*PanelButtonGrime)[1], { 0, 0 }); DrawButtonText(*pBtmBuff, text, { position, { TalkButton.w(), 0 } }, UiFlags::ColorButtonface); } @@ -71,10 +73,10 @@ void DrawTalkButton(int buttonId) void LoadMainPanel() { - LoadArt("data\\panel8buc.pcx", &PanelButton, 2); - LoadArt("data\\dirtybuc.pcx", &PanelButtonGrime, 2); LoadArt("data\\panel8bucp.pcx", &PanelButtonDown, 6); - LoadArt("data\\dirtybucp.pcx", &PanelButtonDownGrime, 2); + PanelButton = LoadClx("data\\panel8buc.clx"); + PanelButtonGrime = LoadClx("data\\dirtybuc.clx"); + PanelButtonDownGrime = LoadClx("data\\dirtybucp.clx"); // Load palette to render targets UpdatePalette(&PanelButtonDown); @@ -99,21 +101,21 @@ void LoadMainPanel() const Surface talkSurface(TalkButton.surface.get()); int muteWidth = GetLineWidth(_("mute"), GameFont12, 2); - DrawArt(talkSurface, { (TalkButton.w() - muteWidth) / 2, 6 }, &PanelButtonGrime, 1, muteWidth, 9); + RenderClxSprite(talkSurface.subregion((TalkButton.w() - muteWidth) / 2, 6, muteWidth, 9), (*PanelButtonGrime)[1], { 0, 0 }); DrawButtonText(talkSurface, _("mute"), { { 0, 0 }, { TalkButton.w(), 0 } }, UiFlags::ColorButtonface); - DrawArt(talkSurface, { (TalkButton.w() - muteWidth) / 2, 23 }, &PanelButtonGrime, 1, muteWidth, 9); + RenderClxSprite(talkSurface.subregion((TalkButton.w() - muteWidth) / 2, 23, muteWidth, 9), (*PanelButtonGrime)[1], { 0, 0 }); DrawButtonText(talkSurface, _("mute"), { { 0, 17 }, { TalkButton.w(), 0 } }, UiFlags::ColorButtonpushed); int voiceWidth = GetLineWidth(_("voice"), GameFont12, 2); - DrawArt(talkSurface, { (TalkButton.w() - voiceWidth) / 2, 39 }, &PanelButtonGrime, 1, voiceWidth, 9); + RenderClxSprite(talkSurface.subregion((TalkButton.w() - voiceWidth) / 2, 39, voiceWidth, 9), (*PanelButtonGrime)[1], { 0, 0 }); DrawButtonText(talkSurface, _("voice"), { { 0, 33 }, { TalkButton.w(), 0 } }, UiFlags::ColorButtonpushed); } UnloadFonts(GameFont12, ColorButtonface); UnloadFonts(GameFont12, ColorButtonpushed); - PanelButton.Unload(); - PanelButtonGrime.Unload(); - PanelButtonDownGrime.Unload(); + PanelButtonDownGrime = std::nullopt; + PanelButtonGrime = std::nullopt; + PanelButton = std::nullopt; } void FreeMainPanel() diff --git a/Source/qol/monhealthbar.cpp b/Source/qol/monhealthbar.cpp index e21a97524..2266d0437 100644 --- a/Source/qol/monhealthbar.cpp +++ b/Source/qol/monhealthbar.cpp @@ -6,9 +6,11 @@ #include -#include "DiabloUI/art_draw.h" #include "control.h" #include "cursor.h" +#include "engine/clx_sprite.hpp" +#include "engine/load_clx.hpp" +#include "engine/render/clx_render.hpp" #include "options.h" #include "utils/language.h" #include "utils/str_cat.hpp" @@ -16,11 +18,11 @@ namespace devilution { namespace { -Art healthBox; -Art resistance; -Art health; -Art healthBlue; -Art playerExpTags; +OptionalOwnedClxSpriteList healthBox; +OptionalOwnedClxSpriteList resistance; +OptionalOwnedClxSpriteList health; +OptionalOwnedClxSpriteList healthBlue; +OptionalOwnedClxSpriteList playerExpTags; } // namespace @@ -29,31 +31,32 @@ void InitMonsterHealthBar() if (!*sgOptions.Gameplay.enemyHealthBar) return; - LoadMaskedArt("data\\healthbox.pcx", &healthBox, 1, 1); - LoadArt("data\\health.pcx", &health); - std::array data; - data[234] = 185; - data[235] = 186; - data[236] = 187; - LoadMaskedArt("data\\health.pcx", &healthBlue, 1, 1, &data); - LoadMaskedArt("data\\resistance.pcx", &resistance, 6, 1); - LoadMaskedArt("data\\monstertags.pcx", &playerExpTags, 5, 1); - - if ((healthBox.surface == nullptr) - || (health.surface == nullptr) - || (resistance.surface == nullptr)) { + healthBox = LoadOptionalClx("data\\healthbox.clx"); + health = LoadOptionalClx("data\\health.clx"); + resistance = LoadOptionalClx("data\\resistance.clx"); + playerExpTags = LoadOptionalClx("data\\monstertags.clx"); + + if (!healthBox || !health || !resistance || !playerExpTags) { app_fatal(_("Failed to load UI resources.\n" "\n" "Make sure devilutionx.mpq is in the game folder and that it is up to date.")); } + + std::array healthBlueTrn; + healthBlueTrn[234] = 185; + healthBlueTrn[235] = 186; + healthBlueTrn[236] = 187; + healthBlue = health->clone(); + ClxApplyTrans(*healthBlue, healthBlueTrn.data()); } void FreeMonsterHealthBar() { - healthBox.Unload(); - health.Unload(); - healthBlue.Unload(); - resistance.Unload(); + healthBlue = std::nullopt; + playerExpTags = std::nullopt; + resistance = std::nullopt; + health = std::nullopt; + healthBox = std::nullopt; } void DrawMonsterHealthBar(const Surface &out) @@ -61,11 +64,6 @@ void DrawMonsterHealthBar(const Surface &out) if (!*sgOptions.Gameplay.enemyHealthBar) return; - assert(healthBox.surface != nullptr); - assert(health.surface != nullptr); - assert(healthBlue.surface != nullptr); - assert(resistance.surface != nullptr); - if (leveltype == DTYPE_TOWN) return; if (pcursmonst == -1) @@ -73,9 +71,9 @@ void DrawMonsterHealthBar(const Surface &out) const Monster &monster = Monsters[pcursmonst]; - const int width = healthBox.w(); - const int barWidth = health.w(); - const int height = healthBox.h(); + const int width = (*healthBox)[0].width(); + const int barWidth = (*health)[0].width(); + const int height = (*healthBox)[0].height(); Point position = { (gnScreenWidth - width) / 2, 18 }; if (CanPanelsCoverView()) { @@ -99,14 +97,16 @@ void DrawMonsterHealthBar(const Surface &out) } } - DrawArt(out, position, &healthBox); + RenderClxSprite(out, (*healthBox)[0], position); DrawHalfTransparentRectTo(out, position.x + border, position.y + border, width - (border * 2), height - (border * 2)); int barProgress = (barWidth * currLife) / monster.maxHitPoints; if (barProgress != 0) { - DrawArt(out, position + Displacement { border + 1, border + 1 }, multiplier > 0 ? &healthBlue : &health, 0, barProgress, height - (border * 2) - 2); + RenderClxSprite( + out.subregion(position.x + border + 1, position.y + border + 1, barProgress, height - (border * 2) - 2), + (*(multiplier > 0 ? healthBlue : health))[0], { 0, 0 }); } - constexpr auto getBorderColor = [](MonsterClass monsterClass) { + constexpr auto GetBorderColor = [](MonsterClass monsterClass) { switch (monsterClass) { case MonsterClass::Undead: return 248; @@ -123,7 +123,7 @@ void DrawMonsterHealthBar(const Surface &out) }; if (*sgOptions.Gameplay.showMonsterType) { - Uint8 borderColor = getBorderColor(monster.data().monsterClass); + Uint8 borderColor = GetBorderColor(monster.data().monsterClass); int borderWidth = width - (border * 2); UnsafeDrawHorizontalLine(out, { position.x + border, position.y + border }, borderWidth, borderColor); UnsafeDrawHorizontalLine(out, { position.x + border, position.y + height - border - 1 }, borderWidth, borderColor); @@ -149,25 +149,25 @@ void DrawMonsterHealthBar(const Surface &out) monster_resistance resists[] = { RESIST_MAGIC, RESIST_FIRE, RESIST_LIGHTNING }; int resOffset = 5; - for (int i = 0; i < 3; i++) { + for (size_t i = 0; i < 3; i++) { if ((monster.resistance & immunes[i]) != 0) { - DrawArt(out, position + Displacement { resOffset, height - 6 }, &resistance, i * 2 + 1); - resOffset += resistance.w() + 2; + RenderClxSprite(out, (*resistance)[i * 2 + 1], position + Displacement { resOffset, height - 6 }); + resOffset += (*resistance)[0].width() + 2; } else if ((monster.resistance & resists[i]) != 0) { - DrawArt(out, position + Displacement { resOffset, height - 6 }, &resistance, i * 2); - resOffset += resistance.w() + 2; + RenderClxSprite(out, (*resistance)[i * 2], position + Displacement { resOffset, height - 6 }); + resOffset += (*resistance)[0].width() + 2; } } } int tagOffset = 5; - for (int i = 0; i < MAX_PLRS; i++) { - if (1 << i & monster.whoHit) { - DrawArt(out, position + Displacement { tagOffset, height - 31 }, &playerExpTags, i + 1); + for (size_t i = 0; i < MAX_PLRS; i++) { + if (((1U << i) & monster.whoHit) != 0) { + RenderClxSprite(out, (*playerExpTags)[i + 1], position + Displacement { tagOffset, height - 31 }); } else if (Players[i].plractive) { - DrawArt(out, position + Displacement { tagOffset, height - 31 }, &playerExpTags, 0); + RenderClxSprite(out, (*playerExpTags)[0], position + Displacement { tagOffset, height - 31 }); } - tagOffset += playerExpTags.w(); + tagOffset += (*playerExpTags)[0].width(); } } diff --git a/Source/qol/stash.cpp b/Source/qol/stash.cpp index d7f2a69c6..10cb051ed 100644 --- a/Source/qol/stash.cpp +++ b/Source/qol/stash.cpp @@ -1,13 +1,14 @@ #include "qol/stash.h" -#include "utils/stdcompat/algorithm.hpp" -#include #include -#include "DiabloUI/art_draw.h" +#include + #include "control.h" #include "controls/plrctrls.h" #include "cursor.h" +#include "engine/clx_sprite.hpp" +#include "engine/load_clx.hpp" #include "engine/points_in_rectangle_range.hpp" #include "engine/rectangle.hpp" #include "engine/render/clx_render.hpp" @@ -19,6 +20,7 @@ #include "stores.h" #include "utils/format_int.hpp" #include "utils/language.h" +#include "utils/stdcompat/algorithm.hpp" #include "utils/str_cat.hpp" #include "utils/utf8.hpp" @@ -50,8 +52,8 @@ constexpr Rectangle StashButtonRect[] = { constexpr PointsInRectangleRange StashGridRange { { { 0, 0 }, Size { 10, 10 } } }; -Art StashPanelArt; -Art StashNavButtonArt; +OptionalOwnedClxSpriteList StashPanelArt; +OptionalOwnedClxSpriteList StashNavButtonArt; /** * @param page The stash page index. @@ -258,16 +260,22 @@ Point GetStashSlotCoord(Point slot) void FreeStashGFX() { - StashPanelArt.Unload(); - StashNavButtonArt.Unload(); + StashNavButtonArt = std::nullopt; + StashPanelArt = std::nullopt; } void InitStash() { InitialWithdrawGoldValue = 0; - LoadArt("data\\stash.pcx", &StashPanelArt, 1); - LoadArt("data\\stashnavbtns.pcx", &StashNavButtonArt, 5); + StashPanelArt = LoadOptionalClx("data\\stash.clx"); + StashNavButtonArt = LoadOptionalClx("data\\stashnavbtns.clx"); + + if (!StashPanelArt || !StashNavButtonArt) { + app_fatal(_("Failed to load UI resources.\n" + "\n" + "Make sure devilutionx.mpq is in the game folder and that it is up to date.")); + } } void TransferItemToInventory(Player &player, uint16_t itemId) @@ -341,11 +349,11 @@ void CheckStashButtonPress(Point mousePosition) void DrawStash(const Surface &out) { - DrawArt(out, GetPanelPosition(UiPanels::Stash), &StashPanelArt); + RenderClxSprite(out, (*StashPanelArt)[0], GetPanelPosition(UiPanels::Stash)); if (StashButtonPressed != -1) { Point stashButton = GetPanelPosition(UiPanels::Stash, StashButtonRect[StashButtonPressed].position); - DrawArt(out, stashButton, &StashNavButtonArt, StashButtonPressed); + RenderClxSprite(out, (*StashNavButtonArt)[StashButtonPressed], stashButton); } constexpr Displacement offset { 0, INV_SLOT_SIZE_PX - 1 };