From ab41e0c1f8be9c8d4a67686dfddeb15e41eb3118 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Tue, 22 Oct 2024 10:20:07 -0500 Subject: [PATCH 01/11] unpack all resdat/cldat, document format, add headers for palette offsets --- include/sprite_resource.h | 2 +- platinum.us/filesys.sha1 | 84 ++-- platinum.us/rom.rsf | 32 ++ res/data/btower_canm.json | 11 + res/data/btower_celact.json | 12 + res/data/btower_cell.json | 11 + res/data/btower_chr.json | 12 + res/data/btower_pal.json | 13 + res/data/meson.build | 79 ++++ res/data/plist_canm.json | 47 +++ res/data/plist_cell.json | 47 +++ res/data/plist_chr.json | 89 +++++ res/data/plist_h.json | 122 ++++++ res/data/plist_pal.json | 45 +++ res/data/porucase_canm.json | 17 + res/data/porucase_celact.json | 22 ++ res/data/porucase_cell.json | 17 + res/data/porucase_chr.json | 19 + res/data/porucase_pal.json | 13 + res/data/pst_canm.json | 107 +++++ res/data/pst_cell.json | 107 +++++ res/data/pst_chr.json | 306 +++++++++++++++ res/data/pst_h.json | 432 +++++++++++++++++++++ res/data/pst_pal.json | 54 +++ res/data/shop_canm.json | 23 ++ res/data/shop_cell.json | 23 ++ res/data/shop_chr.json | 26 ++ res/data/shop_h.json | 32 ++ res/data/shop_pal.json | 21 + res/data/tmapn_canm.json | 35 ++ res/data/tmapn_celact.json | 52 +++ res/{prebuilt => }/data/tmapn_celact.txt | 0 res/data/tmapn_cell.json | 35 ++ res/data/tmapn_chr.json | 40 ++ res/data/tmapn_pal.json | 21 + res/{prebuilt => }/data/tmapn_res_canm.txt | 0 res/{prebuilt => }/data/tmapn_res_cell.txt | 0 res/{prebuilt => }/data/tmapn_res_chr.txt | 0 res/{prebuilt => }/data/tmapn_res_pal.txt | 0 res/data/uground_cell.json | 17 + res/data/uground_cellanm.json | 17 + res/data/uground_char.json | 19 + res/data/uground_char2.json | 19 + res/data/uground_clact.json | 22 ++ res/data/uground_pltt.json | 13 + res/data/uground_pltt2.json | 13 + res/meson.build | 1 + res/prebuilt/data/btower_canm.resdat | Bin 52 -> 0 bytes res/prebuilt/data/btower_celact.cldat | Bin 64 -> 0 bytes res/prebuilt/data/btower_cell.resdat | Bin 52 -> 0 bytes res/prebuilt/data/btower_chr.resdat | Bin 52 -> 0 bytes res/prebuilt/data/btower_pal.resdat | Bin 52 -> 0 bytes res/prebuilt/data/meson.build | 42 -- res/prebuilt/data/plist_canm.resdat | Bin 196 -> 0 bytes res/prebuilt/data/plist_cell.resdat | Bin 196 -> 0 bytes res/prebuilt/data/plist_chr.resdat | Bin 316 -> 0 bytes res/prebuilt/data/plist_h.cldat | Bin 416 -> 0 bytes res/prebuilt/data/plist_pal.resdat | Bin 148 -> 0 bytes res/prebuilt/data/porucase_canm.resdat | Bin 76 -> 0 bytes res/prebuilt/data/porucase_celact.cldat | Bin 96 -> 0 bytes res/prebuilt/data/porucase_cell.resdat | Bin 76 -> 0 bytes res/prebuilt/data/porucase_chr.resdat | Bin 76 -> 0 bytes res/prebuilt/data/porucase_pal.resdat | Bin 52 -> 0 bytes res/prebuilt/data/pst_canm.resdat | Bin 436 -> 0 bytes res/prebuilt/data/pst_cell.resdat | Bin 436 -> 0 bytes res/prebuilt/data/pst_chr.resdat | Bin 1060 -> 0 bytes res/prebuilt/data/pst_h.cldat | Bin 1408 -> 0 bytes res/prebuilt/data/pst_pal.resdat | Bin 172 -> 0 bytes res/prebuilt/data/shop_canm.resdat | Bin 100 -> 0 bytes res/prebuilt/data/shop_cell.resdat | Bin 100 -> 0 bytes res/prebuilt/data/shop_chr.resdat | Bin 100 -> 0 bytes res/prebuilt/data/shop_h.cldat | Bin 128 -> 0 bytes res/prebuilt/data/shop_pal.resdat | Bin 76 -> 0 bytes res/prebuilt/data/tmapn_canm.resdat | Bin 148 -> 0 bytes res/prebuilt/data/tmapn_celact.cldat | Bin 192 -> 0 bytes res/prebuilt/data/tmapn_cell.resdat | Bin 148 -> 0 bytes res/prebuilt/data/tmapn_chr.resdat | Bin 148 -> 0 bytes res/prebuilt/data/tmapn_pal.resdat | Bin 76 -> 0 bytes res/prebuilt/data/uground_cell.resdat | Bin 76 -> 0 bytes res/prebuilt/data/uground_cellanm.resdat | Bin 76 -> 0 bytes res/prebuilt/data/uground_char.resdat | Bin 76 -> 0 bytes res/prebuilt/data/uground_char2.resdat | Bin 76 -> 0 bytes res/prebuilt/data/uground_clact.cldat | Bin 96 -> 0 bytes res/prebuilt/data/uground_pltt.resdat | Bin 52 -> 0 bytes res/prebuilt/data/uground_pltt2.resdat | Bin 52 -> 0 bytes src/sprite_resource.c | 4 +- tools/scripts/make_cldat.py | 41 ++ tools/scripts/make_resdat.py | 77 ++++ tools/scripts/meson.build | 4 +- 89 files changed, 2209 insertions(+), 88 deletions(-) create mode 100644 res/data/btower_canm.json create mode 100644 res/data/btower_celact.json create mode 100644 res/data/btower_cell.json create mode 100644 res/data/btower_chr.json create mode 100644 res/data/btower_pal.json create mode 100644 res/data/meson.build create mode 100644 res/data/plist_canm.json create mode 100644 res/data/plist_cell.json create mode 100644 res/data/plist_chr.json create mode 100644 res/data/plist_h.json create mode 100644 res/data/plist_pal.json create mode 100644 res/data/porucase_canm.json create mode 100644 res/data/porucase_celact.json create mode 100644 res/data/porucase_cell.json create mode 100644 res/data/porucase_chr.json create mode 100644 res/data/porucase_pal.json create mode 100644 res/data/pst_canm.json create mode 100644 res/data/pst_cell.json create mode 100644 res/data/pst_chr.json create mode 100644 res/data/pst_h.json create mode 100644 res/data/pst_pal.json create mode 100644 res/data/shop_canm.json create mode 100644 res/data/shop_cell.json create mode 100644 res/data/shop_chr.json create mode 100644 res/data/shop_h.json create mode 100644 res/data/shop_pal.json create mode 100644 res/data/tmapn_canm.json create mode 100644 res/data/tmapn_celact.json rename res/{prebuilt => }/data/tmapn_celact.txt (100%) create mode 100644 res/data/tmapn_cell.json create mode 100644 res/data/tmapn_chr.json create mode 100644 res/data/tmapn_pal.json rename res/{prebuilt => }/data/tmapn_res_canm.txt (100%) rename res/{prebuilt => }/data/tmapn_res_cell.txt (100%) rename res/{prebuilt => }/data/tmapn_res_chr.txt (100%) rename res/{prebuilt => }/data/tmapn_res_pal.txt (100%) create mode 100644 res/data/uground_cell.json create mode 100644 res/data/uground_cellanm.json create mode 100644 res/data/uground_char.json create mode 100644 res/data/uground_char2.json create mode 100644 res/data/uground_clact.json create mode 100644 res/data/uground_pltt.json create mode 100644 res/data/uground_pltt2.json delete mode 100644 res/prebuilt/data/btower_canm.resdat delete mode 100644 res/prebuilt/data/btower_celact.cldat delete mode 100644 res/prebuilt/data/btower_cell.resdat delete mode 100644 res/prebuilt/data/btower_chr.resdat delete mode 100644 res/prebuilt/data/btower_pal.resdat delete mode 100644 res/prebuilt/data/plist_canm.resdat delete mode 100644 res/prebuilt/data/plist_cell.resdat delete mode 100644 res/prebuilt/data/plist_chr.resdat delete mode 100644 res/prebuilt/data/plist_h.cldat delete mode 100644 res/prebuilt/data/plist_pal.resdat delete mode 100644 res/prebuilt/data/porucase_canm.resdat delete mode 100644 res/prebuilt/data/porucase_celact.cldat delete mode 100644 res/prebuilt/data/porucase_cell.resdat delete mode 100644 res/prebuilt/data/porucase_chr.resdat delete mode 100644 res/prebuilt/data/porucase_pal.resdat delete mode 100644 res/prebuilt/data/pst_canm.resdat delete mode 100644 res/prebuilt/data/pst_cell.resdat delete mode 100644 res/prebuilt/data/pst_chr.resdat delete mode 100644 res/prebuilt/data/pst_h.cldat delete mode 100644 res/prebuilt/data/pst_pal.resdat delete mode 100644 res/prebuilt/data/shop_canm.resdat delete mode 100644 res/prebuilt/data/shop_cell.resdat delete mode 100644 res/prebuilt/data/shop_chr.resdat delete mode 100644 res/prebuilt/data/shop_h.cldat delete mode 100644 res/prebuilt/data/shop_pal.resdat delete mode 100644 res/prebuilt/data/tmapn_canm.resdat delete mode 100644 res/prebuilt/data/tmapn_celact.cldat delete mode 100644 res/prebuilt/data/tmapn_cell.resdat delete mode 100644 res/prebuilt/data/tmapn_chr.resdat delete mode 100644 res/prebuilt/data/tmapn_pal.resdat delete mode 100644 res/prebuilt/data/uground_cell.resdat delete mode 100644 res/prebuilt/data/uground_cellanm.resdat delete mode 100644 res/prebuilt/data/uground_char.resdat delete mode 100644 res/prebuilt/data/uground_char2.resdat delete mode 100644 res/prebuilt/data/uground_clact.cldat delete mode 100644 res/prebuilt/data/uground_pltt.resdat delete mode 100644 res/prebuilt/data/uground_pltt2.resdat create mode 100644 tools/scripts/make_cldat.py create mode 100644 tools/scripts/make_resdat.py diff --git a/include/sprite_resource.h b/include/sprite_resource.h index 72f38872a8..6dae88fac6 100644 --- a/include/sprite_resource.h +++ b/include/sprite_resource.h @@ -44,7 +44,7 @@ typedef struct SpriteResourceTableEntryNARC { BOOL compressed; int id; NNS_G2D_VRAM_TYPE vramType; - int paletteIndex; + int paletteCount; } SpriteResourceTableEntryNARC; typedef struct SpriteResourceTable { diff --git a/platinum.us/filesys.sha1 b/platinum.us/filesys.sha1 index 27012f1e59..cb400ac341 100644 --- a/platinum.us/filesys.sha1 +++ b/platinum.us/filesys.sha1 @@ -1,11 +1,11 @@ dd9f06b78e2a187fb62f2d3ad5d781a8a74d3d1b *res/prebuilt/data/UTF16.dat cea2ad20f4550dcf648aeb6f2bc118dcec7570d9 *res/prebuilt/data/arealight.narc a0c8ba8987d30f0c9930dfe109b7ee8c325582b9 *res/prebuilt/data/battle_win.NSCR -09f94a65e5581ef1cf30066be8786c185aa9b2b2 *res/prebuilt/data/btower_canm.resdat -89951491d6b76b65098917872397e0b11c7bb9de *res/prebuilt/data/btower_celact.cldat -56805c0b9108a7ff0efb6c96437188afde6e0345 *res/prebuilt/data/btower_cell.resdat -9cd64d47ca924bae65f78d438e0928f1fd430235 *res/prebuilt/data/btower_chr.resdat -85493120fb2fee27ed2d5bd56d697304a60baac0 *res/prebuilt/data/btower_pal.resdat +09f94a65e5581ef1cf30066be8786c185aa9b2b2 *res/data/btower_canm.resdat +89951491d6b76b65098917872397e0b11c7bb9de *res/data/btower_celact.cldat +56805c0b9108a7ff0efb6c96437188afde6e0345 *res/data/btower_cell.resdat +9cd64d47ca924bae65f78d438e0928f1fd430235 *res/data/btower_chr.resdat +85493120fb2fee27ed2d5bd56d697304a60baac0 *res/data/btower_pal.resdat 7666516466c447f3d4af62823d13ab4f33f44d6c *res/prebuilt/data/cell0.NCGR 62e12a4af9562e650b4191afaec32bfd6f34e3d8 *res/prebuilt/data/cell0.NCLR 41941e73a6729ccfb9e66a8b1f9b961a11c4654b *res/prebuilt/data/clact_default.NANR @@ -56,26 +56,26 @@ bbec5b2143b48f7439efa8eb285b69635f3720fa *res/prebuilt/data/pc.nsbca e8982c6379fcc2dbd01e2a3626fa1e11477c77c9 *res/prebuilt/data/pl_wm.ncgr 26ca766959599944cd52221ad42cc0a93d95ba2e *res/prebuilt/data/pl_wm.nclr 1914b6e76596ffa892508899cad35acedf7ae070 *res/prebuilt/data/plbr.dat -516b0800e4ebeca7982a487160ed6a04db95eb8b *res/prebuilt/data/plist_canm.resdat -c63feb68844c5a535611cd61945810977dc13989 *res/prebuilt/data/plist_cell.resdat -ea682a75054a3e229c3caa91bf7701d60fa05aa4 *res/prebuilt/data/plist_chr.resdat -d47a8e1fe411e19c194939abb643d2af1e1cf329 *res/prebuilt/data/plist_h.cldat -df06f0ebd532087ff88a709a86ec4c6f00b6d05a *res/prebuilt/data/plist_pal.resdat -1e111fc17f1496bab5b2f20455985a6139bd770d *res/prebuilt/data/porucase_canm.resdat -b844263884695da81d055287a8e5311cf80fc49e *res/prebuilt/data/porucase_celact.cldat -f8716c3d16aa2f8ccbb29c3e2ae55f2d872a689f *res/prebuilt/data/porucase_cell.resdat -f70867dd71f9809cfad32b8dad2adc1f7b9cd281 *res/prebuilt/data/porucase_chr.resdat -ecff5b0d3d4800d3843db63620537fa487ce8934 *res/prebuilt/data/porucase_pal.resdat -6d3ed9ed9df3f3b4285a4e767de4c8aea01ed950 *res/prebuilt/data/pst_canm.resdat -132a2e16407dc32b15bc22812234cc720b351126 *res/prebuilt/data/pst_cell.resdat -61aa12d59c1c79a7f2e7c0e1e2476d361c2876ee *res/prebuilt/data/pst_chr.resdat -51305113cfd7a2694d82b5ff6e56878b31e193e9 *res/prebuilt/data/pst_h.cldat -729603785c0d10750cef1f42d344616a37630415 *res/prebuilt/data/pst_pal.resdat -4b9fc365f7dbe2486e9f07b129422d131b3ded2d *res/prebuilt/data/shop_canm.resdat -ca25450477e4d283af4693f1d4664ed4ba279608 *res/prebuilt/data/shop_cell.resdat -4607568f0688fbabc865d01cfbb38d33c707044f *res/prebuilt/data/shop_chr.resdat -13b14a575d361fea840cf6a433bde418e992bc5d *res/prebuilt/data/shop_h.cldat -6ef9a9cb38575cb47bfa9f3070c068aeff2b7ab0 *res/prebuilt/data/shop_pal.resdat +516b0800e4ebeca7982a487160ed6a04db95eb8b *res/data/plist_canm.resdat +c63feb68844c5a535611cd61945810977dc13989 *res/data/plist_cell.resdat +ea682a75054a3e229c3caa91bf7701d60fa05aa4 *res/data/plist_chr.resdat +d47a8e1fe411e19c194939abb643d2af1e1cf329 *res/data/plist_h.cldat +df06f0ebd532087ff88a709a86ec4c6f00b6d05a *res/data/plist_pal.resdat +1e111fc17f1496bab5b2f20455985a6139bd770d *res/data/porucase_canm.resdat +b844263884695da81d055287a8e5311cf80fc49e *res/data/porucase_celact.cldat +f8716c3d16aa2f8ccbb29c3e2ae55f2d872a689f *res/data/porucase_cell.resdat +f70867dd71f9809cfad32b8dad2adc1f7b9cd281 *res/data/porucase_chr.resdat +ecff5b0d3d4800d3843db63620537fa487ce8934 *res/data/porucase_pal.resdat +6d3ed9ed9df3f3b4285a4e767de4c8aea01ed950 *res/data/pst_canm.resdat +132a2e16407dc32b15bc22812234cc720b351126 *res/data/pst_cell.resdat +61aa12d59c1c79a7f2e7c0e1e2476d361c2876ee *res/data/pst_chr.resdat +51305113cfd7a2694d82b5ff6e56878b31e193e9 *res/data/pst_h.cldat +729603785c0d10750cef1f42d344616a37630415 *res/data/pst_pal.resdat +4b9fc365f7dbe2486e9f07b129422d131b3ded2d *res/data/shop_canm.resdat +ca25450477e4d283af4693f1d4664ed4ba279608 *res/data/shop_cell.resdat +4607568f0688fbabc865d01cfbb38d33c707044f *res/data/shop_chr.resdat +13b14a575d361fea840cf6a433bde418e992bc5d *res/data/shop_h.cldat +6ef9a9cb38575cb47bfa9f3070c068aeff2b7ab0 *res/data/shop_pal.resdat 7d890728684f972892221535e43f2dd07a63ac5c *res/prebuilt/data/slot.narc 5bb388f5b16ef1eb8c8ea4c638eccf1244e7789c *res/prebuilt/data/smptm_koori.NANR 295d997311252e0c1cedaa36fc0083d024a140a2 *res/prebuilt/data/smptm_koori.NCER @@ -93,16 +93,16 @@ efcb17fc440548aefb1ec4b830955fa9e7954025 *res/prebuilt/data/t3_fl_y.nsbtx b5b6089df980ad54540fad84c76f76bcde0bb464 *res/prebuilt/data/test.atr 337f8bd7788eaea30946c8632bdbc9ef9b12b51f *res/prebuilt/data/tmap_block.dat 973dc6f187a2b7469c6a1a11d5c4c0c41b2f221c *res/prebuilt/data/tmap_flags.dat -aba8f43ada2b1919151c50366ec00df4f875350d *res/prebuilt/data/tmapn_canm.resdat -b350396f553cf8c70888aca59e327310812b1ee9 *res/prebuilt/data/tmapn_celact.cldat -b2d44b4083a618fa1da3e463e757b7af5e839bb3 *res/prebuilt/data/tmapn_celact.txt -066150350014d8db521c0905da4c2cf9b523229b *res/prebuilt/data/tmapn_cell.resdat -b976d3f03befcad1b4ed934c0f78a8a5d1d34aa8 *res/prebuilt/data/tmapn_chr.resdat -9ea7f860223c7895ca701901d7ab9453b5f4a72f *res/prebuilt/data/tmapn_pal.resdat -a1d847fd53a2b8f2a1fbee0afd6cab7985f0aab7 *res/prebuilt/data/tmapn_res_canm.txt -52930c878755a7bb702fbe24ebfc2908617605ae *res/prebuilt/data/tmapn_res_cell.txt -9750b822217dbcfa12f08d33f2597b3c7c4f52c4 *res/prebuilt/data/tmapn_res_chr.txt -71bb82389ed0c7632c847dfba9aa3840d6670d93 *res/prebuilt/data/tmapn_res_pal.txt +aba8f43ada2b1919151c50366ec00df4f875350d *res/data/tmapn_canm.resdat +b350396f553cf8c70888aca59e327310812b1ee9 *res/data/tmapn_celact.cldat +b2d44b4083a618fa1da3e463e757b7af5e839bb3 *res/data/tmapn_celact.txt +066150350014d8db521c0905da4c2cf9b523229b *res/data/tmapn_cell.resdat +b976d3f03befcad1b4ed934c0f78a8a5d1d34aa8 *res/data/tmapn_chr.resdat +9ea7f860223c7895ca701901d7ab9453b5f4a72f *res/data/tmapn_pal.resdat +a1d847fd53a2b8f2a1fbee0afd6cab7985f0aab7 *res/data/tmapn_res_canm.txt +52930c878755a7bb702fbe24ebfc2908617605ae *res/data/tmapn_res_cell.txt +9750b822217dbcfa12f08d33f2597b3c7c4f52c4 *res/data/tmapn_res_chr.txt +71bb82389ed0c7632c847dfba9aa3840d6670d93 *res/data/tmapn_res_pal.txt 8ac36eeaf690fd2686b8d3ec3a4952e3d5571280 *res/prebuilt/data/tradelist.narc 5d1052e8c22db3c69fc17455a63b4df9c876f2fb *res/prebuilt/data/trapmark.narc e4ea803a861a64f3307f1e85c131f03f368aaf44 *res/prebuilt/data/tw_arc_etc.naix @@ -121,13 +121,13 @@ baea1d536bbf3364fa00a9ee7586075d69ef94e1 *res/prebuilt/data/ug_parts.narc 8604aca94d462a013d3820c769e6eb45e38f30b9 *res/prebuilt/data/ug_radar.narc efcfa6c0c26afef1840af4fd062f6790f4fb1f14 *res/prebuilt/data/ug_trap.narc 973098a1a60f7923024562e2ac18334567edb574 *res/prebuilt/data/ugeffect_obj_graphic.narc -9aa715c371fa7ba5c6f2bc756974577229fd127f *res/prebuilt/data/uground_cell.resdat -b8e444f219193fab8db5901fc017cc7e25b91d30 *res/prebuilt/data/uground_cellanm.resdat -46ad24833d46809f113460f7515bad3095ec7b24 *res/prebuilt/data/uground_char.resdat -3a39e9918bd968965c4c27830e6a4445fbbfa6e8 *res/prebuilt/data/uground_char2.resdat -f70dd62e5908f8723fef69a48951a2a82adf01b3 *res/prebuilt/data/uground_clact.cldat -8a998f37b0e2e504c17e252cad745ea82abf7e04 *res/prebuilt/data/uground_pltt.resdat -bf16274373fa7a0a1db503ac7f82ef977c2d823a *res/prebuilt/data/uground_pltt2.resdat +9aa715c371fa7ba5c6f2bc756974577229fd127f *res/data/uground_cell.resdat +b8e444f219193fab8db5901fc017cc7e25b91d30 *res/data/uground_cellanm.resdat +46ad24833d46809f113460f7515bad3095ec7b24 *res/data/uground_char.resdat +3a39e9918bd968965c4c27830e6a4445fbbfa6e8 *res/data/uground_char2.resdat +f70dd62e5908f8723fef69a48951a2a82adf01b3 *res/data/uground_clact.cldat +8a998f37b0e2e504c17e252cad745ea82abf7e04 *res/data/uground_pltt.resdat +bf16274373fa7a0a1db503ac7f82ef977c2d823a *res/data/uground_pltt2.resdat fed2bdb82fffa0aa263e3d6df0f6287f742ac430 *res/prebuilt/data/ugroundeffect.naix 9a9c462760c8a718fbf8cd41d0bb87dfcfa50a41 *res/prebuilt/data/ugroundeffect.narc 010b6c08bc7da35acaaf093feac31518cd64027e *res/prebuilt/data/underg_radar.narc diff --git a/platinum.us/rom.rsf b/platinum.us/rom.rsf index bc0c934462..5da595c5f7 100644 --- a/platinum.us/rom.rsf +++ b/platinum.us/rom.rsf @@ -34,11 +34,19 @@ RomSpec File data/UTF16.dat File data/arealight.narc File data/battle_win.NSCR + + Root / # Directory in rom + HostRoot res # Directory in source + File data/btower_canm.resdat File data/btower_celact.cldat File data/btower_cell.resdat File data/btower_chr.resdat File data/btower_pal.resdat + + Root / # Directory in rom + HostRoot res/prebuilt # Directory in source + File data/cell0.NCGR File data/cell0.NCLR File data/clact_default.NANR @@ -89,6 +97,10 @@ RomSpec File data/pl_wm.ncgr File data/pl_wm.nclr File data/plbr.dat + + Root / # Directory in rom + HostRoot res # Directory in source + File data/plist_canm.resdat File data/plist_cell.resdat File data/plist_chr.resdat @@ -109,6 +121,10 @@ RomSpec File data/shop_chr.resdat File data/shop_h.cldat File data/shop_pal.resdat + + Root / # Directory in rom + HostRoot res/prebuilt # Directory in source + File data/slot.narc File data/smptm_koori.NANR File data/smptm_koori.NCER @@ -126,6 +142,10 @@ RomSpec File data/test.atr File data/tmap_block.dat File data/tmap_flags.dat + + Root / # Directory in rom + HostRoot res # Directory in source + File data/tmapn_canm.resdat File data/tmapn_celact.cldat File data/tmapn_celact.txt @@ -136,6 +156,10 @@ RomSpec File data/tmapn_res_cell.txt File data/tmapn_res_chr.txt File data/tmapn_res_pal.txt + + Root / # Directory in rom + HostRoot res/prebuilt # Directory in source + File data/tradelist.narc File data/trapmark.narc File data/tw_arc_etc.naix @@ -154,6 +178,10 @@ RomSpec File data/ug_radar.narc File data/ug_trap.narc File data/ugeffect_obj_graphic.narc + + Root / # Directory in rom + HostRoot res # Directory in source + File data/uground_cell.resdat File data/uground_cellanm.resdat File data/uground_char.resdat @@ -161,6 +189,10 @@ RomSpec File data/uground_clact.cldat File data/uground_pltt.resdat File data/uground_pltt2.resdat + + Root / # Directory in rom + HostRoot res/prebuilt # Directory in source + File data/ugroundeffect.naix File data/ugroundeffect.narc File data/underg_radar.narc diff --git a/res/data/btower_canm.json b/res/data/btower_canm.json new file mode 100644 index 0000000000..035bf840e0 --- /dev/null +++ b/res/data/btower_canm.json @@ -0,0 +1,11 @@ +{ + "type": "ANIM", + "contents": [ + { + "narc": 123, + "member": 3, + "compressed": false, + "id": 0 + } + ] +} \ No newline at end of file diff --git a/res/data/btower_celact.json b/res/data/btower_celact.json new file mode 100644 index 0000000000..8253db2530 --- /dev/null +++ b/res/data/btower_celact.json @@ -0,0 +1,12 @@ +[ + { + "tiles": 0, + "palette": 0, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + } +] \ No newline at end of file diff --git a/res/data/btower_cell.json b/res/data/btower_cell.json new file mode 100644 index 0000000000..3b472dbe06 --- /dev/null +++ b/res/data/btower_cell.json @@ -0,0 +1,11 @@ +{ + "type": "CELLS", + "contents": [ + { + "narc": 123, + "member": 2, + "compressed": false, + "id": 0 + } + ] +} \ No newline at end of file diff --git a/res/data/btower_chr.json b/res/data/btower_chr.json new file mode 100644 index 0000000000..ce30df5c38 --- /dev/null +++ b/res/data/btower_chr.json @@ -0,0 +1,12 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 123, + "member": 1, + "compressed": false, + "id": 0, + "vramType": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/btower_pal.json b/res/data/btower_pal.json new file mode 100644 index 0000000000..9a994526af --- /dev/null +++ b/res/data/btower_pal.json @@ -0,0 +1,13 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 123, + "member": 0, + "compressed": false, + "id": 0, + "vramType": 1, + "paletteCount": 2 + } + ] +} \ No newline at end of file diff --git a/res/data/meson.build b/res/data/meson.build new file mode 100644 index 0000000000..19df3ab859 --- /dev/null +++ b/res/data/meson.build @@ -0,0 +1,79 @@ +resdat_files = files( + 'btower_canm.json', + 'btower_cell.json', + 'btower_chr.json', + 'btower_pal.json', + 'plist_canm.json', + 'plist_cell.json', + 'plist_chr.json', + 'plist_pal.json', + 'porucase_canm.json', + 'porucase_cell.json', + 'porucase_chr.json', + 'porucase_pal.json', + 'pst_canm.json', + 'pst_cell.json', + 'pst_chr.json', + 'pst_pal.json', + 'shop_canm.json', + 'shop_cell.json', + 'shop_chr.json', + 'shop_pal.json', + 'tmapn_canm.json', + 'tmapn_cell.json', + 'tmapn_chr.json', + 'tmapn_pal.json', + 'uground_cell.json', + 'uground_cellanm.json', + 'uground_char.json', + 'uground_char2.json', + 'uground_pltt.json', + 'uground_pltt2.json' +) + +cldat_files = files( + 'btower_celact.json', + 'plist_h.json', + 'porucase_celact.json', + 'pst_h.json', + 'shop_h.json', + 'tmapn_celact.json', + 'uground_clact.json' +) + +# these were definitely left in by mistake! +txt_files = files( + 'tmapn_celact.txt', + 'tmapn_res_canm.txt', + 'tmapn_res_cell.txt', + 'tmapn_res_chr.txt', + 'tmapn_res_pal.txt' +) + +foreach f : resdat_files + nitrofs_files += custom_target( + input: f, + command: [ + make_resdat_py, + '--source-file', '@INPUT@', + '--output-file', '@OUTPUT@' + ], + output: '@BASENAME@.resdat' + ) +endforeach + +foreach f : cldat_files + nitrofs_files += custom_target( + input: f, + command: [ + make_cldat_py, + '--source-file', '@INPUT@', + '--output-file', '@OUTPUT@' + ], + output: '@BASENAME@.cldat' + ) +endforeach + +foreach f : txt_files + nitrofs_files += fs.copyfile(f) +endforeach \ No newline at end of file diff --git a/res/data/plist_canm.json b/res/data/plist_canm.json new file mode 100644 index 0000000000..cde9169d6b --- /dev/null +++ b/res/data/plist_canm.json @@ -0,0 +1,47 @@ +{ + "type": "ANIM", + "contents": [ + { + "narc": 20, + "member": 0, + "compressed": false, + "id": 0 + }, + { + "narc": 20, + "member": 5, + "compressed": false, + "id": 1 + }, + { + "narc": 20, + "member": 9, + "compressed": false, + "id": 2 + }, + { + "narc": 39, + "member": 62, + "compressed": false, + "id": 3 + }, + { + "narc": 19, + "member": 3, + "compressed": false, + "id": 4 + }, + { + "narc": 20, + "member": 18, + "compressed": false, + "id": 5 + }, + { + "narc": 13, + "member": 34, + "compressed": false, + "id": 6 + } + ] +} \ No newline at end of file diff --git a/res/data/plist_cell.json b/res/data/plist_cell.json new file mode 100644 index 0000000000..47e075bbd3 --- /dev/null +++ b/res/data/plist_cell.json @@ -0,0 +1,47 @@ +{ + "type": "CELLS", + "contents": [ + { + "narc": 20, + "member": 1, + "compressed": false, + "id": 0 + }, + { + "narc": 20, + "member": 6, + "compressed": false, + "id": 1 + }, + { + "narc": 20, + "member": 10, + "compressed": false, + "id": 2 + }, + { + "narc": 39, + "member": 63, + "compressed": false, + "id": 3 + }, + { + "narc": 19, + "member": 4, + "compressed": false, + "id": 4 + }, + { + "narc": 20, + "member": 19, + "compressed": false, + "id": 5 + }, + { + "narc": 13, + "member": 35, + "compressed": false, + "id": 6 + } + ] +} \ No newline at end of file diff --git a/res/data/plist_chr.json b/res/data/plist_chr.json new file mode 100644 index 0000000000..a3ab02d50c --- /dev/null +++ b/res/data/plist_chr.json @@ -0,0 +1,89 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 20, + "member": 2, + "compressed": false, + "id": 0, + "vramType": 1 + }, + { + "narc": 20, + "member": 7, + "compressed": false, + "id": 1, + "vramType": 1 + }, + { + "narc": 20, + "member": 11, + "compressed": false, + "id": 2, + "vramType": 1 + }, + { + "narc": 39, + "member": 64, + "compressed": false, + "id": 3, + "vramType": 1 + }, + { + "narc": 19, + "member": 7, + "compressed": false, + "id": 4, + "vramType": 1 + }, + { + "narc": 19, + "member": 7, + "compressed": false, + "id": 5, + "vramType": 1 + }, + { + "narc": 19, + "member": 7, + "compressed": false, + "id": 6, + "vramType": 1 + }, + { + "narc": 19, + "member": 7, + "compressed": false, + "id": 7, + "vramType": 1 + }, + { + "narc": 19, + "member": 7, + "compressed": false, + "id": 8, + "vramType": 1 + }, + { + "narc": 19, + "member": 7, + "compressed": false, + "id": 9, + "vramType": 1 + }, + { + "narc": 20, + "member": 20, + "compressed": false, + "id": 10, + "vramType": 1 + }, + { + "narc": 13, + "member": 36, + "compressed": false, + "id": 11, + "vramType": 2 + } + ] +} \ No newline at end of file diff --git a/res/data/plist_h.json b/res/data/plist_h.json new file mode 100644 index 0000000000..d182adea89 --- /dev/null +++ b/res/data/plist_h.json @@ -0,0 +1,122 @@ +[ + { + "tiles": 0, + "palette": 0, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 1, + "palette": 0, + "cells": 1, + "anim": 1, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 2, + "palette": 0, + "cells": 2, + "anim": 2, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 2 + }, + { + "tiles": 3, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 4, + "palette": 2, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 5, + "palette": 2, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 6, + "palette": 2, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 7, + "palette": 2, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 8, + "palette": 2, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 9, + "palette": 2, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 10, + "palette": 3, + "cells": 5, + "anim": 5, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 11, + "palette": 4, + "cells": 6, + "anim": 6, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + } +] \ No newline at end of file diff --git a/res/data/plist_pal.json b/res/data/plist_pal.json new file mode 100644 index 0000000000..d0a1ac479b --- /dev/null +++ b/res/data/plist_pal.json @@ -0,0 +1,45 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 20, + "member": 8, + "compressed": false, + "id": 0, + "vramType": 1, + "paletteCount": 2 + }, + { + "narc": 39, + "member": 65, + "compressed": false, + "id": 1, + "vramType": 1, + "paletteCount": 1 + }, + { + "narc": 19, + "member": 0, + "compressed": false, + "id": 2, + "vramType": 1, + "paletteCount": 3 + }, + { + "narc": 20, + "member": 21, + "compressed": false, + "id": 3, + "vramType": 1, + "paletteCount": 1 + }, + { + "narc": 20, + "member": 23, + "compressed": false, + "id": 4, + "vramType": 2, + "paletteCount": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/porucase_canm.json b/res/data/porucase_canm.json new file mode 100644 index 0000000000..c0a164b055 --- /dev/null +++ b/res/data/porucase_canm.json @@ -0,0 +1,17 @@ +{ + "type": "ANIM", + "contents": [ + { + "narc": 83, + "member": 7, + "compressed": false, + "id": 0 + }, + { + "narc": 83, + "member": 9, + "compressed": false, + "id": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/porucase_celact.json b/res/data/porucase_celact.json new file mode 100644 index 0000000000..ab05d6d352 --- /dev/null +++ b/res/data/porucase_celact.json @@ -0,0 +1,22 @@ +[ + { + "tiles": 0, + "palette": 0, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 1, + "palette": 0, + "cells": 1, + "anim": 1, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + } +] \ No newline at end of file diff --git a/res/data/porucase_cell.json b/res/data/porucase_cell.json new file mode 100644 index 0000000000..6d41fccb2c --- /dev/null +++ b/res/data/porucase_cell.json @@ -0,0 +1,17 @@ +{ + "type": "CELLS", + "contents": [ + { + "narc": 83, + "member": 6, + "compressed": false, + "id": 0 + }, + { + "narc": 83, + "member": 8, + "compressed": false, + "id": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/porucase_chr.json b/res/data/porucase_chr.json new file mode 100644 index 0000000000..3ba4ca375c --- /dev/null +++ b/res/data/porucase_chr.json @@ -0,0 +1,19 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 83, + "member": 4, + "compressed": false, + "id": 0, + "vramType": 1 + }, + { + "narc": 83, + "member": 5, + "compressed": false, + "id": 1, + "vramType": 2 + } + ] +} \ No newline at end of file diff --git a/res/data/porucase_pal.json b/res/data/porucase_pal.json new file mode 100644 index 0000000000..1e86ffe111 --- /dev/null +++ b/res/data/porucase_pal.json @@ -0,0 +1,13 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 83, + "member": 1, + "compressed": false, + "id": 0, + "vramType": 3, + "paletteCount": 10 + } + ] +} \ No newline at end of file diff --git a/res/data/pst_canm.json b/res/data/pst_canm.json new file mode 100644 index 0000000000..945d01bc91 --- /dev/null +++ b/res/data/pst_canm.json @@ -0,0 +1,107 @@ +{ + "type": "ANIM", + "contents": [ + { + "narc": 39, + "member": 47, + "compressed": false, + "id": 0 + }, + { + "narc": 39, + "member": 127, + "compressed": false, + "id": 1 + }, + { + "narc": 39, + "member": 130, + "compressed": false, + "id": 2 + }, + { + "narc": 27, + "member": 243, + "compressed": true, + "id": 3 + }, + { + "narc": 19, + "member": 1, + "compressed": false, + "id": 4 + }, + { + "narc": 39, + "member": 62, + "compressed": false, + "id": 5 + }, + { + "narc": 39, + "member": 66, + "compressed": false, + "id": 6 + }, + { + "narc": 39, + "member": 59, + "compressed": false, + "id": 7 + }, + { + "narc": 39, + "member": 50, + "compressed": false, + "id": 8 + }, + { + "narc": 13, + "member": 34, + "compressed": false, + "id": 9 + }, + { + "narc": 39, + "member": 17, + "compressed": false, + "id": 10 + }, + { + "narc": 39, + "member": 44, + "compressed": false, + "id": 11 + }, + { + "narc": 39, + "member": 70, + "compressed": false, + "id": 12 + }, + { + "narc": 39, + "member": 122, + "compressed": false, + "id": 13 + }, + { + "narc": 39, + "member": 41, + "compressed": false, + "id": 14 + }, + { + "narc": 39, + "member": 126, + "compressed": false, + "id": 15 + }, + { + "narc": 39, + "member": 133, + "compressed": false, + "id": 16 + } + ] +} \ No newline at end of file diff --git a/res/data/pst_cell.json b/res/data/pst_cell.json new file mode 100644 index 0000000000..44382c8ade --- /dev/null +++ b/res/data/pst_cell.json @@ -0,0 +1,107 @@ +{ + "type": "CELLS", + "contents": [ + { + "narc": 39, + "member": 48, + "compressed": false, + "id": 0 + }, + { + "narc": 39, + "member": 128, + "compressed": false, + "id": 1 + }, + { + "narc": 39, + "member": 131, + "compressed": false, + "id": 2 + }, + { + "narc": 27, + "member": 242, + "compressed": true, + "id": 3 + }, + { + "narc": 19, + "member": 2, + "compressed": false, + "id": 4 + }, + { + "narc": 39, + "member": 63, + "compressed": false, + "id": 5 + }, + { + "narc": 39, + "member": 67, + "compressed": false, + "id": 6 + }, + { + "narc": 39, + "member": 60, + "compressed": false, + "id": 7 + }, + { + "narc": 39, + "member": 51, + "compressed": false, + "id": 8 + }, + { + "narc": 13, + "member": 35, + "compressed": false, + "id": 9 + }, + { + "narc": 39, + "member": 18, + "compressed": false, + "id": 10 + }, + { + "narc": 39, + "member": 45, + "compressed": false, + "id": 11 + }, + { + "narc": 39, + "member": 71, + "compressed": false, + "id": 12 + }, + { + "narc": 39, + "member": 123, + "compressed": false, + "id": 13 + }, + { + "narc": 39, + "member": 42, + "compressed": false, + "id": 14 + }, + { + "narc": 39, + "member": 125, + "compressed": false, + "id": 15 + }, + { + "narc": 39, + "member": 134, + "compressed": false, + "id": 16 + } + ] +} \ No newline at end of file diff --git a/res/data/pst_chr.json b/res/data/pst_chr.json new file mode 100644 index 0000000000..94e9c11b44 --- /dev/null +++ b/res/data/pst_chr.json @@ -0,0 +1,306 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 39, + "member": 21, + "compressed": false, + "id": 0, + "vramType": 1 + }, + { + "narc": 39, + "member": 129, + "compressed": false, + "id": 1, + "vramType": 1 + }, + { + "narc": 39, + "member": 132, + "compressed": false, + "id": 2, + "vramType": 1 + }, + { + "narc": 27, + "member": 234, + "compressed": true, + "id": 3, + "vramType": 1 + }, + { + "narc": 27, + "member": 234, + "compressed": true, + "id": 4, + "vramType": 1 + }, + { + "narc": 27, + "member": 234, + "compressed": true, + "id": 5, + "vramType": 1 + }, + { + "narc": 27, + "member": 234, + "compressed": true, + "id": 6, + "vramType": 1 + }, + { + "narc": 27, + "member": 234, + "compressed": true, + "id": 7, + "vramType": 1 + }, + { + "narc": 27, + "member": 234, + "compressed": true, + "id": 8, + "vramType": 1 + }, + { + "narc": 27, + "member": 234, + "compressed": true, + "id": 9, + "vramType": 1 + }, + { + "narc": 27, + "member": 245, + "compressed": true, + "id": 10, + "vramType": 1 + }, + { + "narc": 19, + "member": 7, + "compressed": false, + "id": 11, + "vramType": 1 + }, + { + "narc": 39, + "member": 64, + "compressed": false, + "id": 12, + "vramType": 1 + }, + { + "narc": 39, + "member": 68, + "compressed": false, + "id": 13, + "vramType": 1 + }, + { + "narc": 39, + "member": 61, + "compressed": false, + "id": 14, + "vramType": 1 + }, + { + "narc": 39, + "member": 52, + "compressed": false, + "id": 15, + "vramType": 1 + }, + { + "narc": 13, + "member": 36, + "compressed": false, + "id": 16, + "vramType": 2 + }, + { + "narc": 39, + "member": 19, + "compressed": false, + "id": 17, + "vramType": 1 + }, + { + "narc": 39, + "member": 20, + "compressed": false, + "id": 18, + "vramType": 1 + }, + { + "narc": 39, + "member": 53, + "compressed": false, + "id": 19, + "vramType": 1 + }, + { + "narc": 39, + "member": 54, + "compressed": false, + "id": 20, + "vramType": 1 + }, + { + "narc": 39, + "member": 55, + "compressed": false, + "id": 21, + "vramType": 1 + }, + { + "narc": 39, + "member": 56, + "compressed": false, + "id": 22, + "vramType": 1 + }, + { + "narc": 39, + "member": 57, + "compressed": false, + "id": 23, + "vramType": 1 + }, + { + "narc": 39, + "member": 58, + "compressed": false, + "id": 24, + "vramType": 1 + }, + { + "narc": 39, + "member": 46, + "compressed": false, + "id": 25, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 26, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 27, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 28, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 29, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 30, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 31, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 32, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 33, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 34, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 35, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 36, + "vramType": 1 + }, + { + "narc": 39, + "member": 72, + "compressed": false, + "id": 37, + "vramType": 1 + }, + { + "narc": 39, + "member": 120, + "compressed": false, + "id": 38, + "vramType": 1 + }, + { + "narc": 39, + "member": 43, + "compressed": false, + "id": 39, + "vramType": 1 + }, + { + "narc": 39, + "member": 124, + "compressed": false, + "id": 40, + "vramType": 1 + }, + { + "narc": 39, + "member": 49, + "compressed": false, + "id": 41, + "vramType": 1 + }, + { + "narc": 39, + "member": 135, + "compressed": false, + "id": 42, + "vramType": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/pst_h.json b/res/data/pst_h.json new file mode 100644 index 0000000000..26e3029bbc --- /dev/null +++ b/res/data/pst_h.json @@ -0,0 +1,432 @@ +[ + { + "tiles": 0, + "palette": 6, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 1, + "palette": 0, + "cells": 1, + "anim": 1, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 2, + "palette": 0, + "cells": 2, + "anim": 2, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 3, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 4, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 5, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 6, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 7, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 8, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 9, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 10, + "palette": 1, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 11, + "palette": 5, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 12, + "palette": 3, + "cells": 5, + "anim": 5, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 13, + "palette": 0, + "cells": 6, + "anim": 6, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 14, + "palette": 0, + "cells": 7, + "anim": 7, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 16, + "palette": 4, + "cells": 9, + "anim": 9, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 17, + "palette": 0, + "cells": 10, + "anim": 10, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 18, + "palette": 0, + "cells": 10, + "anim": 10, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 15, + "palette": 0, + "cells": 8, + "anim": 8, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 22, + "palette": 0, + "cells": 8, + "anim": 8, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 21, + "palette": 0, + "cells": 8, + "anim": 8, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 23, + "palette": 0, + "cells": 8, + "anim": 8, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 19, + "palette": 0, + "cells": 8, + "anim": 8, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 20, + "palette": 0, + "cells": 8, + "anim": 8, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 24, + "palette": 0, + "cells": 8, + "anim": 8, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 25, + "palette": 0, + "cells": 11, + "anim": 11, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 26, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 27, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 28, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 29, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 30, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 31, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 32, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 33, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 34, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 35, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 36, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 37, + "palette": 5, + "cells": 12, + "anim": 12, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + }, + { + "tiles": 38, + "palette": 0, + "cells": 15, + "anim": 15, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 2 + }, + { + "tiles": 39, + "palette": 0, + "cells": 14, + "anim": 14, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 40, + "palette": 0, + "cells": 13, + "anim": 13, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 41, + "palette": 0, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 42, + "palette": 0, + "cells": 16, + "anim": 16, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 3 + } +] \ No newline at end of file diff --git a/res/data/pst_pal.json b/res/data/pst_pal.json new file mode 100644 index 0000000000..69a1fcdad7 --- /dev/null +++ b/res/data/pst_pal.json @@ -0,0 +1,54 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 39, + "member": 69, + "compressed": false, + "id": 0, + "vramType": 1, + "paletteCount": 3 + }, + { + "narc": 27, + "member": 74, + "compressed": false, + "id": 1, + "vramType": 1, + "paletteCount": 3, + "description": "BATTLE_ICON_PALETTE" + }, + { + "narc": 39, + "member": 65, + "compressed": false, + "id": 3, + "vramType": 1, + "paletteCount": 1 + }, + { + "narc": 20, + "member": 23, + "compressed": false, + "id": 4, + "vramType": 2, + "paletteCount": 1 + }, + { + "narc": 39, + "member": 136, + "compressed": false, + "id": 5, + "vramType": 1, + "paletteCount": 5 + }, + { + "narc": 39, + "member": 37, + "compressed": false, + "id": 6, + "vramType": 1, + "paletteCount": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/shop_canm.json b/res/data/shop_canm.json new file mode 100644 index 0000000000..9045d3702f --- /dev/null +++ b/res/data/shop_canm.json @@ -0,0 +1,23 @@ +{ + "type": "ANIM", + "contents": [ + { + "narc": 62, + "member": 6, + "compressed": false, + "id": 0 + }, + { + "narc": 62, + "member": 9, + "compressed": false, + "id": 1 + }, + { + "narc": 16, + "member": 0, + "compressed": false, + "id": 2 + } + ] +} \ No newline at end of file diff --git a/res/data/shop_cell.json b/res/data/shop_cell.json new file mode 100644 index 0000000000..69d3f739b3 --- /dev/null +++ b/res/data/shop_cell.json @@ -0,0 +1,23 @@ +{ + "type": "CELLS", + "contents": [ + { + "narc": 62, + "member": 5, + "compressed": false, + "id": 0 + }, + { + "narc": 62, + "member": 8, + "compressed": false, + "id": 1 + }, + { + "narc": 16, + "member": 1, + "compressed": false, + "id": 2 + } + ] +} \ No newline at end of file diff --git a/res/data/shop_chr.json b/res/data/shop_chr.json new file mode 100644 index 0000000000..03eba49c5c --- /dev/null +++ b/res/data/shop_chr.json @@ -0,0 +1,26 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 62, + "member": 4, + "compressed": false, + "id": 0, + "vramType": 1 + }, + { + "narc": 62, + "member": 7, + "compressed": false, + "id": 1, + "vramType": 1 + }, + { + "narc": 16, + "member": 2, + "compressed": false, + "id": 2, + "vramType": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/shop_h.json b/res/data/shop_h.json new file mode 100644 index 0000000000..9839e1f938 --- /dev/null +++ b/res/data/shop_h.json @@ -0,0 +1,32 @@ +[ + { + "tiles": 0, + "palette": 0, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 1, + "palette": 0, + "cells": 1, + "anim": 1, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + }, + { + "tiles": 2, + "palette": 1, + "cells": 2, + "anim": 2, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 1 + } +] \ No newline at end of file diff --git a/res/data/shop_pal.json b/res/data/shop_pal.json new file mode 100644 index 0000000000..00503bcdd3 --- /dev/null +++ b/res/data/shop_pal.json @@ -0,0 +1,21 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 62, + "member": 10, + "compressed": false, + "id": 0, + "vramType": 1, + "paletteCount": 2 + }, + { + "narc": 16, + "member": 3, + "compressed": false, + "id": 1, + "vramType": 1, + "paletteCount": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/tmapn_canm.json b/res/data/tmapn_canm.json new file mode 100644 index 0000000000..03965dfc22 --- /dev/null +++ b/res/data/tmapn_canm.json @@ -0,0 +1,35 @@ +{ + "type": "ANIM", + "contents": [ + { + "narc": 17, + "member": 6, + "compressed": false, + "id": 0 + }, + { + "narc": 17, + "member": 9, + "compressed": false, + "id": 1 + }, + { + "narc": 17, + "member": 12, + "compressed": false, + "id": 2 + }, + { + "narc": 17, + "member": 15, + "compressed": false, + "id": 3 + }, + { + "narc": 17, + "member": 18, + "compressed": false, + "id": 4 + } + ] +} \ No newline at end of file diff --git a/res/data/tmapn_celact.json b/res/data/tmapn_celact.json new file mode 100644 index 0000000000..02945c5daf --- /dev/null +++ b/res/data/tmapn_celact.json @@ -0,0 +1,52 @@ +[ + { + "tiles": 0, + "palette": 1, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 1, + "palette": 0, + "cells": 1, + "anim": 1, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 2 + }, + { + "tiles": 2, + "palette": 0, + "cells": 2, + "anim": 2, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 2 + }, + { + "tiles": 3, + "palette": 0, + "cells": 3, + "anim": 3, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 2 + }, + { + "tiles": 4, + "palette": 0, + "cells": 4, + "anim": 4, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 2 + } +] \ No newline at end of file diff --git a/res/prebuilt/data/tmapn_celact.txt b/res/data/tmapn_celact.txt similarity index 100% rename from res/prebuilt/data/tmapn_celact.txt rename to res/data/tmapn_celact.txt diff --git a/res/data/tmapn_cell.json b/res/data/tmapn_cell.json new file mode 100644 index 0000000000..be8c59dacc --- /dev/null +++ b/res/data/tmapn_cell.json @@ -0,0 +1,35 @@ +{ + "type": "CELLS", + "contents": [ + { + "narc": 17, + "member": 5, + "compressed": false, + "id": 0 + }, + { + "narc": 17, + "member": 8, + "compressed": false, + "id": 1 + }, + { + "narc": 17, + "member": 11, + "compressed": false, + "id": 2 + }, + { + "narc": 17, + "member": 14, + "compressed": false, + "id": 3 + }, + { + "narc": 17, + "member": 17, + "compressed": false, + "id": 4 + } + ] +} \ No newline at end of file diff --git a/res/data/tmapn_chr.json b/res/data/tmapn_chr.json new file mode 100644 index 0000000000..3b1eafc62d --- /dev/null +++ b/res/data/tmapn_chr.json @@ -0,0 +1,40 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 17, + "member": 4, + "compressed": false, + "id": 0, + "vramType": 2 + }, + { + "narc": 17, + "member": 7, + "compressed": false, + "id": 1, + "vramType": 1 + }, + { + "narc": 17, + "member": 10, + "compressed": false, + "id": 2, + "vramType": 1 + }, + { + "narc": 17, + "member": 13, + "compressed": false, + "id": 3, + "vramType": 1 + }, + { + "narc": 17, + "member": 16, + "compressed": false, + "id": 4, + "vramType": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/tmapn_pal.json b/res/data/tmapn_pal.json new file mode 100644 index 0000000000..55e7c9999c --- /dev/null +++ b/res/data/tmapn_pal.json @@ -0,0 +1,21 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 17, + "member": 2, + "compressed": false, + "id": 0, + "vramType": 1, + "paletteCount": 10 + }, + { + "narc": 17, + "member": 3, + "compressed": false, + "id": 1, + "vramType": 2, + "paletteCount": 1 + } + ] +} \ No newline at end of file diff --git a/res/prebuilt/data/tmapn_res_canm.txt b/res/data/tmapn_res_canm.txt similarity index 100% rename from res/prebuilt/data/tmapn_res_canm.txt rename to res/data/tmapn_res_canm.txt diff --git a/res/prebuilt/data/tmapn_res_cell.txt b/res/data/tmapn_res_cell.txt similarity index 100% rename from res/prebuilt/data/tmapn_res_cell.txt rename to res/data/tmapn_res_cell.txt diff --git a/res/prebuilt/data/tmapn_res_chr.txt b/res/data/tmapn_res_chr.txt similarity index 100% rename from res/prebuilt/data/tmapn_res_chr.txt rename to res/data/tmapn_res_chr.txt diff --git a/res/prebuilt/data/tmapn_res_pal.txt b/res/data/tmapn_res_pal.txt similarity index 100% rename from res/prebuilt/data/tmapn_res_pal.txt rename to res/data/tmapn_res_pal.txt diff --git a/res/data/uground_cell.json b/res/data/uground_cell.json new file mode 100644 index 0000000000..cb2750ded3 --- /dev/null +++ b/res/data/uground_cell.json @@ -0,0 +1,17 @@ +{ + "type": "CELLS", + "contents": [ + { + "narc": 47, + "member": 5, + "compressed": false, + "id": 0 + }, + { + "narc": 47, + "member": 7, + "compressed": false, + "id": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/uground_cellanm.json b/res/data/uground_cellanm.json new file mode 100644 index 0000000000..7bc232af36 --- /dev/null +++ b/res/data/uground_cellanm.json @@ -0,0 +1,17 @@ +{ + "type": "ANIM", + "contents": [ + { + "narc": 47, + "member": 4, + "compressed": false, + "id": 0 + }, + { + "narc": 47, + "member": 6, + "compressed": false, + "id": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/uground_char.json b/res/data/uground_char.json new file mode 100644 index 0000000000..12e045536e --- /dev/null +++ b/res/data/uground_char.json @@ -0,0 +1,19 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 47, + "member": 0, + "compressed": false, + "id": 0, + "vramType": 3 + }, + { + "narc": 47, + "member": 8, + "compressed": false, + "id": 1, + "vramType": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/uground_char2.json b/res/data/uground_char2.json new file mode 100644 index 0000000000..4b27ba02b8 --- /dev/null +++ b/res/data/uground_char2.json @@ -0,0 +1,19 @@ +{ + "type": "TILES", + "contents": [ + { + "narc": 47, + "member": 2, + "compressed": false, + "id": 0, + "vramType": 3 + }, + { + "narc": 47, + "member": 8, + "compressed": false, + "id": 1, + "vramType": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/uground_clact.json b/res/data/uground_clact.json new file mode 100644 index 0000000000..d636a3c5f0 --- /dev/null +++ b/res/data/uground_clact.json @@ -0,0 +1,22 @@ +[ + { + "tiles": 0, + "palette": 0, + "cells": 0, + "anim": 0, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + }, + { + "tiles": 1, + "palette": 0, + "cells": 1, + "anim": 1, + "multi_cells": -1, + "multi_anim": -1, + "vram_transfer": false, + "bg_priority": 0 + } +] \ No newline at end of file diff --git a/res/data/uground_pltt.json b/res/data/uground_pltt.json new file mode 100644 index 0000000000..1dd8436462 --- /dev/null +++ b/res/data/uground_pltt.json @@ -0,0 +1,13 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 47, + "member": 1, + "compressed": false, + "id": 0, + "vramType": 3, + "paletteCount": 1 + } + ] +} \ No newline at end of file diff --git a/res/data/uground_pltt2.json b/res/data/uground_pltt2.json new file mode 100644 index 0000000000..0b6bd62637 --- /dev/null +++ b/res/data/uground_pltt2.json @@ -0,0 +1,13 @@ +{ + "type": "PALETTE", + "contents": [ + { + "narc": 47, + "member": 3, + "compressed": false, + "id": 0, + "vramType": 3, + "paletteCount": 1 + } + ] +} \ No newline at end of file diff --git a/res/meson.build b/res/meson.build index 15948ab8ae..0c48e9accb 100644 --- a/res/meson.build +++ b/res/meson.build @@ -68,3 +68,4 @@ subdir('items') subdir('pokemon') subdir('sound') subdir('trainers') +subdir('data') diff --git a/res/prebuilt/data/btower_canm.resdat b/res/prebuilt/data/btower_canm.resdat deleted file mode 100644 index de23ecf4aaa98434f9d945118f35092c872ca7cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 bcmZQ(U|^^QVrC$Q0T3UA|NZ~}9~%Y$U&k3* diff --git a/res/prebuilt/data/btower_celact.cldat b/res/prebuilt/data/btower_celact.cldat deleted file mode 100644 index 305346c69cdb1ab967802fe1a67e12852cb9c52a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 64 TcmZQzKn4Gy04Dkm$j65PaA_ye diff --git a/res/prebuilt/data/btower_cell.resdat b/res/prebuilt/data/btower_cell.resdat deleted file mode 100644 index c5f621d64ffb0700b506aa8bbb823fb9e5e2f451..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 bcmZQ#U|^^QVkRJl0T3UA|NZ~}9~%Y$UuPLu diff --git a/res/prebuilt/data/btower_chr.resdat b/res/prebuilt/data/btower_chr.resdat deleted file mode 100644 index 28b2b8828afa40f11bf5823cb9724fc59a9cd706..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 bcmZQzU|^^QVn!f_0T3G`_V54y|JX19Pm>ti diff --git a/res/prebuilt/data/btower_pal.resdat b/res/prebuilt/data/btower_pal.resdat deleted file mode 100644 index 73591f905d644da2758fc5a20704869e418849c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 acmZQ%U|^^QVr0Mw`vC=np-i2S< tZ}-j}JCwN7yJMvf6(1|kJ^uaPnJc~&9^FK?x?{VN6o!6u!=9Y;UtS(z8q@#) diff --git a/res/prebuilt/data/plist_h.cldat b/res/prebuilt/data/plist_h.cldat deleted file mode 100644 index 42b38f0000c00a0e0565673d7b2b0dfd59e4972d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 416 zcmaiv%L;%n3?&6}Bje2cRf=Kufz diff --git a/res/prebuilt/data/porucase_canm.resdat b/res/prebuilt/data/porucase_canm.resdat deleted file mode 100644 index 74111cb38d624dc1233f3c26aa4b8ba2d9e4b79e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76 hcmZQ(U|g0T3UCIiZ4#NMir~|NoB-0|1Px8R-B3 diff --git a/res/prebuilt/data/porucase_celact.cldat b/res/prebuilt/data/porucase_celact.cldat deleted file mode 100644 index f11ac63d0b0e24395ce286b2d4c05c09b703fa44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 gcmZQzKn4Gy03^x`#EejB5Dmh}@*w^{pa4D$0Mp+u&;S4c diff --git a/res/prebuilt/data/porucase_cell.resdat b/res/prebuilt/data/porucase_cell.resdat deleted file mode 100644 index 4673d887aa40cc7edc76dab08f3da71828b9bffd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76 hcmZQ#U|ef;H%ep#qQ7+3Y@GaAeiHl=_nrI{ sCuhRG4Pa&<_8&WIHc$R8zexTe@4eo2kYA3p5JcNm*S{+o8X5?KAeagU1|CWTLGZvHz_DtnhNjtq$4tLzYAQ3^gA?#@ zc3zUb;Q02IuY%v={sr9a1I}avxW^0tXTqK&Co#<(QzSyT`LnnXeHkb^%dhg^g}{%h`D9qUb=P!v|dW4b@O zr>DCogb9X8bFCZ2Xr#QGSS`=vi@ViF-K8SZaO#=>A^g*HzL91`xdvoGB5`R7SKNUU^J`+9?J{CR~{+FF~B)&gr zVPV}^N8+9SmzE;`7rqj{7QPX_6}}U`7k&_a6n+wZHmCR<694@9Ke|{b_6hOM{FQ?h X`;0`tfv%$8v$4;Jch>)56GeFeb^U#6 diff --git a/res/prebuilt/data/pst_pal.resdat b/res/prebuilt/data/pst_pal.resdat deleted file mode 100644 index 7a43de5c0bcd4d162946547936516274a4943c10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 172 zcmZQ%U|>)OVpkxB0Y)H$8HlBU*b6EM5`&3@)H_1OLF!;~B0#n{RGbA!GePA*>N}v~ ZtWYr!4H8#{inBq*L1z8?|NlQW3;;4h8fyRm diff --git a/res/prebuilt/data/shop_canm.resdat b/res/prebuilt/data/shop_canm.resdat deleted file mode 100644 index b224e5a020ab05f4dcca024f116e71383df614e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 rcmZQ(U|_HVVm2U#0T3UCIiZ4#NMZsog+Q7Kh(UZ1{`dd?e{2{4ppO}x diff --git a/res/prebuilt/data/shop_cell.resdat b/res/prebuilt/data/shop_cell.resdat deleted file mode 100644 index 73f2e83a86538ccf106bb783c6464f816c590251..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 scmZQ#U|_HVVpbrA0T3UCIiP}!NMZs&Hi!=bOh63cgYduq|Nmpd0H3!Rng9R* diff --git a/res/prebuilt/data/shop_chr.resdat b/res/prebuilt/data/shop_chr.resdat deleted file mode 100644 index e37bd1928eefeade0e9a9afa37345874998a4ec7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 vcmZQzU|_HVViq8V0Y)GLBnHClP(hFwOk4oSW`c@?XplHa?BDDVv5`*D?|NsBTh5wOJ|Nq!90F|Q| AD*ylh diff --git a/res/prebuilt/data/tmapn_celact.cldat b/res/prebuilt/data/tmapn_celact.cldat deleted file mode 100644 index e0bc32d496a7a59313c6ec274ccdfe97b8abfe3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 192 zcmaKhTM7Um48!W<{zq09TtW6>A#`0NsRho?c-ztN`W_pI@9M|ZqM`bko`&jIJboMi C9Y@#z diff --git a/res/prebuilt/data/tmapn_cell.resdat b/res/prebuilt/data/tmapn_cell.resdat deleted file mode 100644 index 1031364239f8b9b933dfc2ec8f178fa09693c6f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmZQ#U|zyJULW5WQG CLm4Fi diff --git a/res/prebuilt/data/tmapn_chr.resdat b/res/prebuilt/data/tmapn_chr.resdat deleted file mode 100644 index 2949693e306af7afd2a216e9b8708738ad85bc7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmZQzU|{`dd?e{2{4HtQG~ diff --git a/res/prebuilt/data/uground_cell.resdat b/res/prebuilt/data/uground_cell.resdat deleted file mode 100644 index 4e12166a425bca3aa0f4fbd00a8f90de36183d26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76 hcmZQ#U|`S(VpbrA0T3UC*`b1rNMir~|NoB-0{~+G84Lgb diff --git a/res/prebuilt/data/uground_cellanm.resdat b/res/prebuilt/data/uground_cellanm.resdat deleted file mode 100644 index 022287ce18a3d17cbf1053959e9d80c59ff91b5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76 hcmZQ(U|`S(Viq8V0T3UC*`R`qNMir~|NoB-0{~*%84Caa diff --git a/res/prebuilt/data/uground_char.resdat b/res/prebuilt/data/uground_char.resdat deleted file mode 100644 index f6a37dd3b5f236e68dee648d946f4836e068e740..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76 kcmZQzU|`S(Vr0M!compressed, narcEntry->id, narcEntry->vramType, - narcEntry->paletteIndex, + narcEntry->paletteCount, table->type, heapID, FALSE); @@ -704,7 +704,7 @@ int SpriteResourceTable_GetPaletteIndex(const SpriteResourceTable *table, int in return fileEntries[index].paletteIndex; } else { SpriteResourceTableEntryNARC *narcEntries = table->entries; - return narcEntries[index].paletteIndex; + return narcEntries[index].paletteCount; } } diff --git a/tools/scripts/make_cldat.py b/tools/scripts/make_cldat.py new file mode 100644 index 0000000000..c2482711bb --- /dev/null +++ b/tools/scripts/make_cldat.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +import argparse +import json +import pathlib +import subprocess +import struct + +argparser = argparse.ArgumentParser( + prog='make_cldat.py', + description='Packs cldat binaries' +) +argparser.add_argument('-s', '--source-file', + required=True, + help='Path to the source file') +argparser.add_argument('-o', '--output-file', + required=True, + help='Path to the output file (where the cldat binary will be output)') +args = argparser.parse_args() + +source_file = pathlib.Path(args.source_file) +output_file = pathlib.Path(args.output_file) + +with open(source_file) as infile: + data = json.loads(infile.read()) + +## format of a standard cldat: +#### array of elements, each element is 32 bytes (8 ints): +#### 4 bytes for each: tile ID, palette ID, cell ID, anim ID, multi-cell ID, multi-anim ID, vram transfer flag, bg priority +#### terminated with 8 ints of -2 +with open(output_file, mode="wb") as f: + for element in data: + f.write(struct.pack(' Date: Tue, 22 Oct 2024 11:12:35 -0500 Subject: [PATCH 02/11] make use of resdat headers in a couple locations --- include/sprite_resource.h | 2 +- src/applications/pokemon_summary_screen/sprite.c | 9 +++++---- src/sprite_resource.c | 4 ++-- src/unk_02082C2C.c | 5 +++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/sprite_resource.h b/include/sprite_resource.h index 6dae88fac6..1866cf0d5a 100644 --- a/include/sprite_resource.h +++ b/include/sprite_resource.h @@ -35,7 +35,7 @@ typedef struct SpriteResourceTableEntryFile { int id; char filename[64]; NNS_G2D_VRAM_TYPE vramType; - int paletteIndex; + int paletteCount; } SpriteResourceTableEntryFile; typedef struct SpriteResourceTableEntryNARC { diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index 37c40ca95a..64b2d561a5 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -7,6 +7,7 @@ #include "applications/pokemon_summary_screen/main.h" #include "applications/pokemon_summary_screen/subscreen.h" +#include "data/pst_pal.h" #include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" @@ -430,7 +431,7 @@ void sub_0208F16C(PokemonSummaryScreen *param0) static void sub_0208F194(PokemonSummaryScreen *param0, u8 param1, u8 param2, u8 param3) { sub_0200D948(param0->renderer, param0->gfxHandler, sub_0207C944(), sub_0207C908(param3), 1, param2); - sub_0200D414(param0->unk_41C[param1], sub_0207C92C(param3) + 3); + sub_0200D414(param0->unk_41C[param1], sub_0207C92C(param3) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); } static void sub_0208F1E4(PokemonSummaryScreen *param0, u8 *param1, s16 *param2, s16 *param3) @@ -465,7 +466,7 @@ void PokemonSummaryScreen_UpdateMoveCategoryIcon(PokemonSummaryScreen *summarySc u32 category = MoveTable_LoadParam(move, MOVEATTRIBUTE_CLASS); sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, sub_0207CAC0(), sub_0207CA90(category), 1, 10); - sub_0200D414(summaryScreen->unk_41C[18], sub_0207CAA8(category) + 3); + sub_0200D414(summaryScreen->unk_41C[18], sub_0207CAA8(category) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); } void PokemonSummaryScreen_UpdateMoveSelectorPos(PokemonSummaryScreen *summaryScreen) @@ -669,7 +670,7 @@ void sub_0208F71C(PokemonSummaryScreen *param0) } sub_0200D948(param0->renderer, param0->gfxHandler, 19, v1, 0, 11); - sub_0200D414(param0->unk_41C[19], PokeIconPaletteIndex(param0->monData.species, param0->monData.form, param0->monData.isEgg) + 7); + sub_0200D414(param0->unk_41C[19], PokeIconPaletteIndex(param0->monData.species, param0->monData.form, param0->monData.isEgg) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); CellActor_SetFlipMode(param0->unk_41C[19], (PokemonPersonalData_GetFormValue(param0->monData.species, param0->monData.form, 28) ^ 1)); } @@ -732,7 +733,7 @@ void PokemonSummaryScreen_HideContestStatDots(PokemonSummaryScreen *summaryScree static void sub_0208F9B0(PokemonSummaryScreen *summaryScreen, u8 ribbonNum, u8 param2) { sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, 39, Ribbon_GetData(ribbonNum, RIBBON_DATA_SPRITE_ID), 0, 26 + param2); - sub_0200D414(summaryScreen->unk_41C[55 + param2], Ribbon_GetData(ribbonNum, RIBBON_DATA_PALETTE_NUM) + 7); + sub_0200D414(summaryScreen->unk_41C[55 + param2], Ribbon_GetData(ribbonNum, RIBBON_DATA_PALETTE_NUM) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); } void sub_0208FA04(PokemonSummaryScreen *summaryScreen) diff --git a/src/sprite_resource.c b/src/sprite_resource.c index 5b78ec9f72..15222e437e 100644 --- a/src/sprite_resource.c +++ b/src/sprite_resource.c @@ -118,7 +118,7 @@ SpriteResource *SpriteResourceCollection_AddFromTable(SpriteResourceCollection * fileEntry->filename, fileEntry->id, fileEntry->vramType, - fileEntry->paletteIndex, + fileEntry->paletteCount, table->type, heapID); } else { @@ -701,7 +701,7 @@ int SpriteResourceTable_GetPaletteIndex(const SpriteResourceTable *table, int in if (table->loadFromNARC == FALSE) { SpriteResourceTableEntryFile *fileEntries = table->entries; - return fileEntries[index].paletteIndex; + return fileEntries[index].paletteCount; } else { SpriteResourceTableEntryNARC *narcEntries = table->entries; return narcEntries[index].paletteCount; diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index fceb7bd1c3..b8b12b3cae 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -7,6 +7,7 @@ #include "struct_defs/struct_0207F248.h" #include "struct_defs/struct_020831B4.h" +#include "data/plist_pal.h" #include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" @@ -97,7 +98,7 @@ void sub_02082CEC(GameWindowLayout *param0, u8 param1, u16 param2, u16 param3, N v1.unk_08 = 0; v1.unk_0A = 0; v1.unk_0C = 0; - v1.unk_10 = PokeIconPaletteIndex(param0->unk_704[param1].unk_04, param0->unk_704[param1].unk_11, v2) + 3; + v1.unk_10 = PokeIconPaletteIndex(param0->unk_704[param1].unk_04, param0->unk_704[param1].unk_11, v2) + RESDAT_PLIST_PAL_NARC_19_MEMBER_0_2_OFFSET; v1.unk_14 = NNS_G2D_VRAM_TYPE_2DMAIN; v1.unk_18 = 0; v1.unk_1C = 0; @@ -131,7 +132,7 @@ void sub_02082DA8(GameWindowLayout *param0, u8 param1) } Heap_FreeToHeap(v5); - sub_0200D414(param0->unk_704[param1].unk_24, PokeIconPaletteIndex(v2, v3, 0) + 3); + sub_0200D414(param0->unk_704[param1].unk_24, PokeIconPaletteIndex(v2, v3, 0) + RESDAT_PLIST_PAL_NARC_19_MEMBER_0_2_OFFSET); NARC_dtor(v1); } From 5548ce18321475322cef7f9f28375e9dd2a47af7 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Fri, 25 Oct 2024 12:47:35 -0500 Subject: [PATCH 03/11] remove irrelevant description field --- res/data/pst_pal.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/res/data/pst_pal.json b/res/data/pst_pal.json index 69a1fcdad7..6b66aa6c08 100644 --- a/res/data/pst_pal.json +++ b/res/data/pst_pal.json @@ -15,8 +15,7 @@ "compressed": false, "id": 1, "vramType": 1, - "paletteCount": 3, - "description": "BATTLE_ICON_PALETTE" + "paletteCount": 3 }, { "narc": 39, From 92af8e542cd67f51e8140f3284522cacd7adf9ab Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Fri, 25 Oct 2024 14:00:15 -0500 Subject: [PATCH 04/11] start doing some cleanup/renaming related to cldat/resdat code --- include/overlay005/ov5_021D2F14.h | 4 +- include/overlay007/struct_ov7_0224F2EC.h | 17 ----- include/sprite_resource.h | 13 ++++ include/unk_0200C6E4.h | 4 +- .../pokemon_summary_screen/sprite.c | 7 ++- src/overlay005/ov5_021D2F14.c | 7 +-- src/overlay007/ov7_0224CD28.c | 3 +- src/overlay079/ov79_021D20F4.c | 6 +- src/overlay080/ov80_021D2A08.c | 6 +- src/overlay090/ov90_021D0D80.c | 6 +- src/unk_0200C6E4.c | 63 +++++++++---------- src/unk_02082C2C.c | 6 +- 12 files changed, 68 insertions(+), 74 deletions(-) delete mode 100644 include/overlay007/struct_ov7_0224F2EC.h diff --git a/include/overlay005/ov5_021D2F14.h b/include/overlay005/ov5_021D2F14.h index 4e49a3849a..0093f10ebc 100644 --- a/include/overlay005/ov5_021D2F14.h +++ b/include/overlay005/ov5_021D2F14.h @@ -5,14 +5,14 @@ #include "struct_defs/sprite_template.h" #include "overlay005/struct_ov5_021D30A8.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_02241308.h" #include "cell_actor.h" #include "narc.h" +#include "sprite_resource.h" -void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224F2EC *param1, u32 param2, u32 param3); +void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const SpriteResourceDataPath *param1, u32 param2, u32 param3); void ov5_021D30A8(UnkStruct_ov5_021D30A8 *param0); CellActor *ov5_021D3104(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224F358 *param1); void ov5_021D3190(UnkStruct_ov5_021D30A8 *param0, UnkStruct_ov104_02241308 *param1, u32 param2, u32 param3); diff --git a/include/overlay007/struct_ov7_0224F2EC.h b/include/overlay007/struct_ov7_0224F2EC.h deleted file mode 100644 index d41e3d45b9..0000000000 --- a/include/overlay007/struct_ov7_0224F2EC.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV7_0224F2EC_H -#define POKEPLATINUM_STRUCT_OV7_0224F2EC_H - -typedef union { - const char *val1[7]; - struct { - const char *unk_00; - const char *unk_04; - const char *unk_08; - const char *unk_0C; - const char *unk_10; - const char *unk_14; - const char *unk_18; - } val2; -} UnkStruct_ov7_0224F2EC; - -#endif // POKEPLATINUM_STRUCT_OV7_0224F2EC_H diff --git a/include/sprite_resource.h b/include/sprite_resource.h index 1866cf0d5a..2fc7d521df 100644 --- a/include/sprite_resource.h +++ b/include/sprite_resource.h @@ -61,6 +61,19 @@ typedef struct SpriteResourceList { int count; } SpriteResourceList; +typedef union { + const char *val1[7]; + struct { + const char *tilesDataPath; + const char *palettesDataPath; + const char *cellsDataPath; + const char *animsDataPath; + const char *multiCellsDataPath; + const char *multiAnimsDataPath; + const char *combinedResourceDataPath; + } paths; +} SpriteResourceDataPath; + SpriteResourceCollection *SpriteResourceCollection_New(int capacity, enum SpriteResourceType type, enum HeapId heapID); void SpriteResourceCollection_Delete(SpriteResourceCollection *spriteResources); SpriteResource *SpriteResourceCollection_AddFromTable(SpriteResourceCollection *spriteResources, const SpriteResourceTable *table, int index, enum HeapId heapID); diff --git a/include/unk_0200C6E4.h b/include/unk_0200C6E4.h index a5d973ca89..e0e39170b8 100644 --- a/include/unk_0200C6E4.h +++ b/include/unk_0200C6E4.h @@ -10,7 +10,6 @@ #include "struct_defs/sprite_template.h" #include "struct_defs/struct_0200C738.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" @@ -19,6 +18,7 @@ #include "cell_actor.h" #include "narc.h" #include "palette.h" +#include "sprite_resource.h" SpriteRenderer *sub_0200C6E4(int param0); SpriteGfxHandler *sub_0200C704(SpriteRenderer *param0); @@ -36,7 +36,7 @@ void sub_0200C880(SpriteRenderer *param0); void sub_0200C8A0(SpriteRenderer *param0, SpriteGfxHandler *param1); void sub_0200C8B0(SpriteRenderer *param0, SpriteGfxHandler *param1); void sub_0200C8D4(SpriteRenderer *param0); -BOOL sub_0200C8F0(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov7_0224F2EC *param2); +BOOL LoadSpriteResourceData(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteResourceDataPath *param2); CellActor *sub_0200CA08(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov7_0224F358 *param2); CellActor *sub_0200CA44(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13); BOOL sub_0200CB30(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov104_02241308 *param2); diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index 64b2d561a5..33322ff5ae 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -8,7 +8,6 @@ #include "applications/pokemon_summary_screen/main.h" #include "applications/pokemon_summary_screen/subscreen.h" #include "data/pst_pal.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" @@ -20,6 +19,8 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "ribbon.h" +#include "pokemon_summary_app.h" +#include "sprite_resource.h" #include "unk_0200C6E4.h" #include "unk_0201DBEC.h" #include "unk_0207C908.h" @@ -161,7 +162,7 @@ void sub_0208EA44(PokemonSummaryScreen *param0) } { - UnkStruct_ov7_0224F2EC v2 = { + SpriteResourceDataPath v2 = { "data/pst_chr.resdat", "data/pst_pal.resdat", "data/pst_cell.resdat", @@ -171,7 +172,7 @@ void sub_0208EA44(PokemonSummaryScreen *param0) "data/pst_h.cldat" }; - sub_0200C8F0(param0->renderer, param0->gfxHandler, &v2); + LoadSpriteResourceData(param0->renderer, param0->gfxHandler, &v2); } } diff --git a/src/overlay005/ov5_021D2F14.c b/src/overlay005/ov5_021D2F14.c index 2ec4432072..7cf7a6d83f 100644 --- a/src/overlay005/ov5_021D2F14.c +++ b/src/overlay005/ov5_021D2F14.c @@ -8,7 +8,6 @@ #include "struct_defs/struct_0200D0F4.h" #include "overlay005/struct_ov5_021D30A8.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_02241308.h" @@ -24,7 +23,7 @@ static BOOL ov5_021D3478(SpriteResourceList *param0, SpriteResource *param1); static void ov5_021D34AC(UnkStruct_ov5_021D30A8 *param0, int param1, int param2, int param3, int param4, int param5); static void ov5_021D3518(UnkStruct_ov5_021D30A8 *param0, NARC *param1, int param2, int param3, int param4, int param5); -void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224F2EC *param1, u32 param2, u32 param3) +void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const SpriteResourceDataPath *param1, u32 param2, u32 param3) { SpriteResourceTable *v0; SpriteResourceTable *v1; @@ -35,7 +34,7 @@ void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224F2EC * param0->unk_00 = sub_020095C4(param2, ¶m0->unk_04, param3); param0->unk_1C6 = param3; - if (param1->val2.unk_10 == NULL) { + if (param1->paths.multiCellsDataPath == NULL) { param0->unk_1C4 = 6 - 2; } else { param0->unk_1C4 = 6; @@ -73,7 +72,7 @@ void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224F2EC * sub_0200A41C(param0->unk_1AC[0]); sub_0200A684(param0->unk_1AC[1]); - v2 = ReadFileToHeap(param3, param1->val2.unk_18); + v2 = ReadFileToHeap(param3, param1->paths.combinedResourceDataPath); param0->unk_190 = sub_02009508(v2, param3, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); Heap_FreeToHeap(v2); diff --git a/src/overlay007/ov7_0224CD28.c b/src/overlay007/ov7_0224CD28.c index 8cba367376..02aad35f9d 100644 --- a/src/overlay007/ov7_0224CD28.c +++ b/src/overlay007/ov7_0224CD28.c @@ -9,7 +9,6 @@ #include "overlay005/fieldmap.h" #include "overlay005/ov5_021D2F14.h" #include "overlay007/struct_ov7_0224D008.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "bag.h" @@ -1438,7 +1437,7 @@ static void ov7_0224EA54(FieldSystem *fieldSystem, UnkStruct_ov7_0224D008 *param param1->unk_2A4 = FieldMessage_Print(¶m1->unk_08[1], param1->unk_298, param1->unk_278, 1); } -static const UnkStruct_ov7_0224F2EC Unk_ov7_0224F2EC = { +static const SpriteResourceDataPath Unk_ov7_0224F2EC = { "data/shop_chr.resdat", "data/shop_pal.resdat", "data/shop_cell.resdat", diff --git a/src/overlay079/ov79_021D20F4.c b/src/overlay079/ov79_021D20F4.c index 8fa54b03c8..c2c8142bb2 100644 --- a/src/overlay079/ov79_021D20F4.c +++ b/src/overlay079/ov79_021D20F4.c @@ -3,7 +3,6 @@ #include #include -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay079/struct_ov79_021D0E1C.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" @@ -11,6 +10,7 @@ #include "cell_actor.h" #include "communication_system.h" #include "gx_layers.h" +#include "sprite_resource.h" #include "unk_0200A784.h" #include "unk_0200C6E4.h" #include "unk_0201DBEC.h" @@ -55,7 +55,7 @@ void ov79_021D20F4(UnkStruct_ov79_021D0E1C *param0) } { - UnkStruct_ov7_0224F2EC v2 = { + SpriteResourceDataPath v2 = { "data/porucase_chr.resdat", "data/porucase_pal.resdat", "data/porucase_cell.resdat", @@ -65,7 +65,7 @@ void ov79_021D20F4(UnkStruct_ov79_021D0E1C *param0) "data/porucase_celact.cldat" }; - sub_0200C8F0(param0->unk_1B8, param0->unk_1BC, &v2); + LoadSpriteResourceData(param0->unk_1B8, param0->unk_1BC, &v2); } param0->unk_1F8 = sub_02098FFC(param0->unk_00, 1, 1, (NNS_G2D_VRAM_TYPE_2DMAIN), 0); diff --git a/src/overlay080/ov80_021D2A08.c b/src/overlay080/ov80_021D2A08.c index 1fe20896aa..1d3c7f239c 100644 --- a/src/overlay080/ov80_021D2A08.c +++ b/src/overlay080/ov80_021D2A08.c @@ -1,12 +1,12 @@ #include #include -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay080/struct_ov80_021D2A08.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" #include "gx_layers.h" +#include "sprite_resource.h" #include "unk_0200C6E4.h" #include "unk_0201DBEC.h" @@ -48,7 +48,7 @@ void ov80_021D2A08(UnkStruct_ov80_021D2A08 *param0) } { - UnkStruct_ov7_0224F2EC v2 = { + SpriteResourceDataPath v2 = { "data/tmapn_chr.resdat", "data/tmapn_pal.resdat", "data/tmapn_cell.resdat", @@ -58,7 +58,7 @@ void ov80_021D2A08(UnkStruct_ov80_021D2A08 *param0) "data/tmapn_celact.cldat" }; - sub_0200C8F0(param0->unk_D8, param0->unk_DC, &v2); + LoadSpriteResourceData(param0->unk_D8, param0->unk_DC, &v2); } } diff --git a/src/overlay090/ov90_021D0D80.c b/src/overlay090/ov90_021D0D80.c index 1449480df2..88408623ad 100644 --- a/src/overlay090/ov90_021D0D80.c +++ b/src/overlay090/ov90_021D0D80.c @@ -12,7 +12,6 @@ #include "struct_defs/struct_02049A68.h" #include "struct_defs/struct_02099F80.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay090/struct_ov90_021D0D80.h" #include "overlay090/struct_ov90_021D1750.h" @@ -31,6 +30,7 @@ #include "narc.h" #include "overlay_manager.h" #include "save_player.h" +#include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" #include "text.h" @@ -886,7 +886,7 @@ static void ov90_021D1ABC(UnkStruct_ov90_021D0ECC *param0) } { - UnkStruct_ov7_0224F2EC v2 = { + SpriteResourceDataPath v2 = { "data/btower_chr.resdat", "data/btower_pal.resdat", "data/btower_cell.resdat", @@ -896,7 +896,7 @@ static void ov90_021D1ABC(UnkStruct_ov90_021D0ECC *param0) "data/btower_celact.cldat" }; - sub_0200C8F0(param0->unk_29C, param0->unk_2A0, &v2); + LoadSpriteResourceData(param0->unk_29C, param0->unk_2A0, &v2); } GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); } diff --git a/src/unk_0200C6E4.c b/src/unk_0200C6E4.c index a74fd04d27..102b092a08 100644 --- a/src/unk_0200C6E4.c +++ b/src/unk_0200C6E4.c @@ -8,7 +8,6 @@ #include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay022/struct_ov22_022559F8.h" #include "overlay104/struct_ov104_022412F4.h" @@ -229,56 +228,56 @@ void sub_0200C8D4(SpriteRenderer *param0) Heap_FreeToHeap(param0); } -BOOL sub_0200C8F0(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov7_0224F2EC *param2) +BOOL LoadSpriteResourceData(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const SpriteResourceDataPath *resourcePaths) { - int v0; - int v1 = 6; - int v2; - SpriteResourceTable *v3; - void *v4; + int entryIndex; + int numEntries = 6; + int size; + SpriteResourceTable *resourceTable; + void *resourceEntryData; - if ((param0 == NULL) || (param1 == NULL)) { + if ((renderer == NULL) || (gfxHandler == NULL)) { return 0; } - if (param2->val2.unk_10 == NULL) { - v1 = 6 - 2; + if (resourcePaths->paths.multiCellsDataPath == NULL) { + numEntries = 6 - 2; } - param1->unk_54 = v1; - v2 = SpriteResourceTable_Size(); - param1->unk_08 = Heap_AllocFromHeap(param0->unk_00, v2 * v1); + gfxHandler->unk_54 = numEntries; + size = SpriteResourceTable_Size(); + gfxHandler->unk_08 = Heap_AllocFromHeap(renderer->unk_00, size * numEntries); - for (v0 = 0; v0 < v1; v0++) { - v3 = SpriteResourceTable_GetArrayElement(param1->unk_08, v0); - v4 = ReadFileToHeap(param0->unk_00, param2->val1[v0]); + for (entryIndex = 0; entryIndex < numEntries; entryIndex++) { + resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->unk_08, entryIndex); + resourceEntryData = ReadFileToHeap(renderer->unk_00, resourcePaths->val1[entryIndex]); - SpriteResourceTable_LoadFromBinary(v4, v3, param0->unk_00); - Heap_FreeToHeap(v4); + SpriteResourceTable_LoadFromBinary(resourceEntryData, resourceTable, renderer->unk_00); + Heap_FreeToHeap(resourceEntryData); } - for (v0 = 0; v0 < v1; v0++) { - v3 = SpriteResourceTable_GetArrayElement(param1->unk_08, v0); - v2 = SpriteResourceTable_GetCount(v3); + for (entryIndex = 0; entryIndex < numEntries; entryIndex++) { + resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->unk_08, entryIndex); + size = SpriteResourceTable_GetCount(resourceTable); - param1->unk_0C[v0] = SpriteResourceCollection_New(v2, v0, param0->unk_00); + gfxHandler->unk_0C[entryIndex] = SpriteResourceCollection_New(size, entryIndex, renderer->unk_00); } - for (v0 = 0; v0 < v1; v0++) { - v3 = SpriteResourceTable_GetArrayElement(param1->unk_08, v0); - v2 = SpriteResourceTable_GetCount(v3); + for (entryIndex = 0; entryIndex < numEntries; entryIndex++) { + resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->unk_08, entryIndex); + size = SpriteResourceTable_GetCount(resourceTable); - param1->unk_24[v0] = SpriteResourceList_New(v2, param0->unk_00); - param1->unk_3C[v0] = SpriteResourceCollection_Extend(param1->unk_0C[v0], v3, param1->unk_24[v0], param0->unk_00); + gfxHandler->unk_24[entryIndex] = SpriteResourceList_New(size, renderer->unk_00); + gfxHandler->unk_3C[entryIndex] = SpriteResourceCollection_Extend(gfxHandler->unk_0C[entryIndex], resourceTable, gfxHandler->unk_24[entryIndex], renderer->unk_00); } - sub_0200A368(param1->unk_24[0]); - sub_0200A60C(param1->unk_24[1]); + sub_0200A368(gfxHandler->unk_24[0]); + sub_0200A60C(gfxHandler->unk_24[1]); - v4 = ReadFileToHeap(param0->unk_00, param2->val2.unk_18); - param1->unk_04 = sub_02009508(v4, param0->unk_00, param1->unk_0C[0], param1->unk_0C[1], param1->unk_0C[2], param1->unk_0C[3], param1->unk_0C[4], param1->unk_0C[5]); + resourceEntryData = ReadFileToHeap(renderer->unk_00, resourcePaths->paths.combinedResourceDataPath); + gfxHandler->unk_04 = sub_02009508(resourceEntryData, renderer->unk_00, gfxHandler->unk_0C[0], gfxHandler->unk_0C[1], gfxHandler->unk_0C[2], gfxHandler->unk_0C[3], gfxHandler->unk_0C[4], gfxHandler->unk_0C[5]); - Heap_FreeToHeap(v4); + Heap_FreeToHeap(resourceEntryData); return 1; } diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index b8b12b3cae..589179580e 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -8,7 +8,6 @@ #include "struct_defs/struct_020831B4.h" #include "data/plist_pal.h" -#include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" @@ -22,6 +21,7 @@ #include "party.h" #include "pokemon.h" #include "pokemon_icon.h" +#include "sprite_resource.h" #include "unk_020093B4.h" #include "unk_0200C6E4.h" #include "unk_0201DBEC.h" @@ -63,7 +63,7 @@ void sub_02082C2C(GameWindowLayout *param0) } { - UnkStruct_ov7_0224F2EC v3 = { + SpriteResourceDataPath v3 = { "data/plist_chr.resdat", "data/plist_pal.resdat", "data/plist_cell.resdat", @@ -73,7 +73,7 @@ void sub_02082C2C(GameWindowLayout *param0) "data/plist_h.cldat" }; - sub_0200C8F0(param0->unk_5A8, param0->unk_5AC, &v3); + LoadSpriteResourceData(param0->unk_5A8, param0->unk_5AC, &v3); } } From b539da13dfd0c5c41c85e7ba73ade69d4a67bc78 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Sat, 2 Nov 2024 09:59:46 -0500 Subject: [PATCH 05/11] roughly align resdat JSON format with how pokeheartgold handles --- res/data/btower_canm.json | 6 +- res/data/btower_celact.json | 8 +- res/data/btower_cell.json | 6 +- res/data/btower_chr.json | 6 +- res/data/btower_pal.json | 6 +- res/data/plist_canm.json | 18 +- res/data/plist_cell.json | 18 +- res/data/plist_chr.json | 28 +- res/data/plist_h.json | 96 ++--- res/data/plist_pal.json | 14 +- res/data/porucase_canm.json | 8 +- res/data/porucase_celact.json | 16 +- res/data/porucase_cell.json | 8 +- res/data/porucase_chr.json | 8 +- res/data/porucase_pal.json | 6 +- res/data/pst_canm.json | 38 +- res/data/pst_cell.json | 38 +- res/data/pst_chr.json | 90 ++--- res/data/pst_h.json | 344 +++++++++--------- res/data/pst_pal.json | 16 +- res/data/shop_canm.json | 10 +- res/data/shop_cell.json | 10 +- res/data/shop_chr.json | 10 +- res/data/shop_h.json | 24 +- res/data/shop_pal.json | 8 +- res/data/tmapn_canm.json | 14 +- res/data/tmapn_celact.json | 40 +- res/data/tmapn_cell.json | 14 +- res/data/tmapn_chr.json | 14 +- res/data/tmapn_pal.json | 8 +- res/data/uground_cell.json | 8 +- res/data/uground_cellanm.json | 8 +- res/data/uground_char.json | 8 +- res/data/uground_char2.json | 8 +- res/data/uground_clact.json | 16 +- res/data/uground_pltt.json | 6 +- res/data/uground_pltt2.json | 6 +- .../pokemon_summary_screen/sprite.c | 2 +- src/unk_02082C2C.c | 2 +- tools/scripts/make_cldat.py | 8 +- tools/scripts/make_resdat.py | 26 +- 41 files changed, 514 insertions(+), 514 deletions(-) diff --git a/res/data/btower_canm.json b/res/data/btower_canm.json index 035bf840e0..7d2b042c7b 100644 --- a/res/data/btower_canm.json +++ b/res/data/btower_canm.json @@ -1,9 +1,9 @@ { - "type": "ANIM", - "contents": [ + "kind": "anim", + "graphics": [ { "narc": 123, - "member": 3, + "file": 3, "compressed": false, "id": 0 } diff --git a/res/data/btower_celact.json b/res/data/btower_celact.json index 8253db2530..311668d1d7 100644 --- a/res/data/btower_celact.json +++ b/res/data/btower_celact.json @@ -1,12 +1,12 @@ [ { - "tiles": 0, + "graphics": 0, "palette": 0, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 } ] \ No newline at end of file diff --git a/res/data/btower_cell.json b/res/data/btower_cell.json index 3b472dbe06..c7ec63b5ac 100644 --- a/res/data/btower_cell.json +++ b/res/data/btower_cell.json @@ -1,9 +1,9 @@ { - "type": "CELLS", - "contents": [ + "kind": "cell", + "graphics": [ { "narc": 123, - "member": 2, + "file": 2, "compressed": false, "id": 0 } diff --git a/res/data/btower_chr.json b/res/data/btower_chr.json index ce30df5c38..9e47f3969e 100644 --- a/res/data/btower_chr.json +++ b/res/data/btower_chr.json @@ -1,9 +1,9 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 123, - "member": 1, + "file": 1, "compressed": false, "id": 0, "vramType": 1 diff --git a/res/data/btower_pal.json b/res/data/btower_pal.json index 9a994526af..f7bcb3010d 100644 --- a/res/data/btower_pal.json +++ b/res/data/btower_pal.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 123, - "member": 0, + "file": 0, "compressed": false, "id": 0, "vramType": 1, diff --git a/res/data/plist_canm.json b/res/data/plist_canm.json index cde9169d6b..2a5ace996b 100644 --- a/res/data/plist_canm.json +++ b/res/data/plist_canm.json @@ -1,45 +1,45 @@ { - "type": "ANIM", - "contents": [ + "kind": "anim", + "graphics": [ { "narc": 20, - "member": 0, + "file": 0, "compressed": false, "id": 0 }, { "narc": 20, - "member": 5, + "file": 5, "compressed": false, "id": 1 }, { "narc": 20, - "member": 9, + "file": 9, "compressed": false, "id": 2 }, { "narc": 39, - "member": 62, + "file": 62, "compressed": false, "id": 3 }, { "narc": 19, - "member": 3, + "file": 3, "compressed": false, "id": 4 }, { "narc": 20, - "member": 18, + "file": 18, "compressed": false, "id": 5 }, { "narc": 13, - "member": 34, + "file": 34, "compressed": false, "id": 6 } diff --git a/res/data/plist_cell.json b/res/data/plist_cell.json index 47e075bbd3..d0909c0c2e 100644 --- a/res/data/plist_cell.json +++ b/res/data/plist_cell.json @@ -1,45 +1,45 @@ { - "type": "CELLS", - "contents": [ + "kind": "cell", + "graphics": [ { "narc": 20, - "member": 1, + "file": 1, "compressed": false, "id": 0 }, { "narc": 20, - "member": 6, + "file": 6, "compressed": false, "id": 1 }, { "narc": 20, - "member": 10, + "file": 10, "compressed": false, "id": 2 }, { "narc": 39, - "member": 63, + "file": 63, "compressed": false, "id": 3 }, { "narc": 19, - "member": 4, + "file": 4, "compressed": false, "id": 4 }, { "narc": 20, - "member": 19, + "file": 19, "compressed": false, "id": 5 }, { "narc": 13, - "member": 35, + "file": 35, "compressed": false, "id": 6 } diff --git a/res/data/plist_chr.json b/res/data/plist_chr.json index a3ab02d50c..c30f03d433 100644 --- a/res/data/plist_chr.json +++ b/res/data/plist_chr.json @@ -1,86 +1,86 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 20, - "member": 2, + "file": 2, "compressed": false, "id": 0, "vramType": 1 }, { "narc": 20, - "member": 7, + "file": 7, "compressed": false, "id": 1, "vramType": 1 }, { "narc": 20, - "member": 11, + "file": 11, "compressed": false, "id": 2, "vramType": 1 }, { "narc": 39, - "member": 64, + "file": 64, "compressed": false, "id": 3, "vramType": 1 }, { "narc": 19, - "member": 7, + "file": 7, "compressed": false, "id": 4, "vramType": 1 }, { "narc": 19, - "member": 7, + "file": 7, "compressed": false, "id": 5, "vramType": 1 }, { "narc": 19, - "member": 7, + "file": 7, "compressed": false, "id": 6, "vramType": 1 }, { "narc": 19, - "member": 7, + "file": 7, "compressed": false, "id": 7, "vramType": 1 }, { "narc": 19, - "member": 7, + "file": 7, "compressed": false, "id": 8, "vramType": 1 }, { "narc": 19, - "member": 7, + "file": 7, "compressed": false, "id": 9, "vramType": 1 }, { "narc": 20, - "member": 20, + "file": 20, "compressed": false, "id": 10, "vramType": 1 }, { "narc": 13, - "member": 36, + "file": 36, "compressed": false, "id": 11, "vramType": 2 diff --git a/res/data/plist_h.json b/res/data/plist_h.json index d182adea89..e438016ca5 100644 --- a/res/data/plist_h.json +++ b/res/data/plist_h.json @@ -1,122 +1,122 @@ [ { - "tiles": 0, + "graphics": 0, "palette": 0, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 1, + "graphics": 1, "palette": 0, - "cells": 1, + "cell": 1, "anim": 1, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 2, + "graphics": 2, "palette": 0, - "cells": 2, + "cell": 2, "anim": 2, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 2 + "transfer": false, + "priority": 2 }, { - "tiles": 3, + "graphics": 3, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 4, + "graphics": 4, "palette": 2, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 5, + "graphics": 5, "palette": 2, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 6, + "graphics": 6, "palette": 2, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 7, + "graphics": 7, "palette": 2, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 8, + "graphics": 8, "palette": 2, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 9, + "graphics": 9, "palette": 2, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 10, + "graphics": 10, "palette": 3, - "cells": 5, + "cell": 5, "anim": 5, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 11, + "graphics": 11, "palette": 4, - "cells": 6, + "cell": 6, "anim": 6, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 } ] \ No newline at end of file diff --git a/res/data/plist_pal.json b/res/data/plist_pal.json index d0a1ac479b..92617c0433 100644 --- a/res/data/plist_pal.json +++ b/res/data/plist_pal.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 20, - "member": 8, + "file": 8, "compressed": false, "id": 0, "vramType": 1, @@ -11,7 +11,7 @@ }, { "narc": 39, - "member": 65, + "file": 65, "compressed": false, "id": 1, "vramType": 1, @@ -19,7 +19,7 @@ }, { "narc": 19, - "member": 0, + "file": 0, "compressed": false, "id": 2, "vramType": 1, @@ -27,7 +27,7 @@ }, { "narc": 20, - "member": 21, + "file": 21, "compressed": false, "id": 3, "vramType": 1, @@ -35,7 +35,7 @@ }, { "narc": 20, - "member": 23, + "file": 23, "compressed": false, "id": 4, "vramType": 2, diff --git a/res/data/porucase_canm.json b/res/data/porucase_canm.json index c0a164b055..75df7cdf3d 100644 --- a/res/data/porucase_canm.json +++ b/res/data/porucase_canm.json @@ -1,15 +1,15 @@ { - "type": "ANIM", - "contents": [ + "kind": "anim", + "graphics": [ { "narc": 83, - "member": 7, + "file": 7, "compressed": false, "id": 0 }, { "narc": 83, - "member": 9, + "file": 9, "compressed": false, "id": 1 } diff --git a/res/data/porucase_celact.json b/res/data/porucase_celact.json index ab05d6d352..fcb92b9903 100644 --- a/res/data/porucase_celact.json +++ b/res/data/porucase_celact.json @@ -1,22 +1,22 @@ [ { - "tiles": 0, + "graphics": 0, "palette": 0, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 1, + "graphics": 1, "palette": 0, - "cells": 1, + "cell": 1, "anim": 1, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 } ] \ No newline at end of file diff --git a/res/data/porucase_cell.json b/res/data/porucase_cell.json index 6d41fccb2c..788f84fbb2 100644 --- a/res/data/porucase_cell.json +++ b/res/data/porucase_cell.json @@ -1,15 +1,15 @@ { - "type": "CELLS", - "contents": [ + "kind": "cell", + "graphics": [ { "narc": 83, - "member": 6, + "file": 6, "compressed": false, "id": 0 }, { "narc": 83, - "member": 8, + "file": 8, "compressed": false, "id": 1 } diff --git a/res/data/porucase_chr.json b/res/data/porucase_chr.json index 3ba4ca375c..aa26d18664 100644 --- a/res/data/porucase_chr.json +++ b/res/data/porucase_chr.json @@ -1,16 +1,16 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 83, - "member": 4, + "file": 4, "compressed": false, "id": 0, "vramType": 1 }, { "narc": 83, - "member": 5, + "file": 5, "compressed": false, "id": 1, "vramType": 2 diff --git a/res/data/porucase_pal.json b/res/data/porucase_pal.json index 1e86ffe111..fd978e6e83 100644 --- a/res/data/porucase_pal.json +++ b/res/data/porucase_pal.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 83, - "member": 1, + "file": 1, "compressed": false, "id": 0, "vramType": 3, diff --git a/res/data/pst_canm.json b/res/data/pst_canm.json index 945d01bc91..a8dfb0835b 100644 --- a/res/data/pst_canm.json +++ b/res/data/pst_canm.json @@ -1,105 +1,105 @@ { - "type": "ANIM", - "contents": [ + "kind": "anim", + "graphics": [ { "narc": 39, - "member": 47, + "file": 47, "compressed": false, "id": 0 }, { "narc": 39, - "member": 127, + "file": 127, "compressed": false, "id": 1 }, { "narc": 39, - "member": 130, + "file": 130, "compressed": false, "id": 2 }, { "narc": 27, - "member": 243, + "file": 243, "compressed": true, "id": 3 }, { "narc": 19, - "member": 1, + "file": 1, "compressed": false, "id": 4 }, { "narc": 39, - "member": 62, + "file": 62, "compressed": false, "id": 5 }, { "narc": 39, - "member": 66, + "file": 66, "compressed": false, "id": 6 }, { "narc": 39, - "member": 59, + "file": 59, "compressed": false, "id": 7 }, { "narc": 39, - "member": 50, + "file": 50, "compressed": false, "id": 8 }, { "narc": 13, - "member": 34, + "file": 34, "compressed": false, "id": 9 }, { "narc": 39, - "member": 17, + "file": 17, "compressed": false, "id": 10 }, { "narc": 39, - "member": 44, + "file": 44, "compressed": false, "id": 11 }, { "narc": 39, - "member": 70, + "file": 70, "compressed": false, "id": 12 }, { "narc": 39, - "member": 122, + "file": 122, "compressed": false, "id": 13 }, { "narc": 39, - "member": 41, + "file": 41, "compressed": false, "id": 14 }, { "narc": 39, - "member": 126, + "file": 126, "compressed": false, "id": 15 }, { "narc": 39, - "member": 133, + "file": 133, "compressed": false, "id": 16 } diff --git a/res/data/pst_cell.json b/res/data/pst_cell.json index 44382c8ade..a8d287096d 100644 --- a/res/data/pst_cell.json +++ b/res/data/pst_cell.json @@ -1,105 +1,105 @@ { - "type": "CELLS", - "contents": [ + "kind": "cell", + "graphics": [ { "narc": 39, - "member": 48, + "file": 48, "compressed": false, "id": 0 }, { "narc": 39, - "member": 128, + "file": 128, "compressed": false, "id": 1 }, { "narc": 39, - "member": 131, + "file": 131, "compressed": false, "id": 2 }, { "narc": 27, - "member": 242, + "file": 242, "compressed": true, "id": 3 }, { "narc": 19, - "member": 2, + "file": 2, "compressed": false, "id": 4 }, { "narc": 39, - "member": 63, + "file": 63, "compressed": false, "id": 5 }, { "narc": 39, - "member": 67, + "file": 67, "compressed": false, "id": 6 }, { "narc": 39, - "member": 60, + "file": 60, "compressed": false, "id": 7 }, { "narc": 39, - "member": 51, + "file": 51, "compressed": false, "id": 8 }, { "narc": 13, - "member": 35, + "file": 35, "compressed": false, "id": 9 }, { "narc": 39, - "member": 18, + "file": 18, "compressed": false, "id": 10 }, { "narc": 39, - "member": 45, + "file": 45, "compressed": false, "id": 11 }, { "narc": 39, - "member": 71, + "file": 71, "compressed": false, "id": 12 }, { "narc": 39, - "member": 123, + "file": 123, "compressed": false, "id": 13 }, { "narc": 39, - "member": 42, + "file": 42, "compressed": false, "id": 14 }, { "narc": 39, - "member": 125, + "file": 125, "compressed": false, "id": 15 }, { "narc": 39, - "member": 134, + "file": 134, "compressed": false, "id": 16 } diff --git a/res/data/pst_chr.json b/res/data/pst_chr.json index 94e9c11b44..d8727d75e7 100644 --- a/res/data/pst_chr.json +++ b/res/data/pst_chr.json @@ -1,303 +1,303 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 39, - "member": 21, + "file": 21, "compressed": false, "id": 0, "vramType": 1 }, { "narc": 39, - "member": 129, + "file": 129, "compressed": false, "id": 1, "vramType": 1 }, { "narc": 39, - "member": 132, + "file": 132, "compressed": false, "id": 2, "vramType": 1 }, { "narc": 27, - "member": 234, + "file": 234, "compressed": true, "id": 3, "vramType": 1 }, { "narc": 27, - "member": 234, + "file": 234, "compressed": true, "id": 4, "vramType": 1 }, { "narc": 27, - "member": 234, + "file": 234, "compressed": true, "id": 5, "vramType": 1 }, { "narc": 27, - "member": 234, + "file": 234, "compressed": true, "id": 6, "vramType": 1 }, { "narc": 27, - "member": 234, + "file": 234, "compressed": true, "id": 7, "vramType": 1 }, { "narc": 27, - "member": 234, + "file": 234, "compressed": true, "id": 8, "vramType": 1 }, { "narc": 27, - "member": 234, + "file": 234, "compressed": true, "id": 9, "vramType": 1 }, { "narc": 27, - "member": 245, + "file": 245, "compressed": true, "id": 10, "vramType": 1 }, { "narc": 19, - "member": 7, + "file": 7, "compressed": false, "id": 11, "vramType": 1 }, { "narc": 39, - "member": 64, + "file": 64, "compressed": false, "id": 12, "vramType": 1 }, { "narc": 39, - "member": 68, + "file": 68, "compressed": false, "id": 13, "vramType": 1 }, { "narc": 39, - "member": 61, + "file": 61, "compressed": false, "id": 14, "vramType": 1 }, { "narc": 39, - "member": 52, + "file": 52, "compressed": false, "id": 15, "vramType": 1 }, { "narc": 13, - "member": 36, + "file": 36, "compressed": false, "id": 16, "vramType": 2 }, { "narc": 39, - "member": 19, + "file": 19, "compressed": false, "id": 17, "vramType": 1 }, { "narc": 39, - "member": 20, + "file": 20, "compressed": false, "id": 18, "vramType": 1 }, { "narc": 39, - "member": 53, + "file": 53, "compressed": false, "id": 19, "vramType": 1 }, { "narc": 39, - "member": 54, + "file": 54, "compressed": false, "id": 20, "vramType": 1 }, { "narc": 39, - "member": 55, + "file": 55, "compressed": false, "id": 21, "vramType": 1 }, { "narc": 39, - "member": 56, + "file": 56, "compressed": false, "id": 22, "vramType": 1 }, { "narc": 39, - "member": 57, + "file": 57, "compressed": false, "id": 23, "vramType": 1 }, { "narc": 39, - "member": 58, + "file": 58, "compressed": false, "id": 24, "vramType": 1 }, { "narc": 39, - "member": 46, + "file": 46, "compressed": false, "id": 25, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 26, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 27, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 28, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 29, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 30, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 31, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 32, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 33, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 34, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 35, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 36, "vramType": 1 }, { "narc": 39, - "member": 72, + "file": 72, "compressed": false, "id": 37, "vramType": 1 }, { "narc": 39, - "member": 120, + "file": 120, "compressed": false, "id": 38, "vramType": 1 }, { "narc": 39, - "member": 43, + "file": 43, "compressed": false, "id": 39, "vramType": 1 }, { "narc": 39, - "member": 124, + "file": 124, "compressed": false, "id": 40, "vramType": 1 }, { "narc": 39, - "member": 49, + "file": 49, "compressed": false, "id": 41, "vramType": 1 }, { "narc": 39, - "member": 135, + "file": 135, "compressed": false, "id": 42, "vramType": 1 diff --git a/res/data/pst_h.json b/res/data/pst_h.json index 26e3029bbc..17b409c2d9 100644 --- a/res/data/pst_h.json +++ b/res/data/pst_h.json @@ -1,432 +1,432 @@ [ { - "tiles": 0, + "graphics": 0, "palette": 6, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 1, + "graphics": 1, "palette": 0, - "cells": 1, + "cell": 1, "anim": 1, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 2, + "graphics": 2, "palette": 0, - "cells": 2, + "cell": 2, "anim": 2, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 3, + "graphics": 3, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 4, + "graphics": 4, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 5, + "graphics": 5, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 6, + "graphics": 6, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 7, + "graphics": 7, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 8, + "graphics": 8, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 9, + "graphics": 9, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 10, + "graphics": 10, "palette": 1, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 11, + "graphics": 11, "palette": 5, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 12, + "graphics": 12, "palette": 3, - "cells": 5, + "cell": 5, "anim": 5, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 13, + "graphics": 13, "palette": 0, - "cells": 6, + "cell": 6, "anim": 6, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 14, + "graphics": 14, "palette": 0, - "cells": 7, + "cell": 7, "anim": 7, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 16, + "graphics": 16, "palette": 4, - "cells": 9, + "cell": 9, "anim": 9, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 17, + "graphics": 17, "palette": 0, - "cells": 10, + "cell": 10, "anim": 10, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 18, + "graphics": 18, "palette": 0, - "cells": 10, + "cell": 10, "anim": 10, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 15, + "graphics": 15, "palette": 0, - "cells": 8, + "cell": 8, "anim": 8, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 22, + "graphics": 22, "palette": 0, - "cells": 8, + "cell": 8, "anim": 8, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 21, + "graphics": 21, "palette": 0, - "cells": 8, + "cell": 8, "anim": 8, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 23, + "graphics": 23, "palette": 0, - "cells": 8, + "cell": 8, "anim": 8, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 19, + "graphics": 19, "palette": 0, - "cells": 8, + "cell": 8, "anim": 8, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 20, + "graphics": 20, "palette": 0, - "cells": 8, + "cell": 8, "anim": 8, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 24, + "graphics": 24, "palette": 0, - "cells": 8, + "cell": 8, "anim": 8, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 25, + "graphics": 25, "palette": 0, - "cells": 11, + "cell": 11, "anim": 11, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 26, + "graphics": 26, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 27, + "graphics": 27, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 28, + "graphics": 28, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 29, + "graphics": 29, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 30, + "graphics": 30, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 31, + "graphics": 31, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 32, + "graphics": 32, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 33, + "graphics": 33, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 34, + "graphics": 34, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 35, + "graphics": 35, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 36, + "graphics": 36, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 37, + "graphics": 37, "palette": 5, - "cells": 12, + "cell": 12, "anim": 12, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 }, { - "tiles": 38, + "graphics": 38, "palette": 0, - "cells": 15, + "cell": 15, "anim": 15, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 2 + "transfer": false, + "priority": 2 }, { - "tiles": 39, + "graphics": 39, "palette": 0, - "cells": 14, + "cell": 14, "anim": 14, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 40, + "graphics": 40, "palette": 0, - "cells": 13, + "cell": 13, "anim": 13, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 41, + "graphics": 41, "palette": 0, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 42, + "graphics": 42, "palette": 0, - "cells": 16, + "cell": 16, "anim": 16, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 3 + "transfer": false, + "priority": 3 } ] \ No newline at end of file diff --git a/res/data/pst_pal.json b/res/data/pst_pal.json index 6b66aa6c08..595c0a1355 100644 --- a/res/data/pst_pal.json +++ b/res/data/pst_pal.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 39, - "member": 69, + "file": 69, "compressed": false, "id": 0, "vramType": 1, @@ -11,7 +11,7 @@ }, { "narc": 27, - "member": 74, + "file": 74, "compressed": false, "id": 1, "vramType": 1, @@ -19,7 +19,7 @@ }, { "narc": 39, - "member": 65, + "file": 65, "compressed": false, "id": 3, "vramType": 1, @@ -27,7 +27,7 @@ }, { "narc": 20, - "member": 23, + "file": 23, "compressed": false, "id": 4, "vramType": 2, @@ -35,7 +35,7 @@ }, { "narc": 39, - "member": 136, + "file": 136, "compressed": false, "id": 5, "vramType": 1, @@ -43,7 +43,7 @@ }, { "narc": 39, - "member": 37, + "file": 37, "compressed": false, "id": 6, "vramType": 1, diff --git a/res/data/shop_canm.json b/res/data/shop_canm.json index 9045d3702f..8a080623f7 100644 --- a/res/data/shop_canm.json +++ b/res/data/shop_canm.json @@ -1,21 +1,21 @@ { - "type": "ANIM", - "contents": [ + "kind": "anim", + "graphics": [ { "narc": 62, - "member": 6, + "file": 6, "compressed": false, "id": 0 }, { "narc": 62, - "member": 9, + "file": 9, "compressed": false, "id": 1 }, { "narc": 16, - "member": 0, + "file": 0, "compressed": false, "id": 2 } diff --git a/res/data/shop_cell.json b/res/data/shop_cell.json index 69d3f739b3..4862f50701 100644 --- a/res/data/shop_cell.json +++ b/res/data/shop_cell.json @@ -1,21 +1,21 @@ { - "type": "CELLS", - "contents": [ + "kind": "cell", + "graphics": [ { "narc": 62, - "member": 5, + "file": 5, "compressed": false, "id": 0 }, { "narc": 62, - "member": 8, + "file": 8, "compressed": false, "id": 1 }, { "narc": 16, - "member": 1, + "file": 1, "compressed": false, "id": 2 } diff --git a/res/data/shop_chr.json b/res/data/shop_chr.json index 03eba49c5c..b7670a0edf 100644 --- a/res/data/shop_chr.json +++ b/res/data/shop_chr.json @@ -1,23 +1,23 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 62, - "member": 4, + "file": 4, "compressed": false, "id": 0, "vramType": 1 }, { "narc": 62, - "member": 7, + "file": 7, "compressed": false, "id": 1, "vramType": 1 }, { "narc": 16, - "member": 2, + "file": 2, "compressed": false, "id": 2, "vramType": 1 diff --git a/res/data/shop_h.json b/res/data/shop_h.json index 9839e1f938..ca2aff9b58 100644 --- a/res/data/shop_h.json +++ b/res/data/shop_h.json @@ -1,32 +1,32 @@ [ { - "tiles": 0, + "graphics": 0, "palette": 0, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 1, + "graphics": 1, "palette": 0, - "cells": 1, + "cell": 1, "anim": 1, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 }, { - "tiles": 2, + "graphics": 2, "palette": 1, - "cells": 2, + "cell": 2, "anim": 2, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 1 + "transfer": false, + "priority": 1 } ] \ No newline at end of file diff --git a/res/data/shop_pal.json b/res/data/shop_pal.json index 00503bcdd3..b472b78c3c 100644 --- a/res/data/shop_pal.json +++ b/res/data/shop_pal.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 62, - "member": 10, + "file": 10, "compressed": false, "id": 0, "vramType": 1, @@ -11,7 +11,7 @@ }, { "narc": 16, - "member": 3, + "file": 3, "compressed": false, "id": 1, "vramType": 1, diff --git a/res/data/tmapn_canm.json b/res/data/tmapn_canm.json index 03965dfc22..0f9d28f1da 100644 --- a/res/data/tmapn_canm.json +++ b/res/data/tmapn_canm.json @@ -1,33 +1,33 @@ { - "type": "ANIM", - "contents": [ + "kind": "anim", + "graphics": [ { "narc": 17, - "member": 6, + "file": 6, "compressed": false, "id": 0 }, { "narc": 17, - "member": 9, + "file": 9, "compressed": false, "id": 1 }, { "narc": 17, - "member": 12, + "file": 12, "compressed": false, "id": 2 }, { "narc": 17, - "member": 15, + "file": 15, "compressed": false, "id": 3 }, { "narc": 17, - "member": 18, + "file": 18, "compressed": false, "id": 4 } diff --git a/res/data/tmapn_celact.json b/res/data/tmapn_celact.json index 02945c5daf..0b4d40a30e 100644 --- a/res/data/tmapn_celact.json +++ b/res/data/tmapn_celact.json @@ -1,52 +1,52 @@ [ { - "tiles": 0, + "graphics": 0, "palette": 1, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 1, + "graphics": 1, "palette": 0, - "cells": 1, + "cell": 1, "anim": 1, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 2 + "transfer": false, + "priority": 2 }, { - "tiles": 2, + "graphics": 2, "palette": 0, - "cells": 2, + "cell": 2, "anim": 2, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 2 + "transfer": false, + "priority": 2 }, { - "tiles": 3, + "graphics": 3, "palette": 0, - "cells": 3, + "cell": 3, "anim": 3, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 2 + "transfer": false, + "priority": 2 }, { - "tiles": 4, + "graphics": 4, "palette": 0, - "cells": 4, + "cell": 4, "anim": 4, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 2 + "transfer": false, + "priority": 2 } ] \ No newline at end of file diff --git a/res/data/tmapn_cell.json b/res/data/tmapn_cell.json index be8c59dacc..b1b0fcb5b5 100644 --- a/res/data/tmapn_cell.json +++ b/res/data/tmapn_cell.json @@ -1,33 +1,33 @@ { - "type": "CELLS", - "contents": [ + "kind": "cell", + "graphics": [ { "narc": 17, - "member": 5, + "file": 5, "compressed": false, "id": 0 }, { "narc": 17, - "member": 8, + "file": 8, "compressed": false, "id": 1 }, { "narc": 17, - "member": 11, + "file": 11, "compressed": false, "id": 2 }, { "narc": 17, - "member": 14, + "file": 14, "compressed": false, "id": 3 }, { "narc": 17, - "member": 17, + "file": 17, "compressed": false, "id": 4 } diff --git a/res/data/tmapn_chr.json b/res/data/tmapn_chr.json index 3b1eafc62d..c3802a0256 100644 --- a/res/data/tmapn_chr.json +++ b/res/data/tmapn_chr.json @@ -1,37 +1,37 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 17, - "member": 4, + "file": 4, "compressed": false, "id": 0, "vramType": 2 }, { "narc": 17, - "member": 7, + "file": 7, "compressed": false, "id": 1, "vramType": 1 }, { "narc": 17, - "member": 10, + "file": 10, "compressed": false, "id": 2, "vramType": 1 }, { "narc": 17, - "member": 13, + "file": 13, "compressed": false, "id": 3, "vramType": 1 }, { "narc": 17, - "member": 16, + "file": 16, "compressed": false, "id": 4, "vramType": 1 diff --git a/res/data/tmapn_pal.json b/res/data/tmapn_pal.json index 55e7c9999c..d047bde080 100644 --- a/res/data/tmapn_pal.json +++ b/res/data/tmapn_pal.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 17, - "member": 2, + "file": 2, "compressed": false, "id": 0, "vramType": 1, @@ -11,7 +11,7 @@ }, { "narc": 17, - "member": 3, + "file": 3, "compressed": false, "id": 1, "vramType": 2, diff --git a/res/data/uground_cell.json b/res/data/uground_cell.json index cb2750ded3..58c39e2598 100644 --- a/res/data/uground_cell.json +++ b/res/data/uground_cell.json @@ -1,15 +1,15 @@ { - "type": "CELLS", - "contents": [ + "kind": "cell", + "graphics": [ { "narc": 47, - "member": 5, + "file": 5, "compressed": false, "id": 0 }, { "narc": 47, - "member": 7, + "file": 7, "compressed": false, "id": 1 } diff --git a/res/data/uground_cellanm.json b/res/data/uground_cellanm.json index 7bc232af36..2eef4afe0f 100644 --- a/res/data/uground_cellanm.json +++ b/res/data/uground_cellanm.json @@ -1,15 +1,15 @@ { - "type": "ANIM", - "contents": [ + "kind": "anim", + "graphics": [ { "narc": 47, - "member": 4, + "file": 4, "compressed": false, "id": 0 }, { "narc": 47, - "member": 6, + "file": 6, "compressed": false, "id": 1 } diff --git a/res/data/uground_char.json b/res/data/uground_char.json index 12e045536e..e59066cf72 100644 --- a/res/data/uground_char.json +++ b/res/data/uground_char.json @@ -1,16 +1,16 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 47, - "member": 0, + "file": 0, "compressed": false, "id": 0, "vramType": 3 }, { "narc": 47, - "member": 8, + "file": 8, "compressed": false, "id": 1, "vramType": 1 diff --git a/res/data/uground_char2.json b/res/data/uground_char2.json index 4b27ba02b8..5dc22df047 100644 --- a/res/data/uground_char2.json +++ b/res/data/uground_char2.json @@ -1,16 +1,16 @@ { - "type": "TILES", - "contents": [ + "kind": "char", + "graphics": [ { "narc": 47, - "member": 2, + "file": 2, "compressed": false, "id": 0, "vramType": 3 }, { "narc": 47, - "member": 8, + "file": 8, "compressed": false, "id": 1, "vramType": 1 diff --git a/res/data/uground_clact.json b/res/data/uground_clact.json index d636a3c5f0..41b7dbd2fe 100644 --- a/res/data/uground_clact.json +++ b/res/data/uground_clact.json @@ -1,22 +1,22 @@ [ { - "tiles": 0, + "graphics": 0, "palette": 0, - "cells": 0, + "cell": 0, "anim": 0, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 }, { - "tiles": 1, + "graphics": 1, "palette": 0, - "cells": 1, + "cell": 1, "anim": 1, "multi_cells": -1, "multi_anim": -1, - "vram_transfer": false, - "bg_priority": 0 + "transfer": false, + "priority": 0 } ] \ No newline at end of file diff --git a/res/data/uground_pltt.json b/res/data/uground_pltt.json index 1dd8436462..ba1094056f 100644 --- a/res/data/uground_pltt.json +++ b/res/data/uground_pltt.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 47, - "member": 1, + "file": 1, "compressed": false, "id": 0, "vramType": 3, diff --git a/res/data/uground_pltt2.json b/res/data/uground_pltt2.json index 0b6bd62637..8e2273d4d1 100644 --- a/res/data/uground_pltt2.json +++ b/res/data/uground_pltt2.json @@ -1,9 +1,9 @@ { - "type": "PALETTE", - "contents": [ + "kind": "pltt", + "graphics": [ { "narc": 47, - "member": 3, + "file": 3, "compressed": false, "id": 0, "vramType": 3, diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index 33322ff5ae..3d5fb614dd 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -7,7 +7,7 @@ #include "applications/pokemon_summary_screen/main.h" #include "applications/pokemon_summary_screen/subscreen.h" -#include "data/pst_pal.h" +#include "data/pst_pal.naix" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index 589179580e..92661f3303 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -7,7 +7,7 @@ #include "struct_defs/struct_0207F248.h" #include "struct_defs/struct_020831B4.h" -#include "data/plist_pal.h" +#include "data/plist_pal.naix" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" diff --git a/tools/scripts/make_cldat.py b/tools/scripts/make_cldat.py index c2482711bb..fb9de41be8 100644 --- a/tools/scripts/make_cldat.py +++ b/tools/scripts/make_cldat.py @@ -29,13 +29,13 @@ #### terminated with 8 ints of -2 with open(output_file, mode="wb") as f: for element in data: - f.write(struct.pack(' Date: Mon, 4 Nov 2024 16:22:04 -0600 Subject: [PATCH 06/11] halfway through sprite_renderer, continuing to document --- include/overlay005/struct_ov5_021D30A8.h | 8 +- include/overlay005/struct_ov5_021DE47C.h | 5 +- include/overlay021/struct_ov21_021D13FC.h | 4 +- include/overlay022/struct_ov22_0225A0E4.h | 4 +- include/overlay063/ov63_0222D1C0.h | 5 +- include/overlay065/struct_ov65_0222EBE0_t.h | 4 +- include/overlay065/struct_ov65_022358CC.h | 5 +- include/overlay071/struct_ov71_0223D238.h | 5 +- include/overlay072/struct_ov72_0223DB98_t.h | 4 +- include/overlay083/struct_ov83_0223D784.h | 5 +- include/overlay094/struct_ov94_0223FD4C.h | 5 +- include/overlay096/struct_ov96_0223BF40_t.h | 4 +- include/overlay097/struct_ov97_0222D04C.h | 5 +- include/overlay097/struct_ov97_02237AEC.h | 5 +- include/overlay105/struct_ov105_02245AAC.h | 5 +- include/overlay106/struct_ov106_02243310.h | 5 +- include/overlay107/struct_ov107_02249954.h | 5 +- include/overlay108/struct_ov108_02243030.h | 5 +- include/overlay109/struct_ov109_021D5140.h | 4 +- include/overlay111/struct_ov111_021D2F80.h | 5 +- include/sprite_renderer.h | 165 ++ include/sprite_resource.h | 1 + include/struct_defs/struct_02009508.h | 11 - include/struct_defs/struct_0200C738.h | 11 - include/struct_defs/struct_0200D0F4.h | 11 +- include/struct_defs/struct_02095E80_t.h | 5 +- include/struct_defs/struct_02095EAC_t.h | 4 +- include/struct_defs/struct_020961E8_t.h | 4 +- include/struct_defs/struct_0209903C.h | 7 +- include/unk_020093B4.h | 13 +- include/unk_0200C6E4.h | 138 -- platinum.us/main.lsf | 2 +- src/applications/options_menu.c | 2 +- .../pokemon_summary_screen/sprite.c | 114 +- src/battle/battle_display.c | 82 +- src/battle/battle_io_command.c | 4 +- src/battle/battle_script.c | 34 +- src/battle/healthbar.c | 72 +- src/battle/ov16_0223B140.c | 22 +- src/battle/ov16_0223DF00.c | 4 +- src/battle/ov16_02268520.c | 12 +- src/battle/ov16_0226871C.c | 66 +- src/battle/ov16_0226DB7C.c | 36 +- src/battle/ov16_0226DE44.c | 18 +- src/battle/party_gauge.c | 78 +- src/choose_starter/choose_starter_app.c | 4 +- src/field_menu.c | 20 +- src/meson.build | 2 +- src/overlay005/ov5_021D2F14.c | 24 +- src/overlay006/ov6_022426AC.c | 4 +- src/overlay006/ov6_02243258.c | 6 +- src/overlay007/ov7_0224BE9C.c | 4 +- src/overlay007/ov7_0224CD28.c | 14 +- src/overlay009/ov9_02249960.c | 4 +- src/overlay010/ov10_0221F800.c | 106 +- src/overlay012/ov12_0221FC20.c | 104 +- src/overlay012/ov12_02225864.c | 16 +- src/overlay012/ov12_022269C0.c | 20 +- src/overlay012/ov12_02226B84.c | 154 +- src/overlay012/ov12_0222AC70.c | 190 +-- src/overlay012/ov12_0222D6B0.c | 130 +- src/overlay012/ov12_0222E784.c | 34 +- src/overlay012/ov12_0222E91C.c | 70 +- src/overlay012/ov12_0222F700.c | 338 ++--- src/overlay012/ov12_022346A4.c | 84 +- src/overlay012/ov12_02234E44.c | 36 +- src/overlay012/ov12_02235254.c | 2 +- src/overlay012/ov12_02235E94.c | 90 +- src/overlay013/ov13_0221FC20.c | 8 +- src/overlay013/ov13_02224500.c | 57 +- src/overlay013/ov13_02225710.c | 2 +- src/overlay013/ov13_022264F4.c | 4 +- src/overlay013/ov13_02227BDC.c | 22 +- src/overlay013/ov13_02228128.c | 4 +- src/overlay017/ov17_0223B140.c | 28 +- src/overlay017/ov17_0223CB1C.c | 24 +- src/overlay017/ov17_0223DAD0.c | 26 +- src/overlay017/ov17_0223F118.c | 22 +- src/overlay017/ov17_0223F7E4.c | 16 +- src/overlay017/ov17_02241270.c | 16 +- src/overlay017/ov17_022413D8.c | 114 +- src/overlay017/ov17_022476F8.c | 10 +- src/overlay017/ov17_022492DC.c | 10 +- src/overlay017/ov17_0224A0FC.c | 80 +- src/overlay017/ov17_0224F080.c | 12 +- src/overlay017/ov17_0224F4D4.c | 18 +- src/overlay017/ov17_02250744.c | 66 +- src/overlay017/ov17_02252AB0.c | 36 +- src/overlay019/ov19_021D61B0.c | 4 +- src/overlay020/ov20_021D2098.c | 4 +- src/overlay021/ov21_021E8D48.c | 4 +- src/overlay023/ov23_0223E140.c | 4 +- src/overlay023/ov23_0224340C.c | 3 +- src/overlay023/ov23_02248F1C.c | 4 +- src/overlay023/ov23_0224F294.c | 20 +- src/overlay056/ov56_022561C0.c | 4 +- src/overlay062/ov62_0222F2C0.c | 18 +- src/overlay062/ov62_022300D8.c | 80 +- src/overlay062/ov62_02231690.c | 164 +- src/overlay062/ov62_02234A10.c | 2 +- src/overlay062/ov62_02235278.c | 14 +- src/overlay062/ov62_02235E64.c | 8 +- src/overlay062/ov62_02236CBC.c | 106 +- src/overlay062/ov62_02237D24.c | 22 +- src/overlay062/ov62_02239D60.c | 28 +- src/overlay062/ov62_0223CAEC.c | 18 +- src/overlay062/ov62_0223DFA8.c | 64 +- src/overlay062/ov62_02241204.c | 84 +- src/overlay062/ov62_02246B00.c | 94 +- src/overlay063/ov63_0222D1C0.c | 7 +- src/overlay064/ov64_0222DCE0.c | 6 +- src/overlay065/ov65_0223648C.c | 4 +- src/overlay068/ov68_0225C700.c | 4 +- src/overlay069/ov69_0225C700.c | 4 +- src/overlay070/ov70_0225D9A4.c | 4 +- src/overlay075/ov75_021D0D80.c | 34 +- src/overlay076/ov76_0223B140.c | 32 +- src/overlay076/ov76_0223B870.c | 124 +- src/overlay076/ov76_0223D338.c | 38 +- src/overlay077/ov77_021D54B0.c | 5 +- src/overlay077/ov77_021D6670.c | 5 +- src/overlay079/ov79_021D0D80.c | 20 +- src/overlay079/ov79_021D183C.c | 8 +- src/overlay079/ov79_021D20F4.c | 18 +- src/overlay079/ov79_021D2268.c | 12 +- src/overlay080/ov80_021D1458.c | 22 +- src/overlay080/ov80_021D2A08.c | 18 +- src/overlay080/ov80_021D2AF4.c | 6 +- src/overlay084/ov84_0223B5A0.c | 66 +- src/overlay084/ov84_022403F4.c | 114 +- src/overlay086/ov86_0223B140.c | 4 +- src/overlay087/ov87_021D106C.c | 4 +- src/overlay090/ov90_021D0D80.c | 24 +- src/overlay091/ov91_021D0D80.c | 70 +- src/overlay095/ov95_02246C20.c | 4 +- src/overlay097/ov97_02230410.c | 4 +- src/overlay097/ov97_02233B18.c | 4 +- src/overlay099/ov99_021D0D80.c | 20 +- src/overlay099/ov99_021D1A54.c | 76 +- src/overlay099/ov99_021D2C08.c | 2 +- src/overlay099/ov99_021D2E28.c | 2 +- src/overlay099/ov99_021D340C.c | 12 +- src/overlay099/ov99_021D4134.c | 10 +- src/overlay100/ov100_021D0D80.c | 18 +- src/overlay100/ov100_021D13E4.c | 26 +- src/overlay100/ov100_021D1C44.c | 14 +- src/overlay100/ov100_021D400C.c | 8 +- src/overlay101/ov101_021D7E48.c | 5 +- src/overlay104/ov104_0222FBE4.c | 18 +- src/overlay104/ov104_02231F74.c | 36 +- src/overlay104/ov104_02237378.c | 12 +- src/overlay104/ov104_02237DD8.c | 28 +- src/overlay104/ov104_0223C2D4.c | 44 +- src/overlay104/ov104_0223D768.c | 10 +- src/overlay104/ov104_0223DC7C.c | 34 +- src/overlay109/ov109_021D0D80.c | 30 +- src/overlay112/ov112_0225C700.c | 4 +- src/overlay113/ov113_0225C700.c | 90 +- src/overlay114/ov114_0225C700.c | 4 +- src/overlay115/ov115_02260CEC.c | 4 +- src/overlay116/ov116_022604C4.c | 30 +- src/overlay116/ov116_02261870.c | 116 +- src/overlay116/ov116_02262A8C.c | 14 +- src/overlay116/ov116_0226432C.c | 68 +- src/overlay117/ov117_02260668.c | 34 +- src/overlay117/ov117_022626B0.c | 16 +- src/overlay117/ov117_02263AF0.c | 224 +-- src/overlay119/ov119_021D0D80.c | 50 +- src/overlay119/ov119_021D191C.c | 42 +- src/pokemon.c | 14 +- src/render_window.c | 10 +- src/sprite_renderer.c | 1279 ++++++++++++++++ src/unk_020093B4.c | 41 +- src/unk_0200C6E4.c | 1337 ----------------- src/unk_0205CA94.c | 10 +- src/unk_0206A780.c | 12 +- src/unk_0206F314.c | 38 +- src/unk_0207C908.c | 20 +- src/unk_0207E0B8.c | 46 +- src/unk_02082C2C.c | 55 +- src/unk_02083370.c | 36 +- src/unk_0208694C.c | 4 +- src/unk_020890F4.c | 6 +- src/unk_02089604.c | 26 +- src/unk_0208A3F4.c | 118 +- src/unk_0208B284.c | 28 +- src/unk_02098FFC.c | 23 +- 187 files changed, 4294 insertions(+), 4368 deletions(-) create mode 100644 include/sprite_renderer.h delete mode 100644 include/struct_defs/struct_02009508.h delete mode 100644 include/struct_defs/struct_0200C738.h delete mode 100644 include/unk_0200C6E4.h create mode 100644 src/sprite_renderer.c delete mode 100644 src/unk_0200C6E4.c diff --git a/include/overlay005/struct_ov5_021D30A8.h b/include/overlay005/struct_ov5_021D30A8.h index dde23d23e5..e5aade1b94 100644 --- a/include/overlay005/struct_ov5_021D30A8.h +++ b/include/overlay005/struct_ov5_021D30A8.h @@ -1,16 +1,14 @@ #ifndef POKEPLATINUM_STRUCT_OV5_021D30A8_H #define POKEPLATINUM_STRUCT_OV5_021D30A8_H -#include "struct_defs/struct_02009508.h" -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; - UnkStruct_02009508 *unk_190; + GF_G2dRenderer unk_04; + CellActorResourceDataList *unk_190; SpriteResourceCollection *unk_194[6]; SpriteResourceList *unk_1AC[6]; u16 unk_1C4; diff --git a/include/overlay005/struct_ov5_021DE47C.h b/include/overlay005/struct_ov5_021DE47C.h index 0de51206e3..ac326fc47a 100644 --- a/include/overlay005/struct_ov5_021DE47C.h +++ b/include/overlay005/struct_ov5_021DE47C.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV5_021DE47C_H #define POKEPLATINUM_STRUCT_OV5_021DE47C_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; } UnkStruct_ov5_021DE47C; diff --git a/include/overlay021/struct_ov21_021D13FC.h b/include/overlay021/struct_ov21_021D13FC.h index 4d5d7e4624..7c5c97596b 100644 --- a/include/overlay021/struct_ov21_021D13FC.h +++ b/include/overlay021/struct_ov21_021D13FC.h @@ -4,7 +4,6 @@ #include "struct_decls/sprite_decl.h" #include "struct_decls/struct_02007768_decl.h" #include "struct_decls/struct_02015064_decl.h" -#include "struct_defs/struct_0200C738.h" #include "overlay021/struct_ov21_021D22F8.h" #include "overlay021/struct_ov21_021D23F8.h" @@ -15,13 +14,14 @@ #include "bg_window.h" #include "cell_actor.h" #include "narc.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "sys_task_manager.h" typedef struct { BgConfig *unk_00; Window unk_04; - UnkStruct_0200C738 unk_14; + GF_G2dRenderer unk_14; CellActorCollection *unk_138; SpriteResourceCollection *unk_13C[4]; UnkStruct_ov21_021D4C0C *unk_14C; diff --git a/include/overlay022/struct_ov22_0225A0E4.h b/include/overlay022/struct_ov22_0225A0E4.h index 11be52c474..5766dbc63f 100644 --- a/include/overlay022/struct_ov22_0225A0E4.h +++ b/include/overlay022/struct_ov22_0225A0E4.h @@ -7,12 +7,12 @@ #include "struct_decls/struct_02015064_decl.h" #include "struct_decls/struct_02015128_decl.h" #include "struct_decls/struct_020151A4_decl.h" -#include "struct_defs/struct_0200C738.h" #include "bg_window.h" #include "cell_actor.h" #include "narc.h" #include "resource_collection.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { @@ -35,7 +35,7 @@ typedef struct { BgConfig *unk_40; CellActorCollection *unk_44; SpriteResourceCollection *unk_48[4]; - UnkStruct_0200C738 unk_58; + GF_G2dRenderer unk_58; NARC *unk_5C; } UnkStruct_ov22_0225A0E4; diff --git a/include/overlay063/ov63_0222D1C0.h b/include/overlay063/ov63_0222D1C0.h index 1888416170..dc2dbda273 100644 --- a/include/overlay063/ov63_0222D1C0.h +++ b/include/overlay063/ov63_0222D1C0.h @@ -1,15 +1,14 @@ #ifndef POKEPLATINUM_OV63_0222D1C0_H #define POKEPLATINUM_OV63_0222D1C0_H -#include "struct_defs/struct_0200C738.h" - #include "overlay063/struct_ov63_0222D160.h" #include "overlay063/struct_ov63_0222D1C0_decl.h" #include "overlay065/struct_ov65_0223582C.h" #include "bg_window.h" +#include "sprite_renderer.h" -UnkStruct_ov63_0222D1C0 *ov63_0222D1C0(UnkStruct_0200C738 *param0, BgConfig *param1, const UnkStruct_ov65_0223582C *param2, u32 param3); +UnkStruct_ov63_0222D1C0 *ov63_0222D1C0(GF_G2dRenderer *param0, BgConfig *param1, const UnkStruct_ov65_0223582C *param2, u32 param3); void ov63_0222D214(UnkStruct_ov63_0222D1C0 *param0); void ov63_0222D228(UnkStruct_ov63_0222D1C0 *param0, const UnkStruct_ov63_0222D160 *param1); diff --git a/include/overlay065/struct_ov65_0222EBE0_t.h b/include/overlay065/struct_ov65_0222EBE0_t.h index 053985bb13..1343e410ee 100644 --- a/include/overlay065/struct_ov65_0222EBE0_t.h +++ b/include/overlay065/struct_ov65_0222EBE0_t.h @@ -3,7 +3,6 @@ #include "struct_decls/struct_02012744_decl.h" #include "struct_decls/struct_0202B370_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0207DFAC.h" #include "overlay061/struct_ov61_0222C3B0.h" @@ -19,6 +18,7 @@ #include "message.h" #include "overlay_manager.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -49,7 +49,7 @@ struct UnkStruct_ov65_0222EBE0_t { Menu *unk_184; void *unk_188; CellActorCollection *unk_18C; - UnkStruct_0200C738 unk_190; + GF_G2dRenderer unk_190; SpriteResourceCollection *unk_31C[4]; UnkStruct_02012744 *unk_32C; Window unk_330; diff --git a/include/overlay065/struct_ov65_022358CC.h b/include/overlay065/struct_ov65_022358CC.h index 86fda3ed3c..dd4d407dc4 100644 --- a/include/overlay065/struct_ov65_022358CC.h +++ b/include/overlay065/struct_ov65_022358CC.h @@ -1,16 +1,15 @@ #ifndef POKEPLATINUM_STRUCT_OV65_022358CC_H #define POKEPLATINUM_STRUCT_OV65_022358CC_H -#include "struct_defs/struct_0200C738.h" - #include "overlay065/struct_ov65_022358CC_sub1.h" #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; UnkStruct_ov65_022358CC_sub1 unk_1A0; } UnkStruct_ov65_022358CC; diff --git a/include/overlay071/struct_ov71_0223D238.h b/include/overlay071/struct_ov71_0223D238.h index dedeb16a0a..97feaf9429 100644 --- a/include/overlay071/struct_ov71_0223D238.h +++ b/include/overlay071/struct_ov71_0223D238.h @@ -3,14 +3,13 @@ #include -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[2][4]; CellActor *unk_1C0[25]; diff --git a/include/overlay072/struct_ov72_0223DB98_t.h b/include/overlay072/struct_ov72_0223DB98_t.h index 40ea21fad4..69ebaff00a 100644 --- a/include/overlay072/struct_ov72_0223DB98_t.h +++ b/include/overlay072/struct_ov72_0223DB98_t.h @@ -2,7 +2,6 @@ #define POKEPLATINUM_STRUCT_OV72_0223DB98_T_H #include "struct_decls/struct_02015920_decl.h" -#include "struct_defs/struct_0200C738.h" #include "overlay072/struct_ov72_0223E7D8.h" #include "overlay072/struct_ov72_0223E80C.h" @@ -13,6 +12,7 @@ #include "game_options.h" #include "game_records.h" #include "message.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -30,7 +30,7 @@ struct UnkStruct_ov72_0223DB98_t { Strbuf *unk_34; int unk_38; CellActorCollection *unk_3C; - UnkStruct_0200C738 unk_40; + GF_G2dRenderer unk_40; SpriteResourceCollection *unk_1CC[4]; SpriteResource *unk_1DC[2][4]; CellActorResourceData unk_1FC; diff --git a/include/overlay083/struct_ov83_0223D784.h b/include/overlay083/struct_ov83_0223D784.h index 369c90d24b..0ea2f41f8c 100644 --- a/include/overlay083/struct_ov83_0223D784.h +++ b/include/overlay083/struct_ov83_0223D784.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV83_0223D784_H #define POKEPLATINUM_STRUCT_OV83_0223D784_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; } UnkStruct_ov83_0223D784; diff --git a/include/overlay094/struct_ov94_0223FD4C.h b/include/overlay094/struct_ov94_0223FD4C.h index 3bbea598cd..07ba727735 100644 --- a/include/overlay094/struct_ov94_0223FD4C.h +++ b/include/overlay094/struct_ov94_0223FD4C.h @@ -6,7 +6,7 @@ #include "struct_decls/struct_0202B370_decl.h" #include "struct_decls/struct_0207AE68_decl.h" -#include "struct_defs/struct_0200C738.h" +#include "struct_defs/pokemon_summary.h" #include "struct_defs/struct_0203E0FC.h" #include "applications/pokemon_summary_screen/main.h" @@ -29,6 +29,7 @@ #include "message.h" #include "overlay_manager.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -99,7 +100,7 @@ typedef struct UnkStruct_ov94_0223FD4C_t { Strbuf *unk_BDC; int unk_BE0; CellActorCollection *unk_BE4; - UnkStruct_0200C738 unk_BE8; + GF_G2dRenderer unk_BE8; SpriteResourceCollection *unk_D74[4]; SpriteResource *unk_D84[3][4]; CellActorResourceData unk_DB4; diff --git a/include/overlay096/struct_ov96_0223BF40_t.h b/include/overlay096/struct_ov96_0223BF40_t.h index 0fe8c7bdc3..37f786dedb 100644 --- a/include/overlay096/struct_ov96_0223BF40_t.h +++ b/include/overlay096/struct_ov96_0223BF40_t.h @@ -4,7 +4,6 @@ #include #include -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0206BC70.h" #include "overlay061/struct_ov61_0222C3B0.h" @@ -18,6 +17,7 @@ #include "menu.h" #include "message.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -59,7 +59,7 @@ struct UnkStruct_ov96_0223BF40_t { Strbuf *unk_BEC; int unk_BF0; CellActorCollection *unk_BF4; - UnkStruct_0200C738 unk_BF8; + GF_G2dRenderer unk_BF8; SpriteResourceCollection *unk_D84[4]; SpriteResource *unk_D94[3][4]; CellActorResourceData unk_DC4; diff --git a/include/overlay097/struct_ov97_0222D04C.h b/include/overlay097/struct_ov97_0222D04C.h index 9a6509e206..f8bb45a4e9 100644 --- a/include/overlay097/struct_ov97_0222D04C.h +++ b/include/overlay097/struct_ov97_0222D04C.h @@ -3,8 +3,6 @@ #include -#include "struct_defs/struct_0200C738.h" - #include "overlay097/struct_ov97_0223829C.h" #include "overlay097/union_ov97_0222D2B0.h" @@ -14,6 +12,7 @@ #include "list_menu.h" #include "message.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -44,7 +43,7 @@ typedef struct { int unk_43C; int unk_440; CellActorCollection *unk_444; - UnkStruct_0200C738 unk_448; + GF_G2dRenderer unk_448; SpriteResourceCollection *unk_5D4[6]; SpriteResource *unk_5EC[6]; CellActorResourceData unk_604; diff --git a/include/overlay097/struct_ov97_02237AEC.h b/include/overlay097/struct_ov97_02237AEC.h index 613fb4b571..adda7596c3 100644 --- a/include/overlay097/struct_ov97_02237AEC.h +++ b/include/overlay097/struct_ov97_02237AEC.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV97_02237AEC_H #define POKEPLATINUM_STRUCT_OV97_02237AEC_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[6]; SpriteResource *unk_1A8[2][6]; CellActorResourceData unk_1D8[2]; diff --git a/include/overlay105/struct_ov105_02245AAC.h b/include/overlay105/struct_ov105_02245AAC.h index 697d518b30..aec1e0f403 100644 --- a/include/overlay105/struct_ov105_02245AAC.h +++ b/include/overlay105/struct_ov105_02245AAC.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV105_02245AAC_H #define POKEPLATINUM_STRUCT_OV105_02245AAC_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[1][4]; } UnkStruct_ov105_02245AAC; diff --git a/include/overlay106/struct_ov106_02243310.h b/include/overlay106/struct_ov106_02243310.h index 8fb5e80249..19097295d1 100644 --- a/include/overlay106/struct_ov106_02243310.h +++ b/include/overlay106/struct_ov106_02243310.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV106_02243310_H #define POKEPLATINUM_STRUCT_OV106_02243310_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[2][4]; } UnkStruct_ov106_02243310; diff --git a/include/overlay107/struct_ov107_02249954.h b/include/overlay107/struct_ov107_02249954.h index 6d05020114..4952f2b4d1 100644 --- a/include/overlay107/struct_ov107_02249954.h +++ b/include/overlay107/struct_ov107_02249954.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV107_02249954_H #define POKEPLATINUM_STRUCT_OV107_02249954_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[7][4]; } UnkStruct_ov107_02249954; diff --git a/include/overlay108/struct_ov108_02243030.h b/include/overlay108/struct_ov108_02243030.h index 74ddf62a64..6d275cd10c 100644 --- a/include/overlay108/struct_ov108_02243030.h +++ b/include/overlay108/struct_ov108_02243030.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV108_02243030_H #define POKEPLATINUM_STRUCT_OV108_02243030_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[11][4]; } UnkStruct_ov108_02243030; diff --git a/include/overlay109/struct_ov109_021D5140.h b/include/overlay109/struct_ov109_021D5140.h index e2670778f3..5a9c45c41a 100644 --- a/include/overlay109/struct_ov109_021D5140.h +++ b/include/overlay109/struct_ov109_021D5140.h @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_0209C194_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0209BDF8.h" #include "overlay109/struct_ov109_021D5140_sub1.h" @@ -15,6 +14,7 @@ #include "cell_actor.h" #include "menu.h" #include "message.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -39,7 +39,7 @@ typedef struct UnkStruct_ov109_021D5140_t { Strbuf *unk_58; int unk_5C; CellActorCollection *unk_60; - UnkStruct_0200C738 unk_64; + GF_G2dRenderer unk_64; SpriteResourceCollection *unk_1F0[4]; SpriteResource *unk_200[3][4]; CellActorResourceData unk_230; diff --git a/include/overlay111/struct_ov111_021D2F80.h b/include/overlay111/struct_ov111_021D2F80.h index 10821e9ae5..4c20435b60 100644 --- a/include/overlay111/struct_ov111_021D2F80.h +++ b/include/overlay111/struct_ov111_021D2F80.h @@ -1,14 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_OV111_021D2F80_H #define POKEPLATINUM_STRUCT_OV111_021D2F80_H -#include "struct_defs/struct_0200C738.h" - #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[5][4]; } UnkStruct_ov111_021D2F80; diff --git a/include/sprite_renderer.h b/include/sprite_renderer.h new file mode 100644 index 0000000000..b4b5e2a8d3 --- /dev/null +++ b/include/sprite_renderer.h @@ -0,0 +1,165 @@ +#ifndef POKEPLATINUM_UNK_0200C6E4_H +#define POKEPLATINUM_UNK_0200C6E4_H + +#include +#include + +#include "struct_decls/cell_actor_data.h" +#include "struct_decls/struct_0200C6E4_decl.h" +#include "struct_decls/struct_0200C704_decl.h" +#include "struct_defs/sprite_template.h" + +#include "overlay007/struct_ov7_0224F358.h" +#include "overlay104/struct_ov104_022412F4.h" +#include "overlay104/struct_ov104_02241308.h" +#include "overlay104/struct_ov104_0224133C.h" + +#include "cell_actor.h" +#include "narc.h" +#include "palette.h" +#include "sprite_resource.h" + +typedef struct { + NNSG2dRendererInstance rendererInstance; + NNSG2dRenderSurface renderSurface[2]; +} GF_G2dRenderer; + +typedef struct { + CellActorResourceData *resourceDataList; + int numEntries; +} CellActorResourceDataList; + +typedef struct CellTransferStateData_t { + int heapID; + int numGfxHandlers; + BOOL hasOamManager; + NNSG2dCellTransferState *cellTransferState; + GF_G2dRenderer renderer; +} SpriteRenderer; + +typedef struct AnimationResourceCollection_t { + CellActorCollection *cellActorList; + CellActorResourceDataList *cellActorDataList; + SpriteResourceTable *spriteResourceTable; + SpriteResourceCollection *spriteResourceCollectionList[SPRITE_RESOURCE_TYPE_MAX]; + SpriteResourceList *spriteResourceList[SPRITE_RESOURCE_TYPE_MAX]; + int numSpriteResources[SPRITE_RESOURCE_TYPE_MAX]; + int numSpriteResourceTypes; +} SpriteGfxHandler; + +SpriteRenderer *SpriteRenderer_Create(int param0); +SpriteGfxHandler *SpriteRenderer_CreateGfxHandler(SpriteRenderer *param0); +GF_G2dRenderer *SpriteRenderer_GetG2dRenderer(SpriteRenderer *param0); +BOOL SpriteRenderer_CreateOamCharPlttManagers(SpriteRenderer *param0, const UnkStruct_ov104_0224133C *param1, const UnkStruct_ov104_022412F4 *param2, int param3); +BOOL SpriteRenderer_CreateCellActorList(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2); +void thunk_CellActor_Delete(CellActor *param0); +void SpriteGfxHandler_UpdateCellActorCollection(SpriteGfxHandler *param0); +void OAMManager_ApplyAndResetBuffers(void); +void sub_0200C808(void); +void SpriteGfxHandler_DeleteCellActorCollection(SpriteGfxHandler *param0); +void SpriteGfxHandler_DeleteCellActorData(SpriteGfxHandler *param0); +void SpriteGfxHandler_DeleteSpriteResources(SpriteGfxHandler *param0); +void SpriteRenderer_Deinit(SpriteRenderer *param0); +void SpriteRenderer_RemoveGfxHandler(SpriteRenderer *param0, SpriteGfxHandler *param1); +void SpriteRenderer_DeleteGfxHandler(SpriteRenderer *param0, SpriteGfxHandler *param1); +void SpriteRenderer_Free(SpriteRenderer *param0); +BOOL SpriteRenderer_LoadSpriteResourceData(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteResourceDataPath *param2); +CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov7_0224F358 *param2); +CellActor *SpriteRenderer_CreateCellActor(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13); +BOOL SpriteRenderer_InitGfxResourceList(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov104_02241308 *param2); +BOOL SpriteRenderer_LoadCharResObj(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); +BOOL SpriteRenderer_LoadCharResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int vram, int resID); +s8 SpriteRenderer_LoadPaletteResObj(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5, int param6, int param7); +s8 SpriteRenderer_LoadPaletteResObjFromOpenNarc(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, int param4, int param5, int param6, int param7); +u8 SpriteRenderer_LoadPalette(PaletteData *palette, enum PaletteBufferID bufferID, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, int compressed, int paletteIndex, int vramType, int resourceID); +u8 SpriteRenderer_LoadPaletteFromOpenNarc(PaletteData *palette, enum PaletteBufferID bufferID, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, int compressed, int paletteIndex, int vramType, int resourceID); +BOOL SpriteRenderer_LoadCellResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID); +BOOL SpriteRenderer_LoadCellResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID); +BOOL SpriteRenderer_LoadAnimResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID); +BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID); +CellActorData *CellActor_LoadResources(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteTemplate *param2); +const NNSG2dImagePaletteProxy *SpriteGfxHandler_GetPaletteProxy(SpriteGfxHandler *param0, int param1); +u32 SpriteGfxHandler_GetPaletteNumberById(SpriteGfxHandler *param0, int param1, NNS_G2D_VRAM_TYPE param2); +BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *param0, int param1); +BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler *param0, int param1); +BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler *param0, int param1); +BOOL SpriteGfxHandler_UnloadAnimObjById(SpriteGfxHandler *param0, int param1); +void SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(SpriteRenderer *param0, SpriteGfxHandler *param1); +void CellActorData_Delete(CellActorData *param0); +void CellActor_UpdateObject(CellActor *param0); +void CellActorData_UpdateObject(CellActorData *param0); +void CellActorData_Update2Frames(CellActorData *param0); +void CellActorData_UpdateNFrames(CellActorData *param0, fx32 param1); +u32 CellActorData_GetActorAnimCount(CellActorData *param0); +void CellActorData_SetAnim(CellActorData *param0, u32 param1); +void CellActorData_SetAnimNoRestart(CellActorData *param0, u32 param1); +u32 CellActorData_GetActiveAnim(CellActorData *param0); +void thunk_CellActor_SetAnimateFlag(CellActor *param0, int param1); +void CellActorData_SetAnimateFlag(CellActorData *param0, int param1); +void thunk_CellActor_SetAnimSpeed(CellActor *param0, fx32 param1); +void CellActorData_SetAnimSpeed(CellActorData *param0, fx32 param1); +BOOL thunk_CellActor_IsAnimated(CellActor *param0); +BOOL CellActorData_IsAnimated(CellActorData *param0); +void thunk_CellActor_SetAnimFrame(CellActor *param0, u16 param1); +void CellActorData_SetAnimFrame(CellActorData *param0, u16 param1); +u16 thunk_CellActor_GetAnimFrame(CellActor *param0); +u16 CellActorData_GetAnimFrame(CellActorData *param0); +void CellActor_DrawSprite(CellActor *param0, int param1); +void CellActorData_DrawSprite(CellActorData *param0, int param1); +int thunk_CellActor_GetDrawFlag(CellActor *param0); +int CellActorData_GetDrawFlag(CellActorData *param0); +void thunk_CellActor_SetExplicitPalette(CellActor *param0, int param1); +void CellActorData_SetExplicitPalette(CellActorData *param0, int param1); +void thunk_CellActor_SetExplicitPaletteOffset(CellActor *param0, int param1); +void CellActorData_SetExplicitPaletteOffset(CellActorData *param0, int param1); +int CellActorData_GetExplicitPaletteOffset(CellActorData *param0); +void thunk_CellActor_SetExplicitPriority(CellActor *param0, int param1); +int CellActorData_GetExplicitPriority(CellActorData *param0); +void CellActorData_SetExplicitPriority(CellActorData *param0, int param1); +void thunk_CellActor_SetPriority(CellActor *param0, int param1); +void CellActorData_SetPriority(CellActorData *param0, int param1); +u32 thunk_CellActor_GetPriority(CellActor *param0); +u32 CellActorData_GetPriority(CellActorData *param0); +void CellActor_SetPositionXY(CellActor *param0, s16 param1, s16 param2); +void CellActorData_SetPositionXY(CellActorData *param0, s16 param1, s16 param2); +void CellActor_SetPositionWithOffsetXY(CellActor *param0, s16 param1, s16 param2, fx32 param3); +void sub_0200D500(CellActorData *param0, s16 param1, s16 param2, fx32 param3); +void sub_0200D50C(CellActor *param0, s16 *param1, s16 *param2); +void SpriteActor_GetSpritePositionXY(CellActorData *param0, s16 *param1, s16 *param2); +void sub_0200D55C(CellActor *param0, s16 *param1, s16 *param2, fx32 param3); +void sub_0200D5A0(CellActorData *param0, s16 *param1, s16 *param2, fx32 param3); +void sub_0200D5AC(CellActor *param0, s16 param1, s16 param2); +void sub_0200D5DC(CellActorData *param0, s16 param1, s16 param2); +void sub_0200D5E8(CellActorData *param0, fx32 param1, fx32 param2); +void sub_0200D614(CellActorData *param0, fx32 param1, fx32 param2); +void sub_0200D638(CellActorData *param0, fx32 *param1, fx32 *param2); +void sub_0200D650(CellActorData *param0, fx32 param1, fx32 param2, fx32 param3); +void sub_0200D67C(CellActorData *param0, fx32 *param1, fx32 *param2, fx32 param3); +void sub_0200D69C(CellActor *param0, int param1); +void sub_0200D6A4(CellActorData *param0, int param1); +void sub_0200D6B0(CellActor *param0, f32 param1, f32 param2); +void sub_0200D6E8(CellActorData *param0, f32 param1, f32 param2); +void sub_0200D6F4(CellActor *param0, f32 param1, f32 param2); +void sub_0200D74C(CellActorData *param0, f32 param1, f32 param2); +void sub_0200D758(CellActor *param0, f32 *param1, f32 *param2); +void sub_0200D788(CellActorData *param0, f32 *param1, f32 *param2); +void sub_0200D794(CellActor *param0, u16 param1); +void sub_0200D79C(CellActorData *param0, u16 param1); +void sub_0200D7A8(CellActor *param0, s32 param1); +void sub_0200D7C0(CellActorData *param0, s32 param1); +void sub_0200D7CC(CellActor *param0, int param1); +void sub_0200D7D4(CellActorData *param0, int param1); +void sub_0200D7E0(CellActorData *param0, s16 param1, s16 param2); +void sub_0200D7FC(CellActorData *param0, BOOL param1); +void sub_0200D808(CellActor *param0, GXOamMode param1); +void SpriteActor_SetOAMMode(CellActorData *param0, GXOamMode param1); +u32 sub_0200D81C(CellActorData *param0); +BOOL sub_0200D828(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); +BOOL sub_0200D888(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); +BOOL sub_0200D8E8(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5, int param6); +void sub_0200D948(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5); +void sub_0200D97C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5); +CellActorCollection *sub_0200D9B0(SpriteGfxHandler *param0); +void sub_0200D9B4(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5); + +#endif // POKEPLATINUM_UNK_0200C6E4_H diff --git a/include/sprite_resource.h b/include/sprite_resource.h index 2fc7d521df..b219760ce3 100644 --- a/include/sprite_resource.h +++ b/include/sprite_resource.h @@ -15,6 +15,7 @@ enum SpriteResourceType { SPRITE_RESOURCE_SPRITE_ANIM, SPRITE_RESOURCE_MULTI_SPRITE, SPRITE_RESOURCE_MULTI_SPRITE_ANIM, + SPRITE_RESOURCE_TYPE_MAX }; typedef struct SpriteResource { diff --git a/include/struct_defs/struct_02009508.h b/include/struct_defs/struct_02009508.h deleted file mode 100644 index 6627cb84a9..0000000000 --- a/include/struct_defs/struct_02009508.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02009508_H -#define POKEPLATINUM_STRUCT_02009508_H - -#include "cell_actor.h" - -typedef struct { - CellActorResourceData *unk_00; - int unk_04; -} UnkStruct_02009508; - -#endif // POKEPLATINUM_STRUCT_02009508_H diff --git a/include/struct_defs/struct_0200C738.h b/include/struct_defs/struct_0200C738.h deleted file mode 100644 index c1f49c7ee2..0000000000 --- a/include/struct_defs/struct_0200C738.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_0200C738_H -#define POKEPLATINUM_STRUCT_0200C738_H - -#include - -typedef struct { - NNSG2dRendererInstance unk_00; - NNSG2dRenderSurface unk_94[2]; -} UnkStruct_0200C738; - -#endif // POKEPLATINUM_STRUCT_0200C738_H diff --git a/include/struct_defs/struct_0200D0F4.h b/include/struct_defs/struct_0200D0F4.h index 2e44d02f76..b063500eab 100644 --- a/include/struct_defs/struct_0200D0F4.h +++ b/include/struct_defs/struct_0200D0F4.h @@ -1,15 +1,14 @@ #ifndef POKEPLATINUM_STRUCT_0200D0F4_H #define POKEPLATINUM_STRUCT_0200D0F4_H -#include "struct_defs/struct_02009508.h" - #include "cell_actor.h" +#include "sprite_renderer.h" typedef struct CellActorData { - CellActor *unk_00; - CellActorResourceData *unk_04; - UnkStruct_02009508 *unk_08; - int unk_0C; + CellActor *cellActor; + CellActorResourceData *cellActorResource; + CellActorResourceDataList *cellActorResourceList; + BOOL vramTransfer; } CellActorData; #endif // POKEPLATINUM_STRUCT_0200D0F4_H diff --git a/include/struct_defs/struct_02095E80_t.h b/include/struct_defs/struct_02095E80_t.h index 4f5993671e..bc97026ad4 100644 --- a/include/struct_defs/struct_02095E80_t.h +++ b/include/struct_defs/struct_02095E80_t.h @@ -10,7 +10,7 @@ #include "struct_decls/struct_party_decl.h" #include "struct_defs/archived_sprite.h" #include "struct_defs/chatot_cry.h" -#include "struct_defs/struct_0200C738.h" +#include "struct_defs/pokemon_summary.h" #include "struct_defs/struct_02027F8C.h" #include "struct_defs/struct_02095E80_sub1.h" @@ -26,6 +26,7 @@ #include "message.h" #include "overlay_manager.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -70,7 +71,7 @@ struct UnkStruct_02095E80_t { Strbuf *unk_18C; Strbuf *unk_190; CellActorCollection *unk_194; - UnkStruct_0200C738 unk_198; + GF_G2dRenderer unk_198; SpriteResourceCollection *unk_324[4]; SpriteResource *unk_334[2][4]; CellActorResourceData unk_354; diff --git a/include/struct_defs/struct_02095EAC_t.h b/include/struct_defs/struct_02095EAC_t.h index b9a3eae5b7..e01a894192 100644 --- a/include/struct_defs/struct_02095EAC_t.h +++ b/include/struct_defs/struct_02095EAC_t.h @@ -2,7 +2,6 @@ #define POKEPLATINUM_STRUCT_02095EAC_T_H #include "struct_decls/struct_02015920_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0203DDFC.h" #include "struct_defs/struct_02095EAC_sub1.h" @@ -12,6 +11,7 @@ #include "bg_window.h" #include "cell_actor.h" #include "message.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -28,7 +28,7 @@ struct UnkStruct_02095EAC_t { Strbuf *unk_2C; int unk_30; CellActorCollection *unk_34; - UnkStruct_0200C738 unk_38; + GF_G2dRenderer unk_38; SpriteResourceCollection *unk_1C4[4]; SpriteResource *unk_1D4[2][4]; CellActorResourceData unk_1F4; diff --git a/include/struct_defs/struct_020961E8_t.h b/include/struct_defs/struct_020961E8_t.h index 094854156e..f24e76747d 100644 --- a/include/struct_defs/struct_020961E8_t.h +++ b/include/struct_defs/struct_020961E8_t.h @@ -3,7 +3,6 @@ #include -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0203DE34.h" #include "struct_defs/struct_020961E8_sub1.h" @@ -15,6 +14,7 @@ #include "menu.h" #include "message.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -35,7 +35,7 @@ struct UnkStruct_020961E8_t { Strbuf *unk_48; int unk_4C; CellActorCollection *unk_50; - UnkStruct_0200C738 unk_54; + GF_G2dRenderer unk_54; SpriteResourceCollection *unk_1E0[4]; SpriteResource *unk_1F0[3][4]; CellActorResourceData unk_220; diff --git a/include/struct_defs/struct_0209903C.h b/include/struct_defs/struct_0209903C.h index eeaebf60e5..36904c96bc 100644 --- a/include/struct_defs/struct_0209903C.h +++ b/include/struct_defs/struct_0209903C.h @@ -1,11 +1,10 @@ #ifndef POKEPLATINUM_STRUCT_0209903C_H #define POKEPLATINUM_STRUCT_0209903C_H -#include "struct_defs/struct_02009508.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0209903C_sub1.h" #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" typedef struct { @@ -16,8 +15,8 @@ typedef struct { u16 unk_0C; u16 unk_0E; CellActorCollection *unk_10; - UnkStruct_0200C738 unk_14; - UnkStruct_02009508 *unk_1A0; + GF_G2dRenderer unk_14; + CellActorResourceDataList *unk_1A0; SpriteResourceCollection *unk_1A4[4]; SpriteResourceList *unk_1B4[4]; UnkStruct_0209903C_sub1 *unk_1C4; diff --git a/include/unk_020093B4.h b/include/unk_020093B4.h index dd8a8ae24d..81d4b0e010 100644 --- a/include/unk_020093B4.h +++ b/include/unk_020093B4.h @@ -3,20 +3,19 @@ #include -#include "struct_defs/struct_02009508.h" #include "struct_defs/struct_02009508_1.h" -#include "struct_defs/struct_0200C738.h" #include "cell_actor.h" +#include "sprite_renderer.h" #include "sprite_resource.h" void sub_020093B4(CellActorResourceData *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, SpriteResourceCollection *param9, SpriteResourceCollection *param10, SpriteResourceCollection *param11, SpriteResourceCollection *param12, SpriteResourceCollection *param13, SpriteResourceCollection *param14); void sub_020094F0(CellActorResourceData *param0); -UnkStruct_02009508 *sub_02009508(const UnkStruct_02009508_1 *param0, int param1, SpriteResourceCollection *param2, SpriteResourceCollection *param3, SpriteResourceCollection *param4, SpriteResourceCollection *param5, SpriteResourceCollection *param6, SpriteResourceCollection *param7); -void sub_020095A8(UnkStruct_02009508 *param0); -CellActorCollection *sub_020095C4(int param0, UnkStruct_0200C738 *param1, int param2); -void sub_0200962C(UnkStruct_0200C738 *param0, fx32 param1, fx32 param2); -void sub_0200964C(UnkStruct_0200C738 *param0, fx32 param1, fx32 param2); +CellActorResourceDataList *sub_02009508(const UnkStruct_02009508_1 *param0, int param1, SpriteResourceCollection *param2, SpriteResourceCollection *param3, SpriteResourceCollection *param4, SpriteResourceCollection *param5, SpriteResourceCollection *param6, SpriteResourceCollection *param7); +void sub_020095A8(CellActorResourceDataList *param0); +CellActorCollection *sub_020095C4(int param0, GF_G2dRenderer *param1, int param2); +void sub_0200962C(GF_G2dRenderer *param0, fx32 param1, fx32 param2); +void sub_0200964C(GF_G2dRenderer *param0, fx32 param1, fx32 param2); void sub_0200966C(u32 param0, GXOBJVRamModeChar param1); void sub_02009704(u32 param0); diff --git a/include/unk_0200C6E4.h b/include/unk_0200C6E4.h deleted file mode 100644 index e0e39170b8..0000000000 --- a/include/unk_0200C6E4.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef POKEPLATINUM_UNK_0200C6E4_H -#define POKEPLATINUM_UNK_0200C6E4_H - -#include -#include - -#include "struct_decls/cell_actor_data.h" -#include "struct_decls/struct_0200C6E4_decl.h" -#include "struct_decls/struct_0200C704_decl.h" -#include "struct_defs/sprite_template.h" -#include "struct_defs/struct_0200C738.h" - -#include "overlay007/struct_ov7_0224F358.h" -#include "overlay104/struct_ov104_022412F4.h" -#include "overlay104/struct_ov104_02241308.h" -#include "overlay104/struct_ov104_0224133C.h" - -#include "cell_actor.h" -#include "narc.h" -#include "palette.h" -#include "sprite_resource.h" - -SpriteRenderer *sub_0200C6E4(int param0); -SpriteGfxHandler *sub_0200C704(SpriteRenderer *param0); -UnkStruct_0200C738 *sub_0200C738(SpriteRenderer *param0); -BOOL sub_0200C73C(SpriteRenderer *param0, const UnkStruct_ov104_0224133C *param1, const UnkStruct_ov104_022412F4 *param2, int param3); -BOOL sub_0200C7C0(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2); -void sub_0200C7E4(CellActor *param0); -void sub_0200C7EC(SpriteGfxHandler *param0); -void OAMManager_ApplyAndResetBuffers(void); -void sub_0200C808(void); -void sub_0200C810(SpriteGfxHandler *param0); -void sub_0200C81C(SpriteGfxHandler *param0); -void sub_0200C82C(SpriteGfxHandler *param0); -void sub_0200C880(SpriteRenderer *param0); -void sub_0200C8A0(SpriteRenderer *param0, SpriteGfxHandler *param1); -void sub_0200C8B0(SpriteRenderer *param0, SpriteGfxHandler *param1); -void sub_0200C8D4(SpriteRenderer *param0); -BOOL LoadSpriteResourceData(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteResourceDataPath *param2); -CellActor *sub_0200CA08(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov7_0224F358 *param2); -CellActor *sub_0200CA44(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13); -BOOL sub_0200CB30(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov104_02241308 *param2); -BOOL sub_0200CBDC(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL SpriteRenderer_LoadCharResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int vram, int resID); -s8 sub_0200CC9C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5, int param6, int param7); -s8 sub_0200CD0C(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, int param4, int param5, int param6, int param7); -u8 sub_0200CD7C(PaletteData *param0, int param1, SpriteRenderer *param2, SpriteGfxHandler *param3, int param4, int param5, int param6, int param7, int param8, int param9); -u8 SpriteRenderer_LoadPalette(PaletteData *palette, enum PaletteBufferID paletteBuffer, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int palID, int vram, int resID); -BOOL sub_0200CE0C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5); -BOOL SpriteRenderer_LoadCellResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int resID); -BOOL sub_0200CE3C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5); -BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int resID); -CellActorData *SpriteActor_LoadResources(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteTemplate *param2); -const NNSG2dImagePaletteProxy *sub_0200D04C(SpriteGfxHandler *param0, int param1); -u32 sub_0200D05C(SpriteGfxHandler *param0, int param1, NNS_G2D_VRAM_TYPE param2); -BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *param0, int param1); -BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler *param0, int param1); -BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler *param0, int param1); -BOOL SpriteGfxHandler_UnloadAnimObjById(SpriteGfxHandler *param0, int param1); -void sub_0200D0B0(SpriteRenderer *param0, SpriteGfxHandler *param1); -void sub_0200D0F4(CellActorData *param0); -void SpriteActor_UpdateObject(CellActor *param0); -void sub_0200D330(CellActorData *param0); -void sub_0200D33C(CellActorData *param0); -void sub_0200D34C(CellActorData *param0, fx32 param1); -u32 sub_0200D358(CellActorData *param0); -void sub_0200D364(CellActorData *param0, u32 param1); -void sub_0200D370(CellActorData *param0, u32 param1); -u32 sub_0200D37C(CellActorData *param0); -void sub_0200D388(CellActor *param0, int param1); -void sub_0200D390(CellActorData *param0, int param1); -void sub_0200D39C(CellActor *param0, fx32 param1); -void sub_0200D3A4(CellActorData *param0, fx32 param1); -BOOL sub_0200D3B0(CellActor *param0); -BOOL sub_0200D3B8(CellActorData *param0); -void sub_0200D3C4(CellActor *param0, u16 param1); -void sub_0200D3CC(CellActorData *param0, u16 param1); -u16 sub_0200D3D8(CellActor *param0); -u16 sub_0200D3E0(CellActorData *param0); -void SpriteActor_DrawSprite(CellActor *param0, int param1); -void SpriteActor_EnableObject(CellActorData *param0, int param1); -int sub_0200D400(CellActor *param0); -int sub_0200D408(CellActorData *param0); -void sub_0200D414(CellActor *param0, int param1); -void sub_0200D41C(CellActorData *param0, int param1); -void sub_0200D428(CellActor *param0, int param1); -void sub_0200D430(CellActorData *param0, int param1); -int sub_0200D43C(CellActorData *param0); -void sub_0200D448(CellActor *param0, int param1); -int sub_0200D454(CellActorData *param0); -void sub_0200D460(CellActorData *param0, int param1); -void sub_0200D46C(CellActor *param0, int param1); -void sub_0200D474(CellActorData *param0, int param1); -u32 sub_0200D480(CellActor *param0); -u32 sub_0200D488(CellActorData *param0); -void SpriteActor_SetPositionXY(CellActor *param0, s16 param1, s16 param2); -void SpriteActor_SetSpritePositionXY(CellActorData *param0, s16 param1, s16 param2); -void sub_0200D4D0(CellActor *param0, s16 param1, s16 param2, fx32 param3); -void sub_0200D500(CellActorData *param0, s16 param1, s16 param2, fx32 param3); -void sub_0200D50C(CellActor *param0, s16 *param1, s16 *param2); -void SpriteActor_GetSpritePositionXY(CellActorData *param0, s16 *param1, s16 *param2); -void sub_0200D55C(CellActor *param0, s16 *param1, s16 *param2, fx32 param3); -void sub_0200D5A0(CellActorData *param0, s16 *param1, s16 *param2, fx32 param3); -void sub_0200D5AC(CellActor *param0, s16 param1, s16 param2); -void sub_0200D5DC(CellActorData *param0, s16 param1, s16 param2); -void sub_0200D5E8(CellActorData *param0, fx32 param1, fx32 param2); -void sub_0200D614(CellActorData *param0, fx32 param1, fx32 param2); -void sub_0200D638(CellActorData *param0, fx32 *param1, fx32 *param2); -void sub_0200D650(CellActorData *param0, fx32 param1, fx32 param2, fx32 param3); -void sub_0200D67C(CellActorData *param0, fx32 *param1, fx32 *param2, fx32 param3); -void sub_0200D69C(CellActor *param0, int param1); -void sub_0200D6A4(CellActorData *param0, int param1); -void sub_0200D6B0(CellActor *param0, f32 param1, f32 param2); -void sub_0200D6E8(CellActorData *param0, f32 param1, f32 param2); -void sub_0200D6F4(CellActor *param0, f32 param1, f32 param2); -void sub_0200D74C(CellActorData *param0, f32 param1, f32 param2); -void sub_0200D758(CellActor *param0, f32 *param1, f32 *param2); -void sub_0200D788(CellActorData *param0, f32 *param1, f32 *param2); -void sub_0200D794(CellActor *param0, u16 param1); -void sub_0200D79C(CellActorData *param0, u16 param1); -void sub_0200D7A8(CellActor *param0, s32 param1); -void sub_0200D7C0(CellActorData *param0, s32 param1); -void sub_0200D7CC(CellActor *param0, int param1); -void sub_0200D7D4(CellActorData *param0, int param1); -void sub_0200D7E0(CellActorData *param0, s16 param1, s16 param2); -void sub_0200D7FC(CellActorData *param0, BOOL param1); -void sub_0200D808(CellActor *param0, GXOamMode param1); -void SpriteActor_SetOAMMode(CellActorData *param0, GXOamMode param1); -u32 sub_0200D81C(CellActorData *param0); -BOOL sub_0200D828(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL sub_0200D888(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL sub_0200D8E8(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5, int param6); -void sub_0200D948(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5); -void sub_0200D97C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5); -CellActorCollection *sub_0200D9B0(SpriteGfxHandler *param0); -void sub_0200D9B4(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5); - -#endif // POKEPLATINUM_UNK_0200C6E4_H diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index 9152c63fcc..13685a7a3f 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -42,7 +42,7 @@ Static main Object main.nef.p/src_message_util.c.o Object main.nef.p/src_string_template.c.o Object main.nef.p/src_unk_0200C440.c.o - Object main.nef.p/src_unk_0200C6E4.c.o + Object main.nef.p/src_sprite_renderer.c.o Object main.nef.p/src_sys_task.c.o Object main.nef.p/src_render_window.c.o Object main.nef.p/src_unk_0200F174.c.o diff --git a/src/applications/options_menu.c b/src/applications/options_menu.c index bbb0fa4058..b0ac42b89d 100644 --- a/src/applications/options_menu.c +++ b/src/applications/options_menu.c @@ -27,11 +27,11 @@ #include "palette.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "text.h" #include "unk_020041CC.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index 3d5fb614dd..b53a60e2a9 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -20,8 +20,8 @@ #include "pokemon_icon.h" #include "ribbon.h" #include "pokemon_summary_app.h" +#include "sprite_renderer.h" #include "sprite_resource.h" -#include "unk_0200C6E4.h" #include "unk_0201DBEC.h" #include "unk_0207C908.h" @@ -135,8 +135,8 @@ void sub_0208EA44(PokemonSummaryScreen *param0) GXLayers_EngineBToggleLayers(GX_PLANEMASK_OBJ, 1); VRAMTransferManager_New(32, 19); - param0->renderer = sub_0200C6E4(19); - param0->gfxHandler = sub_0200C704(param0->renderer); + param0->renderer = SpriteRenderer_Create(19); + param0->gfxHandler = SpriteRenderer_CreateGfxHandler(param0->renderer); { UnkStruct_ov104_0224133C v0 = { @@ -157,8 +157,8 @@ void sub_0208EA44(PokemonSummaryScreen *param0) GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->renderer, &v0, &v1, 32); - sub_0200C7C0(param0->renderer, param0->gfxHandler, 77); + SpriteRenderer_CreateOamCharPlttManagers(param0->renderer, &v0, &v1, 32); + SpriteRenderer_CreateCellActorList(param0->renderer, param0->gfxHandler, 77); } { @@ -172,14 +172,14 @@ void sub_0208EA44(PokemonSummaryScreen *param0) "data/pst_h.cldat" }; - LoadSpriteResourceData(param0->renderer, param0->gfxHandler, &v2); + SpriteRenderer_LoadSpriteResourceData(param0->renderer, param0->gfxHandler, &v2); } } void sub_0208EAF4(PokemonSummaryScreen *summaryScreen) { - sub_0200C8B0(summaryScreen->renderer, summaryScreen->gfxHandler); - sub_0200C8D4(summaryScreen->renderer); + SpriteRenderer_DeleteGfxHandler(summaryScreen->renderer, summaryScreen->gfxHandler); + SpriteRenderer_Free(summaryScreen->renderer); } void sub_0208EB14(PokemonSummaryScreen *summaryScreen) @@ -196,7 +196,7 @@ void sub_0208EB64(PokemonSummaryScreen *param0) u16 v0; for (v0 = 0; v0 < 77; v0++) { - param0->unk_41C[v0] = sub_0200CA08(param0->renderer, param0->gfxHandler, &Unk_020F41A8[v0]); + param0->unk_41C[v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->renderer, param0->gfxHandler, &Unk_020F41A8[v0]); } sub_0208EF0C(param0); @@ -280,7 +280,7 @@ void sub_0208ECF4(PokemonSummaryScreen *param0) v1 = v3 + 24 + (v6 - 1) * 16; } - SpriteActor_SetPositionXY(param0->unk_41C[v5], v1, v2); + CellActor_SetPositionXY(param0->unk_41C[v5], v1, v2); CellActor_SetDrawFlag(v0[v5], 1); v6++; @@ -297,8 +297,8 @@ void sub_0208EDC4(PokemonSummaryScreen *param0) v0 = sub_0208ECB8(param0); - SpriteActor_SetPositionXY(param0->unk_41C[21], v0 + -12, 24); - SpriteActor_SetPositionXY(param0->unk_41C[22], (23 * 8 + 4) + ((23 * 8 + 4) - v0) + -4, 24); + CellActor_SetPositionXY(param0->unk_41C[21], v0 + -12, 24); + CellActor_SetPositionXY(param0->unk_41C[22], (23 * 8 + 4) + ((23 * 8 + 4) - v0) + -4, 24); } void PokemonSummaryScreen_UpdatePageArrows(PokemonSummaryScreen *summaryScreen, BOOL showArrows) @@ -362,19 +362,19 @@ void sub_0208EF58(PokemonSummaryScreen *param0) u16 v0; for (v0 = 11; v0 <= 19; v0++) { - SpriteActor_DrawSprite(param0->unk_41C[v0], 0); + CellActor_DrawSprite(param0->unk_41C[v0], 0); } switch (param0->page) { case 0: - SpriteActor_DrawSprite(param0->unk_41C[11], 1); + CellActor_DrawSprite(param0->unk_41C[11], 1); if (param0->monData.type1 == param0->monData.type2) { - SpriteActor_SetPositionXY(param0->unk_41C[11], 216, 80); + CellActor_SetPositionXY(param0->unk_41C[11], 216, 80); } else { - SpriteActor_SetPositionXY(param0->unk_41C[11], 199, 80); - SpriteActor_DrawSprite(param0->unk_41C[12], 1); - SpriteActor_SetPositionXY( + CellActor_SetPositionXY(param0->unk_41C[11], 199, 80); + CellActor_DrawSprite(param0->unk_41C[12], 1); + CellActor_SetPositionXY( param0->unk_41C[12], 233, 80); } break; @@ -385,19 +385,19 @@ void sub_0208EF58(PokemonSummaryScreen *param0) } sub_0208F194(param0, 13 + v0, 5 + v0, MoveTable_LoadParam(param0->monData.moves[v0], MOVEATTRIBUTE_TYPE)); - SpriteActor_DrawSprite(param0->unk_41C[13 + v0], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); + CellActor_DrawSprite(param0->unk_41C[13 + v0], 1); + CellActor_SetPositionXY(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); } if (param0->data->move != 0) { sub_0208F194(param0, 13 + 4, 5 + 4, MoveTable_LoadParam(param0->data->move, MOVEATTRIBUTE_TYPE)); - SpriteActor_DrawSprite(param0->unk_41C[13 + 4], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); + CellActor_DrawSprite(param0->unk_41C[13 + 4], 1); + CellActor_SetPositionXY(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); } - SpriteActor_SetPositionXY(param0->unk_41C[11], 63, 52); - SpriteActor_SetPositionXY(param0->unk_41C[12], 63 + 34, 52); - SpriteActor_SetPositionXY(param0->unk_41C[18], (92 + 16), 72); + CellActor_SetPositionXY(param0->unk_41C[11], 63, 52); + CellActor_SetPositionXY(param0->unk_41C[12], 63 + 34, 52); + CellActor_SetPositionXY(param0->unk_41C[18], (92 + 16), 72); break; case 5: for (v0 = 0; v0 < 4; v0++) { @@ -406,19 +406,19 @@ void sub_0208EF58(PokemonSummaryScreen *param0) } sub_0208F194(param0, 13 + v0, 5 + v0, MoveTable_LoadParam(param0->monData.moves[v0], MOVEATTRIBUTE_CONTEST_TYPE) + 18); - SpriteActor_DrawSprite(param0->unk_41C[13 + v0], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); + CellActor_DrawSprite(param0->unk_41C[13 + v0], 1); + CellActor_SetPositionXY(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); } if (param0->data->move != 0) { sub_0208F194(param0, 13 + 4, 5 + 4, MoveTable_LoadParam(param0->data->move, MOVEATTRIBUTE_CONTEST_TYPE) + 18); - SpriteActor_DrawSprite(param0->unk_41C[13 + 4], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); + CellActor_DrawSprite(param0->unk_41C[13 + 4], 1); + CellActor_SetPositionXY(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); } - SpriteActor_SetPositionXY(param0->unk_41C[11], 63, 52); - SpriteActor_SetPositionXY(param0->unk_41C[12], 63 + 34, 52); - SpriteActor_SetPositionXY(param0->unk_41C[18], (92 + 16), 72); + CellActor_SetPositionXY(param0->unk_41C[11], 63, 52); + CellActor_SetPositionXY(param0->unk_41C[12], 63 + 34, 52); + CellActor_SetPositionXY(param0->unk_41C[18], (92 + 16), 72); break; } } @@ -432,7 +432,7 @@ void sub_0208F16C(PokemonSummaryScreen *param0) static void sub_0208F194(PokemonSummaryScreen *param0, u8 param1, u8 param2, u8 param3) { sub_0200D948(param0->renderer, param0->gfxHandler, sub_0207C944(), sub_0207C908(param3), 1, param2); - sub_0200D414(param0->unk_41C[param1], sub_0207C92C(param3) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); + thunk_CellActor_SetExplicitPalette(param0->unk_41C[param1], sub_0207C92C(param3) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); } static void sub_0208F1E4(PokemonSummaryScreen *param0, u8 *param1, s16 *param2, s16 *param3) @@ -458,8 +458,8 @@ void sub_0208F22C(PokemonSummaryScreen *param0, u8 param1, u8 param2) sub_0208F1E4(param0, ¶m1, &v0, &v1); sub_0208F1E4(param0, ¶m2, &v2, &v3); - SpriteActor_SetPositionXY(param0->unk_41C[13 + param1], v2, v3); - SpriteActor_SetPositionXY(param0->unk_41C[13 + param2], v0, v1); + CellActor_SetPositionXY(param0->unk_41C[13 + param1], v2, v3); + CellActor_SetPositionXY(param0->unk_41C[13 + param2], v0, v1); } void PokemonSummaryScreen_UpdateMoveCategoryIcon(PokemonSummaryScreen *summaryScreen, u32 move) @@ -467,12 +467,12 @@ void PokemonSummaryScreen_UpdateMoveCategoryIcon(PokemonSummaryScreen *summarySc u32 category = MoveTable_LoadParam(move, MOVEATTRIBUTE_CLASS); sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, sub_0207CAC0(), sub_0207CA90(category), 1, 10); - sub_0200D414(summaryScreen->unk_41C[18], sub_0207CAA8(category) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); + thunk_CellActor_SetExplicitPalette(summaryScreen->unk_41C[18], sub_0207CAA8(category) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); } void PokemonSummaryScreen_UpdateMoveSelectorPos(PokemonSummaryScreen *summaryScreen) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[9], 194, 48 + summaryScreen->cursor * 32); + CellActor_SetPositionXY(summaryScreen->unk_41C[9], 194, 48 + summaryScreen->cursor * 32); } void sub_0208F310(PokemonSummaryScreen *summaryScreen) @@ -480,7 +480,7 @@ void sub_0208F310(PokemonSummaryScreen *summaryScreen) s16 v0, v1; sub_0200D50C(summaryScreen->unk_41C[9], &v0, &v1); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[10], v0, v1); + CellActor_SetPositionXY(summaryScreen->unk_41C[10], v0, v1); CellActor_SetDrawFlag(summaryScreen->unk_41C[10], TRUE); } @@ -602,15 +602,15 @@ void sub_0208F574(PokemonSummaryScreen *param0) } if ((param0->monData.isShiny == 1) && (param0->monData.isEgg == 0)) { - SpriteActor_DrawSprite(param0->unk_41C[53], 1); + CellActor_DrawSprite(param0->unk_41C[53], 1); } else { - SpriteActor_DrawSprite(param0->unk_41C[53], 0); + CellActor_DrawSprite(param0->unk_41C[53], 0); } if (param0->monData.pokerus == 2) { - SpriteActor_DrawSprite(param0->unk_41C[54], 1); + CellActor_DrawSprite(param0->unk_41C[54], 1); } else { - SpriteActor_DrawSprite(param0->unk_41C[54], 0); + CellActor_DrawSprite(param0->unk_41C[54], 0); } } @@ -624,9 +624,9 @@ void sub_0208F600(PokemonSummaryScreen *summaryScreen) PokemonSummaryScreen_CalcSubscreenButtonCirclePos(summaryScreen, &x, &y); if (summaryScreen->subscreenType == PSS_SUBSCREEN_TYPE_NORMAL) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[41], x, y + 192); + CellActor_SetPositionXY(summaryScreen->unk_41C[41], x, y + 192); } else { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[41], x - 4, y + 192); + CellActor_SetPositionXY(summaryScreen->unk_41C[41], x - 4, y + 192); } } @@ -655,7 +655,7 @@ void PokemonSummaryScreen_UpdateAButtonSprite(PokemonSummaryScreen *summaryScree return; } - SpriteActor_SetPositionXY(summaryScreen->unk_41C[47], Window_GetXPos(window) * 8 - 10, 8); + CellActor_SetPositionXY(summaryScreen->unk_41C[47], Window_GetXPos(window) * 8 - 10, 8); CellActor_SetDrawFlag(summaryScreen->unk_41C[47], TRUE); } @@ -671,7 +671,7 @@ void sub_0208F71C(PokemonSummaryScreen *param0) } sub_0200D948(param0->renderer, param0->gfxHandler, 19, v1, 0, 11); - sub_0200D414(param0->unk_41C[19], PokeIconPaletteIndex(param0->monData.species, param0->monData.form, param0->monData.isEgg) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); + thunk_CellActor_SetExplicitPalette(param0->unk_41C[19], PokeIconPaletteIndex(param0->monData.species, param0->monData.form, param0->monData.isEgg) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); CellActor_SetFlipMode(param0->unk_41C[19], (PokemonPersonalData_GetFormValue(param0->monData.species, param0->monData.form, 28) ^ 1)); } @@ -680,12 +680,12 @@ void PokemonSummaryScreen_ShowMonIcon(PokemonSummaryScreen *summaryScreen) sub_0200D97C(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, PokeIconPalettesFileIndex(), FALSE, 5); if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[19], 24, 48); + CellActor_SetPositionXY(summaryScreen->unk_41C[19], 24, 48); } else { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[19], 32, 68); + CellActor_SetPositionXY(summaryScreen->unk_41C[19], 32, 68); } - SpriteActor_DrawSprite(summaryScreen->unk_41C[19], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[19], TRUE); } static s16 sub_0208F800(u32 param0, s16 param1, s16 param2) @@ -709,11 +709,11 @@ static s16 sub_0208F800(u32 param0, s16 param1, s16 param2) void PokemonSummaryScreen_DrawContestStatDots(PokemonSummaryScreen *summaryScreen) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[48], sub_0208F800(summaryScreen->monData.cool, 88, 88), sub_0208F800(summaryScreen->monData.cool, 49, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[49], sub_0208F800(summaryScreen->monData.beauty, 110, 88), sub_0208F800(summaryScreen->monData.beauty, 65, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[50], sub_0208F800(summaryScreen->monData.cute, 103, 88), sub_0208F800(summaryScreen->monData.cute, 92, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[51], sub_0208F800(summaryScreen->monData.smart, 72, 87), sub_0208F800(summaryScreen->monData.smart, 92, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[52], sub_0208F800(summaryScreen->monData.tough, 65, 87), sub_0208F800(summaryScreen->monData.tough, 65, 73)); + CellActor_SetPositionXY(summaryScreen->unk_41C[48], sub_0208F800(summaryScreen->monData.cool, 88, 88), sub_0208F800(summaryScreen->monData.cool, 49, 73)); + CellActor_SetPositionXY(summaryScreen->unk_41C[49], sub_0208F800(summaryScreen->monData.beauty, 110, 88), sub_0208F800(summaryScreen->monData.beauty, 65, 73)); + CellActor_SetPositionXY(summaryScreen->unk_41C[50], sub_0208F800(summaryScreen->monData.cute, 103, 88), sub_0208F800(summaryScreen->monData.cute, 92, 73)); + CellActor_SetPositionXY(summaryScreen->unk_41C[51], sub_0208F800(summaryScreen->monData.smart, 72, 87), sub_0208F800(summaryScreen->monData.smart, 92, 73)); + CellActor_SetPositionXY(summaryScreen->unk_41C[52], sub_0208F800(summaryScreen->monData.tough, 65, 87), sub_0208F800(summaryScreen->monData.tough, 65, 73)); CellActor_SetDrawFlag(summaryScreen->unk_41C[48], TRUE); CellActor_SetDrawFlag(summaryScreen->unk_41C[49], TRUE); @@ -734,7 +734,7 @@ void PokemonSummaryScreen_HideContestStatDots(PokemonSummaryScreen *summaryScree static void sub_0208F9B0(PokemonSummaryScreen *summaryScreen, u8 ribbonNum, u8 param2) { sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, 39, Ribbon_GetData(ribbonNum, RIBBON_DATA_SPRITE_ID), 0, 26 + param2); - sub_0200D414(summaryScreen->unk_41C[55 + param2], Ribbon_GetData(ribbonNum, RIBBON_DATA_PALETTE_NUM) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); + thunk_CellActor_SetExplicitPalette(summaryScreen->unk_41C[55 + param2], Ribbon_GetData(ribbonNum, RIBBON_DATA_PALETTE_NUM) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); } void sub_0208FA04(PokemonSummaryScreen *summaryScreen) @@ -775,7 +775,7 @@ void PokemonSummaryScreen_UpdateShownRibbonRows(PokemonSummaryScreen *summaryScr void PokemonSummaryScreen_UpdateRibbonCursorPos(PokemonSummaryScreen *summaryScreen) { - SpriteActor_SetPositionXY( + CellActor_SetPositionXY( summaryScreen->unk_41C[67], 132 + (summaryScreen->ribbonCol & (RIBBONS_PER_ROW - 1)) * 32, 56 + (summaryScreen->ribbonCol / RIBBONS_PER_ROW) * 40); } @@ -852,7 +852,7 @@ static void sub_0208FC30(CellActor *param0, u32 param1, u32 param2, const s16 *p v1 = param3[3] - (((((param3[3] - param3[1]) << 8) / 256) * param1) >> 8); } - SpriteActor_SetPositionXY(param0, v0, v1); + CellActor_SetPositionXY(param0, v0, v1); SpriteActor_SetAnimFrame(param0, 0); CellActor_SetAnim(param0, 0); } diff --git a/src/battle/battle_display.c b/src/battle/battle_display.c index b644bad488..a0219bfc7d 100644 --- a/src/battle/battle_display.c +++ b/src/battle/battle_display.c @@ -133,6 +133,7 @@ #include "party.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" @@ -141,7 +142,6 @@ #include "unk_02005474.h" #include "unk_0200762C.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_020131EC.h" #include "unk_0201567C.h" #include "unk_02015F84.h" @@ -274,11 +274,11 @@ void ov16_0225CBDC(BattleSystem *param0, BattlerData *param1, UnkStruct_ov16_022 if (param1->battlerType & 0x1) { v4->unk_13 = 2; v4->unk_0C = ov16_0223E020(param0, 1); - SpriteActor_SetSpritePositionXY(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); + CellActorData_SetPositionXY(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); } else { v4->unk_13 = 0; v4->unk_0C = ov16_0223E020(param0, 0); - SpriteActor_SetSpritePositionXY(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); + CellActorData_SetPositionXY(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); } if (param2->unk_01_2) { @@ -505,11 +505,11 @@ void ov16_0225D228(BattleSystem *param0, BattlerData *param1, UnkStruct_ov16_022 if (param1->battlerType & 0x1) { v1->unk_0F = 2; v1->unk_04 = ov16_0223E020(param0, 1); - SpriteActor_SetSpritePositionXY(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); + CellActorData_SetPositionXY(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); } else { v1->unk_0F = 0; v1->unk_04 = ov16_0223E020(param0, 0); - SpriteActor_SetSpritePositionXY(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); + CellActorData_SetPositionXY(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); } if ((BattleSystem_BattleType(param0) & 0x8) || ((BattleSystem_BattleType(param0) & 0x10) && (param1->battlerType & 0x1))) { @@ -1524,7 +1524,7 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) if (v2 < (24 * 8)) { sub_0200D5DC(v0->unk_0C->unk_00, 8, 0); } else { - SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + CellActorData_SetPositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } } @@ -1558,7 +1558,7 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) } if ((v0->unk_1C == 1) || (v0->unk_1C == 3)) { - SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + CellActorData_SetPositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } sub_020086FC(v0->unk_08, 8, 0, 0, 0x0); @@ -1571,7 +1571,7 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) if (v2 > 64) { sub_0200D5DC(v0->unk_0C->unk_00, -8, 0); } else { - SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, 64, (128 + 8)); + CellActorData_SetPositionXY(v0->unk_0C->unk_00, 64, (128 + 8)); } } @@ -1601,7 +1601,7 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) } if ((v0->unk_1C == 0) || (v0->unk_1C == 2)) { - SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, 64, (128 + 8)); + CellActorData_SetPositionXY(v0->unk_0C->unk_00, 64, (128 + 8)); } v0->unk_12++; @@ -1663,7 +1663,7 @@ static void ov16_0225E894(SysTask *param0, void *param1) if (v2 < (24 * 8)) { sub_0200D5DC(v0->unk_0C->unk_00, 8, 0); } else { - SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + CellActorData_SetPositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } } @@ -1684,7 +1684,7 @@ static void ov16_0225E894(SysTask *param0, void *param1) Pokemon_PlayDelayedCry(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, 117, 127, NULL, 5, v4); } - SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + CellActorData_SetPositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); sub_020086FC(v0->unk_08, 8, 0, 0, 0x0); v0->unk_12++; @@ -2319,9 +2319,9 @@ static void ov16_0225FA70(SysTask *param0, void *param1) switch (v0->unk_0E) { case 0: - if (sub_0200D358(v0->unk_08) > 2) { - sub_0200D3CC(v0->unk_08, 0); - sub_0200D364(v0->unk_08, 2); + if (CellActorData_GetActorAnimCount(v0->unk_08) > 2) { + CellActorData_SetAnimFrame(v0->unk_08, 0); + CellActorData_SetAnim(v0->unk_08, 2); } v0->unk_18 = 28; @@ -2341,14 +2341,14 @@ static void ov16_0225FA70(SysTask *param0, void *param1) if (v1 < (24 * 8)) { sub_0200D5DC(v0->unk_04->unk_00, 8, 0); } else { - SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, (24 * 8), (8 * 11)); + CellActorData_SetPositionXY(v0->unk_04->unk_00, (24 * 8), (8 * 11)); } } SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); if ((v0->unk_14 == 1) || ((v0->unk_14 == 3) && ((v5 == (0x2 | 0x1)) || (v5 == ((0x2 | 0x1) | 0x80)) || (v5 == ((0x4 | 0x1) | 0x2))))) { - SpriteActor_SetSpritePositionXY(v0->unk_08, v1, v4); + CellActorData_SetPositionXY(v0->unk_08, v1, v4); } else if (v0->unk_14 == 3) { v1 = v3 - v1; v1 -= 24; @@ -2364,15 +2364,15 @@ static void ov16_0225FA70(SysTask *param0, void *param1) SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); if (v3 >= v0->unk_10) { - SpriteActor_SetSpritePositionXY(v0->unk_08, v0->unk_10, v4); + CellActorData_SetPositionXY(v0->unk_08, v0->unk_10, v4); if ((v0->unk_14 == 1) || (v0->unk_14 == 3)) { - SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, (24 * 8), (8 * 11)); + CellActorData_SetPositionXY(v0->unk_04->unk_00, (24 * 8), (8 * 11)); } - if (sub_0200D358(v0->unk_08) > 1) { - sub_0200D3CC(v0->unk_08, 0); - sub_0200D364(v0->unk_08, 1); + if (CellActorData_GetActorAnimCount(v0->unk_08) > 1) { + CellActorData_SetAnimFrame(v0->unk_08, 0); + CellActorData_SetAnim(v0->unk_08, 1); v0->unk_12_0 = 0; v0->unk_0E = 3; } else { @@ -2384,14 +2384,14 @@ static void ov16_0225FA70(SysTask *param0, void *param1) if (v1 > 64) { sub_0200D5DC(v0->unk_04->unk_00, -8, 0); } else { - SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, 64, (128 + 8)); + CellActorData_SetPositionXY(v0->unk_04->unk_00, 64, (128 + 8)); } } SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); if ((v0->unk_14 == 0) || ((v0->unk_14 == 2) && ((v5 == (0x2 | 0x1)) || (v5 == ((0x2 | 0x1) | 0x80)) || (v5 == ((0x2 | 0x1) | 0x10)) || (v5 == ((0x4 | 0x1) | 0x2))))) { - SpriteActor_SetSpritePositionXY(v0->unk_08, v1, v4); + CellActorData_SetPositionXY(v0->unk_08, v1, v4); } else if (v0->unk_14 == 2) { v1 = v1 - v3; v1 -= 24; @@ -2407,10 +2407,10 @@ static void ov16_0225FA70(SysTask *param0, void *param1) SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); if (v3 <= v0->unk_10) { - SpriteActor_SetSpritePositionXY(v0->unk_08, v0->unk_10, v4); + CellActorData_SetPositionXY(v0->unk_08, v0->unk_10, v4); if ((v0->unk_14 == 0) || (v0->unk_14 == 2)) { - SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, 64, (128 + 8)); + CellActorData_SetPositionXY(v0->unk_04->unk_00, 64, (128 + 8)); } v0->unk_0E = 4; @@ -2418,7 +2418,7 @@ static void ov16_0225FA70(SysTask *param0, void *param1) } break; case 3: - if (sub_0200D3B8(v0->unk_08) == 1) { + if (CellActorData_IsAnimated(v0->unk_08) == 1) { if (ov16_02264650(v0, v0->unk_08) == 0) { break; } @@ -2569,9 +2569,9 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) ov12_02237E40(v0->unk_04->unk_84, 2); ov12_02237E30(v0->unk_04->unk_84, 0); - sub_0200D3CC(v0->unk_04->unk_18, 0); - sub_0200D364(v0->unk_04->unk_18, 1); - sub_0200D390(v0->unk_04->unk_18, 1); + CellActorData_SetAnimFrame(v0->unk_04->unk_18, 0); + CellActorData_SetAnim(v0->unk_04->unk_18, 1); + CellActorData_SetAnimateFlag(v0->unk_04->unk_18, 1); v0->unk_0A = 3; } @@ -2602,7 +2602,7 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) SpriteGfxHandler *v8; v8 = ov16_0223E018(v0->unk_00); - sub_0200D0F4(v0->unk_04->unk_18); + CellActorData_Delete(v0->unk_04->unk_18); v0->unk_04->unk_18 = NULL; SpriteGfxHandler_UnloadCharObjById(v8, 20015 + v0->unk_04->battlerType); @@ -2613,9 +2613,9 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) v0->unk_0A = 6; } } else { - sub_0200D3CC(v0->unk_04->unk_18, 0); - sub_0200D364(v0->unk_04->unk_18, 1); - sub_0200D390(v0->unk_04->unk_18, 1); + CellActorData_SetAnimFrame(v0->unk_04->unk_18, 0); + CellActorData_SetAnim(v0->unk_04->unk_18, 1); + CellActorData_SetAnimateFlag(v0->unk_04->unk_18, 1); v0->unk_0A = 2; } break; @@ -2624,7 +2624,7 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); if (v0->unk_04->unk_84) { - v3 = sub_0200D3E0(v0->unk_04->unk_18); + v3 = CellActorData_GetAnimFrame(v0->unk_04->unk_18); if (v5[v0->unk_0C][v3][0] != 0x7fff) { ov12_02237E0C(v0->unk_04->unk_84, 1); @@ -2656,7 +2656,7 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) v10 = ov16_0223E018(v0->unk_00); - sub_0200D0F4(v0->unk_04->unk_18); + CellActorData_Delete(v0->unk_04->unk_18); v0->unk_04->unk_18 = NULL; SpriteGfxHandler_UnloadCharObjById(v10, 20015 + v0->unk_04->battlerType); @@ -2669,7 +2669,7 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) break; case 3: SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); - v3 = sub_0200D3E0(v0->unk_04->unk_18); + v3 = CellActorData_GetAnimFrame(v0->unk_04->unk_18); if (v3 == 4) { v0->unk_14 = 8; @@ -2745,7 +2745,7 @@ static void ov16_02260284(SysTask *param0, void *param1) SpriteGfxHandler *v3; v3 = ov16_0223E018(v0->unk_00); - sub_0200D0F4(v0->unk_04->unk_18); + CellActorData_Delete(v0->unk_04->unk_18); v0->unk_04->unk_18 = NULL; SpriteGfxHandler_UnloadCharObjById(v3, 20015 + v0->unk_04->battlerType); @@ -2785,7 +2785,7 @@ static void ov16_02260384(SysTask *param0, void *param1) } } - SpriteActor_SetSpritePositionXY(v0->unk_04, v1, v2); + CellActorData_SetPositionXY(v0->unk_04, v1, v2); break; case 1: ClearCommand(v0->unk_00, v0->unk_09, v0->unk_08); @@ -5698,7 +5698,7 @@ void ov16_02263B20(BattlerData *param0, int param1) return; } - SpriteActor_EnableObject(param0->unk_18, param1); + CellActorData_DrawSprite(param0->unk_18, param1); } static Sprite *ov16_02263B30(BattleSystem *param0, UnkStruct_02007768 *param1, ArchivedSprite *param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, SpriteAnimationFrame *param11, UnkFuncPtr_02007C34 *param12) @@ -6287,8 +6287,8 @@ static BOOL ov16_02264650(UnkStruct_ov16_02264650_1 *param0, CellActorData *para break; default: if (((v1 & 0xf00) == 0x100) && (v1 & 0xff)) { - sub_0200D3CC(param0->unk_08, 0); - sub_0200D364(param0->unk_08, (v1 & 0xff) - 1); + CellActorData_SetAnimFrame(param0->unk_08, 0); + CellActorData_SetAnim(param0->unk_08, (v1 & 0xff) - 1); v2 = 1; } diff --git a/src/battle/battle_io_command.c b/src/battle/battle_io_command.c index 2ebe930aa6..c44523bd29 100644 --- a/src/battle/battle_io_command.c +++ b/src/battle/battle_io_command.c @@ -76,8 +76,8 @@ #include "palette.h" #include "party.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_020131EC.h" typedef void (*UnkFuncPtr_ov16_0226F068)(BattleSystem *, BattlerData *); @@ -288,7 +288,7 @@ void ov16_0225C104(BattleSystem *param0, BattlerData *param1, int param2) } if (param1->unk_18) { - sub_0200D0F4(param1->unk_18); + CellActorData_Delete(param1->unk_18); } ov16_022647D8(param1); diff --git a/src/battle/battle_script.c b/src/battle/battle_script.c index fab08a5ee7..87481e1adc 100644 --- a/src/battle/battle_script.c +++ b/src/battle/battle_script.c @@ -63,6 +63,7 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -73,7 +74,6 @@ #include "unk_02005474.h" #include "unk_02006224.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_0201567C.h" @@ -10901,7 +10901,7 @@ static void BattleScript_CatchMonTask(SysTask *param0, void *param1) v18 = BattleSystem_BattlerData(v2->battleSys, v17); if (v18->unk_18) { - sub_0200D0F4(v18->unk_18); + CellActorData_Delete(v18->unk_18); v18->unk_18 = NULL; } } @@ -12221,23 +12221,23 @@ static void BattleScript_LoadPartyLevelUpIcon(BattleSystem *param0, BattleScript v2 = ov16_0223E018(param0); v3 = BattleSystem_PaletteSys(param0); - sub_0200CBDC(v1, v2, 27, 256, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20021); - sub_0200CD7C(v3, 2, v1, v2, 27, 82, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 20016); - sub_0200CE0C(v1, v2, 27, 257, 1, 20013); - sub_0200CE3C(v1, v2, 27, 258, 1, 20013); + SpriteRenderer_LoadCharResObj(v1, v2, 27, 256, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20021); + SpriteRenderer_LoadPalette(v3, 2, v1, v2, 27, 82, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 20016); + SpriteRenderer_LoadCellResObj(v1, v2, 27, 257, 1, 20013); + SpriteRenderer_LoadAnimResObj(v1, v2, 27, 258, 1, 20013); - param1->cellActorData[0] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_0226E6C4); + param1->cellActorData[0] = CellActor_LoadResources(v1, v2, &Unk_ov16_0226E6C4); - sub_0200D330(param1->cellActorData[0]); + CellActorData_UpdateObject(param1->cellActorData[0]); sub_0200D888(v1, v2, 19, Pokemon_IconSpriteIndex(param2), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 20022); - sub_0200CD7C(v3, 2, v1, v2, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 20017); - sub_0200CE0C(v1, v2, 19, PokeIcon64KCellsFileIndex(), 0, 20014); - sub_0200CE3C(v1, v2, 19, PokeIcon64KAnimationFileIndex(), 0, 20014); + SpriteRenderer_LoadPalette(v3, 2, v1, v2, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 20017); + SpriteRenderer_LoadCellResObj(v1, v2, 19, PokeIcon64KCellsFileIndex(), 0, 20014); + SpriteRenderer_LoadAnimResObj(v1, v2, 19, PokeIcon64KAnimationFileIndex(), 0, 20014); - param1->cellActorData[1] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_0226E6F8); + param1->cellActorData[1] = CellActor_LoadResources(v1, v2, &Unk_ov16_0226E6F8); - CellActor_SetExplicitPaletteOffsetAutoAdjust(param1->cellActorData[1]->unk_00, Pokemon_IconPaletteIndex(param2)); - sub_0200D330(param1->cellActorData[1]); + CellActor_SetExplicitPaletteOffsetAutoAdjust(param1->cellActorData[1]->cellActor, Pokemon_IconPaletteIndex(param2)); + CellActorData_UpdateObject(param1->cellActorData[1]); param1->tmpPtr[0] = sub_02012744(1, 5); @@ -12269,7 +12269,7 @@ static void BattleScript_LoadPartyLevelUpIcon(BattleSystem *param0, BattleScript v12.unk_00 = param1->tmpPtr[0]; v12.unk_04 = &v9; v12.unk_08 = sub_0200D9B0(v2); - v12.unk_0C = sub_0200D04C(v2, 20016); + v12.unk_0C = SpriteGfxHandler_GetPaletteProxy(v2, 20016); v12.unk_10 = NULL; v12.unk_14 = v11.unk_04; v12.unk_18 = 176; @@ -12292,8 +12292,8 @@ static void BattleScript_FreePartyLevelUpIcon(BattleSystem *param0, BattleScript v0 = ov16_0223E018(param0); - sub_0200D0F4(param1->cellActorData[0]); - sub_0200D0F4(param1->cellActorData[1]); + CellActorData_Delete(param1->cellActorData[0]); + CellActorData_Delete(param1->cellActorData[1]); sub_02012870(param1->fontOAM); sub_0201EE28(¶m1->spriteMgrAlloc); SpriteGfxHandler_UnloadCharObjById(v0, 20021); diff --git a/src/battle/healthbar.c b/src/battle/healthbar.c index b0cb63b39d..60f5e7e468 100644 --- a/src/battle/healthbar.c +++ b/src/battle/healthbar.c @@ -23,13 +23,13 @@ #include "narc.h" #include "palette.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" #include "unk_0208C098.h" @@ -519,13 +519,13 @@ void Healthbar_LoadResources(SpriteRenderer *renderer, SpriteGfxHandler *gfxHand const SpriteTemplate *template = Healthbar_SpriteTemplate(healthbarType); SpriteRenderer_LoadCharResObjFromOpenNarc(renderer, gfxHandler, narc, template->resources[0], TRUE, NNS_G2D_VRAM_TYPE_2DMAIN, template->resources[0]); - SpriteRenderer_LoadPalette(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_MAIN_PALETTE_RESID); + SpriteRenderer_LoadPaletteFromOpenNarc(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_MAIN_PALETTE_RESID); SpriteRenderer_LoadCellResObjFromOpenNarc(renderer, gfxHandler, narc, template->resources[2], TRUE, template->resources[2]); SpriteRenderer_LoadAnimResObjFromOpenNarc(renderer, gfxHandler, narc, template->resources[3], TRUE, template->resources[3]); - SpriteRenderer_LoadPalette(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_EFFECTS_PALETTE_RESID); + SpriteRenderer_LoadPaletteFromOpenNarc(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_EFFECTS_PALETTE_RESID); if (healthbarType == HEALTHBAR_TYPE_SAFARI_ZONE || healthbarType == HEALTHBAR_TYPE_PAL_PARK) { - SpriteRenderer_LoadPalette(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 81, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_SAFARI_PALETTE_RESID); + SpriteRenderer_LoadPaletteFromOpenNarc(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 81, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_SAFARI_PALETTE_RESID); } } @@ -535,7 +535,7 @@ static void Healthbar_LoadMainPalette(SpriteRenderer *renderer, SpriteGfxHandler if (template != NULL) { SpriteRenderer_LoadCharResObjFromOpenNarc(renderer, handler, narc, template->resources[0], TRUE, NNS_G2D_VRAM_TYPE_2DMAIN, template->resources[0]); - SpriteRenderer_LoadPalette(palette, PLTTBUF_MAIN_OBJ, renderer, handler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_MAIN_PALETTE_RESID); + SpriteRenderer_LoadPaletteFromOpenNarc(palette, PLTTBUF_MAIN_OBJ, renderer, handler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, HEALTHBAR_MAIN_PALETTE_RESID); SpriteRenderer_LoadCellResObjFromOpenNarc(renderer, handler, narc, template->resources[2], TRUE, template->resources[2]); SpriteRenderer_LoadAnimResObjFromOpenNarc(renderer, handler, narc, template->resources[3], TRUE, template->resources[3]); } @@ -544,9 +544,9 @@ static void Healthbar_LoadMainPalette(SpriteRenderer *renderer, SpriteGfxHandler CellActorData *Healthbar_LoadCellActor(SpriteRenderer *renderer, SpriteGfxHandler *handler, int type) { const SpriteTemplate *template = Healthbar_SpriteTemplate(type); - CellActorData *data = SpriteActor_LoadResources(renderer, handler, template); + CellActorData *data = CellActor_LoadResources(renderer, handler, template); - SpriteActor_UpdateObject(data->unk_00); + CellActor_UpdateObject(data->cellActor); return data; } @@ -681,7 +681,7 @@ void ov16_02267220(Healthbar *param0) return; } - sub_0200D0F4(param0->mainActor); + CellActorData_Delete(param0->mainActor); param0->mainActor = NULL; } @@ -691,7 +691,7 @@ static void ov16_02267244(Healthbar *param0) return; } - sub_0200D0F4(param0->arrowActor); + CellActorData_Delete(param0->arrowActor); param0->arrowActor = NULL; } @@ -750,7 +750,7 @@ void ov16_022672C4(Healthbar *param0) Healthbar_LoadMainPalette(v1, v2, v4, v3, param0->type); if (param0->arrowActor != NULL) { - SpriteActor_SetPositionXY(param0->arrowActor->unk_00, v0->x - sArrowOffsetX[param0->type], v0->y + 0); + CellActor_SetPositionXY(param0->arrowActor->cellActor, v0->x - sArrowOffsetX[param0->type], v0->y + 0); } NARC_dtor(v4); @@ -781,7 +781,7 @@ void ov16_0226737C(Healthbar *param0) param0->numberMode ^= 1; v2 = G2_GetOBJCharPtr(); - v1 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v1 = SpriteActor_ImageProxy(param0->mainActor->cellActor); if (param0->numberMode == 1) { v0 = ov16_02268250(70); @@ -886,7 +886,7 @@ s32 ov16_02267560(Healthbar *param0) void ov16_0226757C(Healthbar *param0) { if (param0->arrowActor != NULL) { - CellActor_SetAnimateFlag(param0->arrowActor->unk_00, 1); + CellActor_SetAnimateFlag(param0->arrowActor->cellActor, 1); Healthbar_EnableArrow(param0, 1); } @@ -898,8 +898,8 @@ void ov16_0226757C(Healthbar *param0) void ov16_022675AC(Healthbar *param0) { if (param0->arrowActor != NULL) { - CellActor_SetAnimateFlag(param0->arrowActor->unk_00, 0); - SpriteActor_SetAnimFrame(param0->arrowActor->unk_00, 0); + CellActor_SetAnimateFlag(param0->arrowActor->cellActor, 0); + SpriteActor_SetAnimFrame(param0->arrowActor->cellActor, 0); Healthbar_EnableArrow(param0, 0); } @@ -912,10 +912,10 @@ void ov16_022675D8(Healthbar *param0, int param1) return; } - sub_0200D460(param0->mainActor, param1); + CellActorData_SetExplicitPriority(param0->mainActor, param1); if (param0->arrowActor != NULL) { - sub_0200D460(param0->arrowActor, param1); + CellActorData_SetExplicitPriority(param0->arrowActor, param1); } } @@ -937,7 +937,7 @@ static void Healthbar_EnableArrow(Healthbar *battleSys, BOOL enable) return; } - SpriteActor_EnableObject(battleSys->arrowActor, enable); + CellActorData_DrawSprite(battleSys->arrowActor, enable); } void Healthbar_Enable(Healthbar *battleSys, BOOL enable) @@ -946,7 +946,7 @@ void Healthbar_Enable(Healthbar *battleSys, BOOL enable) return; } - SpriteActor_EnableObject(battleSys->mainActor, enable); + CellActorData_DrawSprite(battleSys->mainActor, enable); Healthbar_EnableArrow(battleSys, enable); } @@ -955,9 +955,9 @@ void Healthbar_OffsetPositionXY(Healthbar *healthbar, int x, int y) GF_ASSERT(healthbar->mainActor != NULL); const SpriteTemplate *template = Healthbar_SpriteTemplate(healthbar->type); - SpriteActor_SetPositionXY(healthbar->mainActor->unk_00, template->x + x, template->y + y); + CellActor_SetPositionXY(healthbar->mainActor->cellActor, template->x + x, template->y + y); if (healthbar->arrowActor != NULL) { - SpriteActor_SetPositionXY(healthbar->arrowActor->unk_00, + CellActor_SetPositionXY(healthbar->arrowActor->cellActor, template->x + x - sArrowOffsetX[healthbar->type], template->y + y + 0); } @@ -1055,9 +1055,9 @@ static void ScrollHealthbarTask(SysTask *task, void *data) } // Update positions of the sprites on the screen - SpriteActor_SetSpritePositionXY(healthbar->mainActor, x, y); + CellActorData_SetPositionXY(healthbar->mainActor, x, y); if (healthbar->arrowActor != NULL) { - SpriteActor_SetSpritePositionXY(healthbar->arrowActor, x - sArrowOffsetX[healthbar->type], y + 0); + CellActorData_SetPositionXY(healthbar->arrowActor, x - sArrowOffsetX[healthbar->type], y + 0); } // If the sprites are now in position, we're done @@ -1104,7 +1104,7 @@ static void Healthbar_DrawBattlerName(Healthbar *healthbar) // copy the window's data into VRAM over the painted healthbar { void *vram = G2_GetOBJCharPtr(); - imgProxy = SpriteActor_ImageProxy(healthbar->mainActor->unk_00); + imgProxy = SpriteActor_ImageProxy(healthbar->mainActor->cellActor); u8 *hiHalf = buf; u8 *loHalf = &buf[HEALTHBAR_NAME_BLOCK_COUNT_X * HEALTHBAR_WINDOW_BLOCK_SIZE]; @@ -1152,7 +1152,7 @@ static void Healthbar_DrawLevelText(Healthbar *param0) void *v5; v5 = G2_GetOBJCharPtr(); - v0 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v0 = SpriteActor_ImageProxy(param0->mainActor->cellActor); MI_CpuCopy16(v2, (void *)((u32)v5 + Unk_ov16_0226F47C[param0->type][0].pos + v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), Unk_ov16_0226F47C[param0->type][0].size); MI_CpuCopy16(v1, (void *)((u32)v5 + Unk_ov16_0226F47C[param0->type][1].pos + v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), Unk_ov16_0226F47C[param0->type][1].size); @@ -1177,7 +1177,7 @@ static void Healthbar_DrawLevelNumber(Healthbar *param0) u8 *v8, *v9; v7 = G2_GetOBJCharPtr(); - v2 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v2 = SpriteActor_ImageProxy(param0->mainActor->cellActor); MI_CpuCopy16((void *)((u32)v7 + Unk_ov16_0226F3EC[param0->type][0].pos + v2->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), v1, Unk_ov16_0226F3EC[param0->type][0].size); MI_CpuCopy16((void *)((u32)v7 + Unk_ov16_0226F3EC[param0->type][1].pos + v2->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), &v1[v3], Unk_ov16_0226F3EC[param0->type][1].size); @@ -1220,7 +1220,7 @@ static void Healthbar_DrawCurrentHP(Healthbar *param0, u32 param1) u8 *v3; v2 = G2_GetOBJCharPtr(); - v1 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v1 = SpriteActor_ImageProxy(param0->mainActor->cellActor); v3 = v0; MI_CpuCopy16(v3, (void *)((u32)v2 + Unk_ov16_0226F41C[param0->type][0].pos + v1->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), Unk_ov16_0226F41C[param0->type][0].size); @@ -1245,7 +1245,7 @@ static void Healthbar_DrawMaxHP(Healthbar *param0) u8 *v3; v2 = G2_GetOBJCharPtr(); - v1 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v1 = SpriteActor_ImageProxy(param0->mainActor->cellActor); v3 = v0; MI_CpuCopy16(v3, (void *)((u32)v2 + Unk_ov16_0226F3BC[param0->type].pos + v1->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), Unk_ov16_0226F3BC[param0->type].size); @@ -1269,7 +1269,7 @@ static void Healthbar_DrawCaughtIcon(Healthbar *param0) void *v2; v2 = G2_GetOBJCharPtr(); - v0 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v0 = SpriteActor_ImageProxy(param0->mainActor->cellActor); MI_CpuCopy16(v1, (void *)((u32)v2 + Unk_ov16_0226F38C[param0->type].pos + v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), Unk_ov16_0226F38C[param0->type].size); } @@ -1286,7 +1286,7 @@ static void Healthbar_DrawStatusIcon(Healthbar *param0, int param1) void *v2; v2 = G2_GetOBJCharPtr(); - v0 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v0 = SpriteActor_ImageProxy(param0->mainActor->cellActor); MI_CpuCopy16(v1, (void *)((u32)v2 + Unk_ov16_0226F35C[param0->type].pos + v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), Unk_ov16_0226F35C[param0->type].size); } @@ -1320,7 +1320,7 @@ static void Healthbar_DrawBallCount(Healthbar *param0, u32 param1) u8 *v7, *v8; v6 = G2_GetOBJCharPtr(); - v2 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v2 = SpriteActor_ImageProxy(param0->mainActor->cellActor); v7 = v1; v8 = &v1[13 * 0x20]; @@ -1368,7 +1368,7 @@ static void Healthbar_DrawBallsLeftMessage(Healthbar *param0, u32 param1) u8 *v9, *v10; v8 = G2_GetOBJCharPtr(); - v2 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v2 = SpriteActor_ImageProxy(param0->mainActor->cellActor); v9 = v1; v10 = &v1[13 * 0x20]; @@ -1429,7 +1429,7 @@ static void DrawGauge(Healthbar *param0, u8 param1) int v9; v7 = G2_GetOBJCharPtr(); - v8 = SpriteActor_ImageProxy(param0->mainActor->unk_00); + v8 = SpriteActor_ImageProxy(param0->mainActor->cellActor); switch (param1) { case 0: @@ -1776,8 +1776,8 @@ static void ov16_02268380(SysTask *param0, void *param1) switch (v0->unk_08) { case 0: - v2 = sub_0200D05C(v1, 20007, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_0200D41C(v0->unk_00->mainActor, v2); + v2 = SpriteGfxHandler_GetPaletteNumberById(v1, 20007, NNS_G2D_VRAM_TYPE_2DMAIN); + CellActorData_SetExplicitPalette(v0->unk_00->mainActor, v2); v0->unk_09 = v2; v0->unk_08++; case 1: @@ -1801,8 +1801,8 @@ static void ov16_02268380(SysTask *param0, void *param1) PaletteData_Blend(v3, 2, v0->unk_09 * 16 + 0, 16, v0->unk_0A, 0x73a5); break; default: - v2 = sub_0200D05C(v1, 20006, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_0200D41C(v0->unk_00->mainActor, v2); + v2 = SpriteGfxHandler_GetPaletteNumberById(v1, 20006, NNS_G2D_VRAM_TYPE_2DMAIN); + CellActorData_SetExplicitPalette(v0->unk_00->mainActor, v2); (*(v0->unk_04)) = 1; diff --git a/src/battle/ov16_0223B140.c b/src/battle/ov16_0223B140.c index aaed2c4ce8..b22b168944 100644 --- a/src/battle/ov16_0223B140.c +++ b/src/battle/ov16_0223B140.c @@ -58,6 +58,7 @@ #include "pokemon.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -69,7 +70,6 @@ #include "unk_0200762C.h" #include "unk_020093B4.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02014000.h" #include "unk_0201567C.h" @@ -318,8 +318,8 @@ void ov16_0223B3E4(BattleSystem *param0) ov16_0223C288(param0->unk_04); ov16_0223C2BC(param0); - sub_0200D0B0(param0->unk_90, param0->unk_94); - sub_0200C8D4(param0->unk_90); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_90, param0->unk_94); + SpriteRenderer_Free(param0->unk_90); VRAMTransferManager_Destroy(); Font_Free(FONT_SUBSCREEN); } @@ -360,7 +360,7 @@ void ov16_0223B430(BattleSystem *param0) NARC_dtor(v1); TextPrinter_SetScrollArrowBaseTile(1); ov16_0223DD4C(param0); - sub_0200964C(sub_0200C738(param0->unk_90), 0, ((192 + 80) << FX32_SHIFT)); + sub_0200964C(SpriteRenderer_GetG2dRenderer(param0->unk_90), 0, ((192 + 80) << FX32_SHIFT)); } void ov16_0223B53C(BattleSystem *param0) @@ -573,17 +573,17 @@ static void ov16_0223B790(OverlayManager *param0) Window_FillTilemap(&v0->windows[0], 0xff); Window_DrawMessageBoxWithScrollCursor(&v0->windows[0], 0, 1, 10); - v0->unk_90 = sub_0200C6E4(5); + v0->unk_90 = SpriteRenderer_Create(5); - sub_0200C73C(v0->unk_90, &Unk_ov16_0226E2E4, &Unk_ov16_0226E29C, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_90, &Unk_ov16_0226E2E4, &Unk_ov16_0226E29C, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_64K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_94 = sub_0200C704(v0->unk_90); + v0->unk_94 = SpriteRenderer_CreateGfxHandler(v0->unk_90); - sub_0200C7C0(v0->unk_90, v0->unk_94, (64 + 64)); - sub_0200CB30(v0->unk_90, v0->unk_94, &Unk_ov16_0226E2B0); - sub_0200964C(sub_0200C738(v0->unk_90), 0, ((192 + 80) << FX32_SHIFT)); + SpriteRenderer_CreateCellActorList(v0->unk_90, v0->unk_94, (64 + 64)); + SpriteRenderer_InitGfxResourceList(v0->unk_90, v0->unk_94, &Unk_ov16_0226E2B0); + sub_0200964C(SpriteRenderer_GetG2dRenderer(v0->unk_90), 0, ((192 + 80) << FX32_SHIFT)); ov16_02268A88(v0->unk_198); @@ -1552,7 +1552,7 @@ static void ov16_0223CF48(SysTask *param0, void *param1) } sub_02007768(v0->unk_88); - sub_0200C7EC(v0->unk_94); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_94); sub_0200C808(); G3_RequestSwapBuffers(GX_SORTMODE_MANUAL, GX_BUFFERMODE_Z); } diff --git a/src/battle/ov16_0223DF00.c b/src/battle/ov16_0223DF00.c index 1aa5d4beef..49d8f9e411 100644 --- a/src/battle/ov16_0223DF00.c +++ b/src/battle/ov16_0223DF00.c @@ -1138,7 +1138,7 @@ void ov16_0223EF8C(BattleSystem *param0) MI_CpuCopy32(PaletteData_GetUnfadedBuffer(param0->unk_28, 0), param0->unk_220, HW_BG_PLTT_SIZE); v7 = G2_GetOBJCharPtr(); - v0 = SpriteActor_ImageProxy(param0->unk_17C[1].unk_00->unk_00); + v0 = SpriteActor_ImageProxy(param0->unk_17C[1].unk_00->cellActor); v7 += v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]; for (v2 = 20; v2 < 20 + 8; v2++) { @@ -1169,7 +1169,7 @@ void ov16_0223EF8C(BattleSystem *param0) } v7 = G2_GetOBJCharPtr(); - v0 = SpriteActor_ImageProxy(param0->unk_17C[0].unk_00->unk_00); + v0 = SpriteActor_ImageProxy(param0->unk_17C[0].unk_00->cellActor); v7 += v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]; for (v6 = 0; v6 < 0x40 * 32; v6++) { diff --git a/src/battle/ov16_02268520.c b/src/battle/ov16_02268520.c index 40838eac57..58a61d2284 100644 --- a/src/battle/ov16_02268520.c +++ b/src/battle/ov16_02268520.c @@ -14,7 +14,7 @@ #include "narc.h" #include "palette.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" static const SpriteTemplate Unk_ov16_022700CC[] = { { @@ -204,7 +204,7 @@ void ov16_02268520(UnkStruct_ov16_02268520 *param0) } SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, v10, v3, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); - SpriteRenderer_LoadPalette(BattleSystem_PaletteSys(param0->unk_04), 2, v0, v1, v10, Unk_ov16_02270134[param0->unk_09][v9], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20009); + SpriteRenderer_LoadPaletteFromOpenNarc(BattleSystem_PaletteSys(param0->unk_04), 2, v0, v1, v10, Unk_ov16_02270134[param0->unk_09][v9], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20009); PaletteData_LoadBufferFromFileStart(BattleSystem_PaletteSys(param0->unk_04), 27, Unk_ov16_02270134[param0->unk_09][v9], 5, 0, 0x20, 0x7 * 0x10); SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, v10, v5, 1, v6); SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, v10, v7, 1, v8); @@ -221,8 +221,8 @@ void ov16_0226862C(UnkStruct_ov16_02268520 *param0) v1 = ov16_0223E018(param0->unk_04); v2 = &Unk_ov16_022700CC[param0->unk_08]; - param0->unk_00 = SpriteActor_LoadResources(v0, v1, v2); - SpriteActor_UpdateObject(param0->unk_00->unk_00); + param0->unk_00 = CellActor_LoadResources(v0, v1, v2); + CellActor_UpdateObject(param0->unk_00->cellActor); } void ov16_02268660(UnkStruct_ov16_02268520 *param0) @@ -231,7 +231,7 @@ void ov16_02268660(UnkStruct_ov16_02268520 *param0) return; } - sub_0200D0F4(param0->unk_00); + CellActorData_Delete(param0->unk_00); param0->unk_00 = NULL; } @@ -264,7 +264,7 @@ void ov16_022686BC(UnkStruct_ov16_02268520 *param0, int param1) return; } - SpriteActor_EnableObject(param0->unk_00, param1); + CellActorData_DrawSprite(param0->unk_00, param1); } void ov16_022686CC(UnkStruct_ov16_02268520 *param0, BattleSystem *param1, u16 param2, int param3) diff --git a/src/battle/ov16_0226871C.c b/src/battle/ov16_0226871C.c index 4442b89ad3..44cec8528c 100644 --- a/src/battle/ov16_0226871C.c +++ b/src/battle/ov16_0226871C.c @@ -47,6 +47,7 @@ #include "pokemon_icon.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -54,7 +55,6 @@ #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_02017728.h" #include "unk_0201D15C.h" @@ -1315,7 +1315,7 @@ void ov16_02268C04(NARC *param0, NARC *param1, UnkStruct_ov16_02268A14 *param2, } } - SpriteRenderer_LoadPalette(BattleSystem_PaletteSys(param2->unk_00), 3, v4, v5, param1, 72, 0, 7, NNS_G2D_VRAM_TYPE_2DSUB, 20023); + SpriteRenderer_LoadPaletteFromOpenNarc(BattleSystem_PaletteSys(param2->unk_00), 3, v4, v5, param1, 72, 0, 7, NNS_G2D_VRAM_TYPE_2DSUB, 20023); param2->unk_66B = param3; G2S_SetBlendAlpha((GX_BLEND_PLANEMASK_BG1), (GX_BLEND_BGALL), 8, 12); @@ -1348,12 +1348,12 @@ void ov16_02268D40(NARC *param0, UnkStruct_ov16_02268A14 *param1) SpriteRenderer_LoadAnimResObjFromOpenNarc(v1, v2, param0, 206, 1, 20016); for (v0 = 0; v0 < 6; v0++) { - param1->unk_5BC[v0] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_02270414); - sub_0200D4D0(param1->unk_5BC[v0]->unk_00, 12 + 19 * v0, 13, ((192 + 80) << FX32_SHIFT)); + param1->unk_5BC[v0] = CellActor_LoadResources(v1, v2, &Unk_ov16_02270414); + CellActor_SetPositionWithOffsetXY(param1->unk_5BC[v0]->cellActor, 12 + 19 * v0, 13, ((192 + 80) << FX32_SHIFT)); sub_0200D6A4(param1->unk_5BC[v0], 1); - param1->unk_5D4[v0] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_02270448); - sub_0200D4D0(param1->unk_5D4[v0]->unk_00, 246 + -12 * v0, 9, ((192 + 80) << FX32_SHIFT)); + param1->unk_5D4[v0] = CellActor_LoadResources(v1, v2, &Unk_ov16_02270448); + CellActor_SetPositionWithOffsetXY(param1->unk_5D4[v0]->cellActor, 246 + -12 * v0, 9, ((192 + 80) << FX32_SHIFT)); } ov16_02269218(param1); @@ -1390,10 +1390,10 @@ static void ov16_02268F00(UnkStruct_ov16_02268A14 *param0) SpriteGfxHandler_UnloadPlttObjById(v2, 20023); for (v0 = 0; v0 < 6; v0++) { - sub_0200D0F4(param0->unk_5BC[v0]); + CellActorData_Delete(param0->unk_5BC[v0]); param0->unk_5BC[v0] = NULL; - sub_0200D0F4(param0->unk_5D4[v0]); + CellActorData_Delete(param0->unk_5D4[v0]); param0->unk_5D4[v0] = NULL; } @@ -1416,7 +1416,7 @@ static void ov16_02268FCC(SysTask *param0, void *param1) switch (v2->unk_03) { case 0: default: - if (sub_0200D400(v0->unk_5BC[v1]->unk_00) == 0) { + if (thunk_CellActor_GetDrawFlag(v0->unk_5BC[v1]->cellActor) == 0) { break; } @@ -1506,13 +1506,13 @@ void ov16_02269168(UnkStruct_ov16_02268A14 *param0, u8 param1[], u8 param2[]) for (v0 = 0; v0 < 6; v0++) { v1 = ov16_0226A934(param1[v0]); - CellActor_SetAnim(param0->unk_5BC[v0]->unk_00, v1); - SpriteActor_UpdateObject(param0->unk_5BC[v0]->unk_00); + CellActor_SetAnim(param0->unk_5BC[v0]->cellActor, v1); + CellActor_UpdateObject(param0->unk_5BC[v0]->cellActor); v1 = ov16_0226A934(param2[v0]); - CellActor_SetAnim(param0->unk_5D4[v0]->unk_00, v1); - SpriteActor_UpdateObject(param0->unk_5D4[v0]->unk_00); + CellActor_SetAnim(param0->unk_5D4[v0]->cellActor, v1); + CellActor_UpdateObject(param0->unk_5D4[v0]->cellActor); } } @@ -1523,12 +1523,12 @@ void ov16_022691BC(UnkStruct_ov16_02268A14 *param0) GF_ASSERT(param0->unk_5BC[0] != NULL && param0->unk_5D4[0] != NULL); for (v0 = 0; v0 < 6; v0++) { - SpriteActor_DrawSprite(param0->unk_5BC[v0]->unk_00, 1); + CellActor_DrawSprite(param0->unk_5BC[v0]->cellActor, 1); } if (BattleSystem_BattleType(param0->unk_00) & 0x1) { for (v0 = 0; v0 < 6; v0++) { - SpriteActor_DrawSprite(param0->unk_5D4[v0]->unk_00, 1); + CellActor_DrawSprite(param0->unk_5D4[v0]->cellActor, 1); } } } @@ -1540,8 +1540,8 @@ void ov16_02269218(UnkStruct_ov16_02268A14 *param0) GF_ASSERT(param0->unk_5BC[0] != NULL && param0->unk_5D4[0] != NULL); for (v0 = 0; v0 < 6; v0++) { - SpriteActor_DrawSprite(param0->unk_5BC[v0]->unk_00, 0); - SpriteActor_DrawSprite(param0->unk_5D4[v0]->unk_00, 0); + CellActor_DrawSprite(param0->unk_5BC[v0]->cellActor, 0); + CellActor_DrawSprite(param0->unk_5D4[v0]->cellActor, 0); } } @@ -2438,9 +2438,9 @@ static void ov16_0226A698(UnkStruct_ov16_02268A14 *param0) v1 = ov16_0223E018(param0->unk_00); v5 = BattleSystem_PaletteSys(param0->unk_00); - sub_0200CD7C(v5, 3, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 20022); - sub_0200CE0C(v0, v1, 19, PokeIcon32KCellsFileIndex(), 0, 20021); - sub_0200CE3C(v0, v1, 19, PokeIcon32KAnimationFileIndex(), 0, 20021); + SpriteRenderer_LoadPalette(v5, 3, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 20022); + SpriteRenderer_LoadCellResObj(v0, v1, 19, PokeIcon32KCellsFileIndex(), 0, 20021); + SpriteRenderer_LoadAnimResObj(v0, v1, 19, PokeIcon32KAnimationFileIndex(), 0, 20021); } static void ov16_0226A718(UnkStruct_ov16_02268A14 *param0) @@ -2463,7 +2463,7 @@ static void ov16_0226A768(UnkStruct_ov16_02268A14 *param0) for (v0 = 0; v0 < 4; v0++) { if (param0->unk_60C[v0] != NULL) { - sub_0200D0F4(param0->unk_60C[v0]); + CellActorData_Delete(param0->unk_60C[v0]); param0->unk_60C[v0] = NULL; } @@ -2512,16 +2512,16 @@ static CellActorData *ov16_0226A7A4(UnkStruct_ov16_02268A14 *param0, Pokemon *pa v0 = ov16_0223E010(param0->unk_00); v1 = ov16_0223E018(param0->unk_00); - sub_0200CBDC(v0, v1, 19, Pokemon_IconSpriteIndex(param1), 0, NNS_G2D_VRAM_TYPE_2DSUB, v2); + SpriteRenderer_LoadCharResObj(v0, v1, 19, Pokemon_IconSpriteIndex(param1), 0, NNS_G2D_VRAM_TYPE_2DSUB, v2); v3 = Unk_ov16_022704B0; v3.resources[0] = v2; v3.x = Unk_ov16_02270304[v5][0]; v3.y = Unk_ov16_02270304[v5][1]; - v4 = SpriteActor_LoadResources(v0, v1, &v3); + v4 = CellActor_LoadResources(v0, v1, &v3); sub_0200D500(v4, v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); - CellActor_SetExplicitPaletteOffsetAutoAdjust(v4->unk_00, Pokemon_IconPaletteIndex(param1)); + CellActor_SetExplicitPaletteOffsetAutoAdjust(v4->cellActor, Pokemon_IconPaletteIndex(param1)); { int v6 = 0; @@ -2546,11 +2546,11 @@ static CellActorData *ov16_0226A7A4(UnkStruct_ov16_02268A14 *param0, Pokemon *pa break; } - sub_0200D364(v4, v6); + CellActorData_SetAnim(v4, v6); } } - sub_0200D330(v4); + CellActorData_UpdateObject(v4); param0->unk_60C[v5] = v4; param0->unk_61C[v5] = SysTask_Start(ov16_0226A928, v4, 1300); @@ -2561,7 +2561,7 @@ static CellActorData *ov16_0226A7A4(UnkStruct_ov16_02268A14 *param0, Pokemon *pa static void ov16_0226A928(SysTask *param0, void *param1) { CellActorData *v0 = param1; - sub_0200D330(v0); + CellActorData_UpdateObject(v0); } static int ov16_0226A934(u8 param0) @@ -2645,7 +2645,7 @@ static void ov16_0226A98C(UnkStruct_ov16_02268A14 *param0, UnkStruct_ov16_0226A9 v0.unk_00 = param0->unk_4C8; v0.unk_04 = &v1; v0.unk_08 = sub_0200D9B0(v6); - v0.unk_0C = sub_0200D04C(v6, param6); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; v0.unk_18 = param7; @@ -2888,7 +2888,7 @@ static void ov16_0226AF0C(UnkStruct_ov16_02268A14 *param0) NNSG2dImageProxy *v9; v8 = G2S_GetOBJCharPtr(); - v9 = SpriteActor_ImageProxy(param0->unk_5EC[v0]->unk_00); + v9 = SpriteActor_ImageProxy(param0->unk_5EC[v0]->cellActor); MI_CpuCopy16(v7->unk_18[v0], (void *)((u32)v8 + v9->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DSUB]), sub_0208C098(6)); } @@ -3338,10 +3338,10 @@ static void ov16_0226B4E0(SysTask *param0, void *param1) sub_020128C4(v0->unk_4CC[v6].unk_00, v2, v3 + -2); if (v9 != 0) { - sub_0200D5AC(v0->unk_5EC[v7]->unk_00, 0, -2); + sub_0200D5AC(v0->unk_5EC[v7]->cellActor, 0, -2); if (v0->unk_5FC[v7] != NULL) { - sub_0200D5AC(v0->unk_5FC[v7]->unk_00, 0, -2); + sub_0200D5AC(v0->unk_5FC[v7]->cellActor, 0, -2); } } } else { @@ -3372,10 +3372,10 @@ static void ov16_0226B4E0(SysTask *param0, void *param1) sub_020128C4(v0->unk_4CC[v6].unk_00, v2, v3 + 1); if (v9 != 0) { - sub_0200D5AC(v0->unk_5EC[v7]->unk_00, 0, 1); + sub_0200D5AC(v0->unk_5EC[v7]->cellActor, 0, 1); if (v0->unk_5FC[v7] != NULL) { - sub_0200D5AC(v0->unk_5FC[v7]->unk_00, 0, 1); + sub_0200D5AC(v0->unk_5FC[v7]->cellActor, 0, 1); } } } else { diff --git a/src/battle/ov16_0226DB7C.c b/src/battle/ov16_0226DB7C.c index 2cc54a0c4f..04fcdd3e19 100644 --- a/src/battle/ov16_0226DB7C.c +++ b/src/battle/ov16_0226DB7C.c @@ -11,9 +11,9 @@ #include "heap.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" -#include "unk_0200C6E4.h" typedef struct UnkStruct_ov16_0226DC24_t { CellActorData *unk_00[5]; @@ -47,7 +47,7 @@ void ov16_0226DB7C(SpriteRenderer *param0, SpriteGfxHandler *param1, PaletteData v0 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param3); - SpriteRenderer_LoadPalette(param2, 3, param0, param1, v0, 80, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); + SpriteRenderer_LoadPaletteFromOpenNarc(param2, 3, param0, param1, v0, 80, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, v0, 250, 1, NNS_G2D_VRAM_TYPE_2DSUB, param4); SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, v0, 251, 1, param6); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, v0, 252, 1, param7); @@ -80,8 +80,8 @@ UnkStruct_ov16_0226DC24 *ov16_0226DC24(SpriteRenderer *param0, SpriteGfxHandler MI_CpuClear8(v0, sizeof(UnkStruct_ov16_0226DC24)); for (v2 = 0; v2 < 5; v2++) { - v0->unk_00[v2] = SpriteActor_LoadResources(param0, param1, &v1); - SpriteActor_EnableObject(v0->unk_00[v2], 0); + v0->unk_00[v2] = CellActor_LoadResources(param0, param1, &v1); + CellActorData_DrawSprite(v0->unk_00[v2], 0); } v0->unk_14 = SysTask_Start(ov16_0226DE10, v0, 40000); @@ -93,7 +93,7 @@ void ov16_0226DCA8(UnkStruct_ov16_0226DC24 *param0) int v0; for (v0 = 0; v0 < 5; v0++) { - sub_0200D0F4(param0->unk_00[v0]); + CellActorData_Delete(param0->unk_00[v0]); } SysTask_Done(param0->unk_14); @@ -109,13 +109,13 @@ void ov16_0226DCCC(UnkStruct_ov16_0226DC24 *param0, int param1, int param2, int sub_0200D500(param0->unk_00[2], param5, param6, param9); sub_0200D500(param0->unk_00[3], param7, param8, param9); - sub_0200D364(param0->unk_00[0], 0); - sub_0200D364(param0->unk_00[1], 1); - sub_0200D364(param0->unk_00[2], 2); - sub_0200D364(param0->unk_00[3], 3); + CellActorData_SetAnim(param0->unk_00[0], 0); + CellActorData_SetAnim(param0->unk_00[1], 1); + CellActorData_SetAnim(param0->unk_00[2], 2); + CellActorData_SetAnim(param0->unk_00[3], 3); for (v0 = 0; v0 < 4; v0++) { - SpriteActor_EnableObject(param0->unk_00[v0], 1); + CellActorData_DrawSprite(param0->unk_00[v0], 1); } } @@ -137,8 +137,8 @@ void ov16_0226DD9C(UnkStruct_ov16_0226DC24 *param0, int param1, int param2, int void ov16_0226DDC0(UnkStruct_ov16_0226DC24 *param0, int param1, int param2, int param3, fx32 param4) { sub_0200D500(param0->unk_00[4], param1, param2, param4); - sub_0200D364(param0->unk_00[4], param3); - SpriteActor_EnableObject(param0->unk_00[4], 1); + CellActorData_SetAnim(param0->unk_00[4], param3); + CellActorData_DrawSprite(param0->unk_00[4], 1); } void ov16_0226DDE8(UnkStruct_ov16_0226DC24 *param0) @@ -146,13 +146,13 @@ void ov16_0226DDE8(UnkStruct_ov16_0226DC24 *param0) int v0; for (v0 = 0; v0 < 5; v0++) { - SpriteActor_EnableObject(param0->unk_00[v0], 0); + CellActorData_DrawSprite(param0->unk_00[v0], 0); } } void ov16_0226DE04(UnkStruct_ov16_0226DC24 *param0) { - SpriteActor_EnableObject(param0->unk_00[4], 0); + CellActorData_DrawSprite(param0->unk_00[4], 0); } static void ov16_0226DE10(SysTask *param0, void *param1) @@ -160,15 +160,15 @@ static void ov16_0226DE10(SysTask *param0, void *param1) UnkStruct_ov16_0226DC24 *v0 = param1; int v1; - if (sub_0200D408(v0->unk_00[0]) == 0) { + if (CellActorData_GetDrawFlag(v0->unk_00[0]) == 0) { return; } for (v1 = 0; v1 < 4; v1++) { - sub_0200D330(v0->unk_00[v1]); + CellActorData_UpdateObject(v0->unk_00[v1]); } - if (sub_0200D408(v0->unk_00[4]) == 1) { - sub_0200D330(v0->unk_00[4]); + if (CellActorData_GetDrawFlag(v0->unk_00[4]) == 1) { + CellActorData_UpdateObject(v0->unk_00[4]); } } diff --git a/src/battle/ov16_0226DE44.c b/src/battle/ov16_0226DE44.c index 58d33b8a8d..2e1f8137f1 100644 --- a/src/battle/ov16_0226DE44.c +++ b/src/battle/ov16_0226DE44.c @@ -11,9 +11,9 @@ #include "heap.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct UnkStruct_ov16_0226DEEC_t { @@ -57,7 +57,7 @@ void ov16_0226DE44(SpriteRenderer *param0, SpriteGfxHandler *param1, u32 param2, { NARC *v0 = NARC_ctor(NARC_INDEX_GRAPHIC__EV_POKESELECT, param2); - SpriteRenderer_LoadPalette(param3, 3, param0, param1, v0, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); + SpriteRenderer_LoadPaletteFromOpenNarc(param3, 3, param0, param1, v0, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, v0, 10, 0, NNS_G2D_VRAM_TYPE_2DSUB, param4); SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, v0, 12, 0, param6); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, v0, 13, 0, param7); @@ -89,8 +89,8 @@ UnkStruct_ov16_0226DEEC *ov16_0226DEEC(SpriteRenderer *param0, SpriteGfxHandler v0 = Heap_AllocFromHeap(param2, sizeof(UnkStruct_ov16_0226DEEC)); MI_CpuClear8(v0, sizeof(UnkStruct_ov16_0226DEEC)); - v0->unk_00 = SpriteActor_LoadResources(param0, param1, &v1); - SpriteActor_EnableObject(v0->unk_00, 0); + v0->unk_00 = CellActor_LoadResources(param0, param1, &v1); + CellActorData_DrawSprite(v0->unk_00, 0); v0->unk_14 = (192 << FX32_SHIFT); v0->unk_04 = SysTask_Start(ov16_0226DFD8, v0, 999); @@ -100,7 +100,7 @@ UnkStruct_ov16_0226DEEC *ov16_0226DEEC(SpriteRenderer *param0, SpriteGfxHandler void ov16_0226DF68(UnkStruct_ov16_0226DEEC *param0) { - sub_0200D0F4(param0->unk_00); + CellActorData_Delete(param0->unk_00); SysTask_Done(param0->unk_04); Heap_FreeToHeap(param0); } @@ -114,7 +114,7 @@ void ov16_0226DF80(UnkStruct_ov16_0226DEEC *param0, int param1, int param2, fx32 param0->unk_14 = param3; sub_0200D500(param0->unk_00, param1, param2, param3); - SpriteActor_EnableObject(param0->unk_00, 1); + CellActorData_DrawSprite(param0->unk_00, 1); } void ov16_0226DFB0(UnkStruct_ov16_0226DEEC *param0, int param1, int param2) @@ -124,7 +124,7 @@ void ov16_0226DFB0(UnkStruct_ov16_0226DEEC *param0, int param1, int param2) void ov16_0226DFBC(UnkStruct_ov16_0226DEEC *param0) { - SpriteActor_EnableObject(param0->unk_00, 0); + CellActorData_DrawSprite(param0->unk_00, 0); ov16_0226E13C(param0); } @@ -154,7 +154,7 @@ static void ov16_0226DFD8(SysTask *param0, void *param1) } } - if (sub_0200D408(v0->unk_00) == 0) { + if (CellActorData_GetDrawFlag(v0->unk_00) == 0) { return; } @@ -216,7 +216,7 @@ static void ov16_0226DFD8(SysTask *param0, void *param1) } } - sub_0200D330(v0->unk_00); + CellActorData_UpdateObject(v0->unk_00); } static void ov16_0226E13C(UnkStruct_ov16_0226DEEC *param0) diff --git a/src/battle/party_gauge.c b/src/battle/party_gauge.c index e8a1a7bef6..6a27b3f45b 100644 --- a/src/battle/party_gauge.c +++ b/src/battle/party_gauge.c @@ -20,10 +20,10 @@ #include "heap.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" typedef struct { CellActorData *cells; @@ -206,7 +206,7 @@ void PartyGauge_LoadGraphics(SpriteRenderer *renderer, SpriteGfxHandler *gfxHand { NARC *narc = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, HEAP_ID_BATTLE); - SpriteRenderer_LoadPalette(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, PARTY_GAUGE_NCLR, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, PARTY_GAUGE_PLTT_RES_ID); + SpriteRenderer_LoadPaletteFromOpenNarc(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, PARTY_GAUGE_NCLR, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, PARTY_GAUGE_PLTT_RES_ID); SpriteRenderer_LoadCharResObjFromOpenNarc(renderer, gfxHandler, narc, PARTY_GAUGE_NCGR_BIN, TRUE, NNS_G2D_VRAM_TYPE_2DMAIN, PARTY_GAUGE_CHAR_RES_ID); SpriteRenderer_LoadCellResObjFromOpenNarc(renderer, gfxHandler, narc, PARTY_GAUGE_NCER_BIN, TRUE, PARTY_GAUGE_CELL_RES_ID); SpriteRenderer_LoadAnimResObjFromOpenNarc(renderer, gfxHandler, narc, PARTY_GAUGE_NANR_BIN, TRUE, PARTY_GAUGE_ANIM_RES_ID); @@ -296,10 +296,10 @@ BOOL PartyGauge_HideIsDone(PartyGauge *gauge) void PartyGauge_Free(PartyGauge *gauge) { - sub_0200D0F4(gauge->arrow.cells); + CellActorData_Delete(gauge->arrow.cells); for (int i = 0; i < MAX_PARTY_SIZE; i++) { - sub_0200D0F4(gauge->pokeballs[i].cells); + CellActorData_Delete(gauge->pokeballs[i].cells); } FreePartyGauge(gauge); @@ -316,17 +316,17 @@ static void ShowArrow(PartyGaugeArrow *arrow, enum PartyGaugeSide side, enum Par GF_ASSERT(arrow->cells == NULL && arrow->task == NULL); MI_CpuClear8(arrow, sizeof(PartyGaugeArrow)); - arrow->cells = SpriteActor_LoadResources(renderer, gfxHandler, &sArrowTemplate); + arrow->cells = CellActor_LoadResources(renderer, gfxHandler, &sArrowTemplate); if (side == PARTY_GAUGE_OURS) { - SpriteActor_SetSpritePositionXY(arrow->cells, ARROW_X_START_OURS, sArrowYPosOurs[pos]); - CellActor_SetAnim(arrow->cells->unk_00, PGANM_ARROW_OURS); + CellActorData_SetPositionXY(arrow->cells, ARROW_X_START_OURS, sArrowYPosOurs[pos]); + CellActor_SetAnim(arrow->cells->cellActor, PGANM_ARROW_OURS); } else { - SpriteActor_SetSpritePositionXY(arrow->cells, ARROW_X_START_THEIRS, sArrowYPosTheirs[pos]); - CellActor_SetAnim(arrow->cells->unk_00, PGANM_ARROW_THEIRS); + CellActorData_SetPositionXY(arrow->cells, ARROW_X_START_THEIRS, sArrowYPosTheirs[pos]); + CellActor_SetAnim(arrow->cells->cellActor, PGANM_ARROW_THEIRS); } - SpriteActor_UpdateObject(arrow->cells->unk_00); + CellActor_UpdateObject(arrow->cells->cellActor); arrow->side = side; arrow->position = pos; @@ -356,7 +356,7 @@ static void ShowArrowTask(SysTask *task, void *data) arrow->state++; } - SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosOurs[arrow->position]); + CellActorData_SetPositionXY(arrow->cells, arrow->x >> 8, sArrowYPosOurs[arrow->position]); } else { arrow->x += ARROW_IN_SPEED; if (arrow->x >= ARROW_X_END_THEIRS << 8) { @@ -364,7 +364,7 @@ static void ShowArrowTask(SysTask *task, void *data) arrow->state++; } - SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosTheirs[arrow->position]); + CellActorData_SetPositionXY(arrow->cells, arrow->x >> 8, sArrowYPosTheirs[arrow->position]); } break; @@ -426,10 +426,10 @@ static void HideArrowTask(SysTask *task, void *data) if (arrow->hideType == HIDE_ARROW_FADE_AND_SCROLL) { if (arrow->side == PARTY_GAUGE_OURS) { arrow->x -= ARROW_OUT_SPEED; - SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosOurs[arrow->position]); + CellActorData_SetPositionXY(arrow->cells, arrow->x >> 8, sArrowYPosOurs[arrow->position]); } else { arrow->x += ARROW_OUT_SPEED; - SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosTheirs[arrow->position]); + CellActorData_SetPositionXY(arrow->cells, arrow->x >> 8, sArrowYPosTheirs[arrow->position]); } } @@ -437,7 +437,7 @@ static void HideArrowTask(SysTask *task, void *data) if (arrow->alpha <= 0) { arrow->alpha = 0; - SpriteActor_DrawSprite(arrow->cells->unk_00, 0); + CellActor_DrawSprite(arrow->cells->cellActor, 0); arrow->state++; } @@ -467,16 +467,16 @@ static void ShowPokeballs(PartyGaugePokeballs *pokeballs, s8 *numBalls, enum Par GF_ASSERT(pokeballs->cells == NULL && pokeballs->task == NULL); MI_CpuClear8(pokeballs, sizeof(PartyGaugePokeballs)); - pokeballs->cells = SpriteActor_LoadResources(renderer, gfxHandler, &sPokeballTemplate); + pokeballs->cells = CellActor_LoadResources(renderer, gfxHandler, &sPokeballTemplate); if (side == PARTY_GAUGE_OURS) { - SpriteActor_SetSpritePositionXY(pokeballs->cells, POKEBALL_X_START_OURS, sPokeballYPosOurs[pos]); + CellActorData_SetPositionXY(pokeballs->cells, POKEBALL_X_START_OURS, sPokeballYPosOurs[pos]); } else { - SpriteActor_SetSpritePositionXY(pokeballs->cells, POKEBALL_X_START_THEIRS, sPokeballYPosTheirs[pos]); + CellActorData_SetPositionXY(pokeballs->cells, POKEBALL_X_START_THEIRS, sPokeballYPosTheirs[pos]); } - CellActor_SetAnim(pokeballs->cells->unk_00, frame); - SpriteActor_UpdateObject(pokeballs->cells->unk_00); + CellActor_SetAnim(pokeballs->cells->cellActor, frame); + CellActor_UpdateObject(pokeballs->cells->cellActor); pokeballs->side = side; pokeballs->ballSlot = slot; @@ -534,7 +534,7 @@ static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) pokeballs->state++; } - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); } else { pokeballs->xStart += POKEBALL_IN_SPEED; @@ -543,10 +543,10 @@ static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) pokeballs->state++; } - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); } - SpriteActor_UpdateObject(pokeballs->cells->unk_00); + CellActor_UpdateObject(pokeballs->cells->cellActor); break; case SHOW_POKEBALLS_INCREMENT: @@ -555,14 +555,14 @@ static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) // fall-through case SHOW_POKEBALLS_SET_FRAME: if (*(pokeballs->pokeballCount) != 6) { - SpriteActor_UpdateObject(pokeballs->cells->unk_00); + CellActor_UpdateObject(pokeballs->cells->cellActor); break; } if (pokeballs->side == PARTY_GAUGE_OURS) { - SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 1); + SpriteActor_SetAnimFrame(pokeballs->cells->cellActor, 1); } else { - SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 1); + SpriteActor_SetAnimFrame(pokeballs->cells->cellActor, 1); } pokeballs->delay = 0; @@ -575,7 +575,7 @@ static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) break; } - CellActor_SetAnim(pokeballs->cells->unk_00, pokeballs->flipAnimation); + CellActor_SetAnim(pokeballs->cells->cellActor, pokeballs->flipAnimation); pokeballs->delay = 0; pokeballs->state++; // fall-through @@ -588,7 +588,7 @@ static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) pokeballs->state++; } - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); } else { pokeballs->xStart -= POKEBALL_IN_SPEED_SLOW; @@ -597,14 +597,14 @@ static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) pokeballs->state++; } - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); } - SpriteActor_UpdateObject(pokeballs->cells->unk_00); + CellActor_UpdateObject(pokeballs->cells->cellActor); break; default: - SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 0); + SpriteActor_SetAnimFrame(pokeballs->cells->cellActor, 0); SysTask_Done(task); pokeballs->task = NULL; } @@ -620,7 +620,7 @@ static void ShowPokeballsMidBattleTask(SysTask *task, void *data) SpriteActor_GetSpritePositionXY(pokeballs->cells, &x, &y); pokeballs->xStart = x << 8; - SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 0); + SpriteActor_SetAnimFrame(pokeballs->cells->cellActor, 0); pokeballs->state++; // fall-through case SHOW_POKEBALLS_DELAY: @@ -638,7 +638,7 @@ static void ShowPokeballsMidBattleTask(SysTask *task, void *data) pokeballs->state++; } - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); } else { pokeballs->xStart += POKEBALL_IN_SPEED; @@ -647,7 +647,7 @@ static void ShowPokeballsMidBattleTask(SysTask *task, void *data) pokeballs->state++; } - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); } break; @@ -717,10 +717,10 @@ static void HidePokeballsStartOfBattleTask(SysTask *task, void *data) case HIDE_POKEBALLS_FADE: if (pokeballs->side == PARTY_GAUGE_OURS) { pokeballs->xStart -= POKEBALL_OUT_SPEED; - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); } else { pokeballs->xStart += POKEBALL_OUT_SPEED; - SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + CellActorData_SetPositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); } // Need some more documentation on this one @@ -728,12 +728,12 @@ static void HidePokeballsStartOfBattleTask(SysTask *task, void *data) pokeballs->state++; } - SpriteActor_UpdateObject(pokeballs->cells->unk_00); + CellActor_UpdateObject(pokeballs->cells->cellActor); break; case HIDE_POKEBALLS_BREAK: default: - SpriteActor_DrawSprite(pokeballs->cells->unk_00, 0); + CellActor_DrawSprite(pokeballs->cells->cellActor, 0); SysTask_Done(task); pokeballs->task = NULL; } @@ -758,7 +758,7 @@ static void HidePokeballsMidBattleTask(SysTask *task, void *data) case HIDE_POKEBALLS_BREAK: default: - SpriteActor_DrawSprite(pokeballs->cells->unk_00, 0); + CellActor_DrawSprite(pokeballs->cells->cellActor, 0); SysTask_Done(task); pokeballs->task = NULL; } diff --git a/src/choose_starter/choose_starter_app.c b/src/choose_starter/choose_starter_app.c index 5f80590b69..360a1002e5 100644 --- a/src/choose_starter/choose_starter_app.c +++ b/src/choose_starter/choose_starter_app.c @@ -16,7 +16,6 @@ #include "struct_decls/struct_02015214_decl.h" #include "struct_defs/archived_sprite.h" #include "struct_defs/choose_starter_data.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02099F80.h" #include "overlay021/struct_ov21_021E7F40.h" @@ -42,6 +41,7 @@ #include "pokemon.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "sys_task.h" @@ -208,7 +208,7 @@ typedef struct ChooseStarterApp { Strbuf *unk_AC; WindowTemplate unk_B0; Menu *unk_B8; - UnkStruct_0200C738 unk_BC; + GF_G2dRenderer unk_BC; CellActorCollection *unk_248; SpriteResourceCollection *unk_24C[6]; UnkStruct_02007768 *spriteManager; diff --git a/src/field_menu.c b/src/field_menu.c index 27cd47aadd..d8a8314b7a 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -57,6 +57,7 @@ #include "save_player.h" #include "savedata.h" #include "script_manager.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" @@ -65,7 +66,6 @@ #include "trainer_info.h" #include "unk_020041CC.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02014A84.h" #include "unk_0202631C.h" @@ -735,12 +735,12 @@ static BOOL FieldMenu_Select(FieldTask *taskMan) menu->unk_28 = Menu_GetCursorPos(menu->unk_20); if (v2 != menu->unk_28) { - sub_0203B558(menu->unk_200[0]->unk_00, menu->unk_28); + sub_0203B558(menu->unk_200[0]->cellActor, menu->unk_28); sub_0203B5B4(menu, v2, menu->unk_28); fieldSystem->unk_90 = menu->unk_30[menu->unk_28]; } - sub_0203B5E8(menu->unk_200[1 + menu->unk_28]->unk_00); + sub_0203B5E8(menu->unk_200[1 + menu->unk_28]->cellActor); switch (menu->unk_2C) { case 0xffffffff: @@ -792,7 +792,7 @@ static void sub_0203B318(FieldMenu *menu, u8 *param1, u32 param2, u8 param3) menu->unk_200[0] = ov5_021D3584(&menu->unk_38, &Unk_020EA0A4[0]); - sub_0203B558(menu->unk_200[0]->unk_00, menu->unk_28); + sub_0203B558(menu->unk_200[0]->cellActor, menu->unk_28); ov5_021D3374(&menu->unk_38, v2, 4, 0, 13529); ov5_021D339C(&menu->unk_38, v2, 3, 0, 13529); @@ -814,11 +814,11 @@ static void sub_0203B318(FieldMenu *menu, u8 *param1, u32 param2, u8 param3) { VecFx32 v4 = { FX32_ONE, FX32_ONE, FX32_ONE }; - CellActor_SetAffineScaleEx(menu->unk_200[1 + i]->unk_00, &v4, 1); + CellActor_SetAffineScaleEx(menu->unk_200[1 + i]->cellActor, &v4, 1); } } - sub_0203B588(menu->unk_200[1 + menu->unk_28]->unk_00, 2, 1); + sub_0203B588(menu->unk_200[1 + menu->unk_28]->cellActor, 2, 1); menu->unk_220 = param2 + 1; @@ -831,7 +831,7 @@ static void sub_0203B4E8(FieldMenu *menu) u16 v0; for (v0 = 0; v0 < menu->unk_220; v0++) { - sub_0200D0F4(menu->unk_200[v0]); + CellActorData_Delete(menu->unk_200[v0]); } ov5_021D375C(&menu->unk_38); @@ -842,7 +842,7 @@ static void sub_0203B520(FieldMenu *menu) u16 v0; for (v0 = 0; v0 < menu->unk_220; v0++) { - CellActor_UpdateAnim(menu->unk_200[v0]->unk_00, FX32_ONE); + CellActor_UpdateAnim(menu->unk_200[v0]->cellActor, FX32_ONE); } } @@ -866,8 +866,8 @@ static void sub_0203B588(CellActor *graphicElement, u16 param1, u16 param2) static void sub_0203B5B4(FieldMenu *menu, u16 param1, u16 param2) { - sub_0203B588(menu->unk_200[1 + param1]->unk_00, 0, 0); - sub_0203B588(menu->unk_200[1 + param2]->unk_00, 1, 1); + sub_0203B588(menu->unk_200[1 + param1]->cellActor, 0, 0); + sub_0203B588(menu->unk_200[1 + param2]->cellActor, 1, 1); } static void sub_0203B5E8(CellActor *graphicElement) diff --git a/src/meson.build b/src/meson.build index e89329c1f4..38e83b957e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -38,7 +38,7 @@ pokeplatinum_c = files( 'message_util.c', 'string_template.c', 'unk_0200C440.c', - 'unk_0200C6E4.c', + 'sprite_renderer.c', 'sys_task.c', 'render_window.c', 'unk_0200F174.c', diff --git a/src/overlay005/ov5_021D2F14.c b/src/overlay005/ov5_021D2F14.c index 7cf7a6d83f..5f5b94d098 100644 --- a/src/overlay005/ov5_021D2F14.c +++ b/src/overlay005/ov5_021D2F14.c @@ -4,7 +4,6 @@ #include #include "struct_defs/sprite_template.h" -#include "struct_defs/struct_02009508.h" #include "struct_defs/struct_0200D0F4.h" #include "overlay005/struct_ov5_021D30A8.h" @@ -14,6 +13,7 @@ #include "cell_actor.h" #include "heap.h" #include "narc.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_020093B4.h" #include "unk_0200A328.h" @@ -105,7 +105,7 @@ CellActor *ov5_021D3104(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224 v3.z = param1->unk_08 * FX32_ONE; v0.collection = param0->unk_00; - v0.resourceData = ¶m0->unk_190->unk_00[param1->unk_00]; + v0.resourceData = ¶m0->unk_190->resourceDataList[param1->unk_00]; v0.position = v3; v0.affineScale = v2; v0.affineZRotation = 0; @@ -338,9 +338,9 @@ CellActorData *ov5_021D3584(UnkStruct_ov5_021D30A8 *param0, const SpriteTemplate v2 = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorData)); - v2->unk_08 = Heap_AllocFromHeap(param0->unk_1C6, sizeof(UnkStruct_02009508)); - v2->unk_08->unk_00 = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorResourceData)); - v2->unk_04 = v2->unk_08->unk_00; + v2->cellActorResourceList = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorResourceDataList)); + v2->cellActorResourceList->resourceDataList = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorResourceData)); + v2->cellActorResource = v2->cellActorResourceList->resourceDataList; for (v0 = 0; v0 < 6; v0++) { v4[v0] = param1->resources[v0]; @@ -359,10 +359,10 @@ CellActorData *ov5_021D3584(UnkStruct_ov5_021D30A8 *param0, const SpriteTemplate } } - sub_020093B4(v2->unk_04, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param1->transferToVRAM, param1->bgPriority, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); + sub_020093B4(v2->cellActorResource, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param1->transferToVRAM, param1->bgPriority, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); v3.collection = param0->unk_00; - v3.resourceData = v2->unk_04; + v3.resourceData = v2->cellActorResource; v3.position.x = FX32_CONST(param1->x); v3.position.y = FX32_CONST(param1->y); v3.position.z = FX32_CONST(param1->z); @@ -379,12 +379,12 @@ CellActorData *ov5_021D3584(UnkStruct_ov5_021D30A8 *param0, const SpriteTemplate v3.vramType = param1->vramType; v3.heapID = param0->unk_1C6; - v2->unk_00 = CellActorCollection_AddEx(&v3); + v2->cellActor = CellActorCollection_AddEx(&v3); - if (v2->unk_00 != NULL) { - v1 = CellActor_GetExplicitPalette(v2->unk_00); - CellActor_SetAnim(v2->unk_00, param1->animIdx); - CellActor_SetExplicitPalette(v2->unk_00, v1 + param1->plttIdx); + if (v2->cellActor != NULL) { + v1 = CellActor_GetExplicitPalette(v2->cellActor); + CellActor_SetAnim(v2->cellActor, param1->animIdx); + CellActor_SetExplicitPalette(v2->cellActor, v1 + param1->plttIdx); } else { GF_ASSERT(FALSE); } diff --git a/src/overlay006/ov6_022426AC.c b/src/overlay006/ov6_022426AC.c index 7029ec6c24..9d51058563 100644 --- a/src/overlay006/ov6_022426AC.c +++ b/src/overlay006/ov6_022426AC.c @@ -4,12 +4,12 @@ #include #include "struct_defs/archived_sprite.h" -#include "struct_defs/struct_0200C738.h" #include "cell_actor.h" #include "heap.h" #include "narc.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "sys_task.h" #include "sys_task_manager.h" @@ -25,7 +25,7 @@ typedef struct UnkStruct_ov6_022426B8_t { void *unk_24; ArchivedSprite unk_28; CellActorCollection *unk_38; - UnkStruct_0200C738 unk_3C; + GF_G2dRenderer unk_3C; CellActor *unk_1C8; BOOL unk_1CC; BOOL unk_1D0; diff --git a/src/overlay006/ov6_02243258.c b/src/overlay006/ov6_02243258.c index a0d9df0535..cdcf4ea0e8 100644 --- a/src/overlay006/ov6_02243258.c +++ b/src/overlay006/ov6_02243258.c @@ -6,7 +6,6 @@ #include "struct_decls/struct_02061AB4_decl.h" #include "struct_decls/struct_020711EC_decl.h" #include "struct_defs/archived_sprite.h" -#include "struct_defs/struct_0200C738.h" #include "field/field_system.h" #include "overlay005/ov5_021F0EB0.h" @@ -21,6 +20,7 @@ #include "narc.h" #include "player_avatar.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "sys_task.h" #include "sys_task_manager.h" @@ -64,7 +64,7 @@ typedef struct { NNSG2dCharacterData *unk_68; NNSG2dPaletteData *unk_6C; CellActorCollection *unk_70; - UnkStruct_0200C738 unk_74; + GF_G2dRenderer unk_74; SpriteResourceCollection *unk_200; SpriteResourceCollection *unk_204; SpriteResourceCollection *unk_208; @@ -151,7 +151,7 @@ typedef struct { s8 unk_06; s8 unk_07; CellActorCollection *unk_08; - UnkStruct_0200C738 unk_0C; + GF_G2dRenderer unk_0C; SpriteResourceCollection *unk_198; SpriteResourceCollection *unk_19C; SpriteResourceCollection *unk_1A0; diff --git a/src/overlay007/ov7_0224BE9C.c b/src/overlay007/ov7_0224BE9C.c index 1c7c34de5a..89c9ab12df 100644 --- a/src/overlay007/ov7_0224BE9C.c +++ b/src/overlay007/ov7_0224BE9C.c @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_02029D04_decl.h" -#include "struct_defs/struct_0200C738.h" #include "overlay007/struct_ov7_0224BEFC_decl.h" @@ -22,6 +21,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -123,7 +123,7 @@ typedef struct UnkStruct_ov7_0224BEFC_t { BgConfig *unk_14; u32 unk_18; CellActorCollection *unk_1C; - UnkStruct_0200C738 unk_20; + GF_G2dRenderer unk_20; MessageLoader *unk_1AC; u32 unk_1B0; u32 unk_1B4; diff --git a/src/overlay007/ov7_0224CD28.c b/src/overlay007/ov7_0224CD28.c index 02aad35f9d..3d13909f37 100644 --- a/src/overlay007/ov7_0224CD28.c +++ b/src/overlay007/ov7_0224CD28.c @@ -33,6 +33,7 @@ #include "player_avatar.h" #include "render_window.h" #include "save_player.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -42,7 +43,6 @@ #include "unk_02005474.h" #include "unk_0200A328.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_0202854C.h" #include "unk_0202C9F4.h" @@ -822,7 +822,7 @@ static u8 ov7_0224DC84(UnkStruct_ov7_0224D008 *param0) ListMenu_GetListAndCursorPos(param0->unk_78, NULL, &v2); if (v1 != v2) { - SpriteActor_SetPositionXY(param0->unk_25C[2], (176 - 4), 24 + v2 * 16); + CellActor_SetPositionXY(param0->unk_25C[2], (176 - 4), 24 + v2 * 16); } switch (v0) { @@ -1481,11 +1481,11 @@ static void ov7_0224EB14(UnkStruct_ov7_0224D008 *param0) static void ov7_0224EB38(UnkStruct_ov7_0224D008 *param0, u8 param1) { if (param1 == 0) { - SpriteActor_SetPositionXY(param0->unk_25C[0], 177, 8); - SpriteActor_SetPositionXY(param0->unk_25C[1], 177, 132); + CellActor_SetPositionXY(param0->unk_25C[0], 177, 8); + CellActor_SetPositionXY(param0->unk_25C[1], 177, 132); } else { - SpriteActor_SetPositionXY(param0->unk_25C[0], 162, 108); - SpriteActor_SetPositionXY(param0->unk_25C[1], 162, 132); + CellActor_SetPositionXY(param0->unk_25C[0], 162, 108); + CellActor_SetPositionXY(param0->unk_25C[1], 162, 132); } } @@ -1511,7 +1511,7 @@ static void ov7_0224EB7C(UnkStruct_ov7_0224D008 *param0, u16 param1) static void ov7_0224EC10(UnkStruct_ov7_0224D008 *param0, u8 param1) { - sub_0200D414(param0->unk_25C[2], param1); + thunk_CellActor_SetExplicitPalette(param0->unk_25C[2], param1); } static void ov7_0224EC20(FieldSystem *fieldSystem, UnkStruct_ov7_0224D008 *param1) diff --git a/src/overlay009/ov9_02249960.c b/src/overlay009/ov9_02249960.c index 7746850b92..c373f1c5f3 100644 --- a/src/overlay009/ov9_02249960.c +++ b/src/overlay009/ov9_02249960.c @@ -9,7 +9,6 @@ #include "struct_decls/struct_0205E884_decl.h" #include "struct_decls/struct_02061830_decl.h" #include "struct_decls/struct_02061AB4_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02071C5C.h" #include "struct_defs/struct_02073838.h" #include "struct_defs/struct_02073974.h" @@ -53,6 +52,7 @@ #include "resource_collection.h" #include "savedata_misc.h" #include "script_manager.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "sys_task.h" #include "sys_task_manager.h" @@ -94,7 +94,7 @@ typedef struct { typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190; SpriteResourceCollection *unk_194; SpriteResourceCollection *unk_198; diff --git a/src/overlay010/ov10_0221F800.c b/src/overlay010/ov10_0221F800.c index 939c295750..0027c2d487 100644 --- a/src/overlay010/ov10_0221F800.c +++ b/src/overlay010/ov10_0221F800.c @@ -45,6 +45,7 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task_manager.h" @@ -54,7 +55,6 @@ #include "unk_02005474.h" #include "unk_0200679C.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02014000.h" @@ -436,7 +436,7 @@ static void ov10_0221F870(SysTask *param0, void *param1) if (v0->unk_B74 != 0) { ov10_02220C2C(v0); - sub_0200C7EC(v0->unk_194); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_194); } if (v0->unk_00->unk_28 != 0) { @@ -976,9 +976,9 @@ static u8 ov10_02220604(UnkStruct_ov10_0221FB28 *param0) static u8 ov10_02220698(UnkStruct_ov10_0221FB28 *param0) { Sound_PlayEffect(1818); - SpriteActor_EnableObject(param0->unk_198[12], 1); - SpriteActor_EnableObject(param0->unk_198[13], 1); - sub_0200D364(param0->unk_198[12], 0); + CellActorData_DrawSprite(param0->unk_198[12], 1); + CellActorData_DrawSprite(param0->unk_198[13], 1); + CellActorData_SetAnim(param0->unk_198[12], 0); param0->unk_B75 = 32; return 1; } @@ -986,7 +986,7 @@ static u8 ov10_02220698(UnkStruct_ov10_0221FB28 *param0) static u8 ov10_022206D8(UnkStruct_ov10_0221FB28 *param0) { Sound_PlayEffect(1818); - SpriteActor_EnableObject(param0->unk_198[12], 1); + CellActorData_DrawSprite(param0->unk_198[12], 1); param0->unk_B75 = 64; return 1; } @@ -1191,8 +1191,8 @@ static void ov10_02220B00(UnkStruct_ov10_0221FB28 *param0, UnkStruct_ov104_02241 { VRAMTransferManager_New(64, param0->unk_00->unk_24); - param0->unk_190 = sub_0200C6E4(param0->unk_00->unk_24); - param0->unk_194 = sub_0200C704(param0->unk_190); + param0->unk_190 = SpriteRenderer_Create(param0->unk_00->unk_24); + param0->unk_194 = SpriteRenderer_CreateGfxHandler(param0->unk_190); { UnkStruct_ov104_0224133C v0 = { 0, @@ -1209,11 +1209,11 @@ static void ov10_02220B00(UnkStruct_ov10_0221FB28 *param0, UnkStruct_ov104_02241 }; v1.unk_00 = param2; - sub_0200C73C(param0->unk_190, &v0, &v1, 16); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_190, &v0, &v1, 16); } - sub_0200C7C0(param0->unk_190, param0->unk_194, param2); - sub_0200CB30(param0->unk_190, param0->unk_194, param1); + SpriteRenderer_CreateCellActorList(param0->unk_190, param0->unk_194, param2); + SpriteRenderer_InitGfxResourceList(param0->unk_190, param0->unk_194, param1); GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); } @@ -1235,7 +1235,7 @@ static CellActorData *ov10_02220BA0(UnkStruct_ov10_0221FB28 *param0, const u32 * v0.bgPriority = param1[4]; v0.transferToVRAM = FALSE; - return SpriteActor_LoadResources(param0->unk_190, param0->unk_194, &v0); + return CellActor_LoadResources(param0->unk_190, param0->unk_194, &v0); } static void ov10_02220BE8(UnkStruct_ov10_0221FB28 *param0) @@ -1243,11 +1243,11 @@ static void ov10_02220BE8(UnkStruct_ov10_0221FB28 *param0) u32 v0; for (v0 = 0; v0 < param0->unk_210; v0++) { - sub_0200D0F4(param0->unk_198[v0]); + CellActorData_Delete(param0->unk_198[v0]); } - sub_0200D0B0(param0->unk_190, param0->unk_194); - sub_0200C8D4(param0->unk_190); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_190, param0->unk_194); + SpriteRenderer_Free(param0->unk_190); } static void ov10_02220C2C(UnkStruct_ov10_0221FB28 *param0) @@ -1255,7 +1255,7 @@ static void ov10_02220C2C(UnkStruct_ov10_0221FB28 *param0) u16 v0; for (v0 = 0; v0 < param0->unk_210; v0++) { - CellActor_UpdateAnim(param0->unk_198[v0]->unk_00, FX32_ONE); + CellActor_UpdateAnim(param0->unk_198[v0]->cellActor, FX32_ONE); } } @@ -1499,7 +1499,7 @@ static void ov10_022210F4(UnkStruct_ov10_0221FB28 *param0) v0 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param0->unk_00->unk_24); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 208, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47111); - sub_0200CC9C(param0->unk_190, param0->unk_194, 108, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47111); + SpriteRenderer_LoadPaletteResObj(param0->unk_190, param0->unk_194, 108, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47111); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 207, 1, 47111); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 209, 1, 47111); NARC_dtor(v0); @@ -1511,7 +1511,7 @@ static void ov10_02221188(UnkStruct_ov10_0221FB28 *param0, u8 param1, s16 param2 u8 v1[] = { 0, 3, 6, 9 }; for (v0 = 0; v0 < 3; v0++) { - SpriteActor_SetSpritePositionXY(param0->unk_198[v1[param1] + v0], param0->unk_B58[param1] + v0 * 19 + param2, param0->unk_B5C[param1] + param3); + CellActorData_SetPositionXY(param0->unk_198[v1[param1] + v0], param0->unk_B58[param1] + v0 * 19 + param2, param0->unk_B5C[param1] + param3); } } @@ -1525,7 +1525,7 @@ static void ov10_022211F0(UnkStruct_ov10_0221FB28 *param0, Party *param1, u16 pa v4 = 0; for (v1 = 0; v1 < param2; v1++) { - sub_0200D364(param0->unk_198[v1 + param3], 0); + CellActorData_SetAnim(param0->unk_198[v1 + param3], 0); if (v3 > v1) { v0 = Party_GetPokemonBySlotIndex(param1, v1); @@ -1537,11 +1537,11 @@ static void ov10_022211F0(UnkStruct_ov10_0221FB28 *param0, Party *param1, u16 pa v2 = PokemonSummaryScreen_StatusIconAnimIdx(v0); if (v2 == 6) { - sub_0200D364(param0->unk_198[v4 + param3], 3); + CellActorData_SetAnim(param0->unk_198[v4 + param3], 3); } else if (v2 != 7) { - sub_0200D364(param0->unk_198[v4 + param3], 2); + CellActorData_SetAnim(param0->unk_198[v4 + param3], 2); } else { - sub_0200D364(param0->unk_198[v4 + param3], 1); + CellActorData_SetAnim(param0->unk_198[v4 + param3], 1); } v4++; @@ -1575,7 +1575,7 @@ static void ov10_0222130C(UnkStruct_ov10_0221FB28 *param0, u32 param1, Strbuf *p v1.unk_00 = param0->unk_B38; v1.unk_04 = v0; v1.unk_08 = sub_0200D9B0(param0->unk_194); - v1.unk_0C = sub_0200D04C(param0->unk_194, 47111); + v1.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_194, 47111); v1.unk_10 = NULL; v1.unk_14 = ((1024 - (8 * 2) - (4 * 4)) - (8 * 2) * param1) * 0x20; v1.unk_18 = 0; @@ -1709,35 +1709,35 @@ static void ov10_0222166C(UnkStruct_ov10_0221FB28 *param0) static void ov10_022216E0(UnkStruct_ov10_0221FB28 *param0) { - SpriteActor_EnableObject(param0->unk_198[12], 0); - SpriteActor_EnableObject(param0->unk_198[13], 0); + CellActorData_DrawSprite(param0->unk_198[12], 0); + CellActorData_DrawSprite(param0->unk_198[13], 0); if (param0->unk_00->unk_2A == 3) { - SpriteActor_SetSpritePositionXY(param0->unk_198[12], 128, (96 - 24)); - sub_0200D364(param0->unk_198[12], 3 - 1); + CellActorData_SetPositionXY(param0->unk_198[12], 128, (96 - 24)); + CellActorData_SetAnim(param0->unk_198[12], 3 - 1); return; } if (ov10_02220AD0() == 1) { if (param0->unk_00->unk_2A == 1) { - SpriteActor_SetSpritePositionXY(param0->unk_198[12], 48, (96 - 24)); - SpriteActor_SetSpritePositionXY(param0->unk_198[13], 208, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[12], 48, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[13], 208, (96 - 24)); } else { - SpriteActor_SetSpritePositionXY(param0->unk_198[12], 208, (96 - 24)); - SpriteActor_SetSpritePositionXY(param0->unk_198[13], 48, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[12], 208, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[13], 48, (96 - 24)); } } else { if (param0->unk_00->unk_2A == 1) { - SpriteActor_SetSpritePositionXY(param0->unk_198[12], 208, (96 - 24)); - SpriteActor_SetSpritePositionXY(param0->unk_198[13], 48, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[12], 208, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[13], 48, (96 - 24)); } else { - SpriteActor_SetSpritePositionXY(param0->unk_198[12], 48, (96 - 24)); - SpriteActor_SetSpritePositionXY(param0->unk_198[13], 208, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[12], 48, (96 - 24)); + CellActorData_SetPositionXY(param0->unk_198[13], 208, (96 - 24)); } } - sub_0200D364(param0->unk_198[12], 1 - 1); - sub_0200D364(param0->unk_198[13], 2 - 1); + CellActorData_SetAnim(param0->unk_198[12], 1 - 1); + CellActorData_SetAnim(param0->unk_198[13], 2 - 1); } static void ov10_022217CC(UnkStruct_ov10_0221FB28 *param0) @@ -2096,35 +2096,35 @@ static void ov10_02221EEC(UnkStruct_ov10_0221FB28 *param0, u32 param1) for (v0 = 0; v0 < 5; v0++) { param0->unk_198[param1 * 5 + v0] = ov10_02220BA0(param0, &Unk_ov10_02222F3C[param1 * 5 + v0][0]); - SpriteActor_SetSpritePositionXY(param0->unk_198[param1 * 5 + v0], Unk_ov10_02222C6C[param1][v0 * 2], Unk_ov10_02222C6C[param1][v0 * 2 + 1]); + CellActorData_SetPositionXY(param0->unk_198[param1 * 5 + v0], Unk_ov10_02222C6C[param1][v0 * 2], Unk_ov10_02222C6C[param1][v0 * 2 + 1]); } if (param0->unk_214[param1].unk_04 == 0) { for (v0 = 0; v0 < 5; v0++) { - SpriteActor_EnableObject(param0->unk_198[param1 * 5 + v0], 0); + CellActorData_DrawSprite(param0->unk_198[param1 * 5 + v0], 0); } } else { - sub_0200D41C(param0->unk_198[param1 * 5 + 0], PokeIconPaletteIndex(param0->unk_214[param1].unk_04, param0->unk_214[param1].unk_11, param0->unk_214[param1].unk_0F)); - sub_0200D364(param0->unk_198[param1 * 5 + 0], ov10_02221E84(param0, param1)); + CellActorData_SetExplicitPalette(param0->unk_198[param1 * 5 + 0], PokeIconPaletteIndex(param0->unk_214[param1].unk_04, param0->unk_214[param1].unk_11, param0->unk_214[param1].unk_0F)); + CellActorData_SetAnim(param0->unk_198[param1 * 5 + 0], ov10_02221E84(param0, param1)); if (param0->unk_214[param1].unk_0A == 0) { - SpriteActor_EnableObject(param0->unk_198[param1 * 5 + 1], 0); + CellActorData_DrawSprite(param0->unk_198[param1 * 5 + 1], 0); } else if (Item_IsMail(param0->unk_214[param1].unk_0A) == 1) { - sub_0200D364(param0->unk_198[param1 * 5 + 1], 1); + CellActorData_SetAnim(param0->unk_198[param1 * 5 + 1], 1); } else { - sub_0200D364(param0->unk_198[param1 * 5 + 1], 0); + CellActorData_SetAnim(param0->unk_198[param1 * 5 + 1], 0); } if (param0->unk_214[param1].unk_10 == 0) { - SpriteActor_EnableObject(param0->unk_198[param1 * 5 + 2], 0); + CellActorData_DrawSprite(param0->unk_198[param1 * 5 + 2], 0); } else { - sub_0200D364(param0->unk_198[param1 * 5 + 2], 2); + CellActorData_SetAnim(param0->unk_198[param1 * 5 + 2], 2); } if (param0->unk_214[param1].unk_14 == 7) { - SpriteActor_EnableObject(param0->unk_198[param1 * 5 + 3], 0); + CellActorData_DrawSprite(param0->unk_198[param1 * 5 + 3], 0); } else { - sub_0200D364(param0->unk_198[param1 * 5 + 3], param0->unk_214[v0].unk_14); + CellActorData_SetAnim(param0->unk_198[param1 * 5 + 3], param0->unk_214[v0].unk_14); } } } @@ -2158,7 +2158,7 @@ static void ov10_022220B4(UnkStruct_ov10_0221FB28 *param0) v1 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param0->unk_00->unk_24); - sub_0200CD0C(param0->unk_190, param0->unk_194, v1, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 47112); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_190, param0->unk_194, v1, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 47112); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v1, PokeIcon32KCellsFileIndex(), 0, 47113); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v1, PokeIcon32KAnimationFileIndex(), 0, 47113); @@ -2176,7 +2176,7 @@ static void ov10_0222216C(UnkStruct_ov10_0221FB28 *param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, param0->unk_00->unk_24); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47119); - sub_0200CD0C(param0->unk_190, param0->unk_194, v0, 21, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47113); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 21, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47113); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 19, 0, 47114); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 18, 0, 47114); NARC_dtor(v0); @@ -2189,7 +2189,7 @@ static void ov10_02222208(UnkStruct_ov10_0221FB28 *param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PST_GRA, param0->unk_00->unk_24); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 64, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47120); - sub_0200CD0C(param0->unk_190, param0->unk_194, v0, 65, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47114); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 65, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47114); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 63, 0, 47115); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 62, 0, 47115); NARC_dtor(v0); @@ -2202,7 +2202,7 @@ static void ov10_022222A4(UnkStruct_ov10_0221FB28 *param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, param0->unk_00->unk_24); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47121); - sub_0200CD0C(param0->unk_190, param0->unk_194, v0, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47115); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47115); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 1, 0, 47116); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 0, 0, 47116); NARC_dtor(v0); @@ -2222,7 +2222,7 @@ static void ov10_02222340(UnkStruct_ov10_0221FB28 *param0, s16 param1) for (v0 = 0; v0 < 3; v0++) { for (v1 = 0; v1 < 5; v1++) { - SpriteActor_SetSpritePositionXY( + CellActorData_SetPositionXY( param0->unk_198[(v2 + v0) * 5 + v1], Unk_ov10_02222C6C[v2 + v0][v1 * 2] + param1, Unk_ov10_02222C6C[v2 + v0][v1 * 2 + 1]); } } diff --git a/src/overlay012/ov12_0221FC20.c b/src/overlay012/ov12_0221FC20.c index b6a10d7f74..213fcf3a40 100644 --- a/src/overlay012/ov12_0221FC20.c +++ b/src/overlay012/ov12_0221FC20.c @@ -44,12 +44,12 @@ #include "palette.h" #include "pokemon.h" #include "spl.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_02005474.h" #include "unk_0200762C.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_02014000.h" #include "unk_0201DBEC.h" #include "unk_0201F834.h" @@ -1297,7 +1297,7 @@ static void ov12_02220798(UnkStruct_ov12_0221FCDC *param0) for (v0 = 0; v0 < 4; v0++) { if (param0->unk_C8[v0] != NULL) { - sub_0200D0B0(param0->unk_BC->unk_AC, param0->unk_C8[v0]); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_BC->unk_AC, param0->unk_C8[v0]); } param0->unk_C8[v0] = NULL; @@ -1952,7 +1952,7 @@ static void ov12_0222118C(SysTask *param0, void *param1) v2 = sub_020080C0(v0->unk_04.unk_04, 1); v2 -= sub_020080C0(v0->unk_04.unk_04, 41); - SpriteActor_SetSpritePositionXY(v0->unk_00, v1, v2); + CellActorData_SetPositionXY(v0->unk_00, v1, v2); } static void ov12_022211D8(SysTask *param0, void *param1) @@ -2103,11 +2103,11 @@ static void ov12_0222144C(UnkStruct_ov12_0221FCDC *param0) }; param0->unk_18 += 1; - param0->unk_134 = sub_0200C704(param0->unk_BC->unk_AC); + param0->unk_134 = SpriteRenderer_CreateGfxHandler(param0->unk_BC->unk_AC); - sub_0200C7C0(param0->unk_BC->unk_AC, param0->unk_134, v0); - sub_0200964C(sub_0200C738(param0->unk_BC->unk_AC), 0, ((192 + 80) << FX32_SHIFT)); - sub_0200CB30(param0->unk_BC->unk_AC, param0->unk_134, &v1); + SpriteRenderer_CreateCellActorList(param0->unk_BC->unk_AC, param0->unk_134, v0); + sub_0200964C(SpriteRenderer_GetG2dRenderer(param0->unk_BC->unk_AC), 0, ((192 + 80) << FX32_SHIFT)); + SpriteRenderer_InitGfxResourceList(param0->unk_BC->unk_AC, param0->unk_134, &v1); } static void ov12_022214C4(UnkStruct_ov12_0221FCDC *param0) @@ -2127,7 +2127,7 @@ static void ov12_022214C4(UnkStruct_ov12_0221FCDC *param0) v0[5] = 0; SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 76, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v0[0]); - SpriteRenderer_LoadPalette(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v0[1]); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v0[1]); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 77, 0, v0[2]); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 78, 0, v0[3]); } @@ -2200,15 +2200,15 @@ static void ov12_02221580(UnkStruct_ov12_0221FCDC *param0) v11.resources[v14] = v2[v14]; } - v1 = SpriteActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_134, &v11); + v1 = CellActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_134, &v11); if (v12 == NULL) { - SpriteActor_EnableObject(v1, 0); + CellActorData_DrawSprite(v1, 0); } else { int v17 = sub_020080C0(v12, 6); if (v17 == 1) { - SpriteActor_EnableObject(v1, 0); + CellActorData_DrawSprite(v1, 0); } } @@ -2220,7 +2220,7 @@ static void ov12_02221580(UnkStruct_ov12_0221FCDC *param0) if (ov12_022232FC(param0, v7) != NULL) { NNSG2dImageProxy *v18; - v18 = SpriteActor_ImageProxy(v1->unk_00); + v18 = SpriteActor_ImageProxy(v1->cellActor); sub_0201DC68(NNS_GFD_DST_2D_OBJ_CHAR_MAIN, v18->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN], v0, (10 * 10 * ((8 / 2) * 8))); } @@ -2228,7 +2228,7 @@ static void ov12_02221580(UnkStruct_ov12_0221FCDC *param0) NNSG2dImagePaletteProxy *v19; int v20; - v19 = CellActor_GetPaletteProxy(v1->unk_00); + v19 = CellActor_GetPaletteProxy(v1->cellActor); v20 = sub_0201FAB4(v19, NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStart(param0->unk_C4, v8, v9, param0->unk_00, 2, 0x20, v20 * 16); @@ -2263,7 +2263,7 @@ static void ov12_022217B4(UnkStruct_ov12_0221FCDC *param0) param0->unk_18 += 1; if (param0->unk_134 != NULL) { - sub_0200D0B0(param0->unk_BC->unk_AC, param0->unk_134); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_BC->unk_AC, param0->unk_134); } param0->unk_134 = NULL; @@ -2279,7 +2279,7 @@ static void ov12_022217E0(UnkStruct_ov12_0221FCDC *param0) param0->unk_18 += 1; if (param0->unk_138[v0] != NULL) { - sub_0200D0F4(param0->unk_138[v0]); + CellActorData_Delete(param0->unk_138[v0]); } param0->unk_14C[v0] = 0; @@ -2296,7 +2296,7 @@ static void ov12_02221810(SysTask *param0, void *param1) } if (v0->unk_00->unk_134 != NULL) { - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } } @@ -2322,7 +2322,7 @@ static void ov12_02221834(UnkStruct_ov12_0221FCDC *param0) param0->unk_48[v1].unk_08 = param0->unk_138[v2]; param0->unk_48[v1].unk_0C = 1; - SpriteActor_EnableObject(param0->unk_48[v1].unk_08, 0); + CellActorData_DrawSprite(param0->unk_48[v1].unk_08, 0); if (ov12_02223364(param0) == 1) { int v3, v4; @@ -2345,58 +2345,58 @@ static void ov12_02221834(UnkStruct_ov12_0221FCDC *param0) } if (v5 == 1) { - SpriteActor_EnableObject(param0->unk_48[v1].unk_08, 0); + CellActorData_DrawSprite(param0->unk_48[v1].unk_08, 0); } else { - SpriteActor_EnableObject(param0->unk_48[v1].unk_08, 1); + CellActorData_DrawSprite(param0->unk_48[v1].unk_08, 1); } } switch (v0) { case 0: if ((v3 == 3) || (v3 == 4)) { - sub_0200D474(param0->unk_48[v1].unk_08, 1); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 1); } else { - SpriteActor_EnableObject(param0->unk_48[v1].unk_08, 0); - sub_0200D474(param0->unk_48[v1].unk_08, 255); + CellActorData_DrawSprite(param0->unk_48[v1].unk_08, 0); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 255); } break; case 2: if ((v3 == 5) || (v3 == 2)) { - sub_0200D474(param0->unk_48[v1].unk_08, 1); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 1); } else { - SpriteActor_EnableObject(param0->unk_48[v1].unk_08, 0); - sub_0200D474(param0->unk_48[v1].unk_08, 255); + CellActorData_DrawSprite(param0->unk_48[v1].unk_08, 0); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 255); } break; case 1: switch (v4) { case 2: - sub_0200D474(param0->unk_48[v1].unk_08, 255); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 255); break; case 3: - sub_0200D474(param0->unk_48[v1].unk_08, 1); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 1); break; case 4: - sub_0200D474(param0->unk_48[v1].unk_08, 1); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 1); break; case 5: - sub_0200D474(param0->unk_48[v1].unk_08, 255); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 255); break; } break; case 3: switch (v4) { case 2: - sub_0200D474(param0->unk_48[v1].unk_08, 1); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 1); break; case 3: - sub_0200D474(param0->unk_48[v1].unk_08, 255); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 255); break; case 4: - sub_0200D474(param0->unk_48[v1].unk_08, 255); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 255); break; case 5: - sub_0200D474(param0->unk_48[v1].unk_08, 1); + CellActorData_SetPriority(param0->unk_48[v1].unk_08, 1); break; } break; @@ -3567,11 +3567,11 @@ static void ov12_02222CE8(UnkStruct_ov12_0221FCDC *param0) param0->unk_18 += 1; GF_ASSERT(param0->unk_C8[v1] == NULL); - param0->unk_C8[v1] = sub_0200C704(param0->unk_BC->unk_AC); + param0->unk_C8[v1] = SpriteRenderer_CreateGfxHandler(param0->unk_BC->unk_AC); GF_ASSERT(param0->unk_C8[v1] != NULL); - sub_0200C7C0(param0->unk_BC->unk_AC, param0->unk_C8[v1], v2); - sub_0200964C(sub_0200C738(param0->unk_BC->unk_AC), 0, ((192 + 80) << FX32_SHIFT)); + SpriteRenderer_CreateCellActorList(param0->unk_BC->unk_AC, param0->unk_C8[v1], v2); + sub_0200964C(SpriteRenderer_GetG2dRenderer(param0->unk_BC->unk_AC), 0, ((192 + 80) << FX32_SHIFT)); { UnkStruct_ov104_02241308 v3; @@ -3581,7 +3581,7 @@ static void ov12_02222CE8(UnkStruct_ov12_0221FCDC *param0) param0->unk_18 += 1; } - sub_0200CB30(param0->unk_BC->unk_AC, param0->unk_C8[v1], &v3); + SpriteRenderer_InitGfxResourceList(param0->unk_BC->unk_AC, param0->unk_C8[v1], &v3); } } @@ -3618,7 +3618,7 @@ static void ov12_02222DCC(UnkStruct_ov12_0221FCDC *param0) v2 = inline_ov12_022204C4(param0->unk_18); param0->unk_18 += 1; - SpriteRenderer_LoadPalette(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[3], v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v2, v1 + 5000); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[3], v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v2, v1 + 5000); } static void ov12_02222E2C(UnkStruct_ov12_0221FCDC *param0) @@ -3693,7 +3693,7 @@ static void ov12_02222EBC(UnkStruct_ov12_0221FCDC *param0) param0->unk_100 = v6; - v4 = SpriteActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_C8[v2], &v6); + v4 = CellActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_C8[v2], &v6); } v3 = inline_ov12_022204C4(param0->unk_18); @@ -3751,7 +3751,7 @@ static void ov12_02222FC8(UnkStruct_ov12_0221FCDC *param0) param0->unk_100 = v5; - v3 = SpriteActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_C8[v1], &v5); + v3 = CellActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_C8[v1], &v5); GF_ASSERT(param0->unk_D8[v2] == NULL); param0->unk_D8[v2] = v3; } @@ -3767,7 +3767,7 @@ static void ov12_0222307C(UnkStruct_ov12_0221FCDC *param0) param0->unk_18 += 1; if (param0->unk_C8[v0] != NULL) { - sub_0200D0B0(param0->unk_BC->unk_AC, param0->unk_C8[v0]); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_BC->unk_AC, param0->unk_C8[v0]); } param0->unk_C8[v0] = NULL; @@ -3786,7 +3786,7 @@ static void ov12_022230A8(UnkStruct_ov12_0221FCDC *param0) v1 = inline_ov12_022204C4(param0->unk_18); param0->unk_18 += 1; - SpriteActor_EnableObject(param0->unk_138[v0], v1); + CellActorData_DrawSprite(param0->unk_138[v0], v1); } static void ov12_022230CC(UnkStruct_ov12_0221FCDC *param0) @@ -4223,7 +4223,7 @@ UnkStruct_ov12_02223764 *ov12_022234F8(BattleSystem *param0, int param1, int par v3[5] = 0; SpriteRenderer_LoadCharResObjFromOpenNarc(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 76, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v3[0]); - SpriteRenderer_LoadPalette(v2->unk_08.unk_08, 2, v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v3[1]); + SpriteRenderer_LoadPaletteFromOpenNarc(v2->unk_08.unk_08, 2, v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v3[1]); SpriteRenderer_LoadCellResObjFromOpenNarc(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 77, 0, v3[2]); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 78, 0, v3[3]); } @@ -4287,26 +4287,26 @@ UnkStruct_ov12_02223764 *ov12_022234F8(BattleSystem *param0, int param1, int par v12.resources[v11] = v9[v11]; } - v10 = SpriteActor_LoadResources(v2->unk_08.unk_00, v2->unk_08.unk_04, &v12); - sub_0200D330(v10); + v10 = CellActor_LoadResources(v2->unk_08.unk_00, v2->unk_08.unk_04, &v12); + CellActorData_UpdateObject(v10); v2->unk_24[v5] = v10; if (v13 == NULL) { - SpriteActor_EnableObject(v10, 0); + CellActorData_DrawSprite(v10, 0); } else if (sub_02008B38(v13) == 0) { - SpriteActor_EnableObject(v10, 0); + CellActorData_DrawSprite(v10, 0); } else { int v16 = sub_020080C0(v13, 6); if (v16 == 1) { - SpriteActor_EnableObject(v10, 0); + CellActorData_DrawSprite(v10, 0); } } if (v13 != NULL) { NNSG2dImageProxy *v17; - v17 = SpriteActor_ImageProxy(v10->unk_00); + v17 = SpriteActor_ImageProxy(v10->cellActor); sub_0201DC68(NNS_GFD_DST_2D_OBJ_CHAR_MAIN, v17->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN], v8, (10 * 10 * ((8 / 2) * 8))); } @@ -4314,7 +4314,7 @@ UnkStruct_ov12_02223764 *ov12_022234F8(BattleSystem *param0, int param1, int par NNSG2dImagePaletteProxy *v18; int v19; - v18 = CellActor_GetPaletteProxy(v10->unk_00); + v18 = CellActor_GetPaletteProxy(v10->cellActor); v19 = sub_0201FAB4(v18, NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStart(v2->unk_08.unk_08, v6, v7, v2->unk_00, 2, 0x20, v19 * 16); @@ -4345,7 +4345,7 @@ void ov12_02223770(UnkStruct_ov12_02223764 *param0) SpriteGfxHandler_UnloadCharObjById(param0->unk_08.unk_04, param0->unk_14[v0]); SpriteGfxHandler_UnloadPlttObjById(param0->unk_08.unk_04, param0->unk_14[v0]); - sub_0200D0F4(param0->unk_24[v0]); + CellActorData_Delete(param0->unk_24[v0]); } Heap_FreeToHeap(param0); @@ -4362,7 +4362,7 @@ void ov12_022237A4(UnkStruct_ov12_02223764 *param0, int param1) SpriteGfxHandler_UnloadCharObjById(param0->unk_08.unk_04, param0->unk_14[v0]); SpriteGfxHandler_UnloadPlttObjById(param0->unk_08.unk_04, param0->unk_14[v0]); - sub_0200D0F4(param0->unk_24[v0]); + CellActorData_Delete(param0->unk_24[v0]); } Heap_FreeToHeap(param0); diff --git a/src/overlay012/ov12_02225864.c b/src/overlay012/ov12_02225864.c index 9e85b54079..5031c30ea7 100644 --- a/src/overlay012/ov12_02225864.c +++ b/src/overlay012/ov12_02225864.c @@ -21,10 +21,10 @@ #include "inlines.h" #include "palette.h" #include "screen_scroll_manager.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0201F834.h" typedef struct { @@ -149,7 +149,7 @@ s16 ov12_022258E0(UnkStruct_ov12_0221FCDC *param0, int param1, int param2) u8 ov12_02225950(CellActorData *param0) { - return sub_0201FAB4(CellActor_GetPaletteProxy(param0->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + return sub_0201FAB4(CellActor_GetPaletteProxy(param0->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); } int ov12_02225964(UnkStruct_ov12_0221FCDC *param0, int param1) @@ -215,7 +215,7 @@ u32 ov12_022259AC(fx32 param0, fx32 param1, fx32 param2) void ov12_022259DC(UnkStruct_ov12_02225F6C *param0, CellActorData *param1, s16 param2, s16 param3) { - SpriteActor_SetSpritePositionXY(param1, param2 + param0->unk_00, param3 + param0->unk_02); + CellActorData_SetPositionXY(param1, param2 + param0->unk_00, param3 + param0->unk_02); } void ov12_022259FC(UnkStruct_ov12_02225F6C *param0, CellActorData *param1) @@ -619,7 +619,7 @@ void ov12_0222605C(CellActorData *param0, s16 param1, s16 param2, fx32 param3, i } SpriteActor_GetSpritePositionXY(param0, &v2, &v3); - SpriteActor_SetSpritePositionXY(param0, v2, v1 + v0); + CellActorData_SetPositionXY(param0, v2, v1 + v0); } BOOL ov12_022260A8(UnkStruct_ov12_02225F6C *param0, CellActorData *param1) @@ -747,7 +747,7 @@ void ov12_022261C4(UnkStruct_ov12_02226274 *param0, UnkStruct_ov12_02225F6C *par param0->unk_98[3] = param11; for (v0 = 0; v0 < param0->unk_AC; v0++) { - SpriteActor_EnableObject(param0->unk_98[v0], 0); + CellActorData_DrawSprite(param0->unk_98[v0], 0); } } @@ -762,7 +762,7 @@ BOOL ov12_02226274(UnkStruct_ov12_02226274 *param0) } if (param0->unk_A8 <= param0->unk_AA) { - SpriteActor_EnableObject(param0->unk_98[param0->unk_AD], 1); + CellActorData_DrawSprite(param0->unk_98[param0->unk_AD], 1); param0->unk_AD++; param0->unk_AA = 0; } @@ -776,13 +776,13 @@ BOOL ov12_02226274(UnkStruct_ov12_02226274 *param0) if (v1[v0]) { if (param0->unk_AE == 0) { - SpriteActor_SetSpritePositionXY(param0->unk_98[v0], param0->unk_00 + param0->unk_04[v0].unk_00, param0->unk_02 + param0->unk_04[v0].unk_02); + CellActorData_SetPositionXY(param0->unk_98[v0], param0->unk_00 + param0->unk_04[v0].unk_00, param0->unk_02 + param0->unk_04[v0].unk_02); } else { ov12_02225FA4(¶m0->unk_04[v0], &v2, &v3); sub_0200D6E8(param0->unk_98[v0], v2, v3); } } else { - SpriteActor_EnableObject(param0->unk_98[v0], 0); + CellActorData_DrawSprite(param0->unk_98[v0], 0); } } diff --git a/src/overlay012/ov12_022269C0.c b/src/overlay012/ov12_022269C0.c index ce1c2ab87f..d8e78ed99a 100644 --- a/src/overlay012/ov12_022269C0.c +++ b/src/overlay012/ov12_022269C0.c @@ -13,9 +13,9 @@ #include "cell_actor.h" #include "heap.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" -#include "unk_0200C6E4.h" typedef struct { u8 unk_00; @@ -134,20 +134,20 @@ static void ov12_02226AAC(SysTask *param0, void *param1) switch (v0->unk_00) { case 0: - SpriteActor_UpdateObject(v0->unk_14[0]->unk_00); - SpriteActor_UpdateObject(v0->unk_14[1]->unk_00); - SpriteActor_UpdateObject(v0->unk_14[2]->unk_00); + CellActor_UpdateObject(v0->unk_14[0]->cellActor); + CellActor_UpdateObject(v0->unk_14[1]->cellActor); + CellActor_UpdateObject(v0->unk_14[2]->cellActor); - sub_0200D5AC(v0->unk_14[0]->unk_00, 1, 0); - sub_0200D5AC(v0->unk_14[1]->unk_00, -1, 0); - sub_0200D5AC(v0->unk_14[2]->unk_00, 1, 1); + sub_0200D5AC(v0->unk_14[0]->cellActor, 1, 0); + sub_0200D5AC(v0->unk_14[1]->cellActor, -1, 0); + sub_0200D5AC(v0->unk_14[2]->cellActor, 1, 1); - sub_0200C7EC(v0->unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_0C); break; case 1: { UnkStruct_ov12_0221FCDC *v1 = v0->unk_04; - sub_0200D0F4(v0->unk_10); + CellActorData_Delete(v0->unk_10); Heap_FreeToHeap(v0); ov12_02220220(v1, param0); } break; @@ -176,7 +176,7 @@ void ov12_02226B1C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri int v2; for (v2 = 1; v2 < 3; v2++) { - v0->unk_14[v2] = SpriteActor_LoadResources(v0->unk_08, v0->unk_0C, &v1); + v0->unk_14[v2] = CellActor_LoadResources(v0->unk_08, v0->unk_0C, &v1); } } diff --git a/src/overlay012/ov12_02226B84.c b/src/overlay012/ov12_02226B84.c index d621f2a9dc..2a16c2f641 100644 --- a/src/overlay012/ov12_02226B84.c +++ b/src/overlay012/ov12_02226B84.c @@ -30,9 +30,9 @@ #include "inlines.h" #include "palette.h" #include "spl.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_02014000.h" #include "unk_0201D15C.h" #include "unk_0201F834.h" @@ -468,11 +468,11 @@ static void ov12_02226BA0(SysTask *param0, void *param1) continue; } - SpriteActor_SetSpritePositionXY(v1->unk_2C[v0].unk_0C, v1->unk_2C[v0].unk_04.unk_00 + v1->unk_7C.unk_00, v1->unk_2C[v0].unk_04.unk_02 + v1->unk_7C.unk_02); - sub_0200D330(v1->unk_2C[v0].unk_0C); + CellActorData_SetPositionXY(v1->unk_2C[v0].unk_0C, v1->unk_2C[v0].unk_04.unk_00 + v1->unk_7C.unk_00, v1->unk_2C[v0].unk_04.unk_02 + v1->unk_7C.unk_02); + CellActorData_UpdateObject(v1->unk_2C[v0].unk_0C); } - sub_0200C7EC(v1->unk_04.unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_04.unk_0C); } if (inline_ov12_02235998(v1->unk_20.unk_08, 0x400) == 1) { @@ -951,8 +951,8 @@ void ov12_02227534(UnkStruct_ov12_0221FCDC *param0) static void ov12_02227620(UnkStruct_ov12_02227620 *param0, s16 param1, s16 param2) { - SpriteActor_EnableObject(param0->unk_14, 1); - SpriteActor_SetSpritePositionXY(param0->unk_14, param1, param2); + CellActorData_DrawSprite(param0->unk_14, 1); + CellActorData_SetPositionXY(param0->unk_14, param1, param2); param0->unk_40 = 0; ov12_02225E68(¶m0->unk_18, 10, 10, 14, 4); } @@ -961,7 +961,7 @@ static BOOL ov12_02227658(UnkStruct_ov12_02227620 *param0) { if (ov12_022260A8(¶m0->unk_18, param0->unk_14) == 0) { if (param0->unk_40) { - SpriteActor_EnableObject(param0->unk_14, 0); + CellActorData_DrawSprite(param0->unk_14, 0); return 1; } else { param0->unk_40 = 1; @@ -1018,13 +1018,13 @@ static void ov12_02227738(SysTask *param0, void *param1) } break; case 1: - sub_0200D0F4(v0->unk_14); + CellActorData_Delete(v0->unk_14); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_0222777C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -1039,10 +1039,10 @@ void ov12_0222777C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_08 = param2; v0->unk_14 = param3; - sub_0200D474(v0->unk_14, 100); - sub_0200D460(v0->unk_14, 1); + CellActorData_SetPriority(v0->unk_14, 100); + CellActorData_SetExplicitPriority(v0->unk_14, 1); sub_0200D6A4(v0->unk_14, 2); - SpriteActor_EnableObject(v0->unk_14, 0); + CellActorData_DrawSprite(v0->unk_14, 0); v0->unk_44 = 4; v0->unk_3C = ov12_02225964(v0->unk_00, ov12_02220240(v0->unk_00)); @@ -1332,7 +1332,7 @@ static void ov12_02227B4C(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } void ov12_02227CBC(UnkStruct_ov12_0221FCDC *param0) @@ -1364,8 +1364,8 @@ void ov12_02227CBC(UnkStruct_ov12_0221FCDC *param0) v0->unk_4C = ov12_02220280(param0, 6); v0->unk_10 = ov12_022202C0(v0->unk_00, ov12_02220280(param0, 7)); - sub_0200D474(v0->unk_10, 100); - sub_0200D460(v0->unk_10, 1); + CellActorData_SetPriority(v0->unk_10, 100); + CellActorData_SetExplicitPriority(v0->unk_10, 1); SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_10, 2); @@ -1575,7 +1575,7 @@ static void ov12_0222813C(SysTask *param0, void *param1) Heap_FreeToHeap(v0); ov12_02220220(v0->unk_00, param0); } else { - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } } @@ -2042,8 +2042,8 @@ static void ov12_02228B10(SysTask *param0, void *param1) return; } - sub_0200D330(v0->unk_24); - sub_0200C7EC(v0->unk_04.unk_0C); + CellActorData_UpdateObject(v0->unk_24); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04.unk_0C); } void ov12_02228B40(UnkStruct_ov12_0221FCDC *param0) @@ -2395,7 +2395,7 @@ void ov12_022291AC(UnkStruct_ov12_0221FCDC *param0) ov12_02235D74(param0, v3, &(v1->unk_1C), &v0); - v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->unk_1C.unk_0C->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->unk_1C.unk_0C->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); v1->unk_30 = ov12_02226870(v1->unk_00.unk_18, ov12_0221FDE4(param0), 2, v2 * 16, 16, v4, v5, v6, v7, v8, 1100); } @@ -2775,9 +2775,9 @@ static void ov12_0222988C(SysTask *param0, void *param1) } } - sub_0200D330(v0->unk_1C); + CellActorData_UpdateObject(v0->unk_1C); G2_SetOBJMosaicSize(v0->unk_24, v0->unk_28); - sub_0200C7EC(v0->unk_00.unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_0C); } void ov12_02229908(UnkStruct_ov12_0221FCDC *param0) @@ -2794,7 +2794,7 @@ void ov12_02229908(UnkStruct_ov12_0221FCDC *param0) v0->unk_28 = ov12_02220280(v0->unk_00.unk_04, 3); v0->unk_1C = ov12_022202C0(v0->unk_00.unk_04, ov12_02220280(v0->unk_00.unk_04, 0)); - SpriteActor_EnableObject(v0->unk_1C, 1); + CellActorData_DrawSprite(v0->unk_1C, 1); if (v0->unk_20 < 0) { v0->unk_2C = 0; @@ -3175,17 +3175,17 @@ static void ov12_0222A178(SysTask *param0, void *param1) UnkStruct_ov12_0222A178 *v1 = (UnkStruct_ov12_0222A178 *)param1; v0 = 1; - v0 = sub_0200D3B8(v1->unk_1C); + v0 = CellActorData_IsAnimated(v1->unk_1C); if (v0 == 0) { - sub_0200D0F4(v1->unk_1C); + CellActorData_Delete(v1->unk_1C); ov12_02220220(v1->unk_00.unk_04, param0); Heap_FreeToHeap(v1); return; } - sub_0200D330(v1->unk_1C); - sub_0200C7EC(v1->unk_00.unk_10); + CellActorData_UpdateObject(v1->unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_00.unk_10); } void ov12_0222A1AC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -3271,14 +3271,14 @@ static void ov12_0222A1F4(SysTask *param0, void *param1) int v3; if (v1 == 0) { - v2 = sub_0200D454(v0->unk_1C); + v2 = CellActorData_GetExplicitPriority(v0->unk_1C); if (v2 == ov12_0222339C(v0->unk_00.unk_04)) { v3 = ov12_02223428(v0->unk_00.unk_04, 2); - sub_0200D460(v0->unk_1C, v3); + CellActorData_SetExplicitPriority(v0->unk_1C, v3); } else { v3 = ov12_0222339C(v0->unk_00.unk_04); - sub_0200D460(v0->unk_1C, v3); + CellActorData_SetExplicitPriority(v0->unk_1C, v3); } } @@ -3321,14 +3321,14 @@ static void ov12_0222A1F4(SysTask *param0, void *param1) } } break; default: - sub_0200D0F4(v0->unk_1C); + CellActorData_Delete(v0->unk_1C); ov12_02220220(v0->unk_00.unk_04, param0); Heap_FreeToHeap(v0); return; } - sub_0200D330(v0->unk_1C); - sub_0200C7EC(v0->unk_00.unk_10); + CellActorData_UpdateObject(v0->unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_10); } void ov12_0222A34C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -3347,16 +3347,16 @@ void ov12_0222A34C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri s16 v2 = ov12_022258E0(param0, v1, 0); s16 v3 = ov12_022258E0(param0, v1, 1); - SpriteActor_SetSpritePositionXY(v0->unk_1C, v2, v3); + CellActorData_SetPositionXY(v0->unk_1C, v2, v3); } if (ov12_0223525C(param0, ov12_02220240(param0)) == 0x4) { - sub_0200D364(v0->unk_1C, 1); + CellActorData_SetAnim(v0->unk_1C, 1); } else { - sub_0200D364(v0->unk_1C, 0); + CellActorData_SetAnim(v0->unk_1C, 0); } - sub_0200D460(v0->unk_1C, ov12_0222339C(v0->unk_00.unk_04)); + CellActorData_SetExplicitPriority(v0->unk_1C, ov12_0222339C(v0->unk_00.unk_04)); sub_0200D5DC(v0->unk_1C, 0, +12); ov12_022201E8(v0->unk_00.unk_04, ov12_0222A1F4, v0); @@ -3367,17 +3367,17 @@ static void ov12_0222A3DC(SysTask *param0, void *param1) UnkStruct_ov12_0222A3DC *v0 = param1; BOOL v1; - v1 = sub_0200D3B8(v0->unk_1C); + v1 = CellActorData_IsAnimated(v0->unk_1C); if (v1 == 0) { - sub_0200D0F4(v0->unk_1C); + CellActorData_Delete(v0->unk_1C); ov12_02220220(v0->unk_00.unk_04, param0); Heap_FreeToHeap(v0); return; } - sub_0200D330(v0->unk_1C); - sub_0200C7EC(v0->unk_00.unk_10); + CellActorData_UpdateObject(v0->unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_10); } void ov12_0222A410(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -3408,11 +3408,11 @@ void ov12_0222A410(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } } - SpriteActor_SetSpritePositionXY(v0->unk_1C, v3, v4); - sub_0200D364(v0->unk_1C, v1); + CellActorData_SetPositionXY(v0->unk_1C, v3, v4); + CellActorData_SetAnim(v0->unk_1C, v1); } - sub_0200D460(v0->unk_1C, ov12_02223428(v0->unk_00.unk_04, 2)); + CellActorData_SetExplicitPriority(v0->unk_1C, ov12_02223428(v0->unk_00.unk_04, 2)); ov12_022201E8(v0->unk_00.unk_04, ov12_0222A3DC, v0); } @@ -3432,7 +3432,7 @@ static void ov12_0222A4A0(SysTask *param0, void *param1) } break; case 2: { - BOOL v2 = sub_0200D3B8(v0->unk_1C); + BOOL v2 = CellActorData_IsAnimated(v0->unk_1C); if (v2 == 0) { SpriteActor_SetOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); @@ -3458,14 +3458,14 @@ static void ov12_0222A4A0(SysTask *param0, void *param1) } break; default: - sub_0200D0F4(v0->unk_1C); + CellActorData_Delete(v0->unk_1C); ov12_02220220(v0->unk_00.unk_04, param0); Heap_FreeToHeap(v0); return; } - sub_0200D330(v0->unk_1C); - sub_0200C7EC(v0->unk_00.unk_10); + CellActorData_UpdateObject(v0->unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_10); } void ov12_0222A5C0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -3476,8 +3476,8 @@ void ov12_0222A5C0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri ov12_0223595C(param0, &v0->unk_00); v0->unk_1C = param3; - SpriteActor_SetSpritePositionXY(v0->unk_1C, -30, 160); - sub_0200D460(v0->unk_1C, ov12_02223428(v0->unk_00.unk_04, 2)); + CellActorData_SetPositionXY(v0->unk_1C, -30, 160); + CellActorData_SetExplicitPriority(v0->unk_1C, ov12_02223428(v0->unk_00.unk_04, 2)); ov12_022201E8(v0->unk_00.unk_04, ov12_0222A4A0, v0); } @@ -3582,13 +3582,13 @@ static void ov12_0222A624(UnkStruct_ov12_0222A624 *param0) SpriteActor_GetSpritePositionXY(param0->unk_1C, &v0, &v1); if (v1 > 130) { - SpriteActor_EnableObject(param0->unk_1C, 0); + CellActorData_DrawSprite(param0->unk_1C, 0); } } param0->unk_38++; } else { - SpriteActor_EnableObject(param0->unk_1C, 0); + CellActorData_DrawSprite(param0->unk_1C, 0); } } @@ -3612,16 +3612,16 @@ static void ov12_0222A878(SysTask *param0, void *param1) G2_SetWndOutsidePlane(GX_WND_PLANEMASK_NONE, 0); G2_SetWnd0Position(0, 0, 0, 0); - SpriteActor_EnableObject(v0->unk_1C, 0); - sub_0200C7EC(v0->unk_00.unk_0C); + CellActorData_DrawSprite(v0->unk_1C, 0); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_0C); ov12_02220220(v0->unk_00.unk_04, param0); Heap_FreeToHeap(v0); return; } - sub_0200D330(v0->unk_1C); - sub_0200C7EC(v0->unk_00.unk_0C); + CellActorData_UpdateObject(v0->unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_0C); } void ov12_0222A8F4(UnkStruct_ov12_0221FCDC *param0) @@ -3645,17 +3645,17 @@ void ov12_0222A8F4(UnkStruct_ov12_0221FCDC *param0) if (v0->unk_28 != 0xFF) { v1 = ov12_02223428(param0, v0->unk_28); - sub_0200D460(v0->unk_1C, v1); + CellActorData_SetExplicitPriority(v0->unk_1C, v1); } if (v0->unk_2C != 0xFF) { - sub_0200D474(v0->unk_1C, v0->unk_2C); + CellActorData_SetPriority(v0->unk_1C, v0->unk_2C); } } if (ov12_02223364(param0) != 1) { if ((ov12_02220280(param0, 4) == 2) || (ov12_02220280(param0, 4) == 3)) { - SpriteActor_EnableObject(v0->unk_1C, 0); + CellActorData_DrawSprite(v0->unk_1C, 0); Heap_FreeToHeap(v0); return; } @@ -3675,64 +3675,64 @@ void ov12_0222A8F4(UnkStruct_ov12_0221FCDC *param0) case 0: switch (v5) { case 2: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; case 3: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; case 4: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; case 5: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; } break; case 2: switch (v5) { case 2: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; case 3: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; case 4: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; case 5: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; } break; case 1: switch (v6) { case 2: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; case 3: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; case 4: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; case 5: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; } break; case 3: switch (v6) { case 2: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; case 3: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; case 4: - sub_0200D474(v0->unk_1C, 20); + CellActorData_SetPriority(v0->unk_1C, 20); break; case 5: - sub_0200D474(v0->unk_1C, 10); + CellActorData_SetPriority(v0->unk_1C, 10); break; } break; @@ -3761,10 +3761,10 @@ static void ov12_0222AB10(SysTask *param0, void *param1) continue; } - sub_0200D330(v1->unk_1C[v0]); + CellActorData_UpdateObject(v1->unk_1C[v0]); } - sub_0200C7EC(v1->unk_00.unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_00.unk_0C); } void ov12_0222AB50(UnkStruct_ov12_0221FCDC *param0) @@ -3793,7 +3793,7 @@ void ov12_0222AB50(UnkStruct_ov12_0221FCDC *param0) v0->unk_1C[v1] = ov12_022202C0(v0->unk_00.unk_04, v1); if (v0->unk_1C[v1] != NULL) { - sub_0200D474(v0->unk_1C[v1], v2[v1]); + CellActorData_SetPriority(v0->unk_1C[v1], v2[v1]); } } } diff --git a/src/overlay012/ov12_0222AC70.c b/src/overlay012/ov12_0222AC70.c index c7a40bf67c..007c30934f 100644 --- a/src/overlay012/ov12_0222AC70.c +++ b/src/overlay012/ov12_0222AC70.c @@ -26,9 +26,9 @@ #include "cell_actor.h" #include "heap.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0201F834.h" typedef struct { @@ -308,20 +308,20 @@ static void ov12_0222AC70(SysTask *param0, void *param1) if (v1->unk_01[v0] >= Unk_ov12_0223A09E[v0][1]) { v1->unk_01[v0] = 0; - if (sub_0200D408(v1->unk_14[v0]) == 1) { - SpriteActor_EnableObject(v1->unk_14[v0], 0); + if (CellActorData_GetDrawFlag(v1->unk_14[v0]) == 1) { + CellActorData_DrawSprite(v1->unk_14[v0], 0); } else { - SpriteActor_EnableObject(v1->unk_14[v0], 1); + CellActorData_DrawSprite(v1->unk_14[v0], 1); } } } else { - SpriteActor_EnableObject(v1->unk_14[v0], 0); + CellActorData_DrawSprite(v1->unk_14[v0], 0); } } if (v1->unk_04 >= 45) { for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { - SpriteActor_EnableObject(v1->unk_14[v0], 1); + CellActorData_DrawSprite(v1->unk_14[v0], 1); } v1->unk_04 = 0; @@ -363,7 +363,7 @@ static void ov12_0222AC70(SysTask *param0, void *param1) break; default: for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { - sub_0200D0F4(v1->unk_14[v0]); + CellActorData_Delete(v1->unk_14[v0]); } ov12_02220220(v1->unk_08, param0); @@ -372,10 +372,10 @@ static void ov12_0222AC70(SysTask *param0, void *param1) } for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { - SpriteActor_UpdateObject(v1->unk_14[v0]->unk_00); + CellActor_UpdateObject(v1->unk_14[v0]->cellActor); } - sub_0200C7EC(v1->unk_10); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_10); } void ov12_0222AE68(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -415,11 +415,11 @@ void ov12_0222AE68(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } for (v0 = 1; v0 < ov12_02220280(v1->unk_08, 0); v0++) { - v1->unk_14[v0] = SpriteActor_LoadResources(v1->unk_0C, v1->unk_10, &v2); - SpriteActor_SetSpritePositionXY(v1->unk_14[v0], v3.unk_00, v3.unk_02); + v1->unk_14[v0] = CellActor_LoadResources(v1->unk_0C, v1->unk_10, &v2); + CellActorData_SetPositionXY(v1->unk_14[v0], v3.unk_00, v3.unk_02); } - SpriteActor_SetSpritePositionXY(v1->unk_14[0], v3.unk_00, v3.unk_02); + CellActorData_SetPositionXY(v1->unk_14[0], v3.unk_00, v3.unk_02); } for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { @@ -655,10 +655,10 @@ static void ov12_0222B4C8(SysTask *param0, void *param1) if (ov12_02225C14(&v2->unk_28[v0]) == 0) { v1++; } else { - SpriteActor_SetSpritePositionXY(v2->unk_18[v0], v2->unk_28[v0].unk_00, v2->unk_28[v0].unk_02); + CellActorData_SetPositionXY(v2->unk_18[v0], v2->unk_28[v0].unk_00, v2->unk_28[v0].unk_02); } - sub_0200D330(v2->unk_18[v0]); + CellActorData_UpdateObject(v2->unk_18[v0]); } if (v1 == 4) { @@ -690,7 +690,7 @@ static void ov12_0222B4C8(SysTask *param0, void *param1) return; } - sub_0200C7EC(v2->unk_14); + SpriteGfxHandler_UpdateCellActorCollection(v2->unk_14); } void ov12_0222B68C(UnkStruct_ov12_0221FCDC *param0) @@ -726,38 +726,38 @@ void ov12_0222B68C(UnkStruct_ov12_0221FCDC *param0) } if (ov12_0223525C(v0->unk_0C, ov12_02220240(v0->unk_0C)) == 0x3) { - sub_0200D474(v0->unk_18[0], 10); - sub_0200D474(v0->unk_18[1], 10); - sub_0200D474(v0->unk_18[2], 20); - sub_0200D474(v0->unk_18[3], 20); - sub_0200D460(v0->unk_18[0], v4); - sub_0200D460(v0->unk_18[1], v4); - sub_0200D460(v0->unk_18[2], v4); - sub_0200D460(v0->unk_18[3], v4); - - v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[0]->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + CellActorData_SetPriority(v0->unk_18[0], 10); + CellActorData_SetPriority(v0->unk_18[1], 10); + CellActorData_SetPriority(v0->unk_18[2], 20); + CellActorData_SetPriority(v0->unk_18[3], 20); + CellActorData_SetExplicitPriority(v0->unk_18[0], v4); + CellActorData_SetExplicitPriority(v0->unk_18[1], v4); + CellActorData_SetExplicitPriority(v0->unk_18[2], v4); + CellActorData_SetExplicitPriority(v0->unk_18[3], v4); + + v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[0]->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_0C), v5, v3, ov12_0221FDE4(param0), 2, 0x20, v2 * 16, 128, 128, 128); - v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[2]->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[2]->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_0C), v5, v3, ov12_0221FDE4(param0), 2, 0x20, v2 * 16, 196, 196, 196); } else { - sub_0200D474(v0->unk_18[0], 20); - sub_0200D474(v0->unk_18[1], 20); - sub_0200D474(v0->unk_18[2], 10); - sub_0200D474(v0->unk_18[3], 10); - sub_0200D460(v0->unk_18[0], v4 + 1); - sub_0200D460(v0->unk_18[1], v4 + 1); - sub_0200D460(v0->unk_18[2], v4 + 1); - sub_0200D460(v0->unk_18[3], v4 + 1); - sub_0200D460(v0->unk_18[0], v4); - sub_0200D460(v0->unk_18[1], v4); - sub_0200D460(v0->unk_18[2], v4); - sub_0200D460(v0->unk_18[3], v4); - - v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[0]->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + CellActorData_SetPriority(v0->unk_18[0], 20); + CellActorData_SetPriority(v0->unk_18[1], 20); + CellActorData_SetPriority(v0->unk_18[2], 10); + CellActorData_SetPriority(v0->unk_18[3], 10); + CellActorData_SetExplicitPriority(v0->unk_18[0], v4 + 1); + CellActorData_SetExplicitPriority(v0->unk_18[1], v4 + 1); + CellActorData_SetExplicitPriority(v0->unk_18[2], v4 + 1); + CellActorData_SetExplicitPriority(v0->unk_18[3], v4 + 1); + CellActorData_SetExplicitPriority(v0->unk_18[0], v4); + CellActorData_SetExplicitPriority(v0->unk_18[1], v4); + CellActorData_SetExplicitPriority(v0->unk_18[2], v4); + CellActorData_SetExplicitPriority(v0->unk_18[3], v4); + + v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[0]->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_0C), v5, v3, ov12_0221FDE4(param0), 2, 0x20, v2 * 16, 196, 196, 196); - v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[2]->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_18[2]->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_0C), v5, v3, ov12_0221FDE4(param0), 2, 0x20, v2 * 16, 128, 128, 128); } } @@ -1091,8 +1091,8 @@ static void ov12_0222BFF4(SysTask *param0, void *param1) } break; case 1: - SpriteActor_EnableObject(v0->unk_0C, 1); - SpriteActor_EnableObject(v0->unk_10, 1); + CellActorData_DrawSprite(v0->unk_0C, 1); + CellActorData_DrawSprite(v0->unk_10, 1); SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_OBJWND); v0->unk_00++; break; @@ -1100,8 +1100,8 @@ static void ov12_0222BFF4(SysTask *param0, void *param1) if ((++v0->unk_01) >= 10) { G2_SetWndOutsidePlane((GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3 | GX_WND_PLANEMASK_OBJ), 0); G2_SetWndOBJInsidePlane((GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3 | GX_WND_PLANEMASK_OBJ), 0); - SpriteActor_EnableObject(v0->unk_0C, 0); - SpriteActor_EnableObject(v0->unk_10, 0); + CellActorData_DrawSprite(v0->unk_0C, 0); + CellActorData_DrawSprite(v0->unk_10, 0); v0->unk_01 = 0; v0->unk_00++; } @@ -1113,9 +1113,9 @@ static void ov12_0222BFF4(SysTask *param0, void *param1) return; } - sub_0200D330(v0->unk_0C); - sub_0200D330(v0->unk_10); - sub_0200C7EC(v0->unk_08); + CellActorData_UpdateObject(v0->unk_0C); + CellActorData_UpdateObject(v0->unk_10); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_0222C0C0(UnkStruct_ov12_0221FCDC *param0) @@ -1138,12 +1138,12 @@ void ov12_0222C0C0(UnkStruct_ov12_0221FCDC *param0) int v2 = ov12_02223334(v0->unk_04, ov12_02220240(v0->unk_04)); int v3 = ov12_02223344(v0->unk_04, ov12_02220240(v0->unk_04)); - v1 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_0C->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + v1 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_0C->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_04), v3, v2, ov12_0221FDE4(param0), 2, 0x20, v1 * 16, 256, 256, 256); } - SpriteActor_EnableObject(v0->unk_0C, 0); - SpriteActor_EnableObject(v0->unk_10, 0); + CellActorData_DrawSprite(v0->unk_0C, 0); + CellActorData_DrawSprite(v0->unk_10, 0); ov12_022201E8(v0->unk_04, ov12_0222BFF4, v0); } @@ -1192,7 +1192,7 @@ static void ov12_0222C1A4(SysTask *param0, void *param1) break; } - sub_0200D330(v2->unk_18[v0].unk_04); + CellActorData_UpdateObject(v2->unk_18[v0].unk_04); } if (v1 >= 3) { @@ -1205,7 +1205,7 @@ static void ov12_0222C1A4(SysTask *param0, void *param1) s16 v6; SpriteActor_GetSpritePositionXY(v2->unk_18[v0].unk_04, &v5, &v6); - SpriteActor_SetSpritePositionXY(v2->unk_18[v0].unk_04, v5, v2->unk_02); + CellActorData_SetPositionXY(v2->unk_18[v0].unk_04, v5, v2->unk_02); sub_0200D6E8(v2->unk_18[v0].unk_04, 1.0f * v2->unk_08, 1.0f); } v2->unk_18[v0].unk_00 = 0; @@ -1252,7 +1252,7 @@ static void ov12_0222C1A4(SysTask *param0, void *param1) return; } - sub_0200C7EC(v2->unk_14); + SpriteGfxHandler_UpdateCellActorCollection(v2->unk_14); } void ov12_0222C3C0(UnkStruct_ov12_0221FCDC *param0) @@ -1283,7 +1283,7 @@ void ov12_0222C3C0(UnkStruct_ov12_0221FCDC *param0) sub_0200D6A4(v0->unk_18[v1].unk_04, 2); SpriteActor_SetOAMMode(v0->unk_18[v1].unk_04, GX_OAM_MODE_XLU); - sub_0200D474(v0->unk_18[v1].unk_04, v1 + 1); + CellActorData_SetPriority(v0->unk_18[v1].unk_04, v1 + 1); } } @@ -1427,9 +1427,9 @@ static void ov12_0222C678(SysTask *param0, void *param1) ov12_02226138(&v0->unk_1C); ov12_02226454(&v0->unk_64); - SpriteActor_SetSpritePositionXY(v0->unk_18, v0->unk_40.unk_00, v0->unk_40.unk_02); - sub_0200D330(v0->unk_18); - sub_0200C7EC(v0->unk_10); + CellActorData_SetPositionXY(v0->unk_18, v0->unk_40.unk_00, v0->unk_40.unk_02); + CellActorData_UpdateObject(v0->unk_18); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_10); break; default: ov12_02220220(v0->unk_0C, param0); @@ -1678,13 +1678,13 @@ static void ov12_0222CACC(SysTask *param0, void *param1) if (ov12_02226138(&v1->unk_40[0]) == 0) { v1->unk_00.unk_00++; } else { - SpriteActor_SetSpritePositionXY(v1->unk_38[0], +v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); - SpriteActor_SetSpritePositionXY(v1->unk_38[1], -v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); - sub_0200D330(v1->unk_38[0]); - sub_0200D330(v1->unk_38[1]); + CellActorData_SetPositionXY(v1->unk_38[0], +v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); + CellActorData_SetPositionXY(v1->unk_38[1], -v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); + CellActorData_UpdateObject(v1->unk_38[0]); + CellActorData_UpdateObject(v1->unk_38[1]); } - sub_0200C7EC(v1->unk_00.unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_00.unk_0C); break; default: ov12_02220220(v1->unk_00.unk_04, param0); @@ -1716,7 +1716,7 @@ static void ov12_0222CBFC(SysTask *param0, void *param1) UnkStruct_ov12_0222CBFC *v1 = (UnkStruct_ov12_0222CBFC *)param1; if (ov12_02225D2C(&v1->unk_8C[0], &v1->unk_8C[1], v1->unk_38) == 0) { - sub_0200D0F4(v1->unk_38); + CellActorData_Delete(v1->unk_38); ov12_02220220(v1->unk_10.unk_04, param0); ov12_02235E80(v1); (v1) = NULL; @@ -1727,8 +1727,8 @@ static void ov12_0222CBFC(SysTask *param0, void *param1) sub_0200D79C(v1->unk_38, v1->unk_D4.unk_00); } - sub_0200D330(v1->unk_38); - sub_0200C7EC(v1->unk_10.unk_10); + CellActorData_UpdateObject(v1->unk_38); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_10.unk_10); } void ov12_0222CC54(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -1774,7 +1774,7 @@ void ov12_0222CC54(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri sub_0200D79C(v2->unk_38, v2->unk_D4.unk_00); ov12_02225D2C(&v2->unk_8C[0], &v2->unk_8C[1], v2->unk_38); - sub_0200D330(v2->unk_38); + CellActorData_UpdateObject(v2->unk_38); ov12_022201E8(v2->unk_10.unk_04, ov12_0222CBFC, v2); } @@ -1798,7 +1798,7 @@ static void ov12_0222CDF0(SysTask *param0, void *param1) ov12_02225FA4(&v0->unk_9C, &v1, &v2); sub_0200D6E8(v0->unk_40, v1, v2); v3 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); - SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); + CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); if (v0->unk_0C < v0->unk_10) { v0->unk_0C++; @@ -1826,7 +1826,7 @@ static void ov12_0222CDF0(SysTask *param0, void *param1) ov12_02225FA4(&v0->unk_9C, &v4, &v5); sub_0200D6E8(v0->unk_40, v4, v5); v6 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); - SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v6); + CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v6); if (v0->unk_0C > v0->unk_0E) { v0->unk_0C--; @@ -1840,16 +1840,16 @@ static void ov12_0222CDF0(SysTask *param0, void *param1) } break; default: - sub_0200D0F4(v0->unk_44[0]); - sub_0200D0F4(v0->unk_44[1]); + CellActorData_Delete(v0->unk_44[0]); + CellActorData_Delete(v0->unk_44[1]); ov12_02220220(v0->unk_18.unk_04, param0); ov12_02235E80(v0); (v0) = NULL; return; } - sub_0200D330(v0->unk_40); - sub_0200C7EC(v0->unk_18.unk_10); + CellActorData_UpdateObject(v0->unk_40); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_18.unk_10); } void ov12_0222CFA0(UnkStruct_ov12_0221FCDC *param0) @@ -1881,32 +1881,32 @@ void ov12_0222CFA0(UnkStruct_ov12_0221FCDC *param0) if (ov12_0221FDD4(param0) == 1) { v0->unk_40 = v0->unk_44[0]; - SpriteActor_EnableObject(v0->unk_44[1], 0); - sub_0200D364(v0->unk_40, 0); + CellActorData_DrawSprite(v0->unk_44[1], 0); + CellActorData_SetAnim(v0->unk_40, 0); v0->unk_14.unk_00 = 255 - 76; v0->unk_14.unk_02 = 120; - sub_0200D460(v0->unk_40, ov12_0222339C(param0) + 1); + CellActorData_SetExplicitPriority(v0->unk_40, ov12_0222339C(param0) + 1); v0->unk_12 = -1; } else { if (ov12_0223525C(param0, ov12_02220240(param0)) == 0x4) { v0->unk_40 = v0->unk_44[1]; - SpriteActor_EnableObject(v0->unk_44[0], 0); - sub_0200D364(v0->unk_40, 1); + CellActorData_DrawSprite(v0->unk_44[0], 0); + CellActorData_SetAnim(v0->unk_40, 1); v0->unk_14.unk_00 = 144; v0->unk_14.unk_02 = 64; } else { v0->unk_40 = v0->unk_44[0]; - SpriteActor_EnableObject(v0->unk_44[1], 0); - sub_0200D364(v0->unk_40, 0); + CellActorData_DrawSprite(v0->unk_44[1], 0); + CellActorData_SetAnim(v0->unk_40, 0); v0->unk_14.unk_00 = 76; v0->unk_14.unk_02 = 120; - sub_0200D460(v0->unk_40, ov12_0222339C(param0) + 1); + CellActorData_SetExplicitPriority(v0->unk_40, ov12_0222339C(param0) + 1); } v0->unk_12 = +1; } - SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02); + CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02); sub_0200D6A4(v0->unk_40, 2); SpriteActor_SetOAMMode(v0->unk_40, GX_OAM_MODE_XLU); @@ -1921,7 +1921,7 @@ void ov12_0222CFA0(UnkStruct_ov12_0221FCDC *param0) sub_0200D6E8(v0->unk_40, v1, v2); v3 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); - SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); + CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); } ov12_022201E8(v0->unk_18.unk_04, ov12_0222CDF0, v0); @@ -2086,7 +2086,7 @@ static void ov12_0222D128(SysTask *param0, void *param1) } break; default: for (v0 = 0; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - sub_0200D0F4(v1->unk_30[v0].unk_00); + CellActorData_Delete(v1->unk_30[v0].unk_00); } ov12_02220220(v1->unk_10, param0); @@ -2101,12 +2101,12 @@ static void ov12_0222D128(SysTask *param0, void *param1) SpriteActor_GetSpritePositionXY(v1->unk_30[v0].unk_00, &v18, &v19); if (v19 < 80) { - sub_0200D460(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10)); + CellActorData_SetExplicitPriority(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10)); } else { if (v18 > 128) { - sub_0200D460(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10)); + CellActorData_SetExplicitPriority(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10)); } else { - sub_0200D460(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10) + 1); + CellActorData_SetExplicitPriority(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10) + 1); } } } @@ -2117,10 +2117,10 @@ static void ov12_0222D128(SysTask *param0, void *param1) } for (v0 = 0; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - sub_0200D330(v1->unk_30[v0].unk_00); + CellActorData_UpdateObject(v1->unk_30[v0].unk_00); } - sub_0200C7EC(v1->unk_18); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_18); } void ov12_0222D56C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -2150,21 +2150,21 @@ void ov12_0222D56C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri { for (v0 = 1; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - v1->unk_30[v0].unk_00 = SpriteActor_LoadResources(v1->unk_14, v1->unk_18, &v2); + v1->unk_30[v0].unk_00 = CellActor_LoadResources(v1->unk_14, v1->unk_18, &v2); } } for (v0 = 0; v0 < ov12_02220280(v1->unk_10, 0); v0++) { SpriteActor_SetOAMMode(v1->unk_30[v0].unk_00, GX_OAM_MODE_XLU); - sub_0200D460(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10) + 1); + CellActorData_SetExplicitPriority(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10) + 1); } if (ov12_0221FDD4(param0) == 1) { - SpriteActor_SetSpritePositionXY(v1->unk_30[0].unk_00, 180 - 20, (40 - 16 + 20 + 10)); - SpriteActor_SetSpritePositionXY(v1->unk_30[1].unk_00, 100 - 20, (25 - 16 + 20 + 10)); + CellActorData_SetPositionXY(v1->unk_30[0].unk_00, 180 - 20, (40 - 16 + 20 + 10)); + CellActorData_SetPositionXY(v1->unk_30[1].unk_00, 100 - 20, (25 - 16 + 20 + 10)); } else { - SpriteActor_SetSpritePositionXY(v1->unk_30[0].unk_00, 100, (40 - 16 + 20 + 10)); - SpriteActor_SetSpritePositionXY(v1->unk_30[1].unk_00, 180, (25 - 16 + 20 + 10)); + CellActorData_SetPositionXY(v1->unk_30[0].unk_00, 100, (40 - 16 + 20 + 10)); + CellActorData_SetPositionXY(v1->unk_30[1].unk_00, 180, (25 - 16 + 20 + 10)); } ov12_022201E8(v1->unk_10, ov12_0222D128, v1); diff --git a/src/overlay012/ov12_0222D6B0.c b/src/overlay012/ov12_0222D6B0.c index 5fd2c489a8..ed17f633b2 100644 --- a/src/overlay012/ov12_0222D6B0.c +++ b/src/overlay012/ov12_0222D6B0.c @@ -22,9 +22,9 @@ #include "bg_window.h" #include "heap.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct { @@ -173,7 +173,7 @@ static void ov12_0222D6B0(SysTask *param0, void *param1) break; default: for (v0 = 0; v0 < v1->unk_05; v0++) { - sub_0200D0F4(v1->unk_14[v0]); + CellActorData_Delete(v1->unk_14[v0]); } ov12_02220220(v1->unk_08, param0); @@ -183,10 +183,10 @@ static void ov12_0222D6B0(SysTask *param0, void *param1) } for (v0 = 0; v0 < v1->unk_05; v0++) { - SpriteActor_UpdateObject(v1->unk_14[v0]->unk_00); + CellActor_UpdateObject(v1->unk_14[v0]->cellActor); } - sub_0200C7EC(v1->unk_10); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_10); } void ov12_0222D7C0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -217,26 +217,26 @@ void ov12_0222D7C0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri { for (v0 = 1; v0 < v1->unk_05; v0++) { - v1->unk_14[v0] = SpriteActor_LoadResources(v1->unk_0C, v1->unk_10, &v2); + v1->unk_14[v0] = CellActor_LoadResources(v1->unk_0C, v1->unk_10, &v2); } } if (ov12_0223525C(param0, ov12_02220248(param0)) == 0x3) { if ((ov12_0223525C(param0, ov12_02220248(param0)) == 0x3) && (ov12_0223525C(param0, ov12_02220240(param0)) == 0x3)) { - sub_0200D364(v1->unk_14[0], 0); + CellActorData_SetAnim(v1->unk_14[0], 0); } else { - sub_0200D364(v1->unk_14[0], 1); + CellActorData_SetAnim(v1->unk_14[0], 1); } - SpriteActor_SetSpritePositionXY(v1->unk_14[0], 128, 80); + CellActorData_SetPositionXY(v1->unk_14[0], 128, 80); } else { if ((ov12_0223525C(param0, ov12_02220248(param0)) == 0x4) && (ov12_0223525C(param0, ov12_02220240(param0)) == 0x4)) { - sub_0200D364(v1->unk_14[0], 1); + CellActorData_SetAnim(v1->unk_14[0], 1); } else { - sub_0200D364(v1->unk_14[0], 0); + CellActorData_SetAnim(v1->unk_14[0], 0); } - SpriteActor_SetSpritePositionXY(v1->unk_14[0], 128, 80); + CellActorData_SetPositionXY(v1->unk_14[0], 128, 80); } for (v0 = 0; v0 < v1->unk_05; v0++) { @@ -314,21 +314,21 @@ static void ov12_0222D934(SysTask *param0, void *param1) case 0: v2->unk_34 = v2->unk_18[0]; v2->unk_38 = v2->unk_18[3]; - SpriteActor_EnableObject(v2->unk_34, 1); - SpriteActor_EnableObject(v2->unk_38, 1); + CellActorData_DrawSprite(v2->unk_34, 1); + CellActorData_DrawSprite(v2->unk_38, 1); break; case 1: v2->unk_34 = v2->unk_18[1]; v2->unk_38 = v2->unk_18[2]; - SpriteActor_EnableObject(v2->unk_34, 1); - SpriteActor_EnableObject(v2->unk_38, 1); + CellActorData_DrawSprite(v2->unk_34, 1); + CellActorData_DrawSprite(v2->unk_38, 1); break; case 2: case 3: v2->unk_34 = v2->unk_18[4]; v2->unk_38 = v2->unk_18[5]; - SpriteActor_EnableObject(v2->unk_34, 1); - SpriteActor_EnableObject(v2->unk_38, 1); + CellActorData_DrawSprite(v2->unk_34, 1); + CellActorData_DrawSprite(v2->unk_38, 1); break; } @@ -362,8 +362,8 @@ static void ov12_0222D934(SysTask *param0, void *param1) if (v5 >= 2) { if (v2->unk_30 <= 3) { - SpriteActor_EnableObject(v2->unk_34, 0); - SpriteActor_EnableObject(v2->unk_38, 0); + CellActorData_DrawSprite(v2->unk_34, 0); + CellActorData_DrawSprite(v2->unk_38, 0); v2->unk_00--; } else { v2->unk_00++; @@ -391,7 +391,7 @@ static void ov12_0222D934(SysTask *param0, void *param1) break; default: for (v0 = 0; v0 < v2->unk_08; v0++) { - sub_0200D0F4(v2->unk_18[v0]); + CellActorData_Delete(v2->unk_18[v0]); } ov12_02220220(v2->unk_0C, param0); @@ -401,11 +401,11 @@ static void ov12_0222D934(SysTask *param0, void *param1) if ((v2->unk_00 < 3) && (v1 == 0)) { for (v0 = 0; v0 < v2->unk_08; v0++) { - SpriteActor_UpdateObject(v2->unk_18[v0]->unk_00); + CellActor_UpdateObject(v2->unk_18[v0]->cellActor); } } - sub_0200C7EC(v2->unk_14); + SpriteGfxHandler_UpdateCellActorCollection(v2->unk_14); } void ov12_0222DB60(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -438,29 +438,29 @@ void ov12_0222DB60(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri { for (v0 = 1; v0 < v1->unk_08; v0++) { - v1->unk_18[v0] = SpriteActor_LoadResources(v1->unk_10, v1->unk_14, &v2); + v1->unk_18[v0] = CellActor_LoadResources(v1->unk_10, v1->unk_14, &v2); } } - sub_0200D364(v1->unk_18[0], 0); - sub_0200D364(v1->unk_18[1], 0); - sub_0200D364(v1->unk_18[2], 1); - sub_0200D364(v1->unk_18[3], 1); - sub_0200D364(v1->unk_18[4], 2); - sub_0200D364(v1->unk_18[5], 3); + CellActorData_SetAnim(v1->unk_18[0], 0); + CellActorData_SetAnim(v1->unk_18[1], 0); + CellActorData_SetAnim(v1->unk_18[2], 1); + CellActorData_SetAnim(v1->unk_18[3], 1); + CellActorData_SetAnim(v1->unk_18[4], 2); + CellActorData_SetAnim(v1->unk_18[5], 3); sub_0200D7D4(v1->unk_18[0], 1); sub_0200D7D4(v1->unk_18[3], 1); for (v0 = 0; v0 < v1->unk_08; v0++) { - sub_0200D390(v1->unk_18[v0], 1); - SpriteActor_SetSpritePositionXY(v1->unk_18[v0], Unk_ov12_0223A162[v0].unk_00, Unk_ov12_0223A162[v0].unk_02); + CellActorData_SetAnimateFlag(v1->unk_18[v0], 1); + CellActorData_SetPositionXY(v1->unk_18[v0], Unk_ov12_0223A162[v0].unk_00, Unk_ov12_0223A162[v0].unk_02); SpriteActor_SetOAMMode(v1->unk_18[v0], GX_OAM_MODE_XLU); } - SpriteActor_EnableObject(v1->unk_18[1], 0); - SpriteActor_EnableObject(v1->unk_18[2], 0); - SpriteActor_EnableObject(v1->unk_18[4], 0); - SpriteActor_EnableObject(v1->unk_18[5], 0); + CellActorData_DrawSprite(v1->unk_18[1], 0); + CellActorData_DrawSprite(v1->unk_18[2], 0); + CellActorData_DrawSprite(v1->unk_18[4], 0); + CellActorData_DrawSprite(v1->unk_18[5], 0); ov12_022201CC(param0, ov12_0222D934, v1, 1100); } @@ -486,7 +486,7 @@ static void ov12_0222DC98(SysTask *param0, void *param1) break; case 1: if ((++v0->unk_0D) >= 3) { - SpriteActor_EnableObject(v0->unk_10, 1); + CellActorData_DrawSprite(v0->unk_10, 1); v0->unk_0D = 0; v0->unk_0C++; } @@ -543,7 +543,7 @@ static void ov12_0222DC98(SysTask *param0, void *param1) v3 = ov12_02225C50(&v0->unk_14, v0->unk_10); if (v3 == 0) { - SpriteActor_EnableObject(v0->unk_10, 0); + CellActorData_DrawSprite(v0->unk_10, 0); v0->unk_0C++; } else { break; @@ -555,7 +555,7 @@ static void ov12_0222DC98(SysTask *param0, void *param1) break; } - sub_0200D330(v0->unk_10); + CellActorData_UpdateObject(v0->unk_10); } static void ov12_0222DE24(SysTask *param0, void *param1) @@ -601,7 +601,7 @@ static void ov12_0222DE24(SysTask *param0, void *param1) } break; case 3: for (v0 = 0; v0 < v1->unk_02; v0++) { - sub_0200D0F4(v1->unk_14[v0].unk_10); + CellActorData_Delete(v1->unk_14[v0].unk_10); } v1->unk_00++; @@ -612,7 +612,7 @@ static void ov12_0222DE24(SysTask *param0, void *param1) return; } - sub_0200C7EC(v1->unk_10); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_10); } static const s16 Unk_ov12_0223A19A[][4] = { @@ -655,7 +655,7 @@ void ov12_0222DEFC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v1 = 0; v1 < v2->unk_02; v1++) { if (v1 != 0) { - v2->unk_14[v1].unk_10 = SpriteActor_LoadResources(v2->unk_0C, v2->unk_10, &v3); + v2->unk_14[v1].unk_10 = CellActor_LoadResources(v2->unk_0C, v2->unk_10, &v3); } v6 = v2->unk_14[v1].unk_10; @@ -673,10 +673,10 @@ void ov12_0222DEFC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v4 = Unk_ov12_0223A19A[v0][1] + (LCRNG_Next() % Unk_ov12_0223A19A[v0][3]); v5 = Unk_ov12_0223A19A[v0][0] + (LCRNG_Next() % Unk_ov12_0223A19A[v0][2]); - SpriteActor_SetSpritePositionXY(v6, v4, v5); + CellActorData_SetPositionXY(v6, v4, v5); sub_0200D6A4(v6, 2); sub_0200D6E8(v6, v2->unk_14[v1].unk_38, v2->unk_14[v1].unk_38); - SpriteActor_EnableObject(v6, 0); + CellActorData_DrawSprite(v6, 0); ov12_022201CC(param0, ov12_0222DC98, &v2->unk_14[v1], 1100 - 1); @@ -742,9 +742,9 @@ static void ov12_0222E080(SysTask *param0, void *param1) return; } - sub_0200D330(v0->unk_24); - sub_0200D330(v0->unk_20); - sub_0200C7EC(v0->unk_04.unk_0C); + CellActorData_UpdateObject(v0->unk_24); + CellActorData_UpdateObject(v0->unk_20); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04.unk_0C); } void ov12_0222E1A8(UnkStruct_ov12_0221FCDC *param0) @@ -773,8 +773,8 @@ void ov12_0222E1A8(UnkStruct_ov12_0221FCDC *param0) void ov12_0222E248(CellActorData *param0) { - if (sub_0200D408(param0) == 1) { - sub_0200D330(param0); + if (CellActorData_GetDrawFlag(param0) == 1) { + CellActorData_UpdateObject(param0); } } @@ -800,14 +800,14 @@ static void ov12_0222E25C(SysTask *param0, void *param1) v0->unk_1E[v1]++; if (v0->unk_1E[v1] >= 40) { - SpriteActor_EnableObject(v0->unk_28[v1], 0); + CellActorData_DrawSprite(v0->unk_28[v1], 0); v2++; } } if (v2 == 4) { for (v1 = 0; v1 < 4; v1++) { - sub_0200D0F4(v0->unk_28[v1]); + CellActorData_Delete(v0->unk_28[v1]); } ov12_02220220(v0->unk_00.unk_04, param0); @@ -816,7 +816,7 @@ static void ov12_0222E25C(SysTask *param0, void *param1) } } - sub_0200C7EC(v0->unk_00.unk_10); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_10); } void ov12_0222E2F8(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -839,7 +839,7 @@ void ov12_0222E2F8(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v1 = 1; v1 < 4; v1++) { v0->unk_1E[v1] = 0; - v0->unk_28[v1] = SpriteActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v2); + v0->unk_28[v1] = CellActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v2); } sub_0200D7D4(v0->unk_28[0], 1); @@ -942,7 +942,7 @@ static void ov12_0222E390(SysTask *param0, void *param1) if (v2 == 4) { for (v1 = 0; v1 < 4; v1++) { - sub_0200D0F4(v0->unk_2C[v1]); + CellActorData_Delete(v0->unk_2C[v1]); } for (v1 = 0; v1 < 6; v1++) { @@ -955,7 +955,7 @@ static void ov12_0222E390(SysTask *param0, void *param1) } } - sub_0200C7EC(v0->unk_00.unk_10); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_10); } void ov12_0222E61C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -979,7 +979,7 @@ void ov12_0222E61C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v1 = 1; v1 < 4; v1++) { v0->unk_22[v1] = (LCRNG_Next() % 4) + (v1 * 5); - v0->unk_2C[v1] = SpriteActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); + v0->unk_2C[v1] = CellActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); } sub_0200D7D4(v0->unk_2C[1], 1); @@ -1004,7 +1004,7 @@ void ov12_0222E61C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } for (v1 = 0; v1 < 4; v1++) { - SpriteActor_SetSpritePositionXY(v0->unk_2C[v1], v5, v6); + CellActorData_SetPositionXY(v0->unk_2C[v1], v5, v6); } } @@ -1012,18 +1012,18 @@ void ov12_0222E61C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v3 = 24; v2 = 16; - sub_0200D474(v0->unk_2C[0], 10); - sub_0200D474(v0->unk_2C[2], 10); - sub_0200D474(v0->unk_2C[1], 18); - sub_0200D474(v0->unk_2C[3], 18); + CellActorData_SetPriority(v0->unk_2C[0], 10); + CellActorData_SetPriority(v0->unk_2C[2], 10); + CellActorData_SetPriority(v0->unk_2C[1], 18); + CellActorData_SetPriority(v0->unk_2C[3], 18); } else { v3 = 0; v2 = 8; - sub_0200D474(v0->unk_2C[0], 18); - sub_0200D474(v0->unk_2C[2], 18); - sub_0200D474(v0->unk_2C[1], 10); - sub_0200D474(v0->unk_2C[3], 10); + CellActorData_SetPriority(v0->unk_2C[0], 18); + CellActorData_SetPriority(v0->unk_2C[2], 18); + CellActorData_SetPriority(v0->unk_2C[1], 10); + CellActorData_SetPriority(v0->unk_2C[3], 10); } v2 = 4; @@ -1035,6 +1035,6 @@ void ov12_0222E61C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri sub_0200D5DC(v0->unk_2C[1], +40, +v2); } - v0->unk_1C = sub_0200D43C(v0->unk_2C[0]); + v0->unk_1C = CellActorData_GetExplicitPaletteOffset(v0->unk_2C[0]); ov12_022201E8(v0->unk_00.unk_04, ov12_0222E390, v0); } diff --git a/src/overlay012/ov12_0222E784.c b/src/overlay012/ov12_0222E784.c index 103cca7e13..d19f054869 100644 --- a/src/overlay012/ov12_0222E784.c +++ b/src/overlay012/ov12_0222E784.c @@ -11,9 +11,9 @@ #include "overlay012/struct_ov12_0223595C.h" #include "overlay012/struct_ov12_02235998.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" typedef struct { UnkStruct_ov12_0223595C unk_00; @@ -32,9 +32,9 @@ static void ov12_0222E784(SysTask *param0, void *param1) switch (v0->unk_00.unk_00) { case 0: if (ov12_02225F6C(&v0->unk_60) == 0) { - SpriteActor_EnableObject(v0->unk_1C.unk_0C, 0); - SpriteActor_EnableObject(v0->unk_30[0].unk_0C, 0); - SpriteActor_EnableObject(v0->unk_30[0].unk_0C, 0); + CellActorData_DrawSprite(v0->unk_1C.unk_0C, 0); + CellActorData_DrawSprite(v0->unk_30[0].unk_0C, 0); + CellActorData_DrawSprite(v0->unk_30[0].unk_0C, 0); ov12_02220220(v0->unk_00.unk_04, param0); ov12_02235E80(v0); @@ -55,10 +55,10 @@ static void ov12_0222E784(SysTask *param0, void *param1) return; } - sub_0200D330(v0->unk_1C.unk_0C); - sub_0200D330(v0->unk_30[0].unk_0C); - sub_0200D330(v0->unk_30[1].unk_0C); - sub_0200C7EC(v0->unk_00.unk_0C); + CellActorData_UpdateObject(v0->unk_1C.unk_0C); + CellActorData_UpdateObject(v0->unk_30[0].unk_0C); + CellActorData_UpdateObject(v0->unk_30[1].unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_0C); } void ov12_0222E810(UnkStruct_ov12_0221FCDC *param0) @@ -76,9 +76,9 @@ void ov12_0222E810(UnkStruct_ov12_0221FCDC *param0) v0->unk_30[1].unk_0C = ov12_022202C0(param0, 2); sub_0200D6A4(v0->unk_1C.unk_0C, 2); - sub_0200D460(v0->unk_1C.unk_0C, ov12_0222339C(param0)); - sub_0200D460(v0->unk_30[0].unk_0C, ov12_0222339C(param0)); - sub_0200D460(v0->unk_30[1].unk_0C, ov12_0222339C(param0)); + CellActorData_SetExplicitPriority(v0->unk_1C.unk_0C, ov12_0222339C(param0)); + CellActorData_SetExplicitPriority(v0->unk_30[0].unk_0C, ov12_0222339C(param0)); + CellActorData_SetExplicitPriority(v0->unk_30[1].unk_0C, ov12_0222339C(param0)); { int v1; @@ -86,13 +86,13 @@ void ov12_0222E810(UnkStruct_ov12_0221FCDC *param0) v1 = ov12_022232B8(v0->unk_00.unk_04, ov12_02220248(v0->unk_00.unk_04)); if ((v1 == 3) || (v1 == 4)) { - sub_0200D474(v0->unk_1C.unk_0C, 30); - sub_0200D474(v0->unk_30[0].unk_0C, 50); - sub_0200D474(v0->unk_30[1].unk_0C, 70); + CellActorData_SetPriority(v0->unk_1C.unk_0C, 30); + CellActorData_SetPriority(v0->unk_30[0].unk_0C, 50); + CellActorData_SetPriority(v0->unk_30[1].unk_0C, 70); } else { - sub_0200D474(v0->unk_1C.unk_0C, 60); - sub_0200D474(v0->unk_30[0].unk_0C, 70); - sub_0200D474(v0->unk_30[1].unk_0C, 50); + CellActorData_SetPriority(v0->unk_1C.unk_0C, 60); + CellActorData_SetPriority(v0->unk_30[0].unk_0C, 70); + CellActorData_SetPriority(v0->unk_30[1].unk_0C, 50); } } diff --git a/src/overlay012/ov12_0222E91C.c b/src/overlay012/ov12_0222E91C.c index feac995da4..9adb482980 100644 --- a/src/overlay012/ov12_0222E91C.c +++ b/src/overlay012/ov12_0222E91C.c @@ -27,9 +27,9 @@ #include "heap.h" #include "palette.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0201F834.h" typedef struct { @@ -142,8 +142,8 @@ static void ov12_0222E91C(SysTask *param0, void *param1) return; } - sub_0200D330(v0->unk_1C.unk_0C); - sub_0200C7EC(v0->unk_00.unk_0C); + CellActorData_UpdateObject(v0->unk_1C.unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_0C); } void ov12_0222EAA0(UnkStruct_ov12_0221FCDC *param0) @@ -173,15 +173,15 @@ void ov12_0222EAA0(UnkStruct_ov12_0221FCDC *param0) int v4 = ov12_02223344(v0->unk_00.unk_04, ov12_02220240(v0->unk_00.unk_04)); v1 = v0->unk_1C.unk_0C; - sub_0200D460(v1, ov12_0222339C(v0->unk_00.unk_04) + 1); - v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + CellActorData_SetExplicitPriority(v1, ov12_0222339C(v0->unk_00.unk_04) + 1); + v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_00.unk_04), v4, v3, ov12_0221FDE4(v0->unk_00.unk_04), 2, 0x20, v2 * 16, 196, 196, 196); SpriteActor_SetOAMMode(v1, GX_OAM_MODE_XLU); v1 = v0->unk_30; - sub_0200D460(v1, ov12_0222339C(v0->unk_00.unk_04) + 1); - v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + CellActorData_SetExplicitPriority(v1, ov12_0222339C(v0->unk_00.unk_04) + 1); + v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_00.unk_04), v4, v3, ov12_0221FDE4(v0->unk_00.unk_04), 2, 0x20, v2 * 16, 196, 196, 196); SpriteActor_SetOAMMode(v1, GX_OAM_MODE_XLU); @@ -208,14 +208,14 @@ static void ov12_0222EC18(SysTask *param0, void *param1) ov12_0222E248(v0->unk_30[v1]); if (v0->unk_1E[v1] >= 160) { - SpriteActor_EnableObject(v0->unk_30[v1], 0); + CellActorData_DrawSprite(v0->unk_30[v1], 0); v2++; } } if (v2 == 8) { for (v1 = 0; v1 < 8; v1++) { - sub_0200D0F4(v0->unk_30[v1]); + CellActorData_Delete(v0->unk_30[v1]); } ov12_02220220(v0->unk_00.unk_04, param0); @@ -224,7 +224,7 @@ static void ov12_0222EC18(SysTask *param0, void *param1) } } - sub_0200C7EC(v0->unk_00.unk_10); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_10); } void ov12_0222EC90(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -247,7 +247,7 @@ void ov12_0222EC90(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_30[0] = param3; for (v1 = 1; v1 < 8; v1++) { - v0->unk_30[v1] = SpriteActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); + v0->unk_30[v1] = CellActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); if (v1 % 2) { sub_0200D7D4(v0->unk_30[v1], 1); @@ -285,7 +285,7 @@ void ov12_0222EC90(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if (v11 % 2) { if (v13 == 0) { if (v12 < 8) { - SpriteActor_SetSpritePositionXY(v0->unk_30[v12], v0->unk_50.unk_00, v0->unk_50.unk_02); + CellActorData_SetPositionXY(v0->unk_30[v12], v0->unk_50.unk_00, v0->unk_50.unk_02); v12++; } } else { @@ -307,22 +307,22 @@ void ov12_0222EC90(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if (ov12_0221FDD4(v0->unk_00.unk_04) == 0) { if (ov12_0223525C(v0->unk_00.unk_04, ov12_02220240(v0->unk_00.unk_04)) == 0x3) { if (v1 < 4) { - sub_0200D460(v0->unk_30[v1], v15); + CellActorData_SetExplicitPriority(v0->unk_30[v1], v15); } else { - sub_0200D460(v0->unk_30[v1], v14); + CellActorData_SetExplicitPriority(v0->unk_30[v1], v14); } } else { if (v1 >= 4) { - sub_0200D460(v0->unk_30[v1], v15); + CellActorData_SetExplicitPriority(v0->unk_30[v1], v15); } else { - sub_0200D460(v0->unk_30[v1], v14); + CellActorData_SetExplicitPriority(v0->unk_30[v1], v14); } } - sub_0200D474(v0->unk_30[v1], 8 - v1); + CellActorData_SetPriority(v0->unk_30[v1], 8 - v1); } else { - sub_0200D474(v0->unk_30[v1], v1); - sub_0200D460(v0->unk_30[v1], v15); + CellActorData_SetPriority(v0->unk_30[v1], v1); + CellActorData_SetExplicitPriority(v0->unk_30[v1], v15); } } } @@ -343,7 +343,7 @@ static void ov12_0222EE50(SysTask *param0, void *param1) if (v0->unk_30 <= 0.2) { v0->unk_00.unk_00++; - SpriteActor_EnableObject(v0->unk_1C[0], 0); + CellActorData_DrawSprite(v0->unk_1C[0], 0); } else { sub_0200D6E8(v0->unk_1C[0], v0->unk_2C * v0->unk_36, v0->unk_30); } @@ -361,7 +361,7 @@ static void ov12_0222EE50(SysTask *param0, void *param1) ov12_02226858(v0->unk_38[0]); ov12_02226858(v0->unk_38[1]); - v1 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_1C[2]->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + v1 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_1C[2]->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); v0->unk_38[1] = ov12_02226870(v0->unk_00.unk_18, ov12_0221FDE4(v0->unk_00.unk_04), 2, v1 * 16, 16, 0, 1, 15, 0, 0xFFFFFF, 1100); v0->unk_00.unk_00++; @@ -370,7 +370,7 @@ static void ov12_0222EE50(SysTask *param0, void *param1) case 2: default: if (ov12_02226848(v0->unk_38[1]) == 0) { - sub_0200D330(v0->unk_1C[1]); + CellActorData_UpdateObject(v0->unk_1C[1]); ov12_02226858(v0->unk_38[1]); ov12_02220220(v0->unk_00.unk_04, param0); Heap_FreeToHeap(v0); @@ -379,10 +379,10 @@ static void ov12_0222EE50(SysTask *param0, void *param1) break; } - sub_0200D330(v0->unk_1C[0]); - sub_0200D330(v0->unk_1C[1]); - sub_0200D330(v0->unk_1C[2]); - sub_0200C7EC(v0->unk_00.unk_0C); + CellActorData_UpdateObject(v0->unk_1C[0]); + CellActorData_UpdateObject(v0->unk_1C[1]); + CellActorData_UpdateObject(v0->unk_1C[2]); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_00.unk_0C); } void ov12_0222EFB0(UnkStruct_ov12_0221FCDC *param0) @@ -416,7 +416,7 @@ void ov12_0222EFB0(UnkStruct_ov12_0221FCDC *param0) } SpriteActor_GetSpritePositionXY(v0->unk_1C[1], &v2, &v3); - SpriteActor_SetSpritePositionXY(v0->unk_1C[0], v2 + v4, v3); + CellActorData_SetPositionXY(v0->unk_1C[0], v2 + v4, v3); sub_0200D6A4(v0->unk_1C[0], 2); sub_0200D6E8(v0->unk_1C[0], v0->unk_2C * v0->unk_36, v0->unk_30); } @@ -424,10 +424,10 @@ void ov12_0222EFB0(UnkStruct_ov12_0221FCDC *param0) { int v6; - v6 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_1C[0]->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + v6 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_1C[0]->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); v0->unk_38[0] = ov12_02226870(v0->unk_00.unk_18, ov12_0221FDE4(param0), 2, v6 * 16, 16, 0, 1, 0, 15, 0xFFFFFF, 1100); - v6 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_1C[2]->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); + v6 = sub_0201FAB4(CellActor_GetPaletteProxy(v0->unk_1C[2]->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); v0->unk_38[1] = ov12_02226870(v0->unk_00.unk_18, ov12_0221FDE4(param0), 2, v6 * 16, 16, 0, 1, 0, 15, 0xFFFFFF, 1100); } @@ -450,11 +450,11 @@ void ov12_0222EFB0(UnkStruct_ov12_0221FCDC *param0) if (ov12_0223525C(v0->unk_00.unk_04, v8) == 0x3) { v13 = 0; - sub_0200D460(v0->unk_1C[0], 1); - sub_0200D474(v0->unk_1C[0], 0); + CellActorData_SetExplicitPriority(v0->unk_1C[0], 1); + CellActorData_SetPriority(v0->unk_1C[0], 0); } else { - sub_0200D460(v0->unk_1C[0], 2); - sub_0200D474(v0->unk_1C[0], 0); + CellActorData_SetExplicitPriority(v0->unk_1C[0], 2); + CellActorData_SetPriority(v0->unk_1C[0], 0); v13 = 2; } @@ -462,10 +462,10 @@ void ov12_0222EFB0(UnkStruct_ov12_0221FCDC *param0) v7 = LoadPokemonSpriteYOffset(ov12_022232D0(v0->unk_00.unk_04, v8), ov12_022232C4(v0->unk_00.unk_04, v8), v13, ov12_022232E0(v0->unk_00.unk_04, v8), ov12_022232EC(v0->unk_00.unk_04, v8)); } - SpriteActor_SetSpritePositionXY(v0->unk_1C[0], v12.unk_00, v11.unk_02 + v7); + CellActorData_SetPositionXY(v0->unk_1C[0], v12.unk_00, v11.unk_02 + v7); } - SpriteActor_EnableObject(v0->unk_1C[0], 1); + CellActorData_DrawSprite(v0->unk_1C[0], 1); v0->unk_34 = 0; v0->unk_35 = 15; diff --git a/src/overlay012/ov12_0222F700.c b/src/overlay012/ov12_0222F700.c index b9c4b5ef1a..4288d7d434 100644 --- a/src/overlay012/ov12_0222F700.c +++ b/src/overlay012/ov12_0222F700.c @@ -25,10 +25,10 @@ #include "enums.h" #include "heap.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" #include "unk_0200762C.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" typedef struct { UnkStruct_ov12_0221FCDC *unk_00; @@ -513,7 +513,7 @@ static void ov12_0222F700(SysTask *param0, void *param1) v1[1] = ov12_02226274(&v0->unk_38); v1[2] = 0; - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); for (v2 = 0; v2 < 3; v2++) { if (v1[v2] == 1) { @@ -554,8 +554,8 @@ void ov12_0222F770(UnkStruct_ov12_0221FCDC *param0) for (v1 = 0; v1 < 2; v1++) { v0->unk_30[v1] = ov12_022202C0(v0->unk_00, v1); - sub_0200D474(v0->unk_30[v1], 100); - sub_0200D460(v0->unk_30[v1], 1); + CellActorData_SetPriority(v0->unk_30[v1], 100); + CellActorData_SetExplicitPriority(v0->unk_30[v1], 1); SpriteActor_SetOAMMode(v0->unk_30[v1], GX_OAM_MODE_XLU); } @@ -671,7 +671,7 @@ void ov12_0222F9E4(UnkStruct_ov12_0221FCDC *param0) static void ov12_0222FAFC(UnkStruct_ov12_0222FAFC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, const SpriteTemplate *param3, const UnkStruct_ov12_0222FAFC *param4) { - param0->unk_00 = SpriteActor_LoadResources(param1, param2, param3); + param0->unk_00 = CellActor_LoadResources(param1, param2, param3); param0->unk_04 = param4->unk_04; param0->unk_28 = param4->unk_28; param0->unk_3C = param4->unk_3C; @@ -680,19 +680,19 @@ static void ov12_0222FAFC(UnkStruct_ov12_0222FAFC *param0, SpriteRenderer *param param0->unk_44 = param4->unk_44; param0->unk_48 = 0; - SpriteActor_EnableObject(param0->unk_00, 0); - sub_0200D474(param0->unk_00, 100); - sub_0200D460(param0->unk_00, 1); + CellActorData_DrawSprite(param0->unk_00, 0); + CellActorData_SetPriority(param0->unk_00, 100); + CellActorData_SetExplicitPriority(param0->unk_00, 1); } static void ov12_0222FB6C(UnkStruct_ov12_0222FAFC *param0) { - sub_0200D0F4(param0->unk_00); + CellActorData_Delete(param0->unk_00); } static void ov12_0222FB78(UnkStruct_ov12_0222FAFC *param0, BOOL param1) { - SpriteActor_EnableObject(param0->unk_00, param1); + CellActorData_DrawSprite(param0->unk_00, param1); } static BOOL ov12_0222FB84(UnkStruct_ov12_0222FAFC *param0) @@ -707,7 +707,7 @@ static BOOL ov12_0222FB84(UnkStruct_ov12_0222FAFC *param0) if (ov12_02225AE0(¶m0->unk_04)) { ov12_02225E0C(¶m0->unk_28); param0->unk_04.unk_04[5] = param0->unk_3C + param0->unk_28.unk_00; - SpriteActor_SetSpritePositionXY(param0->unk_00, param0->unk_3E + param0->unk_04.unk_00, param0->unk_40 + param0->unk_04.unk_02); + CellActorData_SetPositionXY(param0->unk_00, param0->unk_3E + param0->unk_04.unk_00, param0->unk_40 + param0->unk_04.unk_02); } else { if (param0->unk_44 < 1) { if (param0->unk_44 == 0) { @@ -756,7 +756,7 @@ static void ov12_0222FC44(SysTask *param0, void *param1) case 3: if (v0->unk_F0 <= 0) { v0->unk_58[v0->unk_F4].unk_48 = 1; - SpriteActor_EnableObject(v0->unk_58[v0->unk_F4].unk_00, 1); + CellActorData_DrawSprite(v0->unk_58[v0->unk_F4].unk_00, 1); v0->unk_F4++; v0->unk_F0 = 8; } @@ -782,9 +782,9 @@ static void ov12_0222FC44(SysTask *param0, void *param1) } break; case 4: - sub_0200D330(v0->unk_0C.unk_00); + CellActorData_UpdateObject(v0->unk_0C.unk_00); - if (CellActor_IsAnimated(v0->unk_0C.unk_00->unk_00) == 0) { + if (CellActor_IsAnimated(v0->unk_0C.unk_00->cellActor) == 0) { SpriteActor_SetOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); v0->unk_EC++; } @@ -802,14 +802,14 @@ static void ov12_0222FC44(SysTask *param0, void *param1) ov12_0222FB6C(&v0->unk_58[v1]); } - sub_0200D0F4(v0->unk_0C.unk_00); + CellActorData_Delete(v0->unk_0C.unk_00); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_0222FE30(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -844,9 +844,9 @@ void ov12_0222FE30(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_0C.unk_3E = ov12_022258E0(param0, v3, 0); v0->unk_0C.unk_40 = ov12_022258E0(param0, v3, 1); - SpriteActor_SetSpritePositionXY(v0->unk_0C.unk_00, v0->unk_0C.unk_3E, v0->unk_0C.unk_40); - sub_0200D474(v0->unk_0C.unk_00, 100); - sub_0200D460(v0->unk_0C.unk_00, 1); + CellActorData_SetPositionXY(v0->unk_0C.unk_00, v0->unk_0C.unk_3E, v0->unk_0C.unk_40); + CellActorData_SetPriority(v0->unk_0C.unk_00, 100); + CellActorData_SetExplicitPriority(v0->unk_0C.unk_00, 1); v1 = ov12_0222329C(v0->unk_00); v1.x = v0->unk_0C.unk_3E; @@ -874,7 +874,7 @@ static void ov12_0222FF80(UnkStruct_ov12_0222FF80 *param0) sub_02007DEC(param0->unk_5C, 0, param0->unk_60 + param0->unk_10.unk_00); sub_02007DEC(param0->unk_5C, 1, param0->unk_62 + param0->unk_10.unk_02); - SpriteActor_SetSpritePositionXY(param0->unk_58, param0->unk_60 + param0->unk_10.unk_00, param0->unk_62 + param0->unk_10.unk_02 - param0->unk_66); + CellActorData_SetPositionXY(param0->unk_58, param0->unk_60 + param0->unk_10.unk_00, param0->unk_62 + param0->unk_10.unk_02 - param0->unk_66); ov12_02225FA4(¶m0->unk_34, &v0, &v1); v0 += (f32)(param0->unk_64 * (0.10f)); @@ -918,7 +918,7 @@ static void ov12_02230018(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } void ov12_022300C4(UnkStruct_ov12_0221FCDC *param0) @@ -941,8 +941,8 @@ void ov12_022300C4(UnkStruct_ov12_0221FCDC *param0) SpriteActor_SetOAMMode(v0->unk_58, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_58, 2); - sub_0200D474(v0->unk_58, 100); - sub_0200D460(v0->unk_58, 1); + CellActorData_SetPriority(v0->unk_58, 100); + CellActorData_SetExplicitPriority(v0->unk_58, 1); ov12_02225EF0(&v0->unk_34, 10, 12, 10, 15, 10, 7); v0->unk_64 = 1; @@ -1129,7 +1129,7 @@ static void ov12_02230540(SysTask *param0, void *param1) sub_0200D6E8(v0->unk_10, v2, v3); if (v1 == 0) { - SpriteActor_EnableObject(v0->unk_10, 0); + CellActorData_DrawSprite(v0->unk_10, 0); v0->unk_08++; } break; @@ -1139,7 +1139,7 @@ static void ov12_02230540(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } static void ov12_02230600(SysTask *param0, void *param1) @@ -1186,7 +1186,7 @@ static void ov12_02230600(SysTask *param0, void *param1) sub_02007DEC(v0->unk_08, 6, 0); } - SpriteActor_SetSpritePositionXY(v0->unk_0C, v0->unk_38, v0->unk_3A - v0->unk_3C); + CellActorData_SetPositionXY(v0->unk_0C, v0->unk_38, v0->unk_3A - v0->unk_3C); } v0->unk_04++; @@ -1225,8 +1225,8 @@ void ov12_02230754(UnkStruct_ov12_0221FCDC *param0) sub_0200D6E8(v0->unk_10, (14 / (f32)10), (14 / (f32)10)); } - sub_0200D474(v0->unk_10, 100); - sub_0200D460(v0->unk_10, 1); + CellActorData_SetPriority(v0->unk_10, 100); + CellActorData_SetExplicitPriority(v0->unk_10, 1); ov12_022201E8(v0->unk_00, ov12_02230540, v0); } @@ -1316,7 +1316,7 @@ static void ov12_02230994(SysTask *param0, void *param1) case 0: ov12_02230910(v0); - if (sub_0200D408(v0->unk_48) == 1) { + if (CellActorData_GetDrawFlag(v0->unk_48) == 1) { if (ov12_0222337C(v0->unk_00, ov12_02220248(v0->unk_00)) == 0) { sub_02007DEC(v0->unk_10, 6, 1); } @@ -1376,12 +1376,12 @@ void ov12_02230A8C(UnkStruct_ov12_0221FCDC *param0) v5 = ov12_02235254(v0->unk_00, ov12_02220248(v0->unk_00)); if ((v5 == 5) || (v5 == 2)) { - SpriteActor_EnableObject(v0->unk_48, 1); - sub_0200D460(v0->unk_48, 2); + CellActorData_DrawSprite(v0->unk_48, 1); + CellActorData_SetExplicitPriority(v0->unk_48, 2); } else { Bg_SetPriority(ov12_022233B0(v0->unk_00, 1), ov12_0222339C(v0->unk_00)); Bg_SetPriority(0, ov12_0222339C(v0->unk_00) + 1); - SpriteActor_EnableObject(v0->unk_48, 0); + CellActorData_DrawSprite(v0->unk_48, 0); } v0->unk_14 = ov12_0222662C(v3, v3 + 80, ((5 * 0xffff) / 360), (5 * FX32_ONE), 100, ov12_022233EC(param0, 1), 0, ov12_022266E8(-v2, -v3), ov12_0221FDE4(param0)); @@ -1442,13 +1442,13 @@ static void ov12_02230BE0(SysTask *param0, void *param1) } break; case 3: - sub_0200D0F4(v0->unk_10); + CellActorData_Delete(v0->unk_10); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02230CEC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -1481,16 +1481,16 @@ void ov12_02230CEC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri sub_0200D6A4(v0->unk_10, 2); sub_0200D6E8(v0->unk_10, 1, 1); - SpriteActor_SetSpritePositionXY(v0->unk_10, v3, v4); + CellActorData_SetPositionXY(v0->unk_10, v3, v4); sub_0200D5DC(v0->unk_10, 40 * v1, 0); - sub_0200D474(v0->unk_10, 100); - sub_0200D460(v0->unk_10, 1); + CellActorData_SetPriority(v0->unk_10, 100); + CellActorData_SetExplicitPriority(v0->unk_10, 1); sub_0200D7E0(v0->unk_10, -12 * v2, 12); if (ov12_0223525C(param0, ov12_02220240(param0)) == 0x4) { - sub_0200D364(v0->unk_10, 1); + CellActorData_SetAnim(v0->unk_10, 1); } else { - sub_0200D364(v0->unk_10, 0); + CellActorData_SetAnim(v0->unk_10, 0); } ov12_02225E68(&v0->unk_14, 1, 10, 10, 8); @@ -1517,28 +1517,28 @@ static void ov12_02230E24(UnkStruct_ov12_02230E24 *param0, CellActorData *param1 param0->unk_34 = 10; param0->unk_28 = param4; - SpriteActor_SetSpritePositionXY(param0->unk_00, param2, param3); - SpriteActor_SetSpritePositionXY(param0->unk_00, param2, param3); + CellActorData_SetPositionXY(param0->unk_00, param2, param3); + CellActorData_SetPositionXY(param0->unk_00, param2, param3); sub_0200D6A4(param0->unk_00, 2); - sub_0200D474(param0->unk_00, 100); - sub_0200D460(param0->unk_00, 1); + CellActorData_SetPriority(param0->unk_00, 100); + CellActorData_SetExplicitPriority(param0->unk_00, 1); if (param4) { sub_0200D6E8(param0->unk_00, -1, 1); } - SpriteActor_EnableObject(param0->unk_00, 0); + CellActorData_DrawSprite(param0->unk_00, 0); } static void ov12_02230E9C(UnkStruct_ov12_02230E24 *param0) { - sub_0200D0F4(param0->unk_00); + CellActorData_Delete(param0->unk_00); } static void ov12_02230EA8(UnkStruct_ov12_02230E24 *param0) { - SpriteActor_EnableObject(param0->unk_00, 1); - sub_0200D390(param0->unk_00, 1); + CellActorData_DrawSprite(param0->unk_00, 1); + CellActorData_SetAnimateFlag(param0->unk_00, 1); } static BOOL ov12_02230EC0(UnkStruct_ov12_02230E24 *param0) @@ -1619,7 +1619,7 @@ static void ov12_02230F3C(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02231010(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -1652,7 +1652,7 @@ void ov12_02231010(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if (v1 == 0) { ov12_02230E24(&v0->unk_44[v1], param3, v0->unk_1C, v3, v4); } else { - ov12_02230E24(&v0->unk_44[v1], SpriteActor_LoadResources(param1, param2, &v5), v0->unk_1C, v3, v4); + ov12_02230E24(&v0->unk_44[v1], CellActor_LoadResources(param1, param2, &v5), v0->unk_1C, v3, v4); } v3 -= 10; @@ -1696,7 +1696,7 @@ static void ov12_022310D4(SysTask *param0, void *param1) break; case 3: if (ov12_02225D2C(&v0->unk_4C, &v0->unk_70, v0->unk_48) == 0) { - SpriteActor_EnableObject(v0->unk_48, 0); + CellActorData_DrawSprite(v0->unk_48, 0); v0->unk_0C++; } break; @@ -1719,13 +1719,13 @@ static void ov12_022310D4(SysTask *param0, void *param1) } break; case 6: - sub_0200D0F4(v0->unk_48); + CellActorData_Delete(v0->unk_48); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_022312A4(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -1749,9 +1749,9 @@ void ov12_022312A4(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_46 = sub_020080C0(v0->unk_40, 1); v0->unk_48 = param3; - sub_0200D390(v0->unk_48, 1); - sub_0200D474(v0->unk_48, 100); - sub_0200D460(v0->unk_48, 1); + CellActorData_SetAnimateFlag(v0->unk_48, 1); + CellActorData_SetPriority(v0->unk_48, 100); + CellActorData_SetExplicitPriority(v0->unk_48, 1); ov12_02225C98(&v0->unk_4C, &v0->unk_70, v0->unk_14, v0->unk_44, v0->unk_16, v0->unk_46, 10, (32 * FX32_ONE)); ov12_022201E8(v0->unk_00, ov12_022310D4, v0); @@ -1780,7 +1780,7 @@ static void ov12_02231390(SysTask *param0, void *param1) break; case 2: if (ov12_02226454(&v0->unk_40)) { - SpriteActor_EnableObject(v0->unk_14, 1); + CellActorData_DrawSprite(v0->unk_14, 1); sub_02007DEC(v0->unk_10, 6, 0); v0->unk_08++; } @@ -1791,7 +1791,7 @@ static void ov12_02231390(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } void ov12_02231444(UnkStruct_ov12_0221FCDC *param0) @@ -1823,7 +1823,7 @@ void ov12_02231444(UnkStruct_ov12_0221FCDC *param0) v0->unk_1C.unk_04[2] *= v1; ov12_022201E8(v0->unk_00, ov12_02231390, v0); - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } static BOOL ov12_02231508(UnkStruct_ov12_02231508 *param0) @@ -1875,7 +1875,7 @@ static BOOL ov12_02231584(UnkStruct_ov12_02231508 *param0) break; case 1: if (ov12_02226454(¶m0->unk_8C)) { - SpriteActor_EnableObject(param0->unk_3C, 0); + CellActorData_DrawSprite(param0->unk_3C, 0); param0->unk_40++; } break; @@ -1901,13 +1901,13 @@ static void ov12_02231608(SysTask *param0, void *param1) } break; case 1: - sub_0200D0F4(v0->unk_3C); + CellActorData_Delete(v0->unk_3C); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02231650(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -1935,11 +1935,11 @@ void ov12_02231650(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri ov12_02225E68(&v0->unk_14, 10, 10, 15, 12); v0->unk_3C = param3; - sub_0200D390(v0->unk_3C, 1); + CellActorData_SetAnimateFlag(v0->unk_3C, 1); sub_0200D6A4(v0->unk_3C, 2); SpriteActor_SetOAMMode(v0->unk_3C, GX_OAM_MODE_XLU); - sub_0200D474(v0->unk_3C, 100); - sub_0200D460(v0->unk_3C, 1); + CellActorData_SetPriority(v0->unk_3C, 100); + CellActorData_SetExplicitPriority(v0->unk_3C, 1); v0->unk_B4 = v3 + (32 * v1); v0->unk_B6 = v4; @@ -2021,7 +2021,7 @@ static void ov12_0223181C(SysTask *param0, void *param1) break; case 2: if (ov12_02226454(&v0->unk_3C)) { - SpriteActor_EnableObject(v0->unk_14, 0); + CellActorData_DrawSprite(v0->unk_14, 0); } if (sub_020087B4(v0->unk_10) == 0) { @@ -2035,13 +2035,13 @@ static void ov12_0223181C(SysTask *param0, void *param1) } break; case 4: - sub_0200D0F4(v0->unk_14); + CellActorData_Delete(v0->unk_14); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02231950(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -2056,8 +2056,8 @@ void ov12_02231950(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_10 = ov12_022232FC(v0->unk_00, ov12_02220248(param0)); v0->unk_14 = param3; - sub_0200D474(v0->unk_14, 100); - sub_0200D460(v0->unk_14, 1); + CellActorData_SetPriority(v0->unk_14, 100); + CellActorData_SetExplicitPriority(v0->unk_14, 1); SpriteActor_GetSpritePositionXY(v0->unk_14, &v0->unk_64, &v0->unk_66); ov12_022201E8(v0->unk_00, ov12_0223181C, v0); @@ -2113,8 +2113,8 @@ static void ov12_02231A38(SysTask *param0, void *param1) v0->unk_0C++; v0->unk_54 = 8; - sub_0200D364(v0->unk_24, 1); - sub_0200D390(v0->unk_24, 1); + CellActorData_SetAnim(v0->unk_24, 1); + CellActorData_SetAnimateFlag(v0->unk_24, 1); } } break; @@ -2163,19 +2163,19 @@ static void ov12_02231A38(SysTask *param0, void *param1) if (v0->unk_50 < 0) { v0->unk_0C++; } else { - SpriteActor_EnableObject(v0->unk_24, v0->unk_58); + CellActorData_DrawSprite(v0->unk_24, v0->unk_58); v0->unk_58 ^= 1; } } break; case 6: - sub_0200D0F4(v0->unk_24); + CellActorData_Delete(v0->unk_24); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02231C1C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -2196,14 +2196,14 @@ void ov12_02231C1C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_24 = param3; - sub_0200D474(v0->unk_24, 100); - sub_0200D460(v0->unk_24, 1); + CellActorData_SetPriority(v0->unk_24, 100); + CellActorData_SetExplicitPriority(v0->unk_24, 1); SpriteActor_GetSpritePositionXY(v0->unk_24, &v0->unk_4C, &v0->unk_4E); v0->unk_4C -= 80 / 2; v0->unk_4E -= 80 / 2; - SpriteActor_SetSpritePositionXY(v0->unk_24, v0->unk_4C, v0->unk_4E); + CellActorData_SetPositionXY(v0->unk_24, v0->unk_4C, v0->unk_4E); SpriteActor_SetOAMMode(v0->unk_24, GX_OAM_MODE_XLU); v0->unk_54 = -16; @@ -2506,8 +2506,8 @@ static void ov12_0223223C(SysTask *param0, void *param1) v0->unk_0C++; v0->unk_10 = 30; - sub_0200D364(v0->unk_14, 0); - sub_0200D390(v0->unk_14, 1); + CellActorData_SetAnim(v0->unk_14, 0); + CellActorData_SetAnimateFlag(v0->unk_14, 1); sub_0200D6E8(v0->unk_14, 1, 1); ov12_02226424(&v0->unk_3C, 0, 16, 16, 0, 4); @@ -2530,7 +2530,7 @@ static void ov12_0223223C(SysTask *param0, void *param1) } } - if (sub_0200D3B8(v0->unk_14) == 0) { + if (CellActorData_IsAnimated(v0->unk_14) == 0) { v0->unk_0C++; } break; @@ -2543,18 +2543,18 @@ static void ov12_0223223C(SysTask *param0, void *param1) break; case 3: if (ov12_02226454(&v0->unk_3C)) { - SpriteActor_EnableObject(v0->unk_14, 0); + CellActorData_DrawSprite(v0->unk_14, 0); v0->unk_0C++; } break; case 4: - sub_0200D0F4(v0->unk_14); + CellActorData_Delete(v0->unk_14); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02232378(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -2569,11 +2569,11 @@ void ov12_02232378(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_08 = param2; v0->unk_14 = param3; - sub_0200D474(v0->unk_14, 100); - sub_0200D460(v0->unk_14, 1); + CellActorData_SetPriority(v0->unk_14, 100); + CellActorData_SetExplicitPriority(v0->unk_14, 1); sub_0200D6A4(v0->unk_14, 2); SpriteActor_SetOAMMode(v0->unk_14, GX_OAM_MODE_XLU); - sub_0200D3CC(v0->unk_14, 4); + CellActorData_SetAnimFrame(v0->unk_14, 4); v0->unk_6C = 3; v0->unk_70 = (4 * 100); @@ -2772,14 +2772,14 @@ static void ov12_0223283C(CellActorData *param0, int *param1, fx32 param2) { *param1 = 0; - sub_0200D474(param0, 100); - sub_0200D460(param0, 1); - SpriteActor_EnableObject(param0, 1); - sub_0200D390(param0, 1); - sub_0200D3A4(param0, param2); - sub_0200D364(param0, 0); - sub_0200D3CC(param0, 0); - sub_0200D34C(param0, 55 * FX32_ONE); + CellActorData_SetPriority(param0, 100); + CellActorData_SetExplicitPriority(param0, 1); + CellActorData_DrawSprite(param0, 1); + CellActorData_SetAnimateFlag(param0, 1); + CellActorData_SetAnimSpeed(param0, param2); + CellActorData_SetAnim(param0, 0); + CellActorData_SetAnimFrame(param0, 0); + CellActorData_UpdateNFrames(param0, 55 * FX32_ONE); } static BOOL ov12_02232888(CellActorData *param0, int *param1) @@ -2788,7 +2788,7 @@ static BOOL ov12_02232888(CellActorData *param0, int *param1) switch (*param1) { case 0: - if (sub_0200D3B8(param0) == 0) { + if (CellActorData_IsAnimated(param0) == 0) { (*param1)++; v0 = 1; } @@ -2821,7 +2821,7 @@ static void ov12_022328B8(SysTask *param0, void *param1) v2 = ov12_02232888(v0->unk_48[v0->unk_10], &v0->unk_60[v0->unk_10]); if ((v1 == v2) && (v1 == 1)) { - sub_0200D364(v0->unk_48[v0->unk_10], 1); + CellActorData_SetAnim(v0->unk_48[v0->unk_10], 1); v0->unk_0C++; } break; @@ -2856,7 +2856,7 @@ static void ov12_022328B8(SysTask *param0, void *param1) break; case 5: for (v3 = 0; v3 < 6; v3++) { - sub_0200D0F4(v0->unk_48[v3]); + CellActorData_Delete(v0->unk_48[v3]); } ov12_02220220(v0->unk_00, param0); @@ -2864,7 +2864,7 @@ static void ov12_022328B8(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_022329E0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -2896,10 +2896,10 @@ void ov12_022329E0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if (v2 == 0) { v0->unk_48[v2] = param3; } else { - v0->unk_48[v2] = SpriteActor_LoadResources(param1, param2, &v1); + v0->unk_48[v2] = CellActor_LoadResources(param1, param2, &v1); } - SpriteActor_EnableObject(v0->unk_48[v2], 0); + CellActorData_DrawSprite(v0->unk_48[v2], 0); v5 = FX_Mul(FX_CosIdx((((90 * 0xffff) / 360) / (6 / 2)) * (v2 / 2)), (48 * FX32_ONE)) >> FX32_SHIFT; v6 = FX_Mul(FX_SinIdx((((90 * 0xffff) / 360) / (6 / 2)) * (v2 / 2)), (48 * FX32_ONE)) >> FX32_SHIFT; @@ -2912,7 +2912,7 @@ void ov12_022329E0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } v6 = v4 - v6; - SpriteActor_SetSpritePositionXY(v0->unk_48[v2], v5, v6); + CellActorData_SetPositionXY(v0->unk_48[v2], v5, v6); if (v2 < 2) { v0->unk_78[v2] = 8; @@ -2931,12 +2931,12 @@ static void ov12_02232B40(SysTask *param0, void *param1) switch (v0->unk_0C) { case 0: - sub_0200D390(v0->unk_5C, 1); + CellActorData_SetAnimateFlag(v0->unk_5C, 1); v0->unk_0C++; break; case 1: - if (sub_0200D3B8(v0->unk_5C) == 0) { - sub_0200D390(v0->unk_5C, 0); + if (CellActorData_IsAnimated(v0->unk_5C) == 0) { + CellActorData_SetAnimateFlag(v0->unk_5C, 0); v0->unk_0C++; ov12_02225E68(&v0->unk_14, 10, 10, 0, 8); v1 = sub_020080C0(v0->unk_10, 0); @@ -2951,34 +2951,34 @@ static void ov12_02232B40(SysTask *param0, void *param1) sub_02007DEC(v0->unk_10, 6, 1); sub_02007DEC(v0->unk_10, 12, 0x100); sub_02007DEC(v0->unk_10, 13, 0x100); - sub_0200D364(v0->unk_5C, 1); - sub_0200D3A4(v0->unk_5C, FX32_ONE); - sub_0200D390(v0->unk_5C, 1); + CellActorData_SetAnim(v0->unk_5C, 1); + CellActorData_SetAnimSpeed(v0->unk_5C, FX32_ONE); + CellActorData_SetAnimateFlag(v0->unk_5C, 1); v0->unk_0C++; } break; case 3: - if (sub_0200D3B8(v0->unk_5C) == 0) { - sub_0200D390(v0->unk_5C, 0); + if (CellActorData_IsAnimated(v0->unk_5C) == 0) { + CellActorData_SetAnimateFlag(v0->unk_5C, 0); v0->unk_0C++; ov12_02225BC8(&v0->unk_60, 0, 0, v0->unk_8A, 0, 8); } break; case 4: if (ov12_02225C14(&v0->unk_60)) { - SpriteActor_SetSpritePositionXY(v0->unk_5C, v0->unk_88, v0->unk_60.unk_02); + CellActorData_SetPositionXY(v0->unk_5C, v0->unk_88, v0->unk_60.unk_02); } else { v0->unk_0C++; } break; case 5: - sub_0200D0F4(v0->unk_5C); + CellActorData_Delete(v0->unk_5C); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02232CA8(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -2998,9 +2998,9 @@ void ov12_02232CA8(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_8A = ov12_022258E0(param0, ov12_02220240(param0), 1); v0->unk_5C = param3; - sub_0200D474(v0->unk_5C, 100); - sub_0200D460(v0->unk_5C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_5C, v0->unk_88, v0->unk_8A); + CellActorData_SetPriority(v0->unk_5C, 100); + CellActorData_SetExplicitPriority(v0->unk_5C, 1); + CellActorData_SetPositionXY(v0->unk_5C, v0->unk_88, v0->unk_8A); ov12_022201E8(v0->unk_00, ov12_02232B40, v0); } @@ -3034,8 +3034,8 @@ static void ov12_02232D64(UnkStruct_ov12_02232D38 *param0) v0 = ov12_02235254(param0->unk_00, ov12_02220240(param0->unk_00)); - SpriteActor_EnableObject(param0->unk_20, Unk_ov12_0223A1CC[v0]); - SpriteActor_EnableObject(param0->unk_18, 1); + CellActorData_DrawSprite(param0->unk_20, Unk_ov12_0223A1CC[v0]); + CellActorData_DrawSprite(param0->unk_18, 1); ov12_02225FA4(¶m0->unk_28, &v1, &v2); @@ -3087,8 +3087,8 @@ static BOOL ov12_02232E04(UnkStruct_ov12_02232D38 *param0) } else { param0->unk_94++; - SpriteActor_EnableObject(param0->unk_20, 0); - SpriteActor_EnableObject(param0->unk_18, 0); + CellActorData_DrawSprite(param0->unk_20, 0); + CellActorData_DrawSprite(param0->unk_18, 0); v0 = 1; } @@ -3125,8 +3125,8 @@ static void ov12_02232F30(UnkStruct_ov12_02232D38 *param0) v4 = ov12_02235254(param0->unk_00, ov12_02220248(param0->unk_00)); - SpriteActor_EnableObject(param0->unk_24, Unk_ov12_0223A1CC[v4]); - SpriteActor_EnableObject(param0->unk_1C, 1); + CellActorData_DrawSprite(param0->unk_24, Unk_ov12_0223A1CC[v4]); + CellActorData_DrawSprite(param0->unk_1C, 1); ov12_02232D38(param0, param0->unk_1C); } @@ -3218,7 +3218,7 @@ static void ov12_02233094(SysTask *param0, void *param1) break; } - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } void ov12_02233178(UnkStruct_ov12_0221FCDC *param0) @@ -3248,19 +3248,19 @@ void ov12_02233178(UnkStruct_ov12_0221FCDC *param0) v0->unk_10 = ov12_02223354(v0->unk_00, ov12_02220240(v0->unk_00)); v0->unk_18 = ov12_022202C0(v0->unk_00, 0); - sub_0200D474(v0->unk_18, 100); - sub_0200D460(v0->unk_18, 1); - SpriteActor_SetSpritePositionXY(v0->unk_18, v2, v3); - SpriteActor_EnableObject(v0->unk_18, 0); + CellActorData_SetPriority(v0->unk_18, 100); + CellActorData_SetExplicitPriority(v0->unk_18, 1); + CellActorData_SetPositionXY(v0->unk_18, v2, v3); + CellActorData_DrawSprite(v0->unk_18, 0); SpriteActor_SetOAMMode(v0->unk_18, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_18, 2); v0->unk_1C = ov12_022202C0(v0->unk_00, 1); - sub_0200D474(v0->unk_1C, 100); - sub_0200D460(v0->unk_1C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_1C, v4, v5); - SpriteActor_EnableObject(v0->unk_1C, 0); + CellActorData_SetPriority(v0->unk_1C, 100); + CellActorData_SetExplicitPriority(v0->unk_1C, 1); + CellActorData_SetPositionXY(v0->unk_1C, v4, v5); + CellActorData_DrawSprite(v0->unk_1C, 0); SpriteActor_SetOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_1C, 2); sub_0200D7E0(v0->unk_1C, 0, 80 / 2); @@ -3270,8 +3270,8 @@ void ov12_02233178(UnkStruct_ov12_0221FCDC *param0) v0->unk_20 = ov12_022202C0(v0->unk_00, 2); v0->unk_24 = ov12_022202C0(v0->unk_00, 3); - SpriteActor_EnableObject(v0->unk_20, 0); - SpriteActor_EnableObject(v0->unk_24, 0); + CellActorData_DrawSprite(v0->unk_20, 0); + CellActorData_DrawSprite(v0->unk_24, 0); ov12_022201E8(v0->unk_00, ov12_02233094, v0); } @@ -3286,7 +3286,7 @@ static void ov12_02233338(UnkStruct_ov12_022332E8 *param0) { ov12_02225E68(¶m0->unk_F8, 10, 10, 25, 6); ov12_022261C4(¶m0->unk_48, ¶m0->unk_F8, ov12_02225EB8, param0->unk_38, param0->unk_3A, 5, 3, 1, param0->unk_3C[0], param0->unk_3C[1], param0->unk_3C[2], NULL); - SpriteActor_EnableObject(param0->unk_3C[0], 1); + CellActorData_DrawSprite(param0->unk_3C[0], 1); } static void ov12_02233394(SysTask *param0, void *param1) @@ -3301,7 +3301,7 @@ static void ov12_02233394(SysTask *param0, void *param1) break; case 1: if (ov12_02226274(&v0->unk_48) == 0) { - SpriteActor_EnableObject(v0->unk_3C[0], 1); + CellActorData_DrawSprite(v0->unk_3C[0], 1); v0->unk_0C++; ov12_02226108(&v0->unk_14, 4, 0, 1, 6); } @@ -3319,7 +3319,7 @@ static void ov12_02233394(SysTask *param0, void *param1) break; case 4: for (v1 = 0; v1 < 3; v1++) { - sub_0200D0F4(v0->unk_3C[v1]); + CellActorData_Delete(v0->unk_3C[v1]); } Heap_FreeToHeap(v0); @@ -3327,7 +3327,7 @@ static void ov12_02233394(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02233454(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -3351,16 +3351,16 @@ void ov12_02233454(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v1 = 0; v1 < 3; v1++) { if (v1 == 0) { v0->unk_3C[v1] = param3; - sub_0200D364(v0->unk_3C[v1], 1); + CellActorData_SetAnim(v0->unk_3C[v1], 1); } else { - v0->unk_3C[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v2); + v0->unk_3C[v1] = CellActor_LoadResources(v0->unk_04, v0->unk_08, &v2); SpriteActor_SetOAMMode(v0->unk_3C[v1], GX_OAM_MODE_XLU); } - sub_0200D474(v0->unk_3C[v1], 100); - sub_0200D460(v0->unk_3C[v1], 1); - SpriteActor_SetSpritePositionXY(v0->unk_3C[v1], v0->unk_38, v0->unk_3A); - SpriteActor_EnableObject(v0->unk_3C[v1], 0); + CellActorData_SetPriority(v0->unk_3C[v1], 100); + CellActorData_SetExplicitPriority(v0->unk_3C[v1], 1); + CellActorData_SetPositionXY(v0->unk_3C[v1], v0->unk_38, v0->unk_3A); + CellActorData_DrawSprite(v0->unk_3C[v1], 0); sub_0200D6A4(v0->unk_3C[v1], 2); } @@ -3393,12 +3393,12 @@ static void ov12_02233574(UnkStruct_ov12_0223351C *param0) v2 = param0->unk_30[v0].unk_04[1] * 5; v1 = FX_Mul(FX_SinIdx(v2), (FX32_ONE * 10) * param0->unk_14) >> FX32_SHIFT; - SpriteActor_SetSpritePositionXY(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132 + v1); + CellActorData_SetPositionXY(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132 + v1); if ((param0->unk_30[v0].unk_04[1] >= ((90 * 0xffff) / 360)) && (param0->unk_30[v0].unk_04[1] <= ((269 * 0xffff) / 360))) { - sub_0200D460(param0->unk_18[v0], 1); + CellActorData_SetExplicitPriority(param0->unk_18[v0], 1); } else { - sub_0200D460(param0->unk_18[v0], ov12_0222339C(param0->unk_00) + 1); + CellActorData_SetExplicitPriority(param0->unk_18[v0], ov12_0222339C(param0->unk_00) + 1); } } } @@ -3442,7 +3442,7 @@ static void ov12_02233644(SysTask *param0, void *param1) break; case 4: for (v1 = 0; v1 < 6; v1++) { - sub_0200D0F4(v0->unk_18[v1]); + CellActorData_Delete(v0->unk_18[v1]); } Heap_FreeToHeap(v0); @@ -3450,7 +3450,7 @@ static void ov12_02233644(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02233734(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -3477,12 +3477,12 @@ void ov12_02233734(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if (v1 == 0) { v0->unk_18[v1] = param3; } else { - v0->unk_18[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v3); + v0->unk_18[v1] = CellActor_LoadResources(v0->unk_04, v0->unk_08, &v3); } - sub_0200D474(v0->unk_18[v1], 100); + CellActorData_SetPriority(v0->unk_18[v1], 100); SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); - sub_0200D390(v0->unk_18[v1], 1); + CellActorData_SetAnimateFlag(v0->unk_18[v1], 1); } v0->unk_14 = ov12_02225964(v0->unk_00, ov12_02220240(v0->unk_00)); @@ -3495,7 +3495,7 @@ static void ov12_022337E0(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 SpriteActor_GetSpritePositionXY(param0, &v0, &v1); ov12_02225BC8(param1, v0 + (0 * param2), v0 + (256 * param2), v1 + (0 * param3), v1 + (-128 * param3), 59); - SpriteActor_EnableObject(param0, 1); + CellActorData_DrawSprite(param0, 1); } static BOOL ov12_02233834(CellActorData *param0, UnkStruct_ov12_02225F6C *param1) @@ -3512,7 +3512,7 @@ static BOOL ov12_02233834(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 v5 = v0 * ((2 * 0xffff) / 360); v2 = FX_Mul(FX_SinIdx(v5), (FX32_ONE * 14)) >> FX32_SHIFT; - SpriteActor_SetSpritePositionXY(param0, v0, v1 + v2); + CellActorData_SetPositionXY(param0, v0, v1 + v2); v3 = FX_Mul(FX_SinIdx(v5), (FX32_CONST(0.17f))); v3 *= -1; @@ -3561,13 +3561,13 @@ static void ov12_02233988(SysTask *param0, void *param1) if (ov12_02233900(v0)) { for (v1 = 0; v1 < 15; v1++) { - sub_0200D0F4(v0->unk_18[v1]); + CellActorData_Delete(v0->unk_18[v1]); } Heap_FreeToHeap(v0); ov12_02220220(v0->unk_00, param0); } else { - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } } @@ -3594,15 +3594,15 @@ void ov12_022339C4(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if (v1 == 0) { v0->unk_18[v1] = param3; } else { - v0->unk_18[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v5); + v0->unk_18[v1] = CellActor_LoadResources(v0->unk_04, v0->unk_08, &v5); } - sub_0200D474(v0->unk_18[v1], 100); - sub_0200D460(v0->unk_18[v1], 1); + CellActorData_SetPriority(v0->unk_18[v1], 100); + CellActorData_SetExplicitPriority(v0->unk_18[v1], 1); sub_0200D6A4(v0->unk_18[v1], 2); - SpriteActor_EnableObject(v0->unk_18[v1], 0); - SpriteActor_SetSpritePositionXY(v0->unk_18[v1], v2, v3); - sub_0200D364(v0->unk_18[v1], v1 % 3); + CellActorData_DrawSprite(v0->unk_18[v1], 0); + CellActorData_SetPositionXY(v0->unk_18[v1], v2, v3); + CellActorData_SetAnim(v0->unk_18[v1], v1 % 3); } v0->unk_10 = ov12_02225964(v0->unk_00, ov12_02220240(v0->unk_00)); @@ -3836,7 +3836,7 @@ static void ov12_02233F4C(SysTask *param0, void *param1) } break; case 2: - if (sub_0200D3B8(v0->unk_10) == 0) { + if (CellActorData_IsAnimated(v0->unk_10) == 0) { v0->unk_0C++; ov12_02226424(&v0->unk_14, 16, 0, 16 - 16, 16 - 0, 8); } @@ -3847,13 +3847,13 @@ static void ov12_02233F4C(SysTask *param0, void *param1) } break; case 4: - sub_0200D0F4(v0->unk_10); + CellActorData_Delete(v0->unk_10); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02234008(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -3867,7 +3867,7 @@ void ov12_02234008(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_08 = param2; v0->unk_10 = param3; - sub_0200D390(v0->unk_10, 1); + CellActorData_SetAnimateFlag(v0->unk_10, 1); SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); ov12_022201E8(v0->unk_00, ov12_02233F4C, v0); @@ -3958,13 +3958,13 @@ static void ov12_02234290(SysTask *param0, void *param1) UnkStruct_ov12_02234290 *v0 = param1; if (ov12_02225C50(&v0->unk_08, v0->unk_2C) == 0) { - sub_0200D0F4(v0->unk_2C); + CellActorData_Delete(v0->unk_2C); Heap_FreeToHeap(v0); ov12_02220220(v0->unk_00, param0); return; } - sub_0200C7EC(v0->unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_04); } void ov12_022342C4(UnkStruct_ov12_0221FCDC *param0) @@ -3983,10 +3983,10 @@ void ov12_022342C4(UnkStruct_ov12_0221FCDC *param0) if (ov12_0223525C(param0, v1) == 0x3) { v0->unk_2C = ov12_02220298(param0, 0); - sub_0200D0F4(ov12_02220298(param0, 1)); + CellActorData_Delete(ov12_02220298(param0, 1)); } else { v0->unk_2C = ov12_02220298(param0, 1); - sub_0200D0F4(ov12_02220298(param0, 0)); + CellActorData_Delete(ov12_02220298(param0, 0)); } v2 = ov12_02225964(param0, v1); @@ -3997,7 +3997,7 @@ void ov12_022342C4(UnkStruct_ov12_0221FCDC *param0) v4 += 64 * v2; v5 += -16 * v3; - SpriteActor_SetSpritePositionXY(v0->unk_2C, v4, v5); + CellActorData_SetPositionXY(v0->unk_2C, v4, v5); ov12_02225BC8(&v0->unk_08, v4, v4 + (48 * v2), v5, v5 + (-16 * v3), 6); ov12_022201E8(v0->unk_00, ov12_02234290, v0); diff --git a/src/overlay012/ov12_022346A4.c b/src/overlay012/ov12_022346A4.c index 963e4a3645..86613edc50 100644 --- a/src/overlay012/ov12_022346A4.c +++ b/src/overlay012/ov12_022346A4.c @@ -17,9 +17,9 @@ #include "overlay012/struct_ov12_02226454.h" #include "heap.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" typedef struct { UnkStruct_ov12_0221FCDC *unk_00; @@ -95,14 +95,14 @@ void ov12_022346A4(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v2 = 0; v2 < 2; v2++) { if (v2 == 0) { v1->unk_14[v2] = param3; - SpriteActor_SetSpritePositionXY(v1->unk_14[v2], v0.x, v0.y); + CellActorData_SetPositionXY(v1->unk_14[v2], v0.x, v0.y); } else { - v1->unk_14[v2] = SpriteActor_LoadResources(param1, param2, &v0); + v1->unk_14[v2] = CellActor_LoadResources(param1, param2, &v0); } - SpriteActor_EnableObject(v1->unk_14[v2], 0); - sub_0200D474(v1->unk_14[v2], 100); - sub_0200D460(v1->unk_14[v2], 1); + CellActorData_DrawSprite(v1->unk_14[v2], 0); + CellActorData_SetPriority(v1->unk_14[v2], 100); + CellActorData_SetExplicitPriority(v1->unk_14[v2], 1); } ov12_022201E8(v1->unk_00, ov12_02234750, v1); @@ -143,7 +143,7 @@ static void ov12_02234750(SysTask *param0, void *param1) break; case 4: for (v1 = 0; v1 < 2; v1++) { - sub_0200D0F4(v0->unk_14[v1]); + CellActorData_Delete(v0->unk_14[v1]); } ov12_02220220(v0->unk_00, param0); @@ -151,7 +151,7 @@ static void ov12_02234750(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_0C); } static void ov12_0223483C(CellActorData *param0, UnkStruct_ov12_02225F6C *param1, UnkStruct_ov12_02225F6C *param2, int param3) @@ -159,7 +159,7 @@ static void ov12_0223483C(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 s16 v0, v1; sub_0200D6A4(param0, 2); - SpriteActor_EnableObject(param0, 1); + CellActorData_DrawSprite(param0, 1); SpriteActor_GetSpritePositionXY(param0, &v0, &v1); ov12_02225BC8(param1, v0, v0 + (16 * param3), v1, v1 + -32, 32); @@ -177,7 +177,7 @@ static BOOL ov12_0223489C(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 return 0; } - SpriteActor_EnableObject(param0, 0); + CellActorData_DrawSprite(param0, 0); return 1; } @@ -192,12 +192,12 @@ void ov12_022348C8(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_0C = param2; v0->unk_10 = param3; - SpriteActor_EnableObject(v0->unk_10, 0); + CellActorData_DrawSprite(v0->unk_10, 0); SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); - sub_0200D474(v0->unk_10, 100); - sub_0200D460(v0->unk_10, 1); + CellActorData_SetPriority(v0->unk_10, 100); + CellActorData_SetExplicitPriority(v0->unk_10, 1); - v0->unk_08 = sub_0200D43C(v0->unk_10); + v0->unk_08 = CellActorData_GetExplicitPaletteOffset(v0->unk_10); ov12_022201E8(v0->unk_00, ov12_02234918, v0); } @@ -210,7 +210,7 @@ static void ov12_02234918(SysTask *param0, void *param1) switch (v0->unk_04) { case 0: ov12_02226424(&v0->unk_14, 0, 16, 20 - 0, 20 - 16, 10); - SpriteActor_EnableObject(v0->unk_10, 1); + CellActorData_DrawSprite(v0->unk_10, 1); ov12_02235780(v0->unk_00, 0, 20 - 0); v0->unk_04++; break; @@ -218,17 +218,17 @@ static void ov12_02234918(SysTask *param0, void *param1) if (ov12_02226454(&v0->unk_14)) { v0->unk_04++; - sub_0200D390(v0->unk_10, 1); - sub_0200D3A4(v0->unk_10, FX32_ONE); + CellActorData_SetAnimateFlag(v0->unk_10, 1); + CellActorData_SetAnimSpeed(v0->unk_10, FX32_ONE); } break; case 2: - v1 = sub_0200D3E0(v0->unk_10); + v1 = CellActorData_GetAnimFrame(v0->unk_10); v1 %= 3; - sub_0200D430(v0->unk_10, v0->unk_08 + v1); + CellActorData_SetExplicitPaletteOffset(v0->unk_10, v0->unk_08 + v1); - if (sub_0200D3B8(v0->unk_10) == 0) { + if (CellActorData_IsAnimated(v0->unk_10) == 0) { v0->unk_04++; ov12_02226424(&v0->unk_14, 16, 0, 20 - 16, 20 - 0, 8); } @@ -236,17 +236,17 @@ static void ov12_02234918(SysTask *param0, void *param1) case 3: if (ov12_02226454(&v0->unk_14)) { v0->unk_04++; - SpriteActor_EnableObject(v0->unk_10, 0); + CellActorData_DrawSprite(v0->unk_10, 0); } break; case 4: - sub_0200D0F4(v0->unk_10); + CellActorData_Delete(v0->unk_10); ov12_02220220(v0->unk_00, param0); Heap_FreeToHeap(v0); return; } - sub_0200C7EC(v0->unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_0C); } void ov12_02234A10(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -272,14 +272,14 @@ void ov12_02234A10(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v3 = 6 - 1; v3 >= 0; v3--) { if (v3 == 6 - 1) { v1->unk_0C[v3] = param3; - SpriteActor_SetSpritePositionXY(param3, v0.x, v0.y); + CellActorData_SetPositionXY(param3, v0.x, v0.y); } else { - v1->unk_0C[v3] = SpriteActor_LoadResources(param1, param2, &v0); + v1->unk_0C[v3] = CellActor_LoadResources(param1, param2, &v0); } - sub_0200D474(v1->unk_0C[v3], 100); - sub_0200D460(v1->unk_0C[v3], 1); - SpriteActor_EnableObject(v1->unk_0C[v3], 0); + CellActorData_SetPriority(v1->unk_0C[v3], 100); + CellActorData_SetExplicitPriority(v1->unk_0C[v3], 1); + CellActorData_DrawSprite(v1->unk_0C[v3], 0); ov12_02234AE0(v1->unk_0C[v3], &v1->unk_24[v3], &v1->unk_3C[v3], v3, v4); } @@ -291,7 +291,7 @@ static void ov12_02234AE0(CellActorData *param0, int *param1, int *param2, int p { s16 v0, v1; - sub_0200D364(param0, param3 / 2); + CellActorData_SetAnim(param0, param3 / 2); *param2 = param3 * 2; *param1 = 16; @@ -301,7 +301,7 @@ static void ov12_02234AE0(CellActorData *param0, int *param1, int *param2, int p v0 += (40 + (-12 * param3)) * param4; v1 += 40; - SpriteActor_SetSpritePositionXY(param0, v0, v1); + CellActorData_SetPositionXY(param0, v0, v1); } static BOOL ov12_02234B34(CellActorData *param0, int *param1, int *param2) @@ -310,13 +310,13 @@ static BOOL ov12_02234B34(CellActorData *param0, int *param1, int *param2) (*param2)--; if (*param2 == 0) { - SpriteActor_EnableObject(param0, 1); + CellActorData_DrawSprite(param0, 1); } } else { if (*param1 > 0) { (*param1)--; } else { - SpriteActor_EnableObject(param0, 0); + CellActorData_DrawSprite(param0, 0); return 1; } } @@ -342,7 +342,7 @@ static void ov12_02234B64(SysTask *param0, void *param1) break; case 1: for (v1 = 0; v1 < 6; v1++) { - sub_0200D0F4(v0->unk_0C[v1]); + CellActorData_Delete(v0->unk_0C[v1]); } ov12_02220220(v0->unk_00, param0); @@ -350,7 +350,7 @@ static void ov12_02234B64(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } static void ov12_02234BD8(UnkStruct_ov12_02234BD8 *param0, int param1) @@ -375,12 +375,12 @@ static void ov12_02234C30(UnkStruct_ov12_02234BD8 *param0) for (v0 = 0; v0 < 6; v0++) { ov12_02225AE0(¶m0->unk_30[v0]); - SpriteActor_SetSpritePositionXY(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132); + CellActorData_SetPositionXY(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132); if ((param0->unk_30[v0].unk_04[1] >= ((90 * 0xffff) / 360)) && (param0->unk_30[v0].unk_04[1] <= ((269 * 0xffff) / 360))) { - sub_0200D460(param0->unk_18[v0], 1); + CellActorData_SetExplicitPriority(param0->unk_18[v0], 1); } else { - sub_0200D460(param0->unk_18[v0], ov12_0222339C(param0->unk_00) + 1); + CellActorData_SetExplicitPriority(param0->unk_18[v0], ov12_0222339C(param0->unk_00) + 1); } } } @@ -425,7 +425,7 @@ static void ov12_02234CA8(SysTask *param0, void *param1) break; case 4: for (v1 = 0; v1 < 6; v1++) { - sub_0200D0F4(v0->unk_18[v1]); + CellActorData_Delete(v0->unk_18[v1]); } Heap_FreeToHeap(v0); @@ -433,7 +433,7 @@ static void ov12_02234CA8(SysTask *param0, void *param1) return; } - sub_0200C7EC(v0->unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_08); } void ov12_02234D98(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, SpriteGfxHandler *param2, CellActorData *param3) @@ -460,12 +460,12 @@ void ov12_02234D98(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if (v1 == 0) { v0->unk_18[v1] = param3; } else { - v0->unk_18[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v3); + v0->unk_18[v1] = CellActor_LoadResources(v0->unk_04, v0->unk_08, &v3); } - sub_0200D474(v0->unk_18[v1], 100); + CellActorData_SetPriority(v0->unk_18[v1], 100); SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); - sub_0200D390(v0->unk_18[v1], 1); + CellActorData_SetAnimateFlag(v0->unk_18[v1], 1); } v0->unk_14 = ov12_02225964(v0->unk_00, ov12_02220240(v0->unk_00)); diff --git a/src/overlay012/ov12_02234E44.c b/src/overlay012/ov12_02234E44.c index 2194801d9c..8062b054ac 100644 --- a/src/overlay012/ov12_02234E44.c +++ b/src/overlay012/ov12_02234E44.c @@ -13,8 +13,8 @@ #include "bg_window.h" #include "graphics.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" -#include "unk_0200C6E4.h" typedef struct { int unk_00; @@ -102,9 +102,9 @@ static void ov12_02234EF0(SysTask *param0, void *param1) if ((v0->unk_00.unk_14 == 0) && (v0->unk_00.unk_16 == 16)) { Bg_ClearTilemap(v0->unk_18.unk_14, 2); - SpriteActor_EnableObject(v0->unk_34, 0); - SpriteActor_EnableObject(v0->unk_38, 0); - SpriteActor_EnableObject(v0->unk_3C, 0); + CellActorData_DrawSprite(v0->unk_34, 0); + CellActorData_DrawSprite(v0->unk_38, 0); + CellActorData_DrawSprite(v0->unk_3C, 0); v0->unk_18.unk_00++; } @@ -128,10 +128,10 @@ static void ov12_02234EF0(SysTask *param0, void *param1) Bg_SetOffset(v0->unk_18.unk_14, 2, 0, v0->unk_00.unk_10); Bg_SetOffset(v0->unk_18.unk_14, 2, 3, v0->unk_00.unk_12); - sub_0200D330(v0->unk_34); - sub_0200D330(v0->unk_38); - sub_0200D330(v0->unk_3C); - sub_0200C7EC(v0->unk_18.unk_0C); + CellActorData_UpdateObject(v0->unk_34); + CellActorData_UpdateObject(v0->unk_38); + CellActorData_UpdateObject(v0->unk_3C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_18.unk_0C); } static void ov12_0223505C(UnkStruct_ov12_0221FCDC *param0, UnkStruct_ov12_02234E44 *param1) @@ -158,8 +158,8 @@ static void ov12_0223507C(UnkStruct_ov12_0221FCDC *param0, UnkStruct_ov12_02234E v1 = ov12_02223428(v0->unk_18.unk_04, 2); v1 = 2; - sub_0200D460(v0->unk_34, v1); - sub_0200D460(v0->unk_38, v1); + CellActorData_SetExplicitPriority(v0->unk_34, v1); + CellActorData_SetExplicitPriority(v0->unk_38, v1); { int v2; @@ -174,24 +174,24 @@ static void ov12_0223507C(UnkStruct_ov12_0221FCDC *param0, UnkStruct_ov12_02234E v2 = ov12_02235254(param0, v3); if (ov12_0221FDD4(param0) == 1) { - SpriteActor_EnableObject(v0->unk_3C, 0); + CellActorData_DrawSprite(v0->unk_3C, 0); v1 = ov12_02223428(v0->unk_18.unk_04, 2); - sub_0200D460(v0->unk_34, v1); - sub_0200D460(v0->unk_38, v1); + CellActorData_SetExplicitPriority(v0->unk_34, v1); + CellActorData_SetExplicitPriority(v0->unk_38, v1); } else { if ((v2 == 0) || (v2 == 1)) { - SpriteActor_EnableObject(v0->unk_3C, 0); + CellActorData_DrawSprite(v0->unk_3C, 0); } else if ((v2 == 4) || (v2 == 3)) { if (v0->unk_00.unk_08 == 0) { - sub_0200D460(v0->unk_3C, v1 + 1); + CellActorData_SetExplicitPriority(v0->unk_3C, v1 + 1); } else { - sub_0200D460(v0->unk_3C, v1 + 1); + CellActorData_SetExplicitPriority(v0->unk_3C, v1 + 1); } } else { if (v0->unk_00.unk_08 == 0) { - sub_0200D460(v0->unk_3C, v1 - 1); + CellActorData_SetExplicitPriority(v0->unk_3C, v1 - 1); } else { - sub_0200D460(v0->unk_3C, v1 - 1); + CellActorData_SetExplicitPriority(v0->unk_3C, v1 - 1); } } } diff --git a/src/overlay012/ov12_02235254.c b/src/overlay012/ov12_02235254.c index 2c12c8f2d1..05bb780a8b 100644 --- a/src/overlay012/ov12_02235254.c +++ b/src/overlay012/ov12_02235254.c @@ -15,8 +15,8 @@ #include "heap.h" #include "inlines.h" +#include "sprite_renderer.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_02014000.h" void ov17_022413D8(void); diff --git a/src/overlay012/ov12_02235E94.c b/src/overlay012/ov12_02235E94.c index a965da98fe..5e0d101d5e 100644 --- a/src/overlay012/ov12_02235E94.c +++ b/src/overlay012/ov12_02235E94.c @@ -30,11 +30,11 @@ #include "palette.h" #include "pokemon.h" #include "spl.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_02005474.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_02014000.h" #include "unk_0201D15C.h" #include "unk_0202C9F4.h" @@ -1123,7 +1123,7 @@ static BOOL ov12_02236918(BallRotation *param0) { switch (param0->unk_08) { case 0: - sub_0200D364(param0->unk_30, 1); + CellActorData_SetAnim(param0->unk_30, 1); { UnkStruct_ov12_02236690 v0; @@ -1140,7 +1140,7 @@ static BOOL ov12_02236918(BallRotation *param0) param0->unk_08++; break; case 1: { - int v1 = sub_0200D3E0(param0->unk_30); + int v1 = CellActorData_GetAnimFrame(param0->unk_30); if (v1 >= 2) { param0->unk_24 = 0; @@ -1154,7 +1154,7 @@ static BOOL ov12_02236918(BallRotation *param0) break; case 3: { if (ov12_02236764(param0->unk_D0) == 0) { - sub_0200D3CC(param0->unk_30, 0); + CellActorData_SetAnimFrame(param0->unk_30, 0); ov12_02236780(param0->unk_D0); param0->unk_08++; } @@ -1222,7 +1222,7 @@ static BOOL ov12_02236A6C(BallRotation *param0) { int v0; - v0 = sub_0200D43C(param0->unk_30); + v0 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); PaletteData_StartFade(param0->unk_90.paletteSys, 0x4, 1 << v0, -1, 0, 12, 0x37F); param0->unk_08++; @@ -1235,7 +1235,7 @@ static BOOL ov12_02236A6C(BallRotation *param0) { int v1; - v1 = sub_0200D43C(param0->unk_30); + v1 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); PaletteData_StartFade(param0->unk_90.paletteSys, 0x4, 1 << v1, -1, 12, 0, 0x37F); } @@ -1331,8 +1331,8 @@ static BOOL ov12_02236B98(BallRotation *param0) { switch (param0->unk_08) { case 0: - sub_0200D364(param0->unk_30, 1); - sub_0200D3CC(param0->unk_30, 0); + CellActorData_SetAnim(param0->unk_30, 1); + CellActorData_SetAnimFrame(param0->unk_30, 0); param0->unk_08++; case 1: { s16 v0, v1; @@ -1342,7 +1342,7 @@ static BOOL ov12_02236B98(BallRotation *param0) v1 = Unk_ov12_0223ACF0[param0->unk_0C][1]; v2 = Unk_ov12_0223ACF0[param0->unk_0C][2]; - sub_0200D3CC(param0->unk_30, v2); + CellActorData_SetAnimFrame(param0->unk_30, v2); param0->unk_0C++; @@ -1459,7 +1459,7 @@ static BOOL ov12_02236D18(BallRotation *param0) { int v0; - v0 = sub_0200D43C(param0->unk_30); + v0 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); PaletteData_StartFade(param0->unk_90.paletteSys, 0x4, 1 << v0, -5, 0, 10, 0x0); param0->unk_08++; @@ -1488,7 +1488,7 @@ static BOOL ov12_02236D18(BallRotation *param0) break; case 3: { if (ov12_02236764(param0->unk_D0) == 0) { - sub_0200D3CC(param0->unk_30, 0); + CellActorData_SetAnimFrame(param0->unk_30, 0); ov12_02236780(param0->unk_D0); param0->unk_08++; } @@ -1516,7 +1516,7 @@ static BOOL ov12_02236E0C(BallRotation *param0) case 0: { int v0; - v0 = sub_0200D43C(param0->unk_30); + v0 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); PaletteData_StartFade(param0->unk_90.paletteSys, 0x4, 1 << v0, -5, 10, 0, 0x0); } param0->unk_08++; @@ -1555,7 +1555,7 @@ static BOOL ov12_02236E7C(BallRotation *param0) } else { param0->unk_20 = 0; param0->unk_21 = 15; - SpriteActor_EnableObject(param0->unk_30, 0); + CellActorData_DrawSprite(param0->unk_30, 0); param0->unk_08++; } @@ -1651,7 +1651,7 @@ static BOOL ov12_02236F24(BallRotation *param0) if (param0->unk_B8.unk_0C == ((param0->unk_B8.unk_08 / 2) + 10)) { int v1; - v1 = sub_0200D43C(param0->unk_30); + v1 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); param0->unk_D4 = ov12_02226870(param0->unk_90.paletteSys, param0->unk_90.heapID, 2, v1 * 16, 16, -2, 2, 0, 14, 0xFFFF, 1002); } } @@ -1694,7 +1694,7 @@ static BOOL ov12_02236F24(BallRotation *param0) } break; case 3: - sub_0200D364(param0->unk_30, 1); + CellActorData_SetAnim(param0->unk_30, 1); ov12_02237E30(param0, 1); param0->unk_B8.unk_0C = 0; param0->unk_08++; @@ -1705,7 +1705,7 @@ static BOOL ov12_02236F24(BallRotation *param0) int v2; if ((param0->unk_90.type != 12) && (param0->unk_90.type != 13)) { - v2 = sub_0200D43C(param0->unk_30); + v2 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); param0->unk_D4 = ov12_02226870(param0->unk_90.paletteSys, param0->unk_90.heapID, 2, v2 * 16, 16, -2, 2, 0, 14, 0xFFFF, 1002); } } @@ -1762,7 +1762,7 @@ static BOOL ov12_022371E4(BallRotation *param0) if (param0->unk_B8.unk_0C == ((param0->unk_B8.unk_08 / 2) + 10)) { int v1; - v1 = sub_0200D43C(param0->unk_30); + v1 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); param0->unk_D4 = ov12_02226870(param0->unk_90.paletteSys, param0->unk_90.heapID, 2, v1 * 16, 16, -2, 2, 0, 14, 0xFFFF, 1002); } } @@ -1802,19 +1802,19 @@ static BOOL ov12_022371E4(BallRotation *param0) } break; case 3: - sub_0200D364(param0->unk_30, 1); + CellActorData_SetAnim(param0->unk_30, 1); ov12_02237E30(param0, 0); param0->unk_B8.unk_0C = 0; param0->unk_08++; break; default: if (param0->unk_B8.unk_0C == 5) { - sub_0200D3CC(param0->unk_30, 2); + CellActorData_SetAnimFrame(param0->unk_30, 2); { int v2; - v2 = sub_0200D43C(param0->unk_30); + v2 = CellActorData_GetExplicitPaletteOffset(param0->unk_30); param0->unk_D4 = ov12_02226870(param0->unk_90.paletteSys, param0->unk_90.heapID, 2, v2 * 16, 16, -2, 2, 0, 14, 0xFFFF, 1002); } @@ -1850,11 +1850,11 @@ static BOOL ov12_02237474(BallRotation *param0) switch (param0->unk_08) { case 0: ov12_02237E30(param0, 0); - sub_0200D364(param0->unk_30, 1); + CellActorData_SetAnim(param0->unk_30, 1); param0->unk_B8.unk_0C++; if (param0->unk_B8.unk_0C >= Unk_ov12_0223ABBC[0][1]) { - sub_0200D3CC(param0->unk_30, Unk_ov12_0223ABBC[0][0]); + CellActorData_SetAnimFrame(param0->unk_30, Unk_ov12_0223ABBC[0][0]); param0->unk_B8.unk_0C = 0; param0->unk_08++; } @@ -1863,7 +1863,7 @@ static BOOL ov12_02237474(BallRotation *param0) param0->unk_B8.unk_0C++; if (param0->unk_B8.unk_0C >= Unk_ov12_0223ABBC[1][1]) { - sub_0200D3CC(param0->unk_30, Unk_ov12_0223ABBC[1][0]); + CellActorData_SetAnimFrame(param0->unk_30, Unk_ov12_0223ABBC[1][0]); param0->unk_B8.unk_0C = 0; param0->unk_08++; } @@ -1889,7 +1889,7 @@ static BOOL ov12_02237474(BallRotation *param0) param0->unk_B8.unk_0C++; if (param0->unk_B8.unk_0C >= Unk_ov12_0223ABBC[2][1]) { - sub_0200D3CC(param0->unk_30, Unk_ov12_0223ABBC[2][0]); + CellActorData_SetAnimFrame(param0->unk_30, Unk_ov12_0223ABBC[2][0]); param0->unk_B8.unk_0C = 0; param0->unk_08++; } @@ -1898,7 +1898,7 @@ static BOOL ov12_02237474(BallRotation *param0) param0->unk_B8.unk_0C++; if (param0->unk_B8.unk_0C >= Unk_ov12_0223ABBC[3][1]) { - sub_0200D3CC(param0->unk_30, Unk_ov12_0223ABBC[3][0]); + CellActorData_SetAnimFrame(param0->unk_30, Unk_ov12_0223ABBC[3][0]); param0->unk_B8.unk_0C = 0; param0->unk_08++; } @@ -1907,7 +1907,7 @@ static BOOL ov12_02237474(BallRotation *param0) param0->unk_B8.unk_0C++; if (param0->unk_B8.unk_0C >= Unk_ov12_0223ABBC[4][1]) { - sub_0200D3CC(param0->unk_30, Unk_ov12_0223ABBC[4][0]); + CellActorData_SetAnimFrame(param0->unk_30, Unk_ov12_0223ABBC[4][0]); param0->unk_B8.unk_0C = 0; param0->unk_08++; } @@ -1990,7 +1990,7 @@ static void ov12_022376D0(SysTask *param0, void *param1) if (v1->unk_DC > 0) { v1->unk_DC--; - sub_0200C7EC(v1->unk_2C); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_2C); return; } @@ -2001,10 +2001,10 @@ static void ov12_022376D0(SysTask *param0, void *param1) } if (v1->unk_24 == 1) { - sub_0200D330(v1->unk_30); + CellActorData_UpdateObject(v1->unk_30); } - sub_0200C7EC(v1->unk_2C); + SpriteGfxHandler_UpdateCellActorCollection(v1->unk_2C); } BallRotation *ov12_02237728(BallThrow *param0) @@ -2024,7 +2024,7 @@ BallRotation *ov12_02237728(BallThrow *param0) v0->unk_18 = 0; v0->unk_00 = 0; v0->unk_04 = 0; - v0->unk_2C = sub_0200C704(v0->unk_90.cellActorSys); + v0->unk_2C = SpriteRenderer_CreateGfxHandler(v0->unk_90.cellActorSys); v0->unk_DC = 0; v0->unk_24 = ov12_02235F2C(v0->unk_90.type); v0->unk_B8.unk_0C = 0; @@ -2084,8 +2084,8 @@ void ov12_0223783C(BallRotation *param0) GF_ASSERT(param0 != NULL); - sub_0200D0B0(param0->unk_90.cellActorSys, param0->unk_2C); - sub_0200D0F4(param0->unk_30); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_90.cellActorSys, param0->unk_2C); + CellActorData_Delete(param0->unk_30); SysTask_Done(param0->unk_CC); Heap_FreeToHeap(param0); } @@ -2274,10 +2274,10 @@ static void ov12_02237C54(BallRotation *param0) int v2; int v3; - sub_0200C7C0(param0->unk_90.cellActorSys, param0->unk_2C, 10); + SpriteRenderer_CreateCellActorList(param0->unk_90.cellActorSys, param0->unk_2C, 10); if (param0->unk_90.surface == 0) { - sub_0200964C(sub_0200C738(param0->unk_90.cellActorSys), 0, ((192 + 80) << FX32_SHIFT)); + sub_0200964C(SpriteRenderer_GetG2dRenderer(param0->unk_90.cellActorSys), 0, ((192 + 80) << FX32_SHIFT)); } { @@ -2291,7 +2291,7 @@ static void ov12_02237C54(BallRotation *param0) v5.val1[4] = 0; v5.val1[5] = 0; - sub_0200CB30(param0->unk_90.cellActorSys, param0->unk_2C, &v5); + SpriteRenderer_InitGfxResourceList(param0->unk_90.cellActorSys, param0->unk_2C, &v5); } v0 = ov12_02235FC8(param0->unk_90.ballID, 0); @@ -2305,7 +2305,7 @@ static void ov12_02237C54(BallRotation *param0) v6 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param0->unk_90.heapID); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_90.cellActorSys, param0->unk_2C, v6, v0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param0->unk_90.target + 6000); - SpriteRenderer_LoadPalette(param0->unk_90.paletteSys, 2, param0->unk_90.cellActorSys, param0->unk_2C, v6, v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param0->unk_90.target + 6000); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_90.paletteSys, 2, param0->unk_90.cellActorSys, param0->unk_2C, v6, v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param0->unk_90.target + 6000); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_90.cellActorSys, param0->unk_2C, v6, v2, 1, param0->unk_90.target + 6000); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_90.cellActorSys, param0->unk_2C, v6, v3, 1, param0->unk_90.target + 6000); NARC_dtor(v6); @@ -2332,25 +2332,25 @@ static void ov12_02237D8C(BallRotation *param0) v1.resources[v0] = param0->unk_90.target + 6000; } - param0->unk_30 = SpriteActor_LoadResources(param0->unk_90.cellActorSys, param0->unk_2C, &v1); + param0->unk_30 = CellActor_LoadResources(param0->unk_90.cellActorSys, param0->unk_2C, &v1); - SpriteActor_EnableObject(param0->unk_30, 1); + CellActorData_DrawSprite(param0->unk_30, 1); sub_0200D6A4(param0->unk_30, 2); - sub_0200D3CC(param0->unk_30, 0); - sub_0200D364(param0->unk_30, 0); - sub_0200D330(param0->unk_30); + CellActorData_SetAnimFrame(param0->unk_30, 0); + CellActorData_SetAnim(param0->unk_30, 0); + CellActorData_UpdateObject(param0->unk_30); ov12_02220474(); } void ov12_02237E0C(BallRotation *param0, int param1) { - SpriteActor_EnableObject(param0->unk_30, param1); + CellActorData_DrawSprite(param0->unk_30, param1); } void ov12_02237E18(BallRotation *param0, s16 param1, s16 param2) { - SpriteActor_SetSpritePositionXY(param0->unk_30, param1, param2); + CellActorData_SetPositionXY(param0->unk_30, param1, param2); } void ov12_02237E24(BallRotation *param0, u16 param1) @@ -2365,12 +2365,12 @@ void ov12_02237E30(BallRotation *param0, BOOL param1) void ov12_02237E34(BallRotation *param0, int param1) { - sub_0200D474(param0->unk_30, param1); + CellActorData_SetPriority(param0->unk_30, param1); } void ov12_02237E40(BallRotation *param0, int param1) { - sub_0200D460(param0->unk_30, param1); + CellActorData_SetExplicitPriority(param0->unk_30, param1); } void ov12_02237E4C(BallRotation *param0, int param1) diff --git a/src/overlay013/ov13_0221FC20.c b/src/overlay013/ov13_0221FC20.c index b9200d50e6..23dde0c4d5 100644 --- a/src/overlay013/ov13_0221FC20.c +++ b/src/overlay013/ov13_0221FC20.c @@ -31,6 +31,7 @@ #include "party.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task_manager.h" @@ -39,7 +40,6 @@ #include "unk_02005474.h" #include "unk_0200679C.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_0208C098.h" #include "unk_02094EDC.h" @@ -283,7 +283,7 @@ static void ov13_0221FCAC(SysTask *param0, void *param1) } ov13_0222537C(v0); - sub_0200C7EC(v0->unk_1FB0); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_1FB0); ov13_0222601C(v0); } @@ -883,7 +883,7 @@ static u8 ov13_022208A4(UnkStruct_ov13_022213F0 *param0) param0->unk_04[v0->unk_11].unk_17_3 = PokemonSummaryScreen_StatusIconAnimIdx(param0->unk_04[v0->unk_11].unk_00); if (param0->unk_04[v0->unk_11].unk_17_3 == 7) { - SpriteActor_EnableObject(param0->unk_1FB4[13 + v0->unk_11], 0); + CellActorData_DrawSprite(param0->unk_1FB4[13 + v0->unk_11], 0); ov13_022234A8(param0, v0->unk_11); } @@ -1715,7 +1715,7 @@ static u8 ov13_022219DC(UnkStruct_ov13_022213F0 *param0) static void ov13_02221A04(UnkStruct_ov13_022213F0 *param0) { - SpriteActor_EnableObject(param0->unk_1FB4[26], 0); + CellActorData_DrawSprite(param0->unk_1FB4[26], 0); Window_ClearAndScheduleCopyToVRAM(¶m0->unk_206C[10]); Window_ClearAndScheduleCopyToVRAM(¶m0->unk_206C[6]); Window_ClearAndScheduleCopyToVRAM(¶m0->unk_206C[7]); diff --git a/src/overlay013/ov13_02224500.c b/src/overlay013/ov13_02224500.c index 6023dd1cf5..5e3e008dfa 100644 --- a/src/overlay013/ov13_02224500.c +++ b/src/overlay013/ov13_02224500.c @@ -23,7 +23,8 @@ #include "narc.h" #include "party.h" #include "pokemon_icon.h" -#include "unk_0200C6E4.h" +#include "pokemon_summary_app.h" +#include "sprite_renderer.h" #include "unk_0207C908.h" #include "unk_0207E0B8.h" #include "unk_0208C098.h" @@ -240,10 +241,10 @@ static void ov13_0222453C(UnkStruct_ov13_022213F0 *param0) UnkStruct_ov104_02241308 v0 = { 18, 6, 6, 6, 0, 0 }; SpriteRenderer *v1 = ov16_0223E010(param0->unk_00->unk_08); - param0->unk_1FB0 = sub_0200C704(v1); + param0->unk_1FB0 = SpriteRenderer_CreateGfxHandler(v1); - sub_0200C7C0(v1, param0->unk_1FB0, 38 + 5); - sub_0200CB30(v1, param0->unk_1FB0, &v0); + SpriteRenderer_CreateCellActorList(v1, param0->unk_1FB0, 38 + 5); + SpriteRenderer_InitGfxResourceList(v1, param0->unk_1FB0, &v0); } static void ov13_02224588(UnkStruct_ov13_022213F0 *param0) @@ -255,7 +256,7 @@ static void ov13_02224588(UnkStruct_ov13_022213F0 *param0) v2 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param0->unk_00->unk_0C); v0 = ov16_0223E010(param0->unk_00->unk_08); - SpriteRenderer_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 45063); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 45063); SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_1FB0, v2, PokeIcon32KCellsFileIndex(), 0, 45063); SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, param0->unk_1FB0, v2, PokeIcon32KAnimationFileIndex(), 0, 45063); @@ -277,7 +278,7 @@ static void ov13_02224670(UnkStruct_ov13_022213F0 *param0) v1 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PST_GRA, param0->unk_00->unk_0C); - SpriteRenderer_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, v1, PokemonSummaryScreen_StatusIconPltt(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45064); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_1E4, 3, v0, param0->unk_1FB0, v1, PokemonSummaryScreen_StatusIconPltt(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45064); SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_1FB0, v1, PokemonSummaryScreen_StatusIconCell(), 0, 45064); SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, param0->unk_1FB0, v1, PokemonSummaryScreen_StatusIconAnim(), 0, 45064); SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_1FB0, v1, PokemonSummaryScreen_StatusIconChar(), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45069); @@ -310,7 +311,7 @@ static void ov13_02224798(UnkStruct_ov13_022213F0 *param0) v2 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, param0->unk_00->unk_0C); v0 = ov16_0223E010(param0->unk_00->unk_08); - SpriteRenderer_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45066); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45066); SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_1FB0, v2, sub_02081938(), 0, 45066); SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, param0->unk_1FB0, v2, sub_0208193C(), 0, 45066); SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_1FB0, v2, sub_02081930(), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45078); @@ -321,10 +322,10 @@ static void ov13_02224848(UnkStruct_ov13_022213F0 *param0) { SpriteRenderer *v0 = ov16_0223E010(param0->unk_00->unk_08); - sub_0200CD7C(param0->unk_1E4, 3, v0, param0->unk_1FB0, 72, 27, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45067); - sub_0200CE0C(v0, param0->unk_1FB0, 72, 25, 0, 45067); - sub_0200CE3C(v0, param0->unk_1FB0, 72, 24, 0, 45067); - sub_0200CBDC(v0, param0->unk_1FB0, 72, 26, 0, NNS_G2D_VRAM_TYPE_2DSUB, 45079); + SpriteRenderer_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, 72, 27, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45067); + SpriteRenderer_LoadCellResObj(v0, param0->unk_1FB0, 72, 25, 0, 45067); + SpriteRenderer_LoadAnimResObj(v0, param0->unk_1FB0, 72, 24, 0, 45067); + SpriteRenderer_LoadCharResObj(v0, param0->unk_1FB0, 72, 26, 0, NNS_G2D_VRAM_TYPE_2DSUB, 45079); } static CellActorData *ov13_022248D8(UnkStruct_ov13_022213F0 *param0, u32 param1) @@ -348,7 +349,7 @@ static CellActorData *ov13_022248D8(UnkStruct_ov13_022213F0 *param0, u32 param1) v0.bgPriority = 1; v0.transferToVRAM = FALSE; - return SpriteActor_LoadResources(v1, param0->unk_1FB0, &v0); + return CellActor_LoadResources(v1, param0->unk_1FB0, &v0); } static void ov13_02224948(UnkStruct_ov13_022213F0 *param0) @@ -370,17 +371,17 @@ void ov13_02224970(UnkStruct_ov13_022213F0 *param0) v0 = ov16_0223E010(param0->unk_00->unk_08); for (v1 = 0; v1 < 38; v1++) { - sub_0200D0F4(param0->unk_1FB4[v1]); + CellActorData_Delete(param0->unk_1FB4[v1]); } ov13_022255B8(param0); - sub_0200D0B0(v0, param0->unk_1FB0); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0, param0->unk_1FB0); } static void ov13_022249AC(CellActorData *param0, const int param1, const int param2) { - SpriteActor_EnableObject(param0, 1); - SpriteActor_SetSpritePositionXY(param0, param1, param2); + CellActorData_DrawSprite(param0, 1); + CellActorData_SetPositionXY(param0, param1, param2); } static void ov13_022249CC(UnkStruct_ov13_022213F0 *param0) @@ -392,7 +393,7 @@ static void ov13_022249CC(UnkStruct_ov13_022213F0 *param0) continue; } - sub_0200D41C(param0->unk_1FB4[7 + v0], PokeIconPaletteIndex(param0->unk_04[v0].unk_04, param0->unk_04[v0].unk_2E, param0->unk_04[v0].unk_17_7)); + CellActorData_SetExplicitPalette(param0->unk_1FB4[7 + v0], PokeIconPaletteIndex(param0->unk_04[v0].unk_04, param0->unk_04[v0].unk_2E, param0->unk_04[v0].unk_17_7)); } } @@ -401,7 +402,7 @@ static void ov13_02224A0C(UnkStruct_ov13_022213F0 *param0, CellActorData *param1 SpriteRenderer *v0 = ov16_0223E010(param0->unk_00->unk_08); sub_0200D948(v0, param0->unk_1FB0, sub_0207C944(), sub_0207C908(param3), 1, param2); - sub_0200D41C(param1, sub_0207C92C(param3) + 4); + CellActorData_SetExplicitPalette(param1, sub_0207C92C(param3) + 4); } static void ov13_02224A5C(UnkStruct_ov13_022213F0 *param0, CellActorData *param1, u32 param2) @@ -409,7 +410,7 @@ static void ov13_02224A5C(UnkStruct_ov13_022213F0 *param0, CellActorData *param1 SpriteRenderer *v0 = ov16_0223E010(param0->unk_00->unk_08); sub_0200D948(v0, param0->unk_1FB0, sub_0207CAC0(), sub_0207CA90(param2), 1, 45077); - sub_0200D41C(param1, sub_0207CAA8(param2) + 4); + CellActorData_SetExplicitPalette(param1, sub_0207CAA8(param2) + 4); } static void ov13_02224AB0(u16 param0, CellActorData *param1, const int param2, const int param3) @@ -418,7 +419,7 @@ static void ov13_02224AB0(u16 param0, CellActorData *param1, const int param2, c return; } - sub_0200D364(param1, param0); + CellActorData_SetAnim(param1, param0); ov13_022249AC(param1, param2, param3); } @@ -440,9 +441,9 @@ static void ov13_02224B28(u16 param0, CellActorData *param1, const int param2, c } if (Item_IsMail(param0) == 1) { - sub_0200D364(param1, 1); + CellActorData_SetAnim(param1, 1); } else { - sub_0200D364(param1, 0); + CellActorData_SetAnim(param1, 0); } ov13_022249AC(param1, param2, param3); @@ -454,7 +455,7 @@ static void ov13_02224B5C(u8 param0, CellActorData *param1, const int param2, co return; } - sub_0200D364(param1, 2); + CellActorData_SetAnim(param1, 2); ov13_022249AC(param1, param2, param3); } @@ -463,7 +464,7 @@ void ov13_02224B7C(UnkStruct_ov13_022213F0 *param0, u32 param1) u32 v0; for (v0 = 0; v0 < 38; v0++) { - SpriteActor_EnableObject(param0->unk_1FB4[v0], 0); + CellActorData_DrawSprite(param0->unk_1FB4[v0], 0); } switch (param1) { @@ -704,12 +705,12 @@ void ov13_022252E8(UnkStruct_ov13_022213F0 *param0) static void ov13_02225304(CellActorData *param0, u8 param1) { - if (sub_0200D37C(param0) == param1) { + if (CellActorData_GetActiveAnim(param0) == param1) { return; } - sub_0200D3CC(param0, 0); - sub_0200D364(param0, param1); + CellActorData_SetAnimFrame(param0, 0); + CellActorData_SetAnim(param0, param1); } static u8 ov13_02225324(UnkStruct_ov13_02221ED0 *param0) @@ -749,7 +750,7 @@ void ov13_0222537C(UnkStruct_ov13_022213F0 *param0) v1 = ov13_02225324(¶m0->unk_04[v0]); ov13_02225304(param0->unk_1FB4[7 + v0], v1); - sub_0200D34C(param0->unk_1FB4[7 + v0], FX32_ONE); + CellActorData_UpdateNFrames(param0->unk_1FB4[7 + v0], FX32_ONE); } } diff --git a/src/overlay013/ov13_02225710.c b/src/overlay013/ov13_02225710.c index 1a1dd25ac0..7d43109c36 100644 --- a/src/overlay013/ov13_02225710.c +++ b/src/overlay013/ov13_02225710.c @@ -9,7 +9,7 @@ #include "bg_window.h" #include "heap.h" #include "palette.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" typedef struct { u8 unk_00; diff --git a/src/overlay013/ov13_022264F4.c b/src/overlay013/ov13_022264F4.c index 216d2013bc..a60644fa78 100644 --- a/src/overlay013/ov13_022264F4.c +++ b/src/overlay013/ov13_022264F4.c @@ -32,6 +32,7 @@ #include "party.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task_manager.h" @@ -40,7 +41,6 @@ #include "unk_02005474.h" #include "unk_0200679C.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_020797C8.h" static void ov13_02226590(SysTask *param0, void *param1); @@ -186,7 +186,7 @@ static void ov13_02226590(SysTask *param0, void *param1) } ov13_02228848(v0); - sub_0200C7EC(v0->unk_30C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_30C); } static u8 ov13_0222668C(UnkStruct_ov13_02227244 *param0) diff --git a/src/overlay013/ov13_02227BDC.c b/src/overlay013/ov13_02227BDC.c index 17c79f7e61..58dd22d61c 100644 --- a/src/overlay013/ov13_02227BDC.c +++ b/src/overlay013/ov13_02227BDC.c @@ -22,7 +22,7 @@ #include "item.h" #include "narc.h" #include "palette.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" static void ov13_02227C08(UnkStruct_ov13_02227244 *param0); static void ov13_02227C54(UnkStruct_ov13_02227244 *param0); @@ -81,10 +81,10 @@ static void ov13_02227C08(UnkStruct_ov13_02227244 *param0) UnkStruct_ov104_02241308 v0 = { 8, 8, 3, 3, 0, 0 }; SpriteRenderer *v1 = ov16_0223E010(param0->unk_00->unk_00); - param0->unk_30C = sub_0200C704(v1); + param0->unk_30C = SpriteRenderer_CreateGfxHandler(v1); - sub_0200C7C0(v1, param0->unk_30C, 6 + 5 + 1); - sub_0200CB30(v1, param0->unk_30C, &v0); + SpriteRenderer_CreateCellActorList(v1, param0->unk_30C, 6 + 5 + 1); + SpriteRenderer_InitGfxResourceList(v1, param0->unk_30C, &v0); } static void ov13_02227C54(UnkStruct_ov13_02227244 *param0) @@ -98,7 +98,7 @@ static void ov13_02227C54(UnkStruct_ov13_02227244 *param0) for (v1 = 0; v1 < 6; v1++) { SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_30C, v2, Item_FileID(1, 1), 0, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1); - SpriteRenderer_LoadPalette(param0->unk_08, 3, v0, param0->unk_30C, v2, Item_FileID(1, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_08, 3, v0, param0->unk_30C, v2, Item_FileID(1, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1); } SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_30C, v2, Item_IconNCERFile(), 0, 46263); @@ -138,7 +138,7 @@ static CellActorData *ov13_02227D78(UnkStruct_ov13_02227244 *param0, u32 param1) v0.bgPriority = 1; v0.transferToVRAM = FALSE; - return SpriteActor_LoadResources(v1, param0->unk_30C, &v0); + return CellActor_LoadResources(v1, param0->unk_30C, &v0); } static void ov13_02227DE8(UnkStruct_ov13_02227244 *param0) @@ -158,18 +158,18 @@ void ov13_02227E08(UnkStruct_ov13_02227244 *param0) v0 = ov16_0223E010(param0->unk_00->unk_00); for (v1 = 0; v1 < 6; v1++) { - sub_0200D0F4(param0->unk_310[v1]); + CellActorData_Delete(param0->unk_310[v1]); } ov13_02227FDC(param0); ov13_022280C8(param0); - sub_0200D0B0(v0, param0->unk_30C); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0, param0->unk_30C); } static void ov13_02227E48(CellActorData *param0, const int param1, const int param2) { - SpriteActor_EnableObject(param0, 1); - SpriteActor_SetSpritePositionXY(param0, param1, param2); + CellActorData_DrawSprite(param0, 1); + CellActorData_SetPositionXY(param0, param1, param2); } void ov13_02227E68(UnkStruct_ov13_02227244 *param0, u32 param1) @@ -177,7 +177,7 @@ void ov13_02227E68(UnkStruct_ov13_02227244 *param0, u32 param1) u32 v0; for (v0 = 0; v0 < 6; v0++) { - SpriteActor_EnableObject(param0->unk_310[v0], 0); + CellActorData_DrawSprite(param0->unk_310[v0], 0); } switch (param1) { diff --git a/src/overlay013/ov13_02228128.c b/src/overlay013/ov13_02228128.c index ca5ca8297c..7dc15374ed 100644 --- a/src/overlay013/ov13_02228128.c +++ b/src/overlay013/ov13_02228128.c @@ -10,7 +10,7 @@ #include "bg_window.h" #include "heap.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" typedef struct { u8 unk_00; @@ -399,7 +399,7 @@ static void ov13_022287A4(UnkStruct_ov13_02227244 *param0, u8 param1, u8 param2) for (v1 = 0; v1 < 6; v1++) { v0 = param0->unk_310[v1]; - if (sub_0200D408(v0) != 0) { + if (CellActorData_GetDrawFlag(v0) != 0) { break; } } diff --git a/src/overlay017/ov17_0223B140.c b/src/overlay017/ov17_0223B140.c index 8bf69d5685..7146e29803 100644 --- a/src/overlay017/ov17_0223B140.c +++ b/src/overlay017/ov17_0223B140.c @@ -37,6 +37,7 @@ #include "overlay_manager.h" #include "palette.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -44,7 +45,6 @@ #include "unk_020041CC.h" #include "unk_0200762C.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02014000.h" @@ -189,16 +189,16 @@ int ov17_0223B140(OverlayManager *param0, int *param1) sub_0201E450(4); Font_InitManager(FONT_SUBSCREEN, 21); - v0->unk_0C.unk_18 = sub_0200C6E4(21); - sub_0200C73C(v0->unk_0C.unk_18, &Unk_ov17_02252DC8, &Unk_ov17_02252D9C, (16 + 16)); + v0->unk_0C.unk_18 = SpriteRenderer_Create(21); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_0C.unk_18, &Unk_ov17_02252DC8, &Unk_ov17_02252D9C, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_64K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_0C.unk_1C = sub_0200C704(v0->unk_0C.unk_18); + v0->unk_0C.unk_1C = SpriteRenderer_CreateGfxHandler(v0->unk_0C.unk_18); - sub_0200C7C0(v0->unk_0C.unk_18, v0->unk_0C.unk_1C, (64 + 64)); - sub_0200CB30(v0->unk_0C.unk_18, v0->unk_0C.unk_1C, &Unk_ov17_02252DB0); - sub_0200964C(sub_0200C738(v0->unk_0C.unk_18), 0, ((192 + 80) << FX32_SHIFT)); + SpriteRenderer_CreateCellActorList(v0->unk_0C.unk_18, v0->unk_0C.unk_1C, (64 + 64)); + SpriteRenderer_InitGfxResourceList(v0->unk_0C.unk_18, v0->unk_0C.unk_1C, &Unk_ov17_02252DB0); + sub_0200964C(SpriteRenderer_GetG2dRenderer(v0->unk_0C.unk_18), 0, ((192 + 80) << FX32_SHIFT)); v0->unk_0C.unk_04 = sub_0200762C(21); ov17_0223B884(); @@ -342,8 +342,8 @@ int ov17_0223B580(OverlayManager *param0, int *param1) ov17_0223F864(v0->unk_0C.unk_24); ov17_0223F960(v0->unk_7E4); - sub_0200D0B0(v0->unk_0C.unk_18, v0->unk_0C.unk_1C); - sub_0200C8D4(v0->unk_0C.unk_18); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_0C.unk_18, v0->unk_0C.unk_1C); + SpriteRenderer_Free(v0->unk_0C.unk_18); VRAMTransferManager_Destroy(); ov17_022416E4(&v0->unk_0C); @@ -404,7 +404,7 @@ static void ov17_0223B6F0(SysTask *param0, void *param1) if (v0->unk_7EC == 1) { sub_02007768(v0->unk_0C.unk_04); ov11_0221F8F0(); - sub_0200C7EC(v0->unk_0C.unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_0C.unk_1C); sub_0200C808(); G3_SwapBuffers(GX_SORTMODE_MANUAL, GX_BUFFERMODE_Z); } @@ -558,8 +558,8 @@ static void ov17_0223B8C4(UnkStruct_ov17_02246F24 *param0) static void ov17_0223B8F8(UnkStruct_ov17_02246F24 *param0, NARC *param1) { - SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 0, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); - SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 0, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); ov17_02243040(param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1); ov17_02242FA4(param0); @@ -593,8 +593,8 @@ static void ov17_0223B9A4(UnkStruct_ov17_02246F24 *param0) static void ov17_0223BA10(UnkStruct_ov17_02246F24 *param0, NARC *param1) { - SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 4, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 33007); - SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33008); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 4, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 33007); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33008); ov17_0224131C(param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1); ov17_02241270(param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1); diff --git a/src/overlay017/ov17_0223CB1C.c b/src/overlay017/ov17_0223CB1C.c index 77fedb725c..dd8c2be1d1 100644 --- a/src/overlay017/ov17_0223CB1C.c +++ b/src/overlay017/ov17_0223CB1C.c @@ -29,6 +29,7 @@ #include "overlay_manager.h" #include "palette.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -37,7 +38,6 @@ #include "unk_02005474.h" #include "unk_0200762C.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02014000.h" #include "unk_02017728.h" @@ -167,17 +167,17 @@ int ov17_0223CB1C(OverlayManager *param0, int *param1) sub_0201E450(4); Font_InitManager(FONT_SUBSCREEN, 22); - v0->unk_0C.unk_1C = sub_0200C6E4(22); + v0->unk_0C.unk_1C = SpriteRenderer_Create(22); - sub_0200C73C(v0->unk_0C.unk_1C, &Unk_ov17_02252EFC, &Unk_ov17_02252EB4, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_0C.unk_1C, &Unk_ov17_02252EFC, &Unk_ov17_02252EB4, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_64K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_0C.unk_20 = sub_0200C704(v0->unk_0C.unk_1C); + v0->unk_0C.unk_20 = SpriteRenderer_CreateGfxHandler(v0->unk_0C.unk_1C); - sub_0200C7C0(v0->unk_0C.unk_1C, v0->unk_0C.unk_20, (64 + 64)); - sub_0200CB30(v0->unk_0C.unk_1C, v0->unk_0C.unk_20, &Unk_ov17_02252EC8); - sub_0200964C(sub_0200C738(v0->unk_0C.unk_1C), 0, (256 * FX32_ONE)); + SpriteRenderer_CreateCellActorList(v0->unk_0C.unk_1C, v0->unk_0C.unk_20, (64 + 64)); + SpriteRenderer_InitGfxResourceList(v0->unk_0C.unk_1C, v0->unk_0C.unk_20, &Unk_ov17_02252EC8); + sub_0200964C(SpriteRenderer_GetG2dRenderer(v0->unk_0C.unk_1C), 0, (256 * FX32_ONE)); v0->unk_0C.unk_04 = sub_0200762C(22); ov17_0223D350(); @@ -307,8 +307,8 @@ int ov17_0223CF8C(OverlayManager *param0, int *param1) Bg_FreeTilemapBuffer(v0->unk_0C.unk_24, 3); Bg_ToggleLayer(4, 0); Bg_FreeTilemapBuffer(v0->unk_0C.unk_24, 4); - sub_0200D0B0(v0->unk_0C.unk_1C, v0->unk_0C.unk_20); - sub_0200C8D4(v0->unk_0C.unk_1C); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_0C.unk_1C, v0->unk_0C.unk_20); + SpriteRenderer_Free(v0->unk_0C.unk_1C); VRAMTransferManager_Destroy(); for (v1 = 0; v1 < 4; v1++) { @@ -396,7 +396,7 @@ static void ov17_0223D164(SysTask *param0, void *param1) } ov11_0221F8F0(); - sub_0200C7EC(v0->unk_0C.unk_20); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_0C.unk_20); sub_0200C808(); G3_SwapBuffers(GX_SORTMODE_MANUAL, GX_BUFFERMODE_Z); @@ -572,7 +572,7 @@ static void ov17_0223D390(UnkStruct_ov17_02247A48 *param0) static void ov17_0223D3B8(UnkStruct_ov17_02247A48 *param0, NARC *param1) { - SpriteRenderer_LoadPalette(param0->unk_0C.unk_44, 2, param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param1, 7, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C.unk_44, 2, param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param1, 7, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); ov17_0224774C(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param1); ov17_0223F560(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param0->unk_0C.unk_44, 33001, -1, 33001, 33001); @@ -590,7 +590,7 @@ static void ov17_0223D434(UnkStruct_ov17_02247A48 *param0) static void ov17_0223D468(UnkStruct_ov17_02247A48 *param0, NARC *param1) { - sub_0200CD7C(param0->unk_0C.unk_44, 3, param0->unk_0C.unk_1C, param0->unk_0C.unk_20, 46, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DSUB, 33002); + SpriteRenderer_LoadPalette(param0->unk_0C.unk_44, 3, param0->unk_0C.unk_1C, param0->unk_0C.unk_20, 46, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DSUB, 33002); } static void ov17_0223D498(UnkStruct_ov17_02247A48 *param0) diff --git a/src/overlay017/ov17_0223DAD0.c b/src/overlay017/ov17_0223DAD0.c index b8211d3814..bf9802d7b7 100644 --- a/src/overlay017/ov17_0223DAD0.c +++ b/src/overlay017/ov17_0223DAD0.c @@ -37,6 +37,7 @@ #include "palette.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -45,7 +46,6 @@ #include "unk_02005474.h" #include "unk_0200762C.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02014000.h" @@ -269,17 +269,17 @@ int ov17_0223DAD0(OverlayManager *param0, int *param1) sub_0201E450(4); Font_InitManager(FONT_SUBSCREEN, 23); - v0->unk_14.unk_58 = sub_0200C6E4(23); + v0->unk_14.unk_58 = SpriteRenderer_Create(23); - sub_0200C73C(v0->unk_14.unk_58, &Unk_ov17_02253008, &Unk_ov17_02252FDC, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_14.unk_58, &Unk_ov17_02253008, &Unk_ov17_02252FDC, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_64K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_14.unk_5C = sub_0200C704(v0->unk_14.unk_58); + v0->unk_14.unk_5C = SpriteRenderer_CreateGfxHandler(v0->unk_14.unk_58); - sub_0200C7C0(v0->unk_14.unk_58, v0->unk_14.unk_5C, (64 + 64)); - sub_0200CB30(v0->unk_14.unk_58, v0->unk_14.unk_5C, &Unk_ov17_02252FF0); - sub_0200964C(sub_0200C738(v0->unk_14.unk_58), 0, (256 * FX32_ONE)); + SpriteRenderer_CreateCellActorList(v0->unk_14.unk_58, v0->unk_14.unk_5C, (64 + 64)); + SpriteRenderer_InitGfxResourceList(v0->unk_14.unk_58, v0->unk_14.unk_5C, &Unk_ov17_02252FF0); + sub_0200964C(SpriteRenderer_GetG2dRenderer(v0->unk_14.unk_58), 0, (256 * FX32_ONE)); v0->unk_14.unk_44 = sub_0200762C(23); ov17_0223E450(); @@ -419,8 +419,8 @@ int ov17_0223DF0C(OverlayManager *param0, int *param1) ov17_02249358(v0->unk_14.unk_60); ov17_022493A4(v0->unk_1074); - sub_0200D0B0(v0->unk_14.unk_58, v0->unk_14.unk_5C); - sub_0200C8D4(v0->unk_14.unk_58); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_14.unk_58, v0->unk_14.unk_5C); + SpriteRenderer_Free(v0->unk_14.unk_58); VRAMTransferManager_Destroy(); ov17_0224A1EC(&v0->unk_14); @@ -556,7 +556,7 @@ static void ov17_0223E1FC(SysTask *param0, void *param1) } ov11_0221F8F0(); - sub_0200C7EC(v0->unk_14.unk_5C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_14.unk_5C); sub_0200C808(); G3_SwapBuffers(GX_SORTMODE_MANUAL, GX_BUFFERMODE_Z); @@ -723,7 +723,7 @@ static void ov17_0223E458(UnkStruct_ov17_0224DF54 *param0) static void ov17_0223E4B0(UnkStruct_ov17_0224DF54 *param0, NARC *param1) { - SpriteRenderer_LoadPalette(param0->unk_14.unk_90, 2, param0->unk_14.unk_58, param0->unk_14.unk_5C, param1, 6, 0, 8, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_14.unk_90, 2, param0->unk_14.unk_58, param0->unk_14.unk_5C, param1, 6, 0, 8, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); ov17_0224A20C(param0->unk_14.unk_58, param0->unk_14.unk_5C); ov17_0224A390(param0->unk_14.unk_58, param0->unk_14.unk_5C, param1); @@ -768,8 +768,8 @@ static void ov17_0223E588(UnkStruct_ov17_0224DF54 *param0) static void ov17_0223E60C(UnkStruct_ov17_0224DF54 *param0, NARC *param1) { - sub_0200CD7C(param0->unk_14.unk_90, 3, param0->unk_14.unk_58, param0->unk_14.unk_5C, 46, 6, 0, 2, NNS_G2D_VRAM_TYPE_2DSUB, 33002); - sub_0200CD7C(param0->unk_14.unk_90, 3, param0->unk_14.unk_58, param0->unk_14.unk_5C, 46, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33003); + SpriteRenderer_LoadPalette(param0->unk_14.unk_90, 3, param0->unk_14.unk_58, param0->unk_14.unk_5C, 46, 6, 0, 2, NNS_G2D_VRAM_TYPE_2DSUB, 33002); + SpriteRenderer_LoadPalette(param0->unk_14.unk_90, 3, param0->unk_14.unk_58, param0->unk_14.unk_5C, 46, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33003); ov17_022493C4(param0->unk_1074); } diff --git a/src/overlay017/ov17_0223F118.c b/src/overlay017/ov17_0223F118.c index 9822ecd4f7..04520af1cf 100644 --- a/src/overlay017/ov17_0223F118.c +++ b/src/overlay017/ov17_0223F118.c @@ -30,13 +30,13 @@ #include "message.h" #include "palette.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "unk_02005474.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_0201E86C.h" #include "unk_02024220.h" @@ -148,7 +148,7 @@ void ov17_0223F1E8(int param0, BgConfig *param1, SpriteGfxHandler *param2, UnkSt v0.unk_00 = param3; v0.unk_04 = &v1; v0.unk_08 = sub_0200D9B0(param2); - v0.unk_0C = sub_0200D04C(param2, param9); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(param2, param9); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; v0.unk_18 = param10; @@ -317,19 +317,19 @@ void ov17_0223F374(UnkStruct_02095C48 *param0) void ov17_0223F560(SpriteRenderer *param0, SpriteGfxHandler *param1, PaletteData *param2, int param3, int param4, int param5, int param6) { if (param3 != -1) { - sub_0200CBDC(param0, param1, 46, 73, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param3); + SpriteRenderer_LoadCharResObj(param0, param1, 46, 73, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param3); } if (param4 != -1) { - sub_0200CD7C(param2, 2, param0, param1, 46, 7, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param4); + SpriteRenderer_LoadPalette(param2, 2, param0, param1, 46, 7, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param4); } if (param5 != -1) { - sub_0200CE0C(param0, param1, 46, 74, 1, param5); + SpriteRenderer_LoadCellResObj(param0, param1, 46, 74, 1, param5); } if (param6 != -1) { - sub_0200CE3C(param0, param1, 46, 75, 1, param6); + SpriteRenderer_LoadAnimResObj(param0, param1, 46, 75, 1, param6); } } @@ -370,12 +370,12 @@ void ov17_0223F630(UnkStruct_ov17_0223F6E8 *param0, SpriteRenderer *param1, Spri v1.bgPriority = param9; for (v0 = 0; v0 < 6; v0++) { - param0->unk_00[v0] = SpriteActor_LoadResources(param1, param2, &v1); + param0->unk_00[v0] = CellActor_LoadResources(param1, param2, &v1); - SpriteActor_SetSpritePositionXY(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_00, Unk_ov17_022531CC[v0].unk_02); - sub_0200D364(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_06); + CellActorData_SetPositionXY(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_00, Unk_ov17_022531CC[v0].unk_02); + CellActorData_SetAnim(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_06); sub_0200D6A4(param0->unk_00[v0], 1); - SpriteActor_UpdateObject(param0->unk_00[v0]->unk_00); + CellActor_UpdateObject(param0->unk_00[v0]->cellActor); } param0->unk_18 = SysTask_Start(ov17_0223F6E8, param0, param10); @@ -386,7 +386,7 @@ void ov17_0223F6C4(UnkStruct_ov17_0223F6E8 *param0) int v0; for (v0 = 0; v0 < 6; v0++) { - sub_0200D0F4(param0->unk_00[v0]); + CellActorData_Delete(param0->unk_00[v0]); } SysTask_Done(param0->unk_18); diff --git a/src/overlay017/ov17_0223F7E4.c b/src/overlay017/ov17_0223F7E4.c index 5fdf7f8e5b..e6c97cd9b9 100644 --- a/src/overlay017/ov17_0223F7E4.c +++ b/src/overlay017/ov17_0223F7E4.c @@ -34,13 +34,13 @@ #include "narc.h" #include "palette.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_0201E86C.h" #include "unk_02094EDC.h" @@ -987,7 +987,7 @@ static void ov17_02240138(UnkStruct_ov17_0223F7E4 *param0, UnkStruct_ov17_022401 v0.unk_00 = param0->unk_3C; v0.unk_04 = &v1; v0.unk_08 = sub_0200D9B0(v6); - v0.unk_0C = sub_0200D04C(v6, param6); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; v0.unk_18 = param7; @@ -1181,7 +1181,7 @@ static void ov17_0224051C(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_2CC.unk_04_val1.unk_00[v4] != NULL) { - sub_0200D5AC(v0->unk_2CC.unk_04_val1.unk_00[v4]->unk_00, 0, -2); + sub_0200D5AC(v0->unk_2CC.unk_04_val1.unk_00[v4]->cellActor, 0, -2); } } @@ -1204,7 +1204,7 @@ static void ov17_0224051C(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_2CC.unk_04_val1.unk_00[v4] != NULL) { - sub_0200D5AC(v0->unk_2CC.unk_04_val1.unk_00[v4]->unk_00, 0, 1); + sub_0200D5AC(v0->unk_2CC.unk_04_val1.unk_00[v4]->cellActor, 0, 1); } } @@ -1293,11 +1293,11 @@ static void ov17_02240658(SysTask *param0, void *param1) sub_020128C4(v0->unk_40[v6].unk_00, v2, v3 + -2); if (v8 != 0) { - sub_0200D5AC(v0->unk_118[v7]->unk_00, 0, -2); + sub_0200D5AC(v0->unk_118[v7]->cellActor, 0, -2); for (v10 = 0; v10 < 6; v10++) { if (v0->unk_12C[v11][v10] != NULL) { - sub_0200D5AC(v0->unk_12C[v11][v10]->unk_00, 0, -2); + sub_0200D5AC(v0->unk_12C[v11][v10]->cellActor, 0, -2); } } } @@ -1328,11 +1328,11 @@ static void ov17_02240658(SysTask *param0, void *param1) sub_020128C4(v0->unk_40[v6].unk_00, v2, v3 + 1); if (v8 != 0) { - sub_0200D5AC(v0->unk_118[v7]->unk_00, 0, 1); + sub_0200D5AC(v0->unk_118[v7]->cellActor, 0, 1); for (v10 = 0; v10 < 6; v10++) { if (v0->unk_12C[v11][v10] != NULL) { - sub_0200D5AC(v0->unk_12C[v11][v10]->unk_00, 0, 1); + sub_0200D5AC(v0->unk_12C[v11][v10]->cellActor, 0, 1); } } } diff --git a/src/overlay017/ov17_02241270.c b/src/overlay017/ov17_02241270.c index 7b3332647c..5eefb6d253 100644 --- a/src/overlay017/ov17_02241270.c +++ b/src/overlay017/ov17_02241270.c @@ -9,7 +9,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "narc.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" static const SpriteTemplate Unk_ov17_0225364C = { 0x28, @@ -61,9 +61,9 @@ CellActorData *ov17_022412C0(SpriteRenderer *param0, SpriteGfxHandler *param1, i { CellActorData *v0; - v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_0225364C); + v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_0225364C); sub_0200D500(v0, (5 * 8) + (11 * 8) * param2, (0xc * 8) + 0 * param2, ((192 + 80) << FX32_SHIFT)); - SpriteActor_UpdateObject(v0->unk_00); + CellActor_UpdateObject(v0->cellActor); return v0; } @@ -77,7 +77,7 @@ void ov17_022412F0(SpriteGfxHandler *param0) void ov17_02241314(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } void ov17_0224131C(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2) @@ -92,20 +92,20 @@ CellActorData *ov17_0224136C(SpriteRenderer *param0, SpriteGfxHandler *param1, i CellActorData *v0; if (param4 >= 0) { - v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_02253618); + v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_02253618); } else { - v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_02253680); + v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_02253680); } sub_0200D500(v0, param2, param3, ((192 + 80) << FX32_SHIFT)); - SpriteActor_UpdateObject(v0->unk_00); + CellActor_UpdateObject(v0->cellActor); return v0; } void ov17_022413AC(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } void ov17_022413B4(SpriteGfxHandler *param0) diff --git a/src/overlay017/ov17_022413D8.c b/src/overlay017/ov17_022413D8.c index 438ed2fa90..b22b9e0961 100644 --- a/src/overlay017/ov17_022413D8.c +++ b/src/overlay017/ov17_022413D8.c @@ -34,6 +34,7 @@ #include "narc.h" #include "palette.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -42,7 +43,6 @@ #include "unk_020041CC.h" #include "unk_02005474.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_0201D15C.h" #include "unk_0208C098.h" @@ -571,7 +571,7 @@ static CellActorData *ov17_02241720(PaletteData *param0, SpriteRenderer *param1, } SpriteRenderer_LoadCharResObjFromOpenNarc(param1, param2, param5, v2, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33001 + param4); - SpriteRenderer_LoadPalette(param0, 2, param1, param2, param5, v3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + param4); + SpriteRenderer_LoadPaletteFromOpenNarc(param0, 2, param1, param2, param5, v3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + param4); SpriteRenderer_LoadCellResObjFromOpenNarc(param1, param2, param5, v4, 1, 33001 + param4); SpriteRenderer_LoadAnimResObjFromOpenNarc(param1, param2, param5, v5, 1, 33001 + param4); @@ -583,15 +583,15 @@ static CellActorData *ov17_02241720(PaletteData *param0, SpriteRenderer *param1, v1.x = (8 * 12) + (4 * 8) * param4; v1.y = (8 * 5) + 0 * param4; - v0 = SpriteActor_LoadResources(param1, param2, &v1); - SpriteActor_UpdateObject(v0->unk_00); + v0 = CellActor_LoadResources(param1, param2, &v1); + CellActor_UpdateObject(v0->cellActor); return v0; } static void ov17_02241814(SpriteGfxHandler *param0, CellActorData *param1, int param2) { - sub_0200D0F4(param1); + CellActorData_Delete(param1); SpriteGfxHandler_UnloadCharObjById(param0, 33001 + param2); SpriteGfxHandler_UnloadPlttObjById(param0, 33002 + param2); SpriteGfxHandler_UnloadCellObjById(param0, 33001 + param2); @@ -626,15 +626,15 @@ static CellActorData *ov17_022418A4(SpriteRenderer *param0, SpriteGfxHandler *pa v1.y = (8 * 4) + 0 * param2; v1.plttIdx = v2[param2]; - v0 = SpriteActor_LoadResources(param0, param1, &v1); - SpriteActor_UpdateObject(v0->unk_00); + v0 = CellActor_LoadResources(param0, param1, &v1); + CellActor_UpdateObject(v0->cellActor); return v0; } static void ov17_02241900(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } static void ov17_02241908(SpriteGfxHandler *param0) @@ -694,10 +694,10 @@ void ov17_02241A24(UnkStruct_ov17_0223F88C *param0) SpriteTemplate v1; v1 = Unk_ov17_022537B8; - v0 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &v1); + v0 = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &v1); - SpriteActor_EnableObject(v0, 0); - SpriteActor_UpdateObject(v0->unk_00); + CellActorData_DrawSprite(v0, 0); + CellActor_UpdateObject(v0->cellActor); param0->unk_17C = v0; } @@ -706,7 +706,7 @@ void ov17_02241A64(UnkStruct_ov17_0223F88C *param0) { GF_ASSERT(param0->unk_17C != NULL); - sub_0200D0F4(param0->unk_17C); + CellActorData_Delete(param0->unk_17C); param0->unk_17C = NULL; } @@ -714,9 +714,9 @@ void ov17_02241A8C(UnkStruct_ov17_0223F88C *param0, int param1, int param2) { GF_ASSERT(param0->unk_17C != NULL); - SpriteActor_SetSpritePositionXY(param0->unk_17C, Unk_ov17_022536E4[param1].unk_00, Unk_ov17_022536E4[param1].unk_02); - sub_0200D364(param0->unk_17C, param2); - SpriteActor_EnableObject(param0->unk_17C, 1); + CellActorData_SetPositionXY(param0->unk_17C, Unk_ov17_022536E4[param1].unk_00, Unk_ov17_022536E4[param1].unk_02); + CellActorData_SetAnim(param0->unk_17C, param2); + CellActorData_DrawSprite(param0->unk_17C, 1); switch (param2) { case 0: @@ -737,7 +737,7 @@ void ov17_02241A8C(UnkStruct_ov17_0223F88C *param0, int param1, int param2) void ov17_02241B1C(UnkStruct_ov17_0223F88C *param0) { GF_ASSERT(param0->unk_17C != NULL); - SpriteActor_EnableObject(param0->unk_17C, 0); + CellActorData_DrawSprite(param0->unk_17C, 0); } void ov17_02241B3C(UnkStruct_ov17_02246F24 *param0, int param1, int param2, u8 *param3) @@ -828,7 +828,7 @@ static void ov17_02241C2C(SysTask *param0, void *param1) return; } - SpriteActor_SetSpritePositionXY(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); + CellActorData_SetPositionXY(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); } static void ov17_02241CF0(SysTask *param0, void *param1) @@ -856,7 +856,7 @@ static void ov17_02241CF0(SysTask *param0, void *param1) } } - SpriteActor_SetSpritePositionXY(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); + CellActorData_SetPositionXY(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); break; default: *(v0->unk_04) = 1; @@ -874,10 +874,10 @@ void ov17_02241D94(UnkStruct_ov17_0223F88C *param0, int param1, NARC *param2) SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param2, 19, 1, 33005); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param2, 18, 1, 33005); - param0->unk_C0 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov17_02253854); + param0->unk_C0 = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov17_02253854); - SpriteActor_UpdateObject(param0->unk_C0->unk_00); - SpriteActor_SetSpritePositionXY(param0->unk_C0, (8 * 12) + (4 * 8) * param1, (7 * 8)); + CellActor_UpdateObject(param0->unk_C0->cellActor); + CellActorData_SetPositionXY(param0->unk_C0, (8 * 12) + (4 * 8) * param1, (7 * 8)); } void ov17_02241E24(UnkStruct_ov17_0223F88C *param0) @@ -885,7 +885,7 @@ void ov17_02241E24(UnkStruct_ov17_0223F88C *param0) SpriteGfxHandler_UnloadCharObjById(param0->unk_1C, 33005); SpriteGfxHandler_UnloadCellObjById(param0->unk_1C, 33005); SpriteGfxHandler_UnloadAnimObjById(param0->unk_1C, 33005); - sub_0200D0F4(param0->unk_C0); + CellActorData_Delete(param0->unk_C0); param0->unk_C0 = NULL; } @@ -907,7 +907,7 @@ void ov17_02241EA4(SpriteGfxHandler *param0) static inline void inline_ov17_02241EC4(UnkStruct_ov17_0223F88C *param0, int param1, int param2) { if (param0->unk_C4[param1][param2] != NULL) { - sub_0200D0F4(param0->unk_C4[param1][param2]); + CellActorData_Delete(param0->unk_C4[param1][param2]); param0->unk_C4[param1][param2] = NULL; } } @@ -934,10 +934,10 @@ static CellActorData *ov17_02241F08(SpriteRenderer *param0, SpriteGfxHandler *pa { CellActorData *v0; - v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_02253888); + v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_02253888); - SpriteActor_UpdateObject(v0->unk_00); - SpriteActor_SetSpritePositionXY(v0, param2, param3); + CellActor_UpdateObject(v0->cellActor); + CellActorData_SetPositionXY(v0, param2, param3); return v0; } @@ -962,10 +962,10 @@ void ov17_02241F34(UnkStruct_ov17_0223F88C *param0, int param1, int param2, int if (param0->unk_C4[param1][v2] == NULL) { param0->unk_C4[param1][v2] = ov17_02241F08(param0->unk_18, param0->unk_1C, Unk_ov17_0225370C[param2][0] + v2 * 8, Unk_ov17_0225370C[param2][1]); - sub_0200D364(param0->unk_C4[param1][v2], v3); + CellActorData_SetAnim(param0->unk_C4[param1][v2], v3); ov17_02242048(param0->unk_C4[param1][v2]); - } else if (sub_0200D37C(param0->unk_C4[param1][v2]) < v3) { - sub_0200D364(param0->unk_C4[param1][v2], v3); + } else if (CellActorData_GetActiveAnim(param0->unk_C4[param1][v2]) < v3) { + CellActorData_SetAnim(param0->unk_C4[param1][v2], v3); ov17_02242048(param0->unk_C4[param1][v2]); } } @@ -982,7 +982,7 @@ static void ov17_02242048(CellActorData *param0) MI_CpuClear8(v0, sizeof(UnkStruct_ov17_02242048)); v0->unk_00 = param0; - SpriteActor_EnableObject(param0, 0); + CellActorData_DrawSprite(param0, 0); SysTask_Start(ov17_0224207C, v0, 40000); } @@ -995,7 +995,7 @@ static void ov17_0224207C(SysTask *param0, void *param1) sub_0200D6A4(v0->unk_00, 2); v0->unk_04 = (0.1f); v0->unk_08 = (0.1f); - SpriteActor_EnableObject(v0->unk_00, 1); + CellActorData_DrawSprite(v0->unk_00, 1); v0->unk_0C++; case 1: v0->unk_04 += (0.3f); @@ -1051,7 +1051,7 @@ void ov17_022421E0(SpriteGfxHandler *param0) static inline void inline_ov17_0224221C(UnkStruct_ov17_0223F88C *param0, int param1, int param2) { - sub_0200D0F4(param0->unk_124[param1][param2]); + CellActorData_Delete(param0->unk_124[param1][param2]); param0->unk_124[param1][param2] = NULL; } @@ -1079,10 +1079,10 @@ static CellActorData *ov17_02242260(SpriteRenderer *param0, SpriteGfxHandler *pa { CellActorData *v0; - v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_022537EC); + v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_022537EC); - SpriteActor_UpdateObject(v0->unk_00); - SpriteActor_SetSpritePositionXY(v0, param2, param3); + CellActor_UpdateObject(v0->cellActor); + CellActorData_SetPositionXY(v0, param2, param3); return v0; } @@ -1091,10 +1091,10 @@ static CellActorData *ov17_0224228C(SpriteRenderer *param0, SpriteGfxHandler *pa { CellActorData *v0; - v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_0225371C); + v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_0225371C); - SpriteActor_UpdateObject(v0->unk_00); - SpriteActor_SetSpritePositionXY(v0, param2, param3); + CellActor_UpdateObject(v0->cellActor); + CellActorData_SetPositionXY(v0, param2, param3); return v0; } @@ -1153,8 +1153,8 @@ static void ov17_022422B8(SysTask *param0, void *param1) } break; default: - sub_0200D0F4(v0->unk_04); - SpriteActor_EnableObject(v0->unk_08, 1); + CellActorData_Delete(v0->unk_04); + CellActorData_DrawSprite(v0->unk_08, 1); Sound_PlayEffect(1760); Heap_FreeToHeap(param1); SysTask_Done(param0); @@ -1162,7 +1162,7 @@ static void ov17_022422B8(SysTask *param0, void *param1) } sub_0200D7C0(v0->unk_04, 0x2000); - SpriteActor_SetSpritePositionXY(v0->unk_04, v0->unk_10 / 0x100, v0->unk_14 / 0x100); + CellActorData_SetPositionXY(v0->unk_04, v0->unk_10 / 0x100, v0->unk_14 / 0x100); } BOOL ov17_022424A8(UnkStruct_ov17_0223F88C *param0, int param1) @@ -1171,7 +1171,7 @@ BOOL ov17_022424A8(UnkStruct_ov17_0223F88C *param0, int param1) for (v0 = 0; v0 < 5; v0++) { if (param0->unk_124[param1][v0] != NULL) { - if (sub_0200D408(param0->unk_124[param1][v0]) == 0) { + if (CellActorData_GetDrawFlag(param0->unk_124[param1][v0]) == 0) { return 0; } } @@ -1191,7 +1191,7 @@ void ov17_022424D4(UnkStruct_ov17_0223F88C *param0, int param1, int param2) for (v1 = 0; v1 < v0; v1++) { if (param0->unk_124[param1][v1] == NULL) { param0->unk_124[param1][v1] = ov17_02242260(param0->unk_18, param0->unk_1C, Unk_ov17_022536D8[param1][0] + v1 * 5, Unk_ov17_022536D8[param1][1]); - SpriteActor_EnableObject(param0->unk_124[param1][v1], 0); + CellActorData_DrawSprite(param0->unk_124[param1][v1], 0); v2 = Heap_AllocFromHeap(21, sizeof(UnkStruct_ov17_022422B8)); MI_CpuClear8(v2, sizeof(UnkStruct_ov17_022422B8)); @@ -1234,13 +1234,13 @@ static void ov17_0224262C(UnkStruct_ov17_02246F24 *param0, GXOamMode param1, int for (v1 = 0; v1 < 6; v1++) { if (param0->unk_0C.unk_C4[v0][v1] != NULL) { SpriteActor_SetOAMMode(param0->unk_0C.unk_C4[v0][v1], param1); - SpriteActor_EnableObject(param0->unk_0C.unk_C4[v0][v1], v2); + CellActorData_DrawSprite(param0->unk_0C.unk_C4[v0][v1], v2); } } if (param0->unk_0C.unk_160[v0] != NULL) { SpriteActor_SetOAMMode(param0->unk_0C.unk_160[v0], param1); - SpriteActor_EnableObject(param0->unk_0C.unk_160[v0], v2); + CellActorData_DrawSprite(param0->unk_0C.unk_160[v0], v2); } sub_02012AF0(param0->unk_0C.unk_180[v0].unk_00, param1); @@ -1642,12 +1642,12 @@ void ov17_0224308C(SpriteGfxHandler *param0) void ov17_022430AC(UnkStruct_ov17_0223F88C *param0, int param1, int param2) { if (param0->unk_160[param1] == NULL) { - param0->unk_160[param1] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov17_02253750); + param0->unk_160[param1] = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov17_02253750); } - sub_0200D364(param0->unk_160[param1], param2); - SpriteActor_SetSpritePositionXY(param0->unk_160[param1], (8 * 8), (5 * 8 + 2) + param1 * (6 * 8)); - SpriteActor_UpdateObject(param0->unk_160[param1]->unk_00); + CellActorData_SetAnim(param0->unk_160[param1], param2); + CellActorData_SetPositionXY(param0->unk_160[param1], (8 * 8), (5 * 8 + 2) + param1 * (6 * 8)); + CellActor_UpdateObject(param0->unk_160[param1]->cellActor); } void ov17_022430F8(UnkStruct_ov17_0223F88C *param0) @@ -1656,7 +1656,7 @@ void ov17_022430F8(UnkStruct_ov17_0223F88C *param0) for (v0 = 0; v0 < 4; v0++) { if (param0->unk_160[v0] != NULL) { - sub_0200D0F4(param0->unk_160[v0]); + CellActorData_Delete(param0->unk_160[v0]); param0->unk_160[v0] = NULL; } } @@ -1892,7 +1892,7 @@ static void ov17_022434E0(SysTask *param0, void *param1) SpriteActor_GetSpritePositionXY(v0->unk_08, &v4, &v5); v4 = v0->unk_18 >> 8; - SpriteActor_SetSpritePositionXY(v0->unk_08, v4, v5); + CellActorData_SetPositionXY(v0->unk_08, v4, v5); break; case 1: v0->unk_1E += v0->unk_14; @@ -1915,10 +1915,10 @@ static void ov17_022434E0(SysTask *param0, void *param1) v3 = v0->unk_10 / 0x100; v1 = FX_Mul(sub_0201D1D4(v0->unk_1E / 100), v3 << FX32_SHIFT) / FX32_ONE; v2 = FX_Mul(sub_0201D15C(v0->unk_1E / 100), v3 << FX32_SHIFT) / FX32_ONE; - SpriteActor_SetSpritePositionXY(v0->unk_08, v0->unk_21 + v1, v0->unk_22 + v2); + CellActorData_SetPositionXY(v0->unk_08, v0->unk_21 + v1, v0->unk_22 + v2); break; default: - SpriteActor_EnableObject(v0->unk_08, 0); + CellActorData_DrawSprite(v0->unk_08, 0); Sound_PlayEffect(1505); ov17_022414B0(v0->unk_04); @@ -1959,7 +1959,7 @@ static void ov17_022436A4(SysTask *param0, void *param1) continue; } - sub_0200D330(v0->unk_00->unk_0C.unk_124[v0->unk_08][v1]); + CellActorData_UpdateObject(v0->unk_00->unk_0C.unk_124[v0->unk_08][v1]); } } @@ -2027,7 +2027,7 @@ static void ov17_02243750(SysTask *param0, void *param1) v4 = FX_Mul(sub_0201D1D4(v0->unk_0C / 100), (6 << FX32_SHIFT)) / FX32_ONE; v0->unk_20 += 0x80; - SpriteActor_SetSpritePositionXY(v0->unk_04, (v0->unk_1C >> 8) + v3, (v0->unk_20 >> 8) + v4); + CellActorData_SetPositionXY(v0->unk_04, (v0->unk_1C >> 8) + v3, (v0->unk_20 >> 8) + v4); v0->unk_24++; if (v0->unk_24 > 80) { @@ -2061,10 +2061,10 @@ static void ov17_02243750(SysTask *param0, void *param1) v0->unk_0E++; } - SpriteActor_SetSpritePositionXY(v0->unk_04, v0->unk_1C >> 8, v0->unk_20 >> 8); + CellActorData_SetPositionXY(v0->unk_04, v0->unk_1C >> 8, v0->unk_20 >> 8); break; default: - SpriteActor_EnableObject(v0->unk_04, 0); + CellActorData_DrawSprite(v0->unk_04, 0); Sound_PlayEffect(1505); (*(v0->unk_08))--; Heap_FreeToHeap(param1); diff --git a/src/overlay017/ov17_022476F8.c b/src/overlay017/ov17_022476F8.c index 4781aa921a..189d305653 100644 --- a/src/overlay017/ov17_022476F8.c +++ b/src/overlay017/ov17_022476F8.c @@ -20,6 +20,7 @@ #include "message.h" #include "narc.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -27,7 +28,6 @@ #include "text.h" #include "unk_02005474.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct { @@ -118,14 +118,14 @@ void ov17_022477B8(UnkStruct_ov17_02247A48 *param0, int param1, int param2, fx32 v0 = Heap_AllocFromHeap(22, sizeof(UnkStruct_ov17_022477B8)); MI_CpuClear8(v0, sizeof(UnkStruct_ov17_022477B8)); - v0->unk_04 = SpriteActor_LoadResources(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, &Unk_ov17_022543F8); + v0->unk_04 = CellActor_LoadResources(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, &Unk_ov17_022543F8); sub_0200D500(v0->unk_04, param1, param2, (256 * FX32_ONE)); if (param4 == 1) { - sub_0200D364(v0->unk_04, 1); + CellActorData_SetAnim(v0->unk_04, 1); } - SpriteActor_UpdateObject(v0->unk_04->unk_00); + CellActor_UpdateObject(v0->unk_04->cellActor); v0->unk_08 = param1 << 8; v0->unk_0C = param2 << 8; @@ -156,7 +156,7 @@ static void ov17_02247840(SysTask *param0, void *param1) } break; default: - sub_0200D0F4(v0->unk_04); + CellActorData_Delete(v0->unk_04); (*(v0->unk_00))--; Heap_FreeToHeap(param1); SysTask_Done(param0); diff --git a/src/overlay017/ov17_022492DC.c b/src/overlay017/ov17_022492DC.c index 4dd109d334..f82b76a475 100644 --- a/src/overlay017/ov17_022492DC.c +++ b/src/overlay017/ov17_022492DC.c @@ -21,12 +21,12 @@ #include "heap.h" #include "message.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "touch_screen.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_0201E86C.h" #include "unk_02094EDC.h" @@ -716,7 +716,7 @@ static void ov17_02249BC4(UnkStruct_ov17_022492DC *param0, UnkStruct_ov17_02249B v0.unk_00 = param0->unk_18; v0.unk_04 = &v1; v0.unk_08 = sub_0200D9B0(v6); - v0.unk_0C = sub_0200D04C(v6, param6); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; v0.unk_18 = param7; @@ -822,7 +822,7 @@ static void ov17_02249DA0(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_8C.unk_04_val1.unk_10[v4] != NULL) { - sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->unk_00, 0, 16); + sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, 16); } } @@ -851,7 +851,7 @@ static void ov17_02249DA0(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_8C.unk_04_val1.unk_10[v4] != NULL) { - sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->unk_00, 0, -4); + sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, -4); } } @@ -880,7 +880,7 @@ static void ov17_02249DA0(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_8C.unk_04_val1.unk_10[v4] != NULL) { - sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->unk_00, 0, (-(16 + -4))); + sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, (-(16 + -4))); } } diff --git a/src/overlay017/ov17_0224A0FC.c b/src/overlay017/ov17_0224A0FC.c index 0e1df667ba..b4f2d8f22b 100644 --- a/src/overlay017/ov17_0224A0FC.c +++ b/src/overlay017/ov17_0224A0FC.c @@ -46,13 +46,13 @@ #include "pokemon.h" #include "render_window.h" #include "spl.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_02014000.h" #include "unk_0201D15C.h" @@ -571,12 +571,12 @@ static int ov17_0224A46C(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1 break; } - v0 = SpriteActor_LoadResources(param1, param2, &v2); + v0 = CellActor_LoadResources(param1, param2, &v2); - sub_0200D364(v0, param3); - SpriteActor_UpdateObject(v0->unk_00); + CellActorData_SetAnim(v0, param3); + CellActor_UpdateObject(v0->cellActor); sub_0200D500(v0, param5, param6, (256 * FX32_ONE)); - sub_0200D390(v0, 1); + CellActorData_SetAnimateFlag(v0, 1); for (v1 = 0; v1 < (((16 * 2) / 2) * 4 + 4); v1++) { if (param0->unk_D8[v1] == NULL) { @@ -595,7 +595,7 @@ void ov17_0224A580(UnkStruct_ov17_0224A1EC *param0) for (v0 = 0; v0 < (((16 * 2) / 2) * 4 + 4); v0++) { if (param0->unk_D8[v0] != NULL) { - sub_0200D0F4(param0->unk_D8[v0]); + CellActorData_Delete(param0->unk_D8[v0]); param0->unk_D8[v0] = NULL; } } @@ -621,8 +621,8 @@ void ov17_0224A61C(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1, Spri int v1; for (v1 = 0; v1 < 3; v1++) { - param0->unk_960[v1] = SpriteActor_LoadResources(param1, param2, &Unk_ov17_02254794); - SpriteActor_EnableObject(param0->unk_960[v1], 0); + param0->unk_960[v1] = CellActor_LoadResources(param1, param2, &Unk_ov17_02254794); + CellActorData_DrawSprite(param0->unk_960[v1], 0); } } @@ -631,7 +631,7 @@ void ov17_0224A650(UnkStruct_ov17_0224A1EC *param0) int v0, v1; for (v0 = 0; v0 < 3; v0++) { - sub_0200D0F4(param0->unk_960[v0]); + CellActorData_Delete(param0->unk_960[v0]); param0->unk_960[v0] = NULL; } } @@ -693,10 +693,10 @@ void ov17_0224A7E0(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1, Spri v5->unk_00 = param0->unk_960[v4]; - sub_0200D364(v5->unk_00, param3); + CellActorData_SetAnim(v5->unk_00, param3); sub_0200D500(v5->unk_00, v2, v3, (256 * FX32_ONE)); - SpriteActor_UpdateObject(v5->unk_00->unk_00); - SpriteActor_EnableObject(v5->unk_00, 1); + CellActor_UpdateObject(v5->unk_00->cellActor); + CellActorData_DrawSprite(v5->unk_00, 1); for (v1 = 0; v1 < 3; v1++) { sub_020129D0(param0->unk_96C[v1][v4].unk_00, 0); @@ -739,7 +739,7 @@ static void ov17_0224A8D4(SysTask *param0, void *param1) break; default: sub_020129D0(v0->unk_04->unk_00, 0); - SpriteActor_EnableObject(v0->unk_00, 0); + CellActorData_DrawSprite(v0->unk_00, 0); v0->unk_08 = NULL; SysTask_Done(param0); return; @@ -776,8 +776,8 @@ void ov17_0224A9F8(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1, Spri { CellActorData *v0; - v0 = SpriteActor_LoadResources(param1, param2, &Unk_ov17_022547C8); - SpriteActor_UpdateObject(v0->unk_00); + v0 = CellActor_LoadResources(param1, param2, &Unk_ov17_022547C8); + CellActor_UpdateObject(v0->cellActor); param0->unk_1E8 = v0; } @@ -787,7 +787,7 @@ void ov17_0224AA1C(UnkStruct_ov17_0224A1EC *param0) int v0, v1; if (param0->unk_1E8 != NULL) { - sub_0200D0F4(param0->unk_1E8); + CellActorData_Delete(param0->unk_1E8); param0->unk_1E8 = NULL; } } @@ -833,8 +833,8 @@ void ov17_0224AB08(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1, Spri int v0; for (v0 = 0; v0 < 4; v0++) { - param0->unk_200[v0].unk_04 = SpriteActor_LoadResources(param1, param2, &Unk_ov17_02254830); - SpriteActor_UpdateObject(param0->unk_200[v0].unk_04->unk_00); + param0->unk_200[v0].unk_04 = CellActor_LoadResources(param1, param2, &Unk_ov17_02254830); + CellActor_UpdateObject(param0->unk_200[v0].unk_04->cellActor); sub_0200D6A4(param0->unk_200[v0].unk_04, 1); param0->unk_200[v0].unk_13 = v0; param0->unk_200[v0].unk_0C = ¶m0->unk_04[v0]; @@ -851,7 +851,7 @@ void ov17_0224ABB0(UnkStruct_ov17_0224A1EC *param0) int v0; for (v0 = 0; v0 < 4; v0++) { - sub_0200D0F4(param0->unk_200[v0].unk_04); + CellActorData_Delete(param0->unk_200[v0].unk_04); SysTask_Done(param0->unk_200[v0].unk_00); param0->unk_200[v0].unk_04 = NULL; } @@ -862,7 +862,7 @@ void ov17_0224ABDC(UnkStruct_ov17_0224A1EC *param0, int param1) int v0; for (v0 = 0; v0 < 4; v0++) { - SpriteActor_EnableObject(param0->unk_200[v0].unk_04, param1); + CellActorData_DrawSprite(param0->unk_200[v0].unk_04, param1); } } @@ -962,7 +962,7 @@ BOOL ov17_0224AD70(UnkStruct_ov17_0224DF54 *param0, int param1, int param2) return 0; } - v0 = SpriteActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_02254864); + v0 = CellActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_02254864); if (v0 == NULL) { return 0; @@ -971,10 +971,10 @@ BOOL ov17_0224AD70(UnkStruct_ov17_0224DF54 *param0, int param1, int param2) v5 = param0->unk_14.unk_04[param1].unk_04; v6 = param0->unk_14.unk_04[param1].unk_08; - sub_0200D364(v0, param2); + CellActorData_SetAnim(v0, param2); sub_0200D500(v0, v5, v6, (256 * FX32_ONE)); - CellActor_SetAnimateFlag(v0->unk_00, 1); - SpriteActor_UpdateObject(v0->unk_00); + CellActor_SetAnimateFlag(v0->cellActor, 1); + CellActor_UpdateObject(v0->cellActor); v1 = sub_02094E98(param0->unk_00); v2 = 0x500; @@ -1013,7 +1013,7 @@ static void ov17_0224AE84(SysTask *param0, void *param1) v0->unk_18++; if ((v0->unk_18 > 10) || (v0->unk_08 > ((256 + 16) << 8)) || (v0->unk_08 < ((-256 - 16) * 0x100)) || (v0->unk_0C > ((192 + 16) << 8))) { - sub_0200D0F4(v0->unk_04); + CellActorData_Delete(v0->unk_04); SysTask_Done(param0); v0->unk_04 = NULL; v0->unk_00 = NULL; @@ -1081,11 +1081,11 @@ BOOL ov17_0224B01C(UnkStruct_ov17_0224DF54 *param0) UnkStruct_ov17_0224B058 *v1; v1 = ¶m0->unk_14.unk_910; - v0 = SpriteActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_0225472C); + v0 = CellActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_0225472C); sub_0200D500(v0, -1, (0x16 * 8), (256 * FX32_ONE)); - SpriteActor_UpdateObject(v0->unk_00); - SpriteActor_EnableObject(v0, 0); + CellActor_UpdateObject(v0->cellActor); + CellActorData_DrawSprite(v0, 0); v1->unk_04 = v0; return 1; @@ -1096,7 +1096,7 @@ void ov17_0224B058(UnkStruct_ov17_0224DF54 *param0) UnkStruct_ov17_0224B058 *v0; v0 = ¶m0->unk_14.unk_910; - sub_0200D0F4(v0->unk_04); + CellActorData_Delete(v0->unk_04); } void ov17_0224B068(UnkStruct_ov17_0224A1EC *param0, int param1) @@ -1170,7 +1170,7 @@ static BOOL ov17_0224B0E8(UnkStruct_ov17_0224DF54 *param0, int param1, const Unk if (param0->unk_14.unk_D8[v8] != NULL) { sub_0200D5A0(param0->unk_14.unk_D8[v8], &v6, &v7, (256 * FX32_ONE)); - if ((v6 == v1) && (v7 == v2) && (sub_0200D37C(param0->unk_14.unk_D8[v8]) != 2)) { + if ((v6 == v1) && (v7 == v2) && (CellActorData_GetActiveAnim(param0->unk_14.unk_D8[v8]) != 2)) { return 0; } } @@ -1990,10 +1990,10 @@ void ov17_0224C384(UnkStruct_ov17_0224DF54 *param0, SpriteRenderer *param1, Spri param0->unk_14.unk_1FC = v0; v0->unk_08 = param0; - v0->unk_04 = SpriteActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_022547FC); + v0->unk_04 = CellActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_022547FC); - SpriteActor_UpdateObject(v0->unk_04->unk_00); - SpriteActor_EnableObject(v0->unk_04, 0); + CellActor_UpdateObject(v0->unk_04->cellActor); + CellActorData_DrawSprite(v0->unk_04, 0); v0->unk_00 = SysTask_Start(ov17_0224C414, v0, ((30000 + 10000) + 15)); } @@ -2001,7 +2001,7 @@ void ov17_0224C384(UnkStruct_ov17_0224DF54 *param0, SpriteRenderer *param1, Spri void ov17_0224C3E4(UnkStruct_ov17_0224DF54 *param0) { SysTask_Done(param0->unk_14.unk_1FC->unk_00); - sub_0200D0F4(param0->unk_14.unk_1FC->unk_04); + CellActorData_Delete(param0->unk_14.unk_1FC->unk_04); Heap_FreeToHeap(param0->unk_14.unk_1FC); param0->unk_14.unk_1FC = NULL; @@ -2021,7 +2021,7 @@ static void ov17_0224C414(SysTask *param0, void *param1) break; } - SpriteActor_UpdateObject(v0->unk_04->unk_00); + CellActor_UpdateObject(v0->unk_04->cellActor); } void ov17_0224C434(UnkStruct_ov17_0224B058 *param0, u32 param1, u32 param2, int param3) @@ -2034,13 +2034,13 @@ void ov17_0224C434(UnkStruct_ov17_0224B058 *param0, u32 param1, u32 param2, int v0 = param1 * v1 / param2; sub_0200D500(param0->unk_04, v0 - 1 + v2, (0x16 * 8), (256 * FX32_ONE)); - SpriteActor_EnableObject(param0->unk_04, 1); + CellActorData_DrawSprite(param0->unk_04, 1); } void ov17_0224C47C(UnkStruct_ov17_0224B058 *param0, int param1) { sub_0200D500(param0->unk_04, -1, (0x16 * 8), (256 * FX32_ONE)); - SpriteActor_EnableObject(param0->unk_04, param1); + CellActorData_DrawSprite(param0->unk_04, param1); } void ov17_0224C49C(UnkStruct_ov17_0224C384 *param0, u32 param1, u32 param2, int param3) @@ -2066,12 +2066,12 @@ void ov17_0224C49C(UnkStruct_ov17_0224C384 *param0, u32 param1, u32 param2, int v4 -= sub_0201D15C(v5) * 10 / FX32_ONE; sub_0200D500(param0->unk_04, v3, v4, (256 * FX32_ONE)); - SpriteActor_EnableObject(param0->unk_04, 1); + CellActorData_DrawSprite(param0->unk_04, 1); } void ov17_0224C540(UnkStruct_ov17_0224C384 *param0) { - SpriteActor_EnableObject(param0->unk_04, 0); + CellActorData_DrawSprite(param0->unk_04, 0); } void ov17_0224C54C(UnkStruct_ov17_0224C384 *param0, int param1) @@ -2081,7 +2081,7 @@ void ov17_0224C54C(UnkStruct_ov17_0224C384 *param0, int param1) v0 = ov17_0223F0BC(param1, 3); v1 = (256 - v0) / 2; - SpriteActor_EnableObject(param0->unk_04, 1); + CellActorData_DrawSprite(param0->unk_04, 1); sub_0200D500(param0->unk_04, v1, (0x12 * 8), (256 * FX32_ONE)); } diff --git a/src/overlay017/ov17_0224F080.c b/src/overlay017/ov17_0224F080.c index d7f60e8944..0ecea5bd4b 100644 --- a/src/overlay017/ov17_0224F080.c +++ b/src/overlay017/ov17_0224F080.c @@ -8,7 +8,7 @@ #include "struct_defs/sprite_template.h" #include "struct_defs/struct_0200D0F4.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" __attribute__((aligned(4))) static const u32 Unk_ov17_02254A90[] = { 0x30, @@ -55,13 +55,13 @@ u32 ov17_0224F0B8(void) void ov17_0224F0BC(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) { - sub_0200CBDC(param0, param1, ov17_0224F0B8(), ov17_0224F080(param3), 1, param2, param4); + SpriteRenderer_LoadCharResObj(param0, param1, ov17_0224F0B8(), ov17_0224F080(param3), 1, param2, param4); } void ov17_0224F0F0(SpriteRenderer *param0, SpriteGfxHandler *param1, u32 param2, u32 param3) { - sub_0200CE0C(param0, param1, ov17_0224F0B8(), ov17_0224F098(), 1, param2); - sub_0200CE3C(param0, param1, ov17_0224F0B8(), ov17_0224F09C(), 1, param3); + SpriteRenderer_LoadCellResObj(param0, param1, ov17_0224F0B8(), ov17_0224F098(), 1, param2); + SpriteRenderer_LoadAnimResObj(param0, param1, ov17_0224F0B8(), ov17_0224F09C(), 1, param3); } void ov17_0224F138(SpriteGfxHandler *param0, u32 param1) @@ -82,12 +82,12 @@ CellActorData *ov17_0224F154(SpriteRenderer *param0, SpriteGfxHandler *param1, i v1 = *param3; v1.plttIdx = ov17_0224F0A0(param2); - v0 = SpriteActor_LoadResources(param0, param1, &v1); + v0 = CellActor_LoadResources(param0, param1, &v1); return v0; } void ov17_0224F184(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } diff --git a/src/overlay017/ov17_0224F4D4.c b/src/overlay017/ov17_0224F4D4.c index 46da2bb00b..2434c5e3fb 100644 --- a/src/overlay017/ov17_0224F4D4.c +++ b/src/overlay017/ov17_0224F4D4.c @@ -25,6 +25,7 @@ #include "message.h" #include "overlay_manager.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -33,7 +34,6 @@ #include "unk_02005474.h" #include "unk_0200762C.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02014000.h" @@ -179,15 +179,15 @@ int ov17_0224F4D4(OverlayManager *param0, int *param1) sub_0201E450(4); Font_InitManager(FONT_SUBSCREEN, 24); - v0->unk_10.unk_18 = sub_0200C6E4(24); + v0->unk_10.unk_18 = SpriteRenderer_Create(24); - sub_0200C73C(v0->unk_10.unk_18, &Unk_ov17_02254B0C, &Unk_ov17_02254AC4, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_10.unk_18, &Unk_ov17_02254B0C, &Unk_ov17_02254AC4, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_64K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_10.unk_1C = sub_0200C704(v0->unk_10.unk_18); - sub_0200C7C0(v0->unk_10.unk_18, v0->unk_10.unk_1C, (64 + 64)); - sub_0200CB30(v0->unk_10.unk_18, v0->unk_10.unk_1C, &Unk_ov17_02254AD8); + v0->unk_10.unk_1C = SpriteRenderer_CreateGfxHandler(v0->unk_10.unk_18); + SpriteRenderer_CreateCellActorList(v0->unk_10.unk_18, v0->unk_10.unk_1C, (64 + 64)); + SpriteRenderer_InitGfxResourceList(v0->unk_10.unk_18, v0->unk_10.unk_1C, &Unk_ov17_02254AD8); v0->unk_10.unk_04 = sub_0200762C(24); ov17_0224FDDC(); @@ -298,8 +298,8 @@ int ov17_0224F86C(OverlayManager *param0, int *param1) Bg_FreeTilemapBuffer(v0->unk_10.unk_20, 3); Bg_ToggleLayer(4, 0); Bg_FreeTilemapBuffer(v0->unk_10.unk_20, 4); - sub_0200D0B0(v0->unk_10.unk_18, v0->unk_10.unk_1C); - sub_0200C8D4(v0->unk_10.unk_18); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_10.unk_18, v0->unk_10.unk_1C); + SpriteRenderer_Free(v0->unk_10.unk_18); VRAMTransferManager_Destroy(); ov17_022507C4(&v0->unk_10); @@ -399,7 +399,7 @@ static void ov17_0224FAFC(SysTask *param0, void *param1) if (v0->unk_850 == 1) { sub_02007768(v0->unk_10.unk_04); ov11_0221F8F0(); - sub_0200C7EC(v0->unk_10.unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_10.unk_1C); sub_0200C808(); G3_SwapBuffers(GX_SORTMODE_MANUAL, GX_BUFFERMODE_Z); } diff --git a/src/overlay017/ov17_02250744.c b/src/overlay017/ov17_02250744.c index 49f869c956..b4834c9dfe 100644 --- a/src/overlay017/ov17_02250744.c +++ b/src/overlay017/ov17_02250744.c @@ -26,6 +26,7 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -33,7 +34,6 @@ #include "text.h" #include "unk_02005474.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" #include "unk_020933F8.h" #include "unk_02094EDC.h" @@ -377,7 +377,7 @@ void ov17_02250D28(UnkStruct_ov17_0224FCA0 *param0) v0 = NARC_ctor(NARC_INDEX_CONTEST__GRAPHIC__CONTEST_OBJ, 24); - SpriteRenderer_LoadPalette(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v0, 10, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v0, 10, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); ov17_02250F68(param0, v0); ov17_02250DB0(param0); @@ -404,7 +404,7 @@ void ov17_02250DB0(UnkStruct_ov17_0224FCA0 *param0) v3 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 24); - SpriteRenderer_LoadPalette(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KCellsFileIndex(), 0, 33002); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KAnimationFileIndex(), 0, 33002); @@ -414,16 +414,16 @@ void ov17_02250DB0(UnkStruct_ov17_0224FCA0 *param0) sub_0200D888(param0->unk_10.unk_18, param0->unk_10.unk_1C, 19, Pokemon_IconSpriteIndex(param0->unk_00->unk_00.unk_00[v2]), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + v2); v0.resources[0] = 33002 + v2; - param0->unk_10.unk_128[v2] = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &v0); + param0->unk_10.unk_128[v2] = CellActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &v0); - sub_0200D364(param0->unk_10.unk_128[v2], 1); - CellActor_SetExplicitPaletteOffsetAutoAdjust(param0->unk_10.unk_128[v2]->unk_00, Pokemon_IconPaletteIndex(param0->unk_00->unk_00.unk_00[v2])); - sub_0200D330(param0->unk_10.unk_128[v2]); + CellActorData_SetAnim(param0->unk_10.unk_128[v2], 1); + CellActor_SetExplicitPaletteOffsetAutoAdjust(param0->unk_10.unk_128[v2]->cellActor, Pokemon_IconPaletteIndex(param0->unk_00->unk_00.unk_00[v2])); + CellActorData_UpdateObject(param0->unk_10.unk_128[v2]); } for (v2 = 0; v2 < 4; v2++) { v1 = param0->unk_39A.unk_30[v2]; - SpriteActor_SetSpritePositionXY(param0->unk_10.unk_128[v1], Unk_ov17_02254BD4[v2].unk_00, Unk_ov17_02254BD4[v2].unk_02); + CellActorData_SetPositionXY(param0->unk_10.unk_128[v1], Unk_ov17_02254BD4[v2].unk_00, Unk_ov17_02254BD4[v2].unk_02); } param0->unk_10.unk_124 = SysTask_Start(ov17_02250F4C, param0, (50000 + 1000)); @@ -441,7 +441,7 @@ void ov17_02250EFC(UnkStruct_ov17_0224FCA0 *param0) for (v0 = 0; v0 < 4; v0++) { SpriteGfxHandler_UnloadCharObjById(param0->unk_10.unk_1C, 33002 + v0); - sub_0200D0F4(param0->unk_10.unk_128[v0]); + CellActorData_Delete(param0->unk_10.unk_128[v0]); } SysTask_Done(param0->unk_10.unk_124); @@ -453,7 +453,7 @@ static void ov17_02250F4C(SysTask *param0, void *param1) int v1; for (v1 = 0; v1 < 4; v1++) { - sub_0200D330(v0->unk_10.unk_128[v1]); + CellActorData_UpdateObject(v0->unk_10.unk_128[v1]); } } @@ -523,7 +523,7 @@ static void ov17_02251070(UnkStruct_ov17_0224FCA0 *param0) MI_CpuClear8(v1, sizeof(UnkStruct_ov17_02251070)); v1->unk_00 = param0; - v1->unk_04 = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C28); + v1->unk_04 = CellActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C28); v2 = (sub_02094E98(param0->unk_00) & 0xff) + 20; v3 = -16 + (sub_02094E98(param0->unk_00) % (96 - 32 - 16)); @@ -531,14 +531,14 @@ static void ov17_02251070(UnkStruct_ov17_0224FCA0 *param0) v1->unk_08 = v2 * 0x100; v1->unk_0C = v3 * 0x100; - SpriteActor_SetSpritePositionXY(v1->unk_04, v2, v3); + CellActorData_SetPositionXY(v1->unk_04, v2, v3); v1->unk_14 = (sub_02094E98(param0->unk_00) % 0x200) + 0x60; v1->unk_18 = (sub_02094E98(param0->unk_00) % 0x300) + 0x100; v1->unk_12 = (sub_02094E98(param0->unk_00) % 24) + 16; - sub_0200D364(v1->unk_04, sub_02094E98(param0->unk_00) % 0x9); - sub_0200D330(v1->unk_04); + CellActorData_SetAnim(v1->unk_04, sub_02094E98(param0->unk_00) % 0x9); + CellActorData_UpdateObject(v1->unk_04); SysTask_Start(ov17_02251140, v1, ((50000 + 10) + 1)); param0->unk_127A++; @@ -550,7 +550,7 @@ static void ov17_02251140(SysTask *param0, void *param1) if ((v0->unk_00->unk_1279 == 1) || ((v0->unk_0C / 0x100) > (192 + 16)) || (((v0->unk_08 + v0->unk_10) / 0x100) < -16)) { v0->unk_00->unk_127A--; - sub_0200D0F4(v0->unk_04); + CellActorData_Delete(v0->unk_04); Heap_FreeToHeap(param1); SysTask_Done(param0); return; @@ -566,8 +566,8 @@ static void ov17_02251140(SysTask *param0, void *param1) v0->unk_08 -= v0->unk_14; v0->unk_0C += 0x280; - SpriteActor_SetSpritePositionXY(v0->unk_04, (v0->unk_08 / 0x100) + v0->unk_10, v0->unk_0C / 0x100); - sub_0200D330(v0->unk_04); + CellActorData_SetPositionXY(v0->unk_04, (v0->unk_08 / 0x100) + v0->unk_10, v0->unk_0C / 0x100); + CellActorData_UpdateObject(v0->unk_04); } void ov17_0225122C(UnkStruct_ov17_0224FCA0 *param0, NARC *param1) @@ -580,14 +580,14 @@ void ov17_0225122C(UnkStruct_ov17_0224FCA0 *param0, NARC *param1) int v0, v1; for (v0 = 0; v0 < 4; v0++) { - param0->unk_10.unk_138[v0] = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C90); - sub_0200D330(param0->unk_10.unk_138[v0]); - SpriteActor_EnableObject(param0->unk_10.unk_138[v0], 0); + param0->unk_10.unk_138[v0] = CellActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C90); + CellActorData_UpdateObject(param0->unk_10.unk_138[v0]); + CellActorData_DrawSprite(param0->unk_10.unk_138[v0], 0); } for (v0 = 0; v0 < 4; v0++) { v1 = param0->unk_39A.unk_30[v0]; - SpriteActor_SetSpritePositionXY(param0->unk_10.unk_138[v1], Unk_ov17_02254BE4[v0].unk_00, Unk_ov17_02254BE4[v0].unk_02); + CellActorData_SetPositionXY(param0->unk_10.unk_138[v1], Unk_ov17_02254BE4[v0].unk_00, Unk_ov17_02254BE4[v0].unk_02); } } } @@ -602,21 +602,21 @@ void ov17_022512E0(UnkStruct_ov17_0224FCA0 *param0) int v0; for (v0 = 0; v0 < 4; v0++) { - sub_0200D0F4(param0->unk_10.unk_138[v0]); + CellActorData_Delete(param0->unk_10.unk_138[v0]); } } } void ov17_0225131C(UnkStruct_ov17_0224FCA0 *param0, int param1, int param2) { - sub_0200D364(param0->unk_10.unk_138[param1], param2); - SpriteActor_EnableObject(param0->unk_10.unk_138[param1], 1); + CellActorData_SetAnim(param0->unk_10.unk_138[param1], param2); + CellActorData_DrawSprite(param0->unk_10.unk_138[param1], 1); Sound_PlayEffect(1501); } void ov17_02251344(UnkStruct_ov17_0224FCA0 *param0, NARC *param1) { - SpriteRenderer_LoadPalette(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 87, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33008); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 86, 1, 33005); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 85, 1, 33005); @@ -670,24 +670,24 @@ void ov17_022513F4(UnkStruct_ov17_0224FCA0 *param0, int param1, int param2, int for (v6 = 0; v6 < v5; v6++) { if (v1[v6] == NULL) { - v1[v6] = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254CC4); + v1[v6] = CellActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254CC4); } } v7 = 0; for (v8 = param3; v8 >= 16; v8 -= 16) { - sub_0200D364(v1[v7], v2 + 16 - 1); + CellActorData_SetAnim(v1[v7], v2 + 16 - 1); v7++; } if ((v8 > 0) && (v7 < v5)) { - sub_0200D364(v1[v7], v2 + v8 - 1); + CellActorData_SetAnim(v1[v7], v2 + v8 - 1); } for (v6 = 0; v6 < v5; v6++) { - SpriteActor_SetSpritePositionXY(v1[v6], v3 + v6 * 16, v4); - sub_0200D330(v1[v6]); + CellActorData_SetPositionXY(v1[v6], v3 + v6 * 16, v4); + CellActorData_UpdateObject(v1[v6]); } } @@ -698,15 +698,15 @@ void ov17_02251544(UnkStruct_ov17_0224FCA0 *param0) for (v1 = 0; v1 < 4; v1++) { for (v0 = 0; v0 < ((24 * 8) / 16); v0++) { if (param0->unk_10.unk_148[v1][v0] != NULL) { - sub_0200D0F4(param0->unk_10.unk_148[v1][v0]); + CellActorData_Delete(param0->unk_10.unk_148[v1][v0]); } if (param0->unk_10.unk_208[v1][v0] != NULL) { - sub_0200D0F4(param0->unk_10.unk_208[v1][v0]); + CellActorData_Delete(param0->unk_10.unk_208[v1][v0]); } if (param0->unk_10.unk_2C8[v1][v0] != NULL) { - sub_0200D0F4(param0->unk_10.unk_2C8[v1][v0]); + CellActorData_Delete(param0->unk_10.unk_2C8[v1][v0]); } } } diff --git a/src/overlay017/ov17_02252AB0.c b/src/overlay017/ov17_02252AB0.c index 0833cba989..2a967fbecd 100644 --- a/src/overlay017/ov17_02252AB0.c +++ b/src/overlay017/ov17_02252AB0.c @@ -10,9 +10,9 @@ #include "heap.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" -#include "unk_0200C6E4.h" typedef struct UnkStruct_ov17_02252B48_t { CellActorData *unk_00[5]; @@ -41,10 +41,10 @@ static const SpriteTemplate Unk_ov17_02254D9C = { void ov17_02252AB0(SpriteRenderer *param0, SpriteGfxHandler *param1, PaletteData *param2, u32 param3, u32 param4, u32 param5, u32 param6) { - sub_0200CD7C(param2, 3, param0, param1, 27, 80, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param4); - sub_0200CBDC(param0, param1, 27, 250, 1, NNS_G2D_VRAM_TYPE_2DSUB, param3); - sub_0200CE0C(param0, param1, 27, 251, 1, param5); - sub_0200CE3C(param0, param1, 27, 252, 1, param6); + SpriteRenderer_LoadPalette(param2, 3, param0, param1, 27, 80, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param4); + SpriteRenderer_LoadCharResObj(param0, param1, 27, 250, 1, NNS_G2D_VRAM_TYPE_2DSUB, param3); + SpriteRenderer_LoadCellResObj(param0, param1, 27, 251, 1, param5); + SpriteRenderer_LoadAnimResObj(param0, param1, 27, 252, 1, param6); } void ov17_02252B20(SpriteGfxHandler *param0, u32 param1, u32 param2, u32 param3, u32 param4) @@ -73,8 +73,8 @@ UnkStruct_ov17_02252B48 *ov17_02252B48(SpriteRenderer *param0, SpriteGfxHandler MI_CpuClear8(v0, sizeof(UnkStruct_ov17_02252B48)); for (v2 = 0; v2 < 5; v2++) { - v0->unk_00[v2] = SpriteActor_LoadResources(param0, param1, &v1); - SpriteActor_EnableObject(v0->unk_00[v2], 0); + v0->unk_00[v2] = CellActor_LoadResources(param0, param1, &v1); + CellActorData_DrawSprite(v0->unk_00[v2], 0); } v0->unk_14 = SysTask_Start(ov17_02252CB8, v0, 40000); @@ -86,7 +86,7 @@ void ov17_02252BCC(UnkStruct_ov17_02252B48 *param0) int v0; for (v0 = 0; v0 < 5; v0++) { - sub_0200D0F4(param0->unk_00[v0]); + CellActorData_Delete(param0->unk_00[v0]); } SysTask_Done(param0->unk_14); @@ -102,13 +102,13 @@ void ov17_02252BF0(UnkStruct_ov17_02252B48 *param0, int param1, int param2, int sub_0200D500(param0->unk_00[2], param5, param6, param9); sub_0200D500(param0->unk_00[3], param7, param8, param9); - sub_0200D364(param0->unk_00[0], 0); - sub_0200D364(param0->unk_00[1], 1); - sub_0200D364(param0->unk_00[2], 2); - sub_0200D364(param0->unk_00[3], 3); + CellActorData_SetAnim(param0->unk_00[0], 0); + CellActorData_SetAnim(param0->unk_00[1], 1); + CellActorData_SetAnim(param0->unk_00[2], 2); + CellActorData_SetAnim(param0->unk_00[3], 3); for (v0 = 0; v0 < 4; v0++) { - SpriteActor_EnableObject(param0->unk_00[v0], 1); + CellActorData_DrawSprite(param0->unk_00[v0], 1); } } @@ -122,7 +122,7 @@ void ov17_02252C9C(UnkStruct_ov17_02252B48 *param0) int v0; for (v0 = 0; v0 < 5; v0++) { - SpriteActor_EnableObject(param0->unk_00[v0], 0); + CellActorData_DrawSprite(param0->unk_00[v0], 0); } } @@ -131,15 +131,15 @@ static void ov17_02252CB8(SysTask *param0, void *param1) UnkStruct_ov17_02252B48 *v0 = param1; int v1; - if (sub_0200D408(v0->unk_00[0]) == 0) { + if (CellActorData_GetDrawFlag(v0->unk_00[0]) == 0) { return; } for (v1 = 0; v1 < 4; v1++) { - sub_0200D330(v0->unk_00[v1]); + CellActorData_UpdateObject(v0->unk_00[v1]); } - if (sub_0200D408(v0->unk_00[4]) == 1) { - sub_0200D330(v0->unk_00[4]); + if (CellActorData_GetDrawFlag(v0->unk_00[4]) == 1) { + CellActorData_UpdateObject(v0->unk_00[4]); } } diff --git a/src/overlay019/ov19_021D61B0.c b/src/overlay019/ov19_021D61B0.c index 613e615699..53d76b5461 100644 --- a/src/overlay019/ov19_021D61B0.c +++ b/src/overlay019/ov19_021D61B0.c @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_02007768_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02099F80.h" #include "overlay019/funcptr_ov19_021D79B8.h" @@ -43,6 +42,7 @@ #include "gx_layers.h" #include "heap.h" #include "narc.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_02005474.h" @@ -57,7 +57,7 @@ struct UnkStruct_ov19_021D61B0_t { SysTask *unk_04; SysTask *unk_08[4]; CellActorCollection *unk_18; - UnkStruct_0200C738 unk_1C; + GF_G2dRenderer unk_1C; NNSG2dImagePaletteProxy unk_1A8; UnkStruct_02007768 *unk_1BC; BgConfig *unk_1C0; diff --git a/src/overlay020/ov20_021D2098.c b/src/overlay020/ov20_021D2098.c index 2e1f29940f..6dc1b7972a 100644 --- a/src/overlay020/ov20_021D2098.c +++ b/src/overlay020/ov20_021D2098.c @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_020998EC_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02099F80.h" #include "overlay020/ov20_021D0D80.h" @@ -26,6 +25,7 @@ #include "gx_layers.h" #include "heap.h" #include "narc.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_020093B4.h" @@ -41,7 +41,7 @@ typedef struct UnkStruct_ov20_021D2128_t { const UnkStruct_020998EC *unk_1C; BgConfig *unk_20; CellActorCollection *unk_24; - UnkStruct_0200C738 unk_28; + GF_G2dRenderer unk_28; NNSG2dImageProxy unk_1B4[2]; NNSG2dImagePaletteProxy unk_1FC[2]; NNSG2dCellDataBank *unk_224[2]; diff --git a/src/overlay021/ov21_021E8D48.c b/src/overlay021/ov21_021E8D48.c index 9bb26d6103..c6eacf24eb 100644 --- a/src/overlay021/ov21_021E8D48.c +++ b/src/overlay021/ov21_021E8D48.c @@ -6,7 +6,6 @@ #include "struct_decls/sprite_decl.h" #include "struct_decls/struct_02007768_decl.h" #include "struct_defs/archived_sprite.h" -#include "struct_defs/struct_0200C738.h" #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1F90.h" @@ -31,6 +30,7 @@ #include "palette.h" #include "pokedex_data_index.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "sys_task.h" @@ -71,7 +71,7 @@ typedef struct UnkStruct_ov21_021E8D48_t { Window *unk_04; PaletteData *unk_08; Sprite *unk_0C; - UnkStruct_0200C738 unk_10; + GF_G2dRenderer unk_10; CellActorCollection *unk_19C; SpriteResourceCollection *unk_1A0[4]; UnkStruct_ov21_021D4C0C *unk_1B0; diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index cb1647fad3..42d0ad6cdd 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -7,7 +7,6 @@ #include "struct_decls/struct_0202855C_decl.h" #include "struct_decls/struct_020298B0_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02099F80.h" #include "field/field_system.h" @@ -43,6 +42,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "sys_task.h" @@ -139,7 +139,7 @@ typedef struct { BgConfig *unk_04; MATHRandContext32 unk_08; CellActorCollection *unk_20; - UnkStruct_0200C738 unk_24; + GF_G2dRenderer unk_24; SpriteResourceCollection *unk_1B0[4]; SpriteResource *unk_1C0[8]; CellActorResourceData unk_1E0; diff --git a/src/overlay023/ov23_0224340C.c b/src/overlay023/ov23_0224340C.c index 0f80699426..41d78512e6 100644 --- a/src/overlay023/ov23_0224340C.c +++ b/src/overlay023/ov23_0224340C.c @@ -38,6 +38,7 @@ #include "map_object_move.h" #include "narc.h" #include "player_avatar.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "sys_task.h" @@ -115,7 +116,7 @@ typedef struct { SysTask *unk_20[8]; FieldSystem *fieldSystem; CellActorCollection *unk_44; - UnkStruct_0200C738 unk_48; + GF_G2dRenderer unk_48; SpriteResourceCollection *unk_1D4[2][4]; SpriteResource *unk_1F4[2][4]; CellActorResourceData unk_214; diff --git a/src/overlay023/ov23_02248F1C.c b/src/overlay023/ov23_02248F1C.c index 9a1890d749..7d810168b2 100644 --- a/src/overlay023/ov23_02248F1C.c +++ b/src/overlay023/ov23_02248F1C.c @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_0205E884_decl.h" -#include "struct_defs/struct_0200C738.h" #include "field/field_system.h" #include "overlay023/ov23_02241F74.h" @@ -19,6 +18,7 @@ #include "narc.h" #include "player_avatar.h" #include "render_window.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "sys_task_manager.h" @@ -47,7 +47,7 @@ struct UnkStruct_ov23_0224942C_t { FieldSystem *fieldSystem; BgConfig *unk_1B8; CellActorCollection *unk_1BC; - UnkStruct_0200C738 unk_1C0; + GF_G2dRenderer unk_1C0; SpriteResourceCollection *unk_34C[4]; SpriteResource *unk_35C[4]; CellActorResourceData unk_36C; diff --git a/src/overlay023/ov23_0224F294.c b/src/overlay023/ov23_0224F294.c index c09788795f..fd395b38bc 100644 --- a/src/overlay023/ov23_0224F294.c +++ b/src/overlay023/ov23_0224F294.c @@ -46,6 +46,7 @@ #include "player_avatar.h" #include "render_window.h" #include "save_player.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" @@ -54,7 +55,6 @@ #include "trainer_info.h" #include "unk_02005474.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0202854C.h" #include "unk_0206A780.h" @@ -193,7 +193,7 @@ static void ov23_0224F294(UnkStruct_ov23_02250CD4 *param0, u8 *param1, u32 param param0->unk_23C[0] = ov5_021D3584(¶m0->unk_74, &Unk_ov23_0225695C[0]); - ov23_0224F4D0(param0->unk_23C[0]->unk_00, param0->unk_29C); + ov23_0224F4D0(param0->unk_23C[0]->cellActor, param0->unk_29C); ov5_021D3374(¶m0->unk_74, v2, 8, 0, 14529); ov5_021D339C(¶m0->unk_74, v2, 7, 0, 14529); @@ -212,11 +212,11 @@ static void ov23_0224F294(UnkStruct_ov23_02250CD4 *param0, u8 *param1, u32 param { VecFx32 v4 = { FX32_ONE, FX32_ONE, FX32_ONE }; - CellActor_SetAffineScaleEx(param0->unk_23C[1 + v1]->unk_00, &v4, 1); + CellActor_SetAffineScaleEx(param0->unk_23C[1 + v1]->cellActor, &v4, 1); } } - ov23_0224F500(param0->unk_23C[1 + param0->unk_29C]->unk_00, 2, 1); + ov23_0224F500(param0->unk_23C[1 + param0->unk_29C]->cellActor, 2, 1); param0->unk_25C = param2 + 1; GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); } @@ -226,7 +226,7 @@ static void ov23_0224F460(UnkStruct_ov23_02250CD4 *param0) u16 v0; for (v0 = 0; v0 < param0->unk_25C; v0++) { - sub_0200D0F4(param0->unk_23C[v0]); + CellActorData_Delete(param0->unk_23C[v0]); } ov5_021D375C(¶m0->unk_74); @@ -237,7 +237,7 @@ static void ov23_0224F498(UnkStruct_ov23_02250CD4 *param0) u16 v0; for (v0 = 0; v0 < param0->unk_25C; v0++) { - CellActor_UpdateAnim(param0->unk_23C[v0]->unk_00, FX32_ONE); + CellActor_UpdateAnim(param0->unk_23C[v0]->cellActor, FX32_ONE); } } @@ -261,8 +261,8 @@ static void ov23_0224F500(CellActor *param0, u16 param1, u16 param2) static void ov23_0224F52C(UnkStruct_ov23_02250CD4 *param0, u16 param1, u16 param2) { - ov23_0224F500(param0->unk_23C[1 + param1]->unk_00, 0, 0); - ov23_0224F500(param0->unk_23C[1 + param2]->unk_00, 1, 1); + ov23_0224F500(param0->unk_23C[1 + param1]->cellActor, 0, 0); + ov23_0224F500(param0->unk_23C[1 + param2]->cellActor, 1, 1); } static void ov23_0224F560(CellActor *param0) @@ -621,12 +621,12 @@ static BOOL ov23_0224FA58(SysTask *param0, void *param1) v0->unk_29C = Menu_GetCursorPos(v0->unk_54); if (v1 != v0->unk_29C) { - ov23_0224F4D0(v0->unk_23C[0]->unk_00, v0->unk_29C); + ov23_0224F4D0(v0->unk_23C[0]->cellActor, v0->unk_29C); ov23_0224F52C(v0, v1, v0->unk_29C); v0->fieldSystem->unk_90 = v0->unk_29C; } - ov23_0224F560(v0->unk_23C[1 + v0->unk_29C]->unk_00); + ov23_0224F560(v0->unk_23C[1 + v0->unk_29C]->cellActor); if (CommSys_CheckError()) { v0->unk_2A0 = 0xfffffffe; diff --git a/src/overlay056/ov56_022561C0.c b/src/overlay056/ov56_022561C0.c index dcbc40e30d..2c45fd179a 100644 --- a/src/overlay056/ov56_022561C0.c +++ b/src/overlay056/ov56_022561C0.c @@ -6,7 +6,6 @@ #include "struct_decls/struct_02027F8C_decl.h" #include "struct_decls/struct_0205B43C_decl.h" #include "struct_defs/sentence.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0203330C.h" #include "struct_defs/struct_0205C22C.h" #include "struct_defs/struct_0205C924.h" @@ -26,6 +25,7 @@ #include "message.h" #include "message_util.h" #include "save_player.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -73,7 +73,7 @@ struct UnkStruct_ov56_02256468_t { u16 *unk_20; NNSG2dScreenData *unk_24; CellActorCollection *unk_28; - UnkStruct_0200C738 unk_2C; + GF_G2dRenderer unk_2C; SpriteResourceCollection *unk_1B8[4]; SpriteResource *unk_1C8[4]; CellActorResourceData unk_1D8; diff --git a/src/overlay062/ov62_0222F2C0.c b/src/overlay062/ov62_0222F2C0.c index 4004fcc9e2..2a65dfb6b1 100644 --- a/src/overlay062/ov62_0222F2C0.c +++ b/src/overlay062/ov62_0222F2C0.c @@ -25,11 +25,11 @@ #include "palette.h" #include "render_text.h" #include "savedata_misc.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "unk_02005474.h" #include "unk_0200762C.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" @@ -171,8 +171,8 @@ void ov62_0222F514(UnkStruct_0208C06C *param0) NARC_dtor(param0->unk_14.unk_00); SysTask_Done(param0->unk_41E8); - sub_0200D0B0(param0->unk_14.unk_04, param0->unk_14.unk_08); - sub_0200C8D4(param0->unk_14.unk_04); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_14.unk_04, param0->unk_14.unk_08); + SpriteRenderer_Free(param0->unk_14.unk_04); sub_02039794(); { @@ -315,7 +315,7 @@ void ov62_0222F834(UnkStruct_0208C06C *param0) static void ov62_0222F848(UnkStruct_0208C06C *param0) { - param0->unk_14.unk_04 = sub_0200C6E4(102); + param0->unk_14.unk_04 = SpriteRenderer_Create(102); { const UnkStruct_ov104_0224133C v0 = { 0, @@ -332,7 +332,7 @@ static void ov62_0222F848(UnkStruct_0208C06C *param0) 128, 0x10000, 0x4000, GX_OBJVRAMMODE_CHAR_1D_128K, GX_OBJVRAMMODE_CHAR_1D_128K }; - sub_0200C73C(param0->unk_14.unk_04, &v0, &v1, 16 + 16); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_14.unk_04, &v0, &v1, 16 + 16); } { @@ -346,16 +346,16 @@ static void ov62_0222F848(UnkStruct_0208C06C *param0) 16, }; - param0->unk_14.unk_08 = sub_0200C704(param0->unk_14.unk_04); + param0->unk_14.unk_08 = SpriteRenderer_CreateGfxHandler(param0->unk_14.unk_04); - v2 = sub_0200C7C0(param0->unk_14.unk_04, param0->unk_14.unk_08, 64 + 64 + 64); + v2 = SpriteRenderer_CreateCellActorList(param0->unk_14.unk_04, param0->unk_14.unk_08, 64 + 64 + 64); GF_ASSERT(v2); - v2 = sub_0200CB30(param0->unk_14.unk_04, param0->unk_14.unk_08, &v3); + v2 = SpriteRenderer_InitGfxResourceList(param0->unk_14.unk_04, param0->unk_14.unk_08, &v3); GF_ASSERT(v2); } - sub_0200964C(sub_0200C738(param0->unk_14.unk_04), 0, (256 * FX32_ONE)); + sub_0200964C(SpriteRenderer_GetG2dRenderer(param0->unk_14.unk_04), 0, (256 * FX32_ONE)); } void ov62_0222F8E4(void *param0) diff --git a/src/overlay062/ov62_022300D8.c b/src/overlay062/ov62_022300D8.c index 36564e00f7..2ddde3492c 100644 --- a/src/overlay062/ov62_022300D8.c +++ b/src/overlay062/ov62_022300D8.c @@ -24,12 +24,12 @@ #include "message.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_0201D15C.h" #include "unk_0201E86C.h" @@ -111,11 +111,11 @@ void ov62_02230330(UnkStruct_0208C06C *param0) PaletteData *v4 = param0->unk_14.unk_14; if (param0->unk_00 == 0) { - SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); - SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 2, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 3, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); } else { - SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); - SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 2, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 3, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); } SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 65, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); @@ -192,7 +192,7 @@ void ov62_02230464(UnkStruct_0208C06C *param0) v0.resources[3] = 10000; } - param0->unk_6F8[v5].unk_00[v4] = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_6F8[v5].unk_00[v4] = CellActor_LoadResources(v1, v2, &v0); if (v4 == 0) { ov62_02230E68(param0->unk_6F8[v5].unk_00[v4], v6[v5], 192 / 2); @@ -200,7 +200,7 @@ void ov62_02230464(UnkStruct_0208C06C *param0) ov62_02230E68(param0->unk_6F8[v5].unk_00[v4], v6[v5], 192 / 2); } - sub_0200D330(param0->unk_6F8[v5].unk_00[v4]); + CellActorData_UpdateObject(param0->unk_6F8[v5].unk_00[v4]); sub_0200D6A4(param0->unk_6F8[v5].unk_00[v4], 2); sub_0200D6E8(param0->unk_6F8[v5].unk_00[v4], v7[v5], 1.0f); @@ -248,7 +248,7 @@ void ov62_0223066C(UnkStruct_0208C06C *param0) for (v1 = 0; v1 < (3 * 2); v1++) { for (v0 = 0; v0 < 2; v0++) { - sub_0200D0F4(param0->unk_6F8[v1].unk_00[v0]); + CellActorData_Delete(param0->unk_6F8[v1].unk_00[v0]); } } } @@ -345,11 +345,11 @@ void ov62_022307C0(UnkStruct_0208C06C *param0) if (param0->unk_534.unk_1A4 - 1 == v0) { v2 = v2; v3 = (25 + (36 * (5 - 1))); - sub_0200D430(param0->unk_534.unk_00[v0].unk_00, (2 - 1)); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v0].unk_00, (2 - 1)); } else { v2 = v2 - (4 * (param0->unk_534.unk_1A4 - v0)); v3 = (16 * (param0->unk_534.unk_1A4 - v0 - 1)) + (25 + (36 * (5 - (param0->unk_534.unk_1A4 - v0)))); - sub_0200D430(param0->unk_534.unk_00[v0].unk_00, (3 - 1)); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v0].unk_00, (3 - 1)); } ov62_02230E68(param0->unk_534.unk_00[v0].unk_00, v2, v3); @@ -395,10 +395,10 @@ void ov62_0223088C(UnkStruct_0208C06C *param0) v2.resources[2] = 10002; v2.resources[3] = 10002; v2.priority = Unk_ov62_022488A8[1][v0]; - v1->unk_00[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0].unk_00 = CellActor_LoadResources(v3, v4, &v2); - sub_0200D330(v1->unk_00[v0].unk_00); - SpriteActor_EnableObject(v1->unk_00[v0].unk_00, 1); + CellActorData_UpdateObject(v1->unk_00[v0].unk_00); + CellActorData_DrawSprite(v1->unk_00[v0].unk_00, 1); ov62_02230E68(v1->unk_00[v0].unk_00, v2.x + 8, v2.y); v2.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; @@ -407,11 +407,11 @@ void ov62_0223088C(UnkStruct_0208C06C *param0) v2.resources[2] = 10001; v2.resources[3] = 10001; v2.priority = Unk_ov62_022488A8[0][v0]; - v1->unk_C8[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_C8[v0].unk_00 = CellActor_LoadResources(v3, v4, &v2); - sub_0200D330(v1->unk_C8[v0].unk_00); + CellActorData_UpdateObject(v1->unk_C8[v0].unk_00); ov62_02230E68(v1->unk_C8[v0].unk_00, v2.x, v2.y); - SpriteActor_EnableObject(v1->unk_C8[v0].unk_00, param0->unk_818[v0].unk_00); + CellActorData_DrawSprite(v1->unk_C8[v0].unk_00, param0->unk_818[v0].unk_00); } v0 = 0; @@ -428,11 +428,11 @@ void ov62_0223088C(UnkStruct_0208C06C *param0) if (param0->unk_534.unk_1A4 - 1 == v0) { v6 = v6; v7 = (25 + (36 * (5 - 1))); - sub_0200D430(param0->unk_534.unk_00[v0].unk_00, 2 - 1); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v0].unk_00, 2 - 1); } else { v6 = v6 - (4 * (param0->unk_534.unk_1A4 - v0)); v7 = (16 * (param0->unk_534.unk_1A4 - v0 - 1)) + (25 + (36 * (5 - (param0->unk_534.unk_1A4 - v0)))); - sub_0200D430(param0->unk_534.unk_00[v0].unk_00, (3 - 1)); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v0].unk_00, (3 - 1)); } ov62_02230E68(param0->unk_534.unk_00[v0].unk_00, v6, v7); @@ -448,13 +448,13 @@ void ov62_02230A5C(UnkStruct_0208C06C *param0) int v0; for (v0 = 0; v0 < 5; v0++) { - SpriteActor_EnableObject(param0->unk_534.unk_C8[v0].unk_00, param0->unk_818[v0].unk_00); + CellActorData_DrawSprite(param0->unk_534.unk_C8[v0].unk_00, param0->unk_818[v0].unk_00); if (param0->unk_818[v0].unk_00 == 0) { continue; } - sub_0200D364(param0->unk_534.unk_C8[v0].unk_00, param0->unk_818[v0].unk_0C); + CellActorData_SetAnim(param0->unk_534.unk_C8[v0].unk_00, param0->unk_818[v0].unk_0C); ov62_02230FC8(param0, ¶m0->unk_534.unk_C8[v0], param0->unk_818[v0].unk_08, ¶m0->unk_818[v0]); } } @@ -464,8 +464,8 @@ void ov62_02230AB8(UnkStruct_0208C06C *param0) int v0; for (v0 = 0; v0 < 5; v0++) { - sub_020131E0(param0->unk_534.unk_C8[v0].unk_14, param0->unk_534.unk_C8[v0].unk_00->unk_00); - sub_020131E0(param0->unk_534.unk_00[v0].unk_14, param0->unk_534.unk_00[v0].unk_00->unk_00); + sub_020131E0(param0->unk_534.unk_C8[v0].unk_14, param0->unk_534.unk_C8[v0].unk_00->cellActor); + sub_020131E0(param0->unk_534.unk_00[v0].unk_14, param0->unk_534.unk_00[v0].unk_00->cellActor); } } @@ -478,11 +478,11 @@ void ov62_02230AF0(UnkStruct_0208C06C *param0) } for (v0 = 0; v0 < param0->unk_534.unk_1A4; v0++) { - sub_0200D364(param0->unk_534.unk_00[v0].unk_00, param0->unk_534.unk_190[v0]->unk_0C); + CellActorData_SetAnim(param0->unk_534.unk_00[v0].unk_00, param0->unk_534.unk_190[v0]->unk_0C); ov62_02230FC8(param0, ¶m0->unk_534.unk_00[v0], param0->unk_534.unk_190[v0]->unk_08, param0->unk_534.unk_190[v0]); sub_020128C4(param0->unk_534.unk_00[v0].unk_14, 36, -8); sub_020129D0(param0->unk_534.unk_00[v0].unk_14, 1); - SpriteActor_EnableObject(param0->unk_534.unk_00[v0].unk_00, 1); + CellActorData_DrawSprite(param0->unk_534.unk_00[v0].unk_00, 1); } } @@ -492,8 +492,8 @@ void ov62_02230B74(UnkStruct_0208C06C *param0) UnkStruct_ov62_022307C0 *v1 = ¶m0->unk_534; for (v0 = 0; v0 < 5; v0++) { - sub_0200D0F4(v1->unk_00[v0].unk_00); - sub_0200D0F4(v1->unk_C8[v0].unk_00); + CellActorData_Delete(v1->unk_00[v0].unk_00); + CellActorData_Delete(v1->unk_C8[v0].unk_00); } } @@ -504,18 +504,18 @@ void ov62_02230B9C(UnkStruct_0208C06C *param0, BOOL param1) for (v0 = 0; v0 < 5; v0++) { if (param0->unk_534.unk_00[v0].unk_0C == 0) { sub_020129D0(param0->unk_534.unk_00[v0].unk_14, 0); - SpriteActor_EnableObject(param0->unk_534.unk_00[v0].unk_00, 0); + CellActorData_DrawSprite(param0->unk_534.unk_00[v0].unk_00, 0); } else { sub_020129D0(param0->unk_534.unk_00[v0].unk_14, param1); - SpriteActor_EnableObject(param0->unk_534.unk_00[v0].unk_00, param1); + CellActorData_DrawSprite(param0->unk_534.unk_00[v0].unk_00, param1); } if (param0->unk_534.unk_C8[v0].unk_0C == 0) { sub_020129D0(param0->unk_534.unk_C8[v0].unk_14, 0); - SpriteActor_EnableObject(param0->unk_534.unk_C8[v0].unk_00, 0); + CellActorData_DrawSprite(param0->unk_534.unk_C8[v0].unk_00, 0); } else { sub_020129D0(param0->unk_534.unk_C8[v0].unk_14, param1); - SpriteActor_EnableObject(param0->unk_534.unk_C8[v0].unk_00, param1); + CellActorData_DrawSprite(param0->unk_534.unk_C8[v0].unk_00, param1); } } } @@ -592,8 +592,8 @@ void ov62_02230C28(SysTask *param0, void *param1) v0->unk_28++; } - SpriteActor_SetSpritePositionXY(v0->unk_00[0], v5, v6); - SpriteActor_SetSpritePositionXY(v0->unk_00[1], v5, v7); + CellActorData_SetPositionXY(v0->unk_00[0], v5, v6); + CellActorData_SetPositionXY(v0->unk_00[1], v5, v7); } break; case 3: { fx32 v9, v10; @@ -671,8 +671,8 @@ void ov62_02230E80(UnkStruct_0208C06C *param0) v2.unk_00 = param0->unk_14.unk_3C; v2.unk_04 = &v6; v2.unk_08 = sub_0200D9B0(param0->unk_14.unk_08); - v2.unk_0C = sub_0200D04C(param0->unk_14.unk_08, v9[v11]); - v2.unk_10 = v7[v11]->unk_00->unk_00; + v2.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_14.unk_08, v9[v11]); + v2.unk_10 = v7[v11]->unk_00->cellActor; v2.unk_14 = v7[v11]->unk_1C.unk_04; v2.unk_18 = v0 + 36; v2.unk_1C = v1 + -8; @@ -787,8 +787,8 @@ void ov62_0223118C(UnkStruct_ov62_022312B0 *param0, UnkStruct_ov62_0223118C *par v2.unk_00 = param1->unk_3C; v2.unk_04 = &v6; v2.unk_08 = sub_0200D9B0(param1->unk_08); - v2.unk_0C = sub_0200D04C(param1->unk_08, v7); - v2.unk_10 = param0->unk_08->unk_00; + v2.unk_0C = SpriteGfxHandler_GetPaletteProxy(param1->unk_08, v7); + v2.unk_10 = param0->unk_08->cellActor; v2.unk_14 = param0->unk_14.unk_04; v2.unk_18 = v0 + 36; v2.unk_1C = v1 + -8; @@ -903,11 +903,11 @@ CellActorData *ov62_022313E0(UnkStruct_0208C06C *param0, int param1) v1.resources[1] = 10000; } - v0 = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v1); + v0 = CellActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v1); - sub_0200D41C(v0, 2); - sub_0200D364(v0, 0); - sub_0200D330(v0); + CellActorData_SetExplicitPalette(v0, 2); + CellActorData_SetAnim(v0, 0); + CellActorData_UpdateObject(v0); return v0; } diff --git a/src/overlay062/ov62_02231690.c b/src/overlay062/ov62_02231690.c index ed8db7520f..cd572c48cf 100644 --- a/src/overlay062/ov62_02231690.c +++ b/src/overlay062/ov62_02231690.c @@ -44,6 +44,7 @@ #include "palette.h" #include "pokemon_icon.h" #include "savedata_misc.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -52,7 +53,6 @@ #include "touch_screen.h" #include "unk_02005474.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_02014A84.h" #include "unk_0202F1D4.h" @@ -175,8 +175,8 @@ void ov62_022317CC(UnkStruct_0208C06C *param0, int param1) sub_0208B63C(param0->unk_6F0, param0->unk_14.unk_48); SpriteGfxHandler_UnloadPlttObjById(v2, 9999); SpriteGfxHandler_UnloadPlttObjById(v2, 10000); - SpriteRenderer_LoadPalette(v0, 2, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); - SpriteRenderer_LoadPalette(v0, 3, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); + SpriteRenderer_LoadPaletteFromOpenNarc(v0, 2, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); + SpriteRenderer_LoadPaletteFromOpenNarc(v0, 3, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); } void ov62_022318E8(UnkStruct_0208C06C *param0) @@ -549,7 +549,7 @@ static void ov62_02232080(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p static void ov62_022320A0(UnkStruct_ov62_022323B8 *param0, int param1) { if (param0->unk_04) { - SpriteActor_EnableObject(param0->unk_04, param1); + CellActorData_DrawSprite(param0->unk_04, param1); } } @@ -561,7 +561,7 @@ static void ov62_022320B0(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p SpriteGfxHandler_UnloadAnimObjById(param1->unk_14.unk_08, 100000); if (param0->unk_04) { - sub_0200D0F4(param0->unk_04); + CellActorData_Delete(param0->unk_04); param0->unk_04 = NULL; } } @@ -582,16 +582,16 @@ static void ov62_022320EC(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p v6 = param1->unk_14.unk_08; v7 = param1->unk_14.unk_14; - v4 = sub_0200CD7C(v7, 2, v5, v6, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + v4 = SpriteRenderer_LoadPalette(v7, 2, v5, v6, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); { int v9 = PokeIcon64KCellsFileIndex(); - sub_0200CE0C(v5, v6, 19, v9, 0, 100000); + SpriteRenderer_LoadCellResObj(v5, v6, 19, v9, 0, 100000); } { int v10 = PokeIcon64KAnimationFileIndex(); - sub_0200CE3C(v5, v6, 19, v10, 0, 100000); + SpriteRenderer_LoadAnimResObj(v5, v6, 19, v10, 0, 100000); } { @@ -625,17 +625,17 @@ static void ov62_022320EC(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p v8.resources[4] = SPRITE_RESOURCE_NONE; v8.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_04 = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v8); + param0->unk_04 = CellActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v8); v2 = PokeIconPaletteIndex(v1, v3, v0); - sub_0200D430(param0->unk_04, v4 + v2); - sub_0200D364(param0->unk_04, 1); + CellActorData_SetExplicitPaletteOffset(param0->unk_04, v4 + v2); + CellActorData_SetAnim(param0->unk_04, 1); } } static void ov62_022321F4(UnkStruct_ov62_022323B8 *param0, int param1) { - SpriteActor_EnableObject(param0->unk_08, param1); + CellActorData_DrawSprite(param0->unk_08, param1); } static void ov62_02232200(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *param1) @@ -644,7 +644,7 @@ static void ov62_02232200(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p SpriteGfxHandler_UnloadPlttObjById(param1->unk_14.unk_08, 165535); SpriteGfxHandler_UnloadCellObjById(param1->unk_14.unk_08, 165535); SpriteGfxHandler_UnloadAnimObjById(param1->unk_14.unk_08, 165535); - sub_0200D0F4(param0->unk_08); + CellActorData_Delete(param0->unk_08); } static const int Unk_ov62_02248AD8[16][4] = { @@ -719,9 +719,9 @@ static void ov62_0223226C(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p v6 = ov62_02232234(v9, 3); } - sub_0200CD7C(v3, 2, v1, v2, 146, v5, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 165535); - sub_0200CE0C(v1, v2, 146, v7, 0, 165535); - sub_0200CE3C(v1, v2, 146, v8, 0, 165535); + SpriteRenderer_LoadPalette(v3, 2, v1, v2, 146, v5, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 165535); + SpriteRenderer_LoadCellResObj(v1, v2, 146, v7, 0, 165535); + SpriteRenderer_LoadAnimResObj(v1, v2, 146, v8, 0, 165535); sub_0200D888(v1, v2, 146, v6, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 165535); v4.x = 40; @@ -740,9 +740,9 @@ static void ov62_0223226C(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p v4.resources[4] = SPRITE_RESOURCE_NONE; v4.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_08 = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); - sub_0200D364(param0->unk_08, 1); - sub_0200D330(param0->unk_08); + param0->unk_08 = CellActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); + CellActorData_SetAnim(param0->unk_08, 1); + CellActorData_UpdateObject(param0->unk_08); } void ov62_02232378(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *param1) @@ -1743,23 +1743,23 @@ void ov62_0223331C(UnkStruct_ov62_02233310 *param0, UnkStruct_0208C06C *param1, v1.resources[1] = 10000; } - param0->unk_2C[0] = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); - param0->unk_2C[1] = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); + param0->unk_2C[0] = CellActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); + param0->unk_2C[1] = CellActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); - sub_0200D41C(param0->unk_2C[0], 2); - sub_0200D41C(param0->unk_2C[1], 2); - sub_0200D364(param0->unk_2C[0], 0); - sub_0200D364(param0->unk_2C[1], 0); - sub_0200D330(param0->unk_2C[0]); - sub_0200D330(param0->unk_2C[1]); + CellActorData_SetExplicitPalette(param0->unk_2C[0], 2); + CellActorData_SetExplicitPalette(param0->unk_2C[1], 2); + CellActorData_SetAnim(param0->unk_2C[0], 0); + CellActorData_SetAnim(param0->unk_2C[1], 0); + CellActorData_UpdateObject(param0->unk_2C[0]); + CellActorData_UpdateObject(param0->unk_2C[1]); sub_0200D7D4(param0->unk_2C[1], 2); if (param2 == 1) { - SpriteActor_SetSpritePositionXY(param0->unk_2C[0], 256 / 2, 24); - SpriteActor_SetSpritePositionXY(param0->unk_2C[1], 256 / 2, 120); + CellActorData_SetPositionXY(param0->unk_2C[0], 256 / 2, 24); + CellActorData_SetPositionXY(param0->unk_2C[1], 256 / 2, 120); } else { - SpriteActor_SetSpritePositionXY(param0->unk_2C[0], 256 / 2, 24 + 64); - SpriteActor_SetSpritePositionXY(param0->unk_2C[1], 256 / 2, 120 + 64); + CellActorData_SetPositionXY(param0->unk_2C[0], 256 / 2, 24 + 64); + CellActorData_SetPositionXY(param0->unk_2C[1], 256 / 2, 120 + 64); } ov62_02233454(param0); @@ -1767,47 +1767,47 @@ void ov62_0223331C(UnkStruct_ov62_02233310 *param0, UnkStruct_0208C06C *param1, void ov62_02233434(UnkStruct_ov62_02233310 *param0, s16 param1, s16 param2) { - SpriteActor_SetSpritePositionXY(param0->unk_2C[0], 256 / 2, param1); - SpriteActor_SetSpritePositionXY(param0->unk_2C[1], 256 / 2, param2); + CellActorData_SetPositionXY(param0->unk_2C[0], 256 / 2, param1); + CellActorData_SetPositionXY(param0->unk_2C[1], 256 / 2, param2); } void ov62_02233454(UnkStruct_ov62_02233310 *param0) { - SpriteActor_EnableObject(param0->unk_2C[0], 1); - SpriteActor_EnableObject(param0->unk_2C[1], 1); + CellActorData_DrawSprite(param0->unk_2C[0], 1); + CellActorData_DrawSprite(param0->unk_2C[1], 1); if (param0->unk_08 == 0) { - SpriteActor_EnableObject(param0->unk_2C[0], 0); + CellActorData_DrawSprite(param0->unk_2C[0], 0); } if (param0->unk_08 + param0->unk_10 >= param0->unk_04) { - SpriteActor_EnableObject(param0->unk_2C[1], 0); + CellActorData_DrawSprite(param0->unk_2C[1], 0); } - sub_0200D33C(param0->unk_2C[0]); - sub_0200D33C(param0->unk_2C[1]); + CellActorData_Update2Frames(param0->unk_2C[0]); + CellActorData_Update2Frames(param0->unk_2C[1]); } void ov62_0223349C(UnkStruct_ov62_02233310 *param0) { - SpriteActor_EnableObject(param0->unk_2C[0], 1); - SpriteActor_EnableObject(param0->unk_2C[1], 1); + CellActorData_DrawSprite(param0->unk_2C[0], 1); + CellActorData_DrawSprite(param0->unk_2C[1], 1); if (param0->unk_08 == 0) { - SpriteActor_EnableObject(param0->unk_2C[0], 0); + CellActorData_DrawSprite(param0->unk_2C[0], 0); } if (param0->unk_08 + param0->unk_10 >= param0->unk_04) { - SpriteActor_EnableObject(param0->unk_2C[1], 0); + CellActorData_DrawSprite(param0->unk_2C[1], 0); } if (param0->unk_10 >= param0->unk_04) { - SpriteActor_EnableObject(param0->unk_2C[0], 0); - SpriteActor_EnableObject(param0->unk_2C[1], 0); + CellActorData_DrawSprite(param0->unk_2C[0], 0); + CellActorData_DrawSprite(param0->unk_2C[1], 0); } - sub_0200D33C(param0->unk_2C[0]); - sub_0200D33C(param0->unk_2C[1]); + CellActorData_Update2Frames(param0->unk_2C[0]); + CellActorData_Update2Frames(param0->unk_2C[1]); } void ov62_022334FC(UnkStruct_ov62_02233310 *param0, UnkStruct_0208C06C *param1) @@ -1815,8 +1815,8 @@ void ov62_022334FC(UnkStruct_ov62_02233310 *param0, UnkStruct_0208C06C *param1) SpriteGfxHandler_UnloadCharObjById(param1->unk_14.unk_08, 200000); SpriteGfxHandler_UnloadCellObjById(param1->unk_14.unk_08, 200000); SpriteGfxHandler_UnloadAnimObjById(param1->unk_14.unk_08, 200000); - sub_0200D0F4(param0->unk_2C[0]); - sub_0200D0F4(param0->unk_2C[1]); + CellActorData_Delete(param0->unk_2C[0]); + CellActorData_Delete(param0->unk_2C[1]); } static CellActorData *ov62_0223352C(UnkStruct_ov62_0223359C *param0, UnkStruct_0208C06C *param1, int param2, int param3) @@ -1845,18 +1845,18 @@ static CellActorData *ov62_0223352C(UnkStruct_ov62_0223359C *param0, UnkStruct_0 v1.resources[1] = 10000; } - v0 = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); - sub_0200D41C(v0, 2); - sub_0200D364(v0, param3); - sub_0200D330(v0); + v0 = CellActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); + CellActorData_SetExplicitPalette(v0, 2); + CellActorData_SetAnim(v0, param3); + CellActorData_UpdateObject(v0); return v0; } static void ov62_0223359C(UnkStruct_ov62_0223359C *param0) { - sub_0200D0F4(param0->unk_18[0]); - sub_0200D0F4(param0->unk_18[1]); + CellActorData_Delete(param0->unk_18[0]); + CellActorData_Delete(param0->unk_18[1]); } void ov62_022335B0(UnkStruct_ov62_0223359C *param0, UnkStruct_0208C06C *param1) @@ -1869,8 +1869,8 @@ void ov62_022335BC(UnkStruct_ov62_0223359C *param0, UnkStruct_0208C06C *param1, param0->unk_18[0] = ov62_0223352C(param0, param1, 2, param2); param0->unk_18[1] = ov62_0223352C(param0, param1, 2, param2); - SpriteActor_SetSpritePositionXY(param0->unk_18[0], 0 + 24, 72 + 64); - SpriteActor_SetSpritePositionXY(param0->unk_18[1], 256 - 24, 72 + 64); + CellActorData_SetPositionXY(param0->unk_18[0], 0 + 24, 72 + 64); + CellActorData_SetPositionXY(param0->unk_18[1], 256 - 24, 72 + 64); } void ov62_022335F4(UnkStruct_ov62_0223359C *param0) @@ -1931,8 +1931,8 @@ void ov62_02233664(UnkStruct_ov62_0223359C *param0) v3 = TouchScreen_GetHoldState(&v0, &v1); if (param0->unk_14) { - sub_0200D33C(param0->unk_18[0]); - sub_0200D33C(param0->unk_18[1]); + CellActorData_Update2Frames(param0->unk_18[0]); + CellActorData_Update2Frames(param0->unk_18[1]); } if ((param0->unk_04 == 0) && (v3 == 0)) { @@ -2033,7 +2033,7 @@ static void ov62_02233798(SysTask *param0, void *param1) v0->unk_14.unk_510 = 1; sub_02008A94(v0->unk_14.unk_50); - sub_0200C7EC(v0->unk_14.unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_14.unk_08); OAMManager_ApplyAndResetBuffers(); v0->unk_14.unk_510 = 0; @@ -2164,9 +2164,9 @@ void ov62_022339DC(UnkStruct_0208C06C *param0) v1 = param0->unk_14.unk_08; v2 = param0->unk_14.unk_14; - sub_0200CD7C(v2, 2, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); - sub_0200CE0C(v0, v1, 19, PokeIcon64KCellsFileIndex(), 0, 100000); - sub_0200CE3C(v0, v1, 19, PokeIcon64KAnimationFileIndex(), 0, 100000); + SpriteRenderer_LoadPalette(v2, 2, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + SpriteRenderer_LoadCellResObj(v0, v1, 19, PokeIcon64KCellsFileIndex(), 0, 100000); + SpriteRenderer_LoadAnimResObj(v0, v1, 19, PokeIcon64KAnimationFileIndex(), 0, 100000); } void ov62_02233A44(UnkStruct_0208C06C *param0) @@ -2224,12 +2224,12 @@ CellActorData *ov62_02233A7C(UnkStruct_0208C06C *param0, NARC *param1, int param v4.resources[4] = SPRITE_RESOURCE_NONE; v4.resources[5] = SPRITE_RESOURCE_NONE; - v0 = SpriteActor_LoadResources(v1, v2, &v4); + v0 = CellActor_LoadResources(v1, v2, &v4); v5 = PokeIconPaletteIndex(param3, param4, param5); - sub_0200D430(v0, 4 + v5); - sub_0200D364(v0, 1); - sub_0200D330(v0); + CellActorData_SetExplicitPaletteOffset(v0, 4 + v5); + CellActorData_SetAnim(v0, 1); + CellActorData_UpdateObject(v0); return v0; } @@ -2243,7 +2243,7 @@ void ov62_02233B24(UnkStruct_0208C06C *param0, int param1, CellActorData *param2 } SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 100000 + param1); - sub_0200D0F4(param2); + CellActorData_Delete(param2); } void ov62_02233B40(UnkStruct_0208C06C *param0, int param1, CellActorData *param2) @@ -2254,7 +2254,7 @@ void ov62_02233B40(UnkStruct_0208C06C *param0, int param1, CellActorData *param2 return; } - sub_0200D0F4(param2); + CellActorData_Delete(param2); } static void ov62_02233B50(UnkStruct_ov62_02233F74 *param0, UnkStruct_0208C06C *param1) @@ -2513,16 +2513,16 @@ static void ov62_02234000(UnkStruct_ov62_02233F74 *param0, UnkStruct_0208C06C *p v11 = param1->unk_14.unk_08; v12 = param1->unk_14.unk_14; - sub_0200CD7C(v12, 2, v10, v11, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + SpriteRenderer_LoadPalette(v12, 2, v10, v11, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); { int v14 = PokeIcon64KCellsFileIndex(); - sub_0200CE0C(v10, v11, 19, v14, 0, 100000); + SpriteRenderer_LoadCellResObj(v10, v11, 19, v14, 0, 100000); } { int v15 = PokeIcon64KAnimationFileIndex(); - sub_0200CE3C(v10, v11, 19, v15, 0, 100000); + SpriteRenderer_LoadAnimResObj(v10, v11, 19, v15, 0, 100000); } { @@ -2597,13 +2597,13 @@ static void ov62_02234000(UnkStruct_ov62_02233F74 *param0, UnkStruct_0208C06C *p v4.resources[4] = SPRITE_RESOURCE_NONE; v4.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_0C[v3] = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); + param0->unk_0C[v3] = CellActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); v5 = PokeIconPaletteIndex(v1, v2, 0); - sub_0200D430(param0->unk_0C[v3], 4 + v5); - sub_0200D364(param0->unk_0C[v3], 1); - sub_0200D330(param0->unk_0C[v3]); - sub_0200D474(param0->unk_0C[v3], 12 - v0); + CellActorData_SetExplicitPaletteOffset(param0->unk_0C[v3], 4 + v5); + CellActorData_SetAnim(param0->unk_0C[v3], 1); + CellActorData_UpdateObject(param0->unk_0C[v3]); + CellActorData_SetPriority(param0->unk_0C[v3], 12 - v0); v3++; } } @@ -2625,7 +2625,7 @@ void ov62_02234228(UnkStruct_ov62_02233F74 *param0, UnkStruct_0208C06C *param1) for (v0 = 0; v0 < 12; v0++) { if (param0->unk_0C[v0]) { SpriteGfxHandler_UnloadCharObjById(param1->unk_14.unk_08, 100000 + v0); - sub_0200D0F4(param0->unk_0C[v0]); + CellActorData_Delete(param0->unk_0C[v0]); param0->unk_0C[v0] = NULL; } } @@ -2639,7 +2639,7 @@ void ov62_0223427C(UnkStruct_ov62_02233F74 *param0, int param1) for (v0 = 0; v0 < 12; v0++) { if (param0->unk_0C[v0]) { - SpriteActor_EnableObject(param0->unk_0C[v0], param1); + CellActorData_DrawSprite(param0->unk_0C[v0], param1); } } } @@ -2796,16 +2796,16 @@ void ov62_0223454C(UnkStruct_0208C06C *param0, UnkStruct_ov62_022312B0 *param1, ov62_0223118C(param1, ¶m0->unk_14, param2); ov62_0223124C(param1, ¶m0->unk_14, param3); - SpriteActor_SetSpritePositionXY(param1->unk_08, param4, param5); + CellActorData_SetPositionXY(param1->unk_08, param4, param5); sub_020128C4(param1->unk_0C, param6, param7); sub_020129D0(param1->unk_0C, param9); - sub_0200D364(param1->unk_08, param8); + CellActorData_SetAnim(param1->unk_08, param8); } void ov62_022345A8(UnkStruct_ov62_022312B0 *param0) { ov62_022312B0(param0); - sub_0200D0F4(param0->unk_08); + CellActorData_Delete(param0->unk_08); } int ov62_022345B8(UnkStruct_0208C06C *param0, int param1, int param2, int param3) diff --git a/src/overlay062/ov62_02234A10.c b/src/overlay062/ov62_02234A10.c index efaa04e172..0b976ad41e 100644 --- a/src/overlay062/ov62_02234A10.c +++ b/src/overlay062/ov62_02234A10.c @@ -17,11 +17,11 @@ #include "heap.h" #include "message.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_0201D15C.h" diff --git a/src/overlay062/ov62_02235278.c b/src/overlay062/ov62_02235278.c index e2e8ff1143..d33d6f296a 100644 --- a/src/overlay062/ov62_02235278.c +++ b/src/overlay062/ov62_02235278.c @@ -16,11 +16,11 @@ #include "gx_layers.h" #include "heap.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_0208B284.h" @@ -303,10 +303,10 @@ static BOOL ov62_02235580(UnkStruct_0208C06C *param0) v5->unk_04 = v5->unk_00; v5->unk_06 = (25 + (36 * (5 - 1))); - sub_0200D364(param0->unk_534.unk_00[v4].unk_00, param0->unk_818[param0->unk_534.unk_1B0].unk_0C); + CellActorData_SetAnim(param0->unk_534.unk_00[v4].unk_00, param0->unk_818[param0->unk_534.unk_1B0].unk_0C); ov62_02230FC8(param0, ¶m0->unk_534.unk_00[param0->unk_534.unk_1A4], param0->unk_818[param0->unk_534.unk_1B0].unk_08, ¶m0->unk_818[param0->unk_534.unk_1B0]); sub_020129D0(param0->unk_534.unk_00[param0->unk_534.unk_1A4].unk_14, 1); - SpriteActor_EnableObject(param0->unk_534.unk_00[v4].unk_00, 1); + CellActorData_DrawSprite(param0->unk_534.unk_00[v4].unk_00, 1); } else { v5->unk_04 = v5->unk_00 - 4; v5->unk_06 = (16 * (param0->unk_534.unk_1A4 - v4)) + (25 + (36 * (5 - (param0->unk_534.unk_1A4 - v4) - 1))); @@ -324,9 +324,9 @@ static BOOL ov62_02235580(UnkStruct_0208C06C *param0) for (v4 = 0; v4 < param0->unk_534.unk_1A4; v4++) { if (v4 == param0->unk_534.unk_1A4) { - sub_0200D430(param0->unk_534.unk_00[v4].unk_00, (2 - 1)); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v4].unk_00, (2 - 1)); } else { - sub_0200D430(param0->unk_534.unk_00[v4].unk_00, (3 - 1)); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v4].unk_00, (3 - 1)); } } } @@ -432,9 +432,9 @@ static BOOL ov62_02235854(UnkStruct_0208C06C *param0) for (v3 = 0; v3 < param0->unk_534.unk_1A4; v3++) { if (v3 == param0->unk_534.unk_1A4 - 1) { - sub_0200D430(param0->unk_534.unk_00[v3].unk_00, (2 - 1)); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v3].unk_00, (2 - 1)); } else { - sub_0200D430(param0->unk_534.unk_00[v3].unk_00, (3 - 1)); + CellActorData_SetExplicitPaletteOffset(param0->unk_534.unk_00[v3].unk_00, (3 - 1)); } } } diff --git a/src/overlay062/ov62_02235E64.c b/src/overlay062/ov62_02235E64.c index 0db7476d43..191ee78d79 100644 --- a/src/overlay062/ov62_02235E64.c +++ b/src/overlay062/ov62_02235E64.c @@ -20,10 +20,10 @@ #include "message.h" #include "palette.h" #include "savedata.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "text.h" #include "touch_screen.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02023FCC.h" @@ -738,8 +738,8 @@ static void ov62_02236C20(UnkStruct_0208C06C *param0) ov62_0223118C(&v0->unk_158[0], ¶m0->unk_14, NNS_G2D_VRAM_TYPE_2DSUB); ov62_0223124C(&v0->unk_158[0], ¶m0->unk_14, 3); - sub_0200D364(v0->unk_158[0].unk_08, 0); - SpriteActor_SetSpritePositionXY(v0->unk_158[0].unk_08, 80, 232); + CellActorData_SetAnim(v0->unk_158[0].unk_08, 0); + CellActorData_SetPositionXY(v0->unk_158[0].unk_08, 80, 232); sub_020128C4(v0->unk_158[0].unk_0C, 36, -8); sub_020129D0(v0->unk_158[0].unk_0C, 1); } @@ -749,6 +749,6 @@ static void ov62_02236C94(UnkStruct_0208C06C *param0) UnkStruct_ov62_02235E64 *v0 = param0->unk_860; ov62_022312B0(&v0->unk_158[0]); - sub_0200D0F4(v0->unk_158[0].unk_08); + CellActorData_Delete(v0->unk_158[0].unk_08); ov62_022313BC(param0); } diff --git a/src/overlay062/ov62_02236CBC.c b/src/overlay062/ov62_02236CBC.c index 85b5a909a8..49bfe83b91 100644 --- a/src/overlay062/ov62_02236CBC.c +++ b/src/overlay062/ov62_02236CBC.c @@ -20,9 +20,9 @@ #include "heap.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_0201D15C.h" #include "unk_0202D05C.h" @@ -75,9 +75,9 @@ static void ov62_02236CBC(UnkStruct_0208C06C *param0, int param1) UnkStruct_ov62_02236CBC *v0 = param0->unk_860; if (param1 == 0) { - SpriteActor_SetSpritePositionXY(v0->unk_9C[1].unk_08, 128, 232); + CellActorData_SetPositionXY(v0->unk_9C[1].unk_08, 128, 232); } else { - SpriteActor_SetSpritePositionXY(v0->unk_9C[1].unk_08, 80, 232); + CellActorData_SetPositionXY(v0->unk_9C[1].unk_08, 80, 232); } sub_020128C4(v0->unk_9C[1].unk_0C, 36, -8); @@ -107,15 +107,15 @@ static void ov62_02236D48(UnkStruct_0208C06C *param0) ov62_0223118C(&v0->unk_9C[1], ¶m0->unk_14, NNS_G2D_VRAM_TYPE_2DSUB); ov62_0223124C(&v0->unk_9C[1], ¶m0->unk_14, 3); - SpriteActor_SetSpritePositionXY(v0->unk_9C[1].unk_08, 128, 232); + CellActorData_SetPositionXY(v0->unk_9C[1].unk_08, 128, 232); sub_020128C4(v0->unk_9C[1].unk_0C, 36, -8); sub_020129D0(v0->unk_9C[1].unk_0C, 1); v0->unk_94[1] = ov62_022313E0(param0, NNS_G2D_VRAM_TYPE_2DSUB); - SpriteActor_SetSpritePositionXY(v0->unk_94[1], 220, 160 + 64); - sub_0200D364(v0->unk_94[1], 2); - SpriteActor_EnableObject(v0->unk_94[1], 0); + CellActorData_SetPositionXY(v0->unk_94[1], 220, 160 + 64); + CellActorData_SetAnim(v0->unk_94[1], 2); + CellActorData_DrawSprite(v0->unk_94[1], 0); ov62_02236CBC(param0, 1); } @@ -125,8 +125,8 @@ static void ov62_02236DE8(UnkStruct_0208C06C *param0) UnkStruct_ov62_02236CBC *v0 = param0->unk_860; ov62_022312B0(&v0->unk_9C[1]); - sub_0200D0F4(v0->unk_9C[1].unk_08); - sub_0200D0F4(v0->unk_94[1]); + CellActorData_Delete(v0->unk_9C[1].unk_08); + CellActorData_Delete(v0->unk_94[1]); ov62_022313BC(param0); } @@ -141,11 +141,11 @@ static void ov62_02236E14(UnkStruct_0208C06C *param0) Graphics_LoadTilesToBgLayerFromOpenNARC(param0->unk_14.unk_00, 62, param0->unk_14.unk_10, 6, 0, 0, 0, 102); Graphics_LoadTilemapToBgLayerFromOpenNARC(v1, 68, v2, 6, 0, 0, 0, 102); - SpriteRenderer_LoadPalette(v5, 3, v3, v4, v1, ov62_02231710(param0, 0), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 29292); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 3, v3, v4, v1, ov62_02231710(param0, 0), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 29292); SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v1, 66, 0, NNS_G2D_VRAM_TYPE_2DSUB, 29292); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v1, 71, 0, 29292); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v1, 72, 0, 29292); - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v1, ov62_02231710(param0, 1), 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 28282); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v1, ov62_02231710(param0, 1), 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 28282); SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v1, 64, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 28282); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v1, 38, 0, 28282); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v1, 39, 0, 28282); @@ -159,16 +159,16 @@ static void ov62_02236E14(UnkStruct_0208C06C *param0) for (v6 = 0; v6 < 5; v6++) { if (v6 == 3) { - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v1, 92, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v1, 92, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v1, 91, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); } else { - sub_0200CD7C(v5, 2, v3, v4, 146, v7[v6], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, 146, v7[v6], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); sub_0200D888(v3, v4, 146, v8[v6], 0, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); } } - sub_0200CE0C(v3, v4, 146, v9, 0, 18181); - sub_0200CE3C(v3, v4, 146, v10, 0, 18181); + SpriteRenderer_LoadCellResObj(v3, v4, 146, v9, 0, 18181); + SpriteRenderer_LoadAnimResObj(v3, v4, 146, v10, 0, 18181); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v1, 89, 0, 18181 + 1); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v1, 90, 0, 18181 + 1); } @@ -189,9 +189,9 @@ static void ov62_02236E14(UnkStruct_0208C06C *param0) v12 = 16; } - sub_0200CD7C(v5, 2, v3, v4, 146, v11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 165535); - sub_0200CE0C(v3, v4, 146, v13, 0, 165535); - sub_0200CE3C(v3, v4, 146, v14, 0, 165535); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, 146, v11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 165535); + SpriteRenderer_LoadCellResObj(v3, v4, 146, v13, 0, 165535); + SpriteRenderer_LoadAnimResObj(v3, v4, 146, v14, 0, 165535); sub_0200D888(v3, v4, 146, v12, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 165535); } } @@ -284,9 +284,9 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) v9.resources[3] = 165535; for (v0 = 0; v0 < 5; v0++) { - v4->unk_40[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); - sub_0200D364(v4->unk_40[v0], 1); - sub_0200D330(v4->unk_40[v0]); + v4->unk_40[v0] = CellActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + CellActorData_SetAnim(v4->unk_40[v0], 1); + CellActorData_UpdateObject(v4->unk_40[v0]); sub_0200D6E8(v4->unk_40[v0], v4->unk_04[v0], v4->unk_04[v0]); } @@ -302,17 +302,17 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) v9.resources[3] = 18181; } - v4->unk_54[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + v4->unk_54[v0] = CellActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); if (v0 == 3) { - sub_0200D364(v4->unk_54[v0], 0); + CellActorData_SetAnim(v4->unk_54[v0], 0); } else { - sub_0200D364(v4->unk_54[v0], 1); + CellActorData_SetAnim(v4->unk_54[v0], 1); } - sub_0200D330(v4->unk_54[v0]); + CellActorData_UpdateObject(v4->unk_54[v0]); sub_0200D6E8(v4->unk_54[v0], v4->unk_04[v0], v4->unk_04[v0]); - sub_0200D41C(v4->unk_54[v0], 10 + v0); + CellActorData_SetExplicitPalette(v4->unk_54[v0], 10 + v0); } v9.resources[0] = 28282; @@ -334,21 +334,21 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) } for (v0 = 0; v0 < 5; v0++) { - v4->unk_68[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + v4->unk_68[v0] = CellActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); if (v3[v0] == 0) { - sub_0200D364(v4->unk_68[v0], 5); - sub_0200D41C(v4->unk_68[v0], 4 + 5); - SpriteActor_EnableObject(v4->unk_54[v0], 0); - SpriteActor_EnableObject(v4->unk_40[v0], 0); + CellActorData_SetAnim(v4->unk_68[v0], 5); + CellActorData_SetExplicitPalette(v4->unk_68[v0], 4 + 5); + CellActorData_DrawSprite(v4->unk_54[v0], 0); + CellActorData_DrawSprite(v4->unk_40[v0], 0); } else { int v11[] = { 0, 1, 4, 3, 2 }; - sub_0200D364(v4->unk_68[v0], v11[v0]); - sub_0200D41C(v4->unk_68[v0], 4 + v11[v0]); + CellActorData_SetAnim(v4->unk_68[v0], v11[v0]); + CellActorData_SetExplicitPalette(v4->unk_68[v0], 4 + v11[v0]); } - sub_0200D330(v4->unk_68[v0]); + CellActorData_UpdateObject(v4->unk_68[v0]); sub_0200D6E8(v4->unk_68[v0], v4->unk_04[v0], v4->unk_04[v0]); } @@ -382,21 +382,21 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) } for (v0 = 0; v0 < 4 + 1; v0++) { - v4->unk_7C[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + v4->unk_7C[v0] = CellActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); if (v2[v0] == 0) { if (v0 < v1) { - SpriteActor_EnableObject(v4->unk_7C[v0], 0); + CellActorData_DrawSprite(v4->unk_7C[v0], 0); } } - sub_0200D364(v4->unk_7C[v0], v2[v0]); + CellActorData_SetAnim(v4->unk_7C[v0], v2[v0]); ov62_02230E68(v4->unk_7C[v0], 88 + (16 * v0), 72); - sub_0200D330(v4->unk_7C[v0]); + CellActorData_UpdateObject(v4->unk_7C[v0]); } - SpriteActor_EnableObject(v4->unk_7C[4 - 1], 1); - SpriteActor_EnableObject(v4->unk_7C[4 - 0], 1); + CellActorData_DrawSprite(v4->unk_7C[4 - 1], 1); + CellActorData_DrawSprite(v4->unk_7C[4 - 0], 1); for (v0 = 0; v0 < 5; v0++) { sub_0200D6A4(v4->unk_40[v0], 2); @@ -413,7 +413,7 @@ static void ov62_022374A8(UnkStruct_0208C06C *param0) for (v0 = 0; v0 < 5; v0++) { SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 18181 + v0); SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_08, 18181 + v0); - sub_0200D0F4(v1->unk_54[v0]); + CellActorData_Delete(v1->unk_54[v0]); } SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 18181); @@ -422,7 +422,7 @@ static void ov62_022374A8(UnkStruct_0208C06C *param0) SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 18181 + 1); for (v0 = 0; v0 < 5; v0++) { - sub_0200D0F4(v1->unk_40[v0]); + CellActorData_Delete(v1->unk_40[v0]); } SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 165535); @@ -431,7 +431,7 @@ static void ov62_022374A8(UnkStruct_0208C06C *param0) SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 165535); for (v0 = 0; v0 < 5; v0++) { - sub_0200D0F4(v1->unk_68[v0]); + CellActorData_Delete(v1->unk_68[v0]); } SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 28282); @@ -440,7 +440,7 @@ static void ov62_022374A8(UnkStruct_0208C06C *param0) SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 28282); for (v0 = 0; v0 < 4 + 1; v0++) { - sub_0200D0F4(v1->unk_7C[v0]); + CellActorData_Delete(v1->unk_7C[v0]); } SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 29292); @@ -478,8 +478,8 @@ static BOOL ov62_022375A4(UnkStruct_0208C06C *param0) sub_0200D614(v0->unk_68[v1], v4, v5); SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v2, &v3); - SpriteActor_SetSpritePositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); - SpriteActor_SetSpritePositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); + CellActorData_SetPositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); + CellActorData_SetPositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); sub_0200D6E8(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); @@ -518,9 +518,9 @@ static BOOL ov62_022376C4(UnkStruct_0208C06C *param0) if (v0->unk_2C[0] != 0) { v0->unk_04[v1] -= 0.05f; } else { - SpriteActor_EnableObject(v0->unk_68[v1], 0); - SpriteActor_EnableObject(v0->unk_40[v1], 0); - SpriteActor_EnableObject(v0->unk_54[v1], 0); + CellActorData_DrawSprite(v0->unk_68[v1], 0); + CellActorData_DrawSprite(v0->unk_40[v1], 0); + CellActorData_DrawSprite(v0->unk_54[v1], 0); } v4 = (128 << FX32_SHIFT) - sub_0201D250(v0->unk_2C[v1]) * v0->unk_18[v1]; @@ -528,8 +528,8 @@ static BOOL ov62_022376C4(UnkStruct_0208C06C *param0) sub_0200D614(v0->unk_68[v1], v4, v5); SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v2, &v3); - SpriteActor_SetSpritePositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); - SpriteActor_SetSpritePositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); + CellActorData_SetPositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); + CellActorData_SetPositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); sub_0200D6E8(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); @@ -563,8 +563,8 @@ static void ov62_02237814(UnkStruct_0208C06C *param0) sub_0200D614(v0->unk_68[v1], v5, v6); SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v3, &v4); - SpriteActor_SetSpritePositionXY(v0->unk_40[v1], v3 - 32, v4 - 2); - SpriteActor_SetSpritePositionXY(v0->unk_54[v1], v3 + 16, v4 - 2); + CellActorData_SetPositionXY(v0->unk_40[v1], v3 - 32, v4 - 2); + CellActorData_SetPositionXY(v0->unk_54[v1], v3 + 16, v4 - 2); } } diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index 86a579927b..2ac9705d1b 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -37,12 +37,12 @@ #include "heap.h" #include "message.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" @@ -1303,13 +1303,13 @@ static void ov62_0223958C(UnkStruct_0208C06C *param0, int param1) UnkStruct_ov62_02237D24 *v0 = param0->unk_860; if (param1 == 0) { - SpriteActor_EnableObject(v0->unk_198[1].unk_08, 1); + CellActorData_DrawSprite(v0->unk_198[1].unk_08, 1); sub_020129D0(v0->unk_198[1].unk_0C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_198[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_198[0].unk_08, 32, 232); } else { - SpriteActor_EnableObject(v0->unk_198[1].unk_08, 0); + CellActorData_DrawSprite(v0->unk_198[1].unk_08, 0); sub_020129D0(v0->unk_198[1].unk_0C, 0); - SpriteActor_SetSpritePositionXY(v0->unk_198[0].unk_08, 80, 232); + CellActorData_SetPositionXY(v0->unk_198[0].unk_08, 80, 232); } sub_020128C4(v0->unk_198[0].unk_0C, 36, -8); @@ -1330,10 +1330,10 @@ static void ov62_02239608(UnkStruct_0208C06C *param0) ov62_0223124C(&v0->unk_198[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_198[1], ¶m0->unk_14, 53); - sub_0200D364(v0->unk_198[0].unk_08, 0); - sub_0200D364(v0->unk_198[1].unk_08, 4); - SpriteActor_SetSpritePositionXY(v0->unk_198[0].unk_08, 32, 232); - SpriteActor_SetSpritePositionXY(v0->unk_198[1].unk_08, 128, 232); + CellActorData_SetAnim(v0->unk_198[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_198[1].unk_08, 4); + CellActorData_SetPositionXY(v0->unk_198[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_198[1].unk_08, 128, 232); sub_020128C4(v0->unk_198[0].unk_0C, 36, -8); sub_020128C4(v0->unk_198[1].unk_0C, 36, -8); sub_020129D0(v0->unk_198[0].unk_0C, 1); @@ -1349,8 +1349,8 @@ static void ov62_022396E8(UnkStruct_0208C06C *param0) ov62_022312B0(&v0->unk_198[0]); ov62_022312B0(&v0->unk_198[1]); - sub_0200D0F4(v0->unk_198[0].unk_08); - sub_0200D0F4(v0->unk_198[1].unk_08); + CellActorData_Delete(v0->unk_198[0].unk_08); + CellActorData_Delete(v0->unk_198[1].unk_08); ov62_022313BC(param0); } diff --git a/src/overlay062/ov62_02239D60.c b/src/overlay062/ov62_02239D60.c index d90f684982..003370a141 100644 --- a/src/overlay062/ov62_02239D60.c +++ b/src/overlay062/ov62_02239D60.c @@ -42,13 +42,13 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "savedata.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_02023FCC.h" #include "unk_02030A80.h" @@ -577,13 +577,13 @@ static void ov62_0223A4C8(UnkStruct_0208C06C *param0, int param1) UnkStruct_ov62_02239DBC *v0 = param0->unk_860; if (param1 == 0) { - SpriteActor_EnableObject(v0->unk_348[1].unk_08, 1); + CellActorData_DrawSprite(v0->unk_348[1].unk_08, 1); sub_020129D0(v0->unk_348[1].unk_0C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_348[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_348[0].unk_08, 32, 232); } else { - SpriteActor_EnableObject(v0->unk_348[1].unk_08, 0); + CellActorData_DrawSprite(v0->unk_348[1].unk_08, 0); sub_020129D0(v0->unk_348[1].unk_0C, 0); - SpriteActor_SetSpritePositionXY(v0->unk_348[0].unk_08, 80, 232); + CellActorData_SetPositionXY(v0->unk_348[0].unk_08, 80, 232); } sub_020128C4(v0->unk_348[0].unk_0C, 36, -8); @@ -1077,9 +1077,9 @@ static void ov62_0223AE60(UnkStruct_0208C06C *param0) v2 = param0->unk_14.unk_08; v3 = param0->unk_14.unk_14; - sub_0200CD7C(v3, 2, v1, v2, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); - sub_0200CE0C(v1, v2, 19, PokeIcon64KCellsFileIndex(), 0, 100000); - sub_0200CE3C(v1, v2, 19, PokeIcon64KAnimationFileIndex(), 0, 100000); + SpriteRenderer_LoadPalette(v3, 2, v1, v2, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + SpriteRenderer_LoadCellResObj(v1, v2, 19, PokeIcon64KCellsFileIndex(), 0, 100000); + SpriteRenderer_LoadAnimResObj(v1, v2, 19, PokeIcon64KAnimationFileIndex(), 0, 100000); { int v5; @@ -1115,12 +1115,12 @@ static void ov62_0223AE60(UnkStruct_0208C06C *param0) v4.resources[4] = SPRITE_RESOURCE_NONE; v4.resources[5] = SPRITE_RESOURCE_NONE; - v0->unk_2B4[v5] = SpriteActor_LoadResources(v1, v2, &v4); + v0->unk_2B4[v5] = CellActor_LoadResources(v1, v2, &v4); v8 = PokeIconPaletteIndex(v7, v6, v9); - sub_0200D430(v0->unk_2B4[v5], 4 + v8); - sub_0200D364(v0->unk_2B4[v5], 1); - sub_0200D474(v0->unk_2B4[v5], 30 - v5); + CellActorData_SetExplicitPaletteOffset(v0->unk_2B4[v5], 4 + v8); + CellActorData_SetAnim(v0->unk_2B4[v5], 1); + CellActorData_SetPriority(v0->unk_2B4[v5], 30 - v5); } } } @@ -1138,7 +1138,7 @@ static void ov62_0223AFC0(UnkStruct_0208C06C *param0, int param1) continue; } - SpriteActor_EnableObject(v0->unk_2B4[v1], param1); + CellActorData_DrawSprite(v0->unk_2B4[v1], param1); } } @@ -1164,7 +1164,7 @@ static void ov62_0223AFEC(UnkStruct_0208C06C *param0) } SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 100000 + v1); - sub_0200D0F4(v0->unk_2B4[v1]); + CellActorData_Delete(v0->unk_2B4[v1]); v0->unk_2B4[v1] = NULL; } } diff --git a/src/overlay062/ov62_0223CAEC.c b/src/overlay062/ov62_0223CAEC.c index a2e336311c..4ab9ee7bd9 100644 --- a/src/overlay062/ov62_0223CAEC.c +++ b/src/overlay062/ov62_0223CAEC.c @@ -36,7 +36,7 @@ #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" #include "unk_02012744.h" #include "unk_02023FCC.h" #include "unk_02030A80.h" @@ -794,13 +794,13 @@ static void ov62_0223D3A8 (UnkStruct_0208C06C * param0, int param1) UnkStruct_ov62_0223D518 * v0 = param0->unk_860; if (param1 == 0) { - SpriteActor_EnableObject(v0->unk_A4[0].unk_08, 1); + CellActorData_DrawSprite(v0->unk_A4[0].unk_08, 1); sub_020129D0(v0->unk_A4[0].unk_0C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_A4[1].unk_08, 128, 232); + CellActorData_SetPositionXY(v0->unk_A4[1].unk_08, 128, 232); } else { - SpriteActor_EnableObject(v0->unk_A4[0].unk_08, 0); + CellActorData_DrawSprite(v0->unk_A4[0].unk_08, 0); sub_020129D0(v0->unk_A4[0].unk_0C, 0); - SpriteActor_SetSpritePositionXY(v0->unk_A4[1].unk_08, 80, 232); + CellActorData_SetPositionXY(v0->unk_A4[1].unk_08, 80, 232); } sub_020128C4(v0->unk_A4[0].unk_0C, 36, -8); @@ -821,8 +821,8 @@ static void ov62_0223D424 (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_A4[0], ¶m0->unk_14, 53); ov62_0223124C(&v0->unk_A4[1], ¶m0->unk_14, 3); - SpriteActor_SetSpritePositionXY(v0->unk_A4[0].unk_08, 32, 232); - SpriteActor_SetSpritePositionXY(v0->unk_A4[1].unk_08, 128, 232); + CellActorData_SetPositionXY(v0->unk_A4[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_A4[1].unk_08, 128, 232); sub_020128C4(v0->unk_A4[0].unk_0C, 36, -8); sub_020128C4(v0->unk_A4[1].unk_0C, 36, -8); sub_020129D0(v0->unk_A4[0].unk_0C, 0); @@ -838,8 +838,8 @@ static void ov62_0223D4E4 (UnkStruct_0208C06C * param0) ov62_022312B0(&v0->unk_A4[0]); ov62_022312B0(&v0->unk_A4[1]); - sub_0200D0F4(v0->unk_A4[0].unk_08); - sub_0200D0F4(v0->unk_A4[1].unk_08); + CellActorData_Delete(v0->unk_A4[0].unk_08); + CellActorData_Delete(v0->unk_A4[1].unk_08); ov62_022313BC(param0); } diff --git a/src/overlay062/ov62_0223DFA8.c b/src/overlay062/ov62_0223DFA8.c index 849f6596ba..1de0654086 100644 --- a/src/overlay062/ov62_0223DFA8.c +++ b/src/overlay062/ov62_0223DFA8.c @@ -36,7 +36,7 @@ #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02023FCC.h" @@ -201,7 +201,7 @@ static void ov62_0223DFA8 (UnkStruct_0208C06C * param0) for (v1 = 0; v1 < 5; v1++) { for (v2 = 0; v2 < 6; v2++) { if (v3->unk_2008.unk_0C[v1][v2].unk_04) { - SpriteActor_SetSpritePositionXY(v3->unk_2008.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); + CellActorData_SetPositionXY(v3->unk_2008.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); } } } @@ -221,10 +221,10 @@ static void ov62_0223E01C (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_114[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_114[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_114[0].unk_08, 0); - sub_0200D364(v0->unk_114[1].unk_08, 3); - SpriteActor_SetSpritePositionXY(v0->unk_114[0].unk_08, 32, 232); - SpriteActor_SetSpritePositionXY(v0->unk_114[1].unk_08, 128, 232); + CellActorData_SetAnim(v0->unk_114[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_114[1].unk_08, 3); + CellActorData_SetPositionXY(v0->unk_114[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_114[1].unk_08, 128, 232); sub_020128C4(v0->unk_114[0].unk_0C, 36, -8); sub_020128C4(v0->unk_114[1].unk_0C, 36, -8); sub_020129D0(v0->unk_114[0].unk_0C, 1); @@ -594,8 +594,8 @@ static BOOL ov62_0223E8BC (UnkStruct_0208C06C * param0) if (param0->unk_86C == 210) { ov62_0223124C(&v0->unk_114[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_114[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_114[0].unk_08, 0); - sub_0200D364(v0->unk_114[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_114[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_114[1].unk_08, 3); } ov62_0224088C(param0); @@ -690,8 +690,8 @@ static BOOL ov62_0223EB28 (UnkStruct_0208C06C * param0) if (param0->unk_86C == 210) { ov62_0223124C(&v0->unk_114[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_114[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_114[0].unk_08, 0); - sub_0200D364(v0->unk_114[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_114[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_114[1].unk_08, 3); } ov62_02240900(param0); @@ -775,8 +775,8 @@ static BOOL ov62_0223ED7C (UnkStruct_0208C06C * param0) if (ov62_022315E0(&v0->unk_00, &v0->unk_04, 1, 0)) { ov62_0223124C(&v0->unk_114[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_114[1], ¶m0->unk_14, 111); - sub_0200D364(v0->unk_114[0].unk_08, 0); - sub_0200D364(v0->unk_114[1].unk_08, 1); + CellActorData_SetAnim(v0->unk_114[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_114[1].unk_08, 1); ov62_0223F0A8(param0, 1); param0->unk_08++; } @@ -867,8 +867,8 @@ static void ov62_0223EF60 (UnkStruct_0208C06C * param0) ov62_0223EE88(&v0->unk_114[v1], param0, v1 + 1); } - SpriteActor_SetSpritePositionXY(v0->unk_114[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); - sub_0200D364(v0->unk_114[v1].unk_08, v3[v1]); + CellActorData_SetPositionXY(v0->unk_114[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); + CellActorData_SetAnim(v0->unk_114[v1].unk_08, v3[v1]); sub_020128C4(v0->unk_114[v1].unk_0C, 36, -8); sub_020129D0(v0->unk_114[v1].unk_0C, 1); } @@ -881,7 +881,7 @@ static void ov62_0223F038 (UnkStruct_0208C06C * param0) for (v1 = 0; v1 < 4; v1++) { ov62_022312B0(&v0->unk_114[v1]); - sub_0200D0F4(v0->unk_114[v1].unk_08); + CellActorData_Delete(v0->unk_114[v1].unk_08); } ov62_022313BC(param0); @@ -893,8 +893,8 @@ static void ov62_0223F06C (UnkStruct_0208C06C * param0) ov62_022312B0(&v0->unk_114[0]); ov62_022312B0(&v0->unk_114[1]); - sub_0200D0F4(v0->unk_114[0].unk_08); - sub_0200D0F4(v0->unk_114[1].unk_08); + CellActorData_Delete(v0->unk_114[0].unk_08); + CellActorData_Delete(v0->unk_114[1].unk_08); ov62_022313BC(param0); } @@ -903,13 +903,13 @@ static void ov62_0223F0A8 (UnkStruct_0208C06C * param0, int param1) UnkStruct_ov62_0223E01C * v0 = param0->unk_860; if (param1 == 0) { - SpriteActor_EnableObject(v0->unk_114[1].unk_08, 1); + CellActorData_DrawSprite(v0->unk_114[1].unk_08, 1); sub_020129D0(v0->unk_114[1].unk_0C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_114[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_114[0].unk_08, 32, 232); } else { - SpriteActor_EnableObject(v0->unk_114[1].unk_08, 0); + CellActorData_DrawSprite(v0->unk_114[1].unk_08, 0); sub_020129D0(v0->unk_114[1].unk_0C, 0); - SpriteActor_SetSpritePositionXY(v0->unk_114[0].unk_08, 80, 232); + CellActorData_SetPositionXY(v0->unk_114[0].unk_08, 80, 232); } sub_020128C4(v0->unk_114[0].unk_0C, 36, -8); @@ -1327,8 +1327,8 @@ static BOOL ov62_0223F984 (UnkStruct_0208C06C * param0) if (v0->unk_1FBC == 6) { ov62_0223124C(&v0->unk_114[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_114[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_114[0].unk_08, 0); - sub_0200D364(v0->unk_114[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_114[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_114[1].unk_08, 3); } param0->unk_08++; @@ -1694,8 +1694,8 @@ static BOOL ov62_02240084 (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_114[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_114[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_114[0].unk_08, 0); - sub_0200D364(v0->unk_114[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_114[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_114[1].unk_08, 3); v0->unk_2008.unk_08 = 500; v0->unk_2008.unk_04 = param0->unk_14.unk_48C.unk_08; @@ -2013,12 +2013,12 @@ asm static BOOL ov62_022403F8 (UnkStruct_0208C06C * param0) lsl r0, r0, #2 ldr r0, [r5, r0] mov r1, #0 - bl sub_0200D364 + bl CellActorData_SetAnim mov r0, #0x4d lsl r0, r0, #2 ldr r0, [r5, r0] mov r1, #3 - bl sub_0200D364 + bl CellActorData_SetAnim _022405F6: add r0, r4, #0 bl ov62_02240900 @@ -2585,7 +2585,7 @@ static void ov62_02240BF4 (UnkStruct_0208C06C * param0) v3->unk_2008.unk_0C[v0][v1].unk_04 = ov62_02233A7C(param0, v3->unk_2008.unk_00, v3->unk_2008.unk_0C[v0][v1].unk_00, v4, v5, v6); if (v3->unk_2008.unk_0C[v0][v1].unk_04) { - sub_0200D474(v3->unk_2008.unk_0C[v0][v1].unk_04, 6 - v1); + CellActorData_SetPriority(v3->unk_2008.unk_0C[v0][v1].unk_04, 6 - v1); } v3->unk_2008.unk_08++; @@ -2603,7 +2603,7 @@ static void ov62_02240D98 (UnkStruct_0208C06C * param0, BOOL param1) for (v0 = 0; v0 < 5; v0++) { for (v1 = 0; v1 < 6; v1++) { if (v2->unk_2008.unk_0C[v0][v1].unk_04) { - SpriteActor_EnableObject(v2->unk_2008.unk_0C[v0][v1].unk_04, param1); + CellActorData_DrawSprite(v2->unk_2008.unk_0C[v0][v1].unk_04, param1); } } } @@ -2733,7 +2733,7 @@ static void ov62_02240E30 (UnkStruct_0208C06C * param0) v5->unk_2008.unk_0C[v2][v1].unk_04 = ov62_02233A7C(param0, v5->unk_2008.unk_00, v5->unk_2008.unk_0C[v2][v1].unk_00, v6, v7, v8); if (v5->unk_2008.unk_0C[v2][v1].unk_04) { - sub_0200D474(v5->unk_2008.unk_0C[v2][v1].unk_04, 6 - v1); + CellActorData_SetPriority(v5->unk_2008.unk_0C[v2][v1].unk_04, 6 - v1); } v5->unk_2008.unk_08++; @@ -2760,7 +2760,7 @@ static void ov62_022410F0 (UnkStruct_0208C06C * param0) ov62_022312B0(&v0->unk_114[0]); ov62_022312B0(&v0->unk_114[1]); - sub_0200D0F4(v0->unk_114[0].unk_08); - sub_0200D0F4(v0->unk_114[1].unk_08); + CellActorData_Delete(v0->unk_114[0].unk_08); + CellActorData_Delete(v0->unk_114[1].unk_08); ov62_022313BC(param0); } diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index 83db14ef1c..39285226a3 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -46,7 +46,7 @@ #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02023FCC.h" @@ -315,7 +315,7 @@ static void ov62_02241204 (UnkStruct_0208C06C * param0) for (v1 = 0; v1 < 5; v1++) { for (v2 = 0; v2 < 6; v2++) { if (v3->unk_50C.unk_0C[v1][v2].unk_04) { - SpriteActor_SetSpritePositionXY(v3->unk_50C.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); + CellActorData_SetPositionXY(v3->unk_50C.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); } } } @@ -394,7 +394,7 @@ static void ov62_02241278 (UnkStruct_0208C06C * param0) v3->unk_50C.unk_0C[v0][v1].unk_04 = ov62_02233A7C(param0, v3->unk_50C.unk_00, v3->unk_50C.unk_0C[v0][v1].unk_00, v8, v9, v10); if (v3->unk_50C.unk_0C[v0][v1].unk_04) { - sub_0200D474(v3->unk_50C.unk_0C[v0][v1].unk_04, 6 - v1); + CellActorData_SetPriority(v3->unk_50C.unk_0C[v0][v1].unk_04, 6 - v1); } v3->unk_50C.unk_08++; @@ -412,7 +412,7 @@ static void ov62_0224141C (UnkStruct_0208C06C * param0, BOOL param1) for (v0 = 0; v0 < 5; v0++) { for (v1 = 0; v1 < 6; v1++) { if (v2->unk_50C.unk_0C[v0][v1].unk_04) { - SpriteActor_EnableObject(v2->unk_50C.unk_0C[v0][v1].unk_04, param1); + CellActorData_DrawSprite(v2->unk_50C.unk_0C[v0][v1].unk_04, param1); } } } @@ -546,7 +546,7 @@ static void ov62_022414C0 (UnkStruct_0208C06C * param0) v5->unk_50C.unk_0C[v2][v1].unk_04 = ov62_02233A7C(param0, v5->unk_50C.unk_00, v5->unk_50C.unk_0C[v2][v1].unk_00, v6, v7, v8); if (v5->unk_50C.unk_0C[v2][v1].unk_04) { - sub_0200D474(v5->unk_50C.unk_0C[v2][v1].unk_04, 6 - v1); + CellActorData_SetPriority(v5->unk_50C.unk_0C[v2][v1].unk_04, 6 - v1); } v5->unk_50C.unk_08++; @@ -1974,8 +1974,8 @@ static BOOL ov62_02242F74 (UnkStruct_0208C06C * param0) if (v0->unk_0C == 17) { ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 3); } param0->unk_08++; @@ -2146,8 +2146,8 @@ static BOOL ov62_02243410 (UnkStruct_0208C06C * param0) if (ov62_022315E0(&v0->unk_00, &v0->unk_04, 1, 0)) { ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 111); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 1); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 1); ov62_02245C08(param0, 1); param0->unk_08++; } @@ -2222,8 +2222,8 @@ static BOOL ov62_02243514 (UnkStruct_0208C06C * param0) if (param0->unk_86C == 210) { ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 3); } ov62_02234540(param0, 0); @@ -2469,8 +2469,8 @@ static BOOL ov62_02243B1C (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 3); v0->unk_4C0 = 0xffff; v0->unk_4C2 = 0xff; @@ -3250,8 +3250,8 @@ static void ov62_02244BE4 (UnkStruct_0208C06C * param0) ov62_022448E0(&v0->unk_10[v1], param0, v1 + 1); } - SpriteActor_SetSpritePositionXY(v0->unk_10[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); - sub_0200D364(v0->unk_10[v1].unk_08, v3[v1]); + CellActorData_SetPositionXY(v0->unk_10[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); + CellActorData_SetAnim(v0->unk_10[v1].unk_08, v3[v1]); sub_020128C4(v0->unk_10[v1].unk_0C, 36, -8); sub_020129D0(v0->unk_10[v1].unk_0C, 1); } @@ -3264,7 +3264,7 @@ static void ov62_02244CA4 (UnkStruct_0208C06C * param0) for (v1 = 0; v1 < 4; v1++) { ov62_022312B0(&v0->unk_10[v1]); - sub_0200D0F4(v0->unk_10[v1].unk_08); + CellActorData_Delete(v0->unk_10[v1].unk_08); } ov62_022313BC(param0); @@ -4022,13 +4022,13 @@ static void ov62_02245AC8 (UnkStruct_0208C06C * param0, int param1) UnkStruct_ov62_02241204 * v0 = param0->unk_860; if (param1 == 0) { - SpriteActor_EnableObject(v0->unk_10[0].unk_08, 1); + CellActorData_DrawSprite(v0->unk_10[0].unk_08, 1); sub_020129D0(v0->unk_10[0].unk_0C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 128, 232 - 64); + CellActorData_SetPositionXY(v0->unk_10[1].unk_08, 128, 232 - 64); } else { - SpriteActor_EnableObject(v0->unk_10[0].unk_08, 0); + CellActorData_DrawSprite(v0->unk_10[0].unk_08, 0); sub_020129D0(v0->unk_10[0].unk_0C, 0); - SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 80, 232 - 64); + CellActorData_SetPositionXY(v0->unk_10[1].unk_08, 80, 232 - 64); } sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); @@ -4049,14 +4049,14 @@ static void ov62_02245B24 (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 111); - SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 32, 232 - 64); - SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 128, 232 - 64); + CellActorData_SetPositionXY(v0->unk_10[0].unk_08, 32, 232 - 64); + CellActorData_SetPositionXY(v0->unk_10[1].unk_08, 128, 232 - 64); sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); sub_020128C4(v0->unk_10[1].unk_0C, 36, -8); sub_020129D0(v0->unk_10[0].unk_0C, 1); sub_020129D0(v0->unk_10[1].unk_0C, 1); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 1); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 1); ov62_02245AC8(param0, 0); } @@ -4068,8 +4068,8 @@ static void ov62_02245BD8 (UnkStruct_0208C06C * param0) ov62_022312B0(&v0->unk_10[0]); ov62_022312B0(&v0->unk_10[1]); - sub_0200D0F4(v0->unk_10[0].unk_08); - sub_0200D0F4(v0->unk_10[1].unk_08); + CellActorData_Delete(v0->unk_10[0].unk_08); + CellActorData_Delete(v0->unk_10[1].unk_08); ov62_022313BC(param0); } @@ -4079,13 +4079,13 @@ static void ov62_02245C08 (UnkStruct_0208C06C * param0, int param1) UnkStruct_ov62_02241204 * v0 = param0->unk_860; if (param1 == 0) { - SpriteActor_EnableObject(v0->unk_10[1].unk_08, 1); + CellActorData_DrawSprite(v0->unk_10[1].unk_08, 1); sub_020129D0(v0->unk_10[1].unk_0C, 1); - SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_10[0].unk_08, 32, 232); } else { - SpriteActor_EnableObject(v0->unk_10[1].unk_08, 0); + CellActorData_DrawSprite(v0->unk_10[1].unk_08, 0); sub_020129D0(v0->unk_10[1].unk_0C, 0); - SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 80, 232); + CellActorData_SetPositionXY(v0->unk_10[0].unk_08, 80, 232); } sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); @@ -4107,17 +4107,17 @@ static void ov62_02245C64 (UnkStruct_0208C06C * param0) if (param0->unk_86C == 210) { ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 111); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 1); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 1); } else { ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 3); } - SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 32, 232); - SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 128, 232); + CellActorData_SetPositionXY(v0->unk_10[0].unk_08, 32, 232); + CellActorData_SetPositionXY(v0->unk_10[1].unk_08, 128, 232); sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); sub_020128C4(v0->unk_10[1].unk_0C, 36, -8); sub_020129D0(v0->unk_10[0].unk_0C, 1); @@ -4133,8 +4133,8 @@ static void ov62_02245D50 (UnkStruct_0208C06C * param0) ov62_022312B0(&v0->unk_10[0]); ov62_022312B0(&v0->unk_10[1]); - sub_0200D0F4(v0->unk_10[0].unk_08); - sub_0200D0F4(v0->unk_10[1].unk_08); + CellActorData_Delete(v0->unk_10[0].unk_08); + CellActorData_Delete(v0->unk_10[1].unk_08); ov62_022313BC(param0); } @@ -4472,8 +4472,8 @@ static BOOL ov62_02246428 (UnkStruct_0208C06C * param0) if (param0->unk_86C == 210) { ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 3); } ov62_022455C4(param0); @@ -4553,8 +4553,8 @@ static BOOL ov62_02246640 (UnkStruct_0208C06C * param0) if (param0->unk_86C == 210) { ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 94); - sub_0200D364(v0->unk_10[0].unk_08, 0); - sub_0200D364(v0->unk_10[1].unk_08, 3); + CellActorData_SetAnim(v0->unk_10[0].unk_08, 0); + CellActorData_SetAnim(v0->unk_10[1].unk_08, 3); } ov62_02245640(param0); diff --git a/src/overlay062/ov62_02246B00.c b/src/overlay062/ov62_02246B00.c index 7a22774005..4a6243313d 100644 --- a/src/overlay062/ov62_02246B00.c +++ b/src/overlay062/ov62_02246B00.c @@ -19,9 +19,9 @@ #include "inlines.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_02023FCC.h" static inline void inline_ov62_02247CE0(UnkStruct_ov62_02246BF4 *param0, int param1, s16 param2, s16 param3); @@ -234,13 +234,13 @@ BOOL ov62_02246DF8(UnkStruct_ov62_02246BF4 *param0) if (param0->unk_00[0].unk_14.unk_04 == 0) { for (v0 = param0->unk_210; v0 < param0->unk_214; v0++) { - sub_0200D364(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); - sub_0200D330(param0->unk_00[v0].unk_0C); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_UpdateObject(param0->unk_00[v0].unk_0C); } for (v0 = param0->unk_218; v0 < param0->unk_21C; v0++) { - sub_0200D364(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); - sub_0200D330(param0->unk_00[v0].unk_0C); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_UpdateObject(param0->unk_00[v0].unk_0C); } param0->unk_1FC++; } @@ -327,7 +327,7 @@ void ov62_022470A8(UnkStruct_ov62_02246BF4 *param0) for (v0 = 0; v0 < param0->unk_204; v0++) { if (param0->unk_00[v0].unk_00 == 0) { param0->unk_00[v0].unk_00 = 1; - sub_0200D364(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); } v1 = param0->unk_00[v0].unk_00 - 1; @@ -364,13 +364,13 @@ void ov62_02247160(UnkStruct_ov62_02246BF4 *param0) v0 = param0->unk_188[0].unk_00; param0->unk_00[v0].unk_00 = 0; - sub_0200D364(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); v1 = param0->unk_00[v0].unk_04; if (v0 > 0) { v0--; - sub_0200D364(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, ov62_02247B3C(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); v2 = param0->unk_00[v0].unk_04; if (v1 != v2) { @@ -480,13 +480,13 @@ void ov62_0224730C(u32 param0, u32 param1, void *param2) v1 = v0->unk_188[0].unk_00; v0->unk_00[v1].unk_00 = param0 - 12 + 1; - sub_0200D364(v0->unk_00[v1].unk_0C, ov62_02247B3C(v0->unk_00[v1].unk_00, v0->unk_00[v1].unk_08)); + CellActorData_SetAnim(v0->unk_00[v1].unk_0C, ov62_02247B3C(v0->unk_00[v1].unk_00, v0->unk_00[v1].unk_08)); ov62_02247968(v0, 1, 1); ov62_022479D4(v0, param0 - 12); ov62_02247968(v0, 1, 0); ov62_02247968(v0, 2, 1); ov62_02247A20(v0, param0 - 12, 2); - sub_0200D364(v0->unk_188[2].unk_0C, 3); + CellActorData_SetAnim(v0->unk_188[2].unk_0C, 3); v2 = v0->unk_00[v1].unk_04; v1++; @@ -596,11 +596,11 @@ void ov62_02247574(UnkStruct_ov62_02246BF4 *param0) Graphics_LoadTilesToBgLayerFromOpenNARC(v0, 54, param0->unk_220.unk_0C, 3, 0, 0, 0, 102); Graphics_LoadTilemapToBgLayerFromOpenNARC(v0, 43, v1, 3, 0, 0, 0, 102); - SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 44, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 2, v2, v3, v0, 44, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 40, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 41, 0, 1000); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 42, 0, 1000); - SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 88, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 2, v2, v3, v0, 88, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 87, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 85, 0, 1001); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 86, 0, 1001); @@ -611,15 +611,15 @@ void ov62_02247694(UnkStruct_ov62_02246BF4 *param0) int v0; for (v0 = 0; v0 < param0->unk_204; v0++) { - sub_0200D0F4(param0->unk_00[v0].unk_0C); + CellActorData_Delete(param0->unk_00[v0].unk_0C); } for (v0 = 0; v0 < 2; v0++) { - sub_0200D0F4(param0->unk_150[v0].unk_0C); + CellActorData_Delete(param0->unk_150[v0].unk_0C); } for (v0 = 0; v0 < 3; v0++) { - sub_0200D0F4(param0->unk_188[v0].unk_0C); + CellActorData_Delete(param0->unk_188[v0].unk_0C); } SpriteGfxHandler_UnloadCharObjById(param0->unk_220.unk_08, 1000); @@ -664,17 +664,17 @@ void ov62_02247754(UnkStruct_ov62_02246BF4 *param0) for (v0 = 0; v0 < param0->unk_204 + 3 - 1; v0++) { if (v0 == (param0->unk_150[v2].unk_00 + v2 + 1)) { - param0->unk_150[v2].unk_0C = SpriteActor_LoadResources(v4, v5, &v3); - SpriteActor_SetSpritePositionXY(param0->unk_150[v2].unk_0C, 72 + (v0 * 8) + 4, 24); - sub_0200D364(param0->unk_150[v2].unk_0C, 22); - sub_0200D330(param0->unk_150[v2].unk_0C); + param0->unk_150[v2].unk_0C = CellActor_LoadResources(v4, v5, &v3); + CellActorData_SetPositionXY(param0->unk_150[v2].unk_0C, 72 + (v0 * 8) + 4, 24); + CellActorData_SetAnim(param0->unk_150[v2].unk_0C, 22); + CellActorData_UpdateObject(param0->unk_150[v2].unk_0C); v2++; } else { - param0->unk_00[v1].unk_0C = SpriteActor_LoadResources(v4, v5, &v3); - SpriteActor_SetSpritePositionXY(param0->unk_00[v1].unk_0C, 72 + (v0 * 8) + 4, 24); - sub_0200D364(param0->unk_00[v1].unk_0C, ov62_02247B3C(param0->unk_00[v1].unk_00, param0->unk_00[v1].unk_08)); + param0->unk_00[v1].unk_0C = CellActor_LoadResources(v4, v5, &v3); + CellActorData_SetPositionXY(param0->unk_00[v1].unk_0C, 72 + (v0 * 8) + 4, 24); + CellActorData_SetAnim(param0->unk_00[v1].unk_0C, ov62_02247B3C(param0->unk_00[v1].unk_00, param0->unk_00[v1].unk_08)); sub_0200D6A4(param0->unk_00[v1].unk_0C, 0); - sub_0200D330(param0->unk_00[v1].unk_0C); + CellActorData_UpdateObject(param0->unk_00[v1].unk_0C); v1++; } } @@ -707,21 +707,21 @@ void ov62_0224784C(UnkStruct_ov62_02246BF4 *param0) v0.resources[4] = SPRITE_RESOURCE_NONE; v0.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_188[0].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); - param0->unk_188[1].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); - param0->unk_188[2].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_188[0].unk_0C = CellActor_LoadResources(v1, v2, &v0); + param0->unk_188[1].unk_0C = CellActor_LoadResources(v1, v2, &v0); + param0->unk_188[2].unk_0C = CellActor_LoadResources(v1, v2, &v0); ov62_02247998(param0, 0); - sub_0200D364(param0->unk_188[0].unk_0C, 0); - sub_0200D330(param0->unk_188[0].unk_0C); + CellActorData_SetAnim(param0->unk_188[0].unk_0C, 0); + CellActorData_UpdateObject(param0->unk_188[0].unk_0C); param0->unk_188[1].unk_14.unk_00 = 0; param0->unk_188[1].unk_14.unk_02 = 0; param0->unk_188[1].unk_00 = 1; ov62_022479D4(param0, 0); - sub_0200D364(param0->unk_188[1].unk_0C, param0->unk_188[1].unk_00); - sub_0200D330(param0->unk_188[1].unk_0C); + CellActorData_SetAnim(param0->unk_188[1].unk_0C, param0->unk_188[1].unk_00); + CellActorData_UpdateObject(param0->unk_188[1].unk_0C); SpriteActor_SetOAMMode(param0->unk_188[1].unk_0C, GX_OAM_MODE_XLU); param0->unk_188[2].unk_14.unk_00 = 0; @@ -729,8 +729,8 @@ void ov62_0224784C(UnkStruct_ov62_02246BF4 *param0) param0->unk_188[2].unk_00 = 1; ov62_022479D4(param0, 0); - sub_0200D364(param0->unk_188[2].unk_0C, param0->unk_188[2].unk_00); - sub_0200D330(param0->unk_188[2].unk_0C); + CellActorData_SetAnim(param0->unk_188[2].unk_0C, param0->unk_188[2].unk_00); + CellActorData_UpdateObject(param0->unk_188[2].unk_0C); SpriteActor_SetOAMMode(param0->unk_188[2].unk_0C, GX_OAM_MODE_XLU); ov62_02247968(param0, 1, 0); ov62_02247968(param0, 2, 0); @@ -739,9 +739,9 @@ void ov62_0224784C(UnkStruct_ov62_02246BF4 *param0) void ov62_02247968(UnkStruct_ov62_02246BF4 *param0, int param1, BOOL param2) { if (param2 == 1) { - SpriteActor_EnableObject(param0->unk_188[param1].unk_0C, 1); + CellActorData_DrawSprite(param0->unk_188[param1].unk_0C, 1); } else { - SpriteActor_EnableObject(param0->unk_188[param1].unk_0C, 0); + CellActorData_DrawSprite(param0->unk_188[param1].unk_0C, 0); } } @@ -754,7 +754,7 @@ void ov62_02247998(UnkStruct_ov62_02246BF4 *param0, int param1) param0->unk_188[0].unk_00 = param1; SpriteActor_GetSpritePositionXY(v2, &v0, &v1); - SpriteActor_SetSpritePositionXY(param0->unk_188[0].unk_0C, v0, v1 + 16); + CellActorData_SetPositionXY(param0->unk_188[0].unk_0C, v0, v1 + 16); } void ov62_022479D4(UnkStruct_ov62_02246BF4 *param0, int param1) @@ -764,7 +764,7 @@ void ov62_022479D4(UnkStruct_ov62_02246BF4 *param0, int param1) v0 = (param0->unk_220.unk_18[param1 + 12].rect.left + param0->unk_220.unk_18[param1 + 12].rect.right) / 2; v1 = (param0->unk_220.unk_18[param1 + 12].rect.top + param0->unk_220.unk_18[param1 + 12].rect.bottom) / 2; - SpriteActor_SetSpritePositionXY(param0->unk_188[1].unk_0C, v0 - 0, v1 - 8); + CellActorData_SetPositionXY(param0->unk_188[1].unk_0C, v0 - 0, v1 - 8); } void ov62_02247A20(UnkStruct_ov62_02246BF4 *param0, int param1, int param2) @@ -774,14 +774,14 @@ void ov62_02247A20(UnkStruct_ov62_02246BF4 *param0, int param1, int param2) v0 = (param0->unk_220.unk_18[param1 + 12].rect.left + param0->unk_220.unk_18[param1 + 12].rect.right) / 2; v1 = (param0->unk_220.unk_18[param1 + 12].rect.top + param0->unk_220.unk_18[param1 + 12].rect.bottom) / 2; - SpriteActor_SetSpritePositionXY(param0->unk_188[param2].unk_0C, v0 - 0, v1 - 8); + CellActorData_SetPositionXY(param0->unk_188[param2].unk_0C, v0 - 0, v1 - 8); } void ov62_02247A70(UnkStruct_ov62_02246BF4 *param0) { - sub_0200D330(param0->unk_188[0].unk_0C); - sub_0200D330(param0->unk_188[1].unk_0C); - sub_0200D330(param0->unk_188[2].unk_0C); + CellActorData_UpdateObject(param0->unk_188[0].unk_0C); + CellActorData_UpdateObject(param0->unk_188[1].unk_0C); + CellActorData_UpdateObject(param0->unk_188[2].unk_0C); { int v0 = 2; @@ -789,13 +789,13 @@ void ov62_02247A70(UnkStruct_ov62_02246BF4 *param0) BOOL v2; for (v0 = 1; v0 < 3; v0++) { - v1 = sub_0200D37C(param0->unk_188[v0].unk_0C); + v1 = CellActorData_GetActiveAnim(param0->unk_188[v0].unk_0C); if (v1 == 3) { - v2 = sub_0200D3B8(param0->unk_188[v0].unk_0C); + v2 = CellActorData_IsAnimated(param0->unk_188[v0].unk_0C); if (v2 == 0) { - sub_0200D364(param0->unk_188[v0].unk_0C, param0->unk_188[v0].unk_00); + CellActorData_SetAnim(param0->unk_188[v0].unk_0C, param0->unk_188[v0].unk_00); if (param0->unk_220.unk_78 == 1) { ov62_02247968(param0, 1, 0); @@ -807,11 +807,11 @@ void ov62_02247A70(UnkStruct_ov62_02246BF4 *param0) } } else { if (v1 != param0->unk_188[v0].unk_00) { - sub_0200D364(param0->unk_188[v0].unk_0C, param0->unk_188[v0].unk_00); + CellActorData_SetAnim(param0->unk_188[v0].unk_0C, param0->unk_188[v0].unk_00); } { - v1 = sub_0200D37C(param0->unk_188[2].unk_0C); + v1 = CellActorData_GetActiveAnim(param0->unk_188[2].unk_0C); if (v1 != 3) { if (param0->unk_220.unk_78 == 1) { @@ -879,7 +879,7 @@ void ov62_02247B88(UnkStruct_ov62_02246BF4 *param0, int param1) SpriteActor_GetSpritePositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); if (param1 == 0) { - SpriteActor_SetSpritePositionXY(param0->unk_00[v0].unk_0C, v2, v4); + CellActorData_SetPositionXY(param0->unk_00[v0].unk_0C, v2, v4); } else { param0->unk_00[v0].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_00[v0].unk_14.unk_02 = 0; @@ -901,7 +901,7 @@ void ov62_02247B88(UnkStruct_ov62_02246BF4 *param0, int param1) } if (param1 == 0) { - SpriteActor_SetSpritePositionXY(param0->unk_150[v1].unk_0C, v2, v4); + CellActorData_SetPositionXY(param0->unk_150[v1].unk_0C, v2, v4); } else { param0->unk_150[v1].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_150[v1].unk_14.unk_02 = 0; diff --git a/src/overlay063/ov63_0222D1C0.c b/src/overlay063/ov63_0222D1C0.c index 58052582c0..c351977a4c 100644 --- a/src/overlay063/ov63_0222D1C0.c +++ b/src/overlay063/ov63_0222D1C0.c @@ -3,8 +3,6 @@ #include #include -#include "struct_defs/struct_0200C738.h" - #include "overlay063/ov63_0222D160.h" #include "overlay063/struct_ov63_0222CC3C.h" #include "overlay063/struct_ov63_0222D160.h" @@ -13,10 +11,11 @@ #include "bg_window.h" #include "graphics.h" #include "heap.h" +#include "sprite_renderer.h" #include "unk_020093B4.h" typedef struct UnkStruct_ov63_0222D1C0_t { - UnkStruct_0200C738 *unk_00; + GF_G2dRenderer *unk_00; BgConfig *unk_04; void *unk_08; NNSG2dScreenData *unk_0C; @@ -33,7 +32,7 @@ static void ov63_0222D4F8(BgConfig *param0, u8 param1, u8 param2, u8 param3, u8 static u8 ov63_0222D688(u8 param0, u8 param1); static const void *ov63_0222D6BC(const u8 *param0, u8 param1, u8 param2, u8 param3, u8 param4, u8 param5, UnkStruct_ov63_0222CC3C *param6); -UnkStruct_ov63_0222D1C0 *ov63_0222D1C0(UnkStruct_0200C738 *param0, BgConfig *param1, const UnkStruct_ov65_0223582C *param2, u32 param3) +UnkStruct_ov63_0222D1C0 *ov63_0222D1C0(GF_G2dRenderer *param0, BgConfig *param1, const UnkStruct_ov65_0223582C *param2, u32 param3) { UnkStruct_ov63_0222D1C0 *v0; diff --git a/src/overlay064/ov64_0222DCE0.c b/src/overlay064/ov64_0222DCE0.c index fdd3694e14..f6dc844c1b 100644 --- a/src/overlay064/ov64_0222DCE0.c +++ b/src/overlay064/ov64_0222DCE0.c @@ -7,7 +7,7 @@ #include "struct_decls/struct_0202B370_decl.h" #include "struct_decls/struct_0203068C_decl.h" -#include "struct_defs/struct_0200C738.h" +#include "sprite_renderer.h" #include "struct_defs/struct_0208737C.h" #include "struct_defs/struct_02089438.h" #include "struct_defs/struct_02099F80.h" @@ -121,7 +121,7 @@ typedef struct { BgConfig *unk_00; CellActorCollection * unk_04; NNSG2dRenderSurface unk_08; - UnkStruct_0200C738 unk_78; + GF_G2dRenderer unk_78; SpriteResourceCollection * unk_204[4]; StringTemplate * unk_214; MessageLoader * unk_218; @@ -986,7 +986,7 @@ static void ov64_0222E3D8 (UnkStruct_ov64_0222E21C * param0, u32 param1) param0->unk_04 = sub_020095C4(64, ¶m0->unk_78, param1); - sub_0200A8B0(¶m0->unk_08, &Unk_ov64_02232460, NNS_G2D_SURFACETYPE_MAIN2D, ¶m0->unk_78.unk_00); + sub_0200A8B0(¶m0->unk_08, &Unk_ov64_02232460, NNS_G2D_SURFACETYPE_MAIN2D, ¶m0->unk_78.rendererInstance); for (v0 = 0; v0 < 4; v0++) { param0->unk_204[v0] = SpriteResourceCollection_New(64, v0, param1); diff --git a/src/overlay065/ov65_0223648C.c b/src/overlay065/ov65_0223648C.c index 9d7864ed60..3970e46f1a 100644 --- a/src/overlay065/ov65_0223648C.c +++ b/src/overlay065/ov65_0223648C.c @@ -3,7 +3,6 @@ #include #include -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0207DE04.h" #include "struct_defs/struct_0207DFAC.h" #include "struct_defs/struct_0207E060.h" @@ -41,6 +40,7 @@ #include "overlay_manager.h" #include "render_window.h" #include "save_player.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -104,7 +104,7 @@ typedef struct { u8 unk_15; u16 unk_16; CellActorCollection *unk_18; - UnkStruct_0200C738 unk_1C; + GF_G2dRenderer unk_1C; SpriteResourceCollection *unk_1A8[4]; UnkStruct_ov63_0222BE18 *unk_1B8; UnkStruct_ov63_0222CD2C *unk_1BC; diff --git a/src/overlay068/ov68_0225C700.c b/src/overlay068/ov68_0225C700.c index 5424d6254d..73e6e41483 100644 --- a/src/overlay068/ov68_0225C700.c +++ b/src/overlay068/ov68_0225C700.c @@ -6,7 +6,6 @@ #include #include "struct_decls/struct_02030EC4_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02099F80.h" #include "overlay022/struct_ov22_022559F8.h" @@ -34,6 +33,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -110,7 +110,7 @@ typedef struct { typedef struct { BgConfig *unk_00; CellActorCollection *unk_04; - UnkStruct_0200C738 unk_08; + GF_G2dRenderer unk_08; SpriteResourceCollection *unk_194[4]; NARC *unk_1A4; } UnkStruct_ov68_0225C91C; diff --git a/src/overlay069/ov69_0225C700.c b/src/overlay069/ov69_0225C700.c index 0634ba4480..9e88731123 100644 --- a/src/overlay069/ov69_0225C700.c +++ b/src/overlay069/ov69_0225C700.c @@ -5,7 +5,6 @@ #include "struct_decls/struct_02015920_decl.h" #include "struct_decls/struct_0202C878_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02015958.h" #include "struct_defs/struct_0207C690.h" #include "struct_defs/struct_02099F80.h" @@ -36,6 +35,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -108,7 +108,7 @@ typedef struct { typedef struct { BgConfig *unk_00; CellActorCollection *unk_04; - UnkStruct_0200C738 unk_08; + GF_G2dRenderer unk_08; SpriteResourceCollection *unk_194[4]; GenericPointerData *unk_1A4; NARC *unk_1A8; diff --git a/src/overlay070/ov70_0225D9A4.c b/src/overlay070/ov70_0225D9A4.c index 2eb500b726..a26ea63623 100644 --- a/src/overlay070/ov70_0225D9A4.c +++ b/src/overlay070/ov70_0225D9A4.c @@ -5,7 +5,6 @@ #include #include "struct_decls/struct_02023FCC_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0207C690.h" #include "struct_defs/struct_02099F80.h" @@ -55,6 +54,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -98,7 +98,7 @@ typedef struct { typedef struct { BgConfig *unk_00; CellActorCollection *unk_04; - UnkStruct_0200C738 unk_08; + GF_G2dRenderer unk_08; SpriteResourceCollection *unk_194[4]; NNSG2dCellTransferState *unk_1A4; GenericPointerData *unk_1A8; diff --git a/src/overlay075/ov75_021D0D80.c b/src/overlay075/ov75_021D0D80.c index 34ff30a567..6f88ef8a02 100644 --- a/src/overlay075/ov75_021D0D80.c +++ b/src/overlay075/ov75_021D0D80.c @@ -29,13 +29,13 @@ #include "pokemon_icon.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "unk_02005474.h" #include "unk_0200A784.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02014A84.h" #include "unk_02017728.h" @@ -401,7 +401,7 @@ static int ov75_021D1184(UnkStruct_ov75_021D1184 *param0) break; case 2: if (param0->unk_AC != NULL) { - sub_0200C7EC(param0->unk_AC); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_AC); } if (PaletteData_GetSelectedBuffersMask(param0->unk_30)) { @@ -417,7 +417,7 @@ static int ov75_021D1184(UnkStruct_ov75_021D1184 *param0) }; if (param0->unk_AC != NULL) { - sub_0200C7EC(param0->unk_AC); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_AC); } if (!v0[param0->unk_0C](param0)) { @@ -429,7 +429,7 @@ static int ov75_021D1184(UnkStruct_ov75_021D1184 *param0) case 4: if (PaletteData_GetSelectedBuffersMask(param0->unk_30)) { if (param0->unk_AC != NULL) { - sub_0200C7EC(param0->unk_AC); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_AC); } return 0; @@ -871,8 +871,8 @@ static void ov75_021D1ADC(UnkStruct_ov75_021D1184 *param0) VRAMTransferManager_New(32, param0->unk_00); - param0->unk_A8 = sub_0200C6E4(param0->unk_00); - param0->unk_AC = sub_0200C704(param0->unk_A8); + param0->unk_A8 = SpriteRenderer_Create(param0->unk_00); + param0->unk_AC = SpriteRenderer_CreateGfxHandler(param0->unk_A8); { UnkStruct_ov104_0224133C v3 = { @@ -901,15 +901,15 @@ static void ov75_021D1ADC(UnkStruct_ov75_021D1184 *param0) 0, }; - sub_0200C73C(param0->unk_A8, &v3, &v4, 32); - sub_0200C7C0(param0->unk_A8, param0->unk_AC, 3); - sub_0200CB30(param0->unk_A8, param0->unk_AC, &v5); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_A8, &v3, &v4, 32); + SpriteRenderer_CreateCellActorList(param0->unk_A8, param0->unk_AC, 3); + SpriteRenderer_InitGfxResourceList(param0->unk_A8, param0->unk_AC, &v5); sub_0200A93C(param0->unk_00); } - sub_0200CC9C(param0->unk_A8, param0->unk_AC, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 0); - sub_0200CE0C(param0->unk_A8, param0->unk_AC, 19, PokeIconCellsFileIndex(), 0, 0); - sub_0200CE3C(param0->unk_A8, param0->unk_AC, 19, PokeIconAnimationFileIndex(), 0, 0); + SpriteRenderer_LoadPaletteResObj(param0->unk_A8, param0->unk_AC, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 0); + SpriteRenderer_LoadCellResObj(param0->unk_A8, param0->unk_AC, 19, PokeIconCellsFileIndex(), 0, 0); + SpriteRenderer_LoadAnimResObj(param0->unk_A8, param0->unk_AC, 19, PokeIconAnimationFileIndex(), 0, 0); for (v0 = 0; v0 < 3; v0++) { if (param0->unk_1C->unk_14[v0].val2 == 0xFFFF) { @@ -936,10 +936,10 @@ static void ov75_021D1ADC(UnkStruct_ov75_021D1184 *param0) v2.resources[4] = SPRITE_RESOURCE_NONE; v2.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_B0[v0] = SpriteActor_LoadResources(param0->unk_A8, param0->unk_AC, &v2); + param0->unk_B0[v0] = CellActor_LoadResources(param0->unk_A8, param0->unk_AC, &v2); if (param0->unk_1C->unk_14[v0].val1_0 == 7) { - SpriteActor_EnableObject(param0->unk_B0[v0], 0); + CellActorData_DrawSprite(param0->unk_B0[v0], 0); } } } @@ -951,12 +951,12 @@ static void ov75_021D1CB8(UnkStruct_ov75_021D1184 *param0) if (param0->unk_0C == 0) { for (v0 = 0; v0 < 3; v0++) { if (param0->unk_B0[v0] != NULL) { - sub_0200D0F4(param0->unk_B0[v0]); + CellActorData_Delete(param0->unk_B0[v0]); } } - sub_0200D0B0(param0->unk_A8, param0->unk_AC); - sub_0200C8D4(param0->unk_A8); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_A8, param0->unk_AC); + SpriteRenderer_Free(param0->unk_A8); VRAMTransferManager_Destroy(); } } diff --git a/src/overlay076/ov76_0223B140.c b/src/overlay076/ov76_0223B140.c index 591a29577a..2198c61b1d 100644 --- a/src/overlay076/ov76_0223B140.c +++ b/src/overlay076/ov76_0223B140.c @@ -17,8 +17,8 @@ #include "core_sys.h" #include "game_overlay.h" #include "palette.h" +#include "sprite_renderer.h" #include "touch_screen.h" -#include "unk_0200C6E4.h" #include "unk_0202C9F4.h" #include "unk_02097B18.h" @@ -56,7 +56,7 @@ void ov76_0223B184(TouchScreenRect *rect, CellActorData *param1, BOOL param2) } if (param2 == 1) { - SpriteActor_SetSpritePositionXY(param1, gCoreSys.touchX, gCoreSys.touchY); + CellActorData_SetPositionXY(param1, gCoreSys.touchX, gCoreSys.touchY); SpriteActor_GetSpritePositionXY(param1, &v0, &v1); ov76_0223B174(rect); } else { @@ -158,14 +158,14 @@ void ov76_0223B314(UnkStruct_ov76_0223DE00 *param0, u8 param1) } if (v0 == param1) { - sub_0200D474(param0->unk_324[v0].unk_08, 0); + CellActorData_SetPriority(param0->unk_324[v0].unk_08, 0); } else { - int v1 = sub_0200D488(param0->unk_324[v0].unk_08); + int v1 = CellActorData_GetPriority(param0->unk_324[v0].unk_08); if (v1 == 0) { - sub_0200D474(param0->unk_324[v0].unk_08, v1 + 1); + CellActorData_SetPriority(param0->unk_324[v0].unk_08, v1 + 1); } else { - sub_0200D474(param0->unk_324[v0].unk_08, v1 + 2); + CellActorData_SetPriority(param0->unk_324[v0].unk_08, v1 + 2); } } } @@ -183,14 +183,14 @@ void ov76_0223B36C(UnkStruct_ov76_0223DE00 *param0, u8 param1, u8 param2) v3 = param0->unk_D4.unk_0C; v4 = param0->unk_D4.unk_14; - sub_0200CD7C(v4, 3, v2, v3, 91, 293, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 21000 + 293); + SpriteRenderer_LoadPalette(v4, 3, v2, v3, 91, 293, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 21000 + 293); v0 = sub_02098140(param1); v1 = (param2 + 20000); - sub_0200CBDC(v2, v3, 91, v0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v1); - sub_0200CE0C(v2, v3, 91, 93, 1, 22000 + 93); - sub_0200CE3C(v2, v3, 91, 1, 1, 23000 + 1); + SpriteRenderer_LoadCharResObj(v2, v3, 91, v0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v1); + SpriteRenderer_LoadCellResObj(v2, v3, 91, 93, 1, 22000 + 93); + SpriteRenderer_LoadAnimResObj(v2, v3, 91, 1, 1, 23000 + 1); } void ov76_0223B400(UnkStruct_ov76_0223DE00 *param0) @@ -213,7 +213,7 @@ void ov76_0223B400(UnkStruct_ov76_0223DE00 *param0) v4[v0] = 0xFF; if (param0->unk_324[v0].unk_08 != NULL) { - v3[v0] = sub_0200D488(param0->unk_324[v0].unk_08); + v3[v0] = CellActorData_GetPriority(param0->unk_324[v0].unk_08); v4[v0] = v0; v2++; } @@ -265,7 +265,7 @@ void ov76_0223B400(UnkStruct_ov76_0223DE00 *param0) continue; } - sub_0200D474(param0->unk_324[v4[v0]].unk_08, v0); + CellActorData_SetPriority(param0->unk_324[v4[v0]].unk_08, v0); } } } @@ -311,9 +311,9 @@ BOOL ov76_0223B52C(UnkStruct_ov76_0223DE00 *param0, u8 param1) v3.resources[1] = 21000 + 293; v3.resources[2] = 22000 + 93; v3.resources[3] = 23000 + 1; - v2->unk_08 = SpriteActor_LoadResources(v4, v5, &v3); + v2->unk_08 = CellActor_LoadResources(v4, v5, &v3); - sub_0200D330(v2->unk_08); + CellActorData_UpdateObject(v2->unk_08); return 1; } @@ -385,7 +385,7 @@ void ov76_0223B69C(UnkStruct_ov76_0223DE00 *param0, int param1) continue; } - SpriteActor_EnableObject(param0->unk_324[v0].unk_08, param1); + CellActorData_DrawSprite(param0->unk_324[v0].unk_08, param1); } } @@ -417,7 +417,7 @@ void ov76_0223B704(UnkStruct_ov76_0223DE00 *param0, int param1) v1 = (param1 + 20000); SpriteGfxHandler_UnloadCharObjById(param0->unk_D4.unk_0C, v1); - sub_0200D0F4(param0->unk_324[param1].unk_08); + CellActorData_Delete(param0->unk_324[param1].unk_08); param0->unk_324[param1].unk_08 = NULL; param0->unk_324[param1].unk_00 = 0; diff --git a/src/overlay076/ov76_0223B870.c b/src/overlay076/ov76_0223B870.c index d4ea4dfc1d..54147243a6 100644 --- a/src/overlay076/ov76_0223B870.c +++ b/src/overlay076/ov76_0223B870.c @@ -35,13 +35,13 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "touch_screen.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02014000.h" @@ -123,7 +123,7 @@ void ov76_0223B8C4(UnkStruct_ov76_0223DE00 *param0) void ov76_0223B904(UnkStruct_ov76_0223DE00 *param0) { - sub_0200CD7C(param0->unk_D4.unk_14, 3, param0->unk_D4.unk_08, param0->unk_D4.unk_0C, 14, 7, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 30000); + SpriteRenderer_LoadPalette(param0->unk_D4.unk_14, 3, param0->unk_D4.unk_08, param0->unk_D4.unk_0C, 14, 7, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 30000); } void ov76_0223B940(UnkStruct_ov76_0223DE00 *param0) @@ -164,7 +164,7 @@ void ov76_0223B98C(UnkStruct_ov76_0223DE00 *param0, int param1, int param2, int v0.unk_00 = param0->unk_D4.unk_160; v0.unk_04 = &v5; v0.unk_08 = sub_0200D9B0(param0->unk_D4.unk_0C); - v0.unk_0C = sub_0200D04C(param0->unk_D4.unk_0C, v2); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_D4.unk_0C, v2); v0.unk_10 = NULL; v0.unk_14 = param0->unk_D4.unk_16C[param1].unk_04; v0.unk_18 = param2 - Font_CalcStrbufWidth(FONT_SUBSCREEN, v1, 0) / 2; @@ -241,12 +241,12 @@ void ov76_0223BB04(UnkStruct_ov76_0223DE00 *param0) for (v0 = 0; v0 < 8; v0++) { v1 = sub_02098140(param0->unk_418.unk_08[v0]); - sub_0200CBDC(v2, v3, 91, v1, 1, NNS_G2D_VRAM_TYPE_2DSUB, (v0 + 25000)); + SpriteRenderer_LoadCharResObj(v2, v3, 91, v1, 1, NNS_G2D_VRAM_TYPE_2DSUB, (v0 + 25000)); } - sub_0200CD7C(v4, 3, v2, v3, 91, 293, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 26000 + 292); - sub_0200CE0C(v2, v3, 91, 180, 1, 27000 + 180); - sub_0200CE3C(v2, v3, 91, 88, 1, 28000 + 88); + SpriteRenderer_LoadPalette(v4, 3, v2, v3, 91, 293, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 26000 + 292); + SpriteRenderer_LoadCellResObj(v2, v3, 91, 180, 1, 27000 + 180); + SpriteRenderer_LoadAnimResObj(v2, v3, 91, 88, 1, 28000 + 88); } void ov76_0223BBAC(UnkStruct_ov76_0223DE00 *param0) @@ -280,7 +280,7 @@ void ov76_0223BBAC(UnkStruct_ov76_0223DE00 *param0) for (v0 = 0; v0 < 8; v0++) { v2.resources[0] = (v0 + 25000); - v1->unk_00[v0] = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0] = CellActor_LoadResources(v3, v4, &v2); } { @@ -296,9 +296,9 @@ void ov76_0223BBAC(UnkStruct_ov76_0223DE00 *param0) }; for (v0 = 0; v0 < 8; v0++) { - SpriteActor_SetSpritePositionXY(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1] - 1); - sub_0200D330(param0->unk_3E4.unk_00[v0]); - sub_0200D3CC(param0->unk_3E4.unk_00[v0], 0); + CellActorData_SetPositionXY(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1] - 1); + CellActorData_UpdateObject(param0->unk_3E4.unk_00[v0]); + CellActorData_SetAnimFrame(param0->unk_3E4.unk_00[v0], 0); } } } @@ -309,7 +309,7 @@ void ov76_0223BC70(UnkStruct_ov76_0223DE00 *param0) for (v0 = 0; v0 < 8; v0++) { SpriteGfxHandler_UnloadCharObjById(param0->unk_D4.unk_0C, (v0 + 25000)); - sub_0200D0F4(param0->unk_3E4.unk_00[v0]); + CellActorData_Delete(param0->unk_3E4.unk_00[v0]); } } @@ -542,16 +542,16 @@ void ov76_0223C110(UnkStruct_ov76_0223DE00 *param0) v1 = param0->unk_D4.unk_0C; v2 = param0->unk_D4.unk_14; - sub_0200CD7C(v2, 2, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 16000); + SpriteRenderer_LoadPalette(v2, 2, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 16000); { int v3 = PokeIcon64KCellsFileIndex(); - sub_0200CE0C(v0, v1, 19, v3, 0, 17000); + SpriteRenderer_LoadCellResObj(v0, v1, 19, v3, 0, 17000); } { int v4 = PokeIcon64KAnimationFileIndex(); - sub_0200CE3C(v0, v1, 19, v4, 0, 18000); + SpriteRenderer_LoadAnimResObj(v0, v1, 19, v4, 0, 18000); } } @@ -586,15 +586,15 @@ void ov76_0223C188(UnkStruct_ov76_0223DE00 *param0) v6.resources[4] = SPRITE_RESOURCE_NONE; v6.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_2FC[v0] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v6); + param0->unk_2FC[v0] = CellActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v6); v2 = Pokemon_GetValue(v5, MON_DATA_SPECIES, NULL); v1 = Pokemon_GetValue(v5, MON_DATA_IS_EGG, NULL); v4 = Pokemon_GetValue(v5, MON_DATA_FORM, NULL); v3 = PokeIconPaletteIndex(v2, v4, v1); - CellActor_SetExplicitPaletteOffsetAutoAdjust(param0->unk_2FC[v0]->unk_00, v3); - sub_0200D364(param0->unk_2FC[v0], 1); + CellActor_SetExplicitPaletteOffsetAutoAdjust(param0->unk_2FC[v0]->cellActor, v3); + CellActorData_SetAnim(param0->unk_2FC[v0], 1); } } @@ -605,7 +605,7 @@ void ov76_0223C288(UnkStruct_ov76_0223DE00 *param0) s16 v2, v3; for (v0 = 0; v0 < param0->unk_00->unk_00; v0++) { - SpriteActor_EnableObject(param0->unk_2FC[v0], 0); + CellActorData_DrawSprite(param0->unk_2FC[v0], 0); } for (v0 = 0; v0 < 12; v0++) { @@ -613,8 +613,8 @@ void ov76_0223C288(UnkStruct_ov76_0223DE00 *param0) if (v1 != 0xff) { ov76_0223C0EC(v0, &v2, &v3); - SpriteActor_SetSpritePositionXY(param0->unk_2FC[v1], v2 + -16, v3 + (+12)); - SpriteActor_EnableObject(param0->unk_2FC[v1], 1); + CellActorData_SetPositionXY(param0->unk_2FC[v1], v2 + -16, v3 + (+12)); + CellActorData_DrawSprite(param0->unk_2FC[v1], 1); } } } @@ -624,7 +624,7 @@ void ov76_0223C304(UnkStruct_ov76_0223DE00 *param0) int v0; for (v0 = 0; v0 < param0->unk_00->unk_00; v0++) { - sub_0200D330(param0->unk_2FC[v0]); + CellActorData_UpdateObject(param0->unk_2FC[v0]); } } @@ -634,7 +634,7 @@ void ov76_0223C32C(UnkStruct_ov76_0223DE00 *param0) int v1; for (v0 = 0; v0 < param0->unk_00->unk_00; v0++) { - sub_0200D0F4(param0->unk_2FC[v0]); + CellActorData_Delete(param0->unk_2FC[v0]); } } @@ -658,7 +658,7 @@ void ov76_0223C354(UnkStruct_ov76_0223DE00 *param0) void ov76_0223C398(UnkStruct_ov76_0223C398 *param0) { - param0->unk_08 = sub_0200C6E4(53); + param0->unk_08 = SpriteRenderer_Create(53); { const UnkStruct_ov104_0224133C v0 = { 0, @@ -674,7 +674,7 @@ void ov76_0223C398(UnkStruct_ov76_0223C398 *param0) 48 + 48, 1024 * 0x40, 512 * 0x20, GX_OBJVRAMMODE_CHAR_1D_64K, GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->unk_08, &v0, &v1, 16 + 16); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_08, &v0, &v1, 16 + 16); } { @@ -688,19 +688,19 @@ void ov76_0223C398(UnkStruct_ov76_0223C398 *param0) 16, }; - param0->unk_0C = sub_0200C704(param0->unk_08); - v2 = sub_0200C7C0(param0->unk_08, param0->unk_0C, (64 + 64)); + param0->unk_0C = SpriteRenderer_CreateGfxHandler(param0->unk_08); + v2 = SpriteRenderer_CreateCellActorList(param0->unk_08, param0->unk_0C, (64 + 64)); GF_ASSERT(v2); - v2 = sub_0200CB30(param0->unk_08, param0->unk_0C, &v3); + v2 = SpriteRenderer_InitGfxResourceList(param0->unk_08, param0->unk_0C, &v3); GF_ASSERT(v2); } } void ov76_0223C424(UnkStruct_ov76_0223C398 *param0) { - sub_0200D0B0(param0->unk_08, param0->unk_0C); - sub_0200C8D4(param0->unk_08); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_08, param0->unk_0C); + SpriteRenderer_Free(param0->unk_08); } void ov76_0223C438(UnkStruct_ov76_0223DE00 *param0, NARC *param1) @@ -737,7 +737,7 @@ void ov76_0223C4AC(UnkStruct_ov76_0223DE00 *param0) v1.resources[3] = 48000; v1.resources[4] = SPRITE_RESOURCE_NONE; v1.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_314[v0] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + param0->unk_314[v0] = CellActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); sub_0200D7D4(param0->unk_314[v0], v2[v0][2]); } @@ -752,7 +752,7 @@ void ov76_0223C544(UnkStruct_ov76_0223DE00 *param0) } for (v0 = 0; v0 < 4; v0++) { - sub_0200D330(param0->unk_314[v0]); + CellActorData_UpdateObject(param0->unk_314[v0]); } } @@ -761,7 +761,7 @@ void ov76_0223C568(UnkStruct_ov76_0223DE00 *param0, int param1) int v0; for (v0 = 0; v0 < 4; v0++) { - SpriteActor_EnableObject(param0->unk_314[v0], param1); + CellActorData_DrawSprite(param0->unk_314[v0], param1); } } @@ -770,14 +770,14 @@ void ov76_0223C588(UnkStruct_ov76_0223DE00 *param0) int v0; for (v0 = 0; v0 < 4; v0++) { - sub_0200D0F4(param0->unk_314[v0]); + CellActorData_Delete(param0->unk_314[v0]); } } void ov76_0223C5A4(SpriteRenderer *param0, SpriteGfxHandler *param1, PaletteData *param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, NARC *param10) { SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param10, param3, 1, param7, (param3 + 11000)); - SpriteRenderer_LoadPalette(param2, param8, param0, param1, param10, param4, 0, param9, param7, (param4 + 11000)); + SpriteRenderer_LoadPaletteFromOpenNarc(param2, param8, param0, param1, param10, param4, 0, param9, param7, (param4 + 11000)); SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param10, param5, 1, (param5 + 11000)); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param10, param6, 1, (param6 + 11000)); } @@ -807,12 +807,12 @@ void ov76_0223C61C(UnkStruct_ov76_0223DE00 *param0, NARC *param1) v1.resources[4] = SPRITE_RESOURCE_NONE; v1.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_264[v0].unk_08 = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + param0->unk_264[v0].unk_08 = CellActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); { s16 v2, v3; ov76_0223C0EC(v0, &v2, &v3); - SpriteActor_SetSpritePositionXY(param0->unk_264[v0].unk_08, v2, v3); + CellActorData_SetPositionXY(param0->unk_264[v0].unk_08, v2, v3); } } @@ -832,18 +832,18 @@ void ov76_0223C61C(UnkStruct_ov76_0223DE00 *param0, NARC *param1) v1.resources[4] = SPRITE_RESOURCE_NONE; v1.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_2F4[0] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); - param0->unk_2F4[1] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + param0->unk_2F4[0] = CellActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + param0->unk_2F4[1] = CellActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); { s16 v4, v5; ov76_0223C0EC(param0->unk_3C4[0], &v4, &v5); - SpriteActor_SetSpritePositionXY(param0->unk_2F4[0], v4, v5); - SpriteActor_SetSpritePositionXY(param0->unk_2F4[1], v4, v5); - sub_0200D474(param0->unk_2F4[1], 25); - sub_0200D364(param0->unk_2F4[0], 0); - sub_0200D364(param0->unk_2F4[1], 0); + CellActorData_SetPositionXY(param0->unk_2F4[0], v4, v5); + CellActorData_SetPositionXY(param0->unk_2F4[1], v4, v5); + CellActorData_SetPriority(param0->unk_2F4[1], 25); + CellActorData_SetAnim(param0->unk_2F4[0], 0); + CellActorData_SetAnim(param0->unk_2F4[1], 0); } } } @@ -860,7 +860,7 @@ void ov76_0223C7E0(UnkStruct_ov76_0223DE00 *param0) continue; } - sub_0200D364(param0->unk_264[v0].unk_08, param0->unk_264[v0].unk_04); + CellActorData_SetAnim(param0->unk_264[v0].unk_08, param0->unk_264[v0].unk_04); } } @@ -901,11 +901,11 @@ void ov76_0223C88C(UnkStruct_ov76_0223DE00 *param0) int v0; for (v0 = 0; v0 < 12; v0++) { - sub_0200D330(param0->unk_264[v0].unk_08); + CellActorData_UpdateObject(param0->unk_264[v0].unk_08); } - sub_0200D330(param0->unk_2F4[0]); - sub_0200D330(param0->unk_2F4[1]); + CellActorData_UpdateObject(param0->unk_2F4[0]); + CellActorData_UpdateObject(param0->unk_2F4[1]); } void ov76_0223C8BC(UnkStruct_ov76_0223DE00 *param0) @@ -913,11 +913,11 @@ void ov76_0223C8BC(UnkStruct_ov76_0223DE00 *param0) int v0; for (v0 = 0; v0 < 12; v0++) { - sub_0200D0F4(param0->unk_264[v0].unk_08); + CellActorData_Delete(param0->unk_264[v0].unk_08); } - sub_0200D0F4(param0->unk_2F4[0]); - sub_0200D0F4(param0->unk_2F4[1]); + CellActorData_Delete(param0->unk_2F4[0]); + CellActorData_Delete(param0->unk_2F4[1]); } void ov76_0223C8EC(BgConfig *param0, PaletteData *param1, int param2) @@ -1156,7 +1156,7 @@ void ov76_0223CFEC(UnkStruct_ov76_0223DE00 *param0, NARC *param1) v1 = param0->unk_D4.unk_0C; v2 = param0->unk_D4.unk_14; - SpriteRenderer_LoadPalette(v2, 3, v0, v1, param1, 290, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 26000 + 290); + SpriteRenderer_LoadPaletteFromOpenNarc(v2, 3, v0, v1, param1, 290, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 26000 + 290); SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, param1, 273, 1, NNS_G2D_VRAM_TYPE_2DSUB, 25000 + 273); SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, param1, 177, 1, 27000 + 177); SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, param1, 85, 1, 28000 + 85); @@ -1203,13 +1203,13 @@ void ov76_0223D16C(UnkStruct_ov76_0223DE00 *param0) v2.resources[1] = 26000 + 290; v2.resources[2] = 27000 + 177; v2.resources[3] = 28000 + 85; - v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0++] = CellActor_LoadResources(v3, v4, &v2); v2.resources[0] = 25000 + 274; v2.resources[1] = 26000 + 290; v2.resources[2] = 27000 + 178; v2.resources[3] = 28000 + 86; - v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0++] = CellActor_LoadResources(v3, v4, &v2); v2.bgPriority = 1; v2.plttIdx = 1; @@ -1217,7 +1217,7 @@ void ov76_0223D16C(UnkStruct_ov76_0223DE00 *param0) v2.resources[1] = 26000 + 290; v2.resources[2] = 27000 + 176; v2.resources[3] = 28000 + 84; - v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0++] = CellActor_LoadResources(v3, v4, &v2); v2.bgPriority = 1; v2.plttIdx = 0; @@ -1225,8 +1225,8 @@ void ov76_0223D16C(UnkStruct_ov76_0223DE00 *param0) v2.resources[1] = 26000 + 290; v2.resources[2] = 27000 + 175; v2.resources[3] = 28000 + 83; - v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); - v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0++] = CellActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0++] = CellActor_LoadResources(v3, v4, &v2); { const s16 v6[][2] = { @@ -1261,9 +1261,9 @@ void ov76_0223D16C(UnkStruct_ov76_0223DE00 *param0) }; for (v0 = 8; v0 < 13; v0++) { - SpriteActor_SetSpritePositionXY(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1]); - sub_0200D330(param0->unk_3E4.unk_00[v0]); - sub_0200D3CC(param0->unk_3E4.unk_00[v0], 0); + CellActorData_SetPositionXY(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1]); + CellActorData_UpdateObject(param0->unk_3E4.unk_00[v0]); + CellActorData_SetAnimFrame(param0->unk_3E4.unk_00[v0], 0); ov76_0223B870(¶m0->unk_D4.unk_FC[v0], param0->unk_3E4.unk_00[v0], v7[v0][0], v7[v0][1]); } } @@ -1278,7 +1278,7 @@ void ov76_0223D2F4(UnkStruct_ov76_0223DE00 *param0, int param1) continue; } - SpriteActor_EnableObject(param0->unk_3E4.unk_00[v0], param1); + CellActorData_DrawSprite(param0->unk_3E4.unk_00[v0], param1); } } @@ -1296,6 +1296,6 @@ void ov76_0223D31C(UnkStruct_ov76_0223DE00 *param0) int v0; for (v0 = 8; v0 < 13; v0++) { - sub_0200D0F4(param0->unk_3E4.unk_00[v0]); + CellActorData_Delete(param0->unk_3E4.unk_00[v0]); } } diff --git a/src/overlay076/ov76_0223D338.c b/src/overlay076/ov76_0223D338.c index 6c5b6faca7..3367d9f2c0 100644 --- a/src/overlay076/ov76_0223D338.c +++ b/src/overlay076/ov76_0223D338.c @@ -34,13 +34,13 @@ #include "palette.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "string_list.h" #include "sys_task.h" #include "sys_task_manager.h" #include "touch_screen.h" #include "unk_02005474.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02015920.h" @@ -244,7 +244,7 @@ BOOL ov76_0223D550(UnkStruct_ov76_0223DE00 *param0) BOOL v0; v0 = Unk_ov76_0223EE04[param0->unk_3CC](param0); - sub_0200C7EC(param0->unk_D4.unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_D4.unk_0C); return v0; } @@ -293,12 +293,12 @@ static void ov76_0223D600(UnkStruct_ov76_0223DE00 *param0, int param1, BOOL para } ov76_0223C0EC(param0->unk_3C4[param1], &v0, &v1); - SpriteActor_SetSpritePositionXY(param0->unk_2F4[param1], v0, v1); + CellActorData_SetPositionXY(param0->unk_2F4[param1], v0, v1); if (param2 == 1) { param0->unk_3C4[v2] = param0->unk_3C4[param1]; ov76_0223C0EC(param0->unk_3C4[v2], &v0, &v1); - SpriteActor_SetSpritePositionXY(param0->unk_2F4[v2], v0, v1); + CellActorData_SetPositionXY(param0->unk_2F4[v2], v0, v1); } } @@ -452,14 +452,14 @@ void ov76_0223D94C(CellActorData *param0, int param1) { switch (param1) { case 0: - sub_0200D3CC(param0, 1); + CellActorData_SetAnimFrame(param0, 1); break; case 2: - sub_0200D3CC(param0, 2); + CellActorData_SetAnimFrame(param0, 2); break; case 1: case 3: - sub_0200D3CC(param0, 0); + CellActorData_SetAnimFrame(param0, 0); break; default: GF_ASSERT(0); @@ -485,12 +485,12 @@ static void ov76_0223D9AC(SysTask *param0, void *param1) switch (v0->unk_00) { case 3: ov76_0223D984(v0->unk_08, 0, -1); - sub_0200D3CC(v0->unk_04, 2); + CellActorData_SetAnimFrame(v0->unk_04, 2); v0->unk_00++; break; case 6: ov76_0223D984(v0->unk_08, 0, +2); - sub_0200D3CC(v0->unk_04, 0); + CellActorData_SetAnimFrame(v0->unk_04, 0); SysTask_Done(param0); Heap_FreeToHeap(v0); break; @@ -1125,7 +1125,7 @@ static BOOL ov76_0223DF94(UnkStruct_ov76_0223DE00 *param0) break; } - SpriteActor_EnableObject(param0->unk_2F4[1], 0); + CellActorData_DrawSprite(param0->unk_2F4[1], 0); ov76_0223D494(param0, 0, 0xff, 0); ov76_0223CA30(¶m0->unk_D4.unk_18[0], 7); ov76_0223CDA4(param0); @@ -1148,7 +1148,7 @@ static BOOL ov76_0223DF94(UnkStruct_ov76_0223DE00 *param0) v15 = sub_02098164(param0->unk_324[v13].unk_04); ov76_0223CDC4(¶m0->unk_D4.unk_18[0], v15); - SpriteActor_SetSpritePositionXY(param0->unk_324[v13].unk_08, v11, v12); + CellActorData_SetPositionXY(param0->unk_324[v13].unk_08, v11, v12); ov76_0223B758(param0, v13); ov76_0223B7D4(param0, v13); } else { @@ -1254,11 +1254,11 @@ static BOOL ov76_0223E9C4(UnkStruct_ov76_0223DE00 *param0) { switch (param0->unk_3D4) { case 0: - sub_0200D474(param0->unk_2F4[0], 25); - sub_0200D474(param0->unk_2F4[1], 20); - sub_0200D364(param0->unk_2F4[0], 1); + CellActorData_SetPriority(param0->unk_2F4[0], 25); + CellActorData_SetPriority(param0->unk_2F4[1], 20); + CellActorData_SetAnim(param0->unk_2F4[0], 1); ov76_0223CA30(¶m0->unk_D4.unk_18[0], 10); - SpriteActor_EnableObject(param0->unk_2F4[1], 1); + CellActorData_DrawSprite(param0->unk_2F4[1], 1); param0->unk_3D4++; case 1: { BOOL v0; @@ -1276,7 +1276,7 @@ static BOOL ov76_0223E9C4(UnkStruct_ov76_0223DE00 *param0) param0->unk_3D4 = 2; Sound_PlayEffect(1500); } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { - SpriteActor_EnableObject(param0->unk_2F4[1], 0); + CellActorData_DrawSprite(param0->unk_2F4[1], 0); ov76_0223D600(param0, 0, 1); param0->unk_3D4 = 3; Sound_PlayEffect(1501); @@ -1288,10 +1288,10 @@ static BOOL ov76_0223E9C4(UnkStruct_ov76_0223DE00 *param0) } break; case 3: - sub_0200D474(param0->unk_2F4[0], 20); - sub_0200D474(param0->unk_2F4[1], 25); + CellActorData_SetPriority(param0->unk_2F4[0], 20); + CellActorData_SetPriority(param0->unk_2F4[1], 25); ov76_0223D494(param0, 0, 0xff, 0); - sub_0200D364(param0->unk_2F4[0], 0); + CellActorData_SetAnim(param0->unk_2F4[0], 0); ov76_0223CA30(¶m0->unk_D4.unk_18[0], 7); break; } diff --git a/src/overlay077/ov77_021D54B0.c b/src/overlay077/ov77_021D54B0.c index ec58775e9f..54070a3157 100644 --- a/src/overlay077/ov77_021D54B0.c +++ b/src/overlay077/ov77_021D54B0.c @@ -3,8 +3,6 @@ #include #include -#include "struct_defs/struct_0200C738.h" - #include "overlay022/struct_ov22_022559F8.h" #include "overlay077/ov77_021D6670.h" #include "overlay077/struct_ov77_021D6734_decl.h" @@ -12,6 +10,7 @@ #include "cell_actor.h" #include "core_sys.h" #include "gx_layers.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_020093B4.h" #include "unk_0200A328.h" @@ -26,7 +25,7 @@ void include_data_ov77_021D79B8(void); typedef struct UnkStruct_ov77_021D5564_t { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[11][4]; CellActor *unk_250[17]; diff --git a/src/overlay077/ov77_021D6670.c b/src/overlay077/ov77_021D6670.c index e3aa900f60..33d9e14e03 100644 --- a/src/overlay077/ov77_021D6670.c +++ b/src/overlay077/ov77_021D6670.c @@ -3,13 +3,12 @@ #include #include -#include "struct_defs/struct_0200C738.h" - #include "overlay022/struct_ov22_022559F8.h" #include "cell_actor.h" #include "gx_layers.h" #include "heap.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "sys_task.h" #include "sys_task_manager.h" @@ -50,7 +49,7 @@ typedef struct { typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; SpriteResourceCollection *unk_190[4]; SpriteResource *unk_1A0[4]; UnkStruct_ov77_021D6ADC unk_1B0[10]; diff --git a/src/overlay079/ov79_021D0D80.c b/src/overlay079/ov79_021D0D80.c index 1dd53dae75..32a2a92bb3 100644 --- a/src/overlay079/ov79_021D0D80.c +++ b/src/overlay079/ov79_021D0D80.c @@ -24,12 +24,12 @@ #include "narc.h" #include "overlay_manager.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_020158A8.h" #include "unk_02017728.h" @@ -748,7 +748,7 @@ static void ov79_021D167C(UnkStruct_ov79_021D0E1C *param0) }; for (v0 = 0; v0 < 3; v0++) { - param0->unk_1C0[v0] = sub_0200CA08(param0->unk_1B8, param0->unk_1BC, &v1[v0]); + param0->unk_1C0[v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_1B8, param0->unk_1BC, &v1[v0]); CellActor_SetDrawFlag(param0->unk_1C0[v0], 1); } @@ -767,11 +767,11 @@ static void ov79_021D167C(UnkStruct_ov79_021D0E1C *param0) { 0x1A, 0xA5 } }; - param0->unk_1CC[v0] = sub_0200CA08(param0->unk_1B8, param0->unk_1BC, &v1[3]); + param0->unk_1CC[v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_1B8, param0->unk_1BC, &v1[3]); CellActor_SetDrawFlag(param0->unk_1CC[v0], 1); CellActor_SetAnim(param0->unk_1CC[v0], v0 + 3); - SpriteActor_SetPositionXY(param0->unk_1CC[v0], v2[v0].unk_00, v2[v0].unk_02); + CellActor_SetPositionXY(param0->unk_1CC[v0], v2[v0].unk_00, v2[v0].unk_02); } for (v0 = 0; v0 < 6; v0++) { @@ -786,19 +786,19 @@ static void ov79_021D167C(UnkStruct_ov79_021D0E1C *param0) { 0x80, 0x74 } }; - param0->unk_1E0[v0] = sub_0200CA08(param0->unk_1B8, param0->unk_1BC, &v1[4]); + param0->unk_1E0[v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_1B8, param0->unk_1BC, &v1[4]); CellActor_SetDrawFlag(param0->unk_1E0[v0], 1); CellActor_SetAnim(param0->unk_1E0[v0], v0 * 3); CellActor_SetAnimSpeed(param0->unk_1E0[v0], FX32_CONST(2)); CellActor_SetExplicitPalette(param0->unk_1E0[v0], v0 + 2); CellActor_SetAnimateFlag(param0->unk_1E0[v0], 0); - SpriteActor_SetPositionXY(param0->unk_1E0[v0], v3[v0].unk_00, v3[v0].unk_02); + CellActor_SetPositionXY(param0->unk_1E0[v0], v3[v0].unk_00, v3[v0].unk_02); } param0->unk_1FC = sub_0209916C(param0->unk_1F8, 0, 231, 76, 0, 1, 0, 0); - SpriteActor_EnableObject(param0->unk_1FC->unk_04, 0); + CellActorData_DrawSprite(param0->unk_1FC->unk_04, 0); } static void ov79_021D17E8(UnkStruct_ov79_021D0E1C *param0) @@ -808,14 +808,14 @@ static void ov79_021D17E8(UnkStruct_ov79_021D0E1C *param0) sub_02099370(param0->unk_1F8, param0->unk_1FC); for (v0 = 0; v0 < 6; v0++) { - sub_0200C7E4(param0->unk_1E0[v0]); + thunk_CellActor_Delete(param0->unk_1E0[v0]); } for (v0 = 0; v0 < 5; v0++) { - sub_0200C7E4(param0->unk_1CC[v0]); + thunk_CellActor_Delete(param0->unk_1CC[v0]); } for (v0 = 0; v0 < 3; v0++) { - sub_0200C7E4(param0->unk_1C0[v0]); + thunk_CellActor_Delete(param0->unk_1C0[v0]); } } diff --git a/src/overlay079/ov79_021D183C.c b/src/overlay079/ov79_021D183C.c index 4d2a79ca93..21b42db5e5 100644 --- a/src/overlay079/ov79_021D183C.c +++ b/src/overlay079/ov79_021D183C.c @@ -15,12 +15,12 @@ #include "menu.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" #include "text.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_020158A8.h" #include "unk_02098FFC.h" @@ -324,7 +324,7 @@ static void ov79_021D1D94(ListMenu *param0, u32 param1, u8 param2) } ListMenu_GetListAndCursorPos(param0, &v2, &v3); - SpriteActor_SetPositionXY(v0->unk_1C0[0], 105, v3 * 16 + 40); + CellActor_SetPositionXY(v0->unk_1C0[0], 105, v3 * 16 + 40); if (v2 == 0) { CellActor_SetDrawFlag(v0->unk_1C0[1], 0); @@ -343,7 +343,7 @@ static void ov79_021D1D94(ListMenu *param0, u32 param1, u8 param2) if (param1 == 0xFF) { ov79_021D1D20(v0, NULL); Window_CopyToVRAM(&v0->unk_E8[1]); - SpriteActor_EnableObject(v0->unk_1FC->unk_04, 0); + CellActorData_DrawSprite(v0->unk_1FC->unk_04, 0); return; } @@ -360,7 +360,7 @@ static void ov79_021D1D94(ListMenu *param0, u32 param1, u8 param2) StringTemplate_Format(v0->unk_30.unk_00, v0->unk_30.unk_04, v0->unk_30.unk_10); Text_AddPrinterWithParamsAndColor(&v0->unk_E8[1], FONT_SYSTEM, v0->unk_30.unk_04, 8, 0, TEXT_SPEED_INSTANT, v1, NULL); sub_0209933C(v0->unk_1F8, v0->unk_1FC, v0->unk_20->unk_1C[param1].unk_02); - SpriteActor_EnableObject(v0->unk_1FC->unk_04, 1); + CellActorData_DrawSprite(v0->unk_1FC->unk_04, 1); } void ov79_021D1ED8(UnkStruct_ov79_021D0E1C *param0) diff --git a/src/overlay079/ov79_021D20F4.c b/src/overlay079/ov79_021D20F4.c index c2c8142bb2..45da3ae371 100644 --- a/src/overlay079/ov79_021D20F4.c +++ b/src/overlay079/ov79_021D20F4.c @@ -10,9 +10,9 @@ #include "cell_actor.h" #include "communication_system.h" #include "gx_layers.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_0200A784.h" -#include "unk_0200C6E4.h" #include "unk_0201DBEC.h" #include "unk_020393C8.h" #include "unk_02098FFC.h" @@ -25,8 +25,8 @@ void ov79_021D20F4(UnkStruct_ov79_021D0E1C *param0) { VRAMTransferManager_New(32, param0->unk_00); - param0->unk_1B8 = sub_0200C6E4(param0->unk_00); - param0->unk_1BC = sub_0200C704(param0->unk_1B8); + param0->unk_1B8 = SpriteRenderer_Create(param0->unk_00); + param0->unk_1BC = SpriteRenderer_CreateGfxHandler(param0->unk_1B8); { UnkStruct_ov104_0224133C v0 = { @@ -47,8 +47,8 @@ void ov79_021D20F4(UnkStruct_ov79_021D0E1C *param0) GX_OBJVRAMMODE_CHAR_1D_32K, }; - sub_0200C73C(param0->unk_1B8, &v0, &v1, 32); - sub_0200C7C0(param0->unk_1B8, param0->unk_1BC, 3 + 5 + 6); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_1B8, &v0, &v1, 32); + SpriteRenderer_CreateCellActorList(param0->unk_1B8, param0->unk_1BC, 3 + 5 + 6); sub_0200A93C(param0->unk_00); sub_0200A944(param0->unk_00); @@ -65,7 +65,7 @@ void ov79_021D20F4(UnkStruct_ov79_021D0E1C *param0) "data/porucase_celact.cldat" }; - LoadSpriteResourceData(param0->unk_1B8, param0->unk_1BC, &v2); + SpriteRenderer_LoadSpriteResourceData(param0->unk_1B8, param0->unk_1BC, &v2); } param0->unk_1F8 = sub_02098FFC(param0->unk_00, 1, 1, (NNS_G2D_VRAM_TYPE_2DMAIN), 0); @@ -81,14 +81,14 @@ void ov79_021D20F4(UnkStruct_ov79_021D0E1C *param0) void ov79_021D21CC(UnkStruct_ov79_021D0E1C *param0) { sub_0209903C(param0->unk_1F8); - sub_0200C8B0(param0->unk_1B8, param0->unk_1BC); - sub_0200C8D4(param0->unk_1B8); + SpriteRenderer_DeleteGfxHandler(param0->unk_1B8, param0->unk_1BC); + SpriteRenderer_Free(param0->unk_1B8); VRAMTransferManager_Destroy(); } void ov79_021D21F8(UnkStruct_ov79_021D0E1C *param0) { - sub_0200C7EC(param0->unk_1BC); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_1BC); sub_02099160(param0->unk_1F8); } diff --git a/src/overlay079/ov79_021D2268.c b/src/overlay079/ov79_021D2268.c index a7f6bcb6f1..d5eebb9022 100644 --- a/src/overlay079/ov79_021D2268.c +++ b/src/overlay079/ov79_021D2268.c @@ -30,6 +30,7 @@ #include "overlay_manager.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -38,7 +39,6 @@ #include "unk_02005474.h" #include "unk_0200762C.h" #include "unk_0200A784.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201D15C.h" @@ -534,7 +534,7 @@ static void ov79_021D2864(UnkStruct_ov79_021D2928 *param0) { VRAMTransferManager_New(32, param0->unk_00); - param0->unk_7C = sub_0200C6E4(param0->unk_00); + param0->unk_7C = SpriteRenderer_Create(param0->unk_00); { UnkStruct_ov104_0224133C v0 = { @@ -555,14 +555,14 @@ static void ov79_021D2864(UnkStruct_ov79_021D2928 *param0) GX_OBJVRAMMODE_CHAR_1D_32K, }; - sub_0200C73C(param0->unk_7C, &v0, &v1, 32); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_7C, &v0, &v1, 32); sub_0200A93C(param0->unk_00); } param0->unk_5C = sub_02098FFC(param0->unk_00, 2, 2, (NNS_G2D_VRAM_TYPE_2DMAIN), 0); param0->unk_60[0] = sub_0209916C(param0->unk_5C, param0->unk_10->unk_08, 100, 90, 0, 1, 0, 0); - SpriteActor_EnableObject(param0->unk_60[0]->unk_04, 0); + CellActorData_DrawSprite(param0->unk_60[0]->unk_04, 0); if (CommSys_IsInitialized()) { sub_02039734(); @@ -575,7 +575,7 @@ static void ov79_021D2908(UnkStruct_ov79_021D2928 *param0) { sub_02099370(param0->unk_5C, param0->unk_60[0]); sub_0209903C(param0->unk_5C); - sub_0200C8D4(param0->unk_7C); + SpriteRenderer_Free(param0->unk_7C); VRAMTransferManager_Destroy(); } @@ -643,7 +643,7 @@ static int ov79_021D2A04(UnkStruct_ov79_021D2928 *param0, UnkStruct_ov79_021D29B MI_CpuClear8(param1, sizeof(UnkStruct_ov79_021D29B4)); - param1->unk_C4 = param0->unk_60[0]->unk_04->unk_00; + param1->unk_C4 = param0->unk_60[0]->unk_04->cellActor; param1->unk_C8 = param0->unk_40.unk_18; param1->unk_08 = param0->unk_30.unk_09; param1->unk_00 = 24; diff --git a/src/overlay080/ov80_021D1458.c b/src/overlay080/ov80_021D1458.c index cbde7985dc..bcd873474a 100644 --- a/src/overlay080/ov80_021D1458.c +++ b/src/overlay080/ov80_021D1458.c @@ -19,13 +19,13 @@ #include "heap.h" #include "message.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02039C80.h" #include "unk_02071CFC.h" @@ -622,7 +622,7 @@ static void ov80_021D1C24(UnkStruct_ov80_021D2A08 *param0) } if (v1->unk_13-- == 3) { - SpriteActor_SetPositionXY(v1->unk_104, v1->unk_18 * 7 + (48 - 23), v1->unk_1C * 7 + (6 - 40)); + CellActor_SetPositionXY(v1->unk_104, v1->unk_18 * 7 + (48 - 23), v1->unk_1C * 7 + (6 - 40)); CellActor_UpdateAnim(v1->unk_104, FX32_ONE); ov80_021D1A30(param0); @@ -910,18 +910,18 @@ static void ov80_021D2398(UnkStruct_ov80_021D2A08 *param0) UnkStruct_ov80_021D1478 *v0 = param0->unk_34; UnkStruct_ov7_0224F358 v1 = Unk_ov80_021D30E8[2]; - v0->unk_100 = sub_0200CA08(param0->unk_D8, param0->unk_DC, &Unk_ov80_021D30E8[0]); + v0->unk_100 = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_D8, param0->unk_DC, &Unk_ov80_021D30E8[0]); CellActor_SetDrawFlag(v0->unk_100, 0); CellActor_SetAnimSpeed(v0->unk_100, FX32_ONE); - SpriteActor_SetPositionXY(v0->unk_100, 128, 108); + CellActor_SetPositionXY(v0->unk_100, 128, 108); - v0->unk_104 = sub_0200CA08(param0->unk_D8, param0->unk_DC, &Unk_ov80_021D30E8[1]); + v0->unk_104 = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_D8, param0->unk_DC, &Unk_ov80_021D30E8[1]); CellActor_SetDrawFlag(v0->unk_104, 1); CellActor_SetAnimSpeed(v0->unk_104, FX32_CONST(2)); CellActor_SetAnimateFlag(v0->unk_104, 1); - SpriteActor_SetPositionXY(v0->unk_104, v0->unk_18 * 7 + (48 - 23), v0->unk_1C * 7 + (6 - 40)); + CellActor_SetPositionXY(v0->unk_104, v0->unk_18 * 7 + (48 - 23), v0->unk_1C * 7 + (6 - 40)); if (param0->unk_2C->unk_0C == 0) { v1.unk_10 = 1; @@ -929,11 +929,11 @@ static void ov80_021D2398(UnkStruct_ov80_021D2A08 *param0) v1.unk_10 = 0; } - v0->unk_108 = sub_0200CA08(param0->unk_D8, param0->unk_DC, &v1); + v0->unk_108 = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_D8, param0->unk_DC, &v1); CellActor_SetDrawFlag(v0->unk_108, 1); SpriteActor_SetAnimFrame(v0->unk_108, param0->unk_2C->unk_0C); - SpriteActor_SetPositionXY(v0->unk_108, v0->unk_18 * 7 + (48 - 23), v0->unk_1C * 7 + (6 - 40)); + CellActor_SetPositionXY(v0->unk_108, v0->unk_18 * 7 + (48 - 23), v0->unk_1C * 7 + (6 - 40)); } static void ov80_021D24BC(UnkStruct_ov80_021D2A08 *param0, int param1, int param2) @@ -1020,9 +1020,9 @@ static void ov80_021D259C(UnkStruct_ov80_021D2A08 *param0) v2->unk_0A = v3; v2->unk_0B = 1; - v2->unk_0C = sub_0200CA08(param0->unk_D8, param0->unk_DC, &(Unk_ov80_021D30E8)); + v2->unk_0C = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_D8, param0->unk_DC, &(Unk_ov80_021D30E8)); - SpriteActor_SetPositionXY(v2->unk_0C, v2->unk_00 * 7 + 25, v2->unk_04 * 7 + -34); + CellActor_SetPositionXY(v2->unk_0C, v2->unk_00 * 7 + 25, v2->unk_04 * 7 + -34); CellActor_SetPriority(v2->unk_0C, 2); CellActor_SetDrawFlag(v2->unk_0C, 0); } @@ -1066,7 +1066,7 @@ static void ov80_021D2700(UnkStruct_ov80_021D2A08 *param0) for (v2 = 0; v2 < v0->unk_A4.unk_00; v2++) { v1 = &(v0->unk_A4.unk_0C[v2]); - sub_0200C7E4(v1->unk_0C); + thunk_CellActor_Delete(v1->unk_0C); } } diff --git a/src/overlay080/ov80_021D2A08.c b/src/overlay080/ov80_021D2A08.c index 1d3c7f239c..e320185a68 100644 --- a/src/overlay080/ov80_021D2A08.c +++ b/src/overlay080/ov80_021D2A08.c @@ -6,8 +6,8 @@ #include "overlay104/struct_ov104_0224133C.h" #include "gx_layers.h" +#include "sprite_renderer.h" #include "sprite_resource.h" -#include "unk_0200C6E4.h" #include "unk_0201DBEC.h" void ov80_021D2A08(UnkStruct_ov80_021D2A08 *param0); @@ -21,8 +21,8 @@ void ov80_021D2A08(UnkStruct_ov80_021D2A08 *param0) GXLayers_EngineBToggleLayers(GX_PLANEMASK_OBJ, 1); VRAMTransferManager_New(32, param0->unk_04); - param0->unk_D8 = sub_0200C6E4(param0->unk_04); - param0->unk_DC = sub_0200C704(param0->unk_D8); + param0->unk_D8 = SpriteRenderer_Create(param0->unk_04); + param0->unk_DC = SpriteRenderer_CreateGfxHandler(param0->unk_D8); { UnkStruct_ov104_0224133C v0 = { @@ -43,8 +43,8 @@ void ov80_021D2A08(UnkStruct_ov80_021D2A08 *param0) GX_OBJVRAMMODE_CHAR_1D_32K, }; - sub_0200C73C(param0->unk_D8, &v0, &v1, 32); - sub_0200C7C0(param0->unk_D8, param0->unk_DC, (1 + 1 + 1 + 5 + 20)); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_D8, &v0, &v1, 32); + SpriteRenderer_CreateCellActorList(param0->unk_D8, param0->unk_DC, (1 + 1 + 1 + 5 + 20)); } { @@ -58,20 +58,20 @@ void ov80_021D2A08(UnkStruct_ov80_021D2A08 *param0) "data/tmapn_celact.cldat" }; - LoadSpriteResourceData(param0->unk_D8, param0->unk_DC, &v2); + SpriteRenderer_LoadSpriteResourceData(param0->unk_D8, param0->unk_DC, &v2); } } void ov80_021D2AC0(UnkStruct_ov80_021D2A08 *param0) { - sub_0200C8B0(param0->unk_D8, param0->unk_DC); - sub_0200C8D4(param0->unk_D8); + SpriteRenderer_DeleteGfxHandler(param0->unk_D8, param0->unk_DC); + SpriteRenderer_Free(param0->unk_D8); VRAMTransferManager_Destroy(); } void ov80_021D2AE0(UnkStruct_ov80_021D2A08 *param0) { - sub_0200C7EC(param0->unk_DC); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_DC); } void ov80_021D2AEC(UnkStruct_ov80_021D2A08 *param0) diff --git a/src/overlay080/ov80_021D2AF4.c b/src/overlay080/ov80_021D2AF4.c index 2338507d1e..e998c378ce 100644 --- a/src/overlay080/ov80_021D2AF4.c +++ b/src/overlay080/ov80_021D2AF4.c @@ -15,7 +15,7 @@ #include "cell_actor.h" #include "heap.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" const UnkStruct_ov80_021D2C5C_sub1 Unk_ov80_021D31D8[20] = { { 0x19B, 0x0, 0x0, 0x0, 0x0, 0x15, 0xBD }, @@ -68,7 +68,7 @@ UnkStruct_ov80_021D2C1C *ov80_021D2AF4(SpriteRenderer *param0, SpriteGfxHandler v1->unk_00.unk_0C = v2[v3].unk_0C; v1->unk_00.unk_10 = v2[v3].unk_10; v1->unk_14 = param2[v3]; - v1->unk_18 = sub_0200CA08(param0, param1, &v4); + v1->unk_18 = SpriteRenderer_CreateCellActorFromTemplate(param0, param1, &v4); CellActor_SetDrawFlag(v1->unk_18, 1); @@ -81,7 +81,7 @@ UnkStruct_ov80_021D2C1C *ov80_021D2AF4(SpriteRenderer *param0, SpriteGfxHandler } CellActor_UpdateAnim(v1->unk_18, FX32_CONST(v1->unk_00.unk_08)); - SpriteActor_SetPositionXY(v1->unk_18, v1->unk_00.unk_0C + 25, v1->unk_00.unk_10 + -34); + CellActor_SetPositionXY(v1->unk_18, v1->unk_00.unk_0C + 25, v1->unk_00.unk_10 + -34); } return v0; diff --git a/src/overlay084/ov84_0223B5A0.c b/src/overlay084/ov84_0223B5A0.c index 2289302df9..820d08fdbb 100644 --- a/src/overlay084/ov84_0223B5A0.c +++ b/src/overlay084/ov84_0223B5A0.c @@ -35,6 +35,7 @@ #include "render_text.h" #include "render_window.h" #include "save_player.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" @@ -44,7 +45,6 @@ #include "unk_020041CC.h" #include "unk_02005474.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201D15C.h" @@ -557,7 +557,7 @@ int ov84_0223B76C(OverlayManager *param0, int *param1) ov84_0223D014(v0); ov84_02240E5C(v0); ov84_02240ABC(v0); - sub_0200C7EC(v0->unk_DC); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_DC); return 0; } @@ -1103,9 +1103,9 @@ static void ov84_0223C2AC(ListMenu *param0, u32 param1, u8 param2) v0->unk_482 = (v0->unk_482 + 1) % 3; - if ((v0->unk_492 == 0) || (sub_0200D3B8(v0->unk_E0[0]) == 0)) { - sub_0200D3CC(v0->unk_E0[0], 0); - sub_0200D364( + if ((v0->unk_492 == 0) || (CellActorData_IsAnimated(v0->unk_E0[0]) == 0)) { + CellActorData_SetAnimFrame(v0->unk_E0[0], 0); + CellActorData_SetAnim( v0->unk_E0[0], 8 + v0->unk_C4->unk_04[v0->unk_C4->unk_64].unk_08); } } @@ -1240,7 +1240,7 @@ static u8 ov84_0223C5B8(UnkStruct_ov84_0223B5A0 *param0) ListMenu_GetListAndCursorPos(param0->unk_15C, &v2, &v3); if (v0->unk_04 != v3) { - SpriteActor_SetSpritePositionXY( + CellActorData_SetPositionXY( param0->unk_E0[4], 177, 24 + (v3 - 1) * 16); } @@ -1374,8 +1374,8 @@ static void ov84_0223C89C(UnkStruct_ov84_0223B5A0 *param0) Window_FillTilemap(¶m0->unk_04[1], 0); Window_ScheduleCopyToVRAM(¶m0->unk_04[0]); Window_ScheduleCopyToVRAM(¶m0->unk_04[1]); - SpriteActor_EnableObject(param0->unk_E0[4], 0); - SpriteActor_EnableObject(param0->unk_E0[7], 0); + CellActorData_DrawSprite(param0->unk_E0[4], 0); + CellActorData_DrawSprite(param0->unk_E0[7], 0); ov84_0223F3AC(param0, param0->unk_C4->unk_64, 0); ov84_0223CF20(param0, param0->unk_C4->unk_64, 0); } @@ -1438,7 +1438,7 @@ static u8 ov84_0223C920(UnkStruct_ov84_0223B5A0 *param0) Bg_ScheduleTilemapTransfer(param0->unk_00, 4); } - SpriteActor_EnableObject(param0->unk_E0[7], 1); + CellActorData_DrawSprite(param0->unk_E0[7], 1); return 1; } @@ -1455,7 +1455,7 @@ static u8 ov84_0223CA5C(UnkStruct_ov84_0223B5A0 *param0) } Sound_PlayEffect(1738); - sub_0200D364(param0->unk_E0[0], param0->unk_C4->unk_04[v0->unk_00].unk_08); + CellActorData_SetAnim(param0->unk_E0[0], param0->unk_C4->unk_04[v0->unk_00].unk_08); ov84_0223CF20(param0, v0->unk_00, 0); Bg_ScheduleTilemapTransfer(param0->unk_00, 4); @@ -1488,7 +1488,7 @@ static u8 ov84_0223CA5C(UnkStruct_ov84_0223B5A0 *param0) } Sound_PlayEffect(1738); - sub_0200D364(param0->unk_E0[0], param0->unk_C4->unk_04[v0->unk_00].unk_08); + CellActorData_SetAnim(param0->unk_E0[0], param0->unk_C4->unk_04[v0->unk_00].unk_08); ov84_0223CF20(param0, v0->unk_00, 0); Bg_ScheduleTilemapTransfer(param0->unk_00, 4); @@ -1540,15 +1540,15 @@ static u8 ov84_0223CBD8(UnkStruct_ov84_0223B5A0 *param0) param0->unk_C4->unk_64 = v0->unk_00; - sub_0200D364(param0->unk_E0[0], param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_08); + CellActorData_SetAnim(param0->unk_E0[0], param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_08); ov84_0223F438(param0); ov84_0223F3AC(param0, param0->unk_C4->unk_64, 1); ov84_0223BFBC(param0); ov84_0223C194(¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06, ¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_09); ov84_0223C1D0(¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06, ¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_09, 9); ov84_0223C224(param0, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04); - SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); - SpriteActor_EnableObject(param0->unk_E0[4], 1); + CellActorData_SetPositionXY(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); + CellActorData_DrawSprite(param0->unk_E0[4], 1); v0->unk_02++; return 1; @@ -1763,22 +1763,22 @@ static void ov84_0223D0FC(UnkStruct_ov84_0223B5A0 *param0) SpriteActor_GetSpritePositionXY(param0->unk_E0[2], &v0, &v1); v0 -= 1; - SpriteActor_SetSpritePositionXY(param0->unk_E0[2], v0, v1); + CellActorData_SetPositionXY(param0->unk_E0[2], v0, v1); SpriteActor_GetSpritePositionXY(param0->unk_E0[3], &v0, &v1); v0 += 1; - SpriteActor_SetSpritePositionXY(param0->unk_E0[3], v0, v1); + CellActorData_SetPositionXY(param0->unk_E0[3], v0, v1); break; case 2: case 3: SpriteActor_GetSpritePositionXY(param0->unk_E0[2], &v0, &v1); v0 += 1; - SpriteActor_SetSpritePositionXY(param0->unk_E0[2], v0, v1); + CellActorData_SetPositionXY(param0->unk_E0[2], v0, v1); SpriteActor_GetSpritePositionXY(param0->unk_E0[3], &v0, &v1); v0 -= 1; - SpriteActor_SetSpritePositionXY(param0->unk_E0[3], v0, v1); + CellActorData_SetPositionXY(param0->unk_E0[3], v0, v1); break; } @@ -1868,7 +1868,7 @@ static u8 ov84_0223D2F8(UnkStruct_ov84_0223B5A0 *param0) ListMenu_GetListAndCursorPos(param0->unk_15C, &v2, &v3); if (v0->unk_04 != v3) { - SpriteActor_SetSpritePositionXY(param0->unk_E0[5], 177, 24 + (v3 - 1) * 16 - 8); + CellActorData_SetPositionXY(param0->unk_E0[5], 177, 24 + (v3 - 1) * 16 - 8); } v0->unk_06 = v2; @@ -1941,22 +1941,22 @@ static void ov84_0223D4E8(UnkStruct_ov84_0223B5A0 *param0) UnkStruct_ov84_0223BE5C *v0 = ¶m0->unk_C4->unk_04[param0->unk_C4->unk_64]; if (param0->unk_47A == 0) { - SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (v0->unk_04 - 1) * 16); - SpriteActor_EnableObject(param0->unk_E0[4], 1); - SpriteActor_EnableObject(param0->unk_E0[5], 0); + CellActorData_SetPositionXY(param0->unk_E0[4], 177, 24 + (v0->unk_04 - 1) * 16); + CellActorData_DrawSprite(param0->unk_E0[4], 1); + CellActorData_DrawSprite(param0->unk_E0[5], 0); if (param0->unk_424 != 1) { - SpriteActor_EnableObject(param0->unk_E0[2], 1); - SpriteActor_EnableObject(param0->unk_E0[3], 1); + CellActorData_DrawSprite(param0->unk_E0[2], 1); + CellActorData_DrawSprite(param0->unk_E0[3], 1); } } else { - SpriteActor_SetSpritePositionXY(param0->unk_E0[5], 177, 24 + (v0->unk_04 - 1) * 16 - 8); - SpriteActor_EnableObject(param0->unk_E0[4], 0); - SpriteActor_EnableObject(param0->unk_E0[5], 1); + CellActorData_SetPositionXY(param0->unk_E0[5], 177, 24 + (v0->unk_04 - 1) * 16 - 8); + CellActorData_DrawSprite(param0->unk_E0[4], 0); + CellActorData_DrawSprite(param0->unk_E0[5], 1); if (param0->unk_424 != 1) { - SpriteActor_EnableObject(param0->unk_E0[2], 0); - SpriteActor_EnableObject(param0->unk_E0[3], 0); + CellActorData_DrawSprite(param0->unk_E0[2], 0); + CellActorData_DrawSprite(param0->unk_E0[3], 0); } } } @@ -2080,10 +2080,10 @@ static void ov84_0223D7E8(UnkStruct_ov84_0223B5A0 *param0, u8 param1) { if (param1 == 0) { Bg_LoadToTilemapRect(param0->unk_00, 1, Unk_ov84_02241064, 0, 18, 5, 5); - SpriteActor_EnableObject(param0->unk_E0[7], 1); + CellActorData_DrawSprite(param0->unk_E0[7], 1); } else { Bg_LoadToTilemapRect(param0->unk_00, 1, Unk_ov84_02241096, 0, 18, 5, 5); - SpriteActor_EnableObject(param0->unk_E0[7], 0); + CellActorData_DrawSprite(param0->unk_E0[7], 0); } Bg_ScheduleTilemapTransfer(param0->unk_00, 1); @@ -3055,7 +3055,7 @@ static BOOL ov84_0223ED64(UnkStruct_ov84_0223B5A0 *param0, u16 param1) return 0; } - SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (v1 - 1) * 16); + CellActorData_SetPositionXY(param0->unk_E0[4], 177, 24 + (v1 - 1) * 16); param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06 = v0; param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 = v1; @@ -3101,7 +3101,7 @@ static BOOL ov84_0223EE80(UnkStruct_ov84_0223B5A0 *param0, u16 param1) return 0; } - SpriteActor_SetSpritePositionXY(param0->unk_E0[5], 177, 24 + (v1 - 1) * 16 - 8); + CellActorData_SetPositionXY(param0->unk_E0[5], 177, 24 + (v1 - 1) * 16 - 8); param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06 = v0; param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 = v1; diff --git a/src/overlay084/ov84_022403F4.c b/src/overlay084/ov84_022403F4.c index c47d4e62e5..67d6b47614 100644 --- a/src/overlay084/ov84_022403F4.c +++ b/src/overlay084/ov84_022403F4.c @@ -16,7 +16,7 @@ #include "gx_layers.h" #include "item.h" #include "move_table.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" #include "unk_0201DBEC.h" #include "unk_0207C908.h" @@ -188,8 +188,8 @@ static void ov84_02240424(UnkStruct_ov84_0223B5A0 *param0) { UnkStruct_ov104_02241308 v0 = { 10, 6, 9, 9, 0, 0 }; - param0->unk_D8 = sub_0200C6E4(6); - param0->unk_DC = sub_0200C704(param0->unk_D8); + param0->unk_D8 = SpriteRenderer_Create(6); + param0->unk_DC = SpriteRenderer_CreateGfxHandler(param0->unk_D8); { UnkStruct_ov104_0224133C v1 = { 0, @@ -210,11 +210,11 @@ static void ov84_02240424(UnkStruct_ov84_0223B5A0 *param0) GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->unk_D8, &v1, &v2, 32); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_D8, &v1, &v2, 32); } - sub_0200C7C0(param0->unk_D8, param0->unk_DC, 12); - sub_0200CB30(param0->unk_D8, param0->unk_DC, &v0); + SpriteRenderer_CreateCellActorList(param0->unk_D8, param0->unk_DC, 12); + SpriteRenderer_InitGfxResourceList(param0->unk_D8, param0->unk_DC, &v0); } static void ov84_022404C0(UnkStruct_ov84_0223B5A0 *param0) @@ -235,32 +235,32 @@ static void ov84_022404C0(UnkStruct_ov84_0223B5A0 *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 31, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49404); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49405); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 36, 0, NNS_G2D_VRAM_TYPE_2DSUB, 49406); - sub_0200CBDC(param0->unk_D8, param0->unk_DC, 62, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49408); - sub_0200CBDC(param0->unk_D8, param0->unk_DC, 16, Item_FileID(0, 1), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49407); + SpriteRenderer_LoadCharResObj(param0->unk_D8, param0->unk_DC, 62, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49408); + SpriteRenderer_LoadCharResObj(param0->unk_D8, param0->unk_DC, 16, Item_FileID(0, 1), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49407); sub_0207C948(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 49409); sub_0207CAC4(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 49410); - sub_0200CD0C(param0->unk_D8, param0->unk_DC, param0->unk_D4, v1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 49401); - sub_0200CD0C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 20, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 49402); - sub_0200CC9C(param0->unk_D8, param0->unk_DC, 16, Item_FileID(0, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 49404); - sub_0200CC9C(param0->unk_D8, param0->unk_DC, 62, 10, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 49405); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, v1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 49401); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 20, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 49402); + SpriteRenderer_LoadPaletteResObj(param0->unk_D8, param0->unk_DC, 16, Item_FileID(0, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 49404); + SpriteRenderer_LoadPaletteResObj(param0->unk_D8, param0->unk_DC, 62, 10, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 49405); sub_0207C97C(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 49406); - sub_0200CD0C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 37, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 49403); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 37, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 49403); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 1, 0, 49401); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 24, 0, 49402); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 27, 0, 49403); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 30, 0, 49404); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 9, 0, 49405); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 35, 0, 49406); - sub_0200CE0C(param0->unk_D8, param0->unk_DC, 16, Item_IconNCERFile(), 0, 49407); - sub_0200CE0C(param0->unk_D8, param0->unk_DC, 62, 5, 0, 49408); + SpriteRenderer_LoadCellResObj(param0->unk_D8, param0->unk_DC, 16, Item_IconNCERFile(), 0, 49407); + SpriteRenderer_LoadCellResObj(param0->unk_D8, param0->unk_DC, 62, 5, 0, 49408); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 0, 0, 49401); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 23, 0, 49402); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 26, 0, 49403); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 29, 0, 49404); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 8, 0, 49405); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 34, 0, 49406); - sub_0200CE3C(param0->unk_D8, param0->unk_DC, 16, Item_IconNANRFile(), 0, 49407); - sub_0200CE3C(param0->unk_D8, param0->unk_DC, 62, 6, 0, 49408); + SpriteRenderer_LoadAnimResObj(param0->unk_D8, param0->unk_DC, 16, Item_IconNANRFile(), 0, 49407); + SpriteRenderer_LoadAnimResObj(param0->unk_D8, param0->unk_DC, 62, 6, 0, 49408); sub_0207C9EC(param0->unk_D8, param0->unk_DC, 49409, 49409); } @@ -269,32 +269,32 @@ static void ov84_02240950(UnkStruct_ov84_0223B5A0 *param0) u32 v0; for (v0 = 0; v0 < 12; v0++) { - param0->unk_E0[v0] = SpriteActor_LoadResources(param0->unk_D8, param0->unk_DC, &Unk_ov84_022411B0[v0]); + param0->unk_E0[v0] = CellActor_LoadResources(param0->unk_D8, param0->unk_DC, &Unk_ov84_022411B0[v0]); } - SpriteActor_EnableObject(param0->unk_E0[5], 0); - SpriteActor_EnableObject(param0->unk_E0[6], 0); - SpriteActor_EnableObject(param0->unk_E0[10], 0); - SpriteActor_EnableObject(param0->unk_E0[11], 0); + CellActorData_DrawSprite(param0->unk_E0[5], 0); + CellActorData_DrawSprite(param0->unk_E0[6], 0); + CellActorData_DrawSprite(param0->unk_E0[10], 0); + CellActorData_DrawSprite(param0->unk_E0[11], 0); if ((param0->unk_C4->unk_65 == 4) || (param0->unk_C4->unk_65 == 5)) { - SpriteActor_EnableObject(param0->unk_E0[1], 0); + CellActorData_DrawSprite(param0->unk_E0[1], 0); } if (param0->unk_424 == 1) { - SpriteActor_EnableObject(param0->unk_E0[2], 0); - SpriteActor_EnableObject(param0->unk_E0[3], 0); + CellActorData_DrawSprite(param0->unk_E0[2], 0); + CellActorData_DrawSprite(param0->unk_E0[3], 0); } ov84_02240D3C(param0, 0); - sub_0200D364(param0->unk_E0[0], param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_08); - SpriteActor_SetSpritePositionXY(param0->unk_E0[1], ov84_02240C30(param0, param0->unk_C4->unk_64), 97); - SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); + CellActorData_SetAnim(param0->unk_E0[0], param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_08); + CellActorData_SetPositionXY(param0->unk_E0[1], ov84_02240C30(param0, param0->unk_C4->unk_64), 97); + CellActorData_SetPositionXY(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); { VecFx32 v1 = { FX32_ONE, FX32_ONE, FX32_ONE }; - CellActor_SetAffineScaleEx(param0->unk_E0[0]->unk_00, &v1, 2); + CellActor_SetAffineScaleEx(param0->unk_E0[0]->cellActor, &v1, 2); } } @@ -303,11 +303,11 @@ void ov84_02240A88(UnkStruct_ov84_0223B5A0 *param0) u32 v0; for (v0 = 0; v0 < 12; v0++) { - sub_0200D0F4(param0->unk_E0[v0]); + CellActorData_Delete(param0->unk_E0[v0]); } - sub_0200D0B0(param0->unk_D8, param0->unk_DC); - sub_0200C8D4(param0->unk_D8); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_D8, param0->unk_DC); + SpriteRenderer_Free(param0->unk_D8); } void ov84_02240ABC(UnkStruct_ov84_0223B5A0 *param0) @@ -315,7 +315,7 @@ void ov84_02240ABC(UnkStruct_ov84_0223B5A0 *param0) u32 v0; for (v0 = 0; v0 < 12; v0++) { - sub_0200D330(param0->unk_E0[v0]); + CellActorData_UpdateObject(param0->unk_E0[v0]); } } @@ -327,8 +327,8 @@ void ov84_02240AD8(UnkStruct_ov84_0223B5A0 *param0, u16 param1) void ov84_02240B34(UnkStruct_ov84_0223B5A0 *param0, u8 param1) { - sub_0200D41C(param0->unk_E0[4], param1); - sub_0200D41C(param0->unk_E0[1], param1); + CellActorData_SetExplicitPalette(param0->unk_E0[4], param1); + CellActorData_SetExplicitPalette(param0->unk_E0[1], param1); } u8 ov84_02240B50(UnkStruct_ov84_0223B5A0 *param0) @@ -363,7 +363,7 @@ static void ov84_02240B98(UnkStruct_ov84_0223B5A0 *param0) { VecFx32 v0; - v0 = *(CellActor_GetPosition(param0->unk_E0[1]->unk_00)); + v0 = *(CellActor_GetPosition(param0->unk_E0[1]->cellActor)); if (param0->unk_454.unk_01 == 0) { v0.x -= param0->unk_454.unk_04[param0->unk_454.unk_03]; @@ -371,12 +371,12 @@ static void ov84_02240B98(UnkStruct_ov84_0223B5A0 *param0) v0.x += param0->unk_454.unk_04[param0->unk_454.unk_03]; } - CellActor_SetPosition(param0->unk_E0[1]->unk_00, &v0); + CellActor_SetPosition(param0->unk_E0[1]->cellActor, &v0); param0->unk_454.unk_03++; if (param0->unk_454.unk_03 == 8) { v0.x = ov84_02240C30(param0, param0->unk_478) * FX32_ONE; - CellActor_SetPosition(param0->unk_E0[1]->unk_00, &v0); + CellActor_SetPosition(param0->unk_E0[1]->cellActor, &v0); param0->unk_454.unk_00 = 0; } } @@ -391,7 +391,7 @@ static void ov84_02240C48(UnkStruct_ov84_0223B5A0 *param0) VecFx32 v0; fx32 v1; - v0 = *(CellActor_GetPosition(param0->unk_E0[1]->unk_00)); + v0 = *(CellActor_GetPosition(param0->unk_E0[1]->cellActor)); v1 = ov84_02240C30(param0, param0->unk_478) * FX32_ONE; if (v1 < v0.x) { @@ -415,11 +415,11 @@ static void ov84_02240C48(UnkStruct_ov84_0223B5A0 *param0) void ov84_02240CF0(UnkStruct_ov84_0223B5A0 *param0, u8 param1) { if (param1 == 0) { - SpriteActor_SetSpritePositionXY(param0->unk_E0[8], 220, 156); - SpriteActor_SetSpritePositionXY(param0->unk_E0[9], 220, 180); + CellActorData_SetPositionXY(param0->unk_E0[8], 220, 156); + CellActorData_SetPositionXY(param0->unk_E0[9], 220, 180); } else { - SpriteActor_SetSpritePositionXY(param0->unk_E0[8], 162, 108); - SpriteActor_SetSpritePositionXY(param0->unk_E0[9], 162, 132); + CellActorData_SetPositionXY(param0->unk_E0[8], 162, 108); + CellActorData_SetPositionXY(param0->unk_E0[9], 162, 132); } ov84_02240D3C(param0, 1); @@ -427,8 +427,8 @@ void ov84_02240CF0(UnkStruct_ov84_0223B5A0 *param0, u8 param1) void ov84_02240D3C(UnkStruct_ov84_0223B5A0 *param0, u8 param1) { - SpriteActor_EnableObject(param0->unk_E0[8], param1); - SpriteActor_EnableObject(param0->unk_E0[9], param1); + CellActorData_DrawSprite(param0->unk_E0[8], param1); + CellActorData_DrawSprite(param0->unk_E0[9], param1); } void ov84_02240D5C(UnkStruct_ov84_0223B5A0 *param0, u16 param1, u8 param2) @@ -437,8 +437,8 @@ void ov84_02240D5C(UnkStruct_ov84_0223B5A0 *param0, u16 param1, u8 param2) u16 v1; u16 v2; - SpriteActor_EnableObject(param0->unk_E0[10], param2); - SpriteActor_EnableObject(param0->unk_E0[11], param2); + CellActorData_DrawSprite(param0->unk_E0[10], param2); + CellActorData_DrawSprite(param0->unk_E0[11], param2); if (param2 == 0) { return; @@ -449,26 +449,26 @@ void ov84_02240D5C(UnkStruct_ov84_0223B5A0 *param0, u16 param1, u8 param2) v2 = MoveTable_LoadParam(v0, MOVEATTRIBUTE_CLASS); sub_0200D948(param0->unk_D8, param0->unk_DC, sub_0207C944(), sub_0207C908(v1), 1, 49409); - sub_0200D41C(param0->unk_E0[10], sub_0207C92C(v1) + 6); + CellActorData_SetExplicitPalette(param0->unk_E0[10], sub_0207C92C(v1) + 6); sub_0200D948(param0->unk_D8, param0->unk_DC, sub_0207CAC0(), sub_0207CA90(v2), 1, 49410); - sub_0200D41C(param0->unk_E0[11], sub_0207CAA8(v2) + 6); + CellActorData_SetExplicitPalette(param0->unk_E0[11], sub_0207CAA8(v2) + 6); } void ov84_02240E24(UnkStruct_ov84_0223B5A0 *param0, s16 param1, s16 param2) { - SpriteActor_EnableObject(param0->unk_E0[6], 1); - SpriteActor_SetSpritePositionXY(param0->unk_E0[6], param1, param2); - sub_0200D3CC(param0->unk_E0[6], 0); - sub_0200D364(param0->unk_E0[6], 0); + CellActorData_DrawSprite(param0->unk_E0[6], 1); + CellActorData_SetPositionXY(param0->unk_E0[6], param1, param2); + CellActorData_SetAnimFrame(param0->unk_E0[6], 0); + CellActorData_SetAnim(param0->unk_E0[6], 0); } void ov84_02240E5C(UnkStruct_ov84_0223B5A0 *param0) { - if (sub_0200D408(param0->unk_E0[6]) == 1) { - sub_0200D34C(param0->unk_E0[6], FX32_ONE); + if (CellActorData_GetDrawFlag(param0->unk_E0[6]) == 1) { + CellActorData_UpdateNFrames(param0->unk_E0[6], FX32_ONE); - if (sub_0200D3E0(param0->unk_E0[6]) == 2) { - SpriteActor_EnableObject(param0->unk_E0[6], 0); + if (CellActorData_GetAnimFrame(param0->unk_E0[6]) == 2) { + CellActorData_DrawSprite(param0->unk_E0[6], 0); } } } diff --git a/src/overlay086/ov86_0223B140.c b/src/overlay086/ov86_0223B140.c index 5d74d396e9..a9c67e4374 100644 --- a/src/overlay086/ov86_0223B140.c +++ b/src/overlay086/ov86_0223B140.c @@ -6,7 +6,6 @@ #include "struct_defs/archived_sprite.h" #include "struct_defs/sprite_animation_frame.h" #include "struct_defs/struct_02008900.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02013610.h" #include "struct_defs/struct_0203E234.h" #include "struct_defs/struct_02099F80.h" @@ -30,6 +29,7 @@ #include "party.h" #include "play_time.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -62,7 +62,7 @@ typedef struct { BgConfig *unk_10; Window unk_14; CellActorCollection *unk_24; - UnkStruct_0200C738 unk_28; + GF_G2dRenderer unk_28; CellActor *unk_1B4[6]; CellActor *unk_1CC; void *unk_1D0; diff --git a/src/overlay087/ov87_021D106C.c b/src/overlay087/ov87_021D106C.c index 25bf197843..3261e807d5 100644 --- a/src/overlay087/ov87_021D106C.c +++ b/src/overlay087/ov87_021D106C.c @@ -4,7 +4,6 @@ #include #include "struct_defs/archived_sprite.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02013610.h" #include "struct_defs/struct_02099F80.h" @@ -22,6 +21,7 @@ #include "message.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "text.h" @@ -41,7 +41,7 @@ typedef struct UnkStruct_ov87_021D106C_t { BgConfig *unk_10; Window unk_14[2]; CellActorCollection *unk_34; - UnkStruct_0200C738 unk_38; + GF_G2dRenderer unk_38; CellActor *unk_1C4[6]; void *unk_1DC; void *unk_1E0; diff --git a/src/overlay090/ov90_021D0D80.c b/src/overlay090/ov90_021D0D80.c index 88408623ad..7eaca16cc9 100644 --- a/src/overlay090/ov90_021D0D80.c +++ b/src/overlay090/ov90_021D0D80.c @@ -30,13 +30,13 @@ #include "narc.h" #include "overlay_manager.h" #include "save_player.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" #include "text.h" #include "unk_02005474.h" #include "unk_0200A784.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02014A84.h" #include "unk_02017728.h" @@ -856,8 +856,8 @@ static void ov90_021D1ABC(UnkStruct_ov90_021D0ECC *param0) { VRAMTransferManager_New(32, param0->unk_00); - param0->unk_29C = sub_0200C6E4(param0->unk_00); - param0->unk_2A0 = sub_0200C704(param0->unk_29C); + param0->unk_29C = SpriteRenderer_Create(param0->unk_00); + param0->unk_2A0 = SpriteRenderer_CreateGfxHandler(param0->unk_29C); { UnkStruct_ov104_0224133C v0 = { @@ -879,8 +879,8 @@ static void ov90_021D1ABC(UnkStruct_ov90_021D0ECC *param0) GX_OBJVRAMMODE_CHAR_1D_32K, }; - sub_0200C73C(param0->unk_29C, &v0, &v1, 32); - sub_0200C7C0(param0->unk_29C, param0->unk_2A0, 4); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_29C, &v0, &v1, 32); + SpriteRenderer_CreateCellActorList(param0->unk_29C, param0->unk_2A0, 4); sub_0200A93C(param0->unk_00); sub_0200A944(param0->unk_00); } @@ -896,15 +896,15 @@ static void ov90_021D1ABC(UnkStruct_ov90_021D0ECC *param0) "data/btower_celact.cldat" }; - LoadSpriteResourceData(param0->unk_29C, param0->unk_2A0, &v2); + SpriteRenderer_LoadSpriteResourceData(param0->unk_29C, param0->unk_2A0, &v2); } GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); } static void ov90_021D1B6C(UnkStruct_ov90_021D0ECC *param0) { - sub_0200C8B0(param0->unk_29C, param0->unk_2A0); - sub_0200C8D4(param0->unk_29C); + SpriteRenderer_DeleteGfxHandler(param0->unk_29C, param0->unk_2A0); + SpriteRenderer_Free(param0->unk_29C); VRAMTransferManager_Destroy(); } @@ -914,7 +914,7 @@ static void ov90_021D1B90(UnkStruct_ov90_021D0ECC *param0) return; } - sub_0200C7EC(param0->unk_2A0); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_2A0); } static void ov90_021D1BA4(void) @@ -933,7 +933,7 @@ static void ov90_021D1BAC(UnkStruct_ov90_021D0ECC *param0) }; for (v0 = 0; v0 < 4; v0++) { - param0->unk_2A4[v0] = sub_0200CA08(param0->unk_29C, param0->unk_2A0, &v1[v0]); + param0->unk_2A4[v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_29C, param0->unk_2A0, &v1[v0]); } CellActor_SetDrawFlag(param0->unk_2A4[2], 0); @@ -949,7 +949,7 @@ static void ov90_021D1C28(UnkStruct_ov90_021D0ECC *param0) int v0; for (v0 = 0; v0 < 4; v0++) { - sub_0200C7E4(param0->unk_2A4[v0]); + thunk_CellActor_Delete(param0->unk_2A4[v0]); } } @@ -1002,5 +1002,5 @@ static void ov90_021D1C90(UnkStruct_ov90_021D0ECC *param0, u8 param1, u8 param2, break; } - SpriteActor_SetPositionXY(param0->unk_2A4[0], param2 * 72 + 54, param3 * 24 + 68); + CellActor_SetPositionXY(param0->unk_2A4[0], param2 * 72 + 54, param3 * 24 + 68); } diff --git a/src/overlay091/ov91_021D0D80.c b/src/overlay091/ov91_021D0D80.c index c9f98b7199..e47b2cba1f 100644 --- a/src/overlay091/ov91_021D0D80.c +++ b/src/overlay091/ov91_021D0D80.c @@ -32,12 +32,12 @@ #include "pokemon.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" #include "text.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" @@ -417,7 +417,7 @@ int ov91_021D0E08(OverlayManager *param0, int *param1) } ov91_021D20E8(v0); - sub_0200C7EC(v0->unk_114); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_114); return 0; } @@ -818,7 +818,7 @@ static void ov91_021D1498(UnkStruct_ov91_021D0ED8 *param0) ov91_021D1A68(param0, 0xfffffffe); } - SpriteActor_EnableObject(param0->unk_118[5], 0); + CellActorData_DrawSprite(param0->unk_118[5], 0); } ov91_021D2314(param0); @@ -966,7 +966,7 @@ static void ov91_021D18C8(UnkStruct_ov91_021D0ED8 *param0, u32 param1) Window_FillTilemap(¶m0->unk_08[7], 0); Window_FillTilemap(¶m0->unk_08[8], 0); Window_FillTilemap(¶m0->unk_08[9], 0); - SpriteActor_EnableObject(param0->unk_118[5], 0); + CellActorData_DrawSprite(param0->unk_118[5], 0); if (param1 != 0xfffffffe) { MessageLoader *v0; @@ -1001,7 +1001,7 @@ static void ov91_021D18C8(UnkStruct_ov91_021D0ED8 *param0, u32 param1) ov91_021D1580(param0, 10, FONT_SYSTEM, TEXT_COLOR(1, 2, 0), 0); MessageLoader_Free(v0); ov91_021D24B4(param0, param1); - SpriteActor_EnableObject(param0->unk_118[5], 1); + CellActorData_DrawSprite(param0->unk_118[5], 1); Window_ScheduleCopyToVRAM(¶m0->unk_08[2]); Window_ScheduleCopyToVRAM(¶m0->unk_08[3]); Window_ScheduleCopyToVRAM(¶m0->unk_08[4]); @@ -1284,8 +1284,8 @@ static void ov91_021D2014(UnkStruct_ov91_021D0ED8 *param0) VRAMTransferManager_New(64, 67); - param0->unk_110 = sub_0200C6E4(67); - param0->unk_114 = sub_0200C704(param0->unk_110); + param0->unk_110 = SpriteRenderer_Create(67); + param0->unk_114 = SpriteRenderer_CreateGfxHandler(param0->unk_110); { UnkStruct_ov104_0224133C v1 = { @@ -1302,11 +1302,11 @@ static void ov91_021D2014(UnkStruct_ov91_021D0ED8 *param0) 13, 1024 * 128, 1024 * 16, GX_OBJVRAMMODE_CHAR_1D_32K, GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->unk_110, &v1, &v2, 32); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_110, &v1, &v2, 32); } - sub_0200C7C0(param0->unk_110, param0->unk_114, 13); - sub_0200CB30(param0->unk_110, param0->unk_114, &v0); + SpriteRenderer_CreateCellActorList(param0->unk_110, param0->unk_114, 13); + SpriteRenderer_InitGfxResourceList(param0->unk_110, param0->unk_114, &v0); GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); } @@ -1315,11 +1315,11 @@ static void ov91_021D20B4(UnkStruct_ov91_021D0ED8 *param0) u32 v0; for (v0 = 0; v0 < 13; v0++) { - sub_0200D0F4(param0->unk_118[v0]); + CellActorData_Delete(param0->unk_118[v0]); } - sub_0200D0B0(param0->unk_110, param0->unk_114); - sub_0200C8D4(param0->unk_110); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_110, param0->unk_114); + SpriteRenderer_Free(param0->unk_110); } static void ov91_021D20E8(UnkStruct_ov91_021D0ED8 *param0) @@ -1327,7 +1327,7 @@ static void ov91_021D20E8(UnkStruct_ov91_021D0ED8 *param0) u16 v0; for (v0 = 0; v0 < 13; v0++) { - CellActor_UpdateAnim(param0->unk_118[v0]->unk_00, FX32_ONE); + CellActor_UpdateAnim(param0->unk_118[v0]->cellActor, FX32_ONE); } } @@ -1344,7 +1344,7 @@ static void ov91_021D2110(UnkStruct_ov91_021D0ED8 *param0, NARC *param1) } sub_0207CAC4(param0->unk_110, param0->unk_114, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 47275); - sub_0200CD0C(param0->unk_110, param0->unk_114, param1, 9, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47272); + SpriteRenderer_LoadPaletteResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 9, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47272); sub_0207C97C(param0->unk_110, param0->unk_114, NNS_G2D_VRAM_TYPE_2DMAIN, 47273); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 4, 0, 47272); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 7, 0, 47273); @@ -1366,7 +1366,7 @@ static void ov91_021D22A0(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param } sub_0200D948(param0->unk_110, param0->unk_114, sub_0207C944(), sub_0207C908(v0), 1, 47276 + param2); - sub_0200D41C(param0->unk_118[6 + param2], sub_0207C92C(v0) + 2); + CellActorData_SetExplicitPalette(param0->unk_118[6 + param2], sub_0207C92C(v0) + 2); } static void ov91_021D2314(UnkStruct_ov91_021D0ED8 *param0) @@ -1374,13 +1374,13 @@ static void ov91_021D2314(UnkStruct_ov91_021D0ED8 *param0) u32 v0; for (v0 = 0; v0 < 7; v0++) { - SpriteActor_SetSpritePositionXY( + CellActorData_SetPositionXY( param0->unk_118[6 + v0], 152, 32 + 16 * v0); if (param0->unk_00->unk_12 + v0 >= param0->unk_184 - 1) { - SpriteActor_EnableObject(param0->unk_118[6 + v0], 0); + CellActorData_DrawSprite(param0->unk_118[6 + v0], 0); } else { - SpriteActor_EnableObject(param0->unk_118[6 + v0], 1); + CellActorData_DrawSprite(param0->unk_118[6 + v0], 1); ov91_021D22A0(param0, param0->unk_00->unk_0C[param0->unk_00->unk_12 + v0], v0); } } @@ -1405,7 +1405,7 @@ static void ov91_021D237C(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param v2 -= 16; } - SpriteActor_SetSpritePositionXY(param0->unk_118[6 + v0], v1, v2); + CellActorData_SetPositionXY(param0->unk_118[6 + v0], v1, v2); } } else if (param1 > param2) { for (v0 = 0; v0 < 7; v0++) { @@ -1421,7 +1421,7 @@ static void ov91_021D237C(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param v2 += 16; } - SpriteActor_SetSpritePositionXY(param0->unk_118[6 + v0], v1, v2); + CellActorData_SetPositionXY(param0->unk_118[6 + v0], v1, v2); } } else { return; @@ -1432,9 +1432,9 @@ static void ov91_021D237C(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param v2 = (v2 - 32) / 16; if (param2 + v2 >= param0->unk_184 - 1) { - SpriteActor_EnableObject(param0->unk_118[6 + v0], 0); + CellActorData_DrawSprite(param0->unk_118[6 + v0], 0); } else { - SpriteActor_EnableObject(param0->unk_118[6 + v0], 1); + CellActorData_DrawSprite(param0->unk_118[6 + v0], 1); } } } @@ -1444,7 +1444,7 @@ static void ov91_021D24B4(UnkStruct_ov91_021D0ED8 *param0, u16 param1) u32 v0 = MoveTable_LoadParam(param1, MOVEATTRIBUTE_CLASS); sub_0200D948(param0->unk_110, param0->unk_114, sub_0207CAC0(), sub_0207CA90(v0), 1, 47275); - sub_0200D41C(param0->unk_118[5], sub_0207CAA8(v0) + 2); + CellActorData_SetExplicitPalette(param0->unk_118[5], sub_0207CAA8(v0) + 2); } static void ov91_021D2508(UnkStruct_ov91_021D0ED8 *param0, NARC *param1) @@ -1455,41 +1455,41 @@ static void ov91_021D2508(UnkStruct_ov91_021D0ED8 *param0, NARC *param1) ov91_021D2110(param0, param1); for (v0 = 0; v0 < 13; v0++) { - param0->unk_118[v0] = SpriteActor_LoadResources(param0->unk_110, param0->unk_114, &Unk_ov91_021D28FC[v0]); + param0->unk_118[v0] = CellActor_LoadResources(param0->unk_110, param0->unk_114, &Unk_ov91_021D28FC[v0]); } } static void ov91_021D2548(UnkStruct_ov91_021D0ED8 *param0, u8 param1, u8 param2) { - SpriteActor_SetSpritePositionXY(param0->unk_118[4], 196, 32 + 16 * param1); - sub_0200D41C(param0->unk_118[4], param2); + CellActorData_SetPositionXY(param0->unk_118[4], 196, 32 + 16 * param1); + CellActorData_SetExplicitPalette(param0->unk_118[4], param2); } static void ov91_021D2574(UnkStruct_ov91_021D0ED8 *param0, u8 param1) { - SpriteActor_EnableObject(param0->unk_118[0], param1); - SpriteActor_EnableObject(param0->unk_118[1], param1); + CellActorData_DrawSprite(param0->unk_118[0], param1); + CellActorData_DrawSprite(param0->unk_118[1], param1); } static void ov91_021D2594(UnkStruct_ov91_021D0ED8 *param0) { if (param0->unk_00->unk_12 != 0) { - SpriteActor_EnableObject(param0->unk_118[2], 1); + CellActorData_DrawSprite(param0->unk_118[2], 1); } else { - SpriteActor_EnableObject(param0->unk_118[2], 0); + CellActorData_DrawSprite(param0->unk_118[2], 0); } if (param0->unk_00->unk_12 + 7 < param0->unk_184) { - SpriteActor_EnableObject(param0->unk_118[3], 1); + CellActorData_DrawSprite(param0->unk_118[3], 1); } else { - SpriteActor_EnableObject(param0->unk_118[3], 0); + CellActorData_DrawSprite(param0->unk_118[3], 0); } } static void ov91_021D25E4(UnkStruct_ov91_021D0ED8 *param0) { - SpriteActor_EnableObject(param0->unk_118[2], 0); - SpriteActor_EnableObject(param0->unk_118[3], 0); + CellActorData_DrawSprite(param0->unk_118[2], 0); + CellActorData_DrawSprite(param0->unk_118[3], 0); } static int ov91_021D2604(UnkStruct_ov91_021D0ED8 *param0) diff --git a/src/overlay095/ov95_02246C20.c b/src/overlay095/ov95_02246C20.c index 90c1fd26c2..bbff8ba4c4 100644 --- a/src/overlay095/ov95_02246C20.c +++ b/src/overlay095/ov95_02246C20.c @@ -4,7 +4,6 @@ #include #include "struct_defs/archived_sprite.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02013610.h" #include "overlay006/struct_ov6_02246254.h" @@ -29,6 +28,7 @@ #include "message.h" #include "overlay_manager.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -50,7 +50,7 @@ struct UnkStruct_ov95_02247628_t { MessageLoader *unk_10; Strbuf *unk_14; CellActorCollection *unk_18; - UnkStruct_0200C738 unk_1C; + GF_G2dRenderer unk_1C; SysTask *unk_1A8; BOOL unk_1AC; u16 unk_1B0; diff --git a/src/overlay097/ov97_02230410.c b/src/overlay097/ov97_02230410.c index 669e1db27a..c3d18a2f20 100644 --- a/src/overlay097/ov97_02230410.c +++ b/src/overlay097/ov97_02230410.c @@ -2,7 +2,6 @@ #include #include "struct_decls/struct_0202442C_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0202DBAC.h" #include "overlay097/ov97_0222D04C.h" @@ -33,6 +32,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" @@ -94,7 +94,7 @@ typedef struct { int unk_2C9C; int unk_2CA0; CellActorCollection *unk_2CA4; - UnkStruct_0200C738 unk_2CA8; + GF_G2dRenderer unk_2CA8; SpriteResourceCollection *unk_2E34[6]; SpriteResource *unk_2E4C[6]; CellActorResourceData unk_2E64; diff --git a/src/overlay097/ov97_02233B18.c b/src/overlay097/ov97_02233B18.c index 1e6114eab4..c690ce629d 100644 --- a/src/overlay097/ov97_02233B18.c +++ b/src/overlay097/ov97_02233B18.c @@ -6,7 +6,6 @@ #include "struct_decls/struct_02015920_decl.h" #include "struct_decls/struct_02024440_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02015958.h" #include "struct_defs/struct_02099F80.h" @@ -40,6 +39,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -121,7 +121,7 @@ typedef struct { BgConfig *unk_20; int unk_24; CellActorCollection *unk_28; - UnkStruct_0200C738 unk_2C; + GF_G2dRenderer unk_2C; SpriteResourceCollection *unk_1B8[6]; SpriteResource *unk_1D0[6]; CellActorResourceData unk_1E8; diff --git a/src/overlay099/ov99_021D0D80.c b/src/overlay099/ov99_021D0D80.c index 949cf2f50d..e20845228f 100644 --- a/src/overlay099/ov99_021D0D80.c +++ b/src/overlay099/ov99_021D0D80.c @@ -26,12 +26,12 @@ #include "narc.h" #include "overlay_manager.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_020041CC.h" #include "unk_020093B4.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" @@ -133,17 +133,17 @@ int ov99_021D0D80(OverlayManager *param0, int *param1) ov99_021D1918(v0); - v0->unk_18 = sub_0200C6E4(75); + v0->unk_18 = SpriteRenderer_Create(75); - sub_0200C73C(v0->unk_18, &Unk_ov99_021D4760, &Unk_ov99_021D4718, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_18, &Unk_ov99_021D4760, &Unk_ov99_021D4718, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_128K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_1C = sub_0200C704(v0->unk_18); + v0->unk_1C = SpriteRenderer_CreateGfxHandler(v0->unk_18); - sub_0200C7C0(v0->unk_18, v0->unk_1C, (64 + 64)); - sub_0200CB30(v0->unk_18, v0->unk_1C, &Unk_ov99_021D472C); - sub_0200964C(sub_0200C738(v0->unk_18), 0, ((192 + 80) << FX32_SHIFT)); + SpriteRenderer_CreateCellActorList(v0->unk_18, v0->unk_1C, (64 + 64)); + SpriteRenderer_InitGfxResourceList(v0->unk_18, v0->unk_1C, &Unk_ov99_021D472C); + sub_0200964C(SpriteRenderer_GetG2dRenderer(v0->unk_18), 0, ((192 + 80) << FX32_SHIFT)); ov99_021D16E4(v0); @@ -269,8 +269,8 @@ int ov99_021D11A8(OverlayManager *param0, int *param1) } MessageLoader_Free(v0->unk_20); - sub_0200D0B0(v0->unk_18, v0->unk_1C); - sub_0200C8D4(v0->unk_18); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_18, v0->unk_1C); + SpriteRenderer_Free(v0->unk_18); PaletteData_FreeBuffer(v0->unk_0C, 0); PaletteData_FreeBuffer(v0->unk_0C, 1); PaletteData_FreeBuffer(v0->unk_0C, 2); @@ -299,7 +299,7 @@ static void ov99_021D1244(SysTask *param0, void *param1) G3_RequestSwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_Z); } - sub_0200C7EC(v0->unk_1C); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_1C); sub_0200C808(); } diff --git a/src/overlay099/ov99_021D1A54.c b/src/overlay099/ov99_021D1A54.c index 3ab7356962..8b3e64a2ac 100644 --- a/src/overlay099/ov99_021D1A54.c +++ b/src/overlay099/ov99_021D1A54.c @@ -28,10 +28,10 @@ #include "heap.h" #include "message.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "text.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" typedef void (*UnkFuncPtr_ov99_021D4A04)(UnkStruct_ov99_021D2CB0 *); @@ -321,12 +321,12 @@ static void ov99_021D1A54(UnkStruct_ov99_021D2CB0 *param0) u8 v0; if (param0->unk_00->unk_00 == 0) { - v0 = SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 31, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + v0 = SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 31, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 28, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 29, 0, 10001); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 30, 0, 10001); } else { - v0 = SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 36, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + v0 = SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 36, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 33, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 34, 0, 10001); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 35, 0, 10001); @@ -360,18 +360,18 @@ static void ov99_021D1BC4(UnkStruct_ov99_021D2CB0 *param0, CellActorData **param MI_CpuClear8(¶m0->unk_1114, sizeof(UnkStruct_ov99_021D2CB0_sub2)); - v0 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &v2); + v0 = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &v2); - sub_0200D390(v0, 1); - SpriteActor_UpdateObject(v0->unk_00); + CellActorData_SetAnimateFlag(v0, 1); + CellActor_UpdateObject(v0->cellActor); *param1 = v0; v2.priority = 60; - v1 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &v2); + v1 = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &v2); - sub_0200D364(v1, 2); - sub_0200D390(v1, 1); - SpriteActor_UpdateObject(v1->unk_00); + CellActorData_SetAnim(v1, 2); + CellActorData_SetAnimateFlag(v1, 1); + CellActor_UpdateObject(v1->cellActor); *param2 = v1; @@ -399,8 +399,8 @@ static void ov99_021D1BC4(UnkStruct_ov99_021D2CB0 *param0, CellActorData **param static void ov99_021D1C9C(UnkStruct_ov99_021D2CB0 *param0, CellActorData *param1, CellActorData *param2) { - sub_0200D0F4(param1); - sub_0200D0F4(param2); + CellActorData_Delete(param1); + CellActorData_Delete(param2); if (param0->unk_10F4 != NULL) { Heap_FreeToHeap(param0->unk_10F4); @@ -505,7 +505,7 @@ static void ov99_021D1EB4(UnkStruct_ov99_021D2CB0 *param0) static void ov99_021D1EC8(UnkStruct_ov99_021D2CB0 *param0) { - SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10003); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10003); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10003); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10003); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10003); @@ -524,11 +524,11 @@ static void ov99_021D1F70(UnkStruct_ov99_021D2CB0 *param0) int v0; for (v0 = 2; v0 <= 4; v0++) { - param0->unk_10E0[v0] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D499C); + param0->unk_10E0[v0] = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D499C); sub_0200D6A4(param0->unk_10E0[v0], 2); - sub_0200D390(param0->unk_10E0[v0], 1); - SpriteActor_UpdateObject(param0->unk_10E0[v0]->unk_00); + CellActorData_SetAnimateFlag(param0->unk_10E0[v0], 1); + CellActor_UpdateObject(param0->unk_10E0[v0]->cellActor); } } @@ -537,7 +537,7 @@ static void ov99_021D1FB8(UnkStruct_ov99_021D2CB0 *param0) int v0; for (v0 = 2; v0 <= 4; v0++) { - sub_0200D0F4(param0->unk_10E0[v0]); + CellActorData_Delete(param0->unk_10E0[v0]); } } @@ -723,7 +723,7 @@ static void ov99_021D22F4(UnkStruct_ov99_021D2CB0 *param0) static void ov99_021D2308(UnkStruct_ov99_021D2CB0 *param0) { - SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10004); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10004); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10004); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10004); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10004); @@ -742,9 +742,9 @@ static void ov99_021D23B0(UnkStruct_ov99_021D2CB0 *param0) int v0; for (v0 = 2; v0 <= 3; v0++) { - param0->unk_10E0[v0] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4968); - sub_0200D390(param0->unk_10E0[v0], 1); - SpriteActor_UpdateObject(param0->unk_10E0[v0]->unk_00); + param0->unk_10E0[v0] = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4968); + CellActorData_SetAnimateFlag(param0->unk_10E0[v0], 1); + CellActor_UpdateObject(param0->unk_10E0[v0]->cellActor); } } @@ -753,7 +753,7 @@ static void ov99_021D23F0(UnkStruct_ov99_021D2CB0 *param0) int v0; for (v0 = 2; v0 <= 3; v0++) { - sub_0200D0F4(param0->unk_10E0[v0]); + CellActorData_Delete(param0->unk_10E0[v0]); } } @@ -848,7 +848,7 @@ static void ov99_021D2664(UnkStruct_ov99_021D2CB0 *param0) { ov99_021D1A54(param0); - SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10002); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10002); @@ -868,22 +868,22 @@ static void ov99_021D2714(UnkStruct_ov99_021D2CB0 *param0) { ov99_021D1BC4(param0, ¶m0->unk_10E0[0], ¶m0->unk_10E0[1]); - param0->unk_10E0[3] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D49D0); + param0->unk_10E0[3] = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D49D0); - sub_0200D390(param0->unk_10E0[3], 1); - SpriteActor_EnableObject(param0->unk_10E0[3], 0); - SpriteActor_UpdateObject(param0->unk_10E0[3]->unk_00); + CellActorData_SetAnimateFlag(param0->unk_10E0[3], 1); + CellActorData_DrawSprite(param0->unk_10E0[3], 0); + CellActor_UpdateObject(param0->unk_10E0[3]->cellActor); } static void ov99_021D275C(UnkStruct_ov99_021D2CB0 *param0) { ov99_021D1C9C(param0, param0->unk_10E0[0], param0->unk_10E0[1]); - sub_0200D0F4(param0->unk_10E0[3]); + CellActorData_Delete(param0->unk_10E0[3]); } static void ov99_021D2780(UnkStruct_ov99_021D2CB0 *param0) { - SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10005); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10005); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10005); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10005); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10005); @@ -902,16 +902,16 @@ static void ov99_021D2828(UnkStruct_ov99_021D2CB0 *param0) int v0; for (v0 = 2; v0 <= 2; v0++) { - param0->unk_10E0[v0] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4934); - sub_0200D390(param0->unk_10E0[v0], 1); - SpriteActor_UpdateObject(param0->unk_10E0[v0]->unk_00); + param0->unk_10E0[v0] = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4934); + CellActorData_SetAnimateFlag(param0->unk_10E0[v0], 1); + CellActor_UpdateObject(param0->unk_10E0[v0]->cellActor); } - param0->unk_10E0[4] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D48CC); + param0->unk_10E0[4] = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D48CC); - sub_0200D390(param0->unk_10E0[4], 1); - SpriteActor_EnableObject(param0->unk_10E0[4], 0); - SpriteActor_UpdateObject(param0->unk_10E0[4]->unk_00); + CellActorData_SetAnimateFlag(param0->unk_10E0[4], 1); + CellActorData_DrawSprite(param0->unk_10E0[4], 0); + CellActor_UpdateObject(param0->unk_10E0[4]->cellActor); } static void ov99_021D288C(UnkStruct_ov99_021D2CB0 *param0) @@ -919,10 +919,10 @@ static void ov99_021D288C(UnkStruct_ov99_021D2CB0 *param0) int v0; for (v0 = 2; v0 <= 2; v0++) { - sub_0200D0F4(param0->unk_10E0[v0]); + CellActorData_Delete(param0->unk_10E0[v0]); } - sub_0200D0F4(param0->unk_10E0[4]); + CellActorData_Delete(param0->unk_10E0[4]); } static void ov99_021D28AC(UnkStruct_ov99_021D2CB0 *param0) diff --git a/src/overlay099/ov99_021D2C08.c b/src/overlay099/ov99_021D2C08.c index ab667c0024..3e69c1f822 100644 --- a/src/overlay099/ov99_021D2C08.c +++ b/src/overlay099/ov99_021D2C08.c @@ -12,8 +12,8 @@ #include "overlay099/struct_ov99_021D3A40.h" #include "bg_window.h" +#include "sprite_renderer.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct { diff --git a/src/overlay099/ov99_021D2E28.c b/src/overlay099/ov99_021D2E28.c index 99b0046e83..6ca0fd360f 100644 --- a/src/overlay099/ov99_021D2E28.c +++ b/src/overlay099/ov99_021D2E28.c @@ -13,8 +13,8 @@ #include "bg_window.h" #include "palette.h" +#include "sprite_renderer.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct { diff --git a/src/overlay099/ov99_021D340C.c b/src/overlay099/ov99_021D340C.c index 9dfd39f02c..cce3609fa6 100644 --- a/src/overlay099/ov99_021D340C.c +++ b/src/overlay099/ov99_021D340C.c @@ -13,8 +13,8 @@ #include "overlay099/struct_ov99_021D3A40.h" #include "palette.h" +#include "sprite_renderer.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct { @@ -250,8 +250,8 @@ static void ov99_021D372C(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 param1->unk_11F = 31; sub_0200D500(param0->unk_10E0[4], Unk_ov99_021D4C84[param2].unk_00, Unk_ov99_021D4C84[param2].unk_02, ((192 + 80) << FX32_SHIFT)); - SpriteActor_EnableObject(param0->unk_10E0[4], 1); - SpriteActor_EnableObject(param0->unk_10E0[3], 0); + CellActorData_DrawSprite(param0->unk_10E0[4], 1); + CellActorData_DrawSprite(param0->unk_10E0[3], 0); G2S_SetBlendAlpha(0, GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ, param1->unk_11E, param1->unk_11F); G2_SetBlendAlpha(0, GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ, param1->unk_11F, param1->unk_11E); @@ -283,8 +283,8 @@ static void ov99_021D37E0(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 sub_0200D5A0(param0->unk_10E0[4], &v0, &v1, ((192 + 80) << FX32_SHIFT)); if (v1 > 192 + 32) { - SpriteActor_EnableObject(param0->unk_10E0[4], 0); - SpriteActor_EnableObject(param0->unk_10E0[3], 1); + CellActorData_DrawSprite(param0->unk_10E0[4], 0); + CellActorData_DrawSprite(param0->unk_10E0[3], 1); sub_0200D500(param0->unk_10E0[3], v0, -32, ((192 + 80) << FX32_SHIFT)); param1->unk_11D = 1; } @@ -306,7 +306,7 @@ static void ov99_021D37E0(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 sub_0200D5A0(param0->unk_10E0[3], &v0, &v1, ((192 + 80) << FX32_SHIFT)); if (v1 > 192 + 32) { - SpriteActor_EnableObject(param0->unk_10E0[3], 0); + CellActorData_DrawSprite(param0->unk_10E0[3], 0); param1->unk_11D = 0; param1->unk_11C = 0; } diff --git a/src/overlay099/ov99_021D4134.c b/src/overlay099/ov99_021D4134.c index 3389f7aca1..68d4d3a18f 100644 --- a/src/overlay099/ov99_021D4134.c +++ b/src/overlay099/ov99_021D4134.c @@ -14,7 +14,7 @@ #include "graphics.h" #include "heap.h" #include "palette.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" #include "unk_0201D15C.h" typedef struct { @@ -219,7 +219,7 @@ void ov99_021D44CC(UnkStruct_ov99_021D2CB0 *param0, CellActorData *param1) param0->unk_1114.unk_00--; } else { v0 = G2_GetOBJCharPtr(); - v2 = SpriteActor_ImageProxy(param1->unk_00); + v2 = SpriteActor_ImageProxy(param1->cellActor); if (param0->unk_00->unk_00 == 0) { MI_CpuCopy32(¶m0->unk_10F4[param0->unk_1114.unk_02 * ((0x20 * 8) / 2)], (void *)((u32)v0 + 0x1d * 0x20 + v2->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); @@ -253,7 +253,7 @@ void ov99_021D44CC(UnkStruct_ov99_021D2CB0 *param0, CellActorData *param1) } } - if (sub_0200D3B8(param1) == 0) { + if (CellActorData_IsAnimated(param1) == 0) { if (param0->unk_1114.unk_04 != -1) { param0->unk_1114.unk_04++; @@ -264,10 +264,10 @@ void ov99_021D44CC(UnkStruct_ov99_021D2CB0 *param0, CellActorData *param1) v1 = 0; } - sub_0200D364(param1, v1); + CellActorData_SetAnim(param1, v1); } else { param0->unk_1114.unk_04 = 0; - sub_0200D364(param1, 0); + CellActorData_SetAnim(param1, 0); } } } diff --git a/src/overlay100/ov100_021D0D80.c b/src/overlay100/ov100_021D0D80.c index 7a68da327a..1d3f2696a7 100644 --- a/src/overlay100/ov100_021D0D80.c +++ b/src/overlay100/ov100_021D0D80.c @@ -26,8 +26,8 @@ #include "overlay_manager.h" #include "palette.h" #include "render_window.h" +#include "sprite_renderer.h" #include "unk_020041CC.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" @@ -131,7 +131,7 @@ int ov100_021D0EA8(OverlayManager *param0, int *param1) break; } - sub_0200C7EC(v0->unk_0C.unk_08); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_0C.unk_08); return 0; } @@ -161,7 +161,7 @@ int ov100_021D0F44(OverlayManager *param0, int *param1) static void ov100_021D0FA0(UnkStruct_ov100_021D46C8 *param0) { - param0->unk_04 = sub_0200C6E4(111); + param0->unk_04 = SpriteRenderer_Create(111); { const UnkStruct_ov104_0224133C v0 = { @@ -181,7 +181,7 @@ static void ov100_021D0FA0(UnkStruct_ov100_021D46C8 *param0) GX_OBJVRAMMODE_CHAR_1D_64K, GX_OBJVRAMMODE_CHAR_1D_32K }; - BOOL v2 = sub_0200C73C(param0->unk_04, &v0, &v1, 16 + 16); + BOOL v2 = SpriteRenderer_CreateOamCharPlttManagers(param0->unk_04, &v0, &v1, 16 + 16); GF_ASSERT(v2); } @@ -197,12 +197,12 @@ static void ov100_021D0FA0(UnkStruct_ov100_021D46C8 *param0) 16, }; - param0->unk_08 = sub_0200C704(param0->unk_04); + param0->unk_08 = SpriteRenderer_CreateGfxHandler(param0->unk_04); - v3 = sub_0200C7C0(param0->unk_04, param0->unk_08, 64 + 64); + v3 = SpriteRenderer_CreateCellActorList(param0->unk_04, param0->unk_08, 64 + 64); GF_ASSERT(v3); - v3 = sub_0200CB30(param0->unk_04, param0->unk_08, &v4); + v3 = SpriteRenderer_InitGfxResourceList(param0->unk_04, param0->unk_08, &v4); GF_ASSERT(v3); } } @@ -265,8 +265,8 @@ static void ov100_021D111C(UnkStruct_ov100_021D46C8 *param0) NARC_dtor(param0->unk_00); sub_020242C4(param0->unk_14); Camera_Delete(param0->camera); - sub_0200D0B0(param0->unk_04, param0->unk_08); - sub_0200C8D4(param0->unk_04); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_04, param0->unk_08); + SpriteRenderer_Free(param0->unk_04); MessageLoader_Free(param0->unk_2C); G3X_AlphaBlend(0); diff --git a/src/overlay100/ov100_021D13E4.c b/src/overlay100/ov100_021D13E4.c index 84a14c5e01..0b0e6cdccb 100644 --- a/src/overlay100/ov100_021D13E4.c +++ b/src/overlay100/ov100_021D13E4.c @@ -23,10 +23,10 @@ #include "heap.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "unk_020041CC.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_0201D15C.h" #include "unk_0202419C.h" @@ -255,7 +255,7 @@ static void ov100_021D1808(UnkStruct_ov100_021D1808 *param0) PaletteData_LoadBuffer(v4, &v6, 0, 0, 0x2); } - SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 48, 0, v5); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 47, 0, v5); SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 49, 0, NNS_G2D_VRAM_TYPE_2DSUB, v5); @@ -286,8 +286,8 @@ static void ov100_021D1A24(UnkStruct_ov100_021D1808 *param0) for (v0 = 0; v0 < 3; v0++) { SysTask_Done(param0->unk_0C.unk_0C[v0].unk_40); SysTask_Done(param0->unk_0C.unk_D4[v0].unk_40); - sub_0200D0F4(param0->unk_0C.unk_0C[v0].unk_00); - sub_0200D0F4(param0->unk_0C.unk_D4[v0].unk_00); + CellActorData_Delete(param0->unk_0C.unk_0C[v0].unk_00); + CellActorData_Delete(param0->unk_0C.unk_D4[v0].unk_00); } } @@ -320,12 +320,12 @@ static void ov100_021D1A54(UnkStruct_ov100_021D1808 *param0) v6.resources[3] = 50000; for (v0 = 0; v0 < 3; v0++) { - param0->unk_0C.unk_D4[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v6); + param0->unk_0C.unk_D4[v0].unk_00 = CellActor_LoadResources(v3, v4, &v6); - sub_0200D330(param0->unk_0C.unk_D4[v0].unk_00); - SpriteActor_EnableObject(param0->unk_0C.unk_D4[v0].unk_00, 0); - sub_0200D430(param0->unk_0C.unk_D4[v0].unk_00, v0); - SpriteActor_SetSpritePositionXY(param0->unk_0C.unk_D4[v0].unk_00, 0, 0); + CellActorData_UpdateObject(param0->unk_0C.unk_D4[v0].unk_00); + CellActorData_DrawSprite(param0->unk_0C.unk_D4[v0].unk_00, 0); + CellActorData_SetExplicitPaletteOffset(param0->unk_0C.unk_D4[v0].unk_00, v0); + CellActorData_SetPositionXY(param0->unk_0C.unk_D4[v0].unk_00, 0, 0); param0->unk_0C.unk_D4[v0].unk_0C = 1; param0->unk_0C.unk_D4[v0].unk_08 = v0; @@ -351,14 +351,14 @@ static void ov100_021D1A54(UnkStruct_ov100_021D1808 *param0) v6.bgPriority = 2; } - param0->unk_0C.unk_0C[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v6); + param0->unk_0C.unk_0C[v0].unk_00 = CellActor_LoadResources(v3, v4, &v6); param0->unk_0C.unk_0C[v0].unk_04 = param0->unk_0C.unk_D4[v0].unk_00; - sub_0200D330(param0->unk_0C.unk_0C[v0].unk_00); + CellActorData_UpdateObject(param0->unk_0C.unk_0C[v0].unk_00); sub_0200D6A4(param0->unk_0C.unk_0C[v0].unk_00, 2); sub_0200D6E8(param0->unk_0C.unk_0C[v0].unk_00, v9[v0], v9[v0]); - sub_0200D430(param0->unk_0C.unk_0C[v0].unk_00, v0); - SpriteActor_SetSpritePositionXY(param0->unk_0C.unk_0C[v0].unk_00, v7[v0], v8[v0]); + CellActorData_SetExplicitPaletteOffset(param0->unk_0C.unk_0C[v0].unk_00, v0); + CellActorData_SetPositionXY(param0->unk_0C.unk_0C[v0].unk_00, v7[v0], v8[v0]); param0->unk_0C.unk_0C[v0].unk_0C = 0; param0->unk_0C.unk_0C[v0].unk_08 = v0; diff --git a/src/overlay100/ov100_021D1C44.c b/src/overlay100/ov100_021D1C44.c index 2d36cfb061..926dd0a32b 100644 --- a/src/overlay100/ov100_021D1C44.c +++ b/src/overlay100/ov100_021D1C44.c @@ -23,12 +23,12 @@ #include "heap.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "text.h" #include "trainer_info.h" #include "unk_020041CC.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_0201D15C.h" #include "unk_0202419C.h" @@ -83,7 +83,7 @@ static void ov100_021D1C98(UnkStruct_ov100_021D1C98 *param0) PaletteData_LoadBufferFromFileStart(v4, 172, 19, 111, 1, 0x20 * 2, 0); PaletteData_LoadBufferFromFileStart(v4, 172, 19, 111, 0, 0x20 * 2, 0); - SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 48, 0, v5); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 47, 0, v5); SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 49, 0, NNS_G2D_VRAM_TYPE_2DSUB, v5); @@ -221,13 +221,13 @@ static void ov100_021D2250(UnkStruct_ov100_021D1C98 *param0) v6.resources[3] = 50000; for (v0 = 0; v0 < 3; v0++) { - param0->unk_08.unk_0C[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v6); + param0->unk_08.unk_0C[v0].unk_00 = CellActor_LoadResources(v3, v4, &v6); - sub_0200D330(param0->unk_08.unk_0C[v0].unk_00); + CellActorData_UpdateObject(param0->unk_08.unk_0C[v0].unk_00); sub_0200D6A4(param0->unk_08.unk_0C[v0].unk_00, 2); sub_0200D6E8(param0->unk_08.unk_0C[v0].unk_00, 0.5f, 0.5f); - sub_0200D430(param0->unk_08.unk_0C[v0].unk_00, v0); - SpriteActor_SetSpritePositionXY(param0->unk_08.unk_0C[v0].unk_00, 16 + (v0 * 64), 64); + CellActorData_SetExplicitPaletteOffset(param0->unk_08.unk_0C[v0].unk_00, v0); + CellActorData_SetPositionXY(param0->unk_08.unk_0C[v0].unk_00, 16 + (v0 * 64), 64); param0->unk_08.unk_0C[v0].unk_0C = 1; param0->unk_08.unk_0C[v0].unk_08 = v0; @@ -249,7 +249,7 @@ static void ov100_021D2324(UnkStruct_ov100_021D1C98 *param0) for (v0 = 0; v0 < 3; v0++) { SysTask_Done(param0->unk_08.unk_0C[v0].unk_40); - sub_0200D0F4(param0->unk_08.unk_0C[v0].unk_00); + CellActorData_Delete(param0->unk_08.unk_0C[v0].unk_00); } } diff --git a/src/overlay100/ov100_021D400C.c b/src/overlay100/ov100_021D400C.c index d5c5a14232..3856f22af2 100644 --- a/src/overlay100/ov100_021D400C.c +++ b/src/overlay100/ov100_021D400C.c @@ -5,8 +5,8 @@ #include "overlay100/struct_ov100_021D4104.h" +#include "sprite_renderer.h" #include "sys_task_manager.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct { @@ -204,7 +204,7 @@ static void ov100_021D43BC(UnkStruct_ov100_021D4104 *param0) } sub_0200D6E8(param0->unk_00, v0, v0); - sub_0200D474(param0->unk_00, param0->unk_14); + CellActorData_SetPriority(param0->unk_00, param0->unk_14); } void ov100_021D4414(SysTask *param0, void *param1) @@ -214,7 +214,7 @@ void ov100_021D4414(SysTask *param0, void *param1) Unk_ov100_021D5334[v0->unk_0C](v0); ov100_021D43BC(v0); - sub_0200D33C(v0->unk_00); + CellActorData_Update2Frames(v0->unk_00); } void ov100_021D4438(SysTask *param0, void *param1) @@ -246,5 +246,5 @@ void ov100_021D4438(SysTask *param0, void *param1) } } - sub_0200D33C(v0->unk_00); + CellActorData_Update2Frames(v0->unk_00); } diff --git a/src/overlay101/ov101_021D7E48.c b/src/overlay101/ov101_021D7E48.c index 28f149f5f4..e1884dc4ff 100644 --- a/src/overlay101/ov101_021D7E48.c +++ b/src/overlay101/ov101_021D7E48.c @@ -3,13 +3,12 @@ #include #include -#include "struct_defs/struct_0200C738.h" - #include "overlay101/struct_ov101_021D8544.h" #include "cell_actor.h" #include "heap.h" #include "narc.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_020093B4.h" #include "unk_0200A328.h" @@ -32,7 +31,7 @@ typedef struct UnkStruct_ov101_021D7E48_t { u8 unk_0A; u8 unk_0B; CellActorCollection *unk_0C; - UnkStruct_0200C738 unk_10; + GF_G2dRenderer unk_10; NNSG2dCellTransferState *unk_19C; SpriteResourceCollection *unk_1A0; SpriteResourceCollection *unk_1A4; diff --git a/src/overlay104/ov104_0222FBE4.c b/src/overlay104/ov104_0222FBE4.c index 872bd0029f..9994ce7121 100644 --- a/src/overlay104/ov104_0222FBE4.c +++ b/src/overlay104/ov104_0222FBE4.c @@ -76,6 +76,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -84,7 +85,6 @@ #include "trainer_info.h" #include "unk_020041CC.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02014000.h" #include "unk_02017728.h" @@ -1325,8 +1325,8 @@ static BOOL ov104_0223066C(UnkStruct_ov104_0222E930 *param0) v9 = (*((param0)->unk_1C++)); v10 = ov104_0223D2FC(v1, v9, v4); - SpriteActor_SetSpritePositionXY(v10, v5, v6); - SpriteActor_EnableObject(v10, v7); + CellActorData_SetPositionXY(v10, v5, v6); + CellActorData_DrawSprite(v10, v7); ov104_0223D378(v1, v9, v8); } @@ -1358,7 +1358,7 @@ static BOOL ov104_02230728(UnkStruct_ov104_0222E930 *param0) v4 = ov104_0223D370(v1, v2); GF_ASSERT(v4 != NULL); - SpriteActor_EnableObject(v4, v3); + CellActorData_DrawSprite(v4, v3); return 0; } @@ -1373,7 +1373,7 @@ static BOOL ov104_02230760(UnkStruct_ov104_0222E930 *param0) v3 = ov104_0223D370(v1, v2); GF_ASSERT(v3 != NULL); - sub_0200D7CC(v3->unk_00, 1); + sub_0200D7CC(v3->cellActor, 1); return 0; } @@ -1390,9 +1390,9 @@ static BOOL ov104_02230790(UnkStruct_ov104_0222E930 *param0) GF_ASSERT(v0 != NULL); if (v4 == 0) { - sub_0200D808(v0->unk_00, GX_OAM_MODE_NORMAL); + sub_0200D808(v0->cellActor, GX_OAM_MODE_NORMAL); } else { - sub_0200D808(v0->unk_00, GX_OAM_MODE_XLU); + sub_0200D808(v0->cellActor, GX_OAM_MODE_XLU); } return 0; @@ -1407,7 +1407,7 @@ static BOOL ov104_022307D8(UnkStruct_ov104_0222E930 *param0) v2 = ov104_0223D370(v3, v0); - sub_0200D364(v2, v1); + CellActorData_SetAnim(v2, v1); ov104_0223D378(v3, v0, 1); return 0; @@ -1439,7 +1439,7 @@ static BOOL ov104_02230850(UnkStruct_ov104_0222E930 *param0) v0 = ov104_0223D370(v1, param0->unk_78[0]); - if ((ov104_0223D3A4(v1, param0->unk_78[0]) == 0) || (sub_0200D3B8(v0) == 0)) { + if ((ov104_0223D3A4(v1, param0->unk_78[0]) == 0) || (CellActorData_IsAnimated(v0) == 0)) { return 1; } diff --git a/src/overlay104/ov104_02231F74.c b/src/overlay104/ov104_02231F74.c index beac558500..6280342561 100644 --- a/src/overlay104/ov104_02231F74.c +++ b/src/overlay104/ov104_02231F74.c @@ -44,6 +44,7 @@ #include "render_text.h" #include "render_window.h" #include "save_player.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" @@ -51,7 +52,6 @@ #include "sys_task_manager.h" #include "text.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_020131EC.h" #include "unk_02014A84.h" @@ -881,7 +881,7 @@ void ov104_02232CE0(UnkStruct_ov104_0223C4CC *param0, Pokemon *param1, int param v6 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param2); SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, v6, 112, 0, NNS_G2D_VRAM_TYPE_2DMAIN, param3); - SpriteRenderer_LoadPalette(v2, 2, v0, v1, v6, 111, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param3); + SpriteRenderer_LoadPaletteFromOpenNarc(v2, 2, v0, v1, v6, 111, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param3); SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, v6, 113, 0, param3); SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, v6, 114, 0, param3); NARC_dtor(v6); @@ -907,8 +907,8 @@ void ov104_02232CE0(UnkStruct_ov104_0223C4CC *param0, Pokemon *param1, int param v8.resources[v7] = param3; } - v5 = SpriteActor_LoadResources(v0, v1, &v8); - sub_0200D330(v5); + v5 = CellActor_LoadResources(v0, v1, &v8); + CellActorData_UpdateObject(v5); } { @@ -927,11 +927,11 @@ void ov104_02232CE0(UnkStruct_ov104_0223C4CC *param0, Pokemon *param1, int param NNSG2dImagePaletteProxy *v12; int v13; - v11 = SpriteActor_ImageProxy(v5->unk_00); + v11 = SpriteActor_ImageProxy(v5->cellActor); DC_FlushRange(v4, sizeof(10 * 10 * ((8 / 2) * 8))); GX_LoadOBJ(v4, v11->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN], (10 * 10 * ((8 / 2) * 8))); - v12 = CellActor_GetPaletteProxy(v5->unk_00); + v12 = CellActor_GetPaletteProxy(v5->cellActor); v13 = sub_0201FAB4(v12, NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStart(v2, v3.archive, v3.palette, param2, 2, 0x20, v13 * 16); @@ -949,7 +949,7 @@ void ov104_02232CE0(UnkStruct_ov104_0223C4CC *param0, Pokemon *param1, int param void ov104_02232E80(UnkStruct_ov104_0223C4CC *param0, int param1) { - sub_0200D0F4(param0->unk_80[param1 - 50000]); + CellActorData_Delete(param0->unk_80[param1 - 50000]); param0->unk_80[param1 - 50000] = NULL; @@ -987,9 +987,9 @@ static const SpriteTemplate Unk_ov104_0223F9AC = { void ov104_02232EC0(UnkStruct_ov104_0223C4CC *param0) { - sub_0200CD7C(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 2000); - sub_0200CE0C(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIcon32KCellsFileIndex(), 0, 2000); - sub_0200CE3C(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIcon32KAnimationFileIndex(), 0, 2000); + SpriteRenderer_LoadPalette(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 2000); + SpriteRenderer_LoadCellResObj(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIcon32KCellsFileIndex(), 0, 2000); + SpriteRenderer_LoadAnimResObj(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIcon32KAnimationFileIndex(), 0, 2000); } void ov104_02232F28(UnkStruct_ov104_0223C4CC *param0) @@ -1016,10 +1016,10 @@ CellActorData *ov104_02232F4C(UnkStruct_ov104_0223C4CC *param0, Pokemon *param1, v1.y = param4; v1.priority = 200; - v0 = SpriteActor_LoadResources(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); + v0 = CellActor_LoadResources(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); - CellActor_SetExplicitPaletteOffsetAutoAdjust(v0->unk_00, Pokemon_IconPaletteIndex(param1)); - sub_0200D330(v0); + CellActor_SetExplicitPaletteOffsetAutoAdjust(v0->cellActor, Pokemon_IconPaletteIndex(param1)); + CellActorData_UpdateObject(v0); return v0; } @@ -1027,7 +1027,7 @@ CellActorData *ov104_02232F4C(UnkStruct_ov104_0223C4CC *param0, Pokemon *param1, void ov104_02232FD4(UnkStruct_ov104_0223C4CC *param0, CellActorData *param1, int param2) { SpriteGfxHandler_UnloadCharObjById(param0->unk_34.unk_04, 2000 + param2); - sub_0200D0F4(param1); + CellActorData_Delete(param1); } void ov104_02232FEC(UnkStruct_ov104_0223C4CC *param0) @@ -1036,7 +1036,7 @@ void ov104_02232FEC(UnkStruct_ov104_0223C4CC *param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, 94); - SpriteRenderer_LoadPalette(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2001); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2001); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_02081938(), 0, 2001); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_0208193C(), 0, 2001); sub_0200D888(param0->unk_34.unk_00, param0->unk_34.unk_04, 20, sub_02081930(), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2009); @@ -1062,15 +1062,15 @@ CellActorData *ov104_022330AC(UnkStruct_ov104_0223C4CC *param0, int param1, int v1.y = param2; v1.priority = 300; - v0 = SpriteActor_LoadResources(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); - sub_0200D330(v0); + v0 = CellActor_LoadResources(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); + CellActorData_UpdateObject(v0); return v0; } void ov104_022330F0(UnkStruct_ov104_0223C4CC *param0, CellActorData *param1) { - sub_0200D0F4(param1); + CellActorData_Delete(param1); } void ov104_022330FC(UnkStruct_ov104_0222E930 *param0, u16 *param1) diff --git a/src/overlay104/ov104_02237378.c b/src/overlay104/ov104_02237378.c index d947463597..f6ddd9be34 100644 --- a/src/overlay104/ov104_02237378.c +++ b/src/overlay104/ov104_02237378.c @@ -407,19 +407,19 @@ BOOL ov104_02237748(UnkStruct_ov104_0222E930 *param0) CellActor *v24; for (v11 = 0; v11 < v4; v11++) { - v23 = v3->unk_30[v11]->unk_00; + v23 = v3->unk_30[v11]->cellActor; v21 = *(CellActor_GetPosition((const CellActor *)v23)); - v24 = v3->unk_40[v11]->unk_00; + v24 = v3->unk_40[v11]->cellActor; v22 = *(CellActor_GetPosition((const CellActor *)v24)); CellActor_SetPosition(v23, &v22); CellActor_SetPosition(v24, &v21); - v23 = v3->unk_50[v11]->unk_00; + v23 = v3->unk_50[v11]->cellActor; v21 = *(CellActor_GetPosition((const CellActor *)v23)); - v24 = v3->unk_60[v11]->unk_00; + v24 = v3->unk_60[v11]->cellActor; v22 = *(CellActor_GetPosition((const CellActor *)v24)); CellActor_SetPosition(v23, &v22); @@ -451,11 +451,11 @@ BOOL ov104_02237748(UnkStruct_ov104_0222E930 *param0) if (v18 == 0) { for (v11 = 0; v11 < v4; v11++) { - CellActor_SetExplicitPriority(v3->unk_30[v11]->unk_00, 2); + CellActor_SetExplicitPriority(v3->unk_30[v11]->cellActor, 2); } } else { for (v11 = 0; v11 < v5; v11++) { - CellActor_SetExplicitPriority(v3->unk_40[v11]->unk_00, 2); + CellActor_SetExplicitPriority(v3->unk_40[v11]->cellActor, 2); } } break; diff --git a/src/overlay104/ov104_02237DD8.c b/src/overlay104/ov104_02237DD8.c index ba7735fbf1..1aac60c7ae 100644 --- a/src/overlay104/ov104_02237DD8.c +++ b/src/overlay104/ov104_02237DD8.c @@ -708,13 +708,13 @@ void ov104_02238764(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104_0223C4CC * for (v2 = 0; v2 < v0; v2++) { v3 = Party_GetPokemonBySlotIndex(param0->unk_70, v2); param0->unk_30[v2] = ov104_02232F4C(param1, v3, v2, Unk_ov104_0223FB18[v2].unk_00, Unk_ov104_0223FB18[v2].unk_02); - CellActor_SetAnimateFlag(param0->unk_30[v2]->unk_00, 0); + CellActor_SetAnimateFlag(param0->unk_30[v2]->cellActor, 0); } } else { for (v2 = 0; v2 < v1; v2++) { v3 = Party_GetPokemonBySlotIndex(param0->unk_74, v2); param0->unk_40[v2] = ov104_02232F4C(param1, v3, v2 + v0, Unk_ov104_0223FB28[v2].unk_00, Unk_ov104_0223FB28[v2].unk_02); - CellActor_SetAnimateFlag(param0->unk_40[v2]->unk_00, 0); + CellActor_SetAnimateFlag(param0->unk_40[v2]->cellActor, 0); } } @@ -753,9 +753,9 @@ void ov104_0223886C(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104_0223C4CC * } if (param2 == 1) { - CellActor_SetDrawFlag(param0->unk_30[param3]->unk_00, 1); + CellActor_SetDrawFlag(param0->unk_30[param3]->cellActor, 1); } else { - CellActor_SetDrawFlag(param0->unk_30[param3]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_30[param3]->cellActor, 0); } return; @@ -772,9 +772,9 @@ void ov104_022388A4(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104_0223C4CC * } if (param2 == 1) { - CellActor_SetDrawFlag(param0->unk_40[param3]->unk_00, 1); + CellActor_SetDrawFlag(param0->unk_40[param3]->cellActor, 1); } else { - CellActor_SetDrawFlag(param0->unk_40[param3]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_40[param3]->cellActor, 0); } return; @@ -796,7 +796,7 @@ void ov104_022388DC(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104_0223C4CC * v3 = Party_GetPokemonBySlotIndex(param0->unk_70, v2); if (Pokemon_GetValue(v3, MON_DATA_HELD_ITEM, NULL) == 0) { - CellActor_SetDrawFlag(param0->unk_50[v2]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_50[v2]->cellActor, 0); } } } else { @@ -806,7 +806,7 @@ void ov104_022388DC(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104_0223C4CC * v3 = Party_GetPokemonBySlotIndex(param0->unk_74, v2); if (Pokemon_GetValue(v3, MON_DATA_HELD_ITEM, NULL) == 0) { - CellActor_SetDrawFlag(param0->unk_60[v2]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_60[v2]->cellActor, 0); } } } @@ -854,12 +854,12 @@ void ov104_022389F4(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104_0223C4CC * if (param4 == 1) { if (v0 == 0) { - CellActor_SetDrawFlag(param0->unk_50[param3]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_50[param3]->cellActor, 0); } else { - CellActor_SetDrawFlag(param0->unk_50[param3]->unk_00, 1); + CellActor_SetDrawFlag(param0->unk_50[param3]->cellActor, 1); } } else { - CellActor_SetDrawFlag(param0->unk_50[param3]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_50[param3]->cellActor, 0); } } else { if (param3 >= v2) { @@ -871,12 +871,12 @@ void ov104_022389F4(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104_0223C4CC * if (param4 == 1) { if (v0 == 0) { - CellActor_SetDrawFlag(param0->unk_60[param3]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_60[param3]->cellActor, 0); } else { - CellActor_SetDrawFlag(param0->unk_60[param3]->unk_00, 1); + CellActor_SetDrawFlag(param0->unk_60[param3]->cellActor, 1); } } else { - CellActor_SetDrawFlag(param0->unk_60[param3]->unk_00, 0); + CellActor_SetDrawFlag(param0->unk_60[param3]->cellActor, 0); } } diff --git a/src/overlay104/ov104_0223C2D4.c b/src/overlay104/ov104_0223C2D4.c index 59838aa643..cd532d9438 100644 --- a/src/overlay104/ov104_0223C2D4.c +++ b/src/overlay104/ov104_0223C2D4.c @@ -47,12 +47,12 @@ #include "render_text.h" #include "render_window.h" #include "save_player.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "trainer_info.h" #include "unk_020041CC.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" #include "unk_0201E3D8.h" @@ -372,14 +372,14 @@ static void ov104_0223C738(SysTask *param0, void *param1) for (v3 = 0; v3 < 8; v3++) { if ((v0->unk_3C.unk_00[v3] != NULL) && (v2 & 1)) { - sub_0200D330(v0->unk_3C.unk_00[v3]); + CellActorData_UpdateObject(v0->unk_3C.unk_00[v3]); } v2 >>= 1; } } - sub_0200C7EC(v0->unk_34.unk_04); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_34.unk_04); sub_0200C808(); ov104_0223D6A8(); @@ -419,7 +419,7 @@ static void ov104_0223C7EC(UnkStruct_ov104_0223C4CC *param0) v1 = ov63_0222D1B0(¶m0->unk_1C) + param0->unk_A4.unk_06; v0 = ov63_0222D1B8(¶m0->unk_1C) + param0->unk_A4.unk_04; - sub_0200962C(sub_0200C738(param0->unk_34.unk_00), FX32_CONST(v0), FX32_CONST(v1)); + sub_0200962C(SpriteRenderer_GetG2dRenderer(param0->unk_34.unk_00), FX32_CONST(v0), FX32_CONST(v1)); Bg_ScheduleScroll(param0->unk_00, 3, 0, v0); Bg_ScheduleScroll(param0->unk_00, 3, 3, v1); @@ -671,7 +671,7 @@ static void ov104_0223CC74(UnkStruct_ov104_0223C4CC *param0, int param1, const T v1 = ov104_0222EA90(param1, 12); if (v1 == 0) { - param0->unk_24 = ov63_0222D1C0(sub_0200C738(param0->unk_34.unk_00), param0->unk_00, &v0, 94); + param0->unk_24 = ov63_0222D1C0(SpriteRenderer_GetG2dRenderer(param0->unk_34.unk_00), param0->unk_00, &v0, 94); } if (ov104_0222EA90(param1, 9) != 0xffff) { @@ -683,7 +683,7 @@ static void ov104_0223CC74(UnkStruct_ov104_0223C4CC *param0, int param1, const T if (v1 == 0) { param0->unk_28 = ov63_0222D1C0( - sub_0200C738(param0->unk_34.unk_00), param0->unk_00, &v0, 94); + SpriteRenderer_GetG2dRenderer(param0->unk_34.unk_00), param0->unk_00, &v0, 94); } } } @@ -811,17 +811,17 @@ static void ov104_0223CFEC(GenericPointerData *param0) static void ov104_0223CFF4(UnkStruct_ov104_0223C4CC *param0) { - param0->unk_34.unk_00 = sub_0200C6E4(94); + param0->unk_34.unk_00 = SpriteRenderer_Create(94); - sub_0200C73C(param0->unk_34.unk_00, &Unk_ov104_0224133C, &Unk_ov104_022412F4, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_34.unk_00, &Unk_ov104_0224133C, &Unk_ov104_022412F4, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_128K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - param0->unk_34.unk_04 = sub_0200C704(param0->unk_34.unk_00); + param0->unk_34.unk_04 = SpriteRenderer_CreateGfxHandler(param0->unk_34.unk_00); - sub_0200C7C0(param0->unk_34.unk_00, param0->unk_34.unk_04, (64 + 64)); - sub_0200CB30(param0->unk_34.unk_00, param0->unk_34.unk_04, &Unk_ov104_02241308); - sub_0200964C(sub_0200C738(param0->unk_34.unk_00), 0, (512 * FX32_ONE)); + SpriteRenderer_CreateCellActorList(param0->unk_34.unk_00, param0->unk_34.unk_04, (64 + 64)); + SpriteRenderer_InitGfxResourceList(param0->unk_34.unk_00, param0->unk_34.unk_04, &Unk_ov104_02241308); + sub_0200964C(SpriteRenderer_GetG2dRenderer(param0->unk_34.unk_00), 0, (512 * FX32_ONE)); } static void ov104_0223D058(UnkStruct_ov104_0223C4CC *param0) @@ -847,7 +847,7 @@ static void ov104_0223D058(UnkStruct_ov104_0223C4CC *param0) for (v1 = 0; v1 < ((50000 + 3) - 50000 + 1); v1++) { if (param0->unk_80[v1] != NULL) { - sub_0200D0F4(param0->unk_80[v1]); + CellActorData_Delete(param0->unk_80[v1]); SpriteGfxHandler_UnloadCharObjById(param0->unk_34.unk_04, 50000 + v1); SpriteGfxHandler_UnloadPlttObjById(param0->unk_34.unk_04, 50000 + v1); @@ -857,8 +857,8 @@ static void ov104_0223D058(UnkStruct_ov104_0223C4CC *param0) } } - sub_0200D0B0(param0->unk_34.unk_00, param0->unk_34.unk_04); - sub_0200C8D4(param0->unk_34.unk_00); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_34.unk_00, param0->unk_34.unk_04); + SpriteRenderer_Free(param0->unk_34.unk_00); } void ov104_0223D0EC(UnkStruct_ov104_0223C4CC *param0, const UnkStruct_ov104_0223C688 *param1) @@ -1078,10 +1078,10 @@ static void ov104_0223D3B0(UnkStruct_ov104_0223C4CC *param0) for (v0 = 0; v0 < 8; v0++) { if (v2->unk_00[v0] != NULL) { - v1->unk_10[v0].unk_05 = sub_0200D37C(v2->unk_00[v0]); - v1->unk_10[v0].unk_06_0 = sub_0200D3E0(v2->unk_00[v0]); + v1->unk_10[v0].unk_05 = CellActorData_GetActiveAnim(v2->unk_00[v0]); + v1->unk_10[v0].unk_06_0 = CellActorData_GetAnimFrame(v2->unk_00[v0]); v1->unk_10[v0].unk_06_13 = ov104_0223D3A4(param0, v0); - v1->unk_10[v0].unk_06_14 = sub_0200D408(v2->unk_00[v0]); + v1->unk_10[v0].unk_06_14 = CellActorData_GetDrawFlag(v2->unk_00[v0]); v1->unk_10[v0].unk_04 = v2->unk_20[v0]; SpriteActor_GetSpritePositionXY(v2->unk_00[v0], &v1->unk_10[v0].unk_00, &v1->unk_10[v0].unk_02); v1->unk_10[v0].unk_06_15 = 1; @@ -1109,13 +1109,13 @@ static void ov104_0223D498(UnkStruct_ov104_0223C4CC *param0) for (v0 = 0; v0 < 8; v0++) { if (v2->unk_10[v0].unk_06_15 == 1) { v3 = ov104_0223D2FC(param0, v0, v2->unk_10[v0].unk_04); - SpriteActor_SetSpritePositionXY(v3, v2->unk_10[v0].unk_00, v2->unk_10[v0].unk_02); - SpriteActor_EnableObject(v3, v2->unk_10[v0].unk_06_14); + CellActorData_SetPositionXY(v3, v2->unk_10[v0].unk_00, v2->unk_10[v0].unk_02); + CellActorData_DrawSprite(v3, v2->unk_10[v0].unk_06_14); ov104_0223D378(param0, v0, v2->unk_10[v0].unk_06_13); - sub_0200D364(v3, v2->unk_10[v0].unk_05); - sub_0200D3CC(v3, v2->unk_10[v0].unk_06_0); + CellActorData_SetAnim(v3, v2->unk_10[v0].unk_05); + CellActorData_SetAnimFrame(v3, v2->unk_10[v0].unk_06_0); } } diff --git a/src/overlay104/ov104_0223D768.c b/src/overlay104/ov104_0223D768.c index 7b2b01e24d..b45cc737f3 100644 --- a/src/overlay104/ov104_0223D768.c +++ b/src/overlay104/ov104_0223D768.c @@ -10,7 +10,7 @@ #include "narc.h" #include "palette.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" static const SpriteTemplate Unk_ov104_022417D8[] = { { @@ -71,7 +71,7 @@ void ov104_0223D768(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *para v0 = &Unk_ov104_022417D8[param4]; SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, v0->resources[0], 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->resources[0]); - SpriteRenderer_LoadPalette(param3, 2, param0, param1, param2, v0->resources[1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->resources[1]); + SpriteRenderer_LoadPaletteFromOpenNarc(param3, 2, param0, param1, param2, v0->resources[1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->resources[1]); SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, v0->resources[2], 1, v0->resources[2]); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, v0->resources[3], 1, v0->resources[3]); } @@ -95,12 +95,12 @@ CellActorData *ov104_0223D828(SpriteRenderer *param0, SpriteGfxHandler *param1, GF_ASSERT(param2 < NELEMS(Unk_ov104_022417D8)); - v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov104_022417D8[param2]); - SpriteActor_UpdateObject(v0->unk_00); + v0 = CellActor_LoadResources(param0, param1, &Unk_ov104_022417D8[param2]); + CellActor_UpdateObject(v0->cellActor); return v0; } void ov104_0223D858(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } diff --git a/src/overlay104/ov104_0223DC7C.c b/src/overlay104/ov104_0223DC7C.c index 63252dfb8b..5d653c8e9e 100644 --- a/src/overlay104/ov104_0223DC7C.c +++ b/src/overlay104/ov104_0223DC7C.c @@ -18,13 +18,13 @@ #include "message.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "sys_task.h" #include "sys_task_manager.h" #include "text.h" #include "unk_0200679C.h" #include "unk_0200A9DC.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_0201E86C.h" @@ -257,7 +257,7 @@ static BOOL ov104_0223DDE4(UnkStruct_ov104_0223DD30 *param0, u32 param1, const U memset(param0->unk_0C, 0, sizeof(UnkStruct_ov104_0223DDE4)); v0 = param0->unk_0C; - v7 = SpriteRenderer_LoadPalette(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2004); + v7 = SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2004); param0->unk_164 |= 1 << v7; param0->unk_30 = sub_02012744(4, 94); @@ -277,7 +277,7 @@ static BOOL ov104_0223DDE4(UnkStruct_ov104_0223DD30 *param0, u32 param1, const U } { - param0->unk_160 = SpriteRenderer_LoadPalette(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_04, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2002); + param0->unk_160 = SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_04, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2002); param0->unk_164 |= 1 << param0->unk_160; SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_05, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2010); @@ -285,7 +285,7 @@ static BOOL ov104_0223DDE4(UnkStruct_ov104_0223DD30 *param0, u32 param1, const U SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_07, 0, 2002); PaletteData_Blend(param0->unk_1C, 2, param0->unk_160 * 16, 16, 14, (GX_RGB(0, 0, 0))); - v7 = SpriteRenderer_LoadPalette(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 51, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2003); + v7 = SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 51, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2003); param0->unk_164 |= 1 << v7; SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, 144, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2011); @@ -293,10 +293,10 @@ static BOOL ov104_0223DDE4(UnkStruct_ov104_0223DD30 *param0, u32 param1, const U SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, 146, 0, 2003); } - v0->unk_90 = SpriteActor_LoadResources(param0->unk_14, param0->unk_18, &Unk_ov104_022418B4); + v0->unk_90 = CellActor_LoadResources(param0->unk_14, param0->unk_18, &Unk_ov104_022418B4); - SpriteActor_EnableObject(v0->unk_90, 0); - SpriteActor_UpdateObject(v0->unk_90->unk_00); + CellActorData_DrawSprite(v0->unk_90, 0); + CellActor_UpdateObject(v0->unk_90->cellActor); ov104_0223E3FC(param0, &v0->unk_14, (FX32_CONST(72)) + FX32_CONST(param0->unk_28), (FX32_CONST(82)) + FX32_CONST(param0->unk_2A), param1); param0->unk_00++; break; @@ -410,7 +410,7 @@ static BOOL ov104_0223DDE4(UnkStruct_ov104_0223DD30 *param0, u32 param1, const U ov104_0223E3B8(&v0->unk_7C); sub_020127BC(param0->unk_30); - sub_0200D0F4(v0->unk_90); + CellActorData_Delete(v0->unk_90); ov104_0223E48C(&v0->unk_14); return 1; @@ -462,7 +462,7 @@ static void ov104_0223E29C(UnkStruct_ov104_0223DD30 *param0, UnkStruct_ov104_022 v0.unk_00 = param0->unk_30; v0.unk_04 = &v1; v0.unk_08 = sub_0200D9B0(v6); - v0.unk_0C = sub_0200D04C(v6, param6); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; v0.unk_18 = param7; @@ -519,12 +519,12 @@ static void ov104_0223E3FC(UnkStruct_ov104_0223DD30 *param0, UnkStruct_ov104_022 param1->unk_02 = 0; for (v0 = 0; v0 < 4; v0++) { - param1->unk_04[v0] = SpriteActor_LoadResources(param0->unk_14, param0->unk_18, &v1); - SpriteActor_EnableObject(param1->unk_04[v0], 0); + param1->unk_04[v0] = CellActor_LoadResources(param0->unk_14, param0->unk_18, &v1); + CellActorData_DrawSprite(param1->unk_04[v0], 0); if (v0 != 3) { - CellActor_SetAffineOverwriteMode(param1->unk_04[v0]->unk_00, 2); - CellActor_SetAnim(param1->unk_04[v0]->unk_00, 1); + CellActor_SetAffineOverwriteMode(param1->unk_04[v0]->cellActor, 2); + CellActor_SetAnim(param1->unk_04[v0]->cellActor, 1); ov104_0223E534(¶m1->unk_14[v0], FX32_CONST(2), FX32_CONST(1), 6); } else { ov104_0223E534(¶m1->unk_14[v0], FX32_CONST(1), FX32_CONST(1), 6); @@ -537,7 +537,7 @@ static void ov104_0223E48C(UnkStruct_ov104_0223E48C *param0) int v0; for (v0 = 0; v0 < 4; v0++) { - sub_0200D0F4(param0->unk_04[v0]); + CellActorData_Delete(param0->unk_04[v0]); } } @@ -562,8 +562,8 @@ static BOOL ov104_0223E4A4(UnkStruct_ov104_0223E48C *param0) v1 = ov104_0223E544(¶m0->unk_14[v0]); v3 = ov104_0223E58C(param0->unk_14[v0].currentValue, param0->unk_14[v0].currentValue, param0->unk_14[v0].currentValue); - CellActor_SetAffineScale(param0->unk_04[v0]->unk_00, &v3); - CellActor_SetDrawFlag(param0->unk_04[v0]->unk_00, 1); + CellActor_SetAffineScale(param0->unk_04[v0]->cellActor, &v3); + CellActor_SetDrawFlag(param0->unk_04[v0]->cellActor, 1); if (v1 == 0) { v2 = 0; @@ -748,7 +748,7 @@ static BOOL ov104_0223E804(UnkStruct_ov104_0223DD30 *param0, UnkStruct_ov104_022 switch (param2->unk_04) { case 0: sub_0200D500(param1->unk_90, 256 + param0->unk_28, 80 + param0->unk_2A, (512 * FX32_ONE)); - SpriteActor_EnableObject(param1->unk_90, 1); + CellActorData_DrawSprite(param1->unk_90, 1); param2->unk_00 = 256 << 8; param2->unk_04++; break; diff --git a/src/overlay109/ov109_021D0D80.c b/src/overlay109/ov109_021D0D80.c index 9acc6ef622..bf82ba5cc8 100644 --- a/src/overlay109/ov109_021D0D80.c +++ b/src/overlay109/ov109_021D0D80.c @@ -45,6 +45,7 @@ #include "party.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -54,7 +55,6 @@ #include "unk_020041CC.h" #include "unk_02005474.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201D15C.h" @@ -1597,7 +1597,7 @@ static void ov109_021D1C90(UnkStruct_ov109_021D0F70 *param0) ov109_021D2CCC(param0); G3_RequestSwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_Z); - sub_0200C7EC(param0->unk_D98); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_D98); } static void ov109_021D1CF0(UnkStruct_ov109_021D0F70 *param0) @@ -1942,8 +1942,8 @@ static void ov109_021D2368(UnkStruct_ov109_021D0F70 *param0) 48 + 48, 1024 * 0x40, 512 * 0x20, GX_OBJVRAMMODE_CHAR_1D_64K, GX_OBJVRAMMODE_CHAR_1D_32K }; - param0->unk_D94 = sub_0200C6E4(95); - sub_0200C73C(param0->unk_D94, &v0, &v1, 16 + 16); + param0->unk_D94 = SpriteRenderer_Create(95); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_D94, &v0, &v1, 16 + 16); } { @@ -1957,10 +1957,10 @@ static void ov109_021D2368(UnkStruct_ov109_021D0F70 *param0) 16, }; - param0->unk_D98 = sub_0200C704(param0->unk_D94); - v2 = sub_0200C7C0(param0->unk_D94, param0->unk_D98, 255); + param0->unk_D98 = SpriteRenderer_CreateGfxHandler(param0->unk_D94); + v2 = SpriteRenderer_CreateCellActorList(param0->unk_D94, param0->unk_D98, 255); GF_ASSERT(v2); - v2 = sub_0200CB30(param0->unk_D94, param0->unk_D98, &v3); + v2 = SpriteRenderer_InitGfxResourceList(param0->unk_D94, param0->unk_D98, &v3); GF_ASSERT(v2); } } @@ -1982,7 +1982,7 @@ static void ov109_021D2408(UnkStruct_ov109_021D0F70 *param0) v4 = NARC_ctor(NARC_INDEX_GRAPHIC__NUTMIXER, 95); SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, v4, 14, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 4); - SpriteRenderer_LoadPalette(v2, 2, v0, v1, v4, 8, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 5); + SpriteRenderer_LoadPaletteFromOpenNarc(v2, 2, v0, v1, v4, 8, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 5); SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, v4, 13, 0, 6); SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, v4, 12, 0, 7); NARC_dtor(v4); @@ -2004,13 +2004,13 @@ static void ov109_021D2408(UnkStruct_ov109_021D0F70 *param0) static void ov109_021D24C0(UnkStruct_ov109_021D0F70 *param0) { - sub_0200D0B0(param0->unk_D94, param0->unk_D98); - sub_0200C8D4(param0->unk_D94); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_D94, param0->unk_D98); + SpriteRenderer_Free(param0->unk_D94); } static CellActorData *ov109_021D24E0(UnkStruct_ov109_021D0F70 *param0, const SpriteTemplate *param1) { - CellActorData *v0 = SpriteActor_LoadResources(param0->unk_D94, param0->unk_D98, param1); + CellActorData *v0 = CellActor_LoadResources(param0->unk_D94, param0->unk_D98, param1); return v0; } @@ -3096,15 +3096,15 @@ static void ov109_021D3600(SysTask *param0, void *param1) } } - sub_0200D34C(v0->unk_14, FX32_ONE + (FX32_ONE / 2)); + CellActorData_UpdateNFrames(v0->unk_14, FX32_ONE + (FX32_ONE / 2)); - if (sub_0200D3B8(v0->unk_14) == 0) { + if (CellActorData_IsAnimated(v0->unk_14) == 0) { v0->unk_00++; } break; case 1: - sub_0200D0F4(v0->unk_14); + CellActorData_Delete(v0->unk_14); Heap_FreeToHeap(v0); SysTask_Done(param0); } @@ -3134,7 +3134,7 @@ static SysTask *ov109_021D3684(UnkStruct_ov109_021D0F70 *param0) v0.resources[5] = SPRITE_RESOURCE_NONE; v1->unk_14 = ov109_021D24E0(param0, &v0); - sub_0200D330(v1->unk_14); + CellActorData_UpdateObject(v1->unk_14); v1->unk_10 = param0; { diff --git a/src/overlay112/ov112_0225C700.c b/src/overlay112/ov112_0225C700.c index f56c7e7f68..3a4a1f2a7d 100644 --- a/src/overlay112/ov112_0225C700.c +++ b/src/overlay112/ov112_0225C700.c @@ -3,7 +3,6 @@ #include #include -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02099F80.h" #include "overlay022/struct_ov22_022559F8.h" @@ -28,6 +27,7 @@ #include "narc.h" #include "overlay_manager.h" #include "palette.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "text.h" @@ -115,7 +115,7 @@ typedef struct { typedef struct { BgConfig *unk_00; CellActorCollection *unk_04; - UnkStruct_0200C738 unk_08; + GF_G2dRenderer unk_08; SpriteResourceCollection *unk_194[4]; NARC *unk_1A4; } UnkStruct_ov112_0225C9BC; diff --git a/src/overlay113/ov113_0225C700.c b/src/overlay113/ov113_0225C700.c index 75cb7705a4..025a9f3b18 100644 --- a/src/overlay113/ov113_0225C700.c +++ b/src/overlay113/ov113_0225C700.c @@ -58,6 +58,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -65,7 +66,6 @@ #include "text.h" #include "unk_02005474.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02015920.h" @@ -401,17 +401,17 @@ int ov113_0225C700(OverlayManager *param0, int *param1) ov113_0225DBCC(v0); v0->unk_C4 = Strbuf_Init(256, 118); - v0->unk_1C = sub_0200C6E4(118); + v0->unk_1C = SpriteRenderer_Create(118); - sub_0200C73C(v0->unk_1C, &Unk_ov113_02260954, &Unk_ov113_022608E8, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_1C, &Unk_ov113_02260954, &Unk_ov113_022608E8, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_128K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_20 = sub_0200C704(v0->unk_1C); + v0->unk_20 = SpriteRenderer_CreateGfxHandler(v0->unk_1C); - sub_0200C7C0(v0->unk_1C, v0->unk_20, (64 + 64)); - sub_0200CB30(v0->unk_1C, v0->unk_20, &Unk_ov113_022608FC); - sub_0200964C(sub_0200C738(v0->unk_1C), 0, ((192 + 80) << FX32_SHIFT)); + SpriteRenderer_CreateCellActorList(v0->unk_1C, v0->unk_20, (64 + 64)); + SpriteRenderer_InitGfxResourceList(v0->unk_1C, v0->unk_20, &Unk_ov113_022608FC); + sub_0200964C(SpriteRenderer_GetG2dRenderer(v0->unk_1C), 0, ((192 + 80) << FX32_SHIFT)); sub_02039734(); ov113_0225E368(&v0->unk_194, v0->unk_19E0); @@ -645,8 +645,8 @@ int ov113_0225CDFC(OverlayManager *param0, int *param1) ov113_0225D12C(v0->unk_08); Heap_FreeToHeap(v0->unk_08); - sub_0200D0B0(v0->unk_1C, v0->unk_20); - sub_0200C8D4(v0->unk_1C); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_1C, v0->unk_20); + SpriteRenderer_Free(v0->unk_1C); PaletteData_FreeBuffer(v0->unk_0C, 0); PaletteData_FreeBuffer(v0->unk_0C, 1); PaletteData_FreeBuffer(v0->unk_0C, 2); @@ -680,7 +680,7 @@ static void ov113_0225CEF0(SysTask *param0, void *param1) ov113_0225E4E8(&v0->unk_194); ov113_0225DB08(v0); - sub_0200C7EC(v0->unk_20); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_20); sub_0200C808(); G3_RequestSwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_Z); } @@ -930,7 +930,7 @@ static void ov113_0225D304(UnkStruct_ov113_0225DBCC *param0, NARC *param1) int v0, v1; u16 v2; - SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10007); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 5, 0, 10002); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 6, 0, 10002); @@ -942,7 +942,7 @@ static void ov113_0225D304(UnkStruct_ov113_0225DBCC *param0, NARC *param1) SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 15, 0, 10001); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 14, 0, 10001); - v1 = SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); + v1 = SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); if (param0->unk_00->unk_04 == 0) { v2 = 0x0; @@ -955,7 +955,7 @@ static void ov113_0225D304(UnkStruct_ov113_0225DBCC *param0, NARC *param1) SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 1, 0, 10003); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 0, 0, 10003); - param0->unk_921 = sub_0200CD7C(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, 187, 26, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); + param0->unk_921 = SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, 187, 26, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); } static void ov113_0225D484(UnkStruct_ov113_0225DBCC *param0) @@ -969,10 +969,10 @@ static void ov113_0225D484(UnkStruct_ov113_0225DBCC *param0) v1.x = 16 + 32 * v0; v1.y = 176; - param0->unk_924[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); + param0->unk_924[v0] = CellActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); - sub_0200D364(param0->unk_924[v0], v0); - SpriteActor_UpdateObject(param0->unk_924[v0]->unk_00); + CellActorData_SetAnim(param0->unk_924[v0], v0); + CellActor_UpdateObject(param0->unk_924[v0]->cellActor); } v1 = Unk_ov113_02260A38; @@ -981,10 +981,10 @@ static void ov113_0225D484(UnkStruct_ov113_0225DBCC *param0) v1.x = 16 + 32 * v0; v1.y = 176; - param0->unk_93C[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); + param0->unk_93C[v0] = CellActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); - sub_0200D364(param0->unk_93C[v0], v0); - SpriteActor_UpdateObject(param0->unk_93C[v0]->unk_00); + CellActorData_SetAnim(param0->unk_93C[v0], v0); + CellActor_UpdateObject(param0->unk_93C[v0]->cellActor); } v1 = Unk_ov113_02260A6C; @@ -994,8 +994,8 @@ static void ov113_0225D484(UnkStruct_ov113_0225DBCC *param0) v1.y = 176; v1.resources[0] = 10001 + v0; - param0->unk_954[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); - SpriteActor_UpdateObject(param0->unk_954[v0]->unk_00); + param0->unk_954[v0] = CellActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); + CellActor_UpdateObject(param0->unk_954[v0]->cellActor); } { @@ -1013,15 +1013,15 @@ static void ov113_0225D5D8(UnkStruct_ov113_0225DBCC *param0) int v0; for (v0 = 0; v0 < 6; v0++) { - sub_0200D0F4(param0->unk_924[v0]); + CellActorData_Delete(param0->unk_924[v0]); } for (v0 = 0; v0 < 6; v0++) { - sub_0200D0F4(param0->unk_93C[v0]); + CellActorData_Delete(param0->unk_93C[v0]); } for (v0 = 0; v0 < 6; v0++) { - sub_0200D0F4(param0->unk_954[v0]); + CellActorData_Delete(param0->unk_954[v0]); } ov113_0225E250(¶m0->unk_19C0); @@ -1031,7 +1031,7 @@ static void ov113_0225D630(UnkStruct_ov113_0225DBCC *param0, NARC *param1) { int v0; - SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_1C, param0->unk_20, param1, 10, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 10004); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_0C, 3, param0->unk_1C, param0->unk_20, param1, 10, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 10004); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 9, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10009); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 8, 0, 10004); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 7, 0, 10004); @@ -1049,20 +1049,20 @@ static void ov113_0225D6F8(UnkStruct_ov113_0225DBCC *param0) int v0; SpriteTemplate v1; - param0->unk_96C = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &Unk_ov113_0226099C); + param0->unk_96C = CellActor_LoadResources(param0->unk_1C, param0->unk_20, &Unk_ov113_0226099C); - SpriteActor_UpdateObject(param0->unk_96C->unk_00); - SpriteActor_EnableObject(param0->unk_96C, 0); + CellActor_UpdateObject(param0->unk_96C->cellActor); + CellActorData_DrawSprite(param0->unk_96C, 0); v1 = Unk_ov113_022609D0; for (v0 = 0; v0 < 8; v0++) { v1.resources[0] = 10010 + v0; - param0->unk_970[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); + param0->unk_970[v0] = CellActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); sub_0200D500(param0->unk_970[v0], Unk_ov113_02260934[v0][0], Unk_ov113_02260934[v0][1], ((192 + 80) << FX32_SHIFT)); - SpriteActor_UpdateObject(param0->unk_970[v0]->unk_00); - SpriteActor_EnableObject(param0->unk_970[v0], 0); + CellActor_UpdateObject(param0->unk_970[v0]->cellActor); + CellActorData_DrawSprite(param0->unk_970[v0], 0); } } @@ -1070,10 +1070,10 @@ static void ov113_0225D7A4(UnkStruct_ov113_0225DBCC *param0) { int v0; - sub_0200D0F4(param0->unk_96C); + CellActorData_Delete(param0->unk_96C); for (v0 = 0; v0 < 8; v0++) { - sub_0200D0F4(param0->unk_970[v0]); + CellActorData_Delete(param0->unk_970[v0]); } } @@ -1088,9 +1088,9 @@ static void ov113_0225D7CC(UnkStruct_ov113_0225DBCC *param0) for (v0 = 0; v0 < 6; v0++) { if ((param0->unk_8D8[v0].unk_02 == 0) || (param0->unk_8D8[v0].unk_02 > NATIONAL_DEX_COUNT)) { - SpriteActor_EnableObject(param0->unk_924[v0], 0); - SpriteActor_EnableObject(param0->unk_93C[v0], 0); - SpriteActor_EnableObject(param0->unk_954[v0], 0); + CellActorData_DrawSprite(param0->unk_924[v0], 0); + CellActorData_DrawSprite(param0->unk_93C[v0], 0); + CellActorData_DrawSprite(param0->unk_954[v0], 0); for (v1 = 0; v1 < 4; v1++) { Bg_FillTilemapRect(param0->unk_08, 2, Unk_ov113_022608AC[v1], 0 + 4 * v0, 0x14 + v1, 4, 1, 17); @@ -1147,7 +1147,7 @@ static BOOL ov113_0225D938(int param0, int param1, CellActorData *param2, NARC * v0 = G2S_GetOBJCharPtr(); } - v1 = SpriteActor_ImageProxy(param2->unk_00); + v1 = SpriteActor_ImageProxy(param2->cellActor); MI_CpuCopy16(v4, (void *)((u32)v0 + v1->vramLocation.baseAddrOfVram[param5]), 0x20 * 2); MI_CpuCopy16(v5, (void *)((u32)v0 + 0x20 * 2 + v1->vramLocation.baseAddrOfVram[param5]), 0x20 * 2); @@ -1361,7 +1361,7 @@ BOOL ov113_0225DDC0(UnkStruct_ov113_0225DBCC *param0, const UnkStruct_ov113_0226 param0->unk_99C[v1] = param1->unk_02; param0->unk_9AC[v1] = param1->unk_00; ov113_0225D938(param1->unk_02, param1->unk_08, param0->unk_970[v1], param0->unk_160, param0->unk_164, NNS_G2D_VRAM_TYPE_2DSUB, param0->unk_19E0); - SpriteActor_EnableObject(param0->unk_970[v1], 1); + CellActorData_DrawSprite(param0->unk_970[v1], 1); PaletteData_FillBufferRange(param0->unk_0C, 1, 2, param1->unk_00, (2 * 16 + 1) + v1, (2 * 16 + 1) + v1 + 1); } } @@ -1407,7 +1407,7 @@ static int ov113_0225DE98(UnkStruct_ov113_0225DBCC *param0) param0->unk_99C[v1] = 0; param0->unk_9AC[v1] = 0; - SpriteActor_EnableObject(param0->unk_970[v1], 0); + CellActorData_DrawSprite(param0->unk_970[v1], 0); Bg_FillTilemapRect(param0->unk_08, 6, 0, Unk_ov113_02260AD4[v1][0], Unk_ov113_02260AD4[v1][1], Unk_ov113_02260AD4[v1][2], Unk_ov113_02260AD4[v1][3], 16); Bg_ScheduleTilemapTransfer(param0->unk_08, 6); v3++; @@ -1415,7 +1415,7 @@ static int ov113_0225DE98(UnkStruct_ov113_0225DBCC *param0) if (v0.unk_04[v1] == param0->unk_168.unk_04) { sub_0200D500(param0->unk_96C, Unk_ov113_02260914[v1][0], Unk_ov113_02260914[v1][1], ((192 + 80) << FX32_SHIFT)); - SpriteActor_EnableObject(param0->unk_96C, 1); + CellActorData_DrawSprite(param0->unk_96C, 1); } } @@ -1464,7 +1464,7 @@ static void ov113_0225E068(UnkStruct_ov113_0225DBCC *param0, int param1) if (param0->unk_990[v1] == NULL) { v0.x = 16 + 32 * param1; v0.y = 176; - param0->unk_990[v1] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v0); + param0->unk_990[v1] = CellActor_LoadResources(param0->unk_1C, param0->unk_20, &v0); break; } @@ -1491,11 +1491,11 @@ static void ov113_0225E118(UnkStruct_ov113_0225DBCC *param0) for (v0 = 0; v0 < 3; v0++) { if (param0->unk_990[v0] != NULL) { - if (sub_0200D3B8(param0->unk_990[v0]) == 0) { - sub_0200D0F4(param0->unk_990[v0]); + if (CellActorData_IsAnimated(param0->unk_990[v0]) == 0) { + CellActorData_Delete(param0->unk_990[v0]); param0->unk_990[v0] = NULL; } else { - SpriteActor_UpdateObject(param0->unk_990[v0]->unk_00); + CellActor_UpdateObject(param0->unk_990[v0]->cellActor); } } } @@ -1535,7 +1535,7 @@ static void ov113_0225E15C(UnkStruct_ov113_0225DBCC *param0, UnkStruct_ov113_022 v0.unk_00 = param0->unk_10; v0.unk_04 = &v1; v0.unk_08 = sub_0200D9B0(v6); - v0.unk_0C = sub_0200D04C(v6, param6); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; v0.unk_18 = param7; diff --git a/src/overlay114/ov114_0225C700.c b/src/overlay114/ov114_0225C700.c index da2de276fa..d7adeb9a63 100644 --- a/src/overlay114/ov114_0225C700.c +++ b/src/overlay114/ov114_0225C700.c @@ -5,7 +5,6 @@ #include "struct_decls/struct_02015920_decl.h" #include "struct_decls/struct_0202B370_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_02015958.h" #include "struct_defs/struct_02099F80.h" @@ -34,6 +33,7 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -82,7 +82,7 @@ typedef struct { typedef struct { CellActorCollection *unk_00; - UnkStruct_0200C738 unk_04; + GF_G2dRenderer unk_04; } UnkStruct_ov114_0225CFCC; typedef struct { diff --git a/src/overlay115/ov115_02260CEC.c b/src/overlay115/ov115_02260CEC.c index 23aadbe4aa..cfbadeeae1 100644 --- a/src/overlay115/ov115_02260CEC.c +++ b/src/overlay115/ov115_02260CEC.c @@ -8,7 +8,6 @@ #include "struct_decls/struct_02012744_decl.h" #include "struct_decls/struct_02012B20_decl.h" #include "struct_defs/sprite_manager_allocation.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_020127E8.h" #include "struct_defs/struct_0207C690.h" #include "struct_defs/struct_02099F80.h" @@ -37,6 +36,7 @@ #include "message.h" #include "narc.h" #include "render_window.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -281,7 +281,7 @@ typedef struct { u16 unk_16; GenericPointerData *unk_18; CellActorCollection *unk_1C; - UnkStruct_0200C738 unk_20; + GF_G2dRenderer unk_20; SpriteResourceCollection *unk_1AC[4]; CellActorResourceData unk_1BC; SpriteResource *unk_1E0[4]; diff --git a/src/overlay116/ov116_022604C4.c b/src/overlay116/ov116_022604C4.c index c40b113eb6..c89b47fbd5 100644 --- a/src/overlay116/ov116_022604C4.c +++ b/src/overlay116/ov116_022604C4.c @@ -34,9 +34,9 @@ #include "narc.h" #include "overlay_manager.h" #include "palette.h" +#include "sprite_renderer.h" #include "unk_02005474.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201D15C.h" @@ -371,7 +371,7 @@ static BOOL ov116_02260B6C(UnkStruct_ov116_02262A8C *param0) { 0, 0 }, }; - v0 = sub_0200D3E0(param0->unk_D8); + v0 = CellActorData_GetAnimFrame(param0->unk_D8); v1 = (param0->unk_0C * 12) + v0; v2 = v4[v1][0]; v3 = v4[v1][1]; @@ -397,9 +397,9 @@ static BOOL ov116_02260B6C(UnkStruct_ov116_02262A8C *param0) param0->unk_08 = v0; if (param0->unk_0C == 2) { - if (sub_0200D37C(param0->unk_D8) != 2) { - SpriteActor_SetSpritePositionXY(param0->unk_D8, 128, 100); - sub_0200D370(param0->unk_D8, 2); + if (CellActorData_GetActiveAnim(param0->unk_D8) != 2) { + CellActorData_SetPositionXY(param0->unk_D8, 128, 100); + CellActorData_SetAnimNoRestart(param0->unk_D8, 2); ov116_02266FEC(¶m0->unk_FC.unk_190); ov116_02266FEC(¶m0->unk_FC.unk_1A0); @@ -412,7 +412,7 @@ static BOOL ov116_02260B6C(UnkStruct_ov116_02262A8C *param0) param0->unk_08 = 0; param0->unk_0C = 0; - SpriteActor_EnableObject(param0->unk_D8, 0); + CellActorData_DrawSprite(param0->unk_D8, 0); ov116_02266FEC(¶m0->unk_FC.unk_190); ov116_02266FEC(¶m0->unk_FC.unk_1A0); @@ -422,7 +422,7 @@ static BOOL ov116_02260B6C(UnkStruct_ov116_02262A8C *param0) return 1; } - sub_0200D33C(param0->unk_D8); + CellActorData_Update2Frames(param0->unk_D8); return 0; } @@ -827,8 +827,8 @@ void ov116_0226139C(UnkStruct_ov116_0226139C *param0) NARC_dtor(param0->unk_48.unk_04); sub_020242C4(param0->unk_48.unk_18); Camera_Delete(param0->unk_48.camera); - sub_0200D0B0(param0->unk_48.unk_08, param0->unk_48.unk_0C); - sub_0200C8D4(param0->unk_48.unk_08); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_48.unk_08, param0->unk_48.unk_0C); + SpriteRenderer_Free(param0->unk_48.unk_08); gCoreSys.unk_65 = 0; @@ -1045,7 +1045,7 @@ static void ov116_02261494(BgConfig *param0) static void ov116_022616CC(UnkStruct_ov116_0226139C *param0) { - param0->unk_48.unk_08 = sub_0200C6E4(106); + param0->unk_48.unk_08 = SpriteRenderer_Create(106); { const UnkStruct_ov104_0224133C v0 = { 0, @@ -1066,7 +1066,7 @@ static void ov116_022616CC(UnkStruct_ov116_0226139C *param0) GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->unk_48.unk_08, &v0, &v1, 16 + 16); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_48.unk_08, &v0, &v1, 16 + 16); } { BOOL v2; @@ -1079,15 +1079,15 @@ static void ov116_022616CC(UnkStruct_ov116_0226139C *param0) 16, }; - param0->unk_48.unk_0C = sub_0200C704(param0->unk_48.unk_08); + param0->unk_48.unk_0C = SpriteRenderer_CreateGfxHandler(param0->unk_48.unk_08); - v2 = sub_0200C7C0(param0->unk_48.unk_08, param0->unk_48.unk_0C, 255); + v2 = SpriteRenderer_CreateCellActorList(param0->unk_48.unk_08, param0->unk_48.unk_0C, 255); GF_ASSERT(v2); - v2 = sub_0200CB30(param0->unk_48.unk_08, param0->unk_48.unk_0C, &v3); + v2 = SpriteRenderer_InitGfxResourceList(param0->unk_48.unk_08, param0->unk_48.unk_0C, &v3); GF_ASSERT(v2); } - sub_0200964C(sub_0200C738(param0->unk_48.unk_08), 0, (192 + 64) << FX32_SHIFT); + sub_0200964C(SpriteRenderer_GetG2dRenderer(param0->unk_48.unk_08), 0, (192 + 64) << FX32_SHIFT); } static BOOL ov116_02261768(int param0) diff --git a/src/overlay116/ov116_02261870.c b/src/overlay116/ov116_02261870.c index 24800d2971..5a63aabd10 100644 --- a/src/overlay116/ov116_02261870.c +++ b/src/overlay116/ov116_02261870.c @@ -24,10 +24,10 @@ #include "narc.h" #include "palette.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "text.h" #include "trainer_info.h" -#include "unk_0200C6E4.h" #include "unk_0202419C.h" static inline void inline_ov116_02261940(UnkStruct_ov116_0226501C *param0); @@ -168,7 +168,7 @@ void ov116_02261940(UnkStruct_ov116_0226139C *param0) } G3_RequestSwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W); - sub_0200C7EC(param0->unk_48.unk_0C); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_48.unk_0C); } void ov116_02261C48(UnkStruct_ov116_02262A8C *param0, int param1) @@ -231,9 +231,9 @@ void ov116_02261D08(UnkStruct_ov116_02262A8C *param0) for (v4 = 0; v4 < (3 * 12); v4++) { ov116_02261CD8(&v0, v4 * 8, 20, 1, 3, 9006); - param0->unk_28[v4] = SpriteActor_LoadResources(v1, v2, &v0); - sub_0200D430(param0->unk_28[v4], 3); - sub_0200D364(param0->unk_28[v4], (v4 % 11) + 1); + param0->unk_28[v4] = CellActor_LoadResources(v1, v2, &v0); + CellActorData_SetExplicitPaletteOffset(param0->unk_28[v4], 3); + CellActorData_SetAnim(param0->unk_28[v4], (v4 % 11) + 1); } ov116_02261E0C(param0, 0, 0); @@ -253,10 +253,10 @@ void ov116_02261D70(UnkStruct_ov116_02262A8C *param0) v0.bgPriority = 0; v0.priority = 1; - param0->unk_B8[v4] = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_B8[v4] = CellActor_LoadResources(v1, v2, &v0); - sub_0200D33C(param0->unk_B8[v4]); - sub_0200D430(param0->unk_B8[v4], 1); + CellActorData_Update2Frames(param0->unk_B8[v4]); + CellActorData_SetExplicitPaletteOffset(param0->unk_B8[v4], 1); } } @@ -265,7 +265,7 @@ void ov116_02261DF0(UnkStruct_ov116_02262A8C *param0) int v0; for (v0 = 0; v0 < 4; v0++) { - sub_0200D0F4(param0->unk_B8[v0]); + CellActorData_Delete(param0->unk_B8[v0]); } } @@ -274,7 +274,7 @@ void ov116_02261E0C(UnkStruct_ov116_02262A8C *param0, BOOL param1, int param2) int v0; for (v0 = 0; v0 < (3 * 12); v0++) { - SpriteActor_EnableObject(param0->unk_28[v0], param1); + CellActorData_DrawSprite(param0->unk_28[v0], param1); } } @@ -283,7 +283,7 @@ void ov116_02261E28(UnkStruct_ov116_02262A8C *param0) int v0; for (v0 = 0; v0 < (3 * 12); v0++) { - sub_0200D33C(param0->unk_28[v0]); + CellActorData_Update2Frames(param0->unk_28[v0]); } } @@ -292,7 +292,7 @@ void ov116_02261E40(UnkStruct_ov116_02262A8C *param0) int v0; for (v0 = 0; v0 < (3 * 12); v0++) { - sub_0200D0F4(param0->unk_28[v0]); + CellActorData_Delete(param0->unk_28[v0]); } } @@ -319,8 +319,8 @@ void ov116_02261E58(UnkStruct_ov116_02262A8C *param0, int param1, int param2) int v1 = param0->unk_DC[param1]; - sub_0200D364(param0->unk_1C[v1], v0[param2][0]); - sub_0200D364(param0->unk_20[v1], v0[param2][1]); + CellActorData_SetAnim(param0->unk_1C[v1], v0[param2][0]); + CellActorData_SetAnim(param0->unk_20[v1], v0[param2][1]); } int ov116_02261EA4(UnkStruct_ov116_02262A8C *param0, int param1) @@ -336,8 +336,8 @@ int ov116_02261EA4(UnkStruct_ov116_02262A8C *param0, int param1) int v2[2]; v1 = param0->unk_DC[param1]; - v2[0] = sub_0200D37C(param0->unk_1C[v1]); - v2[1] = sub_0200D37C(param0->unk_20[v1]); + v2[0] = CellActorData_GetActiveAnim(param0->unk_1C[v1]); + v2[1] = CellActorData_GetActiveAnim(param0->unk_20[v1]); { int v3; @@ -364,9 +364,9 @@ void ov116_02261F08(UnkStruct_ov116_02262A8C *param0) continue; } - sub_0200D33C(param0->unk_1C[v1]); - sub_0200D33C(param0->unk_20[v1]); - sub_0200D33C(param0->unk_24[v1]); + CellActorData_Update2Frames(param0->unk_1C[v1]); + CellActorData_Update2Frames(param0->unk_20[v1]); + CellActorData_Update2Frames(param0->unk_24[v1]); v1++; } @@ -382,9 +382,9 @@ void ov116_02261F3C(UnkStruct_ov116_02262A8C *param0) continue; } - sub_0200D0F4(param0->unk_1C[v1]); - sub_0200D0F4(param0->unk_20[v1]); - sub_0200D0F4(param0->unk_24[v1]); + CellActorData_Delete(param0->unk_1C[v1]); + CellActorData_Delete(param0->unk_20[v1]); + CellActorData_Delete(param0->unk_24[v1]); v1++; } @@ -600,7 +600,7 @@ void ov116_022622C8(UnkStruct_ov116_0226139C *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DSUB, v11); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); - SpriteRenderer_LoadPalette(v5, 3, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DSUB, v11); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 3, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DSUB, v11); v7 = 27; v8 = 28; @@ -612,7 +612,7 @@ void ov116_022622C8(UnkStruct_ov116_0226139C *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 11; v8 = 12; @@ -624,7 +624,7 @@ void ov116_022622C8(UnkStruct_ov116_0226139C *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 19; v8 = 20; @@ -636,7 +636,7 @@ void ov116_022622C8(UnkStruct_ov116_0226139C *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 15; v8 = 16; @@ -648,7 +648,7 @@ void ov116_022622C8(UnkStruct_ov116_0226139C *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 23; v8 = 24; @@ -660,7 +660,7 @@ void ov116_022622C8(UnkStruct_ov116_0226139C *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); { NARC *v13 = NARC_ctor(NARC_INDEX_RESOURCE__ENG__WIFI_LOBBY_MINIGAME__WLMNGM_TOOL, 106); @@ -675,7 +675,7 @@ void ov116_022622C8(UnkStruct_ov116_0226139C *param0) SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v13, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v13, v8, 0, v11); SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v13, v7, 0, v11); - SpriteRenderer_LoadPalette(v5, 2, v3, v4, v13, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadPaletteFromOpenNarc(v5, 2, v3, v4, v13, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); NARC_dtor(v13); } } @@ -699,21 +699,21 @@ void ov116_022625A8(UnkStruct_ov116_0226139C *param0, UnkStruct_ov116_02262A8C * ov116_02261CD8(&v0, Unk_ov116_02267A78[param1->unk_04 - 1][v5] + 0, (176 + 64), 2, 0, 9000); v0.priority = 1; - param1->unk_1C[v5] = SpriteActor_LoadResources(v1, v2, &v0); + param1->unk_1C[v5] = CellActor_LoadResources(v1, v2, &v0); ov116_02261CD8(&v0, Unk_ov116_02267A78[param1->unk_04 - 1][v5] + 0, ((176 + 64) + 0), 2, 0, 9000); v0.priority = 2; - param1->unk_20[v5] = SpriteActor_LoadResources(v1, v2, &v0); - sub_0200D430(param1->unk_20[v5], 0 + ov116_02264680(param0, v4)); + param1->unk_20[v5] = CellActor_LoadResources(v1, v2, &v0); + CellActorData_SetExplicitPaletteOffset(param1->unk_20[v5], 0 + ov116_02264680(param0, v4)); ov116_02261CD8(&v0, Unk_ov116_02267A78[param1->unk_04 - 1][v5] + 0, ((176 + 64) + 0), 2, 0, 9000); v0.priority = 3; - param1->unk_24[v5] = SpriteActor_LoadResources(v1, v2, &v0); - sub_0200D430(param1->unk_24[v5], 0 + ov116_02264680(param0, v4)); - sub_0200D364(param1->unk_24[v5], 5); - sub_0200D33C(param1->unk_1C[v5]); - sub_0200D33C(param1->unk_20[v5]); - sub_0200D33C(param1->unk_24[v5]); + param1->unk_24[v5] = CellActor_LoadResources(v1, v2, &v0); + CellActorData_SetExplicitPaletteOffset(param1->unk_24[v5], 0 + ov116_02264680(param0, v4)); + CellActorData_SetAnim(param1->unk_24[v5], 5); + CellActorData_Update2Frames(param1->unk_1C[v5]); + CellActorData_Update2Frames(param1->unk_20[v5]); + CellActorData_Update2Frames(param1->unk_24[v5]); ov116_02261E58(param1, v4, 0); v5++; @@ -732,9 +732,9 @@ CellActorData *ov116_022626E8(UnkStruct_ov116_02262A8C *param0, s16 param1, s16 v1.bgPriority = 0; v1.priority = 0; - v0 = SpriteActor_LoadResources(v2, v3, &v1); + v0 = CellActor_LoadResources(v2, v3, &v1); - sub_0200D33C(v0); + CellActorData_Update2Frames(v0); return v0; } @@ -753,25 +753,25 @@ void ov116_02262724(UnkStruct_ov116_02262A8C *param0) v2.bgPriority = 2; v2.priority = 20; - param0->unk_D0[v0] = SpriteActor_LoadResources(v3, v4, &v2); + param0->unk_D0[v0] = CellActor_LoadResources(v3, v4, &v2); - sub_0200D364(param0->unk_D0[v0], 0); - sub_0200D330(param0->unk_D0[v0]); - sub_0200D430(param0->unk_D0[v0], 4); + CellActorData_SetAnim(param0->unk_D0[v0], 0); + CellActorData_UpdateObject(param0->unk_D0[v0]); + CellActorData_SetExplicitPaletteOffset(param0->unk_D0[v0], 4); SpriteActor_SetOAMMode(param0->unk_D0[v0], GX_OAM_MODE_XLU); - SpriteActor_EnableObject(param0->unk_D0[v0], 0); + CellActorData_DrawSprite(param0->unk_D0[v0], 0); ov116_02261CD8(&v2, 0, 0, 2, 0, 9000); v2.bgPriority = 2; v2.priority = 20; - param0->unk_C8[v0] = SpriteActor_LoadResources(v3, v4, &v2); + param0->unk_C8[v0] = CellActor_LoadResources(v3, v4, &v2); - sub_0200D364(param0->unk_C8[v0], 6); - sub_0200D330(param0->unk_C8[v0]); - sub_0200D430(param0->unk_C8[v0], 0); + CellActorData_SetAnim(param0->unk_C8[v0], 6); + CellActorData_UpdateObject(param0->unk_C8[v0]); + CellActorData_SetExplicitPaletteOffset(param0->unk_C8[v0], 0); SpriteActor_SetOAMMode(param0->unk_C8[v0], GX_OAM_MODE_XLU); - SpriteActor_EnableObject(param0->unk_C8[v0], 0); + CellActorData_DrawSprite(param0->unk_C8[v0], 0); } } @@ -780,8 +780,8 @@ void ov116_0226281C(UnkStruct_ov116_02262A8C *param0) int v0; for (v0 = 0; v0 < 2; v0++) { - sub_0200D0F4(param0->unk_D0[v0]); - sub_0200D0F4(param0->unk_C8[v0]); + CellActorData_Delete(param0->unk_D0[v0]); + CellActorData_Delete(param0->unk_C8[v0]); } } @@ -798,17 +798,17 @@ void ov116_02262840(UnkStruct_ov116_02262A8C *param0) v2.bgPriority = 0; v2.priority = 0; - param0->unk_D8 = SpriteActor_LoadResources(v3, v4, &v2); + param0->unk_D8 = CellActor_LoadResources(v3, v4, &v2); - sub_0200D364(param0->unk_D8, 1); - SpriteActor_EnableObject(param0->unk_D8, 1); - sub_0200D330(param0->unk_D8); - sub_0200D430(param0->unk_D8, 7); + CellActorData_SetAnim(param0->unk_D8, 1); + CellActorData_DrawSprite(param0->unk_D8, 1); + CellActorData_UpdateObject(param0->unk_D8); + CellActorData_SetExplicitPaletteOffset(param0->unk_D8, 7); } void ov116_022628AC(UnkStruct_ov116_02262A8C *param0) { - sub_0200D0F4(param0->unk_D8); + CellActorData_Delete(param0->unk_D8); } void ov116_022628B8(UnkStruct_ov116_0226139C *param0) diff --git a/src/overlay116/ov116_02262A8C.c b/src/overlay116/ov116_02262A8C.c index 04d2fc7c51..950d0c358f 100644 --- a/src/overlay116/ov116_02262A8C.c +++ b/src/overlay116/ov116_02262A8C.c @@ -18,11 +18,11 @@ #include "easy3d_object.h" #include "heap.h" #include "inlines.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_0201D15C.h" @@ -514,7 +514,7 @@ void ov116_02262E50(SysTask *param0, void *param1) void ov116_02263158(SysTask *param0, void *param1) { UnkStruct_ov116_02262CB8 *v0 = param1; - int v1 = sub_0200D3E0(v0->unk_0C); + int v1 = CellActorData_GetAnimFrame(v0->unk_0C); if ((IsScreenTransitionDone() == 0) || (v0->unk_2C->unk_2C.unk_00 == 1)) { SysTask_Done(param0); @@ -581,15 +581,15 @@ static void ov116_0226323C(SysTask *param0, void *param1) case 0: { f32 v1, v2; - sub_0200D364(v0->unk_0C, 7); - sub_0200D474(v0->unk_0C, 0); + CellActorData_SetAnim(v0->unk_0C, 7); + CellActorData_SetPriority(v0->unk_0C, 0); sub_0200D6A4(v0->unk_0C, 2); sub_0200D788(v0->unk_0C, &v1, &v2); ov116_02264764(&v0->unk_10, FX_F32_TO_FX32(v2), FX_F32_TO_FX32(2.0f), 2); { int v3 = (*v0->unk_2C) - 1; - sub_0200D430(v0->unk_0C, v3); + CellActorData_SetExplicitPaletteOffset(v0->unk_0C, v3); } v0->unk_00++; @@ -649,8 +649,8 @@ static void ov116_0226323C(SysTask *param0, void *param1) } break; default: sub_0200D6E8(v0->unk_0C, 1.0f, 1.0f); - sub_0200D364(v0->unk_0C, 5); - sub_0200D474(v0->unk_0C, 2); + CellActorData_SetAnim(v0->unk_0C, 5); + CellActorData_SetPriority(v0->unk_0C, 2); sub_0200D6A4(v0->unk_0C, 0); v0->unk_30 = 0; diff --git a/src/overlay116/ov116_0226432C.c b/src/overlay116/ov116_0226432C.c index 9906752733..d2379f5861 100644 --- a/src/overlay116/ov116_0226432C.c +++ b/src/overlay116/ov116_0226432C.c @@ -25,10 +25,10 @@ #include "heap.h" #include "inlines.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_0201D15C.h" @@ -332,7 +332,7 @@ static void ov116_022647BC(SysTask *param0, void *param1) if ((IsScreenTransitionDone() == 0) || (v0->unk_A4->unk_2C.unk_00 == 1)) { for (v1 = 0; v1 < 3; v1++) { - sub_0200D0F4(v0->unk_08[v1]); + CellActorData_Delete(v0->unk_08[v1]); } v0->unk_00 = 0; @@ -362,7 +362,7 @@ static void ov116_022647BC(SysTask *param0, void *param1) v5 = 0; } - sub_0200D330(v0->unk_08[v1]); + CellActorData_UpdateObject(v0->unk_08[v1]); } if (v5) { v0->unk_04++; @@ -371,7 +371,7 @@ static void ov116_022647BC(SysTask *param0, void *param1) break; default: for (v1 = 0; v1 < 3; v1++) { - sub_0200D0F4(v0->unk_08[v1]); + CellActorData_Delete(v0->unk_08[v1]); } v0->unk_00 = 0; @@ -397,7 +397,7 @@ void ov116_0226493C(UnkStruct_ov116_02262A8C *param0, s16 param1, s16 param2) for (v1 = 0; v1 < 3; v1++) { param0->unk_214C[v0].unk_08[v1] = ov116_022626E8(param0, param1, param2); - sub_0200D364(param0->unk_214C[v0].unk_08[v1], ((param1 * (v0 + 1)) + (param2 * (v1 + 1))) % 3); + CellActorData_SetAnim(param0->unk_214C[v0].unk_08[v1], ((param1 * (v0 + 1)) + (param2 * (v1 + 1))) % 3); } SysTask_Start(ov116_022647BC, ¶m0->unk_214C[v0], 4096); @@ -507,7 +507,7 @@ static void ov116_022649E4(SysTask *param0, void *param1) if (v0->unk_14[v6].unk_32 >= (10 + v0->unk_14[v6].unk_26)) { if (v0->unk_14[v6].unk_32 == (10 + v0->unk_14[v6].unk_26)) { - sub_0200D364(v0->unk_14[v6].unk_00, 0); + CellActorData_SetAnim(v0->unk_14[v6].unk_00, 0); } if (v0->unk_14[v6].unk_32 == (18 + v0->unk_14[v6].unk_26)) { @@ -518,7 +518,7 @@ static void ov116_022649E4(SysTask *param0, void *param1) } } - SpriteActor_EnableObject(v0->unk_14[v6].unk_00, v0->unk_14[v6].unk_25); + CellActorData_DrawSprite(v0->unk_14[v6].unk_00, v0->unk_14[v6].unk_25); switch (v0->unk_14[v6].unk_27) { case 0: @@ -693,7 +693,7 @@ static void ov116_0226510C(UnkStruct_ov116_02265470 *param0) SpriteActor_GetSpritePositionXY(v5, &v1, &v2); if (v2 > v3[v0]) { v2 -= 6; - SpriteActor_SetSpritePositionXY(v5, v1, v2); + CellActorData_SetPositionXY(v5, v1, v2); v4[v0] = 0; } } @@ -724,7 +724,7 @@ static void ov116_0226510C(UnkStruct_ov116_02265470 *param0) SpriteActor_GetSpritePositionXY(v5, &v1, &v2); if (v2 < (192 + 32)) { v2 += 6; - SpriteActor_SetSpritePositionXY(v5, v1, v2); + CellActorData_SetPositionXY(v5, v1, v2); v4[v0] = 0; } } @@ -748,7 +748,7 @@ static void ov116_0226510C(UnkStruct_ov116_02265470 *param0) continue; } - sub_0200D33C(v5); + CellActorData_Update2Frames(v5); } } @@ -915,9 +915,9 @@ void ov116_02265470(UnkStruct_ov116_02262A8C *param0) s16 v2, v3; SpriteActor_GetSpritePositionXY(param0->unk_B8[0], &v2, &v3); - SpriteActor_SetSpritePositionXY(param0->unk_B8[0], v2, (192 + 32)); + CellActorData_SetPositionXY(param0->unk_B8[0], v2, (192 + 32)); SpriteActor_GetSpritePositionXY(param0->unk_B8[1], &v2, &v3); - SpriteActor_SetSpritePositionXY(param0->unk_B8[1], v2, (192 + 32)); + CellActorData_SetPositionXY(param0->unk_B8[1], v2, (192 + 32)); } break; case 2: { @@ -936,9 +936,9 @@ void ov116_02265470(UnkStruct_ov116_02262A8C *param0) s16 v5, v6; SpriteActor_GetSpritePositionXY(param0->unk_B8[2], &v5, &v6); - SpriteActor_SetSpritePositionXY(param0->unk_B8[2], v5, (192 + 32)); + CellActorData_SetPositionXY(param0->unk_B8[2], v5, (192 + 32)); SpriteActor_GetSpritePositionXY(param0->unk_B8[3], &v5, &v6); - SpriteActor_SetSpritePositionXY(param0->unk_B8[3], v5, (192 + 32)); + CellActorData_SetPositionXY(param0->unk_B8[3], v5, (192 + 32)); } break; case 4: @@ -1177,9 +1177,9 @@ static void ov116_0226591C(SysTask *param0, void *param1) for (v0 = 0; v0 < 2; v0++) { int v5 = Unk_ov116_02267DA4[v2].unk_0C[v0]; - sub_0200D430(v4->unk_00[v0].unk_00, 4 + v5); + CellActorData_SetExplicitPaletteOffset(v4->unk_00[v0].unk_00, 4 + v5); v5 = Unk_ov116_02267DA4[v2].unk_18[v0]; - sub_0200D430(v4->unk_A0[v0].unk_00, 0 + v5); + CellActorData_SetExplicitPaletteOffset(v4->unk_A0[v0].unk_00, 0 + v5); } SysTask_Start(Unk_ov116_02267DA4[v2].unk_24, v3, 4097); @@ -1239,7 +1239,7 @@ static void ov116_02265AA4(SysTask *param0, void *param1) v1->unk_00[0].unk_18 = 64; v1->unk_00[0].unk_1C = 24; - SpriteActor_EnableObject(v1->unk_00[0].unk_00, 1); + CellActorData_DrawSprite(v1->unk_00[0].unk_00, 1); v1->unk_A0[0].unk_08 = 0; v1->unk_A0[0].unk_14 = 128; @@ -1247,7 +1247,7 @@ static void ov116_02265AA4(SysTask *param0, void *param1) v1->unk_A0[0].unk_18 = 64; v1->unk_A0[0].unk_1C = 24; - SpriteActor_EnableObject(v1->unk_A0[0].unk_00, 1); + CellActorData_DrawSprite(v1->unk_A0[0].unk_00, 1); { sub_0200D67C(v1->unk_00[0].unk_00, &v5, &v6, ((192 + 64) << FX32_SHIFT)); @@ -1505,7 +1505,7 @@ static void ov116_022660A8(SysTask *param0, void *param1) v2->unk_00[v0].unk_18 = 64; v2->unk_00[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_00[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[v0].unk_00, 1); v2->unk_A0[v0].unk_08 = 0; v2->unk_A0[v0].unk_14 = 128; @@ -1513,7 +1513,7 @@ static void ov116_022660A8(SysTask *param0, void *param1) v2->unk_A0[v0].unk_18 = 64; v2->unk_A0[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_A0[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); @@ -1530,7 +1530,7 @@ static void ov116_022660A8(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 0); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 0); v1->unk_1C++; case 1: v3[0] = ov116_02265D8C(&v2->unk_A0[0], v2->unk_144, 0, 3); @@ -1543,7 +1543,7 @@ static void ov116_022660A8(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 1); v1->unk_1C++; } else { break; @@ -1632,7 +1632,7 @@ static void ov116_0226644C(SysTask *param0, void *param1) v2->unk_00[v0].unk_18 = 64; v2->unk_00[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_00[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[v0].unk_00, 1); v2->unk_A0[v0].unk_08 = 0; v2->unk_A0[v0].unk_14 = 128; @@ -1640,7 +1640,7 @@ static void ov116_0226644C(SysTask *param0, void *param1) v2->unk_A0[v0].unk_18 = 64; v2->unk_A0[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_A0[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); @@ -1657,7 +1657,7 @@ static void ov116_0226644C(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 0); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 0); v1->unk_1C++; case 1: v3[0] = ov116_02265D8C(&v2->unk_A0[0], v2->unk_144, 0, 3); @@ -1669,7 +1669,7 @@ static void ov116_0226644C(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 1); v1->unk_1C++; } else { break; @@ -1750,7 +1750,7 @@ static void ov116_022667F4(SysTask *param0, void *param1) v2->unk_00[v0].unk_18 = 64; v2->unk_00[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_00[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[v0].unk_00, 1); v2->unk_A0[v0].unk_08 = 0; v2->unk_A0[v0].unk_14 = 128; @@ -1758,7 +1758,7 @@ static void ov116_022667F4(SysTask *param0, void *param1) v2->unk_A0[v0].unk_18 = 64; v2->unk_A0[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_A0[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); @@ -1775,7 +1775,7 @@ static void ov116_022667F4(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 0); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 0); v1->unk_1C++; case 1: @@ -1789,7 +1789,7 @@ static void ov116_022667F4(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 1); v1->unk_1C++; } else { break; @@ -1896,7 +1896,7 @@ static void ov116_02266BF0(SysTask *param0, void *param1) v2->unk_00[v0].unk_18 = 64; v2->unk_00[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_00[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[v0].unk_00, 1); v2->unk_A0[v0].unk_08 = 0; v2->unk_A0[v0].unk_14 = 128; @@ -1904,7 +1904,7 @@ static void ov116_02266BF0(SysTask *param0, void *param1) v2->unk_A0[v0].unk_18 = 64; v2->unk_A0[v0].unk_1C = 24; - SpriteActor_EnableObject(v2->unk_A0[v0].unk_00, 1); + CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); @@ -1921,7 +1921,7 @@ static void ov116_02266BF0(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 0); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 0); v1->unk_1C++; case 1: v3[0] = ov116_02265D8C(&v2->unk_A0[0], v2->unk_144, 0, 3); @@ -1934,7 +1934,7 @@ static void ov116_02266BF0(SysTask *param0, void *param1) ov116_02265D84(&v2->unk_A0[1]); ov116_02265D84(&v2->unk_00[0]); ov116_02265D84(&v2->unk_00[1]); - SpriteActor_EnableObject(v2->unk_00[1].unk_00, 1); + CellActorData_DrawSprite(v2->unk_00[1].unk_00, 1); v1->unk_1C++; } else { break; diff --git a/src/overlay117/ov117_02260668.c b/src/overlay117/ov117_02260668.c index f9c8c938d9..b61029e30f 100644 --- a/src/overlay117/ov117_02260668.c +++ b/src/overlay117/ov117_02260668.c @@ -39,6 +39,7 @@ #include "palette.h" #include "render_text.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "sys_task.h" @@ -47,7 +48,6 @@ #include "trainer_info.h" #include "unk_02005474.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02012744.h" #include "unk_02014000.h" @@ -217,17 +217,17 @@ int ov117_02260668(OverlayManager *param0, int *param1) sub_0201E450(4); ov117_02260EC0(v0); - v0->unk_24 = sub_0200C6E4(110); + v0->unk_24 = SpriteRenderer_Create(110); - sub_0200C73C(v0->unk_24, &Unk_ov117_022669A8, &Unk_ov117_0226697C, (16 + 16)); + SpriteRenderer_CreateOamCharPlttManagers(v0->unk_24, &Unk_ov117_022669A8, &Unk_ov117_0226697C, (16 + 16)); sub_0200966C(NNS_G2D_VRAM_TYPE_2DMAIN, GX_OBJVRAMMODE_CHAR_1D_64K); sub_02009704(NNS_G2D_VRAM_TYPE_2DMAIN); - v0->unk_28 = sub_0200C704(v0->unk_24); + v0->unk_28 = SpriteRenderer_CreateGfxHandler(v0->unk_24); - sub_0200C7C0(v0->unk_24, v0->unk_28, (96 + 128)); - sub_0200CB30(v0->unk_24, v0->unk_28, &Unk_ov117_02266990); - sub_0200964C(sub_0200C738(v0->unk_24), 0, ((192 + 160) << FX32_SHIFT)); + SpriteRenderer_CreateCellActorList(v0->unk_24, v0->unk_28, (96 + 128)); + SpriteRenderer_InitGfxResourceList(v0->unk_24, v0->unk_28, &Unk_ov117_02266990); + sub_0200964C(SpriteRenderer_GetG2dRenderer(v0->unk_24), 0, ((192 + 160) << FX32_SHIFT)); ov117_02261574(v0); v0->unk_80 = MessageLoader_Init(0, 26, 9, 110); @@ -460,8 +460,8 @@ int ov117_02260C10(OverlayManager *param0, int *param1) Bg_FreeTilemapBuffer(v0->unk_2C, 6); Bg_FreeTilemapBuffer(v0->unk_2C, 7); sub_020127BC(v0->unk_90); - sub_0200D0B0(v0->unk_24, v0->unk_28); - sub_0200C8D4(v0->unk_24); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_24, v0->unk_28); + SpriteRenderer_Free(v0->unk_24); VRAMTransferManager_Destroy(); PaletteData_FreeBuffer(v0->unk_8C, 0); PaletteData_FreeBuffer(v0->unk_8C, 1); @@ -627,7 +627,7 @@ static void ov117_02260F7C(SysTask *param0, void *param1) sub_020146C0(); } - sub_0200C7EC(v0->unk_28); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_28); sub_0200C808(); G3_RequestSwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_Z); sub_02038A1C(110, v0->unk_2C); @@ -974,7 +974,7 @@ static void ov117_0226168C(UnkStruct_ov117_02261280 *param0, NARC *param1) Strbuf *v1, *v2; int v3; - SpriteRenderer_LoadPalette(param0->unk_8C, 2, param0->unk_24, param0->unk_28, param1, 27, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_8C, 2, param0->unk_24, param0->unk_28, param1, 27, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); v1 = MessageLoader_GetNewStrbuf(param0->unk_80, 2); v0 = 6 + ((30 - Font_CalcStrbufWidth(0, v1, 0)) / 2); @@ -994,16 +994,16 @@ static void ov117_0226168C(UnkStruct_ov117_02261280 *param0, NARC *param1) ov117_02266150(param0); - SpriteRenderer_LoadPalette(param0->unk_8C, 2, param0->unk_24, param0->unk_28, param1, 27, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10004); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_8C, 2, param0->unk_24, param0->unk_28, param1, 27, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10004); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 24, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 26, 0, 10002); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 25, 0, 10002); param0->unk_15A8.unk_00 = ov117_02266130(param0); - sub_0200CD7C(param0->unk_8C, 2, param0->unk_24, param0->unk_28, 171, 20, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); - sub_0200CBDC(param0->unk_24, param0->unk_28, 171, 21, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); - sub_0200CE0C(param0->unk_24, param0->unk_28, 171, 22, 0, 10001); - sub_0200CE3C(param0->unk_24, param0->unk_28, 171, 23, 0, 10001); + SpriteRenderer_LoadPalette(param0->unk_8C, 2, param0->unk_24, param0->unk_28, 171, 20, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); + SpriteRenderer_LoadCharResObj(param0->unk_24, param0->unk_28, 171, 21, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadCellResObj(param0->unk_24, param0->unk_28, 171, 22, 0, 10001); + SpriteRenderer_LoadAnimResObj(param0->unk_24, param0->unk_28, 171, 23, 0, 10001); param0->unk_174C.unk_00 = ov117_02266244(param0); } @@ -1024,7 +1024,7 @@ static void ov117_022618E8(UnkStruct_ov117_02261280 *param0) static void ov117_02261940(UnkStruct_ov117_02261280 *param0, NARC *param1) { - SpriteRenderer_LoadPalette(param0->unk_8C, 3, param0->unk_24, param0->unk_28, param1, 23, 0, 9, NNS_G2D_VRAM_TYPE_2DSUB, 10006); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_8C, 3, param0->unk_24, param0->unk_28, param1, 23, 0, 9, NNS_G2D_VRAM_TYPE_2DSUB, 10006); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 20, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10004); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 22, 0, 10004); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 21, 0, 10004); diff --git a/src/overlay117/ov117_022626B0.c b/src/overlay117/ov117_022626B0.c index 0cac071727..4ec24e0bec 100644 --- a/src/overlay117/ov117_022626B0.c +++ b/src/overlay117/ov117_022626B0.c @@ -17,8 +17,8 @@ #include "inlines.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" typedef struct { fx32 unk_00; @@ -919,7 +919,7 @@ static void ov117_022638D8(UnkStruct_ov117_02261280 *param0) v0 = NARC_ctor(NARC_INDEX_APPLICATION__BALLOON__GRAPHIC__BALLOON_GRA, 110); - SpriteRenderer_LoadPalette(param0->unk_8C, 2, param0->unk_24, param0->unk_28, v0, 58, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10005); + SpriteRenderer_LoadPaletteFromOpenNarc(param0->unk_8C, 2, param0->unk_24, param0->unk_28, v0, 58, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10005); SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_24, param0->unk_28, v0, 55, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_24, param0->unk_28, v0, 57, 0, 10003); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_24, param0->unk_28, v0, 56, 0, 10003); @@ -940,10 +940,10 @@ static CellActorData *ov117_02263A00(UnkStruct_ov117_02261280 *param0) SpriteTemplate v1; v1 = Unk_ov117_02266B38; - v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); + v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v1); - SpriteActor_EnableObject(v0, 0); - SpriteActor_UpdateObject(v0->unk_00); + CellActorData_DrawSprite(v0, 0); + CellActor_UpdateObject(v0->cellActor); return v0; } @@ -959,11 +959,11 @@ static void ov117_02263A6C(UnkStruct_ov117_022626B0 *param0, CellActorData *para } sub_0200D500(param1, param0->unk_21C, (param0->unk_230 >> FX32_SHIFT) + Unk_ov117_02266B05[param0->unk_270].unk_02, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param1, v0); - SpriteActor_UpdateObject(param1->unk_00); + CellActorData_SetAnim(param1, v0); + CellActor_UpdateObject(param1->cellActor); } static void ov117_02263AE4(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } diff --git a/src/overlay117/ov117_02263AF0.c b/src/overlay117/ov117_02263AF0.c index d3736683ec..40ba779bc4 100644 --- a/src/overlay117/ov117_02263AF0.c +++ b/src/overlay117/ov117_02263AF0.c @@ -39,10 +39,10 @@ #include "message.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "text.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_02012744.h" #include "unk_0201D15C.h" #include "unk_0201E86C.h" @@ -590,7 +590,7 @@ static int ov117_02263E1C(UnkStruct_ov117_02261280 *param0, const UnkStruct_ov11 if (param1->unk_00 == CommSys_CurNetId()) { ov117_02261E38(param0, param1->unk_04); param2->unk_0C = 25; - SpriteActor_EnableObject(param2->unk_10, 0); + CellActorData_DrawSprite(param2->unk_10, 0); } param2->unk_00 = 1; @@ -634,14 +634,14 @@ void ov117_02263EF8(UnkStruct_ov117_02261280 *param0) v1->unk_0C--; if (v1->unk_0C == 0) { - SpriteActor_EnableObject(v1->unk_10, 1); + CellActorData_DrawSprite(v1->unk_10, 1); } } else if (ov117_02263F80(param0, v1) == 1) { if ((param0->unk_2FCC == 1) && (param0->unk_2FBC == 0)) { ov117_02263D08(param0, ¶m0->unk_1428, v1->unk_08, v1->unk_04, v1->unk_0E); } - sub_0200D0F4(v1->unk_10); + CellActorData_Delete(v1->unk_10); v1->unk_00 = 0; } } @@ -785,12 +785,12 @@ static CellActorData *ov117_0226417C(UnkStruct_ov117_02261280 *param0, const Unk v1.x = param1->unk_00; v1.y = param1->unk_02; v1.plttIdx = param1->unk_06; - v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); + v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v1); sub_0200D500(v0, param1->unk_00, param1->unk_02, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(v0, param1->unk_04); + CellActorData_SetAnim(v0, param1->unk_04); sub_0200D6A4(v0, 2); - SpriteActor_UpdateObject(v0->unk_00); + CellActor_UpdateObject(v0->cellActor); return v0; } @@ -801,7 +801,7 @@ void ov117_022641E4(UnkStruct_ov117_02261280 *param0) for (v0 = 0; v0 < 40; v0++) { if (param0->unk_2FDC[v0].unk_00 == 1) { - sub_0200D0F4(param0->unk_2FDC[v0].unk_10); + CellActorData_Delete(param0->unk_2FDC[v0].unk_10); param0->unk_2FDC[v0].unk_00 = 0; } } @@ -828,15 +828,15 @@ static void ov117_02264214(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 for (v9 = 0; v9 < v3[v8]; v9++) { UnkStruct_ov117_02264508 *v10 = ¶m1->unk_04[v7]; - v1 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); + v1 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v0); if (v1 == NULL) { break; } sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(v1, v6); - SpriteActor_UpdateObject(v1->unk_00); + CellActorData_SetAnim(v1, v6); + CellActor_UpdateObject(v1->cellActor); v10->unk_04 = LCRNG_Next() % 0x2000 + 0x2000; v10->unk_08 = LCRNG_Next() % 0x4000 + 0x2000; @@ -856,15 +856,15 @@ static void ov117_02264214(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 for (v8 = 0; v8 < 8; v8++) { UnkStruct_ov117_02264508 *v11 = ¶m1->unk_868[v8]; - v1 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); + v1 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v0); if (v1 == NULL) { break; } sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(v1, 28 + LCRNG_Next() % 3); - SpriteActor_UpdateObject(v1->unk_00); + CellActorData_SetAnim(v1, 28 + LCRNG_Next() % 3); + CellActor_UpdateObject(v1->cellActor); v11->unk_04 = LCRNG_Next() % 0x2000 + 0x2000; v11->unk_08 = LCRNG_Next() % 0x4000 + 0x2000; @@ -881,15 +881,15 @@ static void ov117_02264214(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 for (v8 = 0; v8 < 3; v8++) { UnkStruct_ov117_02264508 *v12 = ¶m1->unk_928[v8]; - v1 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); + v1 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v0); if (v1 == NULL) { break; } sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(v1, 11); - SpriteActor_UpdateObject(v1->unk_00); + CellActorData_SetAnim(v1, 11); + CellActor_UpdateObject(v1->cellActor); v12->unk_04 = LCRNG_Next() % 0x2000 + 0x2000; v12->unk_08 = LCRNG_Next() % 0x4000 + 0x2000; @@ -910,7 +910,7 @@ void ov117_02264508(UnkStruct_ov117_02261280 *param0) v1 = ¶m0->unk_339C.unk_04[v0]; if (v1->unk_00 != NULL) { - sub_0200D0F4(v1->unk_00); + CellActorData_Delete(v1->unk_00); } } @@ -918,7 +918,7 @@ void ov117_02264508(UnkStruct_ov117_02261280 *param0) v2 = ¶m0->unk_339C.unk_868[v0]; if (v2->unk_00 != NULL) { - sub_0200D0F4(v2->unk_00); + CellActorData_Delete(v2->unk_00); } } @@ -926,7 +926,7 @@ void ov117_02264508(UnkStruct_ov117_02261280 *param0) v3 = ¶m0->unk_339C.unk_928[v0]; if (v3->unk_00 != NULL) { - sub_0200D0F4(v3->unk_00); + CellActorData_Delete(v3->unk_00); } } } @@ -948,7 +948,7 @@ BOOL ov117_02264560(UnkStruct_ov117_02261280 *param0) if (v1->unk_00 != NULL) { if (v1->unk_14 == 0) { - sub_0200D0F4(v1->unk_00); + CellActorData_Delete(v1->unk_00); v1->unk_00 = NULL; continue; } @@ -975,7 +975,7 @@ BOOL ov117_02264560(UnkStruct_ov117_02261280 *param0) if (v2->unk_00 != NULL) { if (v2->unk_14 == 0) { - sub_0200D0F4(v2->unk_00); + CellActorData_Delete(v2->unk_00); v2->unk_00 = NULL; continue; } @@ -1002,7 +1002,7 @@ BOOL ov117_02264560(UnkStruct_ov117_02261280 *param0) if (v3->unk_00 != NULL) { if (v3->unk_14 == 0) { - sub_0200D0F4(v3->unk_00); + CellActorData_Delete(v3->unk_00); v3->unk_00 = NULL; continue; } @@ -1065,12 +1065,12 @@ static CellActorData *ov117_02264884(UnkStruct_ov117_02261280 *param0, int param SpriteTemplate v1; v1 = Unk_ov117_02266D34; - v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); + v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v1); sub_0200D500(v0, (9 * 8) - param2 * 16, (4 * 8), ((192 + 160) << FX32_SHIFT)); - sub_0200D364(v0, 0 + param1); - SpriteActor_UpdateObject(v0->unk_00); - sub_0200D390(v0, 1); + CellActorData_SetAnim(v0, 0 + param1); + CellActor_UpdateObject(v0->cellActor); + CellActorData_SetAnimateFlag(v0, 1); return v0; } @@ -1083,7 +1083,7 @@ void ov117_022648E0(UnkStruct_ov117_02261280 *param0) for (v0 = 0; v0 < 5; v0++) { v1 = ¶m0->unk_3D10[v0]; ov117_02264958(param0, v1, v0, v0); - sub_0200D34C(v1->unk_00, FX32_ONE * 4 * v0); + CellActorData_UpdateNFrames(v1->unk_00, FX32_ONE * 4 * v0); } } @@ -1094,7 +1094,7 @@ void ov117_02264914(UnkStruct_ov117_02261280 *param0) for (v0 = 0; v0 < 5; v0++) { v1 = ¶m0->unk_3D10[v0]; - sub_0200D0F4(v1->unk_00); + CellActorData_Delete(v1->unk_00); } } @@ -1154,12 +1154,12 @@ static void ov117_022649D8(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 switch (param1->unk_05) { case 3: - if (sub_0200D3B8(param1->unk_00) == 0) { + if (CellActorData_IsAnimated(param1->unk_00) == 0) { param1->unk_08 += 5; param1->unk_04 = ov117_02264A70(param1->unk_08); param1->unk_05 = 1; - sub_0200D364(param1->unk_00, 0 + param1->unk_04); + CellActorData_SetAnim(param1->unk_00, 0 + param1->unk_04); sub_0200D500(param1->unk_00, (9 * 8) - 5 * 16, (4 * 8), ((192 + 160) << FX32_SHIFT)); for (v1 = 0; v1 < 5; v1++) { @@ -1179,7 +1179,7 @@ static void ov117_022649D8(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 if ((param1->unk_05 == 1) && (v0 > 75)) { param1->unk_05 = 2; - sub_0200D364(param1->unk_00, 3 + param1->unk_04); + CellActorData_SetAnim(param1->unk_00, 3 + param1->unk_04); Sound_PlayEffect(1406); } @@ -1210,7 +1210,7 @@ static void ov117_02264A84(UnkStruct_ov117_02261280 *param0) if (v1->unk_06 == 0) { v1->unk_05 = 3; - sub_0200D364(v1->unk_00, 6); + CellActorData_SetAnim(v1->unk_00, 6); return; } } @@ -1275,7 +1275,7 @@ void ov117_02264BF8(UnkStruct_ov117_02261280 *param0) u16 *v8, *v9; int v10; - v10 = sub_0200D05C(param0->unk_28, 10006, NNS_G2D_VRAM_TYPE_2DSUB); + v10 = SpriteGfxHandler_GetPaletteNumberById(param0->unk_28, 10006, NNS_G2D_VRAM_TYPE_2DSUB); for (v2 = 0; v2 < param0->unk_00->unk_30; v2++) { v4 = Unk_ov117_02266B8A[v2]; @@ -1316,7 +1316,7 @@ void ov117_02264D1C(UnkStruct_ov117_02261280 *param0) u16 *v8, *v9; int v10; - v10 = sub_0200D05C(param0->unk_28, 10006, NNS_G2D_VRAM_TYPE_2DSUB); + v10 = SpriteGfxHandler_GetPaletteNumberById(param0->unk_28, 10006, NNS_G2D_VRAM_TYPE_2DSUB); for (v2 = 0; v2 < param0->unk_00->unk_30; v2++) { v4 = Unk_ov117_02266B82[v2]; @@ -1455,19 +1455,19 @@ void ov117_02264FB0(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226504C * v1 = Unk_ov117_02266D68; for (v2 = 0; v2 < 4; v2++) { - param1->unk_00[v2] = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); + param1->unk_00[v2] = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v1); sub_0200D500(param1->unk_00[v2], Unk_ov117_02266BB4[v2].unk_00, Unk_ov117_02266BB4[v2].unk_02, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param1->unk_00[v2], 31 + v2 / 2); - SpriteActor_UpdateObject(param1->unk_00[v2]->unk_00); + CellActorData_SetAnim(param1->unk_00[v2], 31 + v2 / 2); + CellActor_UpdateObject(param1->unk_00[v2]->cellActor); } switch (param0->unk_00->unk_30) { case 2: - SpriteActor_EnableObject(param1->unk_00[2], 0); - SpriteActor_EnableObject(param1->unk_00[3], 0); + CellActorData_DrawSprite(param1->unk_00[2], 0); + CellActorData_DrawSprite(param1->unk_00[3], 0); break; case 3: - SpriteActor_EnableObject(param1->unk_00[1], 0); + CellActorData_DrawSprite(param1->unk_00[1], 0); break; } } @@ -1477,7 +1477,7 @@ void ov117_0226504C(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226504C * int v0; for (v0 = 0; v0 < 4; v0++) { - sub_0200D0F4(param1->unk_00[v0]); + CellActorData_Delete(param1->unk_00[v0]); } } @@ -1493,32 +1493,32 @@ void ov117_02265064(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022653F4 * v3 = 256 / 2 + FX_Mul(sub_0201D2B8(param1->unk_E4 + param1->unk_00[v1].unk_0C), 76); v4 = 196 / 2 + (-FX_Mul(sub_0201D2C4(param1->unk_E4 + param1->unk_00[v1].unk_0C), (64 + 4))); - param1->unk_00[v1].unk_00 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); + param1->unk_00[v1].unk_00 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v0); sub_0200D500(param1->unk_00[v1].unk_00, v3, v4 + -24, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param1->unk_00[v1].unk_00, Unk_ov117_02266B7A[v1 + 1]); - SpriteActor_UpdateObject(param1->unk_00[v1].unk_00->unk_00); - SpriteActor_EnableObject(param1->unk_00[v1].unk_00, 0); + CellActorData_SetAnim(param1->unk_00[v1].unk_00, Unk_ov117_02266B7A[v1 + 1]); + CellActor_UpdateObject(param1->unk_00[v1].unk_00->cellActor); + CellActorData_DrawSprite(param1->unk_00[v1].unk_00, 0); - param1->unk_00[v1].unk_04 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); + param1->unk_00[v1].unk_04 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); sub_0200D500(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param1->unk_00[v1].unk_04, 33); - SpriteActor_UpdateObject(param1->unk_00[v1].unk_04->unk_00); - SpriteActor_EnableObject(param1->unk_00[v1].unk_04, 0); + CellActorData_SetAnim(param1->unk_00[v1].unk_04, 33); + CellActor_UpdateObject(param1->unk_00[v1].unk_04->cellActor); + CellActorData_DrawSprite(param1->unk_00[v1].unk_04, 0); - param1->unk_00[v1].unk_08 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E04); + param1->unk_00[v1].unk_08 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E04); sub_0200D500(param1->unk_00[v1].unk_08, v3, v4 + -24 + 24, ((192 + 160) << FX32_SHIFT)); SpriteActor_SetOAMMode(param1->unk_00[v1].unk_08, GX_OAM_MODE_XLU); sub_0200D6A4(param1->unk_00[v1].unk_08, 1); sub_0200D6E8(param1->unk_00[v1].unk_08, 1.0f, 1.0f); - sub_0200D364(param1->unk_00[v1].unk_08, 34 + v1); - SpriteActor_UpdateObject(param1->unk_00[v1].unk_08->unk_00); - SpriteActor_EnableObject(param1->unk_00[v1].unk_08, 0); + CellActorData_SetAnim(param1->unk_00[v1].unk_08, 34 + v1); + CellActor_UpdateObject(param1->unk_00[v1].unk_08->cellActor); + CellActorData_DrawSprite(param1->unk_00[v1].unk_08, 0); ov117_02266344(param0, ¶m1->unk_00[v1].unk_30); } - SpriteActor_EnableObject(param1->unk_00[0].unk_00, 1); - SpriteActor_EnableObject(param1->unk_00[0].unk_08, 1); + CellActorData_DrawSprite(param1->unk_00[0].unk_00, 1); + CellActorData_DrawSprite(param1->unk_00[0].unk_08, 1); } void ov117_022651E0(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022653F4 *param1) @@ -1526,9 +1526,9 @@ void ov117_022651E0(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022653F4 * int v0; for (v0 = 0; v0 < 3; v0++) { - sub_0200D0F4(param1->unk_00[v0].unk_00); - sub_0200D0F4(param1->unk_00[v0].unk_04); - sub_0200D0F4(param1->unk_00[v0].unk_08); + CellActorData_Delete(param1->unk_00[v0].unk_00); + CellActorData_Delete(param1->unk_00[v0].unk_04); + CellActorData_Delete(param1->unk_00[v0].unk_08); ov117_02266384(param0, ¶m1->unk_00[v0].unk_30); } } @@ -1660,8 +1660,8 @@ static int ov117_02265454(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 switch (param2->unk_11) { case 0: - SpriteActor_EnableObject(param2->unk_00, 1); - SpriteActor_EnableObject(param2->unk_08, 1); + CellActorData_DrawSprite(param2->unk_00, 1); + CellActorData_DrawSprite(param2->unk_08, 1); sub_0200D5A0(param2->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); param2->unk_1C = v0; param2->unk_1E = v1; @@ -1728,9 +1728,9 @@ static int ov117_02265644(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 f32 v5; if (param1->unk_F3 > 0) { - sub_0200D34C(param2->unk_00, ((8 + 8 + 12 + 8 + 8) << FX32_SHIFT) / Unk_ov117_02266BC4[param1->unk_F4].unk_00); + CellActorData_UpdateNFrames(param2->unk_00, ((8 + 8 + 12 + 8 + 8) << FX32_SHIFT) / Unk_ov117_02266BC4[param1->unk_F4].unk_00); } else { - sub_0200D3CC(param2->unk_00, 0); + CellActorData_SetAnimFrame(param2->unk_00, 0); } v2 = ((180 * param1->unk_F3) << FX32_SHIFT) / Unk_ov117_02266BC4[param1->unk_F4].unk_00; @@ -1772,9 +1772,9 @@ static int ov117_022657C4(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 Sound_PlayEffect(1403); sub_0200D5A0(param2->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); sub_0200D500(param2->unk_04, v0, v1 + -32, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param2->unk_04, 33); - SpriteActor_EnableObject(param2->unk_04, 1); - sub_0200D364(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 2); + CellActorData_SetAnim(param2->unk_04, 33); + CellActorData_DrawSprite(param2->unk_04, 1); + CellActorData_SetAnim(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 2); param2->unk_12 = Unk_ov117_02266BC4[param1->unk_F4].unk_02; param2->unk_13 = Unk_ov117_02266BC4[param1->unk_F4].unk_02 / 2; @@ -1782,14 +1782,14 @@ static int ov117_022657C4(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 break; case 1: if (param2->unk_12 == param2->unk_13) { - sub_0200D364(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 1); - SpriteActor_EnableObject(param2->unk_04, 0); - sub_0200D34C(param2->unk_04, (4 * FX32_ONE)); + CellActorData_SetAnim(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 1); + CellActorData_DrawSprite(param2->unk_04, 0); + CellActorData_UpdateNFrames(param2->unk_04, (4 * FX32_ONE)); } if (param2->unk_12 == 0) { - SpriteActor_EnableObject(param2->unk_04, 0); - sub_0200D364(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 0); + CellActorData_DrawSprite(param2->unk_04, 0); + CellActorData_SetAnim(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 0); param2->unk_11++; break; } @@ -1844,14 +1844,14 @@ static int ov117_022657C4(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 v9 = -(FX_Mul(sub_0201D2B8(v8), (12 << FX32_SHIFT))) / FX32_ONE; sub_0200D500(param2->unk_00, param2->unk_28 / FX32_ONE, param2->unk_2C / FX32_ONE + -24 + v9, ((192 + 160) << FX32_SHIFT)); - sub_0200D34C(param2->unk_00, ((8 + 8 + 12 + 8 + 8) << FX32_SHIFT) / param2->unk_18); + CellActorData_UpdateNFrames(param2->unk_00, ((8 + 8 + 12 + 8 + 8) << FX32_SHIFT) / param2->unk_18); sub_0200D500(param2->unk_08, param2->unk_28 / FX32_ONE, param2->unk_2C / FX32_ONE + -24 + 24, ((192 + 160) << FX32_SHIFT)); param2->unk_12--; if (param2->unk_12 <= 0) { - sub_0200D364(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 0); - sub_0200D3CC(param2->unk_00, 0); + CellActorData_SetAnim(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 0); + CellActorData_SetAnimFrame(param2->unk_00, 0); ov117_02265428(param2, 2); return 1; } @@ -1870,17 +1870,17 @@ void ov117_02265ABC(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02265C3C * v0 = Unk_ov117_02266D9C; for (v1 = 0; v1 < 3; v1++) { - param1->unk_00[v1].unk_00 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); + param1->unk_00[v1].unk_00 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v0); sub_0200D500(param1->unk_00[v1].unk_00, 0, 0, ((192 + 160) << FX32_SHIFT)); - SpriteActor_EnableObject(param1->unk_00[v1].unk_00, 0); + CellActorData_DrawSprite(param1->unk_00[v1].unk_00, 0); - param1->unk_00[v1].unk_04 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); + param1->unk_00[v1].unk_04 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); sub_0200D500(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param1->unk_00[v1].unk_04, 33); - SpriteActor_UpdateObject(param1->unk_00[v1].unk_04->unk_00); - SpriteActor_EnableObject(param1->unk_00[v1].unk_04, 0); + CellActorData_SetAnim(param1->unk_00[v1].unk_04, 33); + CellActor_UpdateObject(param1->unk_00[v1].unk_04->cellActor); + CellActorData_DrawSprite(param1->unk_00[v1].unk_04, 0); } } @@ -1889,8 +1889,8 @@ void ov117_02265B3C(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02265C3C * int v0; for (v0 = 0; v0 < 3; v0++) { - sub_0200D0F4(param1->unk_00[v0].unk_00); - sub_0200D0F4(param1->unk_00[v0].unk_04); + CellActorData_Delete(param1->unk_00[v0].unk_00); + CellActorData_Delete(param1->unk_00[v0].unk_04); } } @@ -1917,14 +1917,14 @@ void ov117_02265B58(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02265C3C * v2 = ov117_022622C4(param0, param3); v1 = Unk_ov117_02266C2C[param0->unk_00->unk_30][v2]; - sub_0200D41C(v4->unk_00, v1); - sub_0200D364(v4->unk_00, Unk_ov117_02266B7A[param2] + 0); + CellActorData_SetExplicitPalette(v4->unk_00, v1); + CellActorData_SetAnim(v4->unk_00, Unk_ov117_02266B7A[param2] + 0); v3 = Unk_ov117_02266BD8[param0->unk_00->unk_30][v2]; v4->unk_10 = Unk_ov117_02266BB4[v3].unk_02 + -24; sub_0200D500(v4->unk_00, Unk_ov117_02266BB4[v3].unk_00, v4->unk_10 + -96, ((192 + 160) << FX32_SHIFT)); - SpriteActor_UpdateObject(v4->unk_00->unk_00); + CellActor_UpdateObject(v4->unk_00->cellActor); v4->unk_12 = param2; v4->unk_16 = param4 - (MATH_ABS(-96) * FX32_ONE) / 0x8000; @@ -1961,7 +1961,7 @@ static BOOL ov117_02265C3C(UnkStruct_ov117_02265C3C *param0, UnkStruct_ov117_022 break; } - SpriteActor_EnableObject(param1->unk_00, 1); + CellActorData_DrawSprite(param1->unk_00, 1); param1->unk_0C += 0x8000; if ((param1->unk_0C / FX32_ONE) >= param1->unk_10) { @@ -1972,10 +1972,10 @@ static BOOL ov117_02265C3C(UnkStruct_ov117_02265C3C *param0, UnkStruct_ov117_022 case 2: sub_0200D5A0(param1->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); sub_0200D500(param1->unk_04, v0, v1 + -32, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param1->unk_04, 33); - SpriteActor_EnableObject(param1->unk_04, 1); + CellActorData_SetAnim(param1->unk_04, 33); + CellActorData_DrawSprite(param1->unk_04, 1); Sound_PlayEffect(1403); - sub_0200D364(param1->unk_00, Unk_ov117_02266B7A[param1->unk_12] + 2); + CellActorData_SetAnim(param1->unk_00, Unk_ov117_02266B7A[param1->unk_12] + 2); param1->unk_14 = 8; param1->unk_13++; @@ -1984,12 +1984,12 @@ static BOOL ov117_02265C3C(UnkStruct_ov117_02265C3C *param0, UnkStruct_ov117_022 param1->unk_14--; if (param1->unk_14 == 3) { - sub_0200D34C(param1->unk_04, (4 * FX32_ONE)); + CellActorData_UpdateNFrames(param1->unk_04, (4 * FX32_ONE)); } if (param1->unk_14 == 0) { - SpriteActor_EnableObject(param1->unk_04, 0); - sub_0200D364(param1->unk_00, Unk_ov117_02266B7A[param1->unk_12] + 0); + CellActorData_DrawSprite(param1->unk_04, 0); + CellActorData_SetAnim(param1->unk_00, Unk_ov117_02266B7A[param1->unk_12] + 0); param1->unk_13++; } break; @@ -1997,7 +1997,7 @@ static BOOL ov117_02265C3C(UnkStruct_ov117_02265C3C *param0, UnkStruct_ov117_022 param1->unk_0C -= 0x8000; if ((param1->unk_0C / FX32_ONE) <= param1->unk_10 + -96) { - SpriteActor_EnableObject(param1->unk_00, 0); + CellActorData_DrawSprite(param1->unk_00, 0); param1->unk_13 = 0; param1->unk_15 = 0; return 0; @@ -2046,7 +2046,7 @@ void ov117_02265DB8(BgConfig *param0, SpriteGfxHandler *param1, UnkStruct_020127 v0.unk_00 = param2; v0.unk_04 = &v1; v0.unk_08 = sub_0200D9B0(param1); - v0.unk_0C = sub_0200D04C(param1, param8); + v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(param1, param8); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; v0.unk_18 = param9; @@ -2231,8 +2231,8 @@ CellActorData *ov117_02266130(UnkStruct_ov117_02261280 *param0) { CellActorData *v0; - v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E6C); - SpriteActor_UpdateObject(v0->unk_00); + v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E6C); + CellActor_UpdateObject(v0->cellActor); return v0; } @@ -2266,24 +2266,24 @@ void ov117_02266210(UnkStruct_ov117_02261280 *param0) void ov117_02266238(UnkStruct_ov117_02261280 *param0, CellActorData *param1) { - sub_0200D0F4(param1); + CellActorData_Delete(param1); } CellActorData *ov117_02266244(UnkStruct_ov117_02261280 *param0) { CellActorData *v0; - v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266EA0); + v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266EA0); - SpriteActor_EnableObject(v0, 0); - SpriteActor_UpdateObject(v0->unk_00); + CellActorData_DrawSprite(v0, 0); + CellActor_UpdateObject(v0->cellActor); return v0; } void ov117_02266268(UnkStruct_ov117_02261280 *param0, CellActorData *param1) { - sub_0200D0F4(param1); + CellActorData_Delete(param1); } BOOL ov117_02266274(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02266274 *param1) @@ -2292,7 +2292,7 @@ BOOL ov117_02266274(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02266274 * case 0: case 5: sub_0200D500(param1->unk_00, 128, 16, ((192 + 160) << FX32_SHIFT)); - SpriteActor_EnableObject(param1->unk_00, 1); + CellActorData_DrawSprite(param1->unk_00, 1); param1->unk_04++; break; case 1: @@ -2324,7 +2324,7 @@ BOOL ov117_02266274(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02266274 * case 3: case 8: param1->unk_14 = 0; - SpriteActor_EnableObject(param1->unk_00, 0); + CellActorData_DrawSprite(param1->unk_00, 0); param1->unk_04++; case 4: @@ -2350,12 +2350,12 @@ static void ov117_02266344(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 int v1; for (v1 = 0; v1 < 2; v1++) { - v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E38); + v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E38); - sub_0200D364(v0, 27); + CellActorData_SetAnim(v0, 27); SpriteActor_SetOAMMode(v0, GX_OAM_MODE_XLU); - SpriteActor_EnableObject(v0, 0); - SpriteActor_UpdateObject(v0->unk_00); + CellActorData_DrawSprite(v0, 0); + CellActor_UpdateObject(v0->cellActor); param1->unk_00[v1] = v0; } @@ -2366,7 +2366,7 @@ static void ov117_02266384(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 int v0; for (v0 = 0; v0 < 2; v0++) { - sub_0200D0F4(param1->unk_00[v0]); + CellActorData_Delete(param1->unk_00[v0]); } } @@ -2379,9 +2379,9 @@ static void ov117_0226639C(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 for (v2 = 0; v2 < 2; v2++) { sub_0200D500(param2->unk_00[v2], v0, v1 + 28, ((192 + 160) << FX32_SHIFT)); - sub_0200D364(param2->unk_00[v2], 27); + CellActorData_SetAnim(param2->unk_00[v2], 27); SpriteActor_SetOAMMode(param2->unk_00[v2], GX_OAM_MODE_XLU); - SpriteActor_EnableObject(param2->unk_00[v2], 1); + CellActorData_DrawSprite(param2->unk_00[v2], 1); param2->unk_08[v2] = LCRNG_Next() % 0x1000 + 0x1000; param2->unk_10[v2] = LCRNG_Next() % 0x400 + 0x400; @@ -2405,14 +2405,14 @@ static void ov117_02266440(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 case 1: for (v0 = 0; v0 < 2; v0++) { sub_0200D5E8(param2->unk_00[v0], param2->unk_08[v0], -param2->unk_10[v0]); - SpriteActor_UpdateObject(param2->unk_00[v0]->unk_00); + CellActor_UpdateObject(param2->unk_00[v0]->cellActor); } param2->unk_19++; if (param2->unk_19 > 8) { for (v0 = 0; v0 < 2; v0++) { - SpriteActor_EnableObject(param2->unk_00[v0], 0); + CellActorData_DrawSprite(param2->unk_00[v0], 0); } param2->unk_18 = 0; diff --git a/src/overlay119/ov119_021D0D80.c b/src/overlay119/ov119_021D0D80.c index 57b21668a6..dc563fbb8a 100644 --- a/src/overlay119/ov119_021D0D80.c +++ b/src/overlay119/ov119_021D0D80.c @@ -33,12 +33,12 @@ #include "pokemon.h" #include "render_window.h" #include "spl.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" #include "text.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02014000.h" #include "unk_0201DBEC.h" @@ -541,15 +541,15 @@ void ov119_021D1514(UnkStruct_ov119_021D0FD0 *param0) v1 = param0->unk_04.unk_4C; v2 = param0->unk_04.unk_04; - sub_0200CBDC(v0, v1, v4, v3[v6][0], 1, v5, 20000); - sub_0200CD7C(v2, 2, v0, v1, v4, v3[v6][1], 0, 1, v5, 20001); - sub_0200CE0C(v0, v1, v4, v3[v6][2], 1, 20002); - sub_0200CE3C(v0, v1, v4, v3[v6][3], 1, 20003); + SpriteRenderer_LoadCharResObj(v0, v1, v4, v3[v6][0], 1, v5, 20000); + SpriteRenderer_LoadPalette(v2, 2, v0, v1, v4, v3[v6][1], 0, 1, v5, 20001); + SpriteRenderer_LoadCellResObj(v0, v1, v4, v3[v6][2], 1, 20002); + SpriteRenderer_LoadAnimResObj(v0, v1, v4, v3[v6][3], 1, 20003); - sub_0200CBDC(v0, v1, v4, 7, 1, v5, 25000); - sub_0200CD7C(v2, 2, v0, v1, v4, 10, 0, 1, v5, 25001); - sub_0200CE0C(v0, v1, v4, 6, 1, 25002); - sub_0200CE3C(v0, v1, v4, 5, 1, 25003); + SpriteRenderer_LoadCharResObj(v0, v1, v4, 7, 1, v5, 25000); + SpriteRenderer_LoadPalette(v2, 2, v0, v1, v4, 10, 0, 1, v5, 25001); + SpriteRenderer_LoadCellResObj(v0, v1, v4, 6, 1, 25002); + SpriteRenderer_LoadAnimResObj(v0, v1, v4, 5, 1, 25003); } void ov119_021D161C(UnkStruct_ov119_021D0FD0 *param0) @@ -573,9 +573,9 @@ void ov119_021D161C(UnkStruct_ov119_021D0FD0 *param0) v0.resources[4] = SPRITE_RESOURCE_NONE; v0.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_74 = SpriteActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); + param0->unk_74 = CellActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); - sub_0200D330(param0->unk_74); + CellActorData_UpdateObject(param0->unk_74); sub_0200D6A4(param0->unk_74, 2); v0.x = 0; @@ -586,13 +586,13 @@ void ov119_021D161C(UnkStruct_ov119_021D0FD0 *param0) v0.resources[2] = 25002; v0.resources[3] = 25003; - param0->unk_78 = SpriteActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); - sub_0200D330(param0->unk_78); + param0->unk_78 = CellActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); + CellActorData_UpdateObject(param0->unk_78); v0.y = 192 - (6 * 8); - param0->unk_7C = SpriteActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); - sub_0200D330(param0->unk_7C); + param0->unk_7C = CellActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); + CellActorData_UpdateObject(param0->unk_7C); } static const s16 Unk_ov119_021D2478[][10] = { @@ -698,14 +698,14 @@ int ov119_021D176C(UnkStruct_ov119_021D0FD0 *param0, int param1) void ov119_021D17A0(UnkStruct_ov119_021D0FD0 *param0) { - sub_0200D0F4(param0->unk_74); - sub_0200D0F4(param0->unk_78); - sub_0200D0F4(param0->unk_7C); + CellActorData_Delete(param0->unk_74); + CellActorData_Delete(param0->unk_78); + CellActorData_Delete(param0->unk_7C); } void ov119_021D17B8(UnkStruct_ov119_021D17B8 *param0) { - param0->unk_50 = sub_0200C6E4(71); + param0->unk_50 = SpriteRenderer_Create(71); { const UnkStruct_ov104_0224133C v0 = { 0, @@ -721,7 +721,7 @@ void ov119_021D17B8(UnkStruct_ov119_021D17B8 *param0) 48 + 48, 1024 * 0x40, 512 * 0x20, GX_OBJVRAMMODE_CHAR_1D_64K, GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->unk_50, &v0, &v1, 16 + 16); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_50, &v0, &v1, 16 + 16); } { @@ -735,20 +735,20 @@ void ov119_021D17B8(UnkStruct_ov119_021D17B8 *param0) 16, }; - param0->unk_4C = sub_0200C704(param0->unk_50); + param0->unk_4C = SpriteRenderer_CreateGfxHandler(param0->unk_50); - v2 = sub_0200C7C0(param0->unk_50, param0->unk_4C, 255); + v2 = SpriteRenderer_CreateCellActorList(param0->unk_50, param0->unk_4C, 255); GF_ASSERT(v2); - v2 = sub_0200CB30(param0->unk_50, param0->unk_4C, &v3); + v2 = SpriteRenderer_InitGfxResourceList(param0->unk_50, param0->unk_4C, &v3); GF_ASSERT(v2); } } void ov119_021D1844(UnkStruct_ov119_021D17B8 *param0) { - sub_0200D0B0(param0->unk_50, param0->unk_4C); - sub_0200C8D4(param0->unk_50); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(param0->unk_50, param0->unk_4C); + SpriteRenderer_Free(param0->unk_50); } void ov119_021D1858(UnkStruct_ov119_021D0FD0 *param0) diff --git a/src/overlay119/ov119_021D191C.c b/src/overlay119/ov119_021D191C.c index e5f43e08b7..652f54fe0c 100644 --- a/src/overlay119/ov119_021D191C.c +++ b/src/overlay119/ov119_021D191C.c @@ -14,11 +14,11 @@ #include "menu.h" #include "palette.h" #include "pokemon.h" +#include "sprite_renderer.h" #include "text.h" #include "unk_020041CC.h" #include "unk_02005474.h" #include "unk_0200762C.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02015F84.h" #include "unk_0201F834.h" @@ -222,7 +222,7 @@ static BOOL ov119_021D1930(UnkStruct_ov119_021D0FD0 *param0) break; } - sub_0200C7EC(param0->unk_04.unk_4C); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_04.unk_4C); return v0; } @@ -242,7 +242,7 @@ static BOOL ov119_021D1BD0(UnkStruct_ov119_021D0FD0 *param0) ov119_021D1514(param0); ov119_021D161C(param0); - SpriteActor_EnableObject(param0->unk_74, 0); + CellActorData_DrawSprite(param0->unk_74, 0); ov119_021D1858(param0); ov119_021D190C(param0, 1); @@ -375,7 +375,7 @@ static BOOL ov119_021D1BD0(UnkStruct_ov119_021D0FD0 *param0) break; } - sub_0200C7EC(param0->unk_04.unk_4C); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_04.unk_4C); return v0; } @@ -384,7 +384,7 @@ static BOOL ov119_021D1E38(UnkStruct_ov119_021D0FD0 *param0) { switch (param0->unk_68) { case 0: - sub_0200D3CC(param0->unk_74, 0); + CellActorData_SetAnimFrame(param0->unk_74, 0); param0->unk_68++; break; case 1: @@ -411,7 +411,7 @@ static BOOL ov119_021D1E80(UnkStruct_ov119_021D0FD0 *param0) break; } - sub_0200D3CC(param0->unk_74, 1); + CellActorData_SetAnimFrame(param0->unk_74, 1); param0->unk_68++; break; case 1: { @@ -422,7 +422,7 @@ static BOOL ov119_021D1E80(UnkStruct_ov119_021D0FD0 *param0) if (v0 == 2) { Sound_PlayEffect(1812); - sub_0200D3CC(param0->unk_74, 2); + CellActorData_SetAnimFrame(param0->unk_74, 2); param0->unk_68++; param0->unk_64 = 0; } @@ -433,7 +433,7 @@ static BOOL ov119_021D1E80(UnkStruct_ov119_021D0FD0 *param0) v1 = ov119_021D176C(param0, 0); if (v1 == 2) { - sub_0200D3CC(param0->unk_74, 2); + CellActorData_SetAnimFrame(param0->unk_74, 2); param0->unk_68 = 0; param0->unk_64 = 0; return 0; @@ -457,7 +457,7 @@ static BOOL ov119_021D1EF0(UnkStruct_ov119_021D0FD0 *param0) if (v0 == 1) { Sound_PlayEffect(1812); - sub_0200D3CC(param0->unk_74, 3); + CellActorData_SetAnimFrame(param0->unk_74, 3); ov119_021D14DC(param0->unk_04.unk_40, 0); } @@ -493,7 +493,7 @@ static BOOL ov119_021D1F48(UnkStruct_ov119_021D0FD0 *param0) if (v0 == 1) { Sound_PlayEffect(1812); - sub_0200D3CC(param0->unk_74, 4); + CellActorData_SetAnimFrame(param0->unk_74, 4); ov119_021D14DC(param0->unk_04.unk_40, 1); } @@ -519,7 +519,7 @@ static BOOL ov119_021D1FAC(UnkStruct_ov119_021D0FD0 *param0) break; } - sub_0200D3CC(param0->unk_74, 4); + CellActorData_SetAnimFrame(param0->unk_74, 4); GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG1, 0); param0->unk_68++; break; @@ -529,14 +529,14 @@ static BOOL ov119_021D1FAC(UnkStruct_ov119_021D0FD0 *param0) v0 = ov119_021D176C(param0, 3); if (v0 == 1) { - sub_0200D3CC(param0->unk_74, 5); + CellActorData_SetAnimFrame(param0->unk_74, 5); Sound_PlayEffect(1799); ov119_021D14DC(param0->unk_04.unk_40, 2); ov119_021D14DC(param0->unk_04.unk_40, 3); } if (v0 == 2) { - SpriteActor_EnableObject(param0->unk_74, 0); + CellActorData_DrawSprite(param0->unk_74, 0); param0->unk_64 = 0; param0->unk_68++; } @@ -551,7 +551,7 @@ static BOOL ov119_021D1FAC(UnkStruct_ov119_021D0FD0 *param0) NNSG2dImagePaletteProxy *v1; int v2; - v1 = CellActor_GetPaletteProxy(param0->unk_78->unk_00); + v1 = CellActor_GetPaletteProxy(param0->unk_78->cellActor); v2 = sub_0201FAB4(v1, NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_StartFade(param0->unk_04.unk_04, 0x4, 0xFFFF ^ (1 << v2), 0, 0, 16, 0xFFFF); @@ -587,9 +587,9 @@ static BOOL ov119_021D1FAC(UnkStruct_ov119_021D0FD0 *param0) GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG1, 1); ov119_021D190C(param0, 0); - SpriteActor_EnableObject(param0->unk_74, 0); - SpriteActor_EnableObject(param0->unk_78, 0); - SpriteActor_EnableObject(param0->unk_7C, 0); + CellActorData_DrawSprite(param0->unk_74, 0); + CellActorData_DrawSprite(param0->unk_78, 0); + CellActorData_DrawSprite(param0->unk_7C, 0); param0->unk_68++; } break; @@ -657,7 +657,7 @@ static BOOL ov119_021D21BC(UnkStruct_ov119_021D0FD0 *param0) NNSG2dImagePaletteProxy *v0; int v1; - v0 = CellActor_GetPaletteProxy(param0->unk_78->unk_00); + v0 = CellActor_GetPaletteProxy(param0->unk_78->cellActor); v1 = sub_0201FAB4(v0, NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_StartFade(param0->unk_04.unk_04, 0x4, 0xFFFF ^ (1 << v1), 0, 0, 16, 0xFFFF); @@ -694,9 +694,9 @@ static BOOL ov119_021D21BC(UnkStruct_ov119_021D0FD0 *param0) ov119_021D190C(param0, 0); GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG1, 1); - SpriteActor_EnableObject(param0->unk_74, 0); - SpriteActor_EnableObject(param0->unk_78, 0); - SpriteActor_EnableObject(param0->unk_7C, 0); + CellActorData_DrawSprite(param0->unk_74, 0); + CellActorData_DrawSprite(param0->unk_78, 0); + CellActorData_DrawSprite(param0->unk_7C, 0); param0->unk_68++; } break; diff --git a/src/pokemon.c b/src/pokemon.c index e4cd9b3637..33b5e5a7a9 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -46,12 +46,12 @@ #include "party.h" #include "pokemon.h" #include "rtc.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "trainer_data.h" #include "trainer_info.h" #include "unk_02005474.h" #include "unk_02006224.h" -#include "unk_0200C6E4.h" #include "unk_02015F84.h" #include "unk_02017038.h" #include "unk_0201D15C.h" @@ -3149,7 +3149,7 @@ CellActorData *sub_02076994(SpriteRenderer *param0, SpriteGfxHandler *param1, Pa narc = NARC_ctor(v3.unk_00, heapID); SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, narc, v3.unk_04, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 20015 + param7); - SpriteRenderer_LoadPalette(param2, 2, param0, param1, narc, v3.unk_08, 0, v4, NNS_G2D_VRAM_TYPE_2DMAIN, 20010 + param7); + SpriteRenderer_LoadPaletteFromOpenNarc(param2, 2, param0, param1, narc, v3.unk_08, 0, v4, NNS_G2D_VRAM_TYPE_2DMAIN, 20010 + param7); SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, narc, v3.unk_0C, 0, 20007 + param7); SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, narc, v3.unk_10, 0, 20007 + param7); NARC_dtor(narc); @@ -3163,12 +3163,12 @@ CellActorData *sub_02076994(SpriteRenderer *param0, SpriteGfxHandler *param1, Pa v0.resources[3] = 20007 + param7; v0.priority = Unk_020F0588[param7]; - v1 = SpriteActor_LoadResources(param0, param1, &v0); + v1 = CellActor_LoadResources(param0, param1, &v0); - CellActor_SetExplicitPaletteOffsetAutoAdjust(v1->unk_00, 0); - SpriteActor_SetSpritePositionXY(v1, param3, param4); - sub_0200D330(v1); - sub_0200D390(v1, 1); + CellActor_SetExplicitPaletteOffsetAutoAdjust(v1->cellActor, 0); + CellActorData_SetPositionXY(v1, param3, param4); + CellActorData_UpdateObject(v1); + CellActorData_SetAnimateFlag(v1, 1); return v1; } diff --git a/src/render_window.c b/src/render_window.c index 2edfb5ecd7..af683e66a9 100644 --- a/src/render_window.c +++ b/src/render_window.c @@ -25,13 +25,13 @@ #include "palette.h" #include "pokemon.h" #include "render_text.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "sys_task.h" #include "sys_task_manager.h" #include "unk_0200679C.h" #include "unk_0200762C.h" #include "unk_0200A328.h" -#include "unk_0200C6E4.h" #include "unk_020131EC.h" #define SIGNPOST_CONTENT_WIDTH_TILES 6 @@ -775,24 +775,24 @@ static void SysTask_HandlePokemonPreview(SysTask *task, void *data) switch (preview->state) { case 1: ErasePokemonPreviewWindow(preview); - sub_0200D0F4(preview->cellActorData); + CellActorData_Delete(preview->cellActorData); ov5_021D375C(&preview->unk_00); SysTask_FinishAndFreeParam(task); return; case 2: preview->state = 3; - CellActor_SetAnim(preview->cellActorData->unk_00, 1); + CellActor_SetAnim(preview->cellActorData->cellActor, 1); break; case 3: - if (CellActor_GetAnimFrame(preview->cellActorData->unk_00) == 6) { + if (CellActor_GetAnimFrame(preview->cellActorData->cellActor) == 6) { preview->state = 0; } break; } - CellActor_UpdateAnim(preview->cellActorData->unk_00, FX32_ONE); + CellActor_UpdateAnim(preview->cellActorData->cellActor, FX32_ONE); CellActorCollection_Update(preview->unk_00.unk_00); } diff --git a/src/sprite_renderer.c b/src/sprite_renderer.c new file mode 100644 index 0000000000..990675b435 --- /dev/null +++ b/src/sprite_renderer.c @@ -0,0 +1,1279 @@ +#include "sprite_renderer.h" + +#include +#include + +#include "struct_defs/sprite_template.h" +#include "struct_defs/struct_0200D0F4.h" + +#include "overlay007/struct_ov7_0224F358.h" +#include "overlay022/struct_ov22_022559F8.h" +#include "overlay104/struct_ov104_022412F4.h" +#include "overlay104/struct_ov104_02241308.h" +#include "overlay104/struct_ov104_0224133C.h" + +#include "cell_actor.h" +#include "heap.h" +#include "narc.h" +#include "palette.h" +#include "sprite_resource.h" +#include "unk_020093B4.h" +#include "unk_0200A328.h" +#include "unk_0200A784.h" +#include "unk_02017728.h" +#include "unk_0201DBEC.h" +#include "unk_0201E86C.h" +#include "unk_0201F834.h" + +static BOOL SpriteRenderer_LoadResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, enum SpriteResourceType resourceType, int resourceID); +static BOOL SpriteRenderer_LoadResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, enum SpriteResourceType resourceType, int resourceID); +static BOOL SpriteResourceList_Add(SpriteResourceList *param0, SpriteResource *param1); +static BOOL sub_0200D27C(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); +static BOOL sub_0200D2D0(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); +static BOOL SpriteResourceCollection_RemoveFromResourceList(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); + +SpriteRenderer *SpriteRenderer_Create(int heapID) +{ + SpriteRenderer *renderer = Heap_AllocFromHeap(heapID, sizeof(SpriteRenderer)); + + if (renderer == NULL) { + return NULL; + } + + renderer->heapID = heapID; + renderer->numGfxHandlers = 0; + renderer->hasOamManager = TRUE; + + return renderer; +} + +SpriteGfxHandler *SpriteRenderer_CreateGfxHandler(SpriteRenderer *renderer) +{ + GF_ASSERT(renderer != NULL); + + SpriteGfxHandler *gfxHandler = Heap_AllocFromHeap(renderer->heapID, sizeof(SpriteGfxHandler)); + + if (gfxHandler == NULL) { + return NULL; + } + + renderer->numGfxHandlers++; + + for (int i = 0; i < SPRITE_RESOURCE_TYPE_MAX; i++) { + gfxHandler->spriteResourceCollectionList[i] = NULL; + } + + return gfxHandler; +} + +GF_G2dRenderer *SpriteRenderer_GetG2dRenderer(SpriteRenderer *renderer) +{ + return &renderer->renderer; +} + +BOOL SpriteRenderer_CreateOamCharPlttManagers(SpriteRenderer *renderer, const UnkStruct_ov104_0224133C *param1, const UnkStruct_ov104_022412F4 *param2, int param3) +{ + GF_ASSERT(renderer != NULL); + + if (renderer == NULL) { + return FALSE; + } + + { + UnkStruct_ov22_022559F8 v0; + + v0.unk_00 = param2->unk_00; + v0.unk_04 = param2->unk_04; + v0.unk_08 = param2->unk_08; + v0.unk_0C = renderer->heapID; + + sub_0201E88C(&v0, param2->unk_0C, param2->unk_10); + } + + sub_0201F834(param3, renderer->heapID); + NNS_G2dInitOamManagerModule(); + + if (renderer->hasOamManager == TRUE) { + sub_0200A784(param1->unk_00, param1->unk_04, param1->unk_08, param1->unk_0C, param1->unk_10, param1->unk_14, param1->unk_18, param1->unk_1C, renderer->heapID); + } + + renderer->cellTransferState = sub_0201DCC8(32, renderer->heapID); + + sub_0201E994(); + sub_0201F8E4(); + + return TRUE; +} + +BOOL SpriteRenderer_CreateCellActorList(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int numCells) +{ + if ((renderer == NULL) || (gfxHandler == NULL)) { + return FALSE; + } + + gfxHandler->cellActorList = sub_020095C4(numCells, &renderer->renderer, renderer->heapID); + return TRUE; +} + +void thunk_CellActor_Delete(CellActor *cellActor) +{ + CellActor_Delete(cellActor); +} + +void SpriteGfxHandler_UpdateCellActorCollection(SpriteGfxHandler *gfxHandler) +{ + GF_ASSERT(gfxHandler != NULL); + CellActorCollection_Update(gfxHandler->cellActorList); +} + +void OAMManager_ApplyAndResetBuffers(void) +{ + sub_0200A858(); +} + +void sub_0200C808(void) +{ + sub_0201DCE8(); +} + +void SpriteGfxHandler_DeleteCellActorCollection(SpriteGfxHandler *gfxHandler) +{ + CellActorCollection_Delete(gfxHandler->cellActorList); +} + +void SpriteGfxHandler_DeleteCellActorData(SpriteGfxHandler *gfxHandler) +{ + if (gfxHandler->cellActorDataList == NULL) { + return; + } + + sub_020095A8(gfxHandler->cellActorDataList); +} + +void SpriteGfxHandler_DeleteSpriteResources(SpriteGfxHandler *gfxHandler) +{ + int i; + for (i = 0; i < gfxHandler->numSpriteResourceTypes; i++) { + SpriteResourceTable *v1 = SpriteResourceTable_GetArrayElement(gfxHandler->spriteResourceTable, i); + SpriteResourceTable_Clear(v1); + } + + Heap_FreeToHeap(gfxHandler->spriteResourceTable); + sub_0200A508(gfxHandler->spriteResourceList[SPRITE_RESOURCE_TILES]); + sub_0200A700(gfxHandler->spriteResourceList[SPRITE_RESOURCE_PALETTE]); + + for (i = 0; i < gfxHandler->numSpriteResourceTypes; i++) { + SpriteResourceList_Delete(gfxHandler->spriteResourceList[i]); + SpriteResourceCollection_Delete(gfxHandler->spriteResourceCollectionList[i]); + } +} + +void SpriteRenderer_Deinit(SpriteRenderer *renderer) +{ + sub_0201DCF0(renderer->cellTransferState); + sub_0201E958(); + sub_0201F8B4(); + + if (renderer->hasOamManager == TRUE) { + sub_0200A878(); + } +} + +void SpriteRenderer_RemoveGfxHandler(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler) +{ + renderer->numGfxHandlers--; + Heap_FreeToHeap(gfxHandler); +} + +void SpriteRenderer_DeleteGfxHandler(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler) +{ + SpriteGfxHandler_DeleteCellActorCollection(gfxHandler); + SpriteGfxHandler_DeleteCellActorData(gfxHandler); + SpriteGfxHandler_DeleteSpriteResources(gfxHandler); + SpriteRenderer_RemoveGfxHandler(renderer, gfxHandler); +} + +void SpriteRenderer_Free(SpriteRenderer *renderer) +{ + GF_ASSERT(renderer->numGfxHandlers == 0); + + SpriteRenderer_Deinit(renderer); + Heap_FreeToHeap(renderer); +} + +BOOL SpriteRenderer_LoadSpriteResourceData(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const SpriteResourceDataPath *resourcePaths) +{ + int numEntries = SPRITE_RESOURCE_TYPE_MAX; + + if ((renderer == NULL) || (gfxHandler == NULL)) { + return FALSE; + } + + if (resourcePaths->paths.multiCellsDataPath == NULL) { + numEntries = SPRITE_RESOURCE_TYPE_MAX - 2; + } + + gfxHandler->numSpriteResourceTypes = numEntries; + int size = SpriteResourceTable_Size(); + gfxHandler->spriteResourceTable = Heap_AllocFromHeap(renderer->heapID, size * numEntries); + + for (int entryIndex = 0; entryIndex < numEntries; entryIndex++) { + SpriteResourceTable *resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->spriteResourceTable, entryIndex); + void *resourceEntryData = ReadFileToHeap(renderer->heapID, resourcePaths->val1[entryIndex]); + + SpriteResourceTable_LoadFromBinary(resourceEntryData, resourceTable, renderer->heapID); + Heap_FreeToHeap(resourceEntryData); + } + + for (int entryIndex = 0; entryIndex < numEntries; entryIndex++) { + SpriteResourceTable *resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->spriteResourceTable, entryIndex); + size = SpriteResourceTable_GetCount(resourceTable); + + gfxHandler->spriteResourceCollectionList[entryIndex] = SpriteResourceCollection_New(size, entryIndex, renderer->heapID); + } + + for (int entryIndex = 0; entryIndex < numEntries; entryIndex++) { + SpriteResourceTable *resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->spriteResourceTable, entryIndex); + size = SpriteResourceTable_GetCount(resourceTable); + + gfxHandler->spriteResourceList[entryIndex] = SpriteResourceList_New(size, renderer->heapID); + gfxHandler->numSpriteResources[entryIndex] = SpriteResourceCollection_Extend(gfxHandler->spriteResourceCollectionList[entryIndex], resourceTable, gfxHandler->spriteResourceList[entryIndex], renderer->heapID); + } + + sub_0200A368(gfxHandler->spriteResourceList[SPRITE_RESOURCE_TILES]); + sub_0200A60C(gfxHandler->spriteResourceList[SPRITE_RESOURCE_PALETTE]); + + void *resourceEntryData = ReadFileToHeap(renderer->heapID, resourcePaths->paths.combinedResourceDataPath); + gfxHandler->cellActorDataList = sub_02009508( + resourceEntryData, + renderer->heapID, + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_SPRITE], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_SPRITE_ANIM], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM]); + + Heap_FreeToHeap(resourceEntryData); + return 1; +} + +CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkStruct_ov7_0224F358 *template) +{ + return SpriteRenderer_CreateCellActor(renderer, gfxHandler, template->unk_00, template->unk_04, template->unk_06, template->unk_04, template->unk_0A, template->unk_0C, template->unk_10, template->unk_14, template->unk_18, template->unk_1C, template->unk_20, template->unk_24); +} + +CellActor *SpriteRenderer_CreateCellActor(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int resourceIndex, s16 x, s16 y, s16 z, u16 anim, int priority, int palette, int vramType, int param10, int param11, int param12, int param13) +{ + CellActorInitParamsEx cellActorParams; + + cellActorParams.collection = gfxHandler->cellActorList; + cellActorParams.resourceData = &gfxHandler->cellActorDataList->resourceDataList[resourceIndex]; + cellActorParams.position.x = FX32_CONST(x); + cellActorParams.position.y = FX32_CONST(y); + cellActorParams.position.z = FX32_CONST(z); + + if (vramType == NNS_G2D_VRAM_TYPE_2DSUB) { + cellActorParams.position.y += (192 << FX32_SHIFT); + } + + cellActorParams.affineScale.x = FX32_ONE; + cellActorParams.affineScale.y = FX32_ONE; + cellActorParams.affineScale.z = FX32_ONE; + cellActorParams.affineZRotation = 0; + cellActorParams.priority = priority; + cellActorParams.vramType = vramType; + cellActorParams.heapID = renderer->heapID; + + CellActor *cellActor = CellActorCollection_AddEx(&cellActorParams); + + if (cellActor != NULL) { + CellActor_SetAnim(cellActor, anim); + CellActor_SetExplicitPalette(cellActor, palette); + } + + return cellActor; +} + +BOOL SpriteRenderer_InitGfxResourceList(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkStruct_ov104_02241308 *param2) +{ + int i; + int j; + int numEntries = SPRITE_RESOURCE_TYPE_MAX; + + if ((renderer == NULL) || (gfxHandler == NULL)) { + return FALSE; + } + + if ((param2->val2.unk_10 == 0) || (param2->val2.unk_14 == 0)) { + numEntries = SPRITE_RESOURCE_TYPE_MAX - 2; + } + + gfxHandler->numSpriteResourceTypes = numEntries; + + for (i = 0; i < numEntries; i++) { + gfxHandler->spriteResourceCollectionList[i] = SpriteResourceCollection_New(param2->val1[i], i, renderer->heapID); + } + + for (i = 0; i < numEntries; i++) { + int capacity = param2->val1[i]; + + if (capacity == 0) { + continue; + } + + gfxHandler->spriteResourceList[i] = SpriteResourceList_New(capacity, renderer->heapID); + gfxHandler->numSpriteResources[i] = 0; + + for (j = 0; j < gfxHandler->spriteResourceList[i]->capacity; j++) { + gfxHandler->spriteResourceList[i]->resources[j] = NULL; + } + } + + return TRUE; +} + +BOOL SpriteRenderer_LoadCharResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int vramType, int resourceID) +{ + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], resourceID) == FALSE) { + return FALSE; + } + + SpriteResource *resource = SpriteResourceCollection_AddTiles(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], narcIndex, memberIndex, compressed, resourceID, vramType, renderer->heapID); + + if (resource != NULL) { + sub_0200A3DC(resource); + SpriteResourceList_Add(gfxHandler->spriteResourceList[SPRITE_RESOURCE_TILES], resource); + + return TRUE; + } + + GF_ASSERT(0); + + return (resource == NULL) ? FALSE : TRUE; +} + +BOOL SpriteRenderer_LoadCharResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *param1, NARC *narc, int memberIndex, BOOL compressed, int vramType, int resourceID) +{ + if (SpriteResourceCollection_IsIDUnused(param1->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], resourceID) == FALSE) { + return FALSE; + } + + SpriteResource *resource = SpriteResourceCollection_AddTilesFrom(param1->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], narc, memberIndex, compressed, resourceID, vramType, renderer->heapID); + + if (resource != NULL) { + sub_0200A3DC(resource); + SpriteResourceList_Add(param1->spriteResourceList[SPRITE_RESOURCE_TILES], resource); + return TRUE; + } + + GF_ASSERT(0); + + return (resource == NULL) ? FALSE : TRUE; +} + +s8 SpriteRenderer_LoadPaletteResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int paletteIndex, int vramType, int resourceID) +{ + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], resourceID) == FALSE) { + return -1; + } + + SpriteResource *resource = SpriteResourceCollection_AddPalette(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], narcIndex, memberIndex, compressed, resourceID, vramType, paletteIndex, renderer->heapID); + + if (resource != NULL) { + GF_ASSERT(sub_0200A640(resource) == TRUE); + SpriteResourceList_Add(gfxHandler->spriteResourceList[SPRITE_RESOURCE_PALETTE], resource); + return sub_0200A760(resource, vramType); + } + + GF_ASSERT(0); + + return -1; +} + +s8 SpriteRenderer_LoadPaletteResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int paletteIndex, int vramType, int resourceID) +{ + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], resourceID) == FALSE) { + return -1; + } + + SpriteResource *resource = SpriteResourceCollection_AddPaletteFrom(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], narc, memberIndex, compressed, resourceID, vramType, paletteIndex, renderer->heapID); + + if (resource != NULL) { + GF_ASSERT(sub_0200A640(resource) == TRUE); + SpriteResourceList_Add(gfxHandler->spriteResourceList[SPRITE_RESOURCE_PALETTE], resource); + return sub_0200A760(resource, vramType); + } + + GF_ASSERT(0); + return -1; +} + +u8 SpriteRenderer_LoadPalette(PaletteData *palette, enum PaletteBufferID bufferID, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, int compressed, int paletteIndex, int vramType, int resourceID) +{ + int resource = SpriteRenderer_LoadPaletteResObj(renderer, gfxHandler, narcIndex, memberIndex, compressed, paletteIndex, vramType, resourceID); + + if (resource != -1) { + PaletteData_LoadBufferFromHardware(palette, bufferID, resource * 16, paletteIndex * 0x20); + } + + return resource; +} + +u8 SpriteRenderer_LoadPaletteFromOpenNarc(PaletteData *palette, enum PaletteBufferID bufferID, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, int compressed, int paletteIndex, int vramType, int resourceID) +{ + int resource = SpriteRenderer_LoadPaletteResObjFromOpenNarc(renderer, gfxHandler, narc, memberIndex, compressed, paletteIndex, vramType, resourceID); + + if (resource != -1) { + PaletteData_LoadBufferFromHardware(palette, bufferID, resource * 16, paletteIndex * 0x20); + } + + return resource; +} + +BOOL SpriteRenderer_LoadCellResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID) +{ + return SpriteRenderer_LoadResObj(renderer, gfxHandler, narcIndex, memberIndex, compressed, SPRITE_RESOURCE_SPRITE, resourceID); +} + +BOOL SpriteRenderer_LoadCellResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID) +{ + return SpriteRenderer_LoadResObjFromOpenNarc(renderer, gfxHandler, narc, memberIndex, compressed, SPRITE_RESOURCE_SPRITE, resourceID); +} + +BOOL SpriteRenderer_LoadAnimResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID) +{ + return SpriteRenderer_LoadResObj(renderer, gfxHandler, narcIndex, memberIndex, compressed, SPRITE_RESOURCE_SPRITE_ANIM, resourceID); +} + +BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID) +{ + return SpriteRenderer_LoadResObjFromOpenNarc(renderer, gfxHandler, narc, memberIndex, compressed, SPRITE_RESOURCE_SPRITE_ANIM, resourceID); +} + +CellActorData *CellActor_LoadResources(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const SpriteTemplate *template) +{ + CellActorInitParamsEx cellActorParams; + int resourceIDList[SPRITE_RESOURCE_TYPE_MAX]; + + CellActorData *cellActorData = Heap_AllocFromHeap(renderer->heapID, sizeof(CellActorData)); + + if (cellActorData == NULL) { + return NULL; + } + + cellActorData->cellActorResourceList = Heap_AllocFromHeap(renderer->heapID, sizeof(CellActorResourceDataList)); + + if (cellActorData->cellActorResourceList == NULL) { + return NULL; + } + + cellActorData->cellActorResourceList->resourceDataList = Heap_AllocFromHeap(renderer->heapID, sizeof(CellActorResourceData)); + cellActorData->cellActorResource = cellActorData->cellActorResourceList->resourceDataList; + + if (cellActorData->cellActorResourceList->resourceDataList == NULL) { + if (cellActorData->cellActorResourceList) { + Heap_FreeToHeap(cellActorData->cellActorResourceList); + } + + return NULL; + } + + for (int i = 0; i < SPRITE_RESOURCE_TYPE_MAX; i++) { + resourceIDList[i] = template->resources[i]; + } + + if ((gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE] == NULL) || (gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM] == NULL)) { + resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE] = -1; + resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM] = -1; + } else { + if ((resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE] != -1) && (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE], resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE]) == FALSE)) { + resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE] = -1; + } + + if ((resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM] != -1) && (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM], resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM]) == FALSE)) { + resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM] = -1; + } + } + + sub_020093B4( + cellActorData->cellActorResource, + resourceIDList[SPRITE_RESOURCE_TILES], + resourceIDList[SPRITE_RESOURCE_PALETTE], + resourceIDList[SPRITE_RESOURCE_SPRITE], + resourceIDList[SPRITE_RESOURCE_SPRITE_ANIM], + resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE], + resourceIDList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM], + template->transferToVRAM, + template->bgPriority, + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_SPRITE], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_SPRITE_ANIM], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE], + gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM]); + + cellActorParams.collection = gfxHandler->cellActorList; + cellActorParams.resourceData = cellActorData->cellActorResource; + cellActorParams.position.x = FX32_CONST(template->x); + cellActorParams.position.y = FX32_CONST(template->y); + cellActorParams.position.z = FX32_CONST(template->z); + + if (template->vramType == NNS_G2D_VRAM_TYPE_2DSUB) { + cellActorParams.position.y += (192 << FX32_SHIFT); + } + + cellActorParams.affineScale.x = FX32_ONE; + cellActorParams.affineScale.y = FX32_ONE; + cellActorParams.affineScale.z = FX32_ONE; + cellActorParams.affineZRotation = 0; + cellActorParams.priority = template->priority; + cellActorParams.vramType = template->vramType; + cellActorParams.heapID = renderer->heapID; + cellActorData->cellActor = CellActorCollection_AddEx(&cellActorParams); + cellActorData->vramTransfer = template->transferToVRAM; + + if (cellActorData->cellActor != NULL) { + int palette = CellActor_GetExplicitPalette(cellActorData->cellActor); + + CellActor_SetAnim(cellActorData->cellActor, template->animIdx); + CellActor_SetExplicitPalette(cellActorData->cellActor, palette + template->plttIdx); + } else { + GF_ASSERT(FALSE); + } + + return cellActorData; +} + +const NNSG2dImagePaletteProxy *SpriteGfxHandler_GetPaletteProxy(SpriteGfxHandler *gfxHandler, int resourceID) +{ + return sub_0200A72C(SpriteResourceCollection_Find(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], resourceID), NULL); +} + +u32 SpriteGfxHandler_GetPaletteNumberById(SpriteGfxHandler *gfxHandler, int resourceID, NNS_G2D_VRAM_TYPE vramType) +{ + return sub_0200A760(SpriteResourceCollection_Find(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], resourceID), vramType); +} + +BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *gfxHandler, int resourceID) +{ + return sub_0200D27C(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], gfxHandler->spriteResourceList[0], resourceID); +} + +BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler *gfxHandler, int resourceID) +{ + return sub_0200D2D0(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], gfxHandler->spriteResourceList[1], resourceID); +} + +BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler *gfxHandler, int resourceID) +{ + return SpriteResourceCollection_RemoveFromResourceList(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_SPRITE], gfxHandler->spriteResourceList[2], resourceID); +} + +BOOL SpriteGfxHandler_UnloadAnimObjById(SpriteGfxHandler *gfxHandler, int resourceID) +{ + return SpriteResourceCollection_RemoveFromResourceList(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_SPRITE_ANIM], gfxHandler->spriteResourceList[3], resourceID); +} + +void SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(SpriteRenderer *spriteRenderer, SpriteGfxHandler *gfxHandler) +{ + SpriteGfxHandler_DeleteCellActorCollection(gfxHandler); + sub_0200A508(gfxHandler->spriteResourceList[SPRITE_RESOURCE_TILES]); + sub_0200A700(gfxHandler->spriteResourceList[SPRITE_RESOURCE_PALETTE]); + + for (int i = 0; i < gfxHandler->numSpriteResourceTypes; i++) { + SpriteResourceList_Delete(gfxHandler->spriteResourceList[i]); + SpriteResourceCollection_Delete(gfxHandler->spriteResourceCollectionList[i]); + } + + SpriteRenderer_RemoveGfxHandler(spriteRenderer, gfxHandler); +} + +void CellActorData_Delete(CellActorData *cellActorData) +{ + if (cellActorData->vramTransfer) { + sub_0200A5B4(cellActorData->cellActorResource->imageProxy); + } + + CellActor_Delete(cellActorData->cellActor); + sub_020095A8(cellActorData->cellActorResourceList); + Heap_FreeToHeap(cellActorData); +} + +static BOOL SpriteRenderer_LoadResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, enum SpriteResourceType resourceType, int resourceID) +{ + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[resourceType], resourceID) == FALSE) { + return FALSE; + } + + SpriteResource *resource = SpriteResourceCollection_Add(gfxHandler->spriteResourceCollectionList[resourceType], narcIndex, memberIndex, compressed, resourceID, resourceType, renderer->heapID); + + if (resource != NULL) { + BOOL v1 = SpriteResourceList_Add(gfxHandler->spriteResourceList[resourceType], resource); + GF_ASSERT(v1 == TRUE); + return v1; + } + + GF_ASSERT(0); + return (resource == NULL) ? FALSE : TRUE; +} + +static BOOL SpriteRenderer_LoadResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, enum SpriteResourceType resourceType, int resourceID) +{ + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[resourceType], resourceID) == FALSE) { + return FALSE; + } + + SpriteResource *resource = SpriteResourceCollection_AddFrom(gfxHandler->spriteResourceCollectionList[resourceType], narc, memberIndex, compressed, resourceID, resourceType, renderer->heapID); + + if (resource != NULL) { + BOOL v1 = SpriteResourceList_Add(gfxHandler->spriteResourceList[resourceType], resource); + GF_ASSERT(v1 == TRUE); + return v1; + } + + GF_ASSERT(0); + + return (resource == NULL) ? FALSE : TRUE; +} + +static BOOL SpriteResourceList_Add(SpriteResourceList *resourceList, SpriteResource *resource) +{ + for (int i = 0; i < resourceList->capacity; i++) { + if (resourceList->resources[i] != NULL) { + continue; + } + + resourceList->resources[i] = resource; + resourceList->count++; + + return TRUE; + } + + return FALSE; +} + +static BOOL SpriteResourceCollection_RemoveFromResourceList(SpriteResourceCollection *resourceCollection, SpriteResourceList *resourceList, int resourceID) +{ + for (int i = 0; i < resourceList->capacity; i++) { + if (resourceList->resources[i] == NULL) { + continue; + } + + int spriteResourceID = SpriteResource_GetID(resourceList->resources[i]); + + if (spriteResourceID == resourceID) { + SpriteResourceCollection_Remove(resourceCollection, resourceList->resources[i]); + + resourceList->resources[i] = NULL; + resourceList->count--; + + return TRUE; + } + } + + return FALSE; +} + +static BOOL sub_0200D27C(SpriteResourceCollection *resourceCollection, SpriteResourceList *resourceList, int resourceID) +{ + for (int i = 0; i < resourceList->capacity; i++) { + if (resourceList->resources[i] == NULL) { + continue; + } + + int spriteResourceID = SpriteResource_GetID(resourceList->resources[i]); + + if (spriteResourceID == resourceID) { + sub_0201EB50(resourceID); + SpriteResourceCollection_Remove(resourceCollection, resourceList->resources[i]); + + resourceList->resources[i] = NULL; + resourceList->count--; + + return TRUE; + } + } + + return FALSE; +} + +static BOOL sub_0200D2D0(SpriteResourceCollection *resourceCollection, SpriteResourceList *resourceList, int resourceID) +{ + for (int i = 0; i < resourceList->capacity; i++) { + if (resourceList->resources[i] == NULL) { + continue; + } + + int spriteResourceID = SpriteResource_GetID(resourceList->resources[i]); + + if (spriteResourceID == resourceID) { + sub_0201F9F0(resourceID); + SpriteResourceCollection_Remove(resourceCollection, resourceList->resources[i]); + + resourceList->resources[i] = NULL; + resourceList->count--; + + return TRUE; + } + } + + return FALSE; +} + +void CellActor_UpdateObject(CellActor *cellActor) +{ + CellActor_UpdateAnim(cellActor, FX32_ONE); +} + +void CellActorData_UpdateObject(CellActorData *cellActorData) +{ + CellActor_UpdateObject(cellActorData->cellActor); +} + +void CellActorData_Update2Frames(CellActorData *cellActorData) +{ + CellActor_UpdateAnim(cellActorData->cellActor, FX32_CONST(2)); +} + +void CellActorData_UpdateNFrames(CellActorData *cellActorData, fx32 frames) +{ + CellActor_UpdateAnim(cellActorData->cellActor, frames); +} + +u32 CellActorData_GetActorAnimCount(CellActorData *cellActorData) +{ + return CellActor_GetAnimCount(cellActorData->cellActor); +} + +void CellActorData_SetAnim(CellActorData *cellActorData, u32 animID) +{ + CellActor_SetAnim(cellActorData->cellActor, animID); +} + +void CellActorData_SetAnimNoRestart(CellActorData *cellActorData, u32 animID) +{ + CellActor_SetAnimNoRestart(cellActorData->cellActor, animID); +} + +u32 CellActorData_GetActiveAnim(CellActorData *cellActorData) +{ + return CellActor_GetActiveAnim(cellActorData->cellActor); +} + +void thunk_CellActor_SetAnimateFlag(CellActor *cellActor, BOOL animate) +{ + CellActor_SetAnimateFlag(cellActor, animate); +} + +void CellActorData_SetAnimateFlag(CellActorData *cellActorData, BOOL animate) +{ + thunk_CellActor_SetAnimateFlag(cellActorData->cellActor, animate); +} + +void thunk_CellActor_SetAnimSpeed(CellActor *cellActor, fx32 speed) +{ + CellActor_SetAnimSpeed(cellActor, speed); +} + +void CellActorData_SetAnimSpeed(CellActorData *cellActorData, fx32 speed) +{ + thunk_CellActor_SetAnimSpeed(cellActorData->cellActor, speed); +} + +BOOL thunk_CellActor_IsAnimated(CellActor *cellActor) +{ + return CellActor_IsAnimated(cellActor); +} + +BOOL CellActorData_IsAnimated(CellActorData *cellActorData) +{ + return thunk_CellActor_IsAnimated(cellActorData->cellActor); +} + +void thunk_CellActor_SetAnimFrame(CellActor *cellActor, u16 frame) +{ + SpriteActor_SetAnimFrame(cellActor, frame); +} + +void CellActorData_SetAnimFrame(CellActorData *cellActorData, u16 frame) +{ + thunk_CellActor_SetAnimFrame(cellActorData->cellActor, frame); +} + +u16 thunk_CellActor_GetAnimFrame(CellActor *cellActor) +{ + return CellActor_GetAnimFrame(cellActor); +} + +u16 CellActorData_GetAnimFrame(CellActorData *cellActorData) +{ + return thunk_CellActor_GetAnimFrame(cellActorData->cellActor); +} + +void CellActor_DrawSprite(CellActor *cellActor, BOOL drawFlag) +{ + CellActor_SetDrawFlag(cellActor, drawFlag); +} + +void CellActorData_DrawSprite(CellActorData *cellActorData, BOOL drawFlag) +{ + CellActor_DrawSprite(cellActorData->cellActor, drawFlag); +} + +int thunk_CellActor_GetDrawFlag(CellActor *cellActor) +{ + return CellActor_GetDrawFlag(cellActor); +} + +int CellActorData_GetDrawFlag(CellActorData *cellActorData) +{ + return thunk_CellActor_GetDrawFlag(cellActorData->cellActor); +} + +void thunk_CellActor_SetExplicitPalette(CellActor *cellActor, int palette) +{ + CellActor_SetExplicitPalette(cellActor, palette); +} + +void CellActorData_SetExplicitPalette(CellActorData *cellActorData, int palette) +{ + thunk_CellActor_SetExplicitPalette(cellActorData->cellActor, palette); +} + +void thunk_CellActor_SetExplicitPaletteOffset(CellActor *cellActor, int paletteOffset) +{ + CellActor_SetExplicitPaletteOffset(cellActor, paletteOffset); +} + +void CellActorData_SetExplicitPaletteOffset(CellActorData *cellActorData, int paletteOffset) +{ + thunk_CellActor_SetExplicitPaletteOffset(cellActorData->cellActor, paletteOffset); +} + +int CellActorData_GetExplicitPaletteOffset(CellActorData *cellActorData) +{ + return CellActor_GetExplicitPaletteOffset(cellActorData->cellActor); +} + +void thunk_CellActor_SetExplicitPriority(CellActor *cellActor, int priority) +{ + CellActor_SetExplicitPriority(cellActor, priority); +} + +int CellActorData_GetExplicitPriority(CellActorData *cellActorData) +{ + return CellActor_GetExplicitPriority(cellActorData->cellActor); +} + +void CellActorData_SetExplicitPriority(CellActorData *cellActorData, int priority) +{ + thunk_CellActor_SetExplicitPriority(cellActorData->cellActor, priority); +} + +void thunk_CellActor_SetPriority(CellActor *cellActor, int priority) +{ + CellActor_SetPriority(cellActor, priority); +} + +void CellActorData_SetPriority(CellActorData *cellActorData, int priority) +{ + thunk_CellActor_SetPriority(cellActorData->cellActor, priority); +} + +u32 thunk_CellActor_GetPriority(CellActor *cellActor) +{ + return CellActor_GetPriority(cellActor); +} + +u32 CellActorData_GetPriority(CellActorData *cellActorData) +{ + return thunk_CellActor_GetPriority(cellActorData->cellActor); +} + +void CellActor_SetPositionXY(CellActor *cellActor, s16 x, s16 y) +{ + VecFx32 position; + + position.x = x * FX32_ONE; + position.y = y * FX32_ONE; + + if (CellActor_GetVRamType(cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + position.y += (192 << FX32_SHIFT); + } + + position.z = 0; + + CellActor_SetPosition(cellActor, &position); +} + +void CellActorData_SetPositionXY(CellActorData *cellActorData, s16 x, s16 y) +{ + CellActor_SetPositionXY(cellActorData->cellActor, x, y); +} + +void CellActor_SetPositionWithOffsetXY(CellActor *cellActor, s16 x, s16 y, fx32 offset) +{ + VecFx32 position; + + position.x = x * FX32_ONE; + position.y = y * FX32_ONE; + + if (CellActor_GetVRamType(cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + position.y += offset; + } + + position.z = 0; + + CellActor_SetPosition(cellActor, &position); +} + +void sub_0200D500(CellActorData *param0, s16 param1, s16 param2, fx32 param3) +{ + CellActor_SetPositionWithOffsetXY(param0->cellActor, param1, param2, param3); +} + +void sub_0200D50C(CellActor *param0, s16 *param1, s16 *param2) +{ + const VecFx32 *v0; + + v0 = CellActor_GetPosition(param0); + *param1 = v0->x / FX32_ONE; + + if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { + *param2 = (v0->y - (192 << FX32_SHIFT)) / FX32_ONE; + } else { + *param2 = v0->y / FX32_ONE; + } +} + +void SpriteActor_GetSpritePositionXY(CellActorData *param0, s16 *param1, s16 *param2) +{ + sub_0200D50C(param0->cellActor, param1, param2); +} + +void sub_0200D55C(CellActor *param0, s16 *param1, s16 *param2, fx32 param3) +{ + const VecFx32 *v0; + + v0 = CellActor_GetPosition(param0); + *param1 = v0->x / FX32_ONE; + + if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { + *param2 = (v0->y - param3) / FX32_ONE; + } else { + *param2 = v0->y / FX32_ONE; + } +} + +void sub_0200D5A0(CellActorData *param0, s16 *param1, s16 *param2, fx32 param3) +{ + sub_0200D55C(param0->cellActor, param1, param2, param3); +} + +void sub_0200D5AC(CellActor *param0, s16 param1, s16 param2) +{ + const VecFx32 *v0; + VecFx32 v1; + + v0 = CellActor_GetPosition(param0); + + v1.x = v0->x + (param1 * FX32_ONE); + v1.y = v0->y + (param2 * FX32_ONE); + v1.z = v0->z; + + CellActor_SetPosition(param0, &v1); +} + +void sub_0200D5DC(CellActorData *param0, s16 param1, s16 param2) +{ + sub_0200D5AC(param0->cellActor, param1, param2); +} + +void sub_0200D5E8(CellActorData *param0, fx32 param1, fx32 param2) +{ + const VecFx32 *v0; + VecFx32 v1; + + v0 = CellActor_GetPosition(param0->cellActor); + + v1.x = v0->x + param1; + v1.y = v0->y + param2; + v1.z = v0->z; + + CellActor_SetPosition(param0->cellActor, &v1); +} + +void sub_0200D614(CellActorData *param0, fx32 param1, fx32 param2) +{ + const VecFx32 *v0; + VecFx32 v1; + + v0 = CellActor_GetPosition(param0->cellActor); + + v1.x = param1; + v1.y = param2; + v1.z = v0->z; + + CellActor_SetPosition(param0->cellActor, &v1); +} + +void sub_0200D638(CellActorData *param0, fx32 *param1, fx32 *param2) +{ + const VecFx32 *v0; + VecFx32 v1; + + v0 = CellActor_GetPosition(param0->cellActor); + + *param1 = v0->x; + *param2 = v0->y; +} + +void sub_0200D650(CellActorData *param0, fx32 param1, fx32 param2, fx32 param3) +{ + if (CellActor_GetVRamType(param0->cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + sub_0200D614(param0, param1, param2 + param3); + } else { + sub_0200D614(param0, param1, param2); + } +} + +void sub_0200D67C(CellActorData *param0, fx32 *param1, fx32 *param2, fx32 param3) +{ + sub_0200D638(param0, param1, param2); + + if (CellActor_GetVRamType(param0->cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + *param2 = *param2 - param3; + } +} + +void sub_0200D69C(CellActor *param0, int param1) +{ + CellActor_SetAffineOverwriteMode(param0, param1); +} + +void sub_0200D6A4(CellActorData *param0, int param1) +{ + sub_0200D69C(param0->cellActor, param1); +} + +void sub_0200D6B0(CellActor *param0, f32 param1, f32 param2) +{ + const VecFx32 *v0; + VecFx32 *v1; + + v0 = CellActor_GetAffineScale(param0); + v1 = (VecFx32 *)v0; + + v1->x = (param1 * FX32_ONE); + v1->y = (param2 * FX32_ONE); + + CellActor_SetAffineScale(param0, v1); +} + +void sub_0200D6E8(CellActorData *param0, f32 param1, f32 param2) +{ + sub_0200D6B0(param0->cellActor, param1, param2); +} + +void sub_0200D6F4(CellActor *param0, f32 param1, f32 param2) +{ + const VecFx32 *v0; + VecFx32 *v1; + + v0 = CellActor_GetAffineScale(param0); + v1 = (VecFx32 *)v0; + + v1->x = v0->x + (param1 * FX32_ONE); + v1->y = v0->y + (param2 * FX32_ONE); + + CellActor_SetAffineScale(param0, v1); +} + +void sub_0200D74C(CellActorData *param0, f32 param1, f32 param2) +{ + sub_0200D6F4(param0->cellActor, param1, param2); +} + +void sub_0200D758(CellActor *param0, f32 *param1, f32 *param2) +{ + const VecFx32 *v0; + VecFx32 *v1; + + v0 = CellActor_GetAffineScale(param0); + + *param1 = FX_FX32_TO_F32(v0->x); + *param2 = FX_FX32_TO_F32(v0->y); +} + +void sub_0200D788(CellActorData *param0, f32 *param1, f32 *param2) +{ + sub_0200D758(param0->cellActor, param1, param2); +} + +void sub_0200D794(CellActor *param0, u16 param1) +{ + CellActor_SetAffineZRotation(param0, param1); +} + +void sub_0200D79C(CellActorData *param0, u16 param1) +{ + sub_0200D794(param0->cellActor, param1); +} + +void sub_0200D7A8(CellActor *param0, s32 param1) +{ + u16 v0; + + v0 = CellActor_GetAffineZRotation(param0); + v0 += param1; + + CellActor_SetAffineZRotation(param0, v0); +} + +void sub_0200D7C0(CellActorData *param0, s32 param1) +{ + sub_0200D7A8(param0->cellActor, param1); +} + +void sub_0200D7CC(CellActor *param0, int param1) +{ + CellActor_SetFlipMode(param0, param1); +} + +void sub_0200D7D4(CellActorData *param0, int param1) +{ + sub_0200D7CC(param0->cellActor, param1); +} + +void sub_0200D7E0(CellActorData *param0, s16 param1, s16 param2) +{ + VecFx32 v0; + + v0.x = param1 << FX32_SHIFT; + v0.y = param2 << FX32_SHIFT; + v0.z = 0; + + CellActor_SetAffineTranslation(param0->cellActor, &v0); +} + +void sub_0200D7FC(CellActorData *param0, BOOL param1) +{ + CellActor_SetPixelated(param0->cellActor, param1); +} + +void sub_0200D808(CellActor *param0, GXOamMode param1) +{ + CellActor_SetExplicitOAMMode(param0, param1); +} + +void SpriteActor_SetOAMMode(CellActorData *param0, GXOamMode param1) +{ + sub_0200D808(param0->cellActor, param1); +} + +u32 sub_0200D81C(CellActorData *param0) +{ + return CellActor_GetUserAttrForCurrentAnimFrame(param0->cellActor); +} + +BOOL sub_0200D828(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6) +{ + SpriteResource *v0; + + if (SpriteResourceCollection_IsIDUnused(param1->spriteResourceCollectionList[0], param6) == 0) { + return 0; + } + + v0 = SpriteResourceCollection_AddTiles(param1->spriteResourceCollectionList[0], param2, param3, param4, param6, param5, param0->heapID); + + if (v0 != NULL) { + sub_0200A39C(v0); + SpriteResourceList_Add(param1->spriteResourceList[0], v0); + + return 1; + } + + GF_ASSERT(0); + + return (v0 == NULL) ? 0 : 1; +} + +BOOL sub_0200D888(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6) +{ + SpriteResource *v0; + + if (SpriteResourceCollection_IsIDUnused(param1->spriteResourceCollectionList[0], param6) == 0) { + return 0; + } + + v0 = SpriteResourceCollection_AddTiles(param1->spriteResourceCollectionList[0], param2, param3, param4, param6, param5, param0->heapID); + + if (v0 != NULL) { + sub_0200A450(v0); + SpriteResourceList_Add(param1->spriteResourceList[0], v0); + + return 1; + } + + GF_ASSERT(0); + + return (v0 == NULL) ? 0 : 1; +} + +BOOL sub_0200D8E8(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5, int param6) +{ + SpriteResource *v0; + + if (SpriteResourceCollection_IsIDUnused(param1->spriteResourceCollectionList[0], param6) == 0) { + return 0; + } + + v0 = SpriteResourceCollection_AddTilesFrom(param1->spriteResourceCollectionList[0], param2, param3, param4, param6, param5, param0->heapID); + + if (v0 != NULL) { + sub_0200A450(v0); + SpriteResourceList_Add(param1->spriteResourceList[0], v0); + + return 1; + } + + GF_ASSERT(0); + + return (v0 == NULL) ? 0 : 1; +} + +void sub_0200D948(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5) +{ + SpriteResource *v0; + + v0 = SpriteResourceCollection_Find(param1->spriteResourceCollectionList[0], param5); + + SpriteResourceCollection_ModifyTiles(param1->spriteResourceCollectionList[0], v0, param2, param3, param4, param0->heapID); + sub_0200A4C0(v0); +} + +void sub_0200D97C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5) +{ + SpriteResource *v0; + + v0 = SpriteResourceCollection_Find(param1->spriteResourceCollectionList[1], param5); + + SpriteResourceCollection_ModifyPalette(param1->spriteResourceCollectionList[1], v0, param2, param3, param4, param0->heapID); + sub_0200A6B8(v0); +} + +CellActorCollection *sub_0200D9B0(SpriteGfxHandler *param0) +{ + return param0->cellActorList; +} + +void sub_0200D9B4(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5) +{ + SpriteResource *v0; + + v0 = SpriteResourceCollection_Find(param1->spriteResourceCollectionList[0], param5); + + SpriteResourceCollection_ModifyTilesFrom(param1->spriteResourceCollectionList[0], v0, param2, param3, param4, param0->heapID); + sub_0200A4C0(v0); +} diff --git a/src/unk_020093B4.c b/src/unk_020093B4.c index 8a4a7929dd..cd3461c514 100644 --- a/src/unk_020093B4.c +++ b/src/unk_020093B4.c @@ -3,12 +3,11 @@ #include #include -#include "struct_defs/struct_02009508.h" #include "struct_defs/struct_02009508_1.h" -#include "struct_defs/struct_0200C738.h" #include "cell_actor.h" #include "heap.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_0200A328.h" #include "unk_0200A784.h" @@ -97,11 +96,11 @@ void sub_020094F0(CellActorResourceData *param0) memset(param0, 0, sizeof(CellActorResourceData)); } -UnkStruct_02009508 *sub_02009508(const UnkStruct_02009508_1 *param0, int param1, SpriteResourceCollection *param2, SpriteResourceCollection *param3, SpriteResourceCollection *param4, SpriteResourceCollection *param5, SpriteResourceCollection *param6, SpriteResourceCollection *param7) +CellActorResourceDataList *sub_02009508(const UnkStruct_02009508_1 *param0, int param1, SpriteResourceCollection *param2, SpriteResourceCollection *param3, SpriteResourceCollection *param4, SpriteResourceCollection *param5, SpriteResourceCollection *param6, SpriteResourceCollection *param7) { int v0; int v1; - UnkStruct_02009508 *v2; + CellActorResourceDataList *v2; int v3, v4; v1 = 0; @@ -110,57 +109,57 @@ UnkStruct_02009508 *sub_02009508(const UnkStruct_02009508_1 *param0, int param1, v1++; } - v2 = Heap_AllocFromHeap(param1, sizeof(UnkStruct_02009508)); - v2->unk_00 = Heap_AllocFromHeap(param1, sizeof(CellActorResourceData) * v1); - v2->unk_04 = v1; + v2 = Heap_AllocFromHeap(param1, sizeof(CellActorResourceDataList)); + v2->resourceDataList = Heap_AllocFromHeap(param1, sizeof(CellActorResourceData) * v1); + v2->numEntries = v1; - for (v0 = 0; v0 < v2->unk_04; v0++) { - sub_020093B4(v2->unk_00 + v0, param0[v0].unk_00, param0[v0].unk_04, param0[v0].unk_08, param0[v0].unk_0C, param0[v0].unk_10, param0[v0].unk_14, param0[v0].unk_18, param0[v0].unk_1C, param2, param3, param4, param5, param6, param7); + for (v0 = 0; v0 < v2->numEntries; v0++) { + sub_020093B4(v2->resourceDataList + v0, param0[v0].unk_00, param0[v0].unk_04, param0[v0].unk_08, param0[v0].unk_0C, param0[v0].unk_10, param0[v0].unk_14, param0[v0].unk_18, param0[v0].unk_1C, param2, param3, param4, param5, param6, param7); } return v2; } -void sub_020095A8(UnkStruct_02009508 *param0) +void sub_020095A8(CellActorResourceDataList *param0) { GF_ASSERT(param0); - if (param0->unk_00) { - Heap_FreeToHeap(param0->unk_00); + if (param0->resourceDataList) { + Heap_FreeToHeap(param0->resourceDataList); } Heap_FreeToHeap(param0); } -CellActorCollection *sub_020095C4(int param0, UnkStruct_0200C738 *param1, int param2) +CellActorCollection *sub_020095C4(int param0, GF_G2dRenderer *param1, int param2) { CellActorCollectionParams v0; NNSG2dViewRect v1; - sub_0202309C(¶m1->unk_00, -FX32_ONE); + sub_0202309C(¶m1->rendererInstance, -FX32_ONE); v1.posTopLeft.x = 0; v1.posTopLeft.y = 0; v1.sizeView.x = (255 << FX32_SHIFT); v1.sizeView.y = (192 << FX32_SHIFT); - sub_0200A8B0(¶m1->unk_94[0], &v1, NNS_G2D_SURFACETYPE_MAIN2D, ¶m1->unk_00); + sub_0200A8B0(¶m1->renderSurface[0], &v1, NNS_G2D_SURFACETYPE_MAIN2D, ¶m1->rendererInstance); v1.posTopLeft.x = 0; v1.posTopLeft.y = (192 << FX32_SHIFT); v1.sizeView.x = (255 << FX32_SHIFT); v1.sizeView.y = (192 << FX32_SHIFT); - sub_0200A8B0(¶m1->unk_94[1], &v1, NNS_G2D_SURFACETYPE_SUB2D, ¶m1->unk_00); + sub_0200A8B0(¶m1->renderSurface[1], &v1, NNS_G2D_SURFACETYPE_SUB2D, ¶m1->rendererInstance); v0.maxElements = param0; - v0.renderer = ¶m1->unk_00; + v0.renderer = ¶m1->rendererInstance; v0.heapID = param2; return CellActorCollection_New(&v0); } -void sub_0200962C(UnkStruct_0200C738 *param0, fx32 param1, fx32 param2) +void sub_0200962C(GF_G2dRenderer *param0, fx32 param1, fx32 param2) { NNSG2dViewRect v0; @@ -169,10 +168,10 @@ void sub_0200962C(UnkStruct_0200C738 *param0, fx32 param1, fx32 param2) v0.sizeView.x = (255 << FX32_SHIFT); v0.sizeView.y = (192 << FX32_SHIFT); - sub_020230E0(¶m0->unk_94[0], &v0); + sub_020230E0(¶m0->renderSurface[0], &v0); } -void sub_0200964C(UnkStruct_0200C738 *param0, fx32 param1, fx32 param2) +void sub_0200964C(GF_G2dRenderer *param0, fx32 param1, fx32 param2) { NNSG2dViewRect v0; @@ -181,7 +180,7 @@ void sub_0200964C(UnkStruct_0200C738 *param0, fx32 param1, fx32 param2) v0.sizeView.x = (255 << FX32_SHIFT); v0.sizeView.y = (192 << FX32_SHIFT); - sub_020230E0(¶m0->unk_94[1], &v0); + sub_020230E0(¶m0->renderSurface[1], &v0); } void sub_0200966C(u32 param0, GXOBJVRamModeChar param1) diff --git a/src/unk_0200C6E4.c b/src/unk_0200C6E4.c deleted file mode 100644 index 102b092a08..0000000000 --- a/src/unk_0200C6E4.c +++ /dev/null @@ -1,1337 +0,0 @@ -#include "unk_0200C6E4.h" - -#include -#include - -#include "struct_defs/sprite_template.h" -#include "struct_defs/struct_02009508.h" -#include "struct_defs/struct_0200C738.h" -#include "struct_defs/struct_0200D0F4.h" - -#include "overlay007/struct_ov7_0224F358.h" -#include "overlay022/struct_ov22_022559F8.h" -#include "overlay104/struct_ov104_022412F4.h" -#include "overlay104/struct_ov104_02241308.h" -#include "overlay104/struct_ov104_0224133C.h" - -#include "cell_actor.h" -#include "heap.h" -#include "narc.h" -#include "palette.h" -#include "sprite_resource.h" -#include "unk_020093B4.h" -#include "unk_0200A328.h" -#include "unk_0200A784.h" -#include "unk_02017728.h" -#include "unk_0201DBEC.h" -#include "unk_0201E86C.h" -#include "unk_0201F834.h" - -typedef struct CellTransferStateData_t { - int unk_00; - int unk_04; - int unk_08; - NNSG2dCellTransferState *unk_0C; - UnkStruct_0200C738 unk_10; -} SpriteRenderer; - -typedef struct AnimationResourceCollection_t { - CellActorCollection *unk_00; - UnkStruct_02009508 *unk_04; - SpriteResourceTable *unk_08; - SpriteResourceCollection *unk_0C[6]; - SpriteResourceList *unk_24[6]; - int unk_3C[6]; - int unk_54; -} SpriteGfxHandler; - -static BOOL sub_0200D11C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5, int param6); -static BOOL sub_0200D18C(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, int param4, int param5, int param6); -static BOOL sub_0200D1FC(SpriteResourceList *param0, SpriteResource *param1); -static BOOL sub_0200D27C(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); -static BOOL sub_0200D2D0(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); -static BOOL sub_0200D230(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); - -SpriteRenderer *sub_0200C6E4(int param0) -{ - SpriteRenderer *v0 = NULL; - - v0 = Heap_AllocFromHeap(param0, sizeof(SpriteRenderer)); - - if (v0 == NULL) { - return NULL; - } - - v0->unk_00 = param0; - v0->unk_04 = 0; - v0->unk_08 = 1; - - return v0; -} - -SpriteGfxHandler *sub_0200C704(SpriteRenderer *param0) -{ - int v0; - SpriteGfxHandler *v1 = NULL; - - GF_ASSERT(param0 != NULL); - - v1 = Heap_AllocFromHeap(param0->unk_00, sizeof(SpriteGfxHandler)); - - if (v1 == NULL) { - return NULL; - } - - param0->unk_04++; - - for (v0 = 0; v0 < 6; v0++) { - v1->unk_0C[v0] = NULL; - } - - return v1; -} - -UnkStruct_0200C738 *sub_0200C738(SpriteRenderer *param0) -{ - return ¶m0->unk_10; -} - -BOOL sub_0200C73C(SpriteRenderer *param0, const UnkStruct_ov104_0224133C *param1, const UnkStruct_ov104_022412F4 *param2, int param3) -{ - GF_ASSERT(param0 != NULL); - - if (param0 == NULL) { - return 0; - } - - { - UnkStruct_ov22_022559F8 v0; - - v0.unk_00 = param2->unk_00; - v0.unk_04 = param2->unk_04; - v0.unk_08 = param2->unk_08; - v0.unk_0C = param0->unk_00; - - sub_0201E88C(&v0, param2->unk_0C, param2->unk_10); - } - - sub_0201F834(param3, param0->unk_00); - NNS_G2dInitOamManagerModule(); - - if (param0->unk_08 == 1) { - sub_0200A784(param1->unk_00, param1->unk_04, param1->unk_08, param1->unk_0C, param1->unk_10, param1->unk_14, param1->unk_18, param1->unk_1C, param0->unk_00); - } - - param0->unk_0C = sub_0201DCC8(32, param0->unk_00); - - sub_0201E994(); - sub_0201F8E4(); - - return 1; -} - -BOOL sub_0200C7C0(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2) -{ - if ((param0 == NULL) || (param1 == NULL)) { - return 0; - } - - param1->unk_00 = sub_020095C4(param2, ¶m0->unk_10, param0->unk_00); - return 1; -} - -void sub_0200C7E4(CellActor *param0) -{ - CellActor_Delete(param0); -} - -void sub_0200C7EC(SpriteGfxHandler *param0) -{ - GF_ASSERT(param0 != NULL); - CellActorCollection_Update(param0->unk_00); -} - -void OAMManager_ApplyAndResetBuffers(void) -{ - sub_0200A858(); -} - -void sub_0200C808(void) -{ - sub_0201DCE8(); -} - -void sub_0200C810(SpriteGfxHandler *param0) -{ - CellActorCollection_Delete(param0->unk_00); -} - -void sub_0200C81C(SpriteGfxHandler *param0) -{ - if (param0->unk_04 == NULL) { - return; - } - - sub_020095A8(param0->unk_04); -} - -void sub_0200C82C(SpriteGfxHandler *param0) -{ - int v0; - SpriteResourceTable *v1; - - for (v0 = 0; v0 < param0->unk_54; v0++) { - v1 = SpriteResourceTable_GetArrayElement(param0->unk_08, v0); - SpriteResourceTable_Clear(v1); - } - - Heap_FreeToHeap(param0->unk_08); - sub_0200A508(param0->unk_24[0]); - sub_0200A700(param0->unk_24[1]); - - for (v0 = 0; v0 < param0->unk_54; v0++) { - SpriteResourceList_Delete(param0->unk_24[v0]); - SpriteResourceCollection_Delete(param0->unk_0C[v0]); - } -} - -void sub_0200C880(SpriteRenderer *param0) -{ - sub_0201DCF0(param0->unk_0C); - sub_0201E958(); - sub_0201F8B4(); - - if (param0->unk_08 == 1) { - sub_0200A878(); - } -} - -void sub_0200C8A0(SpriteRenderer *param0, SpriteGfxHandler *param1) -{ - param0->unk_04--; - Heap_FreeToHeap(param1); -} - -void sub_0200C8B0(SpriteRenderer *param0, SpriteGfxHandler *param1) -{ - sub_0200C810(param1); - sub_0200C81C(param1); - sub_0200C82C(param1); - sub_0200C8A0(param0, param1); -} - -void sub_0200C8D4(SpriteRenderer *param0) -{ - GF_ASSERT(param0->unk_04 == 0); - - sub_0200C880(param0); - Heap_FreeToHeap(param0); -} - -BOOL LoadSpriteResourceData(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const SpriteResourceDataPath *resourcePaths) -{ - int entryIndex; - int numEntries = 6; - int size; - SpriteResourceTable *resourceTable; - void *resourceEntryData; - - if ((renderer == NULL) || (gfxHandler == NULL)) { - return 0; - } - - if (resourcePaths->paths.multiCellsDataPath == NULL) { - numEntries = 6 - 2; - } - - gfxHandler->unk_54 = numEntries; - size = SpriteResourceTable_Size(); - gfxHandler->unk_08 = Heap_AllocFromHeap(renderer->unk_00, size * numEntries); - - for (entryIndex = 0; entryIndex < numEntries; entryIndex++) { - resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->unk_08, entryIndex); - resourceEntryData = ReadFileToHeap(renderer->unk_00, resourcePaths->val1[entryIndex]); - - SpriteResourceTable_LoadFromBinary(resourceEntryData, resourceTable, renderer->unk_00); - Heap_FreeToHeap(resourceEntryData); - } - - for (entryIndex = 0; entryIndex < numEntries; entryIndex++) { - resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->unk_08, entryIndex); - size = SpriteResourceTable_GetCount(resourceTable); - - gfxHandler->unk_0C[entryIndex] = SpriteResourceCollection_New(size, entryIndex, renderer->unk_00); - } - - for (entryIndex = 0; entryIndex < numEntries; entryIndex++) { - resourceTable = SpriteResourceTable_GetArrayElement(gfxHandler->unk_08, entryIndex); - size = SpriteResourceTable_GetCount(resourceTable); - - gfxHandler->unk_24[entryIndex] = SpriteResourceList_New(size, renderer->unk_00); - gfxHandler->unk_3C[entryIndex] = SpriteResourceCollection_Extend(gfxHandler->unk_0C[entryIndex], resourceTable, gfxHandler->unk_24[entryIndex], renderer->unk_00); - } - - sub_0200A368(gfxHandler->unk_24[0]); - sub_0200A60C(gfxHandler->unk_24[1]); - - resourceEntryData = ReadFileToHeap(renderer->unk_00, resourcePaths->paths.combinedResourceDataPath); - gfxHandler->unk_04 = sub_02009508(resourceEntryData, renderer->unk_00, gfxHandler->unk_0C[0], gfxHandler->unk_0C[1], gfxHandler->unk_0C[2], gfxHandler->unk_0C[3], gfxHandler->unk_0C[4], gfxHandler->unk_0C[5]); - - Heap_FreeToHeap(resourceEntryData); - return 1; -} - -CellActor *sub_0200CA08(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov7_0224F358 *param2) -{ - CellActor *v0 = NULL; - - v0 = sub_0200CA44(param0, param1, param2->unk_00, param2->unk_04, param2->unk_06, param2->unk_04, param2->unk_0A, param2->unk_0C, param2->unk_10, param2->unk_14, param2->unk_18, param2->unk_1C, param2->unk_20, param2->unk_24); - return v0; -} - -CellActor *sub_0200CA44(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13) -{ - CellActor *v0 = NULL; - CellActorInitParamsEx v1; - - v1.collection = param1->unk_00; - v1.resourceData = ¶m1->unk_04->unk_00[param2]; - v1.position.x = FX32_CONST(param3); - v1.position.y = FX32_CONST(param4); - v1.position.z = FX32_CONST(param5); - - if (param9 == NNS_G2D_VRAM_TYPE_2DSUB) { - v1.position.y += (192 << FX32_SHIFT); - } - - v1.affineScale.x = FX32_ONE; - v1.affineScale.y = FX32_ONE; - v1.affineScale.z = FX32_ONE; - v1.affineZRotation = 0; - v1.priority = param7; - v1.vramType = param9; - v1.heapID = param0->unk_00; - - v0 = CellActorCollection_AddEx(&v1); - - if (v0 != NULL) { - CellActor_SetAnim(v0, param6); - CellActor_SetExplicitPalette(v0, param8); - } - - return v0; -} - -BOOL sub_0200CB30(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov104_02241308 *param2) -{ - int v0; - int v1; - int v2 = 6; - int v3; - SpriteResourceTable *v4; - - if ((param0 == NULL) || (param1 == NULL)) { - return 0; - } - - if ((param2->val2.unk_10 == 0) || (param2->val2.unk_14 == 0)) { - v2 = 6 - 2; - } - - param1->unk_54 = v2; - - for (v0 = 0; v0 < v2; v0++) { - param1->unk_0C[v0] = SpriteResourceCollection_New(param2->val1[v0], v0, param0->unk_00); - } - - for (v0 = 0; v0 < v2; v0++) { - v3 = param2->val1[v0]; - - if (v3 == 0) { - continue; - } - - param1->unk_24[v0] = SpriteResourceList_New(v3, param0->unk_00); - param1->unk_3C[v0] = 0; - - for (v1 = 0; v1 < param1->unk_24[v0]->capacity; v1++) { - param1->unk_24[v0]->resources[v1] = NULL; - } - } - - return 1; -} - -BOOL sub_0200CBDC(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6) -{ - SpriteResource *v0; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[0], param6) == 0) { - return 0; - } - - v0 = SpriteResourceCollection_AddTiles(param1->unk_0C[0], param2, param3, param4, param6, param5, param0->unk_00); - - if (v0 != NULL) { - sub_0200A3DC(v0); - sub_0200D1FC(param1->unk_24[0], v0); - - return 1; - } - - GF_ASSERT(0); - - return (v0 == NULL) ? 0 : 1; -} - -BOOL SpriteRenderer_LoadCharResObjFromOpenNarc(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5, int param6) -{ - SpriteResource *v0; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[0], param6) == 0) { - return 0; - } - - v0 = SpriteResourceCollection_AddTilesFrom(param1->unk_0C[0], param2, param3, param4, param6, param5, param0->unk_00); - - if (v0 != NULL) { - sub_0200A3DC(v0); - sub_0200D1FC(param1->unk_24[0], v0); - return 1; - } - - GF_ASSERT(0); - - return (v0 == NULL) ? 0 : 1; -} - -s8 sub_0200CC9C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5, int param6, int param7) -{ - SpriteResource *v0; - int v1; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[1], param7) == 0) { - return -1; - } - - v0 = SpriteResourceCollection_AddPalette(param1->unk_0C[1], param2, param3, param4, param7, param6, param5, param0->unk_00); - - if (v0 != NULL) { - v1 = sub_0200A640(v0); - GF_ASSERT(v1 == 1); - - sub_0200D1FC(param1->unk_24[1], v0); - return sub_0200A760(v0, param6); - } - - GF_ASSERT(0); - - return -1; -} - -s8 sub_0200CD0C(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, int param4, int param5, int param6, int param7) -{ - SpriteResource *v0; - int v1; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[1], param7) == 0) { - return -1; - } - - v0 = SpriteResourceCollection_AddPaletteFrom(param1->unk_0C[1], param2, param3, param4, param7, param6, param5, param0->unk_00); - - if (v0 != NULL) { - v1 = sub_0200A640(v0); - GF_ASSERT(v1 == 1); - sub_0200D1FC(param1->unk_24[1], v0); - - return sub_0200A760(v0, param6); - } - - GF_ASSERT(0); - return -1; -} - -u8 sub_0200CD7C(PaletteData *param0, int param1, SpriteRenderer *param2, SpriteGfxHandler *param3, int param4, int param5, int param6, int param7, int param8, int param9) -{ - int v0; - - v0 = sub_0200CC9C(param2, param3, param4, param5, param6, param7, param8, param9); - - if (v0 != -1) { - PaletteData_LoadBufferFromHardware(param0, param1, v0 * 16, param7 * 0x20); - } - - return v0; -} - -u8 SpriteRenderer_LoadPalette(PaletteData *param0, enum PaletteBufferID param1, SpriteRenderer *param2, SpriteGfxHandler *param3, NARC *param4, int param5, BOOL param6, int param7, int param8, int param9) -{ - int v0; - - v0 = sub_0200CD0C(param2, param3, param4, param5, param6, param7, param8, param9); - - if (v0 != -1) { - PaletteData_LoadBufferFromHardware(param0, param1, v0 * 16, param7 * 0x20); - } - - return v0; -} - -BOOL sub_0200CE0C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5) -{ - return sub_0200D11C(param0, param1, param2, param3, param4, 2, param5); -} - -BOOL SpriteRenderer_LoadCellResObjFromOpenNarc(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5) -{ - return sub_0200D18C(param0, param1, param2, param3, param4, 2, param5); -} - -BOOL sub_0200CE3C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5) -{ - return sub_0200D11C(param0, param1, param2, param3, param4, 3, param5); -} - -BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5) -{ - return sub_0200D18C(param0, param1, param2, param3, param4, 3, param5); -} - -CellActorData *SpriteActor_LoadResources(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteTemplate *param2) -{ - int v0; - int v1; - CellActorData *v2 = NULL; - CellActorInitParamsEx v3; - int v4[6]; - - v2 = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorData)); - - if (v2 == NULL) { - return NULL; - } - - v2->unk_08 = Heap_AllocFromHeap(param0->unk_00, sizeof(UnkStruct_02009508)); - - if (v2->unk_08 == NULL) { - return NULL; - } - - v2->unk_08->unk_00 = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceData)); - v2->unk_04 = v2->unk_08->unk_00; - - if (v2->unk_08->unk_00 == NULL) { - if (v2->unk_08) { - Heap_FreeToHeap(v2->unk_08); - } - - return NULL; - } - - for (v0 = 0; v0 < 6; v0++) { - v4[v0] = param2->resources[v0]; - } - - if ((param1->unk_0C[4] == NULL) || (param1->unk_0C[5] == NULL)) { - v4[4] = 0xffffffff; - v4[5] = 0xffffffff; - } else { - if ((v4[4] != 0xffffffff) && (SpriteResourceCollection_IsIDUnused(param1->unk_0C[4], v4[4]) == 0)) { - v4[4] = 0xffffffff; - } - - if ((v4[5] != 0xffffffff) && (SpriteResourceCollection_IsIDUnused(param1->unk_0C[5], v4[5]) == 0)) { - v4[5] = 0xffffffff; - } - } - - sub_020093B4(v2->unk_04, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param2->transferToVRAM, param2->bgPriority, param1->unk_0C[0], param1->unk_0C[1], param1->unk_0C[2], param1->unk_0C[3], param1->unk_0C[4], param1->unk_0C[5]); - - v3.collection = param1->unk_00; - v3.resourceData = v2->unk_04; - v3.position.x = FX32_CONST(param2->x); - v3.position.y = FX32_CONST(param2->y); - v3.position.z = FX32_CONST(param2->z); - - if (param2->vramType == NNS_G2D_VRAM_TYPE_2DSUB) { - v3.position.y += (192 << FX32_SHIFT); - } - - v3.affineScale.x = FX32_ONE; - v3.affineScale.y = FX32_ONE; - v3.affineScale.z = FX32_ONE; - v3.affineZRotation = 0; - v3.priority = param2->priority; - v3.vramType = param2->vramType; - v3.heapID = param0->unk_00; - v2->unk_00 = CellActorCollection_AddEx(&v3); - v2->unk_0C = param2->transferToVRAM; - - if (v2->unk_00 != NULL) { - v1 = CellActor_GetExplicitPalette(v2->unk_00); - - CellActor_SetAnim(v2->unk_00, param2->animIdx); - CellActor_SetExplicitPalette(v2->unk_00, v1 + param2->plttIdx); - } else { - GF_ASSERT(FALSE); - } - - return v2; -} - -const NNSG2dImagePaletteProxy *sub_0200D04C(SpriteGfxHandler *param0, int param1) -{ - SpriteResource *v0 = SpriteResourceCollection_Find(param0->unk_0C[1], param1); - return sub_0200A72C(v0, NULL); -} - -u32 sub_0200D05C(SpriteGfxHandler *param0, int param1, NNS_G2D_VRAM_TYPE param2) -{ - SpriteResource *v0 = SpriteResourceCollection_Find(param0->unk_0C[1], param1); - return sub_0200A760(v0, param2); -} - -BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *param0, int param1) -{ - return sub_0200D27C(param0->unk_0C[0], param0->unk_24[0], param1); -} - -BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler *param0, int param1) -{ - return sub_0200D2D0(param0->unk_0C[1], param0->unk_24[1], param1); -} - -BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler *param0, int param1) -{ - return sub_0200D230(param0->unk_0C[2], param0->unk_24[2], param1); -} - -BOOL SpriteGfxHandler_UnloadAnimObjById(SpriteGfxHandler *param0, int param1) -{ - return sub_0200D230(param0->unk_0C[3], param0->unk_24[3], param1); -} - -void sub_0200D0B0(SpriteRenderer *param0, SpriteGfxHandler *param1) -{ - int v0; - - sub_0200C810(param1); - sub_0200A508(param1->unk_24[0]); - sub_0200A700(param1->unk_24[1]); - - for (v0 = 0; v0 < param1->unk_54; v0++) { - SpriteResourceList_Delete(param1->unk_24[v0]); - SpriteResourceCollection_Delete(param1->unk_0C[v0]); - } - - sub_0200C8A0(param0, param1); -} - -void sub_0200D0F4(CellActorData *param0) -{ - if (param0->unk_0C) { - sub_0200A5B4(param0->unk_04->imageProxy); - } - - CellActor_Delete(param0->unk_00); - sub_020095A8(param0->unk_08); - Heap_FreeToHeap(param0); -} - -static BOOL sub_0200D11C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5, int param6) -{ - SpriteResource *v0; - int v1; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[param5], param6) == 0) { - return 0; - } - - v0 = SpriteResourceCollection_Add(param1->unk_0C[param5], param2, param3, param4, param6, param5, param0->unk_00); - - if (v0 != NULL) { - v1 = sub_0200D1FC(param1->unk_24[param5], v0); - - GF_ASSERT(v1 == 1); - return v1; - } - - GF_ASSERT(0); - return (v0 == NULL) ? 0 : 1; -} - -static BOOL sub_0200D18C(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, int param4, int param5, int param6) -{ - SpriteResource *v0; - int v1; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[param5], param6) == 0) { - return 0; - } - - v0 = SpriteResourceCollection_AddFrom(param1->unk_0C[param5], param2, param3, param4, param6, param5, param0->unk_00); - - if (v0 != NULL) { - v1 = sub_0200D1FC(param1->unk_24[param5], v0); - - GF_ASSERT(v1 == 1); - return v1; - } - - GF_ASSERT(0); - - return (v0 == NULL) ? 0 : 1; -} - -static BOOL sub_0200D1FC(SpriteResourceList *param0, SpriteResource *param1) -{ - int v0; - - for (v0 = 0; v0 < param0->capacity; v0++) { - if (param0->resources[v0] != NULL) { - continue; - } - - param0->resources[v0] = param1; - param0->count++; - - return 1; - } - - return 0; -} - -static BOOL sub_0200D230(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2) -{ - int v0; - int v1; - - for (v0 = 0; v0 < param1->capacity; v0++) { - if (param1->resources[v0] == NULL) { - continue; - } - - v1 = SpriteResource_GetID(param1->resources[v0]); - - if (v1 == param2) { - SpriteResourceCollection_Remove(param0, param1->resources[v0]); - - param1->resources[v0] = NULL; - param1->count--; - - return 1; - } - } - - return 0; -} - -static BOOL sub_0200D27C(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2) -{ - int v0; - int v1; - - for (v0 = 0; v0 < param1->capacity; v0++) { - if (param1->resources[v0] == NULL) { - continue; - } - - v1 = SpriteResource_GetID(param1->resources[v0]); - - if (v1 == param2) { - sub_0201EB50(param2); - SpriteResourceCollection_Remove(param0, param1->resources[v0]); - - param1->resources[v0] = NULL; - param1->count--; - - return 1; - } - } - - return 0; -} - -static BOOL sub_0200D2D0(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2) -{ - int v0; - int v1; - - for (v0 = 0; v0 < param1->capacity; v0++) { - if (param1->resources[v0] == NULL) { - continue; - } - - v1 = SpriteResource_GetID(param1->resources[v0]); - - if (v1 == param2) { - sub_0201F9F0(param2); - SpriteResourceCollection_Remove(param0, param1->resources[v0]); - - param1->resources[v0] = NULL; - param1->count--; - - return 1; - } - } - - return 0; -} - -void SpriteActor_UpdateObject(CellActor *param0) -{ - CellActor_UpdateAnim(param0, FX32_ONE); -} - -void sub_0200D330(CellActorData *param0) -{ - SpriteActor_UpdateObject(param0->unk_00); -} - -void sub_0200D33C(CellActorData *param0) -{ - CellActor_UpdateAnim(param0->unk_00, FX32_CONST(2)); -} - -void sub_0200D34C(CellActorData *param0, fx32 param1) -{ - CellActor_UpdateAnim(param0->unk_00, param1); -} - -u32 sub_0200D358(CellActorData *param0) -{ - return CellActor_GetAnimCount(param0->unk_00); -} - -void sub_0200D364(CellActorData *param0, u32 param1) -{ - CellActor_SetAnim(param0->unk_00, param1); -} - -void sub_0200D370(CellActorData *param0, u32 param1) -{ - CellActor_SetAnimNoRestart(param0->unk_00, param1); -} - -u32 sub_0200D37C(CellActorData *param0) -{ - return CellActor_GetActiveAnim(param0->unk_00); -} - -void sub_0200D388(CellActor *param0, int param1) -{ - CellActor_SetAnimateFlag(param0, param1); -} - -void sub_0200D390(CellActorData *param0, int param1) -{ - sub_0200D388(param0->unk_00, param1); -} - -void sub_0200D39C(CellActor *param0, fx32 param1) -{ - CellActor_SetAnimSpeed(param0, param1); -} - -void sub_0200D3A4(CellActorData *param0, fx32 param1) -{ - sub_0200D39C(param0->unk_00, param1); -} - -BOOL sub_0200D3B0(CellActor *param0) -{ - return CellActor_IsAnimated(param0); -} - -BOOL sub_0200D3B8(CellActorData *param0) -{ - return sub_0200D3B0(param0->unk_00); -} - -void sub_0200D3C4(CellActor *param0, u16 param1) -{ - SpriteActor_SetAnimFrame(param0, param1); -} - -void sub_0200D3CC(CellActorData *param0, u16 param1) -{ - sub_0200D3C4(param0->unk_00, param1); -} - -u16 sub_0200D3D8(CellActor *param0) -{ - return CellActor_GetAnimFrame(param0); -} - -u16 sub_0200D3E0(CellActorData *param0) -{ - return sub_0200D3D8(param0->unk_00); -} - -void SpriteActor_DrawSprite(CellActor *param0, int param1) -{ - CellActor_SetDrawFlag(param0, param1); -} - -void SpriteActor_EnableObject(CellActorData *param0, int param1) -{ - SpriteActor_DrawSprite(param0->unk_00, param1); -} - -int sub_0200D400(CellActor *param0) -{ - return CellActor_GetDrawFlag(param0); -} - -int sub_0200D408(CellActorData *param0) -{ - return sub_0200D400(param0->unk_00); -} - -void sub_0200D414(CellActor *param0, int param1) -{ - CellActor_SetExplicitPalette(param0, param1); -} - -void sub_0200D41C(CellActorData *param0, int param1) -{ - sub_0200D414(param0->unk_00, param1); -} - -void sub_0200D428(CellActor *param0, int param1) -{ - CellActor_SetExplicitPaletteOffset(param0, param1); -} - -void sub_0200D430(CellActorData *param0, int param1) -{ - sub_0200D428(param0->unk_00, param1); -} - -int sub_0200D43C(CellActorData *param0) -{ - return CellActor_GetExplicitPaletteOffset(param0->unk_00); -} - -void sub_0200D448(CellActor *param0, int param1) -{ - CellActor_SetExplicitPriority(param0, param1); -} - -int sub_0200D454(CellActorData *param0) -{ - return CellActor_GetExplicitPriority(param0->unk_00); -} - -void sub_0200D460(CellActorData *param0, int param1) -{ - sub_0200D448(param0->unk_00, param1); -} - -void sub_0200D46C(CellActor *param0, int param1) -{ - CellActor_SetPriority(param0, param1); -} - -void sub_0200D474(CellActorData *param0, int param1) -{ - sub_0200D46C(param0->unk_00, param1); -} - -u32 sub_0200D480(CellActor *param0) -{ - return CellActor_GetPriority(param0); -} - -u32 sub_0200D488(CellActorData *param0) -{ - return sub_0200D480(param0->unk_00); -} - -void SpriteActor_SetPositionXY(CellActor *param0, s16 param1, s16 param2) -{ - VecFx32 v0; - - v0.x = param1 * FX32_ONE; - v0.y = param2 * FX32_ONE; - - if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { - v0.y += (192 << FX32_SHIFT); - } - - v0.z = 0; - - CellActor_SetPosition(param0, &v0); -} - -void SpriteActor_SetSpritePositionXY(CellActorData *param0, s16 param1, s16 param2) -{ - SpriteActor_SetPositionXY(param0->unk_00, param1, param2); -} - -void sub_0200D4D0(CellActor *param0, s16 param1, s16 param2, fx32 param3) -{ - VecFx32 v0; - - v0.x = param1 * FX32_ONE; - v0.y = param2 * FX32_ONE; - - if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { - v0.y += param3; - } - - v0.z = 0; - - CellActor_SetPosition(param0, &v0); -} - -void sub_0200D500(CellActorData *param0, s16 param1, s16 param2, fx32 param3) -{ - sub_0200D4D0(param0->unk_00, param1, param2, param3); -} - -void sub_0200D50C(CellActor *param0, s16 *param1, s16 *param2) -{ - const VecFx32 *v0; - - v0 = CellActor_GetPosition(param0); - *param1 = v0->x / FX32_ONE; - - if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { - *param2 = (v0->y - (192 << FX32_SHIFT)) / FX32_ONE; - } else { - *param2 = v0->y / FX32_ONE; - } -} - -void SpriteActor_GetSpritePositionXY(CellActorData *param0, s16 *param1, s16 *param2) -{ - sub_0200D50C(param0->unk_00, param1, param2); -} - -void sub_0200D55C(CellActor *param0, s16 *param1, s16 *param2, fx32 param3) -{ - const VecFx32 *v0; - - v0 = CellActor_GetPosition(param0); - *param1 = v0->x / FX32_ONE; - - if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { - *param2 = (v0->y - param3) / FX32_ONE; - } else { - *param2 = v0->y / FX32_ONE; - } -} - -void sub_0200D5A0(CellActorData *param0, s16 *param1, s16 *param2, fx32 param3) -{ - sub_0200D55C(param0->unk_00, param1, param2, param3); -} - -void sub_0200D5AC(CellActor *param0, s16 param1, s16 param2) -{ - const VecFx32 *v0; - VecFx32 v1; - - v0 = CellActor_GetPosition(param0); - - v1.x = v0->x + (param1 * FX32_ONE); - v1.y = v0->y + (param2 * FX32_ONE); - v1.z = v0->z; - - CellActor_SetPosition(param0, &v1); -} - -void sub_0200D5DC(CellActorData *param0, s16 param1, s16 param2) -{ - sub_0200D5AC(param0->unk_00, param1, param2); -} - -void sub_0200D5E8(CellActorData *param0, fx32 param1, fx32 param2) -{ - const VecFx32 *v0; - VecFx32 v1; - - v0 = CellActor_GetPosition(param0->unk_00); - - v1.x = v0->x + param1; - v1.y = v0->y + param2; - v1.z = v0->z; - - CellActor_SetPosition(param0->unk_00, &v1); -} - -void sub_0200D614(CellActorData *param0, fx32 param1, fx32 param2) -{ - const VecFx32 *v0; - VecFx32 v1; - - v0 = CellActor_GetPosition(param0->unk_00); - - v1.x = param1; - v1.y = param2; - v1.z = v0->z; - - CellActor_SetPosition(param0->unk_00, &v1); -} - -void sub_0200D638(CellActorData *param0, fx32 *param1, fx32 *param2) -{ - const VecFx32 *v0; - VecFx32 v1; - - v0 = CellActor_GetPosition(param0->unk_00); - - *param1 = v0->x; - *param2 = v0->y; -} - -void sub_0200D650(CellActorData *param0, fx32 param1, fx32 param2, fx32 param3) -{ - if (CellActor_GetVRamType(param0->unk_00) == NNS_G2D_VRAM_TYPE_2DSUB) { - sub_0200D614(param0, param1, param2 + param3); - } else { - sub_0200D614(param0, param1, param2); - } -} - -void sub_0200D67C(CellActorData *param0, fx32 *param1, fx32 *param2, fx32 param3) -{ - sub_0200D638(param0, param1, param2); - - if (CellActor_GetVRamType(param0->unk_00) == NNS_G2D_VRAM_TYPE_2DSUB) { - *param2 = *param2 - param3; - } -} - -void sub_0200D69C(CellActor *param0, int param1) -{ - CellActor_SetAffineOverwriteMode(param0, param1); -} - -void sub_0200D6A4(CellActorData *param0, int param1) -{ - sub_0200D69C(param0->unk_00, param1); -} - -void sub_0200D6B0(CellActor *param0, f32 param1, f32 param2) -{ - const VecFx32 *v0; - VecFx32 *v1; - - v0 = CellActor_GetAffineScale(param0); - v1 = (VecFx32 *)v0; - - v1->x = (param1 * FX32_ONE); - v1->y = (param2 * FX32_ONE); - - CellActor_SetAffineScale(param0, v1); -} - -void sub_0200D6E8(CellActorData *param0, f32 param1, f32 param2) -{ - sub_0200D6B0(param0->unk_00, param1, param2); -} - -void sub_0200D6F4(CellActor *param0, f32 param1, f32 param2) -{ - const VecFx32 *v0; - VecFx32 *v1; - - v0 = CellActor_GetAffineScale(param0); - v1 = (VecFx32 *)v0; - - v1->x = v0->x + (param1 * FX32_ONE); - v1->y = v0->y + (param2 * FX32_ONE); - - CellActor_SetAffineScale(param0, v1); -} - -void sub_0200D74C(CellActorData *param0, f32 param1, f32 param2) -{ - sub_0200D6F4(param0->unk_00, param1, param2); -} - -void sub_0200D758(CellActor *param0, f32 *param1, f32 *param2) -{ - const VecFx32 *v0; - VecFx32 *v1; - - v0 = CellActor_GetAffineScale(param0); - - *param1 = FX_FX32_TO_F32(v0->x); - *param2 = FX_FX32_TO_F32(v0->y); -} - -void sub_0200D788(CellActorData *param0, f32 *param1, f32 *param2) -{ - sub_0200D758(param0->unk_00, param1, param2); -} - -void sub_0200D794(CellActor *param0, u16 param1) -{ - CellActor_SetAffineZRotation(param0, param1); -} - -void sub_0200D79C(CellActorData *param0, u16 param1) -{ - sub_0200D794(param0->unk_00, param1); -} - -void sub_0200D7A8(CellActor *param0, s32 param1) -{ - u16 v0; - - v0 = CellActor_GetAffineZRotation(param0); - v0 += param1; - - CellActor_SetAffineZRotation(param0, v0); -} - -void sub_0200D7C0(CellActorData *param0, s32 param1) -{ - sub_0200D7A8(param0->unk_00, param1); -} - -void sub_0200D7CC(CellActor *param0, int param1) -{ - CellActor_SetFlipMode(param0, param1); -} - -void sub_0200D7D4(CellActorData *param0, int param1) -{ - sub_0200D7CC(param0->unk_00, param1); -} - -void sub_0200D7E0(CellActorData *param0, s16 param1, s16 param2) -{ - VecFx32 v0; - - v0.x = param1 << FX32_SHIFT; - v0.y = param2 << FX32_SHIFT; - v0.z = 0; - - CellActor_SetAffineTranslation(param0->unk_00, &v0); -} - -void sub_0200D7FC(CellActorData *param0, BOOL param1) -{ - CellActor_SetPixelated(param0->unk_00, param1); -} - -void sub_0200D808(CellActor *param0, GXOamMode param1) -{ - CellActor_SetExplicitOAMMode(param0, param1); -} - -void SpriteActor_SetOAMMode(CellActorData *param0, GXOamMode param1) -{ - sub_0200D808(param0->unk_00, param1); -} - -u32 sub_0200D81C(CellActorData *param0) -{ - return CellActor_GetUserAttrForCurrentAnimFrame(param0->unk_00); -} - -BOOL sub_0200D828(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6) -{ - SpriteResource *v0; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[0], param6) == 0) { - return 0; - } - - v0 = SpriteResourceCollection_AddTiles(param1->unk_0C[0], param2, param3, param4, param6, param5, param0->unk_00); - - if (v0 != NULL) { - sub_0200A39C(v0); - sub_0200D1FC(param1->unk_24[0], v0); - - return 1; - } - - GF_ASSERT(0); - - return (v0 == NULL) ? 0 : 1; -} - -BOOL sub_0200D888(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6) -{ - SpriteResource *v0; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[0], param6) == 0) { - return 0; - } - - v0 = SpriteResourceCollection_AddTiles(param1->unk_0C[0], param2, param3, param4, param6, param5, param0->unk_00); - - if (v0 != NULL) { - sub_0200A450(v0); - sub_0200D1FC(param1->unk_24[0], v0); - - return 1; - } - - GF_ASSERT(0); - - return (v0 == NULL) ? 0 : 1; -} - -BOOL sub_0200D8E8(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5, int param6) -{ - SpriteResource *v0; - - if (SpriteResourceCollection_IsIDUnused(param1->unk_0C[0], param6) == 0) { - return 0; - } - - v0 = SpriteResourceCollection_AddTilesFrom(param1->unk_0C[0], param2, param3, param4, param6, param5, param0->unk_00); - - if (v0 != NULL) { - sub_0200A450(v0); - sub_0200D1FC(param1->unk_24[0], v0); - - return 1; - } - - GF_ASSERT(0); - - return (v0 == NULL) ? 0 : 1; -} - -void sub_0200D948(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5) -{ - SpriteResource *v0; - - v0 = SpriteResourceCollection_Find(param1->unk_0C[0], param5); - - SpriteResourceCollection_ModifyTiles(param1->unk_0C[0], v0, param2, param3, param4, param0->unk_00); - sub_0200A4C0(v0); -} - -void sub_0200D97C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5) -{ - SpriteResource *v0; - - v0 = SpriteResourceCollection_Find(param1->unk_0C[1], param5); - - SpriteResourceCollection_ModifyPalette(param1->unk_0C[1], v0, param2, param3, param4, param0->unk_00); - sub_0200A6B8(v0); -} - -CellActorCollection *sub_0200D9B0(SpriteGfxHandler *param0) -{ - return param0->unk_00; -} - -void sub_0200D9B4(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5) -{ - SpriteResource *v0; - - v0 = SpriteResourceCollection_Find(param1->unk_0C[0], param5); - - SpriteResourceCollection_ModifyTilesFrom(param1->unk_0C[0], v0, param2, param3, param4, param0->unk_00); - sub_0200A4C0(v0); -} diff --git a/src/unk_0205CA94.c b/src/unk_0205CA94.c index 9679b38cd6..12db03b95d 100644 --- a/src/unk_0205CA94.c +++ b/src/unk_0205CA94.c @@ -3,9 +3,6 @@ #include #include -#include "struct_defs/struct_02009508.h" -#include "struct_defs/struct_0200C738.h" - #include "field/field_system.h" #include "bg_window.h" @@ -16,6 +13,7 @@ #include "map_object.h" #include "player_avatar.h" #include "save_player.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "sys_task_manager.h" #include "trainer_info.h" @@ -27,11 +25,11 @@ typedef struct { CellActorCollection *unk_00; - UnkStruct_02009508 *unk_04; + CellActorResourceDataList *unk_04; SpriteResourceCollection *unk_08[4]; SpriteResourceList *unk_18[2]; int unk_20[4]; - UnkStruct_0200C738 unk_30; + GF_G2dRenderer unk_30; } UnkStruct_0205D094; typedef struct UnkStruct_0205D3AC_t { @@ -562,7 +560,7 @@ static CellActor *sub_0205D344(UnkStruct_0205D094 *param0, int param1, VecFx32 * memset(&v0, 0, sizeof(CellActorInitParamsEx)); v0.collection = param0->unk_00; - v0.resourceData = ¶m0->unk_04->unk_00[param1]; + v0.resourceData = ¶m0->unk_04->resourceDataList[param1]; v0.position = *param2; v0.affineScale = v2; v0.priority = param3; diff --git a/src/unk_0206A780.c b/src/unk_0206A780.c index 9248b86844..5b5c80ab02 100644 --- a/src/unk_0206A780.c +++ b/src/unk_0206A780.c @@ -12,7 +12,7 @@ #include "cell_actor.h" #include "heap.h" #include "narc.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" static const SpriteTemplate Unk_020EFA04[] = { { @@ -76,7 +76,7 @@ void sub_0206A844(UnkStruct_0206A844 *param0) for (v0 = 0; v0 < 2; v0++) { if (param0->unk_1C8[v0] != NULL) { - sub_0200D0F4(param0->unk_1C8[v0]); + CellActorData_Delete(param0->unk_1C8[v0]); } } @@ -90,7 +90,7 @@ void sub_0206A870(UnkStruct_0206A844 *param0) for (v0 = 0; v0 < 2; v0++) { if (param0->unk_1C8[v0] != NULL) { - CellActor_UpdateAnim(param0->unk_1C8[v0]->unk_00, FX32_ONE); + CellActor_UpdateAnim(param0->unk_1C8[v0]->cellActor, FX32_ONE); } } @@ -99,8 +99,8 @@ void sub_0206A870(UnkStruct_0206A844 *param0) void sub_0206A8A0(UnkStruct_0206A844 *param0, s16 param1, s16 param2, s16 param3) { - SpriteActor_SetSpritePositionXY(param0->unk_1C8[0], param1, param2); - SpriteActor_SetSpritePositionXY(param0->unk_1C8[1], param1, param3); + CellActorData_SetPositionXY(param0->unk_1C8[0], param1, param2); + CellActorData_SetPositionXY(param0->unk_1C8[1], param1, param3); } void sub_0206A8C4(UnkStruct_0206A844 *param0, u16 param1, BOOL param2) @@ -109,5 +109,5 @@ void sub_0206A8C4(UnkStruct_0206A844 *param0, u16 param1, BOOL param2) return; } - SpriteActor_EnableObject(param0->unk_1C8[param1], param2); + CellActorData_DrawSprite(param0->unk_1C8[param1], param2); } diff --git a/src/unk_0206F314.c b/src/unk_0206F314.c index 6334e66a6a..4f4f75cb2f 100644 --- a/src/unk_0206F314.c +++ b/src/unk_0206F314.c @@ -28,12 +28,12 @@ #include "render_window.h" #include "save_player.h" #include "savedata.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" #include "text.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0202E840.h" typedef struct { @@ -348,7 +348,7 @@ static int sub_0206F554(UnkStruct_0206F7F8 *param0) if (param0->unk_28 > 0) { Sound_PlayEffect(1500); --param0->unk_28; - SpriteActor_SetSpritePositionXY(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); + CellActorData_SetPositionXY(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); } } @@ -356,7 +356,7 @@ static int sub_0206F554(UnkStruct_0206F7F8 *param0) if (param0->unk_28 < (param0->unk_21 - 1)) { Sound_PlayEffect(1500); ++param0->unk_28; - SpriteActor_SetSpritePositionXY(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); + CellActorData_SetPositionXY(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); } } @@ -386,7 +386,7 @@ static int sub_0206F658(UnkStruct_0206F7F8 *param0) case 0: Window_FillTilemap(¶m0->unk_E4, ((15 << 4) | 15)); param0->unk_1E = Text_AddPrinterWithParamsAndColor(¶m0->unk_E4, FONT_MESSAGE, param0->unk_2C.unk_68[1], 0, 0, param0->unk_1A, TEXT_COLOR(1, 2, 15), NULL); - sub_0200D41C(param0->unk_2FC[0], 2); + CellActorData_SetExplicitPalette(param0->unk_2FC[0], 2); param0->unk_0C++; break; case 1: @@ -410,12 +410,12 @@ static int sub_0206F658(UnkStruct_0206F7F8 *param0) case 3: param0->unk_328->unk_04 = 0; sub_02070050(param0, 1); - sub_0200D41C(param0->unk_2FC[0], 1); + CellActorData_SetExplicitPalette(param0->unk_2FC[0], 1); param0->unk_0C = 0; return 6; case 0xFF: sub_0206FFB4(param0); - sub_0200D41C(param0->unk_2FC[0], 1); + CellActorData_SetExplicitPalette(param0->unk_2FC[0], 1); param0->unk_0C = 0; return 6; } @@ -432,7 +432,7 @@ static int sub_0206F748(UnkStruct_0206F7F8 *param0) Sound_PlayEffect(1522); Window_FillTilemap(¶m0->unk_E4, ((15 << 4) | 15)); param0->unk_1E = Text_AddPrinterWithParamsAndColor(¶m0->unk_E4, FONT_MESSAGE, param0->unk_2C.unk_68[2], 0, 0, param0->unk_1A, TEXT_COLOR(1, 2, 15), NULL); - sub_0200D41C(param0->unk_2FC[0], 2); + CellActorData_SetExplicitPalette(param0->unk_2FC[0], 2); param0->unk_0C++; break; case 1: @@ -449,7 +449,7 @@ static int sub_0206F748(UnkStruct_0206F7F8 *param0) Sound_PlayEffect(1500); sub_0206FFB4(param0); - sub_0200D41C(param0->unk_2FC[0], 1); + CellActorData_SetExplicitPalette(param0->unk_2FC[0], 1); param0->unk_0C = 0; return 6; } @@ -658,7 +658,7 @@ static void sub_0206FCC4(UnkStruct_0206F7F8 *param0) param0->unk_2FC[v0] = ov5_021D3584(¶m0->unk_134, &v2[v0]); } - SpriteActor_EnableObject(param0->unk_2FC[1], 0); + CellActorData_DrawSprite(param0->unk_2FC[1], 0); } static void sub_0206FD94(UnkStruct_0206F7F8 *param0) @@ -667,7 +667,7 @@ static void sub_0206FD94(UnkStruct_0206F7F8 *param0) for (v0 = 0; v0 < 2; v0++) { if (param0->unk_2FC[v0] != NULL) { - sub_0200D0F4(param0->unk_2FC[v0]); + CellActorData_Delete(param0->unk_2FC[v0]); } } @@ -705,7 +705,7 @@ static void sub_0206FDC0(UnkStruct_0206F7F8 *param0, u16 param1, u16 param2) Window_DrawMessageBoxWithScrollCursor(¶m0->unk_E4, 1, (1024 - (18 + 12)), 10); Window_FillTilemap(¶m0->unk_E4, ((15 << 4) | 15)); Text_AddPrinterWithParamsAndColor(¶m0->unk_E4, FONT_MESSAGE, param0->unk_2C.unk_10, 0, 0, TEXT_SPEED_INSTANT, TEXT_COLOR(1, 2, 15), NULL); - SpriteActor_EnableObject(param0->unk_2FC[0], 1); + CellActorData_DrawSprite(param0->unk_2FC[0], 1); Bg_ScheduleTilemapTransfer(param0->unk_D0, 3); } @@ -716,7 +716,7 @@ static void sub_0206FF10(UnkStruct_0206F7F8 *param0) Window_ClearAndCopyToVRAM(&(param0->unk_D4)); Window_EraseStandardFrame(&(param0->unk_D4), 0); Window_Remove(&(param0->unk_D4)); - SpriteActor_EnableObject(param0->unk_2FC[0], 0); + CellActorData_DrawSprite(param0->unk_2FC[0], 0); Bg_ScheduleTilemapTransfer(param0->unk_D0, 3); } @@ -732,7 +732,7 @@ static void sub_0206FF60(ListMenu *param0, u32 param1, u8 param2) ListMenu_GetListAndCursorPos(param0, &v0, &v1); v2 = ListMenu_GetAttribute(param0, 2); - SpriteActor_SetSpritePositionXY(v3->unk_2FC[0], 126, 16 + 16 * (v1 + v0)); + CellActorData_SetPositionXY(v3->unk_2FC[0], 126, 16 + 16 * (v1 + v0)); } static void sub_0206FFB4(UnkStruct_0206F7F8 *param0) @@ -744,15 +744,15 @@ static void sub_0206FFB4(UnkStruct_0206F7F8 *param0) static void sub_0206FFE4(UnkStruct_0206F7F8 *param0) { sub_0206FFB4(param0); - SpriteActor_SetSpritePositionXY(param0->unk_2FC[0], 126, 16 + param0->unk_28 * 16); - SpriteActor_EnableObject(param0->unk_2FC[0], 1); + CellActorData_SetPositionXY(param0->unk_2FC[0], 126, 16 + param0->unk_28 * 16); + CellActorData_DrawSprite(param0->unk_2FC[0], 1); } static void sub_02070010(UnkStruct_0206F7F8 *param0) { Window_FillTilemap(¶m0->unk_E4, ((15 << 4) | 15)); Text_AddPrinterWithParamsAndColor(¶m0->unk_E4, FONT_MESSAGE, param0->unk_2C.unk_50[param0->unk_1F], 0, 0, TEXT_SPEED_INSTANT, TEXT_COLOR(1, 2, 15), NULL); - SpriteActor_EnableObject(param0->unk_2FC[0], 0); + CellActorData_DrawSprite(param0->unk_2FC[0], 0); } static void sub_02070050(UnkStruct_0206F7F8 *param0, BOOL param1) @@ -822,7 +822,7 @@ static void sub_020701DC(UnkStruct_0206F7F8 *param0, u16 param1) Window_Add(param0->unk_D0, ¶m0->unk_D4, 1, 4, 1, 24, 12, 13, 1); Window_DrawStandardFrame(¶m0->unk_D4, 1, (1024 - (18 + 12) - 9), 11); sub_02070050(param0, 0); - SpriteActor_EnableObject(param0->unk_2FC[1], 1); + CellActorData_DrawSprite(param0->unk_2FC[1], 1); Window_Add(param0->unk_D0, ¶m0->unk_F4, 3, 8, 14, 8, 2, 13, ((((1024 - (18 + 12) - 9) - 27 * 4) - 6 * 4) - (8 * 2))); Window_FillTilemap(¶m0->unk_F4, ((0 << 4) | 0)); Text_AddPrinterWithParamsAndColor(¶m0->unk_F4, FONT_SYSTEM, param0->unk_2C.unk_14, 0, 0, TEXT_SPEED_INSTANT, TEXT_COLOR(1, 2, 0), NULL); @@ -836,8 +836,8 @@ static void sub_02070288(UnkStruct_0206F7F8 *param0) Window_Remove(¶m0->unk_D4); Window_ClearAndCopyToVRAM(¶m0->unk_F4); Window_Remove(¶m0->unk_F4); - SpriteActor_EnableObject(param0->unk_2FC[0], 0); - SpriteActor_EnableObject(param0->unk_2FC[1], 0); + CellActorData_DrawSprite(param0->unk_2FC[0], 0); + CellActorData_DrawSprite(param0->unk_2FC[1], 0); } static BOOL sub_020702D0(FieldTask *param0) diff --git a/src/unk_0207C908.c b/src/unk_0207C908.c index 8588f4344e..06ecde2301 100644 --- a/src/unk_0207C908.c +++ b/src/unk_0207C908.c @@ -9,7 +9,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "palette.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" __attribute__((aligned(4))) static const u32 Unk_020F0AF0[] = { 0xEA, @@ -109,23 +109,23 @@ u32 sub_0207C944(void) void sub_0207C948(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) { - sub_0200CBDC(param0, param1, sub_0207C944(), sub_0207C908(param3), 1, param2, param4); + SpriteRenderer_LoadCharResObj(param0, param1, sub_0207C944(), sub_0207C908(param3), 1, param2, param4); } void sub_0207C97C(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, u32 param3) { - sub_0200CC9C(param0, param1, sub_0207C944(), sub_0207C920(), 0, 3, param2, param3); + SpriteRenderer_LoadPaletteResObj(param0, param1, sub_0207C944(), sub_0207C920(), 0, 3, param2, param3); } void sub_0207C9B0(PaletteData *param0, int param1, SpriteRenderer *param2, SpriteGfxHandler *param3, NNS_G2D_VRAM_TYPE param4, u32 param5) { - sub_0200CD7C(param0, param1, param2, param3, sub_0207C944(), sub_0207C920(), 0, 3, param4, param5); + SpriteRenderer_LoadPalette(param0, param1, param2, param3, sub_0207C944(), sub_0207C920(), 0, 3, param4, param5); } void sub_0207C9EC(SpriteRenderer *param0, SpriteGfxHandler *param1, u32 param2, u32 param3) { - sub_0200CE0C(param0, param1, sub_0207C944(), sub_0207C924(), 1, param2); - sub_0200CE3C(param0, param1, sub_0207C944(), sub_0207C928(), 1, param3); + SpriteRenderer_LoadCellResObj(param0, param1, sub_0207C944(), sub_0207C924(), 1, param2); + SpriteRenderer_LoadAnimResObj(param0, param1, sub_0207C944(), sub_0207C928(), 1, param3); } void sub_0207CA34(SpriteGfxHandler *param0, u32 param1) @@ -151,14 +151,14 @@ CellActorData *sub_0207CA58(SpriteRenderer *param0, SpriteGfxHandler *param1, in v1 = *param3; v1.plttIdx = sub_0207C92C(param2); - v0 = SpriteActor_LoadResources(param0, param1, &v1); + v0 = CellActor_LoadResources(param0, param1, &v1); return v0; } void sub_0207CA88(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } u32 sub_0207CA90(int param0) @@ -180,7 +180,7 @@ u32 sub_0207CAC0(void) void sub_0207CAC4(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) { - sub_0200CBDC(param0, param1, sub_0207CAC0(), sub_0207CA90(param3), 1, param2, param4); + SpriteRenderer_LoadCharResObj(param0, param1, sub_0207CAC0(), sub_0207CA90(param3), 1, param2, param4); } void sub_0207CAF8(SpriteGfxHandler *param0, u32 param1) @@ -190,5 +190,5 @@ void sub_0207CAF8(SpriteGfxHandler *param0, u32 param1) void sub_0207CB00(CellActorData *param0) { - sub_0200D0F4(param0); + CellActorData_Delete(param0); } diff --git a/src/unk_0207E0B8.c b/src/unk_0207E0B8.c index 562ac0b64d..4325946d8d 100644 --- a/src/unk_0207E0B8.c +++ b/src/unk_0207E0B8.c @@ -34,6 +34,7 @@ #include "party.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" @@ -42,7 +43,6 @@ #include "unk_020041CC.h" #include "unk_02005474.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" @@ -287,7 +287,7 @@ static int sub_0207E0B8(OverlayManager *param0, int *param1) } else if ((v0->unk_5A4->unk_20 == 9) || (v0->unk_5A4->unk_20 == 14)) { sub_020826E0(v0, 31, 1); } else if ((v0->unk_5A4->unk_20 == 7) || (v0->unk_5A4->unk_20 == 8) || (v0->unk_5A4->unk_20 == 11) || (v0->unk_5A4->unk_20 == 12)) { - sub_0200D414(v0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(v0->unk_5B0[6], 1); } else if ((v0->unk_5A4->unk_20 == 2) || (v0->unk_5A4->unk_20 == 17)) { sub_020826E0(v0, 34, 1); } else if (v0->unk_5A4->unk_20 == 15) { @@ -301,7 +301,7 @@ static int sub_0207E0B8(OverlayManager *param0, int *param1) } else if (v0->unk_5A4->unk_20 != 10) { sub_020826E0(v0, 29, 1); } else { - sub_0200D414(v0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(v0->unk_5B0[6], 1); } sub_02081BC0(v0); @@ -449,7 +449,7 @@ static int sub_0207E2A8(OverlayManager *param0, int *param1) sub_020831B4(v0); sub_02083334(v0); sub_0207FE1C(v0); - sub_0200C7EC(v0->unk_5AC); + SpriteGfxHandler_UpdateCellActorCollection(v0->unk_5AC); return 0; } @@ -510,7 +510,7 @@ static int sub_0207E518(GameWindowLayout *param0) param0->unk_5A4->unk_23 = 1; return 32; } else { - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); return sub_02084780(param0); } } @@ -523,7 +523,7 @@ static int sub_0207E5B4(GameWindowLayout *param0) u8 v0 = HandleSpecialInput(param0); if ((v0 == 0) || (v0 == 2)) { - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); return ApplyItemEffectOnPokemon(param0); } else if (v0 == 3) { param0->unk_5A4->unk_23 = 0; @@ -538,7 +538,7 @@ static int sub_0207E5F4(GameWindowLayout *param0) u8 v0 = HandleSpecialInput(param0); if ((v0 == 0) || (v0 == 2)) { - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); return ProcessItemApplication(param0); } else if (v0 == 3) { param0->unk_5A4->unk_23 = 0; @@ -562,7 +562,7 @@ static int sub_0207E634(GameWindowLayout *param0) Menu_Free(param0->unk_700, NULL); StringList_Free(param0->unk_6FC); sub_020826E0(param0, 29, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); return 1; default: { UnkFuncPtr_0207E634 v1; @@ -620,7 +620,7 @@ static int sub_0207E750(GameWindowLayout *param0) u8 v0 = HandleSpecialInput(param0); if ((v0 == 0) || (v0 == 2)) { - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); if (param0->unk_704[param0->unk_B11].unk_10 != 1) { return sub_0208615C(param0); @@ -1012,7 +1012,7 @@ static void sub_0207EE14(GameWindowLayout *param0) s16 v1, v2; sub_0200D50C(param0->unk_5B0[9], &v1, &v2); - SpriteActor_SetPositionXY(param0->unk_5B0[9], v1, v2 - 8); + CellActor_SetPositionXY(param0->unk_5B0[9], v1, v2 - 8); } v0 ^= 1; @@ -1392,7 +1392,7 @@ static void sub_0207F9A0(GameWindowLayout *param0) sub_0201E028(param0->unk_7F4, &v0, &v1, NULL, NULL, param0->unk_B11, 4); CellActor_SetAnim(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B11)); - SpriteActor_SetPositionXY(param0->unk_5B0[6], v0, v1); + CellActor_SetPositionXY(param0->unk_5B0[6], v0, v1); } static const u8 Unk_020F1BD4[][6] = { @@ -1463,7 +1463,7 @@ static u8 sub_0207FA24(GameWindowLayout *param0) } else { CellActor_SetAnim(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, v0)); CellActor_SetDrawFlag(param0->unk_5B0[6], 1); - SpriteActor_SetPositionXY(param0->unk_5B0[6], v2, v3); + CellActor_SetPositionXY(param0->unk_5B0[6], v2, v3); } { @@ -1551,7 +1551,7 @@ static u8 sub_0207FC94(GameWindowLayout *param0) sub_0201E028(param0->unk_7F4, &v1, &v2, NULL, NULL, param0->unk_B11, 4); CellActor_SetAnim(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B11)); CellActor_SetDrawFlag(param0->unk_5B0[6], 1); - SpriteActor_SetPositionXY(param0->unk_5B0[6], v1, v2); + CellActor_SetPositionXY(param0->unk_5B0[6], v1, v2); param0->unk_B0C = 1; param0->unk_B0D = param0->unk_B11; @@ -1578,7 +1578,7 @@ void sub_0207FD68(GameWindowLayout *param0, u8 param1) sub_0201E028(param0->unk_7F4, &v0, &v1, NULL, NULL, param0->unk_B11, 4); CellActor_SetAnim(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param1)); CellActor_SetDrawFlag(param0->unk_5B0[6], 1); - SpriteActor_SetPositionXY(param0->unk_5B0[6], v0, v1); + CellActor_SetPositionXY(param0->unk_5B0[6], v0, v1); } { @@ -1726,7 +1726,7 @@ static void sub_0207FFC8(GameWindowLayout *param0) Heap_FreeToHeapExplicit(12, v0); sub_02081E08(param0); sub_020826F4(param0, 0xffffffff, 1); - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); } static u8 sub_020800B4(GameWindowLayout *param0, u8 *param1) @@ -2335,7 +2335,7 @@ static u8 HandleWindowInputEvent(GameWindowLayout *param0, int *param1) sub_020826E0(param0, 29, 1); } - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); return 1; default: { UnkFuncPtr_0207E634 v1 = (UnkFuncPtr_0207E634)v0; @@ -2372,7 +2372,7 @@ static int ProcessWindowInput(GameWindowLayout *param0) switch (CheckPokemonCondition(param0)) { case 0: Sound_PlayEffect(1516); - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); if (param0->unk_704[param0->unk_B11].unk_08 - param0->unk_704[param0->unk_B11].unk_06 < param0->unk_B14[0]) { param0->unk_B14[0] = param0->unk_704[param0->unk_B11].unk_08 - param0->unk_704[param0->unk_B11].unk_06; @@ -2406,7 +2406,7 @@ static int ProcessWindowInput(GameWindowLayout *param0) switch (CheckPokemonCondition(param0)) { case 0: Sound_PlayEffect(1516); - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); if (param0->unk_704[param0->unk_B11].unk_08 - param0->unk_704[param0->unk_B11].unk_06 < param0->unk_B14[0]) { param0->unk_B14[0] = param0->unk_704[param0->unk_B11].unk_08 - param0->unk_704[param0->unk_B11].unk_06; @@ -2429,7 +2429,7 @@ static int ProcessWindowInput(GameWindowLayout *param0) if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); Window_EraseMessageBox(¶m0->unk_04[34], 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); sub_020826E0(param0, 36, 1); param0->unk_B14[1] = 0; } @@ -2469,7 +2469,7 @@ static int ProcessWindowInput(GameWindowLayout *param0) if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); Window_EraseMessageBox(¶m0->unk_04[34], 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); sub_02083B88(param0); return 1; } @@ -2486,7 +2486,7 @@ static u8 CheckPokemonCondition(GameWindowLayout *param0) } if ((param0->unk_B11 == param0->unk_B0F_0) || (param0->unk_704[param0->unk_B11].unk_06 == 0) || (param0->unk_704[param0->unk_B11].unk_06 == param0->unk_704[param0->unk_B11].unk_08)) { - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); sub_02082708(param0, 131, 1); param0->unk_B14[1] = 1; @@ -2832,7 +2832,7 @@ static int ResetWindowOnInput(GameWindowLayout *param0) if (param0->unk_5A4->unk_20 == 10) { Window_EraseMessageBox(¶m0->unk_04[34], 1); sub_020826E0(param0, 29, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); param0->unk_5A4->unk_20 = 0; return 1; } @@ -2890,7 +2890,7 @@ static int CheckForItemApplication(GameWindowLayout *param0) return 32; } - sub_0200D414(param0->unk_5B0[6], 1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 1); sub_02082708(param0, 195, 1); param0->unk_B04.unk_00 = sub_02083A78; param0->unk_B04.unk_04 = sub_02083AA4; diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index 92661f3303..9485c2a06e 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -3,7 +3,6 @@ #include #include -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0207F248.h" #include "struct_defs/struct_020831B4.h" @@ -21,9 +20,9 @@ #include "party.h" #include "pokemon.h" #include "pokemon_icon.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_020093B4.h" -#include "unk_0200C6E4.h" #include "unk_0201DBEC.h" #include "unk_0201E010.h" #include "unk_0207E0B8.h" @@ -35,8 +34,8 @@ void sub_02082C2C(GameWindowLayout *param0) GXLayers_EngineBToggleLayers(GX_PLANEMASK_OBJ, 1); VRAMTransferManager_New(32, 12); - param0->unk_5A8 = sub_0200C6E4(12); - param0->unk_5AC = sub_0200C704(param0->unk_5A8); + param0->unk_5A8 = SpriteRenderer_Create(12); + param0->unk_5AC = SpriteRenderer_CreateGfxHandler(param0->unk_5A8); { UnkStruct_ov104_0224133C v0 = { @@ -53,12 +52,12 @@ void sub_02082C2C(GameWindowLayout *param0) 29 + 6, 1024, 1024, GX_OBJVRAMMODE_CHAR_1D_32K, GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->unk_5A8, &v0, &v1, 32); - sub_0200C7C0(param0->unk_5A8, param0->unk_5AC, 29 + 6); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_5A8, &v0, &v1, 32); + SpriteRenderer_CreateCellActorList(param0->unk_5A8, param0->unk_5AC, 29 + 6); } { - UnkStruct_0200C738 *v2 = sub_0200C738(param0->unk_5A8); + GF_G2dRenderer *v2 = SpriteRenderer_GetG2dRenderer(param0->unk_5A8); sub_0200964C(v2, 0, (256 * FX32_ONE)); } @@ -73,7 +72,7 @@ void sub_02082C2C(GameWindowLayout *param0) "data/plist_h.cldat" }; - LoadSpriteResourceData(param0->unk_5A8, param0->unk_5AC, &v3); + SpriteRenderer_LoadSpriteResourceData(param0->unk_5A8, param0->unk_5AC, &v3); } } @@ -105,7 +104,7 @@ void sub_02082CEC(GameWindowLayout *param0, u8 param1, u16 param2, u16 param3, N v1.unk_20 = 0; v1.unk_24 = 0; - param0->unk_704[param1].unk_24 = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &v1); + param0->unk_704[param1].unk_24 = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &v1); } void sub_02082DA8(GameWindowLayout *param0, u8 param1) @@ -132,7 +131,7 @@ void sub_02082DA8(GameWindowLayout *param0, u8 param1) } Heap_FreeToHeap(v5); - sub_0200D414(param0->unk_704[param1].unk_24, PokeIconPaletteIndex(v2, v3, 0) + RESDAT_PLIST_PAL_NARC_19_MEMBER_0_2_OFFSET); + thunk_CellActor_SetExplicitPalette(param0->unk_704[param1].unk_24, PokeIconPaletteIndex(v2, v3, 0) + RESDAT_PLIST_PAL_NARC_19_MEMBER_0_2_OFFSET); NARC_dtor(v1); } @@ -166,19 +165,19 @@ void sub_02082E58(GameWindowLayout *param0) { u32 v0; - param0->unk_5B0[6] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[0]); - param0->unk_5B0[7] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[1]); - param0->unk_5B0[8] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[2]); - param0->unk_5B0[9] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[3]); - param0->unk_5B0[28] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[22]); + param0->unk_5B0[6] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[0]); + param0->unk_5B0[7] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[1]); + param0->unk_5B0[8] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[2]); + param0->unk_5B0[9] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[3]); + param0->unk_5B0[28] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[22]); for (v0 = 0; v0 < 6; v0++) { - param0->unk_5B0[10 + v0] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[4 + v0]); + param0->unk_5B0[10 + v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[4 + v0]); param0->unk_704[v0].unk_1A = Unk_020F20C0[4 + v0].unk_04; param0->unk_704[v0].unk_1C = Unk_020F20C0[4 + v0].unk_06; CellActor_SetDrawFlag(param0->unk_5B0[10 + v0], 0); - param0->unk_5B0[16 + v0] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[10 + v0]); - param0->unk_5B0[22 + v0] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[16 + v0]); + param0->unk_5B0[16 + v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[10 + v0]); + param0->unk_5B0[22 + v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[16 + v0]); } CellActor_SetDrawFlag(param0->unk_5B0[7], 0); @@ -202,13 +201,13 @@ void sub_02082FAC(GameWindowLayout *param0, u8 param1, u16 param2, u16 param3) v0.unk_20 = 0; v0.unk_24 = 0; - param0->unk_5B0[0 + param1] = sub_0200CA08(param0->unk_5A8, param0->unk_5AC, &v0); + param0->unk_5B0[0 + param1] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &v0); } void sub_02082FF4(GameWindowLayout *param0) { - sub_0200C8B0(param0->unk_5A8, param0->unk_5AC); - sub_0200C8D4(param0->unk_5A8); + SpriteRenderer_DeleteGfxHandler(param0->unk_5A8, param0->unk_5AC); + SpriteRenderer_Free(param0->unk_5A8); } void sub_02083014(GameWindowLayout *param0, u8 param1, u8 param2) @@ -257,12 +256,12 @@ void sub_020830A0(GameWindowLayout *param0, u8 param1, s16 param2, s16 param3) param0->unk_704[param1].unk_1E = param2 + 8; param0->unk_704[param1].unk_20 = param3 + 8; - SpriteActor_SetPositionXY(*v0, param0->unk_704[param1].unk_1E, param0->unk_704[param1].unk_20); + CellActor_SetPositionXY(*v0, param0->unk_704[param1].unk_1E, param0->unk_704[param1].unk_20); } void sub_020830D4(GameWindowLayout *param0, u8 param1) { - SpriteActor_SetPositionXY(param0->unk_5B0[22 + param1], param0->unk_704[param1].unk_1E + 8, param0->unk_704[param1].unk_20); + CellActor_SetPositionXY(param0->unk_5B0[22 + param1], param0->unk_704[param1].unk_1E + 8, param0->unk_704[param1].unk_20); } void sub_02083104(GameWindowLayout *param0, u8 param1) @@ -335,15 +334,15 @@ void sub_020831B4(GameWindowLayout *param0) if ((param0->unk_B11 == v1) && (v2 != 0) && (v2 != 5)) { if (CellActor_GetAnimFrame(v0->unk_24) == 0) { - SpriteActor_SetPositionXY(v0->unk_24, v0->unk_16, v0->unk_18 - 3); + CellActor_SetPositionXY(v0->unk_24, v0->unk_16, v0->unk_18 - 3); } else { - SpriteActor_SetPositionXY(v0->unk_24, v0->unk_16, v0->unk_18 + 1); + CellActor_SetPositionXY(v0->unk_24, v0->unk_16, v0->unk_18 + 1); } continue; } - SpriteActor_SetPositionXY(v0->unk_24, v0->unk_16, v0->unk_18); + CellActor_SetPositionXY(v0->unk_24, v0->unk_16, v0->unk_18); } } @@ -354,8 +353,8 @@ void sub_0208327C(GameWindowLayout *param0, u8 param1, u8 param2) sub_0201E010(¶m0->unk_7F4[param1], &v0, &v1); CellActor_SetAnim(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param1)); CellActor_SetDrawFlag(param0->unk_5B0[6], 1); - SpriteActor_SetPositionXY(param0->unk_5B0[6], v0, v1); - sub_0200D414(param0->unk_5B0[6], param2); + CellActor_SetPositionXY(param0->unk_5B0[6], v0, v1); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], param2); } void sub_020832E4(GameWindowLayout *param0, s16 param1, s16 param2) diff --git a/src/unk_02083370.c b/src/unk_02083370.c index bdcea827f0..0cb0198048 100644 --- a/src/unk_02083370.c +++ b/src/unk_02083370.c @@ -25,11 +25,11 @@ #include "party.h" #include "pokemon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "string_list.h" #include "string_template.h" #include "text.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0207070C.h" #include "unk_0207E0B8.h" #include "unk_020819DC.h" @@ -222,7 +222,7 @@ int sub_02083658(GameWindowLayout *param0) if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Window_EraseMessageBox(¶m0->unk_04[34], 1); sub_020826E0(param0, 29, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); return 1; } } @@ -371,7 +371,7 @@ static int sub_02083990(void *param0) Window_EraseMessageBox(&v0->unk_04[34], 1); sub_020826E0(v0, 29, 1); - sub_0200D414(v0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(v0->unk_5B0[6], 0); return 1; } @@ -381,7 +381,7 @@ int sub_020839BC(GameWindowLayout *param0) if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Window_EraseMessageBox(¶m0->unk_04[34], 1); sub_020826E0(param0, 29, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); return 1; } @@ -427,7 +427,7 @@ int sub_02083AA4(void *param0) Window_EraseMessageBox(&v0->unk_04[34], 1); sub_020826E0(v0, 29, 1); - sub_0200D414(v0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(v0->unk_5B0[6], 0); return 1; } @@ -439,9 +439,9 @@ static void sub_02083AD0(GameWindowLayout *param0, int *param1) param0->unk_B0F_6 = 1; param0->unk_B0F_0 = param0->unk_B11; - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); sub_0200D50C(param0->unk_5B0[6], &v0, &v1); - SpriteActor_SetPositionXY(param0->unk_5B0[7], v0, v1); + CellActor_SetPositionXY(param0->unk_5B0[7], v0, v1); CellActor_SetAnim(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); CellActor_SetDrawFlag(param0->unk_5B0[7], 1); sub_0207F8F8(param0, param0->unk_B0F_0); @@ -613,11 +613,11 @@ static void sub_02083FDC(GameWindowLayout *param0, u8 param1, u8 param2) v1 += 8; } - SpriteActor_SetPositionXY(param0->unk_704[v0->unk_300[param1]].unk_24, param0->unk_704[v0->unk_300[param1]].unk_16, param0->unk_704[v0->unk_300[param1]].unk_18); - SpriteActor_SetPositionXY(param0->unk_5B0[10 + v0->unk_300[param1]], param0->unk_704[v0->unk_300[param1]].unk_1A, param0->unk_704[v0->unk_300[param1]].unk_1C); - SpriteActor_SetPositionXY(param0->unk_5B0[16 + v0->unk_300[param1]], param0->unk_704[v0->unk_300[param1]].unk_1E, param0->unk_704[v0->unk_300[param1]].unk_20); - SpriteActor_SetPositionXY(param0->unk_5B0[22 + v0->unk_300[param1]], param0->unk_704[v0->unk_300[param1]].unk_1E + 8, param0->unk_704[v0->unk_300[param1]].unk_20); - SpriteActor_SetPositionXY(param0->unk_5B0[0 + v0->unk_300[param1]], v1, v2); + CellActor_SetPositionXY(param0->unk_704[v0->unk_300[param1]].unk_24, param0->unk_704[v0->unk_300[param1]].unk_16, param0->unk_704[v0->unk_300[param1]].unk_18); + CellActor_SetPositionXY(param0->unk_5B0[10 + v0->unk_300[param1]], param0->unk_704[v0->unk_300[param1]].unk_1A, param0->unk_704[v0->unk_300[param1]].unk_1C); + CellActor_SetPositionXY(param0->unk_5B0[16 + v0->unk_300[param1]], param0->unk_704[v0->unk_300[param1]].unk_1E, param0->unk_704[v0->unk_300[param1]].unk_20); + CellActor_SetPositionXY(param0->unk_5B0[22 + v0->unk_300[param1]], param0->unk_704[v0->unk_300[param1]].unk_1E + 8, param0->unk_704[v0->unk_300[param1]].unk_20); + CellActor_SetPositionXY(param0->unk_5B0[0 + v0->unk_300[param1]], v1, v2); } static void sub_02084134(GameWindowLayout *param0) @@ -728,7 +728,7 @@ static void sub_020844B0(GameWindowLayout *param0, int *param1) sub_02082508(param0, param0->unk_B11); sub_020826E0(param0, 34, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); if (v0 == param0->unk_5A4->unk_32_4 - 1) { sub_0207FD68(param0, 6); @@ -765,7 +765,7 @@ int sub_020845A8(GameWindowLayout *param0) if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Window_EraseMessageBox(¶m0->unk_04[34], 1); sub_020826E0(param0, 34, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); return 1; } @@ -799,7 +799,7 @@ static void sub_020845E8(GameWindowLayout *param0, int *param1) Window_EraseMessageBox(¶m0->unk_04[33], 1); sub_0208337C(param0); sub_020826E0(param0, 29, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); *param1 = 1; } @@ -1018,9 +1018,9 @@ static int sub_02084A18(GameWindowLayout *param0) param0->unk_B0F_6 = 1; param0->unk_B0F_0 = param0->unk_B11; - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); sub_0200D50C(param0->unk_5B0[6], &v0, &v1); - SpriteActor_SetPositionXY(param0->unk_5B0[7], v0, v1); + CellActor_SetPositionXY(param0->unk_5B0[7], v0, v1); CellActor_SetAnim(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); CellActor_SetDrawFlag(param0->unk_5B0[7], 1); sub_0207F8F8(param0, param0->unk_B0F_0); @@ -1036,7 +1036,7 @@ int sub_02084B34(GameWindowLayout *param0) if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Window_EraseMessageBox(¶m0->unk_04[34], 1); sub_020826E0(param0, 29, 1); - sub_0200D414(param0->unk_5B0[6], 0); + thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); return 1; } diff --git a/src/unk_0208694C.c b/src/unk_0208694C.c index d61bc92c0a..0f717cb321 100644 --- a/src/unk_0208694C.c +++ b/src/unk_0208694C.c @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_02087A10_decl.h" -#include "struct_defs/struct_0200C738.h" #include "struct_defs/struct_0208737C.h" #include "struct_defs/struct_02099F80.h" @@ -26,6 +25,7 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "render_window.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "strbuf.h" #include "string_template.h" @@ -86,7 +86,7 @@ struct UnkStruct_02087A10_t { Strbuf *unk_180; Strbuf *unk_184; CellActorCollection *unk_188; - UnkStruct_0200C738 unk_18C; + GF_G2dRenderer unk_18C; SpriteResourceCollection *unk_318[4]; SpriteResource *unk_328[2][4]; CellActorResourceData unk_348; diff --git a/src/unk_020890F4.c b/src/unk_020890F4.c index 9a2b5171ac..463d6eaeff 100644 --- a/src/unk_020890F4.c +++ b/src/unk_020890F4.c @@ -16,8 +16,8 @@ #include "narc.h" #include "overlay_manager.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" -#include "unk_0200C6E4.h" #include "unk_02017728.h" #include "unk_0201DBEC.h" #include "unk_0201E3D8.h" @@ -145,8 +145,8 @@ static int sub_0208927C(OverlayManager *param0, int *param1) v1 = sub_0201E530(); } - sub_0200D0B0(v0->unk_2C0.unk_04, v0->unk_2C0.unk_08); - sub_0200C8D4(v0->unk_2C0.unk_04); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(v0->unk_2C0.unk_04, v0->unk_2C0.unk_08); + SpriteRenderer_Free(v0->unk_2C0.unk_04); sub_02024034(v0->unk_2C0.unk_14); OverlayManager_FreeData(param0); Heap_Destroy(101); diff --git a/src/unk_02089604.c b/src/unk_02089604.c index f1a7826cd8..f2daf67f09 100644 --- a/src/unk_02089604.c +++ b/src/unk_02089604.c @@ -8,10 +8,10 @@ #include "core_sys.h" #include "heap.h" #include "palette.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "touch_screen.h" #include "unk_02005474.h" -#include "unk_0200C6E4.h" #include "unk_0200F174.h" #include "unk_02023FCC.h" #include "unk_020393C8.h" @@ -214,13 +214,13 @@ BOOL sub_02089974(UnkStruct_02089688 *param0) if (param0->unk_00[0].unk_14.unk_04 == 0) { for (v0 = param0->unk_2B0; v0 < param0->unk_2B4; v0++) { - sub_0200D364(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); - sub_0200D330(param0->unk_00[v0].unk_0C); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_UpdateObject(param0->unk_00[v0].unk_0C); } for (v0 = param0->unk_2B8; v0 < param0->unk_2BC; v0++) { - sub_0200D364(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); - sub_0200D330(param0->unk_00[v0].unk_0C); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_UpdateObject(param0->unk_00[v0].unk_0C); } param0->unk_29C++; @@ -290,7 +290,7 @@ BOOL sub_02089BEC(UnkStruct_02089688 *param0) sub_0208ABB4(param0); sub_0208AC8C(param0); - sub_0200C7EC(param0->unk_2C0.unk_08); + SpriteGfxHandler_UpdateCellActorCollection(param0->unk_2C0.unk_08); return v0; } @@ -530,12 +530,12 @@ asm void sub_02089C20 (UnkStruct_02089688 * param0) add r1, r0, #0 add r0, r4, r7 ldr r0, [r0, #0xc] - bl sub_0200D364 + bl CellActorData_SetAnim mov r0, #0x96 lsl r0, r0, #2 ldr r0, [r4, r0] mov r1, #3 - bl sub_0200D364 + bl CellActorData_SetAnim add r0, r4, r7 ldr r3, [r0, #4] ldr r0, [sp] @@ -759,7 +759,7 @@ void sub_02089F80(UnkStruct_02089688 *param0) for (v0 = 0; v0 < param0->unk_2A4; v0++) { if (param0->unk_00[v0].unk_00 == 0) { param0->unk_00[v0].unk_00 = 1; - sub_0200D364(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); } v1 = param0->unk_00[v0].unk_00 - 1; @@ -794,12 +794,12 @@ void sub_02089FFC(UnkStruct_02089688 *param0) v0 = param0->unk_1F0[0].unk_00; param0->unk_00[v0].unk_00 = 0; - sub_0200D364(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); v1 = param0->unk_00[v0].unk_04; if (v0 > param0->unk_3C4) { v0--; - sub_0200D364(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); + CellActorData_SetAnim(param0->unk_00[v0].unk_0C, sub_0208AD98(param0->unk_00[v0].unk_00, param0->unk_00[v0].unk_08)); v2 = param0->unk_00[v0].unk_04; @@ -903,13 +903,13 @@ void sub_0208A180(u32 param0, u32 param1, void *param2) v1 = v0->unk_1F0[0].unk_00; v0->unk_00[v1].unk_00 = param0 - 16 + 1; - sub_0200D364(v0->unk_00[v1].unk_0C, sub_0208AD98(v0->unk_00[v1].unk_00, v0->unk_00[v1].unk_08)); + CellActorData_SetAnim(v0->unk_00[v1].unk_0C, sub_0208AD98(v0->unk_00[v1].unk_00, v0->unk_00[v1].unk_08)); sub_0208AAB4(v0, 1, 1); sub_0208AB2C(v0, param0 - 16); sub_0208AAB4(v0, 1, 0); sub_0208AAB4(v0, 2, 1); sub_0208AB6C(v0, param0 - 16, 2); - sub_0200D364(v0->unk_1F0[2].unk_0C, 3); + CellActorData_SetAnim(v0->unk_1F0[2].unk_0C, 3); v2 = v0->unk_00[v1].unk_04; v1++; diff --git a/src/unk_0208A3F4.c b/src/unk_0208A3F4.c index 3e400aa39c..afe35c2d5a 100644 --- a/src/unk_0208A3F4.c +++ b/src/unk_0208A3F4.c @@ -27,13 +27,13 @@ #include "render_window.h" #include "strbuf.h" #include "text.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" #include "unk_02012744.h" #include "unk_0201E86C.h" void sub_0208A3F4 (UnkStruct_02089688 * param0) { - param0->unk_2C0.unk_04 = sub_0200C6E4(101); + param0->unk_2C0.unk_04 = SpriteRenderer_Create(101); { const UnkStruct_ov104_0224133C v0 = { 0, 128, 0, 32, 0, 128, 0, 32, @@ -42,7 +42,7 @@ void sub_0208A3F4 (UnkStruct_02089688 * param0) 48 + 48, 1024 * 0x40, 512 * 0x20, GX_OBJVRAMMODE_CHAR_1D_64K, GX_OBJVRAMMODE_CHAR_1D_32K }; - sub_0200C73C(param0->unk_2C0.unk_04, &v0, &v1, 16 + 16); + SpriteRenderer_CreateOamCharPlttManagers(param0->unk_2C0.unk_04, &v0, &v1, 16 + 16); } { @@ -51,12 +51,12 @@ void sub_0208A3F4 (UnkStruct_02089688 * param0) 48 + 48, 16 + 16, 64, 64, 16, 16, }; - param0->unk_2C0.unk_08 = sub_0200C704(param0->unk_2C0.unk_04); + param0->unk_2C0.unk_08 = SpriteRenderer_CreateGfxHandler(param0->unk_2C0.unk_04); - v2 = sub_0200C7C0(param0->unk_2C0.unk_04, param0->unk_2C0.unk_08, 64 + 64); + v2 = SpriteRenderer_CreateCellActorList(param0->unk_2C0.unk_04, param0->unk_2C0.unk_08, 64 + 64); GF_ASSERT(v2); - v2 = sub_0200CB30(param0->unk_2C0.unk_04, param0->unk_2C0.unk_08, &v3); + v2 = SpriteRenderer_InitGfxResourceList(param0->unk_2C0.unk_04, param0->unk_2C0.unk_08, &v3); GF_ASSERT(v2); } } @@ -83,17 +83,17 @@ void sub_0208A490 (UnkStruct_02089688 * param0) Graphics_LoadTilemapToBgLayerFromOpenNARC(v0, 17, v1, 5, 0, 0, 0, 101); PaletteData_LoadBufferFromFileStart(v4, 159, 16, 101, 1, 0x20 * 1, 0); - SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 2, v2, v3, v0, 1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 2, 0, 1000); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 3, 0, 1000); - SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 5, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 2, v2, v3, v0, 5, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 6, 0, 1001); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 7, 0, 1001); - SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 9, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 1002); + SpriteRenderer_LoadPaletteFromOpenNarc(v4, 2, v2, v3, v0, 9, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 1002); SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 8, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1002); SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 10, 0, 1002); SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 11, 0, 1002); @@ -112,19 +112,19 @@ void sub_0208A6CC (UnkStruct_02089688 * param0) int v0; for (v0 = 0; v0 < param0->unk_2A4; v0++) { - sub_0200D0F4(param0->unk_00[v0].unk_0C); + CellActorData_Delete(param0->unk_00[v0].unk_0C); } for (v0 = 0; v0 < param0->unk_3C0; v0++) { - sub_0200D0F4(param0->unk_1A0[v0].unk_0C); + CellActorData_Delete(param0->unk_1A0[v0].unk_0C); } for (v0 = 0; v0 < 2; v0++) { - sub_0200D0F4(param0->unk_240[v0].unk_0C); + CellActorData_Delete(param0->unk_240[v0].unk_0C); } for (v0 = 0; v0 < 3; v0++) { - sub_0200D0F4(param0->unk_1F0[v0].unk_0C); + CellActorData_Delete(param0->unk_1F0[v0].unk_0C); } sub_0208AFE8(param0); @@ -230,7 +230,7 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) ldr r0, [sp, #8] ldr r1, [sp, #4] add r2, sp, #0x10 - bl SpriteActor_LoadResources + bl CellActor_LoadResources mov r1, #0x73 lsl r1, r1, #2 str r0, [r4, r1] @@ -239,16 +239,16 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) ldr r0, [r4, r0] asr r1, r1, #0x10 mov r2, #0x18 - bl SpriteActor_SetSpritePositionXY + bl CellActorData_SetPositionXY mov r0, #0x73 lsl r0, r0, #2 ldr r0, [r4, r0] mov r1, #0x16 - bl sub_0200D364 + bl CellActorData_SetAnim mov r0, #0x73 lsl r0, r0, #2 ldr r0, [r4, r0] - bl sub_0200D330 + bl CellActorData_UpdateObject ldr r0, [sp, #0xc] add r4, #0x1c add r0, r0, #1 @@ -258,23 +258,23 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) ldr r0, [sp, #8] ldr r1, [sp, #4] add r2, sp, #0x10 - bl SpriteActor_LoadResources + bl CellActor_LoadResources lsl r1, r7, #0x10 str r0, [r5, #0xc] asr r1, r1, #0x10 mov r2, #0x18 - bl SpriteActor_SetSpritePositionXY + bl CellActorData_SetPositionXY ldr r0, [r5, #0] ldr r1, [r5, #8] bl sub_0208AD98 add r1, r0, #0 ldr r0, [r5, #0xc] - bl sub_0200D364 + bl CellActorData_SetAnim ldr r0, [r5, #0xc] mov r1, #2 bl sub_0200D6A4 ldr r0, [r5, #0xc] - bl sub_0200D330 + bl CellActorData_UpdateObject add r5, #0x1c _0208A882: ldr r1, [sp] @@ -322,21 +322,21 @@ void sub_0208A8A0 (UnkStruct_02089688 * param0) v0.resources[4] = SPRITE_RESOURCE_NONE; v0.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_1F0[0].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); - param0->unk_1F0[1].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); - param0->unk_1F0[2].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_1F0[0].unk_0C = CellActor_LoadResources(v1, v2, &v0); + param0->unk_1F0[1].unk_0C = CellActor_LoadResources(v1, v2, &v0); + param0->unk_1F0[2].unk_0C = CellActor_LoadResources(v1, v2, &v0); sub_0208AAE4(param0, param0->unk_3C4); - sub_0200D364(param0->unk_1F0[0].unk_0C, 0); - sub_0200D330(param0->unk_1F0[0].unk_0C); + CellActorData_SetAnim(param0->unk_1F0[0].unk_0C, 0); + CellActorData_UpdateObject(param0->unk_1F0[0].unk_0C); param0->unk_1F0[1].unk_14.unk_00 = 0; param0->unk_1F0[1].unk_14.unk_02 = 0; param0->unk_1F0[1].unk_00 = 1; sub_0208AB2C(param0, 0); - sub_0200D364(param0->unk_1F0[1].unk_0C, param0->unk_1F0[1].unk_00); - sub_0200D330(param0->unk_1F0[1].unk_0C); + CellActorData_SetAnim(param0->unk_1F0[1].unk_0C, param0->unk_1F0[1].unk_00); + CellActorData_UpdateObject(param0->unk_1F0[1].unk_0C); SpriteActor_SetOAMMode(param0->unk_1F0[1].unk_0C, GX_OAM_MODE_XLU); param0->unk_1F0[2].unk_14.unk_00 = 0; @@ -344,8 +344,8 @@ void sub_0208A8A0 (UnkStruct_02089688 * param0) param0->unk_1F0[2].unk_00 = 1; sub_0208AB2C(param0, 0); - sub_0200D364(param0->unk_1F0[2].unk_0C, param0->unk_1F0[2].unk_00); - sub_0200D330(param0->unk_1F0[2].unk_0C); + CellActorData_SetAnim(param0->unk_1F0[2].unk_0C, param0->unk_1F0[2].unk_00); + CellActorData_UpdateObject(param0->unk_1F0[2].unk_0C); SpriteActor_SetOAMMode(param0->unk_1F0[2].unk_0C, GX_OAM_MODE_XLU); sub_0208AAB4(param0, 1, 0); sub_0208AAB4(param0, 2, 0); @@ -378,9 +378,9 @@ void sub_0208A9BC (UnkStruct_02089688 * param0) v0.resources[4] = SPRITE_RESOURCE_NONE; v0.resources[5] = SPRITE_RESOURCE_NONE; v0.plttIdx = 0; - param0->unk_240[0].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_240[0].unk_0C = CellActor_LoadResources(v1, v2, &v0); v0.plttIdx = 1; - param0->unk_240[1].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_240[1].unk_0C = CellActor_LoadResources(v1, v2, &v0); { s16 v4, v5; @@ -388,25 +388,25 @@ void sub_0208A9BC (UnkStruct_02089688 * param0) v4 = (param0->unk_2C0.unk_18[26].rect.left + param0->unk_2C0.unk_18[26].rect.right) / 2; v5 = (param0->unk_2C0.unk_18[26].rect.top + param0->unk_2C0.unk_18[26].rect.bottom) / 2; - SpriteActor_SetSpritePositionXY(param0->unk_240[0].unk_0C, v4, v5); - sub_0200D364(param0->unk_240[0].unk_0C, 0); - sub_0200D330(param0->unk_240[0].unk_0C); + CellActorData_SetPositionXY(param0->unk_240[0].unk_0C, v4, v5); + CellActorData_SetAnim(param0->unk_240[0].unk_0C, 0); + CellActorData_UpdateObject(param0->unk_240[0].unk_0C); v4 = (param0->unk_2C0.unk_18[27].rect.left + param0->unk_2C0.unk_18[27].rect.right) / 2; v5 = (param0->unk_2C0.unk_18[27].rect.top + param0->unk_2C0.unk_18[27].rect.bottom) / 2; - SpriteActor_SetSpritePositionXY(param0->unk_240[1].unk_0C, v4, v5); - sub_0200D364(param0->unk_240[1].unk_0C, 0); - sub_0200D330(param0->unk_240[1].unk_0C); + CellActorData_SetPositionXY(param0->unk_240[1].unk_0C, v4, v5); + CellActorData_SetAnim(param0->unk_240[1].unk_0C, 0); + CellActorData_UpdateObject(param0->unk_240[1].unk_0C); } } void sub_0208AAB4 (UnkStruct_02089688 * param0, int param1, BOOL param2) { if (param2 == 1) { - SpriteActor_EnableObject(param0->unk_1F0[param1].unk_0C, 1); + CellActorData_DrawSprite(param0->unk_1F0[param1].unk_0C, 1); } else { - SpriteActor_EnableObject(param0->unk_1F0[param1].unk_0C, 0); + CellActorData_DrawSprite(param0->unk_1F0[param1].unk_0C, 0); } } @@ -423,7 +423,7 @@ void sub_0208AAE4 (UnkStruct_02089688 * param0, int param1) param0->unk_1F0[0].unk_00 = param1; SpriteActor_GetSpritePositionXY(v2, &v0, &v1); - SpriteActor_SetSpritePositionXY(param0->unk_1F0[0].unk_0C, v0, v1 + 16); + CellActorData_SetPositionXY(param0->unk_1F0[0].unk_0C, v0, v1 + 16); } void sub_0208AB2C (UnkStruct_02089688 * param0, int param1) @@ -433,7 +433,7 @@ void sub_0208AB2C (UnkStruct_02089688 * param0, int param1) v0 = (param0->unk_2C0.unk_18[param1 + 16].rect.left + param0->unk_2C0.unk_18[param1 + 16].rect.right) / 2; v1 = (param0->unk_2C0.unk_18[param1 + 16].rect.top + param0->unk_2C0.unk_18[param1 + 16].rect.bottom) / 2; - SpriteActor_SetSpritePositionXY(param0->unk_1F0[1].unk_0C, v0, v1); + CellActorData_SetPositionXY(param0->unk_1F0[1].unk_0C, v0, v1); } void sub_0208AB6C (UnkStruct_02089688 * param0, int param1, int param2) @@ -443,14 +443,14 @@ void sub_0208AB6C (UnkStruct_02089688 * param0, int param1, int param2) v0 = (param0->unk_2C0.unk_18[param1 + 16].rect.left + param0->unk_2C0.unk_18[param1 + 16].rect.right) / 2; v1 = (param0->unk_2C0.unk_18[param1 + 16].rect.top + param0->unk_2C0.unk_18[param1 + 16].rect.bottom) / 2; - SpriteActor_SetSpritePositionXY(param0->unk_1F0[param2].unk_0C, v0, v1); + CellActorData_SetPositionXY(param0->unk_1F0[param2].unk_0C, v0, v1); } void sub_0208ABB4 (UnkStruct_02089688 * param0) { - sub_0200D330(param0->unk_1F0[0].unk_0C); - sub_0200D330(param0->unk_1F0[1].unk_0C); - sub_0200D330(param0->unk_1F0[2].unk_0C); + CellActorData_UpdateObject(param0->unk_1F0[0].unk_0C); + CellActorData_UpdateObject(param0->unk_1F0[1].unk_0C); + CellActorData_UpdateObject(param0->unk_1F0[2].unk_0C); { int v0 = 2; @@ -458,13 +458,13 @@ void sub_0208ABB4 (UnkStruct_02089688 * param0) BOOL v2; for (v0 = 1; v0 < 3; v0++) { - v1 = sub_0200D37C(param0->unk_1F0[v0].unk_0C); + v1 = CellActorData_GetActiveAnim(param0->unk_1F0[v0].unk_0C); if (v1 == 3) { - v2 = sub_0200D3B8(param0->unk_1F0[v0].unk_0C); + v2 = CellActorData_IsAnimated(param0->unk_1F0[v0].unk_0C); if (v2 == 0) { - sub_0200D364(param0->unk_1F0[v0].unk_0C, param0->unk_1F0[v0].unk_00); + CellActorData_SetAnim(param0->unk_1F0[v0].unk_0C, param0->unk_1F0[v0].unk_00); if (param0->unk_2C0.unk_88 == 1) { sub_0208AAB4(param0, 1, 0); @@ -476,11 +476,11 @@ void sub_0208ABB4 (UnkStruct_02089688 * param0) } } else { if (v1 != param0->unk_1F0[v0].unk_00) { - sub_0200D364(param0->unk_1F0[v0].unk_0C, param0->unk_1F0[v0].unk_00); + CellActorData_SetAnim(param0->unk_1F0[v0].unk_0C, param0->unk_1F0[v0].unk_00); } { - v1 = sub_0200D37C(param0->unk_1F0[2].unk_0C); + v1 = CellActorData_GetActiveAnim(param0->unk_1F0[2].unk_0C); if (v1 != 3) { if (param0->unk_2C0.unk_88 == 1) { @@ -524,19 +524,19 @@ void sub_0208AC8C (UnkStruct_02089688 * param0) param0->unk_240[v0].unk_14.unk_04++; if (param0->unk_240[v0].unk_14.unk_04 == 1) { - sub_0200D364(param0->unk_240[v0].unk_0C, 1); + CellActorData_SetAnim(param0->unk_240[v0].unk_0C, 1); sub_0208AC80(param0->unk_2C0.unk_90[v0], v1, v2 - 0); } else if (param0->unk_240[v0].unk_14.unk_04 == 2) { - sub_0200D364(param0->unk_240[v0].unk_0C, 2); + CellActorData_SetAnim(param0->unk_240[v0].unk_0C, 2); sub_0208AC80(param0->unk_2C0.unk_90[v0], v1, v2 - 1); } else if (param0->unk_240[v0].unk_14.unk_04 == 10) { - sub_0200D364(param0->unk_240[v0].unk_0C, 0); + CellActorData_SetAnim(param0->unk_240[v0].unk_0C, 0); sub_0208AC80(param0->unk_2C0.unk_90[v0], v1, v2 + 0); param0->unk_240[v0].unk_00++; } break; default: - sub_0200D364(param0->unk_240[v0].unk_0C, 0); + CellActorData_SetAnim(param0->unk_240[v0].unk_0C, 0); sub_0208AC80(param0->unk_2C0.unk_90[v0], v1, v2); param0->unk_240[v0].unk_00 = 0; break; @@ -598,7 +598,7 @@ void sub_0208ADE4 (UnkStruct_02089688 * param0, int param1) SpriteActor_GetSpritePositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); if (param1 == 0) { - SpriteActor_SetSpritePositionXY(param0->unk_00[v0].unk_0C, v2, v4); + CellActorData_SetPositionXY(param0->unk_00[v0].unk_0C, v2, v4); } else { param0->unk_00[v0].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_00[v0].unk_14.unk_02 = 0; @@ -620,7 +620,7 @@ void sub_0208ADE4 (UnkStruct_02089688 * param0, int param1) } if (param1 == 0) { - SpriteActor_SetSpritePositionXY(param0->unk_1A0[v1].unk_0C, v2, v4); + CellActorData_SetPositionXY(param0->unk_1A0[v1].unk_0C, v2, v4); } else { param0->unk_1A0[v1].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_1A0[v1].unk_14.unk_02 = 0; @@ -684,7 +684,7 @@ void sub_0208AFE8 (UnkStruct_02089688 * param0) void sub_0208B028 (UnkStruct_02089688 * param0) { - sub_0200CD7C(param0->unk_2C0.unk_10, 2, param0->unk_2C0.unk_04, param0->unk_2C0.unk_08, 14, 7, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1003); + SpriteRenderer_LoadPalette(param0->unk_2C0.unk_10, 2, param0->unk_2C0.unk_04, param0->unk_2C0.unk_08, 14, 7, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1003); } void sub_0208B064 (UnkStruct_02089688 * param0) @@ -726,7 +726,7 @@ void sub_0208B090 (UnkStruct_02089688 * param0, int param1, int param2, int para v2.unk_00 = param0->unk_2C0.unk_8C; v2.unk_04 = &v7; v2.unk_08 = sub_0200D9B0(param0->unk_2C0.unk_08); - v2.unk_0C = sub_0200D04C(param0->unk_2C0.unk_08, v4); + v2.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_2C0.unk_08, v4); v2.unk_10 = NULL; v2.unk_14 = param0->unk_2C0.unk_98[param1].unk_04; v2.unk_18 = v0; diff --git a/src/unk_0208B284.c b/src/unk_0208B284.c index ce8a84d600..848a570a54 100644 --- a/src/unk_0208B284.c +++ b/src/unk_0208B284.c @@ -12,9 +12,9 @@ #include "heap.h" #include "narc.h" #include "palette.h" +#include "sprite_renderer.h" #include "sys_task.h" #include "sys_task_manager.h" -#include "unk_0200C6E4.h" #include "unk_0201D15C.h" typedef struct { @@ -190,8 +190,8 @@ void sub_0208B63C(UnkStruct_0208B878 *param0, int param1) SpriteGfxHandler_UnloadPlttObjById(v2, 22222 + 1); SpriteGfxHandler_UnloadPlttObjById(v2, 22222 + 2); - SpriteRenderer_LoadPalette(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 22222 + 1); - SpriteRenderer_LoadPalette(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 22222 + 2); + SpriteRenderer_LoadPaletteFromOpenNarc(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 22222 + 1); + SpriteRenderer_LoadPaletteFromOpenNarc(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 22222 + 2); } void sub_0208B6B0(UnkStruct_0208B878 *param0, int param1) @@ -209,17 +209,17 @@ void sub_0208B6B0(UnkStruct_0208B878 *param0, int param1) if (param0->unk_10.unk_08 == 1) { if (param0->unk_10.unk_0C == 0) { - SpriteRenderer_LoadPalette(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); + SpriteRenderer_LoadPaletteFromOpenNarc(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); } else { - SpriteRenderer_LoadPalette(v3, 2, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); + SpriteRenderer_LoadPaletteFromOpenNarc(v3, 2, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); } SpriteRenderer_LoadCharResObjFromOpenNarc(v1, v2, v0, 95, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v4); } else { if (param0->unk_10.unk_0C == 0) { - SpriteRenderer_LoadPalette(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); + SpriteRenderer_LoadPaletteFromOpenNarc(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); } else { - SpriteRenderer_LoadPalette(v3, 3, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); + SpriteRenderer_LoadPaletteFromOpenNarc(v3, 3, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); } SpriteRenderer_LoadCharResObjFromOpenNarc(v1, v2, v0, 95, 0, NNS_G2D_VRAM_TYPE_2DSUB, v4); @@ -258,10 +258,10 @@ void sub_0208B7B4(UnkStruct_0208B878 *param0) v1.resources[5] = SPRITE_RESOURCE_NONE; for (v0 = 0; v0 < param0->unk_10.unk_00; v0++) { - param0->unk_24[v0].unk_00 = SpriteActor_LoadResources(v2, v3, &v1); + param0->unk_24[v0].unk_00 = CellActor_LoadResources(v2, v3, &v1); - sub_0200D330(param0->unk_24[v0].unk_00); - SpriteActor_SetSpritePositionXY(param0->unk_24[v0].unk_00, 256 / 2, 192 / 2); + CellActorData_UpdateObject(param0->unk_24[v0].unk_00); + CellActorData_SetPositionXY(param0->unk_24[v0].unk_00, 256 / 2, 192 / 2); } } @@ -273,7 +273,7 @@ void sub_0208B830(UnkStruct_0208B878 *param0) SpriteGfxHandler_UnloadCharObjById(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); SpriteGfxHandler_UnloadCellObjById(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); SpriteGfxHandler_UnloadAnimObjById(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); - sub_0200D0F4(param0->unk_24[v0].unk_00); + CellActorData_Delete(param0->unk_24[v0].unk_00); } } @@ -390,7 +390,7 @@ BOOL sub_0208B9E0(UnkStruct_0208B878 *param0, BOOL param1) int v0; for (v0 = 0; v0 < param0->unk_10.unk_00; v0++) { - SpriteActor_EnableObject(param0->unk_24[v0].unk_00, param1); + CellActorData_DrawSprite(param0->unk_24[v0].unk_00, param1); } } @@ -413,7 +413,7 @@ void sub_0208BA30(UnkStruct_0208B878 *param0) int v0; for (v0 = 0; v0 < param0->unk_10.unk_00; v0++) { - sub_0200D364(param0->unk_24[v0].unk_00, 1); + CellActorData_SetAnim(param0->unk_24[v0].unk_00, 1); } } @@ -422,6 +422,6 @@ void sub_0208BA54(UnkStruct_0208B878 *param0) int v0; for (v0 = 0; v0 < param0->unk_10.unk_00; v0++) { - sub_0200D364(param0->unk_24[v0].unk_00, 0); + CellActorData_SetAnim(param0->unk_24[v0].unk_00, 0); } } diff --git a/src/unk_02098FFC.c b/src/unk_02098FFC.c index 628b72bdd1..6c1e517823 100644 --- a/src/unk_02098FFC.c +++ b/src/unk_02098FFC.c @@ -3,7 +3,6 @@ #include #include -#include "struct_defs/struct_02009508.h" #include "struct_defs/struct_0200D0F4.h" #include "struct_defs/struct_0209903C.h" #include "struct_defs/struct_0209903C_sub1.h" @@ -12,10 +11,10 @@ #include "cell_actor.h" #include "heap.h" #include "narc.h" +#include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_020093B4.h" #include "unk_0200A328.h" -#include "unk_0200C6E4.h" static void sub_02099058(UnkStruct_0209903C *param0); static void sub_02099118(UnkStruct_0209903C *param0); @@ -130,14 +129,14 @@ UnkStruct_0209916C *sub_0209916C(UnkStruct_0209903C *param0, int param1, u16 par v4 = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorData)); - v4->unk_08 = Heap_AllocFromHeap(param0->unk_00, sizeof(UnkStruct_02009508)); - v4->unk_08->unk_00 = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceData)); - v4->unk_04 = v4->unk_08->unk_00; + v4->cellActorResourceList = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceDataList)); + v4->cellActorResourceList->resourceDataList = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceData)); + v4->cellActorResource = v4->cellActorResourceList->resourceDataList; - sub_020093B4(v4->unk_04, 0xe000, 0xe000 + v1, 0xe000, 0xe000, 0xffffffff, 0xffffffff, 0, param5, param0->unk_1A4[0], param0->unk_1A4[1], param0->unk_1A4[2], param0->unk_1A4[3], NULL, NULL); + sub_020093B4(v4->cellActorResource, 0xe000, 0xe000 + v1, 0xe000, 0xe000, 0xffffffff, 0xffffffff, 0, param5, param0->unk_1A4[0], param0->unk_1A4[1], param0->unk_1A4[2], param0->unk_1A4[3], NULL, NULL); v5.collection = param0->unk_10; - v5.resourceData = v4->unk_04; + v5.resourceData = v4->cellActorResource; v5.position.x = FX32_CONST(param2); v5.position.y = FX32_CONST(param3); v5.position.z = FX32_CONST(param4); @@ -154,13 +153,13 @@ UnkStruct_0209916C *sub_0209916C(UnkStruct_0209903C *param0, int param1, u16 par v5.vramType = v0; v5.heapID = param0->unk_00; - v4->unk_00 = CellActorCollection_AddEx(&v5); + v4->cellActor = CellActorCollection_AddEx(&v5); - if (v4->unk_00 != NULL) { - CellActor_SetAnim(v4->unk_00, 0); + if (v4->cellActor != NULL) { + CellActor_SetAnim(v4->cellActor, 0); v2 = sub_0200A760( v6, v0); - CellActor_SetExplicitPalette(v4->unk_00, v2); + CellActor_SetExplicitPalette(v4->cellActor, v2); } else { GF_ASSERT(FALSE); } @@ -181,7 +180,7 @@ void sub_0209933C(UnkStruct_0209903C *param0, UnkStruct_0209916C *param1, int pa void sub_02099370(UnkStruct_0209903C *param0, UnkStruct_0209916C *param1) { - sub_0200D0F4(param1->unk_04); + CellActorData_Delete(param1->unk_04); param0->unk_1C4[param1->unk_00].unk_00 = 0; param0->unk_1C4[param1->unk_00].unk_02 = 0; From 217a90c80383a3900b7b962d530d83a8b7b6731b Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Tue, 5 Nov 2024 11:03:33 -0600 Subject: [PATCH 07/11] finish first pass over sprite_renderer files --- include/sprite_renderer.h | 214 +++++------ .../pokemon_summary_screen/sprite.c | 22 +- src/battle/battle_display.c | 64 ++-- src/battle/battle_script.c | 2 +- src/battle/healthbar.c | 2 +- src/battle/ov16_0226871C.c | 38 +- src/battle/ov16_0226DB7C.c | 10 +- src/battle/ov16_0226DE44.c | 8 +- src/battle/party_gauge.c | 16 +- src/overlay010/ov10_0221F800.c | 2 +- src/overlay012/ov12_0221FC20.c | 2 +- src/overlay012/ov12_02225864.c | 6 +- src/overlay012/ov12_022269C0.c | 6 +- src/overlay012/ov12_02226B84.c | 56 +-- src/overlay012/ov12_0222AC70.c | 76 ++-- src/overlay012/ov12_0222D6B0.c | 72 ++-- src/overlay012/ov12_0222E784.c | 4 +- src/overlay012/ov12_0222E91C.c | 16 +- src/overlay012/ov12_0222F700.c | 108 +++--- src/overlay012/ov12_022346A4.c | 10 +- src/overlay012/ov12_02234E44.c | 2 +- src/overlay012/ov12_02235254.c | 2 +- src/overlay012/ov12_02235E94.c | 48 +-- src/overlay013/ov13_02224500.c | 4 +- src/overlay013/ov13_02225710.c | 16 +- src/overlay013/ov13_02227BDC.c | 2 +- src/overlay013/ov13_02228128.c | 4 +- src/overlay017/ov17_0223F118.c | 6 +- src/overlay017/ov17_0223F7E4.c | 16 +- src/overlay017/ov17_02241270.c | 4 +- src/overlay017/ov17_022413D8.c | 36 +- src/overlay017/ov17_022476F8.c | 4 +- src/overlay017/ov17_022492DC.c | 8 +- src/overlay017/ov17_0224A0FC.c | 32 +- src/overlay017/ov17_02252AB0.c | 8 +- src/overlay062/ov62_0222F2C0.c | 4 +- src/overlay062/ov62_022300D8.c | 42 +-- src/overlay062/ov62_02231690.c | 2 +- src/overlay062/ov62_02234A10.c | 6 +- src/overlay062/ov62_02236CBC.c | 48 +-- src/overlay062/ov62_02246B00.c | 34 +- src/overlay076/ov76_0223B140.c | 14 +- src/overlay076/ov76_0223B870.c | 8 +- src/overlay084/ov84_0223B5A0.c | 8 +- src/overlay084/ov84_022403F4.c | 8 +- src/overlay091/ov91_021D0D80.c | 10 +- src/overlay099/ov99_021D1A54.c | 2 +- src/overlay099/ov99_021D2C08.c | 8 +- src/overlay099/ov99_021D2E28.c | 10 +- src/overlay099/ov99_021D340C.c | 26 +- src/overlay100/ov100_021D13E4.c | 4 +- src/overlay100/ov100_021D1C44.c | 4 +- src/overlay100/ov100_021D400C.c | 22 +- src/overlay104/ov104_0222FBE4.c | 6 +- src/overlay104/ov104_0223C2D4.c | 4 +- src/overlay104/ov104_0223DC7C.c | 6 +- src/overlay113/ov113_0225C700.c | 8 +- src/overlay116/ov116_022604C4.c | 2 +- src/overlay116/ov116_02261870.c | 4 +- src/overlay116/ov116_02262A8C.c | 20 +- src/overlay116/ov116_0226432C.c | 70 ++-- src/overlay117/ov117_02260668.c | 2 +- src/overlay117/ov117_022626B0.c | 2 +- src/overlay117/ov117_02263AF0.c | 120 +++--- src/overlay119/ov119_021D0D80.c | 6 +- src/overlay119/ov119_021D191C.c | 16 +- src/sprite_renderer.c | 351 +++++++++--------- src/unk_0207E0B8.c | 2 +- src/unk_02082C2C.c | 2 +- src/unk_02083370.c | 6 +- src/unk_02089604.c | 12 +- src/unk_0208A3F4.c | 16 +- src/unk_0208B284.c | 10 +- 73 files changed, 925 insertions(+), 926 deletions(-) diff --git a/include/sprite_renderer.h b/include/sprite_renderer.h index b4b5e2a8d3..16fca1944f 100644 --- a/include/sprite_renderer.h +++ b/include/sprite_renderer.h @@ -38,7 +38,7 @@ typedef struct CellTransferStateData_t { } SpriteRenderer; typedef struct AnimationResourceCollection_t { - CellActorCollection *cellActorList; + CellActorCollection *cellActorCollection; CellActorResourceDataList *cellActorDataList; SpriteResourceTable *spriteResourceTable; SpriteResourceCollection *spriteResourceCollectionList[SPRITE_RESOURCE_TYPE_MAX]; @@ -47,119 +47,119 @@ typedef struct AnimationResourceCollection_t { int numSpriteResourceTypes; } SpriteGfxHandler; -SpriteRenderer *SpriteRenderer_Create(int param0); -SpriteGfxHandler *SpriteRenderer_CreateGfxHandler(SpriteRenderer *param0); -GF_G2dRenderer *SpriteRenderer_GetG2dRenderer(SpriteRenderer *param0); -BOOL SpriteRenderer_CreateOamCharPlttManagers(SpriteRenderer *param0, const UnkStruct_ov104_0224133C *param1, const UnkStruct_ov104_022412F4 *param2, int param3); -BOOL SpriteRenderer_CreateCellActorList(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2); -void thunk_CellActor_Delete(CellActor *param0); -void SpriteGfxHandler_UpdateCellActorCollection(SpriteGfxHandler *param0); +SpriteRenderer *SpriteRenderer_Create(int heapID); +SpriteGfxHandler *SpriteRenderer_CreateGfxHandler(SpriteRenderer *renderer); +GF_G2dRenderer *SpriteRenderer_GetG2dRenderer(SpriteRenderer *renderer); +BOOL SpriteRenderer_CreateOamCharPlttManagers(SpriteRenderer *renderer, const UnkStruct_ov104_0224133C *param1, const UnkStruct_ov104_022412F4 *param2, int param3); +BOOL SpriteRenderer_CreateCellActorList(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int numCells); +void thunk_CellActor_Delete(CellActor *cellActor); +void SpriteGfxHandler_UpdateCellActorCollection(SpriteGfxHandler *gfxHandler); void OAMManager_ApplyAndResetBuffers(void); void sub_0200C808(void); -void SpriteGfxHandler_DeleteCellActorCollection(SpriteGfxHandler *param0); -void SpriteGfxHandler_DeleteCellActorData(SpriteGfxHandler *param0); -void SpriteGfxHandler_DeleteSpriteResources(SpriteGfxHandler *param0); -void SpriteRenderer_Deinit(SpriteRenderer *param0); -void SpriteRenderer_RemoveGfxHandler(SpriteRenderer *param0, SpriteGfxHandler *param1); -void SpriteRenderer_DeleteGfxHandler(SpriteRenderer *param0, SpriteGfxHandler *param1); -void SpriteRenderer_Free(SpriteRenderer *param0); -BOOL SpriteRenderer_LoadSpriteResourceData(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteResourceDataPath *param2); -CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov7_0224F358 *param2); -CellActor *SpriteRenderer_CreateCellActor(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13); -BOOL SpriteRenderer_InitGfxResourceList(SpriteRenderer *param0, SpriteGfxHandler *param1, const UnkStruct_ov104_02241308 *param2); -BOOL SpriteRenderer_LoadCharResObj(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL SpriteRenderer_LoadCharResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int vram, int resID); -s8 SpriteRenderer_LoadPaletteResObj(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, int param4, int param5, int param6, int param7); -s8 SpriteRenderer_LoadPaletteResObjFromOpenNarc(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, int param4, int param5, int param6, int param7); +void SpriteGfxHandler_DeleteCellActorCollection(SpriteGfxHandler *gfxHandler); +void SpriteGfxHandler_DeleteCellActorData(SpriteGfxHandler *gfxHandler); +void SpriteGfxHandler_DeleteSpriteResources(SpriteGfxHandler *gfxHandler); +void SpriteRenderer_Deinit(SpriteRenderer *renderer); +void SpriteRenderer_RemoveGfxHandler(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler); +void SpriteRenderer_DeleteGfxHandler(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler); +void SpriteRenderer_Free(SpriteRenderer *renderer); +BOOL SpriteRenderer_LoadSpriteResourceData(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const SpriteResourceDataPath *resourcePaths); +CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkStruct_ov7_0224F358 *template); +CellActor *SpriteRenderer_CreateCellActor(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int resourceIndex, s16 x, s16 y, s16 z, u16 anim, int priority, int palette, int vramType, int param10, int param11, int param12, int param13); +BOOL SpriteRenderer_InitGfxResourceList(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkStruct_ov104_02241308 *param2); +BOOL SpriteRenderer_LoadCharResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int vramType, int resourceID); +BOOL SpriteRenderer_LoadCharResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *param1, NARC *narc, int memberIndex, BOOL compressed, int vramType, int resourceID); +s8 SpriteRenderer_LoadPaletteResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int paletteIndex, int vramType, int resourceID); +s8 SpriteRenderer_LoadPaletteResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int paletteIndex, int vramType, int resourceID); u8 SpriteRenderer_LoadPalette(PaletteData *palette, enum PaletteBufferID bufferID, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, int compressed, int paletteIndex, int vramType, int resourceID); u8 SpriteRenderer_LoadPaletteFromOpenNarc(PaletteData *palette, enum PaletteBufferID bufferID, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, int compressed, int paletteIndex, int vramType, int resourceID); BOOL SpriteRenderer_LoadCellResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID); BOOL SpriteRenderer_LoadCellResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID); BOOL SpriteRenderer_LoadAnimResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID); BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID); -CellActorData *CellActor_LoadResources(SpriteRenderer *param0, SpriteGfxHandler *param1, const SpriteTemplate *param2); -const NNSG2dImagePaletteProxy *SpriteGfxHandler_GetPaletteProxy(SpriteGfxHandler *param0, int param1); -u32 SpriteGfxHandler_GetPaletteNumberById(SpriteGfxHandler *param0, int param1, NNS_G2D_VRAM_TYPE param2); -BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *param0, int param1); -BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler *param0, int param1); -BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler *param0, int param1); -BOOL SpriteGfxHandler_UnloadAnimObjById(SpriteGfxHandler *param0, int param1); -void SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(SpriteRenderer *param0, SpriteGfxHandler *param1); -void CellActorData_Delete(CellActorData *param0); -void CellActor_UpdateObject(CellActor *param0); -void CellActorData_UpdateObject(CellActorData *param0); -void CellActorData_Update2Frames(CellActorData *param0); -void CellActorData_UpdateNFrames(CellActorData *param0, fx32 param1); -u32 CellActorData_GetActorAnimCount(CellActorData *param0); -void CellActorData_SetAnim(CellActorData *param0, u32 param1); -void CellActorData_SetAnimNoRestart(CellActorData *param0, u32 param1); -u32 CellActorData_GetActiveAnim(CellActorData *param0); -void thunk_CellActor_SetAnimateFlag(CellActor *param0, int param1); -void CellActorData_SetAnimateFlag(CellActorData *param0, int param1); -void thunk_CellActor_SetAnimSpeed(CellActor *param0, fx32 param1); -void CellActorData_SetAnimSpeed(CellActorData *param0, fx32 param1); -BOOL thunk_CellActor_IsAnimated(CellActor *param0); -BOOL CellActorData_IsAnimated(CellActorData *param0); -void thunk_CellActor_SetAnimFrame(CellActor *param0, u16 param1); -void CellActorData_SetAnimFrame(CellActorData *param0, u16 param1); -u16 thunk_CellActor_GetAnimFrame(CellActor *param0); -u16 CellActorData_GetAnimFrame(CellActorData *param0); -void CellActor_DrawSprite(CellActor *param0, int param1); -void CellActorData_DrawSprite(CellActorData *param0, int param1); -int thunk_CellActor_GetDrawFlag(CellActor *param0); -int CellActorData_GetDrawFlag(CellActorData *param0); -void thunk_CellActor_SetExplicitPalette(CellActor *param0, int param1); -void CellActorData_SetExplicitPalette(CellActorData *param0, int param1); -void thunk_CellActor_SetExplicitPaletteOffset(CellActor *param0, int param1); -void CellActorData_SetExplicitPaletteOffset(CellActorData *param0, int param1); -int CellActorData_GetExplicitPaletteOffset(CellActorData *param0); -void thunk_CellActor_SetExplicitPriority(CellActor *param0, int param1); -int CellActorData_GetExplicitPriority(CellActorData *param0); -void CellActorData_SetExplicitPriority(CellActorData *param0, int param1); -void thunk_CellActor_SetPriority(CellActor *param0, int param1); -void CellActorData_SetPriority(CellActorData *param0, int param1); -u32 thunk_CellActor_GetPriority(CellActor *param0); -u32 CellActorData_GetPriority(CellActorData *param0); -void CellActor_SetPositionXY(CellActor *param0, s16 param1, s16 param2); -void CellActorData_SetPositionXY(CellActorData *param0, s16 param1, s16 param2); -void CellActor_SetPositionWithOffsetXY(CellActor *param0, s16 param1, s16 param2, fx32 param3); -void sub_0200D500(CellActorData *param0, s16 param1, s16 param2, fx32 param3); -void sub_0200D50C(CellActor *param0, s16 *param1, s16 *param2); -void SpriteActor_GetSpritePositionXY(CellActorData *param0, s16 *param1, s16 *param2); -void sub_0200D55C(CellActor *param0, s16 *param1, s16 *param2, fx32 param3); -void sub_0200D5A0(CellActorData *param0, s16 *param1, s16 *param2, fx32 param3); -void sub_0200D5AC(CellActor *param0, s16 param1, s16 param2); -void sub_0200D5DC(CellActorData *param0, s16 param1, s16 param2); -void sub_0200D5E8(CellActorData *param0, fx32 param1, fx32 param2); -void sub_0200D614(CellActorData *param0, fx32 param1, fx32 param2); -void sub_0200D638(CellActorData *param0, fx32 *param1, fx32 *param2); -void sub_0200D650(CellActorData *param0, fx32 param1, fx32 param2, fx32 param3); -void sub_0200D67C(CellActorData *param0, fx32 *param1, fx32 *param2, fx32 param3); -void sub_0200D69C(CellActor *param0, int param1); -void sub_0200D6A4(CellActorData *param0, int param1); -void sub_0200D6B0(CellActor *param0, f32 param1, f32 param2); -void sub_0200D6E8(CellActorData *param0, f32 param1, f32 param2); -void sub_0200D6F4(CellActor *param0, f32 param1, f32 param2); -void sub_0200D74C(CellActorData *param0, f32 param1, f32 param2); -void sub_0200D758(CellActor *param0, f32 *param1, f32 *param2); -void sub_0200D788(CellActorData *param0, f32 *param1, f32 *param2); -void sub_0200D794(CellActor *param0, u16 param1); -void sub_0200D79C(CellActorData *param0, u16 param1); -void sub_0200D7A8(CellActor *param0, s32 param1); -void sub_0200D7C0(CellActorData *param0, s32 param1); -void sub_0200D7CC(CellActor *param0, int param1); -void sub_0200D7D4(CellActorData *param0, int param1); -void sub_0200D7E0(CellActorData *param0, s16 param1, s16 param2); -void sub_0200D7FC(CellActorData *param0, BOOL param1); -void sub_0200D808(CellActor *param0, GXOamMode param1); -void SpriteActor_SetOAMMode(CellActorData *param0, GXOamMode param1); -u32 sub_0200D81C(CellActorData *param0); -BOOL sub_0200D828(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL sub_0200D888(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL sub_0200D8E8(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5, int param6); -void sub_0200D948(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5); -void sub_0200D97C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5); -CellActorCollection *sub_0200D9B0(SpriteGfxHandler *param0); -void sub_0200D9B4(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5); +CellActorData *CellActor_LoadResources(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const SpriteTemplate *template); +const NNSG2dImagePaletteProxy *SpriteGfxHandler_GetPaletteProxy(SpriteGfxHandler *gfxHandler, int resourceID); +u32 SpriteGfxHandler_GetPaletteNumberById(SpriteGfxHandler *gfxHandler, int resourceID, NNS_G2D_VRAM_TYPE vramType); +BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *gfxHandler, int resourceID); +BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler *gfxHandler, int resourceID); +BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler *gfxHandler, int resourceID); +BOOL SpriteGfxHandler_UnloadAnimObjById(SpriteGfxHandler *gfxHandler, int resourceID); +void SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(SpriteRenderer *spriteRenderer, SpriteGfxHandler *gfxHandler); +void CellActorData_Delete(CellActorData *cellActorData); +void CellActor_UpdateObject(CellActor *cellActor); +void CellActorData_UpdateObject(CellActorData *cellActorData); +void CellActorData_Update2Frames(CellActorData *cellActorData); +void CellActorData_UpdateNFrames(CellActorData *cellActorData, fx32 frames); +u32 CellActorData_GetActorAnimCount(CellActorData *cellActorData); +void CellActorData_SetAnim(CellActorData *cellActorData, u32 animID); +void CellActorData_SetAnimNoRestart(CellActorData *cellActorData, u32 animID); +u32 CellActorData_GetActiveAnim(CellActorData *cellActorData); +void thunk_CellActor_SetAnimateFlag(CellActor *cellActor, BOOL animate); +void CellActorData_SetAnimateFlag(CellActorData *cellActorData, BOOL animate); +void thunk_CellActor_SetAnimSpeed(CellActor *cellActor, fx32 speed); +void CellActorData_SetAnimSpeed(CellActorData *cellActorData, fx32 speed); +BOOL thunk_CellActor_IsAnimated(CellActor *cellActor); +BOOL CellActorData_IsAnimated(CellActorData *cellActorData); +void thunk_CellActor_SetAnimFrame(CellActor *cellActor, u16 frame); +void CellActorData_SetAnimFrame(CellActorData *cellActorData, u16 frame); +u16 thunk_CellActor_GetAnimFrame(CellActor *cellActor); +u16 CellActorData_GetAnimFrame(CellActorData *cellActorData); +void CellActor_DrawSprite(CellActor *cellActor, BOOL drawFlag); +void CellActorData_DrawSprite(CellActorData *cellActorData, BOOL drawFlag); +int thunk_CellActor_GetDrawFlag(CellActor *cellActor); +int CellActorData_GetDrawFlag(CellActorData *cellActorData); +void thunk_CellActor_SetExplicitPalette(CellActor *cellActor, int palette); +void CellActorData_SetExplicitPalette(CellActorData *cellActorData, int palette); +void thunk_CellActor_SetExplicitPaletteOffset(CellActor *cellActor, int paletteOffset); +void CellActorData_SetExplicitPaletteOffset(CellActorData *cellActorData, int paletteOffset); +int CellActorData_GetExplicitPaletteOffset(CellActorData *cellActorData); +void thunk_CellActor_SetExplicitPriority(CellActor *cellActor, int priority); +int CellActorData_GetExplicitPriority(CellActorData *cellActorData); +void CellActorData_SetExplicitPriority(CellActorData *cellActorData, int priority); +void thunk_CellActor_SetPriority(CellActor *cellActor, int priority); +void CellActorData_SetPriority(CellActorData *cellActorData, int priority); +u32 thunk_CellActor_GetPriority(CellActor *cellActor); +u32 CellActorData_GetPriority(CellActorData *cellActorData); +void CellActor_SetPositionXY(CellActor *cellActor, s16 x, s16 y); +void CellActorData_SetPositionXY(CellActorData *cellActorData, s16 x, s16 y); +void CellActor_SetPositionWithOffsetXY(CellActor *cellActor, s16 x, s16 y, fx32 offset); +void CellActorData_SetPositionWithOffsetXY(CellActorData *cellActorData, s16 x, s16 y, fx32 offset); +void CellActor_GetPositionXY(CellActor *cellActor, s16 *x, s16 *y); +void CellActorData_GetPositionXY(CellActorData *cellActorData, s16 *x, s16 *y); +void CellActor_GetPositionWithOffsetXY(CellActor *cellActor, s16 *x, s16 *y, fx32 offset); +void CellActorData_GetPositionWithOffsetXY(CellActorData *cellActorData, s16 *x, s16 *y, fx32 offset); +void CellActor_AddPositionXY(CellActor *cellActor, s16 x, s16 y); +void CellActorData_AddPositionXY(CellActorData *cellActorData, s16 x, s16 y); +void CellActorData_AddPositionXYFx32(CellActorData *cellActorData, fx32 x, fx32 y); +void CellActorData_SetPositionFx32(CellActorData *cellActorData, fx32 x, fx32 y); +void CellActorData_GetPositionFx32(CellActorData *cellActorData, fx32 *x, fx32 *y); +void CellActorData_SetPositionWithOffsetFx32(CellActorData *cellActorData, fx32 x, fx32 y, fx32 offset); +void CellActorData_GetPositionFx32WithOffset(CellActorData *cellActorData, fx32 *x, fx32 *y, fx32 offset); +void thunk_CellActor_SetAffineOverwriteMode(CellActor *cellActor, enum AffineOverwriteMode mode); +void CellActorData_SetAffineOverwriteMode(CellActorData *cellActorData, enum AffineOverwriteMode mode); +void CellActor_SetAffineScaleXYFx32(CellActor *cellActor, f32 x, f32 y); +void CellActorData_SetAffineScaleXYFx32(CellActorData *cellActorData, f32 x, f32 y); +void CellActor_AddAffineScaleFx32(CellActor *cellActor, f32 x, f32 y); +void CellActorData_AddAffineScaleFx32(CellActorData *cellActorData, f32 x, f32 y); +void CellActor_GetAffineScaleF32(CellActor *cellActor, f32 *x, f32 *y); +void CellActorData_GetAffineScaleF32(CellActorData *cellActorData, f32 *x, f32 *y); +void thunk_CellActor_SetAffineZRotation(CellActor *cellActor, u16 angle); +void CellActorData_SetAffineZRotation(CellActorData *cellActorData, u16 angle); +void CellActor_AddAffineZRotation(CellActor *cellActor, s32 angle); +void CellActorData_AddAffineZRotation(CellActorData *cellActorData, s32 angle); +void thunk_CellActor_SetFlipMode(CellActor *cellActor, int mode); +void CellActorData_SetFlipMode(CellActorData *cellActorData, int mode); +void CellActorData_SetAffineTranslationXY(CellActorData *cellActorData, s16 x, s16 y); +void CellActorData_SetPixelated(CellActorData *cellActorData, BOOL pixelated); +void thunk_CellActor_SetExplicitOAMMode(CellActor *cellActor, GXOamMode mode); +void CellActorData_SetExplicitOAMMode(CellActorData *cellActorData, GXOamMode mode); +u32 CellActorData_GetUserAttrForCurrentAnimFrame(CellActorData *cellActorData); +BOOL sub_0200D828(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int vramType, int resourceID); +BOOL sub_0200D888(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int vramType, int resourceID); +BOOL sub_0200D8E8(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int vramType, int resourceID); +void SpriteRenderer_ModifyTiles(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID); +void SpriteRenderer_ModifyPalette(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID); +CellActorCollection *SpriteGfxHandler_GetCellActorCollection(SpriteGfxHandler *gfxHandler); +void SpriteRenderer_ModifyTilesFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID); #endif // POKEPLATINUM_UNK_0200C6E4_H diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index b53a60e2a9..05cf8e5b5b 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -272,7 +272,7 @@ void sub_0208ECF4(PokemonSummaryScreen *param0) } } - sub_0200D50C(v0[v5], &v1, &v2); + CellActor_GetPositionXY(v0[v5], &v1, &v2); if (param0->page >= v5) { v1 = v3 + v6 * 16; @@ -321,8 +321,8 @@ void sub_0208EE3C(PokemonSummaryScreen *param0) v0 = 21 + param0->monData.caughtBall - 1; } - sub_0200D948(param0->renderer, param0->gfxHandler, 39, v0, 0, 0); - sub_0200D97C(param0->renderer, param0->gfxHandler, 39, 37 + Unk_020F411C[param0->monData.caughtBall], 0, 6); + SpriteRenderer_ModifyTiles(param0->renderer, param0->gfxHandler, 39, v0, 0, 0); + SpriteRenderer_ModifyPalette(param0->renderer, param0->gfxHandler, 39, 37 + Unk_020F411C[param0->monData.caughtBall], 0, 6); } void sub_0208EE9C(PokemonSummaryScreen *param0) @@ -431,7 +431,7 @@ void sub_0208F16C(PokemonSummaryScreen *param0) static void sub_0208F194(PokemonSummaryScreen *param0, u8 param1, u8 param2, u8 param3) { - sub_0200D948(param0->renderer, param0->gfxHandler, sub_0207C944(), sub_0207C908(param3), 1, param2); + SpriteRenderer_ModifyTiles(param0->renderer, param0->gfxHandler, sub_0207C944(), sub_0207C908(param3), 1, param2); thunk_CellActor_SetExplicitPalette(param0->unk_41C[param1], sub_0207C92C(param3) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); } @@ -442,7 +442,7 @@ static void sub_0208F1E4(PokemonSummaryScreen *param0, u8 *param1, s16 *param2, v1 = 42 + *param1 * 32; for (v0 = 0; v0 < 4; v0++) { - sub_0200D50C(param0->unk_41C[13 + v0], param2, param3); + CellActor_GetPositionXY(param0->unk_41C[13 + v0], param2, param3); if (v1 == *param3) { *param1 = (u8)v0; @@ -466,7 +466,7 @@ void PokemonSummaryScreen_UpdateMoveCategoryIcon(PokemonSummaryScreen *summarySc { u32 category = MoveTable_LoadParam(move, MOVEATTRIBUTE_CLASS); - sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, sub_0207CAC0(), sub_0207CA90(category), 1, 10); + SpriteRenderer_ModifyTiles(summaryScreen->renderer, summaryScreen->gfxHandler, sub_0207CAC0(), sub_0207CA90(category), 1, 10); thunk_CellActor_SetExplicitPalette(summaryScreen->unk_41C[18], sub_0207CAA8(category) + RESDAT_PST_PAL_NARC_27_MEMBER_74_1_OFFSET); } @@ -479,7 +479,7 @@ void sub_0208F310(PokemonSummaryScreen *summaryScreen) { s16 v0, v1; - sub_0200D50C(summaryScreen->unk_41C[9], &v0, &v1); + CellActor_GetPositionXY(summaryScreen->unk_41C[9], &v0, &v1); CellActor_SetPositionXY(summaryScreen->unk_41C[10], v0, v1); CellActor_SetDrawFlag(summaryScreen->unk_41C[10], TRUE); } @@ -670,14 +670,14 @@ void sub_0208F71C(PokemonSummaryScreen *param0) v1 = Pokemon_IconSpriteIndex(v0); } - sub_0200D948(param0->renderer, param0->gfxHandler, 19, v1, 0, 11); + SpriteRenderer_ModifyTiles(param0->renderer, param0->gfxHandler, 19, v1, 0, 11); thunk_CellActor_SetExplicitPalette(param0->unk_41C[19], PokeIconPaletteIndex(param0->monData.species, param0->monData.form, param0->monData.isEgg) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); CellActor_SetFlipMode(param0->unk_41C[19], (PokemonPersonalData_GetFormValue(param0->monData.species, param0->monData.form, 28) ^ 1)); } void PokemonSummaryScreen_ShowMonIcon(PokemonSummaryScreen *summaryScreen) { - sub_0200D97C(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, PokeIconPalettesFileIndex(), FALSE, 5); + SpriteRenderer_ModifyPalette(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, PokeIconPalettesFileIndex(), FALSE, 5); if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { CellActor_SetPositionXY(summaryScreen->unk_41C[19], 24, 48); @@ -733,7 +733,7 @@ void PokemonSummaryScreen_HideContestStatDots(PokemonSummaryScreen *summaryScree static void sub_0208F9B0(PokemonSummaryScreen *summaryScreen, u8 ribbonNum, u8 param2) { - sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, 39, Ribbon_GetData(ribbonNum, RIBBON_DATA_SPRITE_ID), 0, 26 + param2); + SpriteRenderer_ModifyTiles(summaryScreen->renderer, summaryScreen->gfxHandler, 39, Ribbon_GetData(ribbonNum, RIBBON_DATA_SPRITE_ID), 0, 26 + param2); thunk_CellActor_SetExplicitPalette(summaryScreen->unk_41C[55 + param2], Ribbon_GetData(ribbonNum, RIBBON_DATA_PALETTE_NUM) + RESDAT_PST_PAL_NARC_20_MEMBER_23_3_OFFSET); } @@ -749,7 +749,7 @@ void sub_0208FA04(PokemonSummaryScreen *summaryScreen) return; } - sub_0200D97C(summaryScreen->renderer, summaryScreen->gfxHandler, 39, 136, 0, 5); + SpriteRenderer_ModifyPalette(summaryScreen->renderer, summaryScreen->gfxHandler, 39, 136, 0, 5); for (i = 0; i < 12; i++) { if (i < summaryScreen->ribbonMax) { diff --git a/src/battle/battle_display.c b/src/battle/battle_display.c index a0219bfc7d..0b97fb2c30 100644 --- a/src/battle/battle_display.c +++ b/src/battle/battle_display.c @@ -1518,17 +1518,17 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) v0->unk_12++; case 2: if (v0->unk_13 == 2) { - SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); + CellActorData_GetPositionXY(v0->unk_0C->unk_00, &v2, &v3); if ((v0->unk_1C == 1) || (v0->unk_1C == 3)) { if (v2 < (24 * 8)) { - sub_0200D5DC(v0->unk_0C->unk_00, 8, 0); + CellActorData_AddPositionXY(v0->unk_0C->unk_00, 8, 0); } else { CellActorData_SetPositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } } - SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); + CellActorData_GetPositionXY(v0->unk_0C->unk_00, &v2, &v3); if (v0->unk_1C == 1) { sub_02007DEC(v0->unk_08, 0, v2); @@ -1565,17 +1565,17 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) v0->unk_12++; } } else { - SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); + CellActorData_GetPositionXY(v0->unk_0C->unk_00, &v2, &v3); if ((v0->unk_1C == 0) || (v0->unk_1C == 2)) { if (v2 > 64) { - sub_0200D5DC(v0->unk_0C->unk_00, -8, 0); + CellActorData_AddPositionXY(v0->unk_0C->unk_00, -8, 0); } else { CellActorData_SetPositionXY(v0->unk_0C->unk_00, 64, (128 + 8)); } } - SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); + CellActorData_GetPositionXY(v0->unk_0C->unk_00, &v2, &v3); if (v0->unk_1C == 0) { sub_02007DEC(v0->unk_08, 0, v2); @@ -1657,17 +1657,17 @@ static void ov16_0225E894(SysTask *param0, void *param1) v0->unk_12++; case 2: - SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); + CellActorData_GetPositionXY(v0->unk_0C->unk_00, &v2, &v3); if ((v0->unk_1C == 1) || (v0->unk_1C == 3)) { if (v2 < (24 * 8)) { - sub_0200D5DC(v0->unk_0C->unk_00, 8, 0); + CellActorData_AddPositionXY(v0->unk_0C->unk_00, 8, 0); } else { CellActorData_SetPositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } } - SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); + CellActorData_GetPositionXY(v0->unk_0C->unk_00, &v2, &v3); sub_02008274(v0->unk_08, 1, 8 / 2); if (sub_020080C0(v0->unk_08, 1) >= v0->unk_14) { @@ -2333,19 +2333,19 @@ static void ov16_0225FA70(SysTask *param0, void *param1) v0->unk_0E = 2; case 2: - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); - SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); + CellActorData_GetPositionXY(v0->unk_04->unk_00, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_08, &v3, &v4); if (v0->unk_0F == 2) { if ((v0->unk_14 == 1) || (v0->unk_14 == 3)) { if (v1 < (24 * 8)) { - sub_0200D5DC(v0->unk_04->unk_00, 8, 0); + CellActorData_AddPositionXY(v0->unk_04->unk_00, 8, 0); } else { CellActorData_SetPositionXY(v0->unk_04->unk_00, (24 * 8), (8 * 11)); } } - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_04->unk_00, &v1, &v2); if ((v0->unk_14 == 1) || ((v0->unk_14 == 3) && ((v5 == (0x2 | 0x1)) || (v5 == ((0x2 | 0x1) | 0x80)) || (v5 == ((0x4 | 0x1) | 0x2))))) { CellActorData_SetPositionXY(v0->unk_08, v1, v4); @@ -2353,15 +2353,15 @@ static void ov16_0225FA70(SysTask *param0, void *param1) v1 = v3 - v1; v1 -= 24; - sub_0200D5DC(v0->unk_08, -v1, 0); + CellActorData_AddPositionXY(v0->unk_08, -v1, 0); } else if (v0->unk_14 == 5) { v1 = v1 - v3; v1 -= 16; - sub_0200D5DC(v0->unk_08, v1, 0); + CellActorData_AddPositionXY(v0->unk_08, v1, 0); } - SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); + CellActorData_GetPositionXY(v0->unk_08, &v3, &v4); if (v3 >= v0->unk_10) { CellActorData_SetPositionXY(v0->unk_08, v0->unk_10, v4); @@ -2382,13 +2382,13 @@ static void ov16_0225FA70(SysTask *param0, void *param1) } else { if ((v0->unk_14 == 0) || (v0->unk_14 == 2)) { if (v1 > 64) { - sub_0200D5DC(v0->unk_04->unk_00, -8, 0); + CellActorData_AddPositionXY(v0->unk_04->unk_00, -8, 0); } else { CellActorData_SetPositionXY(v0->unk_04->unk_00, 64, (128 + 8)); } } - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_04->unk_00, &v1, &v2); if ((v0->unk_14 == 0) || ((v0->unk_14 == 2) && ((v5 == (0x2 | 0x1)) || (v5 == ((0x2 | 0x1) | 0x80)) || (v5 == ((0x2 | 0x1) | 0x10)) || (v5 == ((0x4 | 0x1) | 0x2))))) { CellActorData_SetPositionXY(v0->unk_08, v1, v4); @@ -2396,15 +2396,15 @@ static void ov16_0225FA70(SysTask *param0, void *param1) v1 = v1 - v3; v1 -= 24; - sub_0200D5DC(v0->unk_08, v1, 0); + CellActorData_AddPositionXY(v0->unk_08, v1, 0); } else if (v0->unk_14 == 4) { v1 = v3 - v1; v1 -= 16; - sub_0200D5DC(v0->unk_08, -v1, 0); + CellActorData_AddPositionXY(v0->unk_08, -v1, 0); } - SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); + CellActorData_GetPositionXY(v0->unk_08, &v3, &v4); if (v3 <= v0->unk_10) { CellActorData_SetPositionXY(v0->unk_08, v0->unk_10, v4); @@ -2579,8 +2579,8 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) break; case 1: if (v0->unk_0B == 2) { - sub_0200D5DC(v0->unk_04->unk_18, 5, 0); - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); + CellActorData_AddPositionXY(v0->unk_04->unk_18, 5, 0); + CellActorData_GetPositionXY(v0->unk_04->unk_18, &v1, &v2); if ((v1 >= (256 - 48) - 48) && (ov12_02237890(v0->unk_04->unk_84) != 0)) { ov12_02237E0C(v0->unk_04->unk_84, 1); @@ -2620,8 +2620,8 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) } break; case 2: - sub_0200D5DC(v0->unk_04->unk_18, -5, 0); - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); + CellActorData_AddPositionXY(v0->unk_04->unk_18, -5, 0); + CellActorData_GetPositionXY(v0->unk_04->unk_18, &v1, &v2); if (v0->unk_04->unk_84) { v3 = CellActorData_GetAnimFrame(v0->unk_04->unk_18); @@ -2668,7 +2668,7 @@ static void ov16_0225FD5C(SysTask *param0, void *param1) } break; case 3: - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_04->unk_18, &v1, &v2); v3 = CellActorData_GetAnimFrame(v0->unk_04->unk_18); if (v3 == 4) { @@ -2726,15 +2726,15 @@ static void ov16_02260284(SysTask *param0, void *param1) switch (v0->unk_0A) { case 0: if (v0->unk_0B == 2) { - sub_0200D5DC(v0->unk_04->unk_18, 5, 0); - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); + CellActorData_AddPositionXY(v0->unk_04->unk_18, 5, 0); + CellActorData_GetPositionXY(v0->unk_04->unk_18, &v1, &v2); if (v1 >= (256 + 40)) { v0->unk_0A++; } } else { - sub_0200D5DC(v0->unk_04->unk_18, -5, 0); - SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); + CellActorData_AddPositionXY(v0->unk_04->unk_18, -5, 0); + CellActorData_GetPositionXY(v0->unk_04->unk_18, &v1, &v2); if (v1 <= -40) { v0->unk_0A++; @@ -2767,7 +2767,7 @@ static void ov16_02260384(SysTask *param0, void *param1) switch (v0->unk_0A) { case 0: - SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_04, &v1, &v2); if (v0->unk_0B == 0) { v1 += 5; @@ -6268,7 +6268,7 @@ static BOOL ov16_02264650(UnkStruct_ov16_02264650_1 *param0, CellActorData *para int v1; BOOL v2 = 0; - v1 = sub_0200D81C(param0->unk_08); + v1 = CellActorData_GetUserAttrForCurrentAnimFrame(param0->unk_08); switch (v1) { case 1: diff --git a/src/battle/battle_script.c b/src/battle/battle_script.c index 87481e1adc..3a6f893e33 100644 --- a/src/battle/battle_script.c +++ b/src/battle/battle_script.c @@ -12268,7 +12268,7 @@ static void BattleScript_LoadPartyLevelUpIcon(BattleSystem *param0, BattleScript v12.unk_00 = param1->tmpPtr[0]; v12.unk_04 = &v9; - v12.unk_08 = sub_0200D9B0(v2); + v12.unk_08 = SpriteGfxHandler_GetCellActorCollection(v2); v12.unk_0C = SpriteGfxHandler_GetPaletteProxy(v2, 20016); v12.unk_10 = NULL; v12.unk_14 = v11.unk_04; diff --git a/src/battle/healthbar.c b/src/battle/healthbar.c index 60f5e7e468..517ac731b2 100644 --- a/src/battle/healthbar.c +++ b/src/battle/healthbar.c @@ -1007,7 +1007,7 @@ static void ScrollHealthbarTask(SysTask *task, void *data) const SpriteTemplate *template = Healthbar_SpriteTemplate(healthbar->type); s16 x, y; - SpriteActor_GetSpritePositionXY(healthbar->mainActor, &x, &y); + CellActorData_GetPositionXY(healthbar->mainActor, &x, &y); // Determine new X and Y based on the type of healthbar switch (healthbar->type) { diff --git a/src/battle/ov16_0226871C.c b/src/battle/ov16_0226871C.c index 44cec8528c..715adb3c85 100644 --- a/src/battle/ov16_0226871C.c +++ b/src/battle/ov16_0226871C.c @@ -1350,7 +1350,7 @@ void ov16_02268D40(NARC *param0, UnkStruct_ov16_02268A14 *param1) for (v0 = 0; v0 < 6; v0++) { param1->unk_5BC[v0] = CellActor_LoadResources(v1, v2, &Unk_ov16_02270414); CellActor_SetPositionWithOffsetXY(param1->unk_5BC[v0]->cellActor, 12 + 19 * v0, 13, ((192 + 80) << FX32_SHIFT)); - sub_0200D6A4(param1->unk_5BC[v0], 1); + CellActorData_SetAffineOverwriteMode(param1->unk_5BC[v0], 1); param1->unk_5D4[v0] = CellActor_LoadResources(v1, v2, &Unk_ov16_02270448); CellActor_SetPositionWithOffsetXY(param1->unk_5D4[v0]->cellActor, 246 + -12 * v0, 9, ((192 + 80) << FX32_SHIFT)); @@ -1441,10 +1441,10 @@ static void ov16_02268FCC(SysTask *param0, void *param1) break; case 2: case 4: - sub_0200D7C0(v0->unk_5BC[v1], 0x800); + CellActorData_AddAffineZRotation(v0->unk_5BC[v1], 0x800); v2->unk_00 += 0x180; - sub_0200D500(v0->unk_5BC[v1], 12 + 19 * v1 + v2->unk_00 / 0x100, 13, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v0->unk_5BC[v1], 12 + 19 * v1 + v2->unk_00 / 0x100, 13, ((192 + 80) << FX32_SHIFT)); v2->unk_06++; if (v2->unk_06 >= v2->unk_07) { @@ -1453,8 +1453,8 @@ static void ov16_02268FCC(SysTask *param0, void *param1) if (v2->unk_03 == 2) { v2->unk_03++; } else { - sub_0200D79C(v0->unk_5BC[v1], 0); - sub_0200D500(v0->unk_5BC[v1], 12 + 19 * v1, 13, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetAffineZRotation(v0->unk_5BC[v1], 0); + CellActorData_SetPositionWithOffsetXY(v0->unk_5BC[v1], 12 + 19 * v1, 13, ((192 + 80) << FX32_SHIFT)); v2->unk_00 = 0; @@ -1475,10 +1475,10 @@ static void ov16_02268FCC(SysTask *param0, void *param1) break; case 3: - sub_0200D7C0(v0->unk_5BC[v1], -0x800); + CellActorData_AddAffineZRotation(v0->unk_5BC[v1], -0x800); v2->unk_00 -= 0x180; - sub_0200D500(v0->unk_5BC[v1], 12 + 19 * v1 + v2->unk_00 / 0x100, 13, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v0->unk_5BC[v1], 12 + 19 * v1 + v2->unk_00 / 0x100, 13, ((192 + 80) << FX32_SHIFT)); v2->unk_06++; if (v2->unk_06 >= v2->unk_07 * 2) { @@ -1805,7 +1805,7 @@ static void ov16_02269668(UnkStruct_ov16_02268A14 *param0, int param1, int param v9 -= 32 / 2; } - sub_0200D500(v8, v9, v10 - (((192 + 80) << FX32_SHIFT) >> FX32_SHIFT), ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v8, v9, v10 - (((192 + 80) << FX32_SHIFT) >> FX32_SHIFT), ((192 + 80) << FX32_SHIFT)); } } @@ -2520,7 +2520,7 @@ static CellActorData *ov16_0226A7A4(UnkStruct_ov16_02268A14 *param0, Pokemon *pa v3.y = Unk_ov16_02270304[v5][1]; v4 = CellActor_LoadResources(v0, v1, &v3); - sub_0200D500(v4, v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v4, v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); CellActor_SetExplicitPaletteOffsetAutoAdjust(v4->cellActor, Pokemon_IconPaletteIndex(param1)); { @@ -2644,7 +2644,7 @@ static void ov16_0226A98C(UnkStruct_ov16_02268A14 *param0, UnkStruct_ov16_0226A9 v0.unk_00 = param0->unk_4C8; v0.unk_04 = &v1; - v0.unk_08 = sub_0200D9B0(v6); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(v6); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; @@ -2881,7 +2881,7 @@ static void ov16_0226AF0C(UnkStruct_ov16_02268A14 *param0) param0->unk_5EC[v0] = sub_0207CA58(v1, v2, v5, &v3); - sub_0200D500(param0->unk_5EC[v0], v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_5EC[v0], v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); { void *v8; @@ -3232,7 +3232,7 @@ static void ov16_0226B390(SysTask *param0, void *param1) sub_020128C4(v0->unk_4CC[v0->unk_67C.unk_04_val3.unk_0D].unk_00, v2, v3 + -2); if ((v0->unk_67C.unk_04_val3.unk_0E != 0xff) && (v0->unk_60C[v0->unk_67C.unk_04_val3.unk_0E] != NULL)) { - sub_0200D5DC(v0->unk_60C[v0->unk_67C.unk_04_val3.unk_0E], 0, -2); + CellActorData_AddPositionXY(v0->unk_60C[v0->unk_67C.unk_04_val3.unk_0E], 0, -2); } v0->unk_67C.unk_00++; @@ -3252,7 +3252,7 @@ static void ov16_0226B390(SysTask *param0, void *param1) sub_020128C4(v0->unk_4CC[v0->unk_67C.unk_04_val3.unk_0D].unk_00, v2, v3 + 1); if ((v0->unk_67C.unk_04_val3.unk_0E != 0xff) && (v0->unk_60C[v0->unk_67C.unk_04_val3.unk_0E] != NULL)) { - sub_0200D5DC(v0->unk_60C[v0->unk_67C.unk_04_val3.unk_0E], 0, 1); + CellActorData_AddPositionXY(v0->unk_60C[v0->unk_67C.unk_04_val3.unk_0E], 0, 1); } v0->unk_67C.unk_00++; @@ -3338,10 +3338,10 @@ static void ov16_0226B4E0(SysTask *param0, void *param1) sub_020128C4(v0->unk_4CC[v6].unk_00, v2, v3 + -2); if (v9 != 0) { - sub_0200D5AC(v0->unk_5EC[v7]->cellActor, 0, -2); + CellActor_AddPositionXY(v0->unk_5EC[v7]->cellActor, 0, -2); if (v0->unk_5FC[v7] != NULL) { - sub_0200D5AC(v0->unk_5FC[v7]->cellActor, 0, -2); + CellActor_AddPositionXY(v0->unk_5FC[v7]->cellActor, 0, -2); } } } else { @@ -3372,10 +3372,10 @@ static void ov16_0226B4E0(SysTask *param0, void *param1) sub_020128C4(v0->unk_4CC[v6].unk_00, v2, v3 + 1); if (v9 != 0) { - sub_0200D5AC(v0->unk_5EC[v7]->cellActor, 0, 1); + CellActor_AddPositionXY(v0->unk_5EC[v7]->cellActor, 0, 1); if (v0->unk_5FC[v7] != NULL) { - sub_0200D5AC(v0->unk_5FC[v7]->cellActor, 0, 1); + CellActor_AddPositionXY(v0->unk_5FC[v7]->cellActor, 0, 1); } } } else { @@ -3421,7 +3421,7 @@ static void ov16_0226B780(SysTask *param0, void *param1) } if (v0->unk_60C[v5] != NULL) { - sub_0200D5DC(v0->unk_60C[v5], 0, -2); + CellActorData_AddPositionXY(v0->unk_60C[v5], 0, -2); } } } @@ -3450,7 +3450,7 @@ static void ov16_0226B780(SysTask *param0, void *param1) } if (v0->unk_60C[v5] != NULL) { - sub_0200D5DC(v0->unk_60C[v5], 0, 1); + CellActorData_AddPositionXY(v0->unk_60C[v5], 0, 1); } } } diff --git a/src/battle/ov16_0226DB7C.c b/src/battle/ov16_0226DB7C.c index 04fcdd3e19..3fe1345094 100644 --- a/src/battle/ov16_0226DB7C.c +++ b/src/battle/ov16_0226DB7C.c @@ -104,10 +104,10 @@ void ov16_0226DCCC(UnkStruct_ov16_0226DC24 *param0, int param1, int param2, int { int v0; - sub_0200D500(param0->unk_00[0], param1, param2, param9); - sub_0200D500(param0->unk_00[1], param3, param4, param9); - sub_0200D500(param0->unk_00[2], param5, param6, param9); - sub_0200D500(param0->unk_00[3], param7, param8, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[0], param1, param2, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[1], param3, param4, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[2], param5, param6, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[3], param7, param8, param9); CellActorData_SetAnim(param0->unk_00[0], 0); CellActorData_SetAnim(param0->unk_00[1], 1); @@ -136,7 +136,7 @@ void ov16_0226DD9C(UnkStruct_ov16_0226DC24 *param0, int param1, int param2, int void ov16_0226DDC0(UnkStruct_ov16_0226DC24 *param0, int param1, int param2, int param3, fx32 param4) { - sub_0200D500(param0->unk_00[4], param1, param2, param4); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[4], param1, param2, param4); CellActorData_SetAnim(param0->unk_00[4], param3); CellActorData_DrawSprite(param0->unk_00[4], 1); } diff --git a/src/battle/ov16_0226DE44.c b/src/battle/ov16_0226DE44.c index 2e1f8137f1..ebaf98ed90 100644 --- a/src/battle/ov16_0226DE44.c +++ b/src/battle/ov16_0226DE44.c @@ -113,7 +113,7 @@ void ov16_0226DF80(UnkStruct_ov16_0226DEEC *param0, int param1, int param2, fx32 param0->unk_0C = param2; param0->unk_14 = param3; - sub_0200D500(param0->unk_00, param1, param2, param3); + CellActorData_SetPositionWithOffsetXY(param0->unk_00, param1, param2, param3); CellActorData_DrawSprite(param0->unk_00, 1); } @@ -174,7 +174,7 @@ static void ov16_0226DFD8(SysTask *param0, void *param1) if (v0->unk_1C == 0) { v1 = FX_Mul(sub_0201D15C(v0->unk_10 / 100), 14 << FX32_SHIFT) / FX32_ONE; - sub_0200D500(v0->unk_00, v0->unk_08, v0->unk_0C - v1, v0->unk_14); + CellActorData_SetPositionWithOffsetXY(v0->unk_00, v0->unk_08, v0->unk_0C - v1, v0->unk_14); } } @@ -189,7 +189,7 @@ static void ov16_0226DFD8(SysTask *param0, void *param1) } break; case 1: - sub_0200D500(v0->unk_00, v0->unk_08, v0->unk_0C + 8, v0->unk_14); + CellActorData_SetPositionWithOffsetXY(v0->unk_00, v0->unk_08, v0->unk_0C + 8, v0->unk_14); v0->unk_1B = 1; v0->unk_1D++; break; @@ -197,7 +197,7 @@ static void ov16_0226DFD8(SysTask *param0, void *param1) v0->unk_1E++; if (v0->unk_1E > 2) { - sub_0200D500(v0->unk_00, v0->unk_08, v0->unk_0C + 2, v0->unk_14); + CellActorData_SetPositionWithOffsetXY(v0->unk_00, v0->unk_08, v0->unk_0C + 2, v0->unk_14); v0->unk_1E = 0; v0->unk_1D++; } diff --git a/src/battle/party_gauge.c b/src/battle/party_gauge.c index 6a27b3f45b..b00801f998 100644 --- a/src/battle/party_gauge.c +++ b/src/battle/party_gauge.c @@ -344,7 +344,7 @@ static void ShowArrowTask(SysTask *task, void *data) case SHOW_ARROW_INIT: s16 x, y; - SpriteActor_GetSpritePositionXY(arrow->cells, &x, &y); + CellActorData_GetPositionXY(arrow->cells, &x, &y); arrow->x = x << 8; arrow->state++; // fall-through @@ -405,10 +405,10 @@ static void HideArrowTask(SysTask *task, void *data) case HIDE_ARROW_INIT: s16 x, y; - SpriteActor_GetSpritePositionXY(arrow->cells, &x, &y); + CellActorData_GetPositionXY(arrow->cells, &x, &y); arrow->x = x << 8; - SpriteActor_SetOAMMode(arrow->cells, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(arrow->cells, GX_OAM_MODE_XLU); arrow->alpha = 16 << 8; G2_SetBlendAlpha(GX_BLEND_PLANEMASK_NONE, GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BD, (arrow->alpha >> 8), 16 - (arrow->alpha >> 8)); @@ -513,7 +513,7 @@ static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) switch (pokeballs->state) { case SHOW_POKEBALLS_INIT: s16 x, y; - SpriteActor_GetSpritePositionXY(pokeballs->cells, &x, &y); + CellActorData_GetPositionXY(pokeballs->cells, &x, &y); pokeballs->xStart = x << 8; pokeballs->state++; @@ -617,7 +617,7 @@ static void ShowPokeballsMidBattleTask(SysTask *task, void *data) switch (pokeballs->state) { case SHOW_POKEBALLS_INIT: s16 x, y; - SpriteActor_GetSpritePositionXY(pokeballs->cells, &x, &y); + CellActorData_GetPositionXY(pokeballs->cells, &x, &y); pokeballs->xStart = x << 8; SpriteActor_SetAnimFrame(pokeballs->cells->cellActor, 0); @@ -697,10 +697,10 @@ static void HidePokeballsStartOfBattleTask(SysTask *task, void *data) case HIDE_POKEBALLS_INIT: s16 x, y; - SpriteActor_GetSpritePositionXY(pokeballs->cells, &x, &y); + CellActorData_GetPositionXY(pokeballs->cells, &x, &y); pokeballs->xStart = x << 8; - SpriteActor_SetOAMMode(pokeballs->cells, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(pokeballs->cells, GX_OAM_MODE_XLU); pokeballs->state++; // fall-through case HIDE_POKEBALLS_DELAY: @@ -749,7 +749,7 @@ static void HidePokeballsMidBattleTask(SysTask *task, void *data) switch (pokeballs->state) { case HIDE_POKEBALLS_INIT: - SpriteActor_SetOAMMode(pokeballs->cells, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(pokeballs->cells, GX_OAM_MODE_XLU); pokeballs->state++; // fall-through case HIDE_POKEBALLS_DELAY: diff --git a/src/overlay010/ov10_0221F800.c b/src/overlay010/ov10_0221F800.c index 0027c2d487..af871da38e 100644 --- a/src/overlay010/ov10_0221F800.c +++ b/src/overlay010/ov10_0221F800.c @@ -1574,7 +1574,7 @@ static void ov10_0222130C(UnkStruct_ov10_0221FB28 *param0, u32 param1, Strbuf *p v1.unk_00 = param0->unk_B38; v1.unk_04 = v0; - v1.unk_08 = sub_0200D9B0(param0->unk_194); + v1.unk_08 = SpriteGfxHandler_GetCellActorCollection(param0->unk_194); v1.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_194, 47111); v1.unk_10 = NULL; v1.unk_14 = ((1024 - (8 * 2) - (4 * 4)) - (8 * 2) * param1) * 0x20; diff --git a/src/overlay012/ov12_0221FC20.c b/src/overlay012/ov12_0221FC20.c index 213fcf3a40..f49db84e26 100644 --- a/src/overlay012/ov12_0221FC20.c +++ b/src/overlay012/ov12_0221FC20.c @@ -2213,7 +2213,7 @@ static void ov12_02221580(UnkStruct_ov12_0221FCDC *param0) } if ((ov12_0221FDD4(param0) == 1) && (IsFormSymmetrical(ov12_022232D0(param0, v7), v10) == 1)) { - sub_0200D7D4(v1, 1); + CellActorData_SetFlipMode(v1, 1); } } diff --git a/src/overlay012/ov12_02225864.c b/src/overlay012/ov12_02225864.c index 5031c30ea7..960359305b 100644 --- a/src/overlay012/ov12_02225864.c +++ b/src/overlay012/ov12_02225864.c @@ -223,7 +223,7 @@ void ov12_022259FC(UnkStruct_ov12_02225F6C *param0, CellActorData *param1) f32 v0, v1; ov12_02225FA4(param0, &v0, &v1); - sub_0200D6E8(param1, v0, v1); + CellActorData_SetAffineScaleXYFx32(param1, v0, v1); } void ov12_02225A18(UnkStruct_ov12_02225F6C *param0, Sprite *param1, s16 param2, s16 param3) @@ -618,7 +618,7 @@ void ov12_0222605C(CellActorData *param0, s16 param1, s16 param2, fx32 param3, i v1 = param1 - param2; } - SpriteActor_GetSpritePositionXY(param0, &v2, &v3); + CellActorData_GetPositionXY(param0, &v2, &v3); CellActorData_SetPositionXY(param0, v2, v1 + v0); } @@ -779,7 +779,7 @@ BOOL ov12_02226274(UnkStruct_ov12_02226274 *param0) CellActorData_SetPositionXY(param0->unk_98[v0], param0->unk_00 + param0->unk_04[v0].unk_00, param0->unk_02 + param0->unk_04[v0].unk_02); } else { ov12_02225FA4(¶m0->unk_04[v0], &v2, &v3); - sub_0200D6E8(param0->unk_98[v0], v2, v3); + CellActorData_SetAffineScaleXYFx32(param0->unk_98[v0], v2, v3); } } else { CellActorData_DrawSprite(param0->unk_98[v0], 0); diff --git a/src/overlay012/ov12_022269C0.c b/src/overlay012/ov12_022269C0.c index d8e78ed99a..5b99b53f39 100644 --- a/src/overlay012/ov12_022269C0.c +++ b/src/overlay012/ov12_022269C0.c @@ -138,9 +138,9 @@ static void ov12_02226AAC(SysTask *param0, void *param1) CellActor_UpdateObject(v0->unk_14[1]->cellActor); CellActor_UpdateObject(v0->unk_14[2]->cellActor); - sub_0200D5AC(v0->unk_14[0]->cellActor, 1, 0); - sub_0200D5AC(v0->unk_14[1]->cellActor, -1, 0); - sub_0200D5AC(v0->unk_14[2]->cellActor, 1, 1); + CellActor_AddPositionXY(v0->unk_14[0]->cellActor, 1, 0); + CellActor_AddPositionXY(v0->unk_14[1]->cellActor, -1, 0); + CellActor_AddPositionXY(v0->unk_14[2]->cellActor, 1, 1); SpriteGfxHandler_UpdateCellActorCollection(v0->unk_0C); break; diff --git a/src/overlay012/ov12_02226B84.c b/src/overlay012/ov12_02226B84.c index 2a16c2f641..7f767352ad 100644 --- a/src/overlay012/ov12_02226B84.c +++ b/src/overlay012/ov12_02226B84.c @@ -1041,7 +1041,7 @@ void ov12_0222777C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri CellActorData_SetPriority(v0->unk_14, 100); CellActorData_SetExplicitPriority(v0->unk_14, 1); - sub_0200D6A4(v0->unk_14, 2); + CellActorData_SetAffineOverwriteMode(v0->unk_14, 2); CellActorData_DrawSprite(v0->unk_14, 0); v0->unk_44 = 4; @@ -1281,7 +1281,7 @@ static void ov12_02227B4C(SysTask *param0, void *param1) v1 = -v1; } - sub_0200D6E8(v0->unk_10, v1, v2); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v1, v2); v0->unk_08++; break; case 1: @@ -1292,7 +1292,7 @@ static void ov12_02227B4C(SysTask *param0, void *param1) v1 = -v1; } - sub_0200D6E8(v0->unk_10, v1, v2); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v1, v2); if (v3) { ov12_0222605C(v0->unk_10, v0->unk_0C, v0->unk_0E, v0->unk_14.unk_04[4], 0); @@ -1312,7 +1312,7 @@ static void ov12_02227B4C(SysTask *param0, void *param1) v1 = -v1; } - sub_0200D6E8(v0->unk_10, v1, v2); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v1, v2); if (v3) { ov12_0222605C(v0->unk_10, v0->unk_0C, v0->unk_0E, v0->unk_14.unk_04[4], 0); @@ -1366,8 +1366,8 @@ void ov12_02227CBC(UnkStruct_ov12_0221FCDC *param0) CellActorData_SetPriority(v0->unk_10, 100); CellActorData_SetExplicitPriority(v0->unk_10, 1); - SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); - sub_0200D6A4(v0->unk_10, 2); + CellActorData_SetExplicitOAMMode(v0->unk_10, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_10, 2); ov12_02235780(v0->unk_00, v0->unk_38, 16 - v0->unk_38); ov12_022201E8(v0->unk_00, ov12_02227B4C, v0); @@ -1598,7 +1598,7 @@ void ov12_02228168(UnkStruct_ov12_0221FCDC *param0) for (v2 = 0; v2 < 4; v2++) { if (v1 & (1 << v2)) { v3 = ov12_022202C0(v0->unk_00, v2); - SpriteActor_SetOAMMode(v3, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v3, GX_OAM_MODE_XLU); } } @@ -2059,9 +2059,9 @@ void ov12_02228B40(UnkStruct_ov12_0221FCDC *param0) v1->unk_24 = ov12_022202C0(v1->unk_04.unk_04, 0); - SpriteActor_SetOAMMode(v1->unk_24, GX_OAM_MODE_OBJWND); - sub_0200D6A4(v1->unk_24, 2); - sub_0200D6E8(v1->unk_24, 1.2f, 1.2f); + CellActorData_SetExplicitOAMMode(v1->unk_24, GX_OAM_MODE_OBJWND); + CellActorData_SetAffineOverwriteMode(v1->unk_24, 2); + CellActorData_SetAffineScaleXYFx32(v1->unk_24, 1.2f, 1.2f); GX_SetVisibleWnd(GX_WNDMASK_OW); G2_SetWndOutsidePlane((GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3 | GX_WND_PLANEMASK_OBJ), 0); @@ -2802,7 +2802,7 @@ void ov12_02229908(UnkStruct_ov12_0221FCDC *param0) v0->unk_2C = 15; } - sub_0200D7FC(v0->unk_1C, 1); + CellActorData_SetPixelated(v0->unk_1C, 1); { SysTask *v2; @@ -3204,7 +3204,7 @@ void ov12_0222A1AC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v1 = ov12_02220280(param0, 0); v2 = ov12_02220280(param0, 1); - sub_0200D5DC(param3, v1, v2); + CellActorData_AddPositionXY(param3, v1, v2); } ov12_022201E8(v0->unk_00.unk_04, ov12_0222A178, v0); @@ -3282,18 +3282,18 @@ static void ov12_0222A1F4(SysTask *param0, void *param1) } } - sub_0200D5DC(v0->unk_1C, v1, 0); + CellActorData_AddPositionXY(v0->unk_1C, v1, 0); } else { - sub_0200D6A4(v0->unk_1C, 2); + CellActorData_SetAffineOverwriteMode(v0->unk_1C, 2); ov12_02225D50(&v0->unk_20, 0, +((20 * 0xffff) / 360), 4); - sub_0200D7E0(v0->unk_1C, -8, 16); + CellActorData_SetAffineTranslationXY(v0->unk_1C, -8, 16); v0->unk_34 = 0; v0->unk_00.unk_00++; } } break; case 1: { if (ov12_02225DA0(&v0->unk_20) == 1) { - sub_0200D79C(v0->unk_1C, v0->unk_20.unk_00); + CellActorData_SetAffineZRotation(v0->unk_1C, v0->unk_20.unk_00); } else { if (v0->unk_34 > 5) { v0->unk_00.unk_00++; @@ -3357,7 +3357,7 @@ void ov12_0222A34C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } CellActorData_SetExplicitPriority(v0->unk_1C, ov12_0222339C(v0->unk_00.unk_04)); - sub_0200D5DC(v0->unk_1C, 0, +12); + CellActorData_AddPositionXY(v0->unk_1C, 0, +12); ov12_022201E8(v0->unk_00.unk_04, ov12_0222A1F4, v0); } @@ -3435,7 +3435,7 @@ static void ov12_0222A4A0(SysTask *param0, void *param1) BOOL v2 = CellActorData_IsAnimated(v0->unk_1C); if (v2 == 0) { - SpriteActor_SetOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); v0->unk_20 = 16; v0->unk_21 = 0; ov12_02235780(v0->unk_00.unk_04, v0->unk_20, v0->unk_21); @@ -3516,14 +3516,14 @@ static void ov12_0222A624(UnkStruct_ov12_0222A624 *param0) if (LCRNG_Next() % 2) { if (param0->unk_38 == 0) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +4); + CellActorData_AddPositionXY(param0->unk_1C, 0, +4); } } break; case 7: if (param0->unk_38 != 1) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +4); + CellActorData_AddPositionXY(param0->unk_1C, 0, +4); } break; case 10: @@ -3531,14 +3531,14 @@ static void ov12_0222A624(UnkStruct_ov12_0222A624 *param0) if (LCRNG_Next() % 2) { if (param0->unk_38 == 1) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +4); + CellActorData_AddPositionXY(param0->unk_1C, 0, +4); } } break; case 12: if (param0->unk_38 != 2) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +4); + CellActorData_AddPositionXY(param0->unk_1C, 0, +4); } break; case 15: @@ -3546,14 +3546,14 @@ static void ov12_0222A624(UnkStruct_ov12_0222A624 *param0) if (LCRNG_Next() % 2) { if (param0->unk_38 == 2) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +4); + CellActorData_AddPositionXY(param0->unk_1C, 0, +4); } } break; case 17: if (param0->unk_38 != 3) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +4); + CellActorData_AddPositionXY(param0->unk_1C, 0, +4); } break; case 22: @@ -3561,25 +3561,25 @@ static void ov12_0222A624(UnkStruct_ov12_0222A624 *param0) if (LCRNG_Next() % 2) { if (param0->unk_38 == 3) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +8); + CellActorData_AddPositionXY(param0->unk_1C, 0, +8); } } break; case 24: if (param0->unk_38 != 4) { param0->unk_38++; - sub_0200D5DC(param0->unk_1C, 0, +8); + CellActorData_AddPositionXY(param0->unk_1C, 0, +8); } break; default: if (param0->unk_00.unk_00 > param0->unk_3C) { if (param0->unk_38 < 20) { - sub_0200D5DC(param0->unk_1C, 0, +4); + CellActorData_AddPositionXY(param0->unk_1C, 0, +4); { s16 v0, v1; - SpriteActor_GetSpritePositionXY(param0->unk_1C, &v0, &v1); + CellActorData_GetPositionXY(param0->unk_1C, &v0, &v1); if (v1 > 130) { CellActorData_DrawSprite(param0->unk_1C, 0); diff --git a/src/overlay012/ov12_0222AC70.c b/src/overlay012/ov12_0222AC70.c index 007c30934f..4bece209f8 100644 --- a/src/overlay012/ov12_0222AC70.c +++ b/src/overlay012/ov12_0222AC70.c @@ -299,7 +299,7 @@ static void ov12_0222AC70(SysTask *param0, void *param1) for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { { s16 v2, v3; - SpriteActor_GetSpritePositionXY(v1->unk_14[v0], &v2, &v3); + CellActorData_GetPositionXY(v1->unk_14[v0], &v2, &v3); } if (v1->unk_04 >= Unk_ov12_0223A09E[v0][0]) { @@ -338,7 +338,7 @@ static void ov12_0222AC70(SysTask *param0, void *param1) f32 v4, v5; ov12_02225FA4(&v1->unk_20, &v4, &v5); - sub_0200D6E8(v1->unk_14[v0], v4, v5); + CellActorData_SetAffineScaleXYFx32(v1->unk_14[v0], v4, v5); } } else { if (++v1->unk_04 >= 45) { @@ -424,9 +424,9 @@ void ov12_0222AE68(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { v1->unk_01[v0] = 0; - sub_0200D6A4(v1->unk_14[v0], 2); - sub_0200D5DC(v1->unk_14[v0], 0, 32 - (v0 * 4)); - SpriteActor_SetOAMMode(v1->unk_14[v0], GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v1->unk_14[v0], 2); + CellActorData_AddPositionXY(v1->unk_14[v0], 0, 32 - (v0 * 4)); + CellActorData_SetExplicitOAMMode(v1->unk_14[v0], GX_OAM_MODE_XLU); } ov12_022201CC(param0, ov12_0222AC70, v1, 0x1000); @@ -722,7 +722,7 @@ void ov12_0222B68C(UnkStruct_ov12_0221FCDC *param0) for (v1 = 0; v1 < 4; v1++) { v0->unk_18[v1] = ov12_022202C0(v0->unk_0C, v1); - SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); } if (ov12_0223525C(v0->unk_0C, ov12_02220240(v0->unk_0C)) == 0x3) { @@ -1093,7 +1093,7 @@ static void ov12_0222BFF4(SysTask *param0, void *param1) case 1: CellActorData_DrawSprite(v0->unk_0C, 1); CellActorData_DrawSprite(v0->unk_10, 1); - SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_OBJWND); + CellActorData_SetExplicitOAMMode(v0->unk_10, GX_OAM_MODE_OBJWND); v0->unk_00++; break; case 2: @@ -1183,7 +1183,7 @@ static void ov12_0222C1A4(SysTask *param0, void *param1) f32 v3, v4; ov12_02225FA4(&v2->unk_18[v0].unk_08, &v3, &v4); - sub_0200D6E8(v2->unk_18[v0].unk_04, v3 * v2->unk_08, v4); + CellActorData_SetAffineScaleXYFx32(v2->unk_18[v0].unk_04, v3 * v2->unk_08, v4); ov12_0222605C(v2->unk_18[v0].unk_04, v2->unk_02, v2->unk_04, v2->unk_18[v0].unk_08.unk_04[4], 0); } break; @@ -1204,9 +1204,9 @@ static void ov12_0222C1A4(SysTask *param0, void *param1) s16 v5; s16 v6; - SpriteActor_GetSpritePositionXY(v2->unk_18[v0].unk_04, &v5, &v6); + CellActorData_GetPositionXY(v2->unk_18[v0].unk_04, &v5, &v6); CellActorData_SetPositionXY(v2->unk_18[v0].unk_04, v5, v2->unk_02); - sub_0200D6E8(v2->unk_18[v0].unk_04, 1.0f * v2->unk_08, 1.0f); + CellActorData_SetAffineScaleXYFx32(v2->unk_18[v0].unk_04, 1.0f * v2->unk_08, 1.0f); } v2->unk_18[v0].unk_00 = 0; v2->unk_18[v0].unk_01 = 0; @@ -1220,7 +1220,7 @@ static void ov12_0222C1A4(SysTask *param0, void *param1) break; case 2: for (v0 = 0; v0 < 3; v0++) { - SpriteActor_SetOAMMode(v2->unk_18[v0].unk_04, GX_OAM_MODE_NORMAL); + CellActorData_SetExplicitOAMMode(v2->unk_18[v0].unk_04, GX_OAM_MODE_NORMAL); ov12_02225EF0(&v2->unk_18[v0].unk_08, 5, 100, 5, 100, 100, 5); } @@ -1236,7 +1236,7 @@ static void ov12_0222C1A4(SysTask *param0, void *param1) f32 v7, v8; ov12_02225FA4(&v2->unk_18[v0].unk_08, &v7, &v8); - sub_0200D6E8(v2->unk_18[v0].unk_04, v7 * v2->unk_08, v8); + CellActorData_SetAffineScaleXYFx32(v2->unk_18[v0].unk_04, v7 * v2->unk_08, v8); ov12_0222605C(v2->unk_18[v0].unk_04, v2->unk_02, v2->unk_04, v2->unk_18[v0].unk_08.unk_04[4], 0); } } @@ -1281,8 +1281,8 @@ void ov12_0222C3C0(UnkStruct_ov12_0221FCDC *param0) v0->unk_18[v1].unk_01 = 0; v0->unk_18[v1].unk_04 = ov12_022202C0(v0->unk_10, v1); - sub_0200D6A4(v0->unk_18[v1].unk_04, 2); - SpriteActor_SetOAMMode(v0->unk_18[v1].unk_04, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_18[v1].unk_04, 2); + CellActorData_SetExplicitOAMMode(v0->unk_18[v1].unk_04, GX_OAM_MODE_XLU); CellActorData_SetPriority(v0->unk_18[v1].unk_04, v1 + 1); } } @@ -1297,7 +1297,7 @@ void ov12_0222C3C0(UnkStruct_ov12_0221FCDC *param0) int v2; for (v2 = 0; v2 < 3; v2++) { - sub_0200D6E8(v0->unk_18[v2].unk_04, 1.0f * v0->unk_08, 1.0f); + CellActorData_SetAffineScaleXYFx32(v0->unk_18[v2].unk_04, 1.0f * v0->unk_08, 1.0f); } } @@ -1472,7 +1472,7 @@ void ov12_0222C6D4(UnkStruct_ov12_0221FCDC *param0) ov12_022357BC(v0->unk_0C, (1 << ov12_022233EC(param0, 2)) | GX_BLEND_PLANEMASK_BD | (1 << ov12_022233EC(param0, 1)) | GX_WND_PLANEMASK_BG0, 0xffffffff, 0xffffffff); ov12_02226424(&v0->unk_64, 31, 0, 0, 31, (20 - 5)); - SpriteActor_SetOAMMode(v0->unk_18, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_18, GX_OAM_MODE_XLU); ov12_022201E8(v0->unk_0C, ov12_0222C678, v0); } @@ -1724,7 +1724,7 @@ static void ov12_0222CBFC(SysTask *param0, void *param1) } if (ov12_02225DA0(&v1->unk_D4) == 1) { - sub_0200D79C(v1->unk_38, v1->unk_D4.unk_00); + CellActorData_SetAffineZRotation(v1->unk_38, v1->unk_D4.unk_00); } CellActorData_UpdateObject(v1->unk_38); @@ -1748,7 +1748,7 @@ void ov12_0222CC54(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v1 = ov12_02225964(param0, ov12_02220240(param0)); v2->unk_38 = param3; - sub_0200D6A4(v2->unk_38, 2); + CellActorData_SetAffineOverwriteMode(v2->unk_38, 2); v2->unk_3C[0].unk_08 = ov12_022232FC(param0, ov12_02220240(param0)); v2->unk_3C[1].unk_08 = ov12_022232FC(param0, ov12_02220248(param0)); @@ -1771,7 +1771,7 @@ void ov12_0222CC54(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri ov12_02225D50(&v2->unk_D4, ((90 * 0xffff) / 360) * v1, ((130 * 0xffff) / 360) * v1, 10); } - sub_0200D79C(v2->unk_38, v2->unk_D4.unk_00); + CellActorData_SetAffineZRotation(v2->unk_38, v2->unk_D4.unk_00); ov12_02225D2C(&v2->unk_8C[0], &v2->unk_8C[1], v2->unk_38); CellActorData_UpdateObject(v2->unk_38); @@ -1796,7 +1796,7 @@ static void ov12_0222CDF0(SysTask *param0, void *param1) s16 v3; ov12_02225FA4(&v0->unk_9C, &v1, &v2); - sub_0200D6E8(v0->unk_40, v1, v2); + CellActorData_SetAffineScaleXYFx32(v0->unk_40, v1, v2); v3 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); @@ -1824,7 +1824,7 @@ static void ov12_0222CDF0(SysTask *param0, void *param1) s16 v6; ov12_02225FA4(&v0->unk_9C, &v4, &v5); - sub_0200D6E8(v0->unk_40, v4, v5); + CellActorData_SetAffineScaleXYFx32(v0->unk_40, v4, v5); v6 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v6); @@ -1907,8 +1907,8 @@ void ov12_0222CFA0(UnkStruct_ov12_0221FCDC *param0) } CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02); - sub_0200D6A4(v0->unk_40, 2); - SpriteActor_SetOAMMode(v0->unk_40, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_40, 2); + CellActorData_SetExplicitOAMMode(v0->unk_40, GX_OAM_MODE_XLU); { f32 v1, v2; @@ -1918,7 +1918,7 @@ void ov12_0222CFA0(UnkStruct_ov12_0221FCDC *param0) ov12_02225F6C(&v0->unk_9C); ov12_02225FA4(&v0->unk_9C, &v1, &v2); - sub_0200D6E8(v0->unk_40, v1, v2); + CellActorData_SetAffineScaleXYFx32(v0->unk_40, v1, v2); v3 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); CellActorData_SetPositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); @@ -1970,11 +1970,11 @@ static void ov12_0222D128(SysTask *param0, void *param1) case 3: { s16 v3, v4; - SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v3, &v4); + CellActorData_GetPositionXY(v1->unk_30[0].unk_00, &v3, &v4); if (v4 <= ((40 - 16 + 20 + 10) + 50)) { - sub_0200D5DC(v1->unk_30[0].unk_00, 0, 2); - sub_0200D5DC(v1->unk_30[1].unk_00, 0, 2); + CellActorData_AddPositionXY(v1->unk_30[0].unk_00, 0, 2); + CellActorData_AddPositionXY(v1->unk_30[1].unk_00, 0, 2); } else { v1->unk_00++; } @@ -1982,11 +1982,11 @@ static void ov12_0222D128(SysTask *param0, void *param1) case 4: { s16 v5, v6; - SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v5, &v6); + CellActorData_GetPositionXY(v1->unk_30[0].unk_00, &v5, &v6); if (v6 <= ((40 - 16 + 20 + 10) + 50)) { - sub_0200D5DC(v1->unk_30[0].unk_00, 0, 2); - sub_0200D5DC(v1->unk_30[1].unk_00, 0, 2); + CellActorData_AddPositionXY(v1->unk_30[0].unk_00, 0, 2); + CellActorData_AddPositionXY(v1->unk_30[1].unk_00, 0, 2); } else { G2_ChangeBlendAlpha(16, 0); v1->unk_00++; @@ -2000,11 +2000,11 @@ static void ov12_0222D128(SysTask *param0, void *param1) G2_ChangeBlendAlpha(v1->unk_04, v1->unk_08); if (v1->unk_01 == 10) { - sub_0200D5DC(v1->unk_30[0].unk_00, 0, 16); + CellActorData_AddPositionXY(v1->unk_30[0].unk_00, 0, 16); } if (v1->unk_01 == 12) { - sub_0200D5DC(v1->unk_30[1].unk_00, 0, 16); + CellActorData_AddPositionXY(v1->unk_30[1].unk_00, 0, 16); } break; case 5: @@ -2017,8 +2017,8 @@ static void ov12_0222D128(SysTask *param0, void *param1) { s16 v7, v8, v9, v10; - SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v7, &v8); - SpriteActor_GetSpritePositionXY(v1->unk_30[1].unk_00, &v9, &v10); + CellActorData_GetPositionXY(v1->unk_30[0].unk_00, &v7, &v8); + CellActorData_GetPositionXY(v1->unk_30[1].unk_00, &v9, &v10); ov12_02226728(v7, v8, v9, v10, &v1->unk_C8, &v1->unk_CA); ov12_02226744(v7, v8, v1->unk_C8, v1->unk_CA, &v1->unk_2C); @@ -2039,8 +2039,8 @@ static void ov12_0222D128(SysTask *param0, void *param1) { +1, -1 }, }; - SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v11, &v12); - SpriteActor_GetSpritePositionXY(v1->unk_30[1].unk_00, &v13, &v14); + CellActorData_GetPositionXY(v1->unk_30[0].unk_00, &v11, &v12); + CellActorData_GetPositionXY(v1->unk_30[1].unk_00, &v13, &v14); ov12_02225C98(&v1->unk_30[0].unk_04[0], &v1->unk_30[0].unk_04[1], v11, v13, v12, v14, 10, v1->unk_2C * v15[v1->unk_0C][0]); ov12_02225C98(&v1->unk_30[1].unk_04[0], &v1->unk_30[1].unk_04[1], v13, v11, v14, v12, 10, v1->unk_2C * v15[v1->unk_0C][1]); @@ -2098,7 +2098,7 @@ static void ov12_0222D128(SysTask *param0, void *param1) s16 v18, v19; for (v0 = 0; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - SpriteActor_GetSpritePositionXY(v1->unk_30[v0].unk_00, &v18, &v19); + CellActorData_GetPositionXY(v1->unk_30[v0].unk_00, &v18, &v19); if (v19 < 80) { CellActorData_SetExplicitPriority(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10)); @@ -2155,7 +2155,7 @@ void ov12_0222D56C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } for (v0 = 0; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - SpriteActor_SetOAMMode(v1->unk_30[v0].unk_00, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v1->unk_30[v0].unk_00, GX_OAM_MODE_XLU); CellActorData_SetExplicitPriority(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10) + 1); } diff --git a/src/overlay012/ov12_0222D6B0.c b/src/overlay012/ov12_0222D6B0.c index ed17f633b2..89a9511c90 100644 --- a/src/overlay012/ov12_0222D6B0.c +++ b/src/overlay012/ov12_0222D6B0.c @@ -140,7 +140,7 @@ static void ov12_0222D6B0(SysTask *param0, void *param1) for (v0 = 0; v0 < v1->unk_05; v0++) { { s16 v2, v3; - SpriteActor_GetSpritePositionXY(v1->unk_14[v0], &v2, &v3); + CellActorData_GetPositionXY(v1->unk_14[v0], &v2, &v3); } if (v1->unk_04 >= Unk_ov12_0223A144[v0][0]) { @@ -241,11 +241,11 @@ void ov12_0222D7C0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri for (v0 = 0; v0 < v1->unk_05; v0++) { v1->unk_01[v0] = 0; - sub_0200D6A4(v1->unk_14[v0], 2); - SpriteActor_SetOAMMode(v1->unk_14[v0], GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v1->unk_14[v0], 2); + CellActorData_SetExplicitOAMMode(v1->unk_14[v0], GX_OAM_MODE_XLU); if (ov12_0221FDD4(v1->unk_08) == 1) { - sub_0200D6E8(v1->unk_14[v0], -1.0f, 1.0f); + CellActorData_SetAffineScaleXYFx32(v1->unk_14[v0], -1.0f, 1.0f); } } @@ -335,10 +335,10 @@ static void ov12_0222D934(SysTask *param0, void *param1) { s16 v3, v4; - SpriteActor_GetSpritePositionXY(v2->unk_34, &v3, &v4); + CellActorData_GetPositionXY(v2->unk_34, &v3, &v4); ov12_02225BC8(&v2->unk_3C, v3, Unk_ov12_0223A17A[v2->unk_30][0].unk_00, v4, Unk_ov12_0223A17A[v2->unk_30][0].unk_02, Unk_ov12_0223A140[v2->unk_30]); - SpriteActor_GetSpritePositionXY(v2->unk_38, &v3, &v4); + CellActorData_GetPositionXY(v2->unk_38, &v3, &v4); ov12_02225BC8(&v2->unk_60, v3, Unk_ov12_0223A17A[v2->unk_30][1].unk_00, v4, Unk_ov12_0223A17A[v2->unk_30][1].unk_02, Unk_ov12_0223A140[v2->unk_30]); } v2->unk_30++; @@ -448,13 +448,13 @@ void ov12_0222DB60(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri CellActorData_SetAnim(v1->unk_18[3], 1); CellActorData_SetAnim(v1->unk_18[4], 2); CellActorData_SetAnim(v1->unk_18[5], 3); - sub_0200D7D4(v1->unk_18[0], 1); - sub_0200D7D4(v1->unk_18[3], 1); + CellActorData_SetFlipMode(v1->unk_18[0], 1); + CellActorData_SetFlipMode(v1->unk_18[3], 1); for (v0 = 0; v0 < v1->unk_08; v0++) { CellActorData_SetAnimateFlag(v1->unk_18[v0], 1); CellActorData_SetPositionXY(v1->unk_18[v0], Unk_ov12_0223A162[v0].unk_00, Unk_ov12_0223A162[v0].unk_02); - SpriteActor_SetOAMMode(v1->unk_18[v0], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v1->unk_18[v0], GX_OAM_MODE_XLU); } CellActorData_DrawSprite(v1->unk_18[1], 0); @@ -494,7 +494,7 @@ static void ov12_0222DC98(SysTask *param0, void *param1) case 2: if ((++v0->unk_0D) <= 3) { v0->unk_38 += 0.1f; - sub_0200D6E8(v0->unk_10, v0->unk_38, v0->unk_38); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v0->unk_38, v0->unk_38); } else { v0->unk_0D = 0; v0->unk_0C++; @@ -503,7 +503,7 @@ static void ov12_0222DC98(SysTask *param0, void *param1) case 3: if ((++v0->unk_0D) <= 3) { v0->unk_38 -= 0.1f; - sub_0200D6E8(v0->unk_10, v0->unk_38, v0->unk_38); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v0->unk_38, v0->unk_38); } else { v0->unk_0D = 0; v0->unk_0C++; @@ -533,7 +533,7 @@ static void ov12_0222DC98(SysTask *param0, void *param1) v2 = 10 + (LCRNG_Next() % 10); - SpriteActor_GetSpritePositionXY(v0->unk_10, &v1.unk_00, &v1.unk_02); + CellActorData_GetPositionXY(v0->unk_10, &v1.unk_00, &v1.unk_02); ov12_02225BC8(&v0->unk_14, v1.unk_00, Unk_ov12_0223A14A[v0->unk_0F].unk_00, v1.unk_02, Unk_ov12_0223A14A[v0->unk_0F].unk_02, v2); v0->unk_0C++; } break; @@ -674,8 +674,8 @@ void ov12_0222DEFC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v5 = Unk_ov12_0223A19A[v0][0] + (LCRNG_Next() % Unk_ov12_0223A19A[v0][2]); CellActorData_SetPositionXY(v6, v4, v5); - sub_0200D6A4(v6, 2); - sub_0200D6E8(v6, v2->unk_14[v1].unk_38, v2->unk_14[v1].unk_38); + CellActorData_SetAffineOverwriteMode(v6, 2); + CellActorData_SetAffineScaleXYFx32(v6, v2->unk_14[v1].unk_38, v2->unk_14[v1].unk_38); CellActorData_DrawSprite(v6, 0); ov12_022201CC(param0, ov12_0222DC98, &v2->unk_14[v1], 1100 - 1); @@ -755,14 +755,14 @@ void ov12_0222E1A8(UnkStruct_ov12_0221FCDC *param0) ov12_0223595C(param0, &v0->unk_04); v0->unk_20 = ov12_022202C0(v0->unk_04.unk_04, 0); - SpriteActor_SetOAMMode(v0->unk_20, GX_OAM_MODE_OBJWND); + CellActorData_SetExplicitOAMMode(v0->unk_20, GX_OAM_MODE_OBJWND); GX_SetVisibleWnd(GX_WNDMASK_OW); G2_SetWndOutsidePlane(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3 | GX_WND_PLANEMASK_OBJ, 0); G2_SetWndOBJInsidePlane(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_OBJ, 0); v0->unk_24 = ov12_022202C0(v0->unk_04.unk_04, 1); - SpriteActor_SetOAMMode(v0->unk_24, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_24, GX_OAM_MODE_XLU); ov12_02226424(&v0->unk_2C, 16, 2, 2, 16, 16); ov12_02222590(v0->unk_04.unk_04, 2); @@ -842,17 +842,17 @@ void ov12_0222E2F8(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_28[v1] = CellActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v2); } - sub_0200D7D4(v0->unk_28[0], 1); - sub_0200D7D4(v0->unk_28[1], 1); + CellActorData_SetFlipMode(v0->unk_28[0], 1); + CellActorData_SetFlipMode(v0->unk_28[1], 1); { UnkStruct_ov12_02235350 v3; } - sub_0200D5DC(v0->unk_28[0], -32, 0); - sub_0200D5DC(v0->unk_28[1], -32, +32); - sub_0200D5DC(v0->unk_28[2], +32, 0); - sub_0200D5DC(v0->unk_28[3], +32, +32); + CellActorData_AddPositionXY(v0->unk_28[0], -32, 0); + CellActorData_AddPositionXY(v0->unk_28[1], -32, +32); + CellActorData_AddPositionXY(v0->unk_28[2], +32, 0); + CellActorData_AddPositionXY(v0->unk_28[3], +32, +32); } ov12_022201E8(v0->unk_00.unk_04, ov12_0222E25C, v0); @@ -878,10 +878,10 @@ static void ov12_0222E390(SysTask *param0, void *param1) if (v0->unk_22[0] == 110) { ov12_02235780(v0->unk_00.unk_04, 0xffffffff, 0xffffffff); - SpriteActor_SetOAMMode(v0->unk_2C[0], GX_OAM_MODE_XLU); - SpriteActor_SetOAMMode(v0->unk_2C[1], GX_OAM_MODE_XLU); - SpriteActor_SetOAMMode(v0->unk_2C[2], GX_OAM_MODE_XLU); - SpriteActor_SetOAMMode(v0->unk_2C[3], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[0], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[1], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[2], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[3], GX_OAM_MODE_XLU); v0->unk_54 = 15; v0->unk_58 = 0; @@ -915,10 +915,10 @@ static void ov12_0222E390(SysTask *param0, void *param1) if (v0->unk_22[0] == 110) { ov12_02235780(v0->unk_00.unk_04, 0xffffffff, 0xffffffff); - SpriteActor_SetOAMMode(v0->unk_2C[0], GX_OAM_MODE_XLU); - SpriteActor_SetOAMMode(v0->unk_2C[1], GX_OAM_MODE_XLU); - SpriteActor_SetOAMMode(v0->unk_2C[2], GX_OAM_MODE_XLU); - SpriteActor_SetOAMMode(v0->unk_2C[3], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[0], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[1], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[2], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_2C[3], GX_OAM_MODE_XLU); v0->unk_54 = 15; v0->unk_58 = 0; @@ -982,8 +982,8 @@ void ov12_0222E61C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_2C[v1] = CellActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); } - sub_0200D7D4(v0->unk_2C[1], 1); - sub_0200D7D4(v0->unk_2C[2], 1); + CellActorData_SetFlipMode(v0->unk_2C[1], 1); + CellActorData_SetFlipMode(v0->unk_2C[2], 1); { s16 v5; @@ -1029,10 +1029,10 @@ void ov12_0222E61C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v2 = 4; v3 = 0; - sub_0200D5DC(v0->unk_2C[0], -32, +v3); - sub_0200D5DC(v0->unk_2C[3], -40, +v2); - sub_0200D5DC(v0->unk_2C[2], +32, +v3); - sub_0200D5DC(v0->unk_2C[1], +40, +v2); + CellActorData_AddPositionXY(v0->unk_2C[0], -32, +v3); + CellActorData_AddPositionXY(v0->unk_2C[3], -40, +v2); + CellActorData_AddPositionXY(v0->unk_2C[2], +32, +v3); + CellActorData_AddPositionXY(v0->unk_2C[1], +40, +v2); } v0->unk_1C = CellActorData_GetExplicitPaletteOffset(v0->unk_2C[0]); diff --git a/src/overlay012/ov12_0222E784.c b/src/overlay012/ov12_0222E784.c index d19f054869..48cc6ff983 100644 --- a/src/overlay012/ov12_0222E784.c +++ b/src/overlay012/ov12_0222E784.c @@ -47,7 +47,7 @@ static void ov12_0222E784(SysTask *param0, void *param1) f32 v1, v2; ov12_02225FA4(&v0->unk_60, &v1, &v2); - sub_0200D6E8(v0->unk_1C.unk_0C, v1, v2); + CellActorData_SetAffineScaleXYFx32(v0->unk_1C.unk_0C, v1, v2); ov12_0222605C(v0->unk_1C.unk_0C, v0->unk_58, v0->unk_5A, v0->unk_60.unk_04[4], 0); } break; @@ -75,7 +75,7 @@ void ov12_0222E810(UnkStruct_ov12_0221FCDC *param0) v0->unk_30[0].unk_0C = ov12_022202C0(param0, 1); v0->unk_30[1].unk_0C = ov12_022202C0(param0, 2); - sub_0200D6A4(v0->unk_1C.unk_0C, 2); + CellActorData_SetAffineOverwriteMode(v0->unk_1C.unk_0C, 2); CellActorData_SetExplicitPriority(v0->unk_1C.unk_0C, ov12_0222339C(param0)); CellActorData_SetExplicitPriority(v0->unk_30[0].unk_0C, ov12_0222339C(param0)); CellActorData_SetExplicitPriority(v0->unk_30[1].unk_0C, ov12_0222339C(param0)); diff --git a/src/overlay012/ov12_0222E91C.c b/src/overlay012/ov12_0222E91C.c index 9adb482980..6838b26b12 100644 --- a/src/overlay012/ov12_0222E91C.c +++ b/src/overlay012/ov12_0222E91C.c @@ -177,14 +177,14 @@ void ov12_0222EAA0(UnkStruct_ov12_0221FCDC *param0) v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_00.unk_04), v4, v3, ov12_0221FDE4(v0->unk_00.unk_04), 2, 0x20, v2 * 16, 196, 196, 196); - SpriteActor_SetOAMMode(v1, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v1, GX_OAM_MODE_XLU); v1 = v0->unk_30; CellActorData_SetExplicitPriority(v1, ov12_0222339C(v0->unk_00.unk_04) + 1); v2 = sub_0201FAB4(CellActor_GetPaletteProxy(v1->cellActor), NNS_G2D_VRAM_TYPE_2DMAIN); PaletteData_LoadBufferFromFileStartWithTint(ov12_0222332C(v0->unk_00.unk_04), v4, v3, ov12_0221FDE4(v0->unk_00.unk_04), 2, 0x20, v2 * 16, 196, 196, 196); - SpriteActor_SetOAMMode(v1, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v1, GX_OAM_MODE_XLU); } ov12_022201E8(v0->unk_00.unk_04, ov12_0222E91C, v0); @@ -250,7 +250,7 @@ void ov12_0222EC90(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_30[v1] = CellActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); if (v1 % 2) { - sub_0200D7D4(v0->unk_30[v1], 1); + CellActorData_SetFlipMode(v0->unk_30[v1], 1); } } } @@ -345,7 +345,7 @@ static void ov12_0222EE50(SysTask *param0, void *param1) v0->unk_00.unk_00++; CellActorData_DrawSprite(v0->unk_1C[0], 0); } else { - sub_0200D6E8(v0->unk_1C[0], v0->unk_2C * v0->unk_36, v0->unk_30); + CellActorData_SetAffineScaleXYFx32(v0->unk_1C[0], v0->unk_2C * v0->unk_36, v0->unk_30); } } else { v0->unk_34++; @@ -415,10 +415,10 @@ void ov12_0222EFB0(UnkStruct_ov12_0221FCDC *param0) v0->unk_36 = +1; } - SpriteActor_GetSpritePositionXY(v0->unk_1C[1], &v2, &v3); + CellActorData_GetPositionXY(v0->unk_1C[1], &v2, &v3); CellActorData_SetPositionXY(v0->unk_1C[0], v2 + v4, v3); - sub_0200D6A4(v0->unk_1C[0], 2); - sub_0200D6E8(v0->unk_1C[0], v0->unk_2C * v0->unk_36, v0->unk_30); + CellActorData_SetAffineOverwriteMode(v0->unk_1C[0], 2); + CellActorData_SetAffineScaleXYFx32(v0->unk_1C[0], v0->unk_2C * v0->unk_36, v0->unk_30); } { @@ -443,7 +443,7 @@ void ov12_0222EFB0(UnkStruct_ov12_0221FCDC *param0) v9 = ov12_02235254(v0->unk_00.unk_04, v8); ov12_02235350(v9, ov12_0221FDD4(v0->unk_00.unk_04), &v11); - SpriteActor_GetSpritePositionXY(v0->unk_1C[0], &v12.unk_00, &v12.unk_02); + CellActorData_GetPositionXY(v0->unk_1C[0], &v12.unk_00, &v12.unk_02); { int v13; diff --git a/src/overlay012/ov12_0222F700.c b/src/overlay012/ov12_0222F700.c index 4288d7d434..6cdc1bf9f5 100644 --- a/src/overlay012/ov12_0222F700.c +++ b/src/overlay012/ov12_0222F700.c @@ -556,7 +556,7 @@ void ov12_0222F770(UnkStruct_ov12_0221FCDC *param0) v0->unk_30[v1] = ov12_022202C0(v0->unk_00, v1); CellActorData_SetPriority(v0->unk_30[v1], 100); CellActorData_SetExplicitPriority(v0->unk_30[v1], 1); - SpriteActor_SetOAMMode(v0->unk_30[v1], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_30[v1], GX_OAM_MODE_XLU); } ov12_022261C4(&v0->unk_38, &v3, ov12_02225AE0, v0->unk_E8, v0->unk_EA - v0->unk_EC, 2, 2, 0, v0->unk_30[0], v0->unk_30[1], NULL, NULL); @@ -744,7 +744,7 @@ static void ov12_0222FC44(SysTask *param0, void *param1) G2_ChangeBlendAlpha((v0->unk_F8 / 10), 31 - (v0->unk_F8 / 10)); if (v0->unk_F8 >= 310) { - SpriteActor_SetOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_NORMAL); + CellActorData_SetExplicitOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_NORMAL); v0->unk_EC++; } @@ -785,7 +785,7 @@ static void ov12_0222FC44(SysTask *param0, void *param1) CellActorData_UpdateObject(v0->unk_0C.unk_00); if (CellActor_IsAnimated(v0->unk_0C.unk_00->cellActor) == 0) { - SpriteActor_SetOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); v0->unk_EC++; } break; @@ -859,10 +859,10 @@ void ov12_0222FE30(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_F8 = 0; ov12_02235780(v0->unk_00, 0, 31); - SpriteActor_SetOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); for (v2 = 0; v2 < 2; v2++) { - SpriteActor_SetOAMMode(v0->unk_58[v2].unk_00, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_58[v2].unk_00, GX_OAM_MODE_XLU); } ov12_022201E8(v0->unk_00, ov12_0222FC44, v0); @@ -878,7 +878,7 @@ static void ov12_0222FF80(UnkStruct_ov12_0222FF80 *param0) ov12_02225FA4(¶m0->unk_34, &v0, &v1); v0 += (f32)(param0->unk_64 * (0.10f)); - sub_0200D6E8(param0->unk_58, v0, v1); + CellActorData_SetAffineScaleXYFx32(param0->unk_58, v0, v1); param0->unk_64 *= -1; } @@ -939,8 +939,8 @@ void ov12_022300C4(UnkStruct_ov12_0221FCDC *param0) ov12_02226108(&v0->unk_10, 2, 0, 1, 6); v0->unk_58 = ov12_022202C0(v0->unk_00, 0); - SpriteActor_SetOAMMode(v0->unk_58, GX_OAM_MODE_XLU); - sub_0200D6A4(v0->unk_58, 2); + CellActorData_SetExplicitOAMMode(v0->unk_58, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_58, 2); CellActorData_SetPriority(v0->unk_58, 100); CellActorData_SetExplicitPriority(v0->unk_58, 1); @@ -1126,7 +1126,7 @@ static void ov12_02230540(SysTask *param0, void *param1) v2 = -v2; } - sub_0200D6E8(v0->unk_10, v2, v3); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v2, v3); if (v1 == 0) { CellActorData_DrawSprite(v0->unk_10, 0); @@ -1215,14 +1215,14 @@ void ov12_02230754(UnkStruct_ov12_0221FCDC *param0) ov12_02225E68(&v0->unk_14, 14, 10, 10, 8); ov12_02225D78(&v0->unk_38, 0, 16, 8); - SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_10, GX_OAM_MODE_XLU); ov12_02235780(v0->unk_00, 0, 31); - sub_0200D6A4(v0->unk_10, 2); + CellActorData_SetAffineOverwriteMode(v0->unk_10, 2); if (v0->unk_4C == 1) { - sub_0200D6E8(v0->unk_10, -(14 / (f32)10), (14 / (f32)10)); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, -(14 / (f32)10), (14 / (f32)10)); } else { - sub_0200D6E8(v0->unk_10, (14 / (f32)10), (14 / (f32)10)); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, (14 / (f32)10), (14 / (f32)10)); } CellActorData_SetPriority(v0->unk_10, 100); @@ -1404,7 +1404,7 @@ static void ov12_02230BE0(SysTask *param0, void *param1) if (v1 == 1) { ov12_02225FA4(&v0->unk_14, &v2, &v3); - sub_0200D6E8(v0->unk_10, v2 * v0->unk_54, v3); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v2 * v0->unk_54, v3); } else { v0->unk_0C++; v0->unk_4C = 5; @@ -1415,7 +1415,7 @@ static void ov12_02230BE0(SysTask *param0, void *param1) break; case 1: v1 = ov12_02225DA0(&v0->unk_38); - sub_0200D79C(v0->unk_10, v0->unk_38.unk_00); + CellActorData_SetAffineZRotation(v0->unk_10, v0->unk_38.unk_00); if (v1 == 0) { if (v0->unk_4C > 0) { @@ -1436,7 +1436,7 @@ static void ov12_02230BE0(SysTask *param0, void *param1) if (v1 == 1) { ov12_02225FA4(&v0->unk_14, &v2, &v3); - sub_0200D6E8(v0->unk_10, v2 * v0->unk_54, v3); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, v2 * v0->unk_54, v3); } else { v0->unk_0C++; } @@ -1479,13 +1479,13 @@ void ov12_02230CEC(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_10 = param3; - sub_0200D6A4(v0->unk_10, 2); - sub_0200D6E8(v0->unk_10, 1, 1); + CellActorData_SetAffineOverwriteMode(v0->unk_10, 2); + CellActorData_SetAffineScaleXYFx32(v0->unk_10, 1, 1); CellActorData_SetPositionXY(v0->unk_10, v3, v4); - sub_0200D5DC(v0->unk_10, 40 * v1, 0); + CellActorData_AddPositionXY(v0->unk_10, 40 * v1, 0); CellActorData_SetPriority(v0->unk_10, 100); CellActorData_SetExplicitPriority(v0->unk_10, 1); - sub_0200D7E0(v0->unk_10, -12 * v2, 12); + CellActorData_SetAffineTranslationXY(v0->unk_10, -12 * v2, 12); if (ov12_0223525C(param0, ov12_02220240(param0)) == 0x4) { CellActorData_SetAnim(v0->unk_10, 1); @@ -1519,12 +1519,12 @@ static void ov12_02230E24(UnkStruct_ov12_02230E24 *param0, CellActorData *param1 CellActorData_SetPositionXY(param0->unk_00, param2, param3); CellActorData_SetPositionXY(param0->unk_00, param2, param3); - sub_0200D6A4(param0->unk_00, 2); + CellActorData_SetAffineOverwriteMode(param0->unk_00, 2); CellActorData_SetPriority(param0->unk_00, 100); CellActorData_SetExplicitPriority(param0->unk_00, 1); if (param4) { - sub_0200D6E8(param0->unk_00, -1, 1); + CellActorData_SetAffineScaleXYFx32(param0->unk_00, -1, 1); } CellActorData_DrawSprite(param0->unk_00, 0); @@ -1553,9 +1553,9 @@ static BOOL ov12_02230EC0(UnkStruct_ov12_02230E24 *param0) ov12_02225FA4(¶m0->unk_04, &v1, &v2); if (param0->unk_28) { - sub_0200D6E8(param0->unk_00, -v1, 1); + CellActorData_SetAffineScaleXYFx32(param0->unk_00, -v1, 1); } else { - sub_0200D6E8(param0->unk_00, v1, 1); + CellActorData_SetAffineScaleXYFx32(param0->unk_00, v1, 1); } } else { if (param0->unk_2C > 0) { @@ -1813,7 +1813,7 @@ void ov12_02231444(UnkStruct_ov12_0221FCDC *param0) v0->unk_1A -= -8; v0->unk_14 = ov12_022202C0(v0->unk_00, 0); - SpriteActor_SetOAMMode(v0->unk_14, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_14, GX_OAM_MODE_XLU); sub_02007DEC(v0->unk_10, 6, 1); ov12_022263A4(&v0->unk_1C, 2, 16); @@ -1936,8 +1936,8 @@ void ov12_02231650(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_3C = param3; CellActorData_SetAnimateFlag(v0->unk_3C, 1); - sub_0200D6A4(v0->unk_3C, 2); - SpriteActor_SetOAMMode(v0->unk_3C, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_3C, 2); + CellActorData_SetExplicitOAMMode(v0->unk_3C, GX_OAM_MODE_XLU); CellActorData_SetPriority(v0->unk_3C, 100); CellActorData_SetExplicitPriority(v0->unk_3C, 1); @@ -2011,7 +2011,7 @@ static void ov12_0223181C(SysTask *param0, void *param1) } else { v0->unk_0C++; - SpriteActor_SetOAMMode(v0->unk_14, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_14, GX_OAM_MODE_XLU); ov12_02226424( &v0->unk_3C, 16, 0, 0, 16, 16); @@ -2058,7 +2058,7 @@ void ov12_02231950(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri CellActorData_SetPriority(v0->unk_14, 100); CellActorData_SetExplicitPriority(v0->unk_14, 1); - SpriteActor_GetSpritePositionXY(v0->unk_14, &v0->unk_64, &v0->unk_66); + CellActorData_GetPositionXY(v0->unk_14, &v0->unk_64, &v0->unk_66); ov12_022201E8(v0->unk_00, ov12_0223181C, v0); } @@ -2198,13 +2198,13 @@ void ov12_02231C1C(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri CellActorData_SetPriority(v0->unk_24, 100); CellActorData_SetExplicitPriority(v0->unk_24, 1); - SpriteActor_GetSpritePositionXY(v0->unk_24, &v0->unk_4C, &v0->unk_4E); + CellActorData_GetPositionXY(v0->unk_24, &v0->unk_4C, &v0->unk_4E); v0->unk_4C -= 80 / 2; v0->unk_4E -= 80 / 2; CellActorData_SetPositionXY(v0->unk_24, v0->unk_4C, v0->unk_4E); - SpriteActor_SetOAMMode(v0->unk_24, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_24, GX_OAM_MODE_XLU); v0->unk_54 = -16; @@ -2508,7 +2508,7 @@ static void ov12_0223223C(SysTask *param0, void *param1) CellActorData_SetAnim(v0->unk_14, 0); CellActorData_SetAnimateFlag(v0->unk_14, 1); - sub_0200D6E8(v0->unk_14, 1, 1); + CellActorData_SetAffineScaleXYFx32(v0->unk_14, 1, 1); ov12_02226424(&v0->unk_3C, 0, 16, 16, 0, 4); } @@ -2571,8 +2571,8 @@ void ov12_02232378(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri CellActorData_SetPriority(v0->unk_14, 100); CellActorData_SetExplicitPriority(v0->unk_14, 1); - sub_0200D6A4(v0->unk_14, 2); - SpriteActor_SetOAMMode(v0->unk_14, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_14, 2); + CellActorData_SetExplicitOAMMode(v0->unk_14, GX_OAM_MODE_XLU); CellActorData_SetAnimFrame(v0->unk_14, 4); v0->unk_6C = 3; @@ -2906,7 +2906,7 @@ void ov12_022329E0(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri if ((v2 % 2) == 0) { v5 = v3 + v5; - sub_0200D7D4(v0->unk_48[v2], 1); + CellActorData_SetFlipMode(v0->unk_48[v2], 1); } else { v5 = v3 - v5; } @@ -3043,7 +3043,7 @@ static void ov12_02232D64(UnkStruct_ov12_02232D38 *param0) v1 = -v1; } - sub_0200D6E8(param0->unk_18, v1, v2); + CellActorData_SetAffineScaleXYFx32(param0->unk_18, v1, v2); ov12_02232D38(param0, param0->unk_18); } @@ -3061,7 +3061,7 @@ static BOOL ov12_02232E04(UnkStruct_ov12_02232D38 *param0) v1 = -v1; } - sub_0200D6E8(param0->unk_18, v1, v2); + CellActorData_SetAffineScaleXYFx32(param0->unk_18, v1, v2); ov12_0222605C(param0->unk_18, param0->unk_14, param0->unk_10, param0->unk_28.unk_04[4], 0); param0->unk_98--; @@ -3082,7 +3082,7 @@ static BOOL ov12_02232E04(UnkStruct_ov12_02232D38 *param0) v1 = -v1; } - sub_0200D6E8(param0->unk_18, v1, v2); + CellActorData_SetAffineScaleXYFx32(param0->unk_18, v1, v2); ov12_0222605C(param0->unk_18, param0->unk_14, param0->unk_10, param0->unk_28.unk_04[4], 0); } else { param0->unk_94++; @@ -3107,7 +3107,7 @@ static void ov12_02232F30(UnkStruct_ov12_02232D38 *param0) f32 v2, v3; int v4; - SpriteActor_GetSpritePositionXY(param0->unk_1C, &v0, &v1); + CellActorData_GetPositionXY(param0->unk_1C, &v0, &v1); ov12_02225BC8(¶m0->unk_70, v0, v0, v1 - 64, v1, 8); ov12_02225EF0(¶m0->unk_28, 2, 10, 20, 10, 10, 8); @@ -3117,7 +3117,7 @@ static void ov12_02232F30(UnkStruct_ov12_02232D38 *param0) v2 = -v2; } - sub_0200D6E8(param0->unk_1C, v2, v3); + CellActorData_SetAffineScaleXYFx32(param0->unk_1C, v2, v3); ov12_02225C50(¶m0->unk_70, param0->unk_1C); param0->unk_94 = 0; @@ -3156,7 +3156,7 @@ static BOOL ov12_02232FF0(UnkStruct_ov12_02232D38 *param0) v0 = -v0; } - sub_0200D6E8(param0->unk_1C, v0, v1); + CellActorData_SetAffineScaleXYFx32(param0->unk_1C, v0, v1); if (v3 == 0) { param0->unk_94++; @@ -3252,8 +3252,8 @@ void ov12_02233178(UnkStruct_ov12_0221FCDC *param0) CellActorData_SetExplicitPriority(v0->unk_18, 1); CellActorData_SetPositionXY(v0->unk_18, v2, v3); CellActorData_DrawSprite(v0->unk_18, 0); - SpriteActor_SetOAMMode(v0->unk_18, GX_OAM_MODE_XLU); - sub_0200D6A4(v0->unk_18, 2); + CellActorData_SetExplicitOAMMode(v0->unk_18, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_18, 2); v0->unk_1C = ov12_022202C0(v0->unk_00, 1); @@ -3261,9 +3261,9 @@ void ov12_02233178(UnkStruct_ov12_0221FCDC *param0) CellActorData_SetExplicitPriority(v0->unk_1C, 1); CellActorData_SetPositionXY(v0->unk_1C, v4, v5); CellActorData_DrawSprite(v0->unk_1C, 0); - SpriteActor_SetOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); - sub_0200D6A4(v0->unk_1C, 2); - sub_0200D7E0(v0->unk_1C, 0, 80 / 2); + CellActorData_SetExplicitOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(v0->unk_1C, 2); + CellActorData_SetAffineTranslationXY(v0->unk_1C, 0, 80 / 2); v0->unk_C8 = ov12_022234A8(v0->unk_00, 0); v0->unk_CC = ov12_022234A8(v0->unk_00, 1); @@ -3354,14 +3354,14 @@ void ov12_02233454(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri CellActorData_SetAnim(v0->unk_3C[v1], 1); } else { v0->unk_3C[v1] = CellActor_LoadResources(v0->unk_04, v0->unk_08, &v2); - SpriteActor_SetOAMMode(v0->unk_3C[v1], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_3C[v1], GX_OAM_MODE_XLU); } CellActorData_SetPriority(v0->unk_3C[v1], 100); CellActorData_SetExplicitPriority(v0->unk_3C[v1], 1); CellActorData_SetPositionXY(v0->unk_3C[v1], v0->unk_38, v0->unk_3A); CellActorData_DrawSprite(v0->unk_3C[v1], 0); - sub_0200D6A4(v0->unk_3C[v1], 2); + CellActorData_SetAffineOverwriteMode(v0->unk_3C[v1], 2); } ov12_022201E8(v0->unk_00, ov12_02233394, v0); @@ -3481,7 +3481,7 @@ void ov12_02233734(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } CellActorData_SetPriority(v0->unk_18[v1], 100); - SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); CellActorData_SetAnimateFlag(v0->unk_18[v1], 1); } @@ -3493,7 +3493,7 @@ static void ov12_022337E0(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 { s16 v0, v1; - SpriteActor_GetSpritePositionXY(param0, &v0, &v1); + CellActorData_GetPositionXY(param0, &v0, &v1); ov12_02225BC8(param1, v0 + (0 * param2), v0 + (256 * param2), v1 + (0 * param3), v1 + (-128 * param3), 59); CellActorData_DrawSprite(param0, 1); } @@ -3507,7 +3507,7 @@ static BOOL ov12_02233834(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 u16 v5; if (ov12_02225C50(param1, param0)) { - SpriteActor_GetSpritePositionXY(param0, &v0, &v1); + CellActorData_GetPositionXY(param0, &v0, &v1); v5 = v0 * ((2 * 0xffff) / 360); v2 = FX_Mul(FX_SinIdx(v5), (FX32_ONE * 14)) >> FX32_SHIFT; @@ -3518,7 +3518,7 @@ static BOOL ov12_02233834(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 v3 *= -1; v4 = (1.0f) + FX_FX32_TO_F32(v3); - sub_0200D6E8(param0, v4, v4); + CellActorData_SetAffineScaleXYFx32(param0, v4, v4); return 0; } @@ -3599,7 +3599,7 @@ void ov12_022339C4(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri CellActorData_SetPriority(v0->unk_18[v1], 100); CellActorData_SetExplicitPriority(v0->unk_18[v1], 1); - sub_0200D6A4(v0->unk_18[v1], 2); + CellActorData_SetAffineOverwriteMode(v0->unk_18[v1], 2); CellActorData_DrawSprite(v0->unk_18[v1], 0); CellActorData_SetPositionXY(v0->unk_18[v1], v2, v3); CellActorData_SetAnim(v0->unk_18[v1], v1 % 3); @@ -3868,7 +3868,7 @@ void ov12_02234008(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_10 = param3; CellActorData_SetAnimateFlag(v0->unk_10, 1); - SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_10, GX_OAM_MODE_XLU); ov12_022201E8(v0->unk_00, ov12_02233F4C, v0); } diff --git a/src/overlay012/ov12_022346A4.c b/src/overlay012/ov12_022346A4.c index 86613edc50..ce7e602731 100644 --- a/src/overlay012/ov12_022346A4.c +++ b/src/overlay012/ov12_022346A4.c @@ -158,9 +158,9 @@ static void ov12_0223483C(CellActorData *param0, UnkStruct_ov12_02225F6C *param1 { s16 v0, v1; - sub_0200D6A4(param0, 2); + CellActorData_SetAffineOverwriteMode(param0, 2); CellActorData_DrawSprite(param0, 1); - SpriteActor_GetSpritePositionXY(param0, &v0, &v1); + CellActorData_GetPositionXY(param0, &v0, &v1); ov12_02225BC8(param1, v0, v0 + (16 * param3), v1, v1 + -32, 32); ov12_02225E68(param2, 2, 10, 10, 32); @@ -193,7 +193,7 @@ void ov12_022348C8(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri v0->unk_10 = param3; CellActorData_DrawSprite(v0->unk_10, 0); - SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_10, GX_OAM_MODE_XLU); CellActorData_SetPriority(v0->unk_10, 100); CellActorData_SetExplicitPriority(v0->unk_10, 1); @@ -296,7 +296,7 @@ static void ov12_02234AE0(CellActorData *param0, int *param1, int *param2, int p *param2 = param3 * 2; *param1 = 16; - SpriteActor_GetSpritePositionXY(param0, &v0, &v1); + CellActorData_GetPositionXY(param0, &v0, &v1); v0 += (40 + (-12 * param3)) * param4; v1 += 40; @@ -464,7 +464,7 @@ void ov12_02234D98(UnkStruct_ov12_0221FCDC *param0, SpriteRenderer *param1, Spri } CellActorData_SetPriority(v0->unk_18[v1], 100); - SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); CellActorData_SetAnimateFlag(v0->unk_18[v1], 1); } diff --git a/src/overlay012/ov12_02234E44.c b/src/overlay012/ov12_02234E44.c index 8062b054ac..6194fb492f 100644 --- a/src/overlay012/ov12_02234E44.c +++ b/src/overlay012/ov12_02234E44.c @@ -203,7 +203,7 @@ static void ov12_0223507C(UnkStruct_ov12_0221FCDC *param0, UnkStruct_ov12_02234E G2_SetWndOutsidePlane((GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3 | GX_WND_PLANEMASK_OBJ), 1); GX_SetVisibleWnd(GX_WNDMASK_OW); - SpriteActor_SetOAMMode(v0->unk_38, GX_OAM_MODE_OBJWND); + CellActorData_SetExplicitOAMMode(v0->unk_38, GX_OAM_MODE_OBJWND); } v0->unk_00.unk_10 = 0; diff --git a/src/overlay012/ov12_02235254.c b/src/overlay012/ov12_02235254.c index 05bb780a8b..9aebe97d73 100644 --- a/src/overlay012/ov12_02235254.c +++ b/src/overlay012/ov12_02235254.c @@ -746,7 +746,7 @@ void ov12_02235918(Sprite *param0, UnkStruct_ov12_02235350 *param1) void ov12_02235950(CellActorData *param0, UnkStruct_ov12_02235350 *param1) { - SpriteActor_GetSpritePositionXY(param0, &(param1->unk_00), &(param1->unk_02)); + CellActorData_GetPositionXY(param0, &(param1->unk_00), &(param1->unk_02)); } void ov12_0223595C(UnkStruct_ov12_0221FCDC *param0, UnkStruct_ov12_0223595C *param1) diff --git a/src/overlay012/ov12_02235E94.c b/src/overlay012/ov12_02235E94.c index 5e0d101d5e..361896c53f 100644 --- a/src/overlay012/ov12_02235E94.c +++ b/src/overlay012/ov12_02235E94.c @@ -1132,7 +1132,7 @@ static BOOL ov12_02236918(BallRotation *param0) v0.unk_0C = 0xFF; v0.unk_10 = 0; - SpriteActor_GetSpritePositionXY(param0->unk_30, &v0.unk_00, &v0.unk_02); + CellActorData_GetPositionXY(param0->unk_30, &v0.unk_00, &v0.unk_02); param0->unk_D8 = ov12_02223764(param0->unk_90.battleSys, param0->unk_90.heapID); param0->unk_D0 = ov12_02236690(&v0); @@ -1178,7 +1178,7 @@ static BOOL ov12_022369FC(BallRotation *param0) switch (param0->unk_0C) { case 0: - SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + CellActorData_GetPositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); param0->unk_B8.unk_04 = 60; param0->unk_B8.unk_06 = 180; param0->unk_B8.unk_08 = 10; @@ -1270,7 +1270,7 @@ static BOOL ov12_02236B20(BallRotation *param0) { s16 v0, v1; - SpriteActor_GetSpritePositionXY(param0->unk_30, &v0, &v1); + CellActorData_GetPositionXY(param0->unk_30, &v0, &v1); ov12_02225BC8(¶m0->unk_48[0], v0, v0, v1, v1 + 32, 32 / 3); param0->unk_08++; @@ -1359,7 +1359,7 @@ static BOOL ov12_02236B98(BallRotation *param0) if ((param0->unk_0C > 20) || (v0 == 0xFF) || (v1 == 0xFF)) { param0->unk_08++; } else { - sub_0200D5DC(param0->unk_30, v0, v1); + CellActorData_AddPositionXY(param0->unk_30, v0, v1); } } break; default: @@ -1415,7 +1415,7 @@ static BOOL ov12_02236C64(BallRotation *param0) if ((param0->unk_0C > 11) || (v0 == 0xFF)) { param0->unk_08++; param0->unk_18++; - sub_0200D79C(param0->unk_30, 0); + CellActorData_SetAffineZRotation(param0->unk_30, 0); ov12_022368E4(param0, 18); return 1; } else { @@ -1423,8 +1423,8 @@ static BOOL ov12_02236C64(BallRotation *param0) sub_02005728(1534, 117); } - sub_0200D5DC(param0->unk_30, v0, 0); - sub_0200D7C0(param0->unk_30, ((((v0) * 2) * 0xffff) / 360)); + CellActorData_AddPositionXY(param0->unk_30, v0, 0); + CellActorData_AddAffineZRotation(param0->unk_30, ((((v0) * 2) * 0xffff) / 360)); } } break; default: @@ -1477,7 +1477,7 @@ static BOOL ov12_02236D18(BallRotation *param0) v1.unk_0C = ov12_02235FB4(v1.unk_04); v1.unk_10 = 0; - SpriteActor_GetSpritePositionXY(param0->unk_30, &v1.unk_00, &v1.unk_02); + CellActorData_GetPositionXY(param0->unk_30, &v1.unk_00, &v1.unk_02); param0->unk_D0 = ov12_02236690(&v1); } param0->unk_08++; @@ -1546,7 +1546,7 @@ static BOOL ov12_02236E7C(BallRotation *param0) { switch (param0->unk_08) { case 0: - SpriteActor_SetOAMMode(param0->unk_30, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_30, GX_OAM_MODE_XLU); param0->unk_08++; case 1: if (param0->unk_20 > 0) { @@ -1635,16 +1635,16 @@ static BOOL ov12_02236F24(BallRotation *param0) if (ov12_02235EB0(param0->unk_90.type) == 1) { v0 = (LCRNG_Next() % 20) + 10; - sub_0200D7C0(param0->unk_30, 0x2000 * v0); + CellActorData_AddAffineZRotation(param0->unk_30, 0x2000 * v0); } } break; case 1: if (ov12_02235EB0(param0->unk_90.type) == 1) { - sub_0200D7C0(param0->unk_30, 0x2000); + CellActorData_AddAffineZRotation(param0->unk_30, 0x2000); if (param0->unk_B8.unk_0C > ((param0->unk_B8.unk_08 / 2) + 10)) { - sub_0200D7C0(param0->unk_30, 0x2000); + CellActorData_AddAffineZRotation(param0->unk_30, 0x2000); } if (ov12_02235EF0(param0->unk_90.type) == 1) { @@ -1746,16 +1746,16 @@ static BOOL ov12_022371E4(BallRotation *param0) if (ov12_02235EB0(param0->unk_90.type) == 1) { v0 = (LCRNG_Next() % 20) + 10; - sub_0200D7C0(param0->unk_30, 0x2000 * v0); + CellActorData_AddAffineZRotation(param0->unk_30, 0x2000 * v0); } } break; case 1: if (ov12_02235EB0(param0->unk_90.type) == 1) { - sub_0200D7C0(param0->unk_30, 0x2000); + CellActorData_AddAffineZRotation(param0->unk_30, 0x2000); if (param0->unk_B8.unk_0C > ((param0->unk_B8.unk_08 / 2) + 10)) { - sub_0200D7C0(param0->unk_30, 0x2000); + CellActorData_AddAffineZRotation(param0->unk_30, 0x2000); } if (ov12_02235EF0(param0->unk_90.type) == 1) { @@ -1876,7 +1876,7 @@ static BOOL ov12_02237474(BallRotation *param0) v0.unk_0C = 0xFF; v0.unk_10 = 1; - SpriteActor_GetSpritePositionXY(param0->unk_30, &v0.unk_00, &v0.unk_02); + CellActorData_GetPositionXY(param0->unk_30, &v0.unk_00, &v0.unk_02); param0->unk_D0 = ov12_02236690(&v0); } param0->unk_08++; @@ -1941,7 +1941,7 @@ static BOOL ov12_02237608(BallRotation *param0) param0->unk_08++; break; case 1: - sub_0200D79C(param0->unk_30, param0->unk_34.unk_00); + CellActorData_SetAffineZRotation(param0->unk_30, param0->unk_34.unk_00); if (ov12_02225DA0(¶m0->unk_34) == 0) { if (param0->unk_0C >= 1) { @@ -1970,7 +1970,7 @@ static BOOL ov12_02237694(BallRotation *param0) if (param0->unk_30 != NULL) { s16 v0, v1; - SpriteActor_GetSpritePositionXY(param0->unk_30, &v0, &v1); + CellActorData_GetPositionXY(param0->unk_30, &v0, &v1); param0->unk_B8.unk_00 = v0; param0->unk_B8.unk_02 = v1; @@ -2098,7 +2098,7 @@ void ov12_0223786C(BallRotation *param0, int param1) param0->unk_10 = 0; param0->unk_1C = 1; - SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + CellActorData_GetPositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); } int ov12_02237890(BallRotation *param0) @@ -2110,7 +2110,7 @@ int ov12_02237890(BallRotation *param0) static void ov12_022378A0(BallRotation *param0) { - SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + CellActorData_GetPositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); switch (param0->unk_90.type) { case 0: @@ -2119,7 +2119,7 @@ static void ov12_022378A0(BallRotation *param0) case 3: case 4: case 5: - SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_04, ¶m0->unk_B8.unk_06); + CellActorData_GetPositionXY(param0->unk_30, ¶m0->unk_B8.unk_04, ¶m0->unk_B8.unk_06); param0->unk_B8.unk_10 = 0; param0->unk_B8.unk_08 = 12; return; @@ -2129,7 +2129,7 @@ static void ov12_022378A0(BallRotation *param0) param0->unk_B8.unk_06 += 32; break; case 7: - SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + CellActorData_GetPositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); ov12_02225864(1, 4, ¶m0->unk_B8.unk_04, ¶m0->unk_B8.unk_06); param0->unk_B8.unk_10 = 48; param0->unk_B8.unk_06 += 32; @@ -2335,7 +2335,7 @@ static void ov12_02237D8C(BallRotation *param0) param0->unk_30 = CellActor_LoadResources(param0->unk_90.cellActorSys, param0->unk_2C, &v1); CellActorData_DrawSprite(param0->unk_30, 1); - sub_0200D6A4(param0->unk_30, 2); + CellActorData_SetAffineOverwriteMode(param0->unk_30, 2); CellActorData_SetAnimFrame(param0->unk_30, 0); CellActorData_SetAnim(param0->unk_30, 0); CellActorData_UpdateObject(param0->unk_30); @@ -2355,7 +2355,7 @@ void ov12_02237E18(BallRotation *param0, s16 param1, s16 param2) void ov12_02237E24(BallRotation *param0, u16 param1) { - sub_0200D79C(param0->unk_30, param1); + CellActorData_SetAffineZRotation(param0->unk_30, param1); } void ov12_02237E30(BallRotation *param0, BOOL param1) diff --git a/src/overlay013/ov13_02224500.c b/src/overlay013/ov13_02224500.c index 5e3e008dfa..16e9a0032f 100644 --- a/src/overlay013/ov13_02224500.c +++ b/src/overlay013/ov13_02224500.c @@ -401,7 +401,7 @@ static void ov13_02224A0C(UnkStruct_ov13_022213F0 *param0, CellActorData *param1 { SpriteRenderer *v0 = ov16_0223E010(param0->unk_00->unk_08); - sub_0200D948(v0, param0->unk_1FB0, sub_0207C944(), sub_0207C908(param3), 1, param2); + SpriteRenderer_ModifyTiles(v0, param0->unk_1FB0, sub_0207C944(), sub_0207C908(param3), 1, param2); CellActorData_SetExplicitPalette(param1, sub_0207C92C(param3) + 4); } @@ -409,7 +409,7 @@ static void ov13_02224A5C(UnkStruct_ov13_022213F0 *param0, CellActorData *param1 { SpriteRenderer *v0 = ov16_0223E010(param0->unk_00->unk_08); - sub_0200D948(v0, param0->unk_1FB0, sub_0207CAC0(), sub_0207CA90(param2), 1, 45077); + SpriteRenderer_ModifyTiles(v0, param0->unk_1FB0, sub_0207CAC0(), sub_0207CA90(param2), 1, 45077); CellActorData_SetExplicitPalette(param1, sub_0207CAA8(param2) + 4); } diff --git a/src/overlay013/ov13_02225710.c b/src/overlay013/ov13_02225710.c index 7d43109c36..8613697bbf 100644 --- a/src/overlay013/ov13_02225710.c +++ b/src/overlay013/ov13_02225710.c @@ -497,32 +497,32 @@ static void ov13_02225EB8(UnkStruct_ov13_022213F0 *param0, u8 param1, u8 param2) case 3: case 4: case 5: - sub_0200D5DC(param0->unk_1FB4[13 + param1 - 0], 0, Unk_ov13_02229896[param2]); - sub_0200D5DC(param0->unk_1FB4[0 + param1 - 0], 0, Unk_ov13_02229896[param2]); - sub_0200D5DC(param0->unk_1FB4[7 + param1 - 0], 0, Unk_ov13_02229896[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[13 + param1 - 0], 0, Unk_ov13_02229896[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[0 + param1 - 0], 0, Unk_ov13_02229896[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[7 + param1 - 0], 0, Unk_ov13_02229896[param2]); break; case 7: - sub_0200D5DC(param0->unk_1FB4[0 + param0->unk_00->unk_11], 0, Unk_ov13_02229890[param2]); - sub_0200D5DC(param0->unk_1FB4[7 + param0->unk_00->unk_11], 0, Unk_ov13_02229890[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[0 + param0->unk_00->unk_11], 0, Unk_ov13_02229890[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[7 + param0->unk_00->unk_11], 0, Unk_ov13_02229890[param2]); break; case 14: case 15: case 16: case 17: - sub_0200D5DC(param0->unk_1FB4[21 + param1 - 14], 0, Unk_ov13_02229890[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[21 + param1 - 14], 0, Unk_ov13_02229890[param2]); break; case 19: case 20: case 21: case 22: - sub_0200D5DC(param0->unk_1FB4[21 + param1 - 19], 0, Unk_ov13_02229890[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[21 + param1 - 19], 0, Unk_ov13_02229890[param2]); break; case 23: case 24: case 25: case 26: case 27: - sub_0200D5DC(param0->unk_1FB4[21 + param1 - 23], 0, Unk_ov13_02229890[param2]); + CellActorData_AddPositionXY(param0->unk_1FB4[21 + param1 - 23], 0, Unk_ov13_02229890[param2]); break; } } diff --git a/src/overlay013/ov13_02227BDC.c b/src/overlay013/ov13_02227BDC.c index 58dd22d61c..0148ce71ae 100644 --- a/src/overlay013/ov13_02227BDC.c +++ b/src/overlay013/ov13_02227BDC.c @@ -109,7 +109,7 @@ static void ov13_02227C54(UnkStruct_ov13_02227244 *param0) static void ov13_02227D10(UnkStruct_ov13_02227244 *param0, u16 param1, u32 param2) { SpriteRenderer *v0 = ov16_0223E010(param0->unk_00->unk_00); - sub_0200D948(v0, param0->unk_30C, 16, Item_FileID(param1, 1), 0, param2); + SpriteRenderer_ModifyTiles(v0, param0->unk_30C, 16, Item_FileID(param1, 1), 0, param2); } static void ov13_02227D48(UnkStruct_ov13_02227244 *param0, u16 param1, u16 param2, u32 param3) diff --git a/src/overlay013/ov13_02228128.c b/src/overlay013/ov13_02228128.c index 7dc15374ed..68041d572a 100644 --- a/src/overlay013/ov13_02228128.c +++ b/src/overlay013/ov13_02228128.c @@ -410,10 +410,10 @@ static void ov13_022287A4(UnkStruct_ov13_02227244 *param0, u8 param1, u8 param2) switch (param2) { case 0: case 2: - sub_0200D5DC(v0, 0, 2); + CellActorData_AddPositionXY(v0, 0, 2); break; case 1: - sub_0200D5DC(v0, 0, -4); + CellActorData_AddPositionXY(v0, 0, -4); break; } } diff --git a/src/overlay017/ov17_0223F118.c b/src/overlay017/ov17_0223F118.c index 04520af1cf..f8877631d0 100644 --- a/src/overlay017/ov17_0223F118.c +++ b/src/overlay017/ov17_0223F118.c @@ -147,7 +147,7 @@ void ov17_0223F1E8(int param0, BgConfig *param1, SpriteGfxHandler *param2, UnkSt v0.unk_00 = param3; v0.unk_04 = &v1; - v0.unk_08 = sub_0200D9B0(param2); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(param2); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(param2, param9); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; @@ -374,7 +374,7 @@ void ov17_0223F630(UnkStruct_ov17_0223F6E8 *param0, SpriteRenderer *param1, Spri CellActorData_SetPositionXY(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_00, Unk_ov17_022531CC[v0].unk_02); CellActorData_SetAnim(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_06); - sub_0200D6A4(param0->unk_00[v0], 1); + CellActorData_SetAffineOverwriteMode(param0->unk_00[v0], 1); CellActor_UpdateObject(param0->unk_00[v0]->cellActor); } @@ -399,7 +399,7 @@ static void ov17_0223F6E8(SysTask *param0, void *param1) int v1; for (v1 = 0; v1 < 6; v1++) { - sub_0200D7C0(v0->unk_00[v1], Unk_ov17_022531CC[v1].unk_04); + CellActorData_AddAffineZRotation(v0->unk_00[v1], Unk_ov17_022531CC[v1].unk_04); } } diff --git a/src/overlay017/ov17_0223F7E4.c b/src/overlay017/ov17_0223F7E4.c index e6c97cd9b9..a57d245cb8 100644 --- a/src/overlay017/ov17_0223F7E4.c +++ b/src/overlay017/ov17_0223F7E4.c @@ -986,7 +986,7 @@ static void ov17_02240138(UnkStruct_ov17_0223F7E4 *param0, UnkStruct_ov17_022401 v0.unk_00 = param0->unk_3C; v0.unk_04 = &v1; - v0.unk_08 = sub_0200D9B0(v6); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(v6); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; @@ -1069,7 +1069,7 @@ static void ov17_022402E8(UnkStruct_ov17_0223F7E4 *param0, u16 param1[]) v3.y = Unk_ov17_02253298[v0][1]; param0->unk_118[v0] = ov17_0224F154(v1, v2, v4, &v3); - sub_0200D500(param0->unk_118[v0], v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_118[v0], v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); } } } @@ -1181,7 +1181,7 @@ static void ov17_0224051C(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_2CC.unk_04_val1.unk_00[v4] != NULL) { - sub_0200D5AC(v0->unk_2CC.unk_04_val1.unk_00[v4]->cellActor, 0, -2); + CellActor_AddPositionXY(v0->unk_2CC.unk_04_val1.unk_00[v4]->cellActor, 0, -2); } } @@ -1204,7 +1204,7 @@ static void ov17_0224051C(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_2CC.unk_04_val1.unk_00[v4] != NULL) { - sub_0200D5AC(v0->unk_2CC.unk_04_val1.unk_00[v4]->cellActor, 0, 1); + CellActor_AddPositionXY(v0->unk_2CC.unk_04_val1.unk_00[v4]->cellActor, 0, 1); } } @@ -1293,11 +1293,11 @@ static void ov17_02240658(SysTask *param0, void *param1) sub_020128C4(v0->unk_40[v6].unk_00, v2, v3 + -2); if (v8 != 0) { - sub_0200D5AC(v0->unk_118[v7]->cellActor, 0, -2); + CellActor_AddPositionXY(v0->unk_118[v7]->cellActor, 0, -2); for (v10 = 0; v10 < 6; v10++) { if (v0->unk_12C[v11][v10] != NULL) { - sub_0200D5AC(v0->unk_12C[v11][v10]->cellActor, 0, -2); + CellActor_AddPositionXY(v0->unk_12C[v11][v10]->cellActor, 0, -2); } } } @@ -1328,11 +1328,11 @@ static void ov17_02240658(SysTask *param0, void *param1) sub_020128C4(v0->unk_40[v6].unk_00, v2, v3 + 1); if (v8 != 0) { - sub_0200D5AC(v0->unk_118[v7]->cellActor, 0, 1); + CellActor_AddPositionXY(v0->unk_118[v7]->cellActor, 0, 1); for (v10 = 0; v10 < 6; v10++) { if (v0->unk_12C[v11][v10] != NULL) { - sub_0200D5AC(v0->unk_12C[v11][v10]->cellActor, 0, 1); + CellActor_AddPositionXY(v0->unk_12C[v11][v10]->cellActor, 0, 1); } } } diff --git a/src/overlay017/ov17_02241270.c b/src/overlay017/ov17_02241270.c index 5eefb6d253..ffaf7b1e3d 100644 --- a/src/overlay017/ov17_02241270.c +++ b/src/overlay017/ov17_02241270.c @@ -62,7 +62,7 @@ CellActorData *ov17_022412C0(SpriteRenderer *param0, SpriteGfxHandler *param1, i CellActorData *v0; v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_0225364C); - sub_0200D500(v0, (5 * 8) + (11 * 8) * param2, (0xc * 8) + 0 * param2, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v0, (5 * 8) + (11 * 8) * param2, (0xc * 8) + 0 * param2, ((192 + 80) << FX32_SHIFT)); CellActor_UpdateObject(v0->cellActor); return v0; @@ -97,7 +97,7 @@ CellActorData *ov17_0224136C(SpriteRenderer *param0, SpriteGfxHandler *param1, i v0 = CellActor_LoadResources(param0, param1, &Unk_ov17_02253680); } - sub_0200D500(v0, param2, param3, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v0, param2, param3, ((192 + 80) << FX32_SHIFT)); CellActor_UpdateObject(v0->cellActor); return v0; diff --git a/src/overlay017/ov17_022413D8.c b/src/overlay017/ov17_022413D8.c index b22b9e0961..011c97ed75 100644 --- a/src/overlay017/ov17_022413D8.c +++ b/src/overlay017/ov17_022413D8.c @@ -753,7 +753,7 @@ void ov17_02241B3C(UnkStruct_ov17_02246F24 *param0, int param1, int param2, u8 * v0->unk_00 = param0; v0->unk_08 = param1; - SpriteActor_GetSpritePositionXY(param0->unk_0C.unk_A8[param1], &v0->unk_0C, &v0->unk_0E); + CellActorData_GetPositionXY(param0->unk_0C.unk_A8[param1], &v0->unk_0C, &v0->unk_0E); switch (param2) { case 0: @@ -992,7 +992,7 @@ static void ov17_0224207C(SysTask *param0, void *param1) switch (v0->unk_0C) { case 0: - sub_0200D6A4(v0->unk_00, 2); + CellActorData_SetAffineOverwriteMode(v0->unk_00, 2); v0->unk_04 = (0.1f); v0->unk_08 = (0.1f); CellActorData_DrawSprite(v0->unk_00, 1); @@ -1001,8 +1001,8 @@ static void ov17_0224207C(SysTask *param0, void *param1) v0->unk_04 += (0.3f); v0->unk_08 += (0.3f); - sub_0200D6E8(v0->unk_00, v0->unk_04, v0->unk_08); - sub_0200D7C0(v0->unk_00, 0); + CellActorData_SetAffineScaleXYFx32(v0->unk_00, v0->unk_04, v0->unk_08); + CellActorData_AddAffineZRotation(v0->unk_00, 0); if (v0->unk_04 >= (1.5f)) { v0->unk_0C++; @@ -1012,17 +1012,17 @@ static void ov17_0224207C(SysTask *param0, void *param1) v0->unk_04 -= (0.3f); v0->unk_08 -= (0.3f); - sub_0200D6E8(v0->unk_00, v0->unk_04, v0->unk_08); - sub_0200D7C0(v0->unk_00, 0); + CellActorData_SetAffineScaleXYFx32(v0->unk_00, v0->unk_04, v0->unk_08); + CellActorData_AddAffineZRotation(v0->unk_00, 0); if (v0->unk_04 <= (1.0f)) { - sub_0200D6E8(v0->unk_00, (1.0f), (1.0f)); - sub_0200D79C(v0->unk_00, 0); + CellActorData_SetAffineScaleXYFx32(v0->unk_00, (1.0f), (1.0f)); + CellActorData_SetAffineZRotation(v0->unk_00, 0); v0->unk_0C++; } break; default: - sub_0200D6A4(v0->unk_00, 0); + CellActorData_SetAffineOverwriteMode(v0->unk_00, 0); Heap_FreeToHeap(param1); SysTask_Done(param0); return; @@ -1105,7 +1105,7 @@ static void ov17_022422B8(SysTask *param0, void *param1) switch (v0->unk_2E) { case 0: - sub_0200D6A4(v0->unk_04, 1); + CellActorData_SetAffineOverwriteMode(v0->unk_04, 1); v0->unk_20 = v0->unk_10 + (32 << 8); v0->unk_24 = v0->unk_14 + (72 << 8); @@ -1161,7 +1161,7 @@ static void ov17_022422B8(SysTask *param0, void *param1) return; } - sub_0200D7C0(v0->unk_04, 0x2000); + CellActorData_AddAffineZRotation(v0->unk_04, 0x2000); CellActorData_SetPositionXY(v0->unk_04, v0->unk_10 / 0x100, v0->unk_14 / 0x100); } @@ -1233,13 +1233,13 @@ static void ov17_0224262C(UnkStruct_ov17_02246F24 *param0, GXOamMode param1, int for (v0 = 0; v0 < 4; v0++) { for (v1 = 0; v1 < 6; v1++) { if (param0->unk_0C.unk_C4[v0][v1] != NULL) { - SpriteActor_SetOAMMode(param0->unk_0C.unk_C4[v0][v1], param1); + CellActorData_SetExplicitOAMMode(param0->unk_0C.unk_C4[v0][v1], param1); CellActorData_DrawSprite(param0->unk_0C.unk_C4[v0][v1], v2); } } if (param0->unk_0C.unk_160[v0] != NULL) { - SpriteActor_SetOAMMode(param0->unk_0C.unk_160[v0], param1); + CellActorData_SetExplicitOAMMode(param0->unk_0C.unk_160[v0], param1); CellActorData_DrawSprite(param0->unk_0C.unk_160[v0], v2); } @@ -1836,7 +1836,7 @@ void ov17_0224331C(UnkStruct_ov17_02246F24 *param0, int param1, int param2, u8 * } if (*param3 == 0) { - SpriteActor_GetSpritePositionXY(param0->unk_0C.unk_C4[param1][v7], &v3, &v4); + CellActorData_GetPositionXY(param0->unk_0C.unk_C4[param1][v7], &v3, &v4); v8 = sub_0208C0A4( MATH_IAbs(v3 - v1), MATH_IAbs(v4 - v2)) * 0x100; @@ -1865,7 +1865,7 @@ void ov17_0224331C(UnkStruct_ov17_02246F24 *param0, int param1, int param2, u8 * v0->unk_23 = v3; v0->unk_24 = v4; - SpriteActor_GetSpritePositionXY(param0->unk_0C.unk_C4[param1][v7], &v5, &v6); + CellActorData_GetPositionXY(param0->unk_0C.unk_C4[param1][v7], &v5, &v6); v0->unk_1C = (MATH_IAbs(v3 - v5) << 8) / (3 * (*param3)); v0->unk_18 = v5 << 8; @@ -1890,7 +1890,7 @@ static void ov17_022434E0(SysTask *param0, void *param1) v0->unk_20++; } - SpriteActor_GetSpritePositionXY(v0->unk_08, &v4, &v5); + CellActorData_GetPositionXY(v0->unk_08, &v4, &v5); v4 = v0->unk_18 >> 8; CellActorData_SetPositionXY(v0->unk_08, v4, v5); break; @@ -2008,7 +2008,7 @@ static void ov17_02243750(SysTask *param0, void *param1) break; } - SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_04, &v1, &v2); v2 += (6 << FX32_SHIFT) >> FX32_SHIFT; v0->unk_1C = v1 << 8; @@ -2032,7 +2032,7 @@ static void ov17_02243750(SysTask *param0, void *param1) if (v0->unk_24 > 80) { v0->unk_24 = 0; - SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_04, &v1, &v2); v0->unk_1C = v1 << 8; v0->unk_20 = v2 << 8; { diff --git a/src/overlay017/ov17_022476F8.c b/src/overlay017/ov17_022476F8.c index 189d305653..58f716ae42 100644 --- a/src/overlay017/ov17_022476F8.c +++ b/src/overlay017/ov17_022476F8.c @@ -119,7 +119,7 @@ void ov17_022477B8(UnkStruct_ov17_02247A48 *param0, int param1, int param2, fx32 MI_CpuClear8(v0, sizeof(UnkStruct_ov17_022477B8)); v0->unk_04 = CellActor_LoadResources(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, &Unk_ov17_022543F8); - sub_0200D500(v0->unk_04, param1, param2, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v0->unk_04, param1, param2, (256 * FX32_ONE)); if (param4 == 1) { CellActorData_SetAnim(v0->unk_04, 1); @@ -147,7 +147,7 @@ static void ov17_02247840(SysTask *param0, void *param1) v0->unk_10 += (6 << FX32_SHIFT); v0->unk_0C -= 0x100; - sub_0200D500(v0->unk_04, v0->unk_08 / 0x100 + v1, v0->unk_0C / 0x100, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v0->unk_04, v0->unk_08 / 0x100 + v1, v0->unk_0C / 0x100, (256 * FX32_ONE)); v0->unk_16++; diff --git a/src/overlay017/ov17_022492DC.c b/src/overlay017/ov17_022492DC.c index f82b76a475..dee52a5760 100644 --- a/src/overlay017/ov17_022492DC.c +++ b/src/overlay017/ov17_022492DC.c @@ -715,7 +715,7 @@ static void ov17_02249BC4(UnkStruct_ov17_022492DC *param0, UnkStruct_ov17_02249B v0.unk_00 = param0->unk_18; v0.unk_04 = &v1; - v0.unk_08 = sub_0200D9B0(v6); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(v6); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; @@ -822,7 +822,7 @@ static void ov17_02249DA0(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_8C.unk_04_val1.unk_10[v4] != NULL) { - sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, 16); + CellActor_AddPositionXY(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, 16); } } @@ -851,7 +851,7 @@ static void ov17_02249DA0(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_8C.unk_04_val1.unk_10[v4] != NULL) { - sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, -4); + CellActor_AddPositionXY(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, -4); } } @@ -880,7 +880,7 @@ static void ov17_02249DA0(SysTask *param0, void *param1) for (v4 = 0; v4 < 3; v4++) { if (v0->unk_8C.unk_04_val1.unk_10[v4] != NULL) { - sub_0200D5AC(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, (-(16 + -4))); + CellActor_AddPositionXY(v0->unk_8C.unk_04_val1.unk_10[v4]->cellActor, 0, (-(16 + -4))); } } diff --git a/src/overlay017/ov17_0224A0FC.c b/src/overlay017/ov17_0224A0FC.c index b4f2d8f22b..bd7b5b3201 100644 --- a/src/overlay017/ov17_0224A0FC.c +++ b/src/overlay017/ov17_0224A0FC.c @@ -575,7 +575,7 @@ static int ov17_0224A46C(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1 CellActorData_SetAnim(v0, param3); CellActor_UpdateObject(v0->cellActor); - sub_0200D500(v0, param5, param6, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v0, param5, param6, (256 * FX32_ONE)); CellActorData_SetAnimateFlag(v0, 1); for (v1 = 0; v1 < (((16 * 2) / 2) * 4 + 4); v1++) { @@ -694,7 +694,7 @@ void ov17_0224A7E0(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1, Spri v5->unk_00 = param0->unk_960[v4]; CellActorData_SetAnim(v5->unk_00, param3); - sub_0200D500(v5->unk_00, v2, v3, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v5->unk_00, v2, v3, (256 * FX32_ONE)); CellActor_UpdateObject(v5->unk_00->cellActor); CellActorData_DrawSprite(v5->unk_00, 1); @@ -720,7 +720,7 @@ static void ov17_0224A8D4(SysTask *param0, void *param1) sub_020129A4(v0->unk_04->unk_00, &v1, &v2); v2 += -4; sub_020128C4(v0->unk_04->unk_00, v1, v2); - sub_0200D5DC(v0->unk_00, 0, -4); + CellActorData_AddPositionXY(v0->unk_00, 0, -4); v0->unk_0C++; @@ -811,7 +811,7 @@ static void ov17_0224AA68(SysTask *param0, void *param1) v1 = v0->unk_14.unk_04[v3].unk_04; v2 = v0->unk_14.unk_04[v3].unk_08; - sub_0200D500(v0->unk_14.unk_1E8, v1, v2 - 8 * 5, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v0->unk_14.unk_1E8, v1, v2 - 8 * 5, (256 * FX32_ONE)); } void ov17_0224AA94(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2) @@ -835,7 +835,7 @@ void ov17_0224AB08(UnkStruct_ov17_0224A1EC *param0, SpriteRenderer *param1, Spri for (v0 = 0; v0 < 4; v0++) { param0->unk_200[v0].unk_04 = CellActor_LoadResources(param1, param2, &Unk_ov17_02254830); CellActor_UpdateObject(param0->unk_200[v0].unk_04->cellActor); - sub_0200D6A4(param0->unk_200[v0].unk_04, 1); + CellActorData_SetAffineOverwriteMode(param0->unk_200[v0].unk_04, 1); param0->unk_200[v0].unk_13 = v0; param0->unk_200[v0].unk_0C = ¶m0->unk_04[v0]; param0->unk_200[v0].unk_14 = Pokemon_DPSpriteYOffset(param0->unk_00->unk_00[v0], 2); @@ -889,12 +889,12 @@ static void ov17_0224ABFC(SysTask *param0, void *param1) if (v0->unk_12 == 0) { s16 v7, v8; - sub_0200D5A0(v0->unk_04, &v7, &v8, (256 * FX32_ONE)); + CellActorData_GetPositionWithOffsetXY(v0->unk_04, &v7, &v8, (256 * FX32_ONE)); v2 = v8; } - sub_0200D500(v0->unk_04, v1, v2, (256 * FX32_ONE)); - sub_0200D6E8(v0->unk_04, v5, v5); + CellActorData_SetPositionWithOffsetXY(v0->unk_04, v1, v2, (256 * FX32_ONE)); + CellActorData_SetAffineScaleXYFx32(v0->unk_04, v5, v5); } void ov17_0224AC78(UnkStruct_ov17_0224ABFC *param0, int param1, int param2) @@ -972,7 +972,7 @@ BOOL ov17_0224AD70(UnkStruct_ov17_0224DF54 *param0, int param1, int param2) v6 = param0->unk_14.unk_04[param1].unk_08; CellActorData_SetAnim(v0, param2); - sub_0200D500(v0, v5, v6, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v0, v5, v6, (256 * FX32_ONE)); CellActor_SetAnimateFlag(v0->cellActor, 1); CellActor_UpdateObject(v0->cellActor); @@ -1026,7 +1026,7 @@ static void ov17_0224AE84(SysTask *param0, void *param1) CP_SetDivImm32_32(v0->unk_0C, 0x100); v2 = CP_GetDivResult32(); - sub_0200D500(v0->unk_04, v1, v2, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v0->unk_04, v1, v2, (256 * FX32_ONE)); } static void ov17_0224AF3C(UnkStruct_ov17_0224DF54 *param0, int param1, int param2, int param3) @@ -1083,7 +1083,7 @@ BOOL ov17_0224B01C(UnkStruct_ov17_0224DF54 *param0) v1 = ¶m0->unk_14.unk_910; v0 = CellActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_0225472C); - sub_0200D500(v0, -1, (0x16 * 8), (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(v0, -1, (0x16 * 8), (256 * FX32_ONE)); CellActor_UpdateObject(v0->cellActor); CellActorData_DrawSprite(v0, 0); @@ -1168,7 +1168,7 @@ static BOOL ov17_0224B0E8(UnkStruct_ov17_0224DF54 *param0, int param1, const Unk for (v8 = 0; v8 < (((16 * 2) / 2) * 4 + 4); v8++) { if (param0->unk_14.unk_D8[v8] != NULL) { - sub_0200D5A0(param0->unk_14.unk_D8[v8], &v6, &v7, (256 * FX32_ONE)); + CellActorData_GetPositionWithOffsetXY(param0->unk_14.unk_D8[v8], &v6, &v7, (256 * FX32_ONE)); if ((v6 == v1) && (v7 == v2) && (CellActorData_GetActiveAnim(param0->unk_14.unk_D8[v8]) != 2)) { return 0; @@ -2033,13 +2033,13 @@ void ov17_0224C434(UnkStruct_ov17_0224B058 *param0, u32 param1, u32 param2, int v2 = (256 - v1) / 2; v0 = param1 * v1 / param2; - sub_0200D500(param0->unk_04, v0 - 1 + v2, (0x16 * 8), (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(param0->unk_04, v0 - 1 + v2, (0x16 * 8), (256 * FX32_ONE)); CellActorData_DrawSprite(param0->unk_04, 1); } void ov17_0224C47C(UnkStruct_ov17_0224B058 *param0, int param1) { - sub_0200D500(param0->unk_04, -1, (0x16 * 8), (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(param0->unk_04, -1, (0x16 * 8), (256 * FX32_ONE)); CellActorData_DrawSprite(param0->unk_04, param1); } @@ -2065,7 +2065,7 @@ void ov17_0224C49C(UnkStruct_ov17_0224C384 *param0, u32 param1, u32 param2, int v4 = (0x12 * 8); v4 -= sub_0201D15C(v5) * 10 / FX32_ONE; - sub_0200D500(param0->unk_04, v3, v4, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(param0->unk_04, v3, v4, (256 * FX32_ONE)); CellActorData_DrawSprite(param0->unk_04, 1); } @@ -2082,7 +2082,7 @@ void ov17_0224C54C(UnkStruct_ov17_0224C384 *param0, int param1) v1 = (256 - v0) / 2; CellActorData_DrawSprite(param0->unk_04, 1); - sub_0200D500(param0->unk_04, v1, (0x12 * 8), (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(param0->unk_04, v1, (0x12 * 8), (256 * FX32_ONE)); } int ov17_0224C57C(int param0) diff --git a/src/overlay017/ov17_02252AB0.c b/src/overlay017/ov17_02252AB0.c index 2a967fbecd..cf62125129 100644 --- a/src/overlay017/ov17_02252AB0.c +++ b/src/overlay017/ov17_02252AB0.c @@ -97,10 +97,10 @@ void ov17_02252BF0(UnkStruct_ov17_02252B48 *param0, int param1, int param2, int { int v0; - sub_0200D500(param0->unk_00[0], param1, param2, param9); - sub_0200D500(param0->unk_00[1], param3, param4, param9); - sub_0200D500(param0->unk_00[2], param5, param6, param9); - sub_0200D500(param0->unk_00[3], param7, param8, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[0], param1, param2, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[1], param3, param4, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[2], param5, param6, param9); + CellActorData_SetPositionWithOffsetXY(param0->unk_00[3], param7, param8, param9); CellActorData_SetAnim(param0->unk_00[0], 0); CellActorData_SetAnim(param0->unk_00[1], 1); diff --git a/src/overlay062/ov62_0222F2C0.c b/src/overlay062/ov62_0222F2C0.c index 2a65dfb6b1..8da3793a2c 100644 --- a/src/overlay062/ov62_0222F2C0.c +++ b/src/overlay062/ov62_0222F2C0.c @@ -712,7 +712,7 @@ void ov62_0222FF7C(UnkStruct_0208C06C *param0) continue; } - SpriteActor_GetSpritePositionXY(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); + CellActorData_GetPositionXY(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); param0->unk_534.unk_C8[v0].unk_10->rect.top = v2 - 16; param0->unk_534.unk_C8[v0].unk_10->rect.bottom = v2 + 16; @@ -727,7 +727,7 @@ void ov62_02230014(UnkStruct_0208C06C *param0) s16 v1, v2; for (v0 = 0; v0 < 5; v0++) { - SpriteActor_GetSpritePositionXY(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); + CellActorData_GetPositionXY(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); param0->unk_534.unk_C8[v0].unk_10->rect.top = 0; param0->unk_534.unk_C8[v0].unk_10->rect.bottom = 0; param0->unk_534.unk_C8[v0].unk_10->rect.left = 0; diff --git a/src/overlay062/ov62_022300D8.c b/src/overlay062/ov62_022300D8.c index 2ddde3492c..0c67c6c289 100644 --- a/src/overlay062/ov62_022300D8.c +++ b/src/overlay062/ov62_022300D8.c @@ -201,8 +201,8 @@ void ov62_02230464(UnkStruct_0208C06C *param0) } CellActorData_UpdateObject(param0->unk_6F8[v5].unk_00[v4]); - sub_0200D6A4(param0->unk_6F8[v5].unk_00[v4], 2); - sub_0200D6E8(param0->unk_6F8[v5].unk_00[v4], v7[v5], 1.0f); + CellActorData_SetAffineOverwriteMode(param0->unk_6F8[v5].unk_00[v4], 2); + CellActorData_SetAffineScaleXYFx32(param0->unk_6F8[v5].unk_00[v4], v7[v5], 1.0f); param0->unk_6F8[v5].unk_28 = 0; param0->unk_6F8[v5].unk_19 = v5 % 3; @@ -548,8 +548,8 @@ void ov62_02230C28(SysTask *param0, void *param1) v0->unk_2C++; v0->unk_28 = 0; } else { - sub_0200D638(v0->unk_00[0], &v1, &v2); - sub_0200D638(v0->unk_00[1], &v3, &v4); + CellActorData_GetPositionFx32(v0->unk_00[0], &v1, &v2); + CellActorData_GetPositionFx32(v0->unk_00[1], &v3, &v4); v1 = v1 + ((sub_0201D250((v0->unk_20 * 0xffff) / 360) * 1) * (v0->unk_18 * -1)); v3 = v1; @@ -557,8 +557,8 @@ void ov62_02230C28(SysTask *param0, void *param1) v0->unk_20 += 32; v0->unk_20 %= 360; - sub_0200D614(v0->unk_00[0], v1, v2); - sub_0200D614(v0->unk_00[1], v3, v4); + CellActorData_SetPositionFx32(v0->unk_00[0], v1, v2); + CellActorData_SetPositionFx32(v0->unk_00[1], v3, v4); v0->unk_28++; } @@ -575,8 +575,8 @@ void ov62_02230C28(SysTask *param0, void *param1) 0, }; - SpriteActor_GetSpritePositionXY(v0->unk_00[0], &v5, &v6); - SpriteActor_GetSpritePositionXY(v0->unk_00[1], &v5, &v7); + CellActorData_GetPositionXY(v0->unk_00[0], &v5, &v6); + CellActorData_GetPositionXY(v0->unk_00[1], &v5, &v7); if (v0->unk_28 == 0) { v0->unk_14 = v0->unk_16 - v5; @@ -600,12 +600,12 @@ void ov62_02230C28(SysTask *param0, void *param1) fx32 v11, v12; if (v0->unk_28 == 0) { - sub_0200D638(v0->unk_00[0], &v0->unk_0C, &v10); + CellActorData_GetPositionFx32(v0->unk_00[0], &v0->unk_0C, &v10); v0->unk_28++; } - sub_0200D638(v0->unk_00[0], &v9, &v10); - sub_0200D638(v0->unk_00[1], &v11, &v12); + CellActorData_GetPositionFx32(v0->unk_00[0], &v9, &v10); + CellActorData_GetPositionFx32(v0->unk_00[1], &v11, &v12); v9 = v0->unk_0C + ((sub_0201D250((v0->unk_20 * 0xffff) / 360) * 3) * (v0->unk_18 * -1)); v11 = v9; @@ -618,27 +618,27 @@ void ov62_02230C28(SysTask *param0, void *param1) v0->unk_20 %= 360; - sub_0200D614(v0->unk_00[0], v9, v10); - sub_0200D614(v0->unk_00[1], v11, v12); + CellActorData_SetPositionFx32(v0->unk_00[0], v9, v10); + CellActorData_SetPositionFx32(v0->unk_00[1], v11, v12); } break; } if ((v0->unk_2C >= 2) && (v0->unk_10 > 0.1f)) { v0->unk_10 -= 0.10f; - sub_0200D6E8(v0->unk_00[0], v0->unk_10, 1.0f); - sub_0200D6E8(v0->unk_00[1], v0->unk_10, 1.0f); + CellActorData_SetAffineScaleXYFx32(v0->unk_00[0], v0->unk_10, 1.0f); + CellActorData_SetAffineScaleXYFx32(v0->unk_00[1], v0->unk_10, 1.0f); } } void ov62_02230E68(CellActorData *param0, s16 param1, s16 param2) { - sub_0200D500(param0, param1, param2, (256 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(param0, param1, param2, (256 * FX32_ONE)); } void ov62_02230E74(CellActorData *param0, s16 *param1, s16 *param2) { - sub_0200D5A0(param0, param1, param2, (256 * FX32_ONE)); + CellActorData_GetPositionWithOffsetXY(param0, param1, param2, (256 * FX32_ONE)); } void ov62_02230E80(UnkStruct_0208C06C *param0) @@ -666,11 +666,11 @@ void ov62_02230E80(UnkStruct_0208C06C *param0) v4 = sub_02012898(&v6, v8[v11], 102); sub_0201ED94(v4, 1, v8[v11], &v7[v11]->unk_1C); - SpriteActor_GetSpritePositionXY(v7[v11]->unk_00, &v0, &v1); + CellActorData_GetPositionXY(v7[v11]->unk_00, &v0, &v1); v2.unk_00 = param0->unk_14.unk_3C; v2.unk_04 = &v6; - v2.unk_08 = sub_0200D9B0(param0->unk_14.unk_08); + v2.unk_08 = SpriteGfxHandler_GetCellActorCollection(param0->unk_14.unk_08); v2.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_14.unk_08, v9[v11]); v2.unk_10 = v7[v11]->unk_00->cellActor; v2.unk_14 = v7[v11]->unk_1C.unk_04; @@ -782,11 +782,11 @@ void ov62_0223118C(UnkStruct_ov62_022312B0 *param0, UnkStruct_ov62_0223118C *par v4 = sub_02012898(&v6, param2, 102); sub_0201ED94(v4, 1, param2, ¶m0->unk_14); - SpriteActor_GetSpritePositionXY(param0->unk_08, &v0, &v1); + CellActorData_GetPositionXY(param0->unk_08, &v0, &v1); v2.unk_00 = param1->unk_3C; v2.unk_04 = &v6; - v2.unk_08 = sub_0200D9B0(param1->unk_08); + v2.unk_08 = SpriteGfxHandler_GetCellActorCollection(param1->unk_08); v2.unk_0C = SpriteGfxHandler_GetPaletteProxy(param1->unk_08, v7); v2.unk_10 = param0->unk_08->cellActor; v2.unk_14 = param0->unk_14.unk_04; diff --git a/src/overlay062/ov62_02231690.c b/src/overlay062/ov62_02231690.c index cd572c48cf..6c2d8fb1f6 100644 --- a/src/overlay062/ov62_02231690.c +++ b/src/overlay062/ov62_02231690.c @@ -1752,7 +1752,7 @@ void ov62_0223331C(UnkStruct_ov62_02233310 *param0, UnkStruct_0208C06C *param1, CellActorData_SetAnim(param0->unk_2C[1], 0); CellActorData_UpdateObject(param0->unk_2C[0]); CellActorData_UpdateObject(param0->unk_2C[1]); - sub_0200D7D4(param0->unk_2C[1], 2); + CellActorData_SetFlipMode(param0->unk_2C[1], 2); if (param2 == 1) { CellActorData_SetPositionXY(param0->unk_2C[0], 256 / 2, 24); diff --git a/src/overlay062/ov62_02234A10.c b/src/overlay062/ov62_02234A10.c index 0b976ad41e..694120006c 100644 --- a/src/overlay062/ov62_02234A10.c +++ b/src/overlay062/ov62_02234A10.c @@ -295,8 +295,8 @@ BOOL ov62_02235008(UnkStruct_0208C06C *param0) v0->unk_00[v1].unk_08 = (25 + (36 * (v1)) + (16 * (5 - (param0->unk_534.unk_1AC)))); ov62_02230E68(param0->unk_534.unk_C8[v1].unk_00, 42, (25 + (36 * (5 - 1)) + (16 * (5 - (param0->unk_534.unk_1AC))))); - sub_0200D638(param0->unk_534.unk_C8[v1].unk_00, &v0->unk_00[v1].unk_0C, &v2); - sub_0200D614(param0->unk_534.unk_C8[v1].unk_00, v0->unk_00[v1].unk_0C, (25 + (36 * (5 - 1)) + (16 * (5 - (param0->unk_534.unk_1AC)))) * FX32_ONE); + CellActorData_GetPositionFx32(param0->unk_534.unk_C8[v1].unk_00, &v0->unk_00[v1].unk_0C, &v2); + CellActorData_SetPositionFx32(param0->unk_534.unk_C8[v1].unk_00, v0->unk_00[v1].unk_0C, (25 + (36 * (5 - 1)) + (16 * (5 - (param0->unk_534.unk_1AC)))) * FX32_ONE); sub_020128C4(param0->unk_534.unk_C8[v1].unk_14, 36, -8); sub_020129D0(param0->unk_534.unk_C8[v1].unk_14, 1); } @@ -339,7 +339,7 @@ BOOL ov62_02235008(UnkStruct_0208C06C *param0) v7 = v0->unk_00[v3].unk_0C + (sub_0201D250((v0->unk_00[v3].unk_04 * 0xffff) / 360) * 16); v0->unk_00[v3].unk_04 += (-4 * 1); - sub_0200D614(param0->unk_534.unk_C8[v3].unk_00, v7, v8); + CellActorData_SetPositionFx32(param0->unk_534.unk_C8[v3].unk_00, v7, v8); sub_020128C4(param0->unk_534.unk_C8[v3].unk_14, 36, -8); } if (v4 == param0->unk_534.unk_1AC) { diff --git a/src/overlay062/ov62_02236CBC.c b/src/overlay062/ov62_02236CBC.c index 49bfe83b91..a60c17f9c6 100644 --- a/src/overlay062/ov62_02236CBC.c +++ b/src/overlay062/ov62_02236CBC.c @@ -287,7 +287,7 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) v4->unk_40[v0] = CellActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); CellActorData_SetAnim(v4->unk_40[v0], 1); CellActorData_UpdateObject(v4->unk_40[v0]); - sub_0200D6E8(v4->unk_40[v0], v4->unk_04[v0], v4->unk_04[v0]); + CellActorData_SetAffineScaleXYFx32(v4->unk_40[v0], v4->unk_04[v0], v4->unk_04[v0]); } for (v0 = 0; v0 < 5; v0++) { @@ -311,7 +311,7 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) } CellActorData_UpdateObject(v4->unk_54[v0]); - sub_0200D6E8(v4->unk_54[v0], v4->unk_04[v0], v4->unk_04[v0]); + CellActorData_SetAffineScaleXYFx32(v4->unk_54[v0], v4->unk_04[v0], v4->unk_04[v0]); CellActorData_SetExplicitPalette(v4->unk_54[v0], 10 + v0); } @@ -349,7 +349,7 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) } CellActorData_UpdateObject(v4->unk_68[v0]); - sub_0200D6E8(v4->unk_68[v0], v4->unk_04[v0], v4->unk_04[v0]); + CellActorData_SetAffineScaleXYFx32(v4->unk_68[v0], v4->unk_04[v0], v4->unk_04[v0]); } v9.resources[0] = 29292; @@ -399,9 +399,9 @@ static void ov62_022371CC(UnkStruct_0208C06C *param0) CellActorData_DrawSprite(v4->unk_7C[4 - 0], 1); for (v0 = 0; v0 < 5; v0++) { - sub_0200D6A4(v4->unk_40[v0], 2); - sub_0200D6A4(v4->unk_54[v0], 2); - sub_0200D6A4(v4->unk_68[v0], 2); + CellActorData_SetAffineOverwriteMode(v4->unk_40[v0], 2); + CellActorData_SetAffineOverwriteMode(v4->unk_54[v0], 2); + CellActorData_SetAffineOverwriteMode(v4->unk_68[v0], 2); } } @@ -467,22 +467,22 @@ static BOOL ov62_022375A4(UnkStruct_0208C06C *param0) if (v0->unk_2C[0] != 0) { v0->unk_04[v1] += 0.05f; } else { - sub_0200D6A4(v0->unk_40[v1], 0); - sub_0200D6A4(v0->unk_54[v1], 0); - sub_0200D6A4(v0->unk_68[v1], 0); + CellActorData_SetAffineOverwriteMode(v0->unk_40[v1], 0); + CellActorData_SetAffineOverwriteMode(v0->unk_54[v1], 0); + CellActorData_SetAffineOverwriteMode(v0->unk_68[v1], 0); v0->unk_04[v1] = 1.0f; } v4 = (128 << FX32_SHIFT) + sub_0201D250(v0->unk_2C[v1]) * v0->unk_18[v1]; v5 = (106 << FX32_SHIFT) - sub_0201D264(v0->unk_2C[v1]) * v0->unk_18[v1]; - sub_0200D614(v0->unk_68[v1], v4, v5); - SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v2, &v3); + CellActorData_SetPositionFx32(v0->unk_68[v1], v4, v5); + CellActorData_GetPositionXY(v0->unk_68[v1], &v2, &v3); CellActorData_SetPositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); CellActorData_SetPositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); - sub_0200D6E8(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); - sub_0200D6E8(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); - sub_0200D6E8(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); + CellActorData_SetAffineScaleXYFx32(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); + CellActorData_SetAffineScaleXYFx32(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); + CellActorData_SetAffineScaleXYFx32(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); } if (v0->unk_2C[0] == 0) { @@ -506,9 +506,9 @@ static BOOL ov62_022376C4(UnkStruct_0208C06C *param0) if (v0->unk_2C[0] == 20) { for (v1 = 0; v1 < 5; v1++) { - sub_0200D6A4(v0->unk_40[v1], 2); - sub_0200D6A4(v0->unk_54[v1], 2); - sub_0200D6A4(v0->unk_68[v1], 2); + CellActorData_SetAffineOverwriteMode(v0->unk_40[v1], 2); + CellActorData_SetAffineOverwriteMode(v0->unk_54[v1], 2); + CellActorData_SetAffineOverwriteMode(v0->unk_68[v1], 2); } } @@ -526,13 +526,13 @@ static BOOL ov62_022376C4(UnkStruct_0208C06C *param0) v4 = (128 << FX32_SHIFT) - sub_0201D250(v0->unk_2C[v1]) * v0->unk_18[v1]; v5 = (106 << FX32_SHIFT) - sub_0201D264(v0->unk_2C[v1]) * v0->unk_18[v1]; - sub_0200D614(v0->unk_68[v1], v4, v5); - SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v2, &v3); + CellActorData_SetPositionFx32(v0->unk_68[v1], v4, v5); + CellActorData_GetPositionXY(v0->unk_68[v1], &v2, &v3); CellActorData_SetPositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); CellActorData_SetPositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); - sub_0200D6E8(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); - sub_0200D6E8(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); - sub_0200D6E8(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); + CellActorData_SetAffineScaleXYFx32(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); + CellActorData_SetAffineScaleXYFx32(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); + CellActorData_SetAffineScaleXYFx32(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); } if (v0->unk_2C[0] == 0) { @@ -561,8 +561,8 @@ static void ov62_02237814(UnkStruct_0208C06C *param0) v5 = v7[v1][0] << FX32_SHIFT; v6 = v7[v1][1] << FX32_SHIFT; - sub_0200D614(v0->unk_68[v1], v5, v6); - SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v3, &v4); + CellActorData_SetPositionFx32(v0->unk_68[v1], v5, v6); + CellActorData_GetPositionXY(v0->unk_68[v1], &v3, &v4); CellActorData_SetPositionXY(v0->unk_40[v1], v3 - 32, v4 - 2); CellActorData_SetPositionXY(v0->unk_54[v1], v3 + 16, v4 - 2); } diff --git a/src/overlay062/ov62_02246B00.c b/src/overlay062/ov62_02246B00.c index 4a6243313d..f2ce269923 100644 --- a/src/overlay062/ov62_02246B00.c +++ b/src/overlay062/ov62_02246B00.c @@ -207,19 +207,19 @@ BOOL ov62_02246DF8(UnkStruct_ov62_02246BF4 *param0) continue; } - sub_0200D5DC(param0->unk_00[v0].unk_0C, param0->unk_00[v0].unk_14.unk_00, param0->unk_00[v0].unk_14.unk_02); + CellActorData_AddPositionXY(param0->unk_00[v0].unk_0C, param0->unk_00[v0].unk_14.unk_00, param0->unk_00[v0].unk_14.unk_02); param0->unk_00[v0].unk_14.unk_04--; if ((v0 >= param0->unk_210) && (v0 < param0->unk_214)) { - sub_0200D6E8(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; - sub_0200D6A4(param0->unk_00[v0].unk_0C, 2); + CellActorData_SetAffineOverwriteMode(param0->unk_00[v0].unk_0C, 2); } if ((v0 >= param0->unk_218) && (v0 < param0->unk_21C)) { - sub_0200D6E8(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; - sub_0200D6A4(param0->unk_00[v0].unk_0C, 2); + CellActorData_SetAffineOverwriteMode(param0->unk_00[v0].unk_0C, 2); } } @@ -228,7 +228,7 @@ BOOL ov62_02246DF8(UnkStruct_ov62_02246BF4 *param0) continue; } - sub_0200D5DC(param0->unk_150[v0].unk_0C, param0->unk_150[v0].unk_14.unk_00, param0->unk_150[v0].unk_14.unk_02); + CellActorData_AddPositionXY(param0->unk_150[v0].unk_0C, param0->unk_150[v0].unk_14.unk_00, param0->unk_150[v0].unk_14.unk_02); param0->unk_150[v0].unk_14.unk_04--; } @@ -250,21 +250,21 @@ BOOL ov62_02246DF8(UnkStruct_ov62_02246BF4 *param0) case 1: for (v0 = param0->unk_210; v0 < param0->unk_214; v0++) { if (param0->unk_00[v0].unk_14.unk_05 == 6) { - sub_0200D6A4(param0->unk_00[v0].unk_0C, 1); + CellActorData_SetAffineOverwriteMode(param0->unk_00[v0].unk_0C, 1); continue; } - sub_0200D6E8(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; } for (v0 = param0->unk_218; v0 < param0->unk_21C; v0++) { if (param0->unk_00[v0].unk_14.unk_05 == 6) { - sub_0200D6A4(param0->unk_00[v0].unk_0C, 1); + CellActorData_SetAffineOverwriteMode(param0->unk_00[v0].unk_0C, 1); continue; } - sub_0200D6E8(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; } @@ -673,7 +673,7 @@ void ov62_02247754(UnkStruct_ov62_02246BF4 *param0) param0->unk_00[v1].unk_0C = CellActor_LoadResources(v4, v5, &v3); CellActorData_SetPositionXY(param0->unk_00[v1].unk_0C, 72 + (v0 * 8) + 4, 24); CellActorData_SetAnim(param0->unk_00[v1].unk_0C, ov62_02247B3C(param0->unk_00[v1].unk_00, param0->unk_00[v1].unk_08)); - sub_0200D6A4(param0->unk_00[v1].unk_0C, 0); + CellActorData_SetAffineOverwriteMode(param0->unk_00[v1].unk_0C, 0); CellActorData_UpdateObject(param0->unk_00[v1].unk_0C); v1++; } @@ -722,7 +722,7 @@ void ov62_0224784C(UnkStruct_ov62_02246BF4 *param0) ov62_022479D4(param0, 0); CellActorData_SetAnim(param0->unk_188[1].unk_0C, param0->unk_188[1].unk_00); CellActorData_UpdateObject(param0->unk_188[1].unk_0C); - SpriteActor_SetOAMMode(param0->unk_188[1].unk_0C, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_188[1].unk_0C, GX_OAM_MODE_XLU); param0->unk_188[2].unk_14.unk_00 = 0; param0->unk_188[2].unk_14.unk_02 = 0; @@ -731,7 +731,7 @@ void ov62_0224784C(UnkStruct_ov62_02246BF4 *param0) ov62_022479D4(param0, 0); CellActorData_SetAnim(param0->unk_188[2].unk_0C, param0->unk_188[2].unk_00); CellActorData_UpdateObject(param0->unk_188[2].unk_0C); - SpriteActor_SetOAMMode(param0->unk_188[2].unk_0C, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_188[2].unk_0C, GX_OAM_MODE_XLU); ov62_02247968(param0, 1, 0); ov62_02247968(param0, 2, 0); } @@ -753,7 +753,7 @@ void ov62_02247998(UnkStruct_ov62_02246BF4 *param0, int param1) v2 = param0->unk_00[param1].unk_0C; param0->unk_188[0].unk_00 = param1; - SpriteActor_GetSpritePositionXY(v2, &v0, &v1); + CellActorData_GetPositionXY(v2, &v0, &v1); CellActorData_SetPositionXY(param0->unk_188[0].unk_0C, v0, v1 + 16); } @@ -876,7 +876,7 @@ void ov62_02247B88(UnkStruct_ov62_02246BF4 *param0, int param1) } } - SpriteActor_GetSpritePositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); + CellActorData_GetPositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); if (param1 == 0) { CellActorData_SetPositionXY(param0->unk_00[v0].unk_0C, v2, v4); @@ -888,7 +888,7 @@ void ov62_02247B88(UnkStruct_ov62_02246BF4 *param0, int param1) } if ((v0 == param0->unk_150[v1].unk_00) && (v1 != 3 - 1)) { - SpriteActor_GetSpritePositionXY(param0->unk_150[v1].unk_0C, &v3, &v4); + CellActorData_GetPositionXY(param0->unk_150[v1].unk_0C, &v3, &v4); if (param0->unk_210 == param0->unk_214) { v2 += 8; @@ -920,7 +920,7 @@ static inline void inline_ov62_02247CE0(UnkStruct_ov62_02246BF4 *param0, int par v2 = ¶m0->unk_00[param1]; - SpriteActor_GetSpritePositionXY(v2->unk_0C, &v0, &v1); + CellActorData_GetPositionXY(v2->unk_0C, &v0, &v1); v2->unk_10->rect.top = v1 - param3; v2->unk_10->rect.left = v0 - param2; diff --git a/src/overlay076/ov76_0223B140.c b/src/overlay076/ov76_0223B140.c index 2198c61b1d..846092c286 100644 --- a/src/overlay076/ov76_0223B140.c +++ b/src/overlay076/ov76_0223B140.c @@ -57,10 +57,10 @@ void ov76_0223B184(TouchScreenRect *rect, CellActorData *param1, BOOL param2) if (param2 == 1) { CellActorData_SetPositionXY(param1, gCoreSys.touchX, gCoreSys.touchY); - SpriteActor_GetSpritePositionXY(param1, &v0, &v1); + CellActorData_GetPositionXY(param1, &v0, &v1); ov76_0223B174(rect); } else { - SpriteActor_GetSpritePositionXY(param1, &v0, &v1); + CellActorData_GetPositionXY(param1, &v0, &v1); ov76_0223B15C(rect, v0, v1); } } @@ -74,7 +74,7 @@ void ov76_0223B1E0(UnkStruct_ov76_0223DE00 *param0) continue; } - sub_0200D5DC(param0->unk_324[v0].unk_08, -(+7 * 8), -(-2 * 8)); + CellActorData_AddPositionXY(param0->unk_324[v0].unk_08, -(+7 * 8), -(-2 * 8)); } } @@ -398,7 +398,7 @@ BOOL ov76_0223B6C4(UnkStruct_ov76_0223DE00 *param0, int param1) return 1; } - SpriteActor_GetSpritePositionXY(param0->unk_324[param1].unk_08, &v1, &v2); + CellActorData_GetPositionXY(param0->unk_324[param1].unk_08, &v1, &v2); v0 = ov12_02237E54(v1, v2, 190, 70); if (v0 > 60) { @@ -435,9 +435,9 @@ void ov76_0223B758(UnkStruct_ov76_0223DE00 *param0, int param1) v0 = ov76_0223B6C4(param0, param1); if (v0 == 0) { - SpriteActor_SetOAMMode(param0->unk_324[param1].unk_08, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_324[param1].unk_08, GX_OAM_MODE_XLU); } else { - SpriteActor_SetOAMMode(param0->unk_324[param1].unk_08, GX_OAM_MODE_NORMAL); + CellActorData_SetExplicitOAMMode(param0->unk_324[param1].unk_08, GX_OAM_MODE_NORMAL); } } @@ -463,7 +463,7 @@ void ov76_0223B7D4(UnkStruct_ov76_0223DE00 *param0, int param1) { s16 v0, v1; - SpriteActor_GetSpritePositionXY(param0->unk_324[param1].unk_08, &v0, &v1); + CellActorData_GetPositionXY(param0->unk_324[param1].unk_08, &v0, &v1); param0->unk_324[param1].unk_05 = (u8)v0; param0->unk_324[param1].unk_06 = (u8)v1; diff --git a/src/overlay076/ov76_0223B870.c b/src/overlay076/ov76_0223B870.c index 54147243a6..13c51c214f 100644 --- a/src/overlay076/ov76_0223B870.c +++ b/src/overlay076/ov76_0223B870.c @@ -97,7 +97,7 @@ static void ov76_0223B870(TouchScreenRect *rect, CellActorData *param1, int para { s16 v0, v1; - SpriteActor_GetSpritePositionXY(param1, &v0, &v1); + CellActorData_GetPositionXY(param1, &v0, &v1); rect->rect.top = v1 - param3; rect->rect.bottom = v1 + param3; @@ -163,7 +163,7 @@ void ov76_0223B98C(UnkStruct_ov76_0223DE00 *param0, int param1, int param2, int v0.unk_00 = param0->unk_D4.unk_160; v0.unk_04 = &v5; - v0.unk_08 = sub_0200D9B0(param0->unk_D4.unk_0C); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(param0->unk_D4.unk_0C); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_D4.unk_0C, v2); v0.unk_10 = NULL; v0.unk_14 = param0->unk_D4.unk_16C[param1].unk_04; @@ -363,7 +363,7 @@ void ov76_0223BD30(UnkStruct_ov76_0223DE00 *param0, s8 param1, int param2) v0->unk_144[v1] = param0->unk_324[v1].unk_08; - SpriteActor_GetSpritePositionXY(v0->unk_144[v1], &v2, &v3); + CellActorData_GetPositionXY(v0->unk_144[v1], &v2, &v3); ov12_02225BC8(&v0->unk_00[v1], v2, v2 + ((+7 * 8) * param1), v3, v3 + ((-2 * 8) * param1), param2); ov12_02225C50(&v0->unk_00[v1], v0->unk_144[v1]); ov12_02225C50(&v0->unk_00[v1], v0->unk_144[v1]); @@ -739,7 +739,7 @@ void ov76_0223C4AC(UnkStruct_ov76_0223DE00 *param0) v1.resources[5] = SPRITE_RESOURCE_NONE; param0->unk_314[v0] = CellActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); - sub_0200D7D4(param0->unk_314[v0], v2[v0][2]); + CellActorData_SetFlipMode(param0->unk_314[v0], v2[v0][2]); } } diff --git a/src/overlay084/ov84_0223B5A0.c b/src/overlay084/ov84_0223B5A0.c index 820d08fdbb..52f96f6dc3 100644 --- a/src/overlay084/ov84_0223B5A0.c +++ b/src/overlay084/ov84_0223B5A0.c @@ -1760,22 +1760,22 @@ static void ov84_0223D0FC(UnkStruct_ov84_0223B5A0 *param0) switch (param0->unk_480) { case 0: case 1: - SpriteActor_GetSpritePositionXY(param0->unk_E0[2], &v0, &v1); + CellActorData_GetPositionXY(param0->unk_E0[2], &v0, &v1); v0 -= 1; CellActorData_SetPositionXY(param0->unk_E0[2], v0, v1); - SpriteActor_GetSpritePositionXY(param0->unk_E0[3], &v0, &v1); + CellActorData_GetPositionXY(param0->unk_E0[3], &v0, &v1); v0 += 1; CellActorData_SetPositionXY(param0->unk_E0[3], v0, v1); break; case 2: case 3: - SpriteActor_GetSpritePositionXY(param0->unk_E0[2], &v0, &v1); + CellActorData_GetPositionXY(param0->unk_E0[2], &v0, &v1); v0 += 1; CellActorData_SetPositionXY(param0->unk_E0[2], v0, v1); - SpriteActor_GetSpritePositionXY(param0->unk_E0[3], &v0, &v1); + CellActorData_GetPositionXY(param0->unk_E0[3], &v0, &v1); v0 -= 1; CellActorData_SetPositionXY(param0->unk_E0[3], v0, v1); diff --git a/src/overlay084/ov84_022403F4.c b/src/overlay084/ov84_022403F4.c index 67d6b47614..72dff3c324 100644 --- a/src/overlay084/ov84_022403F4.c +++ b/src/overlay084/ov84_022403F4.c @@ -321,8 +321,8 @@ void ov84_02240ABC(UnkStruct_ov84_0223B5A0 *param0) void ov84_02240AD8(UnkStruct_ov84_0223B5A0 *param0, u16 param1) { - sub_0200D948(param0->unk_D8, param0->unk_DC, 16, Item_FileID(param1, 1), 0, 49407); - sub_0200D97C(param0->unk_D8, param0->unk_DC, 16, Item_FileID(param1, 2), 0, 49404); + SpriteRenderer_ModifyTiles(param0->unk_D8, param0->unk_DC, 16, Item_FileID(param1, 1), 0, 49407); + SpriteRenderer_ModifyPalette(param0->unk_D8, param0->unk_DC, 16, Item_FileID(param1, 2), 0, 49404); } void ov84_02240B34(UnkStruct_ov84_0223B5A0 *param0, u8 param1) @@ -448,9 +448,9 @@ void ov84_02240D5C(UnkStruct_ov84_0223B5A0 *param0, u16 param1, u8 param2) v1 = MoveTable_LoadParam(v0, MOVEATTRIBUTE_TYPE); v2 = MoveTable_LoadParam(v0, MOVEATTRIBUTE_CLASS); - sub_0200D948(param0->unk_D8, param0->unk_DC, sub_0207C944(), sub_0207C908(v1), 1, 49409); + SpriteRenderer_ModifyTiles(param0->unk_D8, param0->unk_DC, sub_0207C944(), sub_0207C908(v1), 1, 49409); CellActorData_SetExplicitPalette(param0->unk_E0[10], sub_0207C92C(v1) + 6); - sub_0200D948(param0->unk_D8, param0->unk_DC, sub_0207CAC0(), sub_0207CA90(v2), 1, 49410); + SpriteRenderer_ModifyTiles(param0->unk_D8, param0->unk_DC, sub_0207CAC0(), sub_0207CA90(v2), 1, 49410); CellActorData_SetExplicitPalette(param0->unk_E0[11], sub_0207CAA8(v2) + 6); } diff --git a/src/overlay091/ov91_021D0D80.c b/src/overlay091/ov91_021D0D80.c index e47b2cba1f..bfe7d471d8 100644 --- a/src/overlay091/ov91_021D0D80.c +++ b/src/overlay091/ov91_021D0D80.c @@ -1365,7 +1365,7 @@ static void ov91_021D22A0(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param v0 = MoveTable_LoadParam(param1, MOVEATTRIBUTE_CONTEST_TYPE) + 18; } - sub_0200D948(param0->unk_110, param0->unk_114, sub_0207C944(), sub_0207C908(v0), 1, 47276 + param2); + SpriteRenderer_ModifyTiles(param0->unk_110, param0->unk_114, sub_0207C944(), sub_0207C908(v0), 1, 47276 + param2); CellActorData_SetExplicitPalette(param0->unk_118[6 + param2], sub_0207C92C(v0) + 2); } @@ -1393,7 +1393,7 @@ static void ov91_021D237C(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param if (param1 < param2) { for (v0 = 0; v0 < 7; v0++) { - SpriteActor_GetSpritePositionXY(param0->unk_118[6 + v0], &v1, &v2); + CellActorData_GetPositionXY(param0->unk_118[6 + v0], &v1, &v2); if (v2 == 32) { v2 = ((((((32 + 16) + 16) + 16) + 16) + 16) + 16); @@ -1409,7 +1409,7 @@ static void ov91_021D237C(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param } } else if (param1 > param2) { for (v0 = 0; v0 < 7; v0++) { - SpriteActor_GetSpritePositionXY(param0->unk_118[6 + v0], &v1, &v2); + CellActorData_GetPositionXY(param0->unk_118[6 + v0], &v1, &v2); if (v2 == ((((((32 + 16) + 16) + 16) + 16) + 16) + 16)) { v2 = 32; @@ -1428,7 +1428,7 @@ static void ov91_021D237C(UnkStruct_ov91_021D0ED8 *param0, u16 param1, u16 param } for (v0 = 0; v0 < 7; v0++) { - SpriteActor_GetSpritePositionXY(param0->unk_118[6 + v0], &v1, &v2); + CellActorData_GetPositionXY(param0->unk_118[6 + v0], &v1, &v2); v2 = (v2 - 32) / 16; if (param2 + v2 >= param0->unk_184 - 1) { @@ -1443,7 +1443,7 @@ static void ov91_021D24B4(UnkStruct_ov91_021D0ED8 *param0, u16 param1) { u32 v0 = MoveTable_LoadParam(param1, MOVEATTRIBUTE_CLASS); - sub_0200D948(param0->unk_110, param0->unk_114, sub_0207CAC0(), sub_0207CA90(v0), 1, 47275); + SpriteRenderer_ModifyTiles(param0->unk_110, param0->unk_114, sub_0207CAC0(), sub_0207CA90(v0), 1, 47275); CellActorData_SetExplicitPalette(param0->unk_118[5], sub_0207CAA8(v0) + 2); } diff --git a/src/overlay099/ov99_021D1A54.c b/src/overlay099/ov99_021D1A54.c index 8b3e64a2ac..e881ef975d 100644 --- a/src/overlay099/ov99_021D1A54.c +++ b/src/overlay099/ov99_021D1A54.c @@ -526,7 +526,7 @@ static void ov99_021D1F70(UnkStruct_ov99_021D2CB0 *param0) for (v0 = 2; v0 <= 4; v0++) { param0->unk_10E0[v0] = CellActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D499C); - sub_0200D6A4(param0->unk_10E0[v0], 2); + CellActorData_SetAffineOverwriteMode(param0->unk_10E0[v0], 2); CellActorData_SetAnimateFlag(param0->unk_10E0[v0], 1); CellActor_UpdateObject(param0->unk_10E0[v0]->cellActor); } diff --git a/src/overlay099/ov99_021D2C08.c b/src/overlay099/ov99_021D2C08.c index 3e69c1f822..afe9a7f34b 100644 --- a/src/overlay099/ov99_021D2C08.c +++ b/src/overlay099/ov99_021D2C08.c @@ -108,7 +108,7 @@ static void ov99_021D2CB0(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D2C GF_ASSERT(NELEMS(Unk_ov99_021D4B70) == 4 - 2 + 1); for (v0 = 2; v0 <= 4; v0++, v1++) { - sub_0200D650(param0->unk_10E0[v0], Unk_ov99_021D4B70[v1].unk_04, Unk_ov99_021D4B70[v1].unk_08, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_10E0[v0], Unk_ov99_021D4B70[v1].unk_04, Unk_ov99_021D4B70[v1].unk_08, ((192 + 80) << FX32_SHIFT)); param1->unk_08[v1].unk_00 = Unk_ov99_021D4B70[v1].unk_04; param1->unk_08[v1].unk_04 = Unk_ov99_021D4B70[v1].unk_08; } @@ -145,12 +145,12 @@ static void ov99_021D2D18(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D2C v0->unk_00 += v1->unk_0C; v0->unk_04 += v1->unk_10; - sub_0200D650(param2, v0->unk_00, v0->unk_04 + v2, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param2, v0->unk_00, v0->unk_04 + v2, ((192 + 80) << FX32_SHIFT)); if (v0->unk_12 == 0) { - sub_0200D74C(param2, v1->unk_1C, v1->unk_1C); + CellActorData_AddAffineScaleFx32(param2, v1->unk_1C, v1->unk_1C); } else { - sub_0200D74C(param2, -v1->unk_1C, -v1->unk_1C); + CellActorData_AddAffineScaleFx32(param2, -v1->unk_1C, -v1->unk_1C); } v0->unk_10++; diff --git a/src/overlay099/ov99_021D2E28.c b/src/overlay099/ov99_021D2E28.c index 6ca0fd360f..dc64153d17 100644 --- a/src/overlay099/ov99_021D2E28.c +++ b/src/overlay099/ov99_021D2E28.c @@ -144,8 +144,8 @@ static void ov99_021D2ED8(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D2E param1->unk_94[v1].unk_2C = FX_Mul(sub_0201D2C4(Unk_ov99_021D4BDC[v1].unk_10), Unk_ov99_021D4BDC[v1].unk_08); param1->unk_94[v1].unk_34 = Unk_ov99_021D4BDC[v1].unk_00; - sub_0200D650(param0->unk_10E0[v0], param1->unk_94[v1].unk_00 + param1->unk_94[v1].unk_28, param1->unk_94[v1].unk_04 + param1->unk_94[v1].unk_2C, ((192 + 80) << FX32_SHIFT)); - sub_0200D6A4(param0->unk_10E0[v0], 2); + CellActorData_SetPositionWithOffsetFx32(param0->unk_10E0[v0], param1->unk_94[v1].unk_00 + param1->unk_94[v1].unk_28, param1->unk_94[v1].unk_04 + param1->unk_94[v1].unk_2C, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetAffineOverwriteMode(param0->unk_10E0[v0], 2); } } @@ -245,9 +245,9 @@ static void ov99_021D2FD4(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D2E } if (v0->unk_38 == 0) { - sub_0200D7C0(param2, v1->unk_4C); + CellActorData_AddAffineZRotation(param2, v1->unk_4C); } else { - sub_0200D7C0(param2, -v1->unk_4C); + CellActorData_AddAffineZRotation(param2, -v1->unk_4C); } v0->unk_36++; @@ -258,7 +258,7 @@ static void ov99_021D2FD4(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D2E } v0->unk_04 -= v1->unk_48; - sub_0200D650(param2, v0->unk_00 + v0->unk_28, v0->unk_04 + v0->unk_2C, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param2, v0->unk_00 + v0->unk_28, v0->unk_04 + v0->unk_2C, ((192 + 80) << FX32_SHIFT)); } static void ov99_021D32D8(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D2E28 *param1) diff --git a/src/overlay099/ov99_021D340C.c b/src/overlay099/ov99_021D340C.c index cce3609fa6..57198a6705 100644 --- a/src/overlay099/ov99_021D340C.c +++ b/src/overlay099/ov99_021D340C.c @@ -159,8 +159,8 @@ static void ov99_021D3588(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 GF_ASSERT(NELEMS(Unk_ov99_021D4C90) == 2 - 2 + 1); for (v0 = 2; v0 <= 2; v0++, v1++) { - sub_0200D6A4(param0->unk_10E0[v0], 2); - sub_0200D500(param0->unk_10E0[v0], Unk_ov99_021D4C90[v1].unk_00, Unk_ov99_021D4C90[v1].unk_02, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetAffineOverwriteMode(param0->unk_10E0[v0], 2); + CellActorData_SetPositionWithOffsetXY(param0->unk_10E0[v0], Unk_ov99_021D4C90[v1].unk_00, Unk_ov99_021D4C90[v1].unk_02, ((192 + 80) << FX32_SHIFT)); param1->unk_124[v1].unk_00 = Unk_ov99_021D4C90[v1].unk_00 * FX32_ONE; param1->unk_124[v1].unk_04 = Unk_ov99_021D4C90[v1].unk_02 * FX32_ONE; } @@ -200,12 +200,12 @@ static void ov99_021D35E8(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 v0->unk_00 += v1->unk_04; v0->unk_04 += v1->unk_08; - sub_0200D650(param2, v0->unk_00, v0->unk_04 + v2, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param2, v0->unk_00, v0->unk_04 + v2, ((192 + 80) << FX32_SHIFT)); if (v0->unk_0E == 0) { - sub_0200D7C0(param2, v1->unk_14); + CellActorData_AddAffineZRotation(param2, v1->unk_14); } else { - sub_0200D7C0(param2, -v1->unk_14); + CellActorData_AddAffineZRotation(param2, -v1->unk_14); } v0->unk_0C++; @@ -218,8 +218,8 @@ static void ov99_021D35E8(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 static void ov99_021D36B0(UnkStruct_ov99_021D2CB0 *param0) { - SpriteActor_SetOAMMode(param0->unk_10E0[3], GX_OAM_MODE_XLU); - SpriteActor_SetOAMMode(param0->unk_10E0[4], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_10E0[3], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_10E0[4], GX_OAM_MODE_XLU); } static void ov99_021D36D4(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D340C *param1) @@ -249,7 +249,7 @@ static void ov99_021D372C(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 param1->unk_11E = 0; param1->unk_11F = 31; - sub_0200D500(param0->unk_10E0[4], Unk_ov99_021D4C84[param2].unk_00, Unk_ov99_021D4C84[param2].unk_02, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_10E0[4], Unk_ov99_021D4C84[param2].unk_00, Unk_ov99_021D4C84[param2].unk_02, ((192 + 80) << FX32_SHIFT)); CellActorData_DrawSprite(param0->unk_10E0[4], 1); CellActorData_DrawSprite(param0->unk_10E0[3], 0); @@ -279,13 +279,13 @@ static void ov99_021D37E0(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 G2S_ChangeBlendAlpha(param1->unk_11E, param1->unk_11F); - sub_0200D5E8(param0->unk_10E0[4], -0x6000, 0xd000); - sub_0200D5A0(param0->unk_10E0[4], &v0, &v1, ((192 + 80) << FX32_SHIFT)); + CellActorData_AddPositionXYFx32(param0->unk_10E0[4], -0x6000, 0xd000); + CellActorData_GetPositionWithOffsetXY(param0->unk_10E0[4], &v0, &v1, ((192 + 80) << FX32_SHIFT)); if (v1 > 192 + 32) { CellActorData_DrawSprite(param0->unk_10E0[4], 0); CellActorData_DrawSprite(param0->unk_10E0[3], 1); - sub_0200D500(param0->unk_10E0[3], v0, -32, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_10E0[3], v0, -32, ((192 + 80) << FX32_SHIFT)); param1->unk_11D = 1; } } else { @@ -302,8 +302,8 @@ static void ov99_021D37E0(UnkStruct_ov99_021D2CB0 *param0, UnkStruct_ov99_021D34 G2_ChangeBlendAlpha(param1->unk_11E, param1->unk_11F); - sub_0200D5E8(param0->unk_10E0[3], -0x6000, 0xd000); - sub_0200D5A0(param0->unk_10E0[3], &v0, &v1, ((192 + 80) << FX32_SHIFT)); + CellActorData_AddPositionXYFx32(param0->unk_10E0[3], -0x6000, 0xd000); + CellActorData_GetPositionWithOffsetXY(param0->unk_10E0[3], &v0, &v1, ((192 + 80) << FX32_SHIFT)); if (v1 > 192 + 32) { CellActorData_DrawSprite(param0->unk_10E0[3], 0); diff --git a/src/overlay100/ov100_021D13E4.c b/src/overlay100/ov100_021D13E4.c index 0b0e6cdccb..358857e753 100644 --- a/src/overlay100/ov100_021D13E4.c +++ b/src/overlay100/ov100_021D13E4.c @@ -355,8 +355,8 @@ static void ov100_021D1A54(UnkStruct_ov100_021D1808 *param0) param0->unk_0C.unk_0C[v0].unk_04 = param0->unk_0C.unk_D4[v0].unk_00; CellActorData_UpdateObject(param0->unk_0C.unk_0C[v0].unk_00); - sub_0200D6A4(param0->unk_0C.unk_0C[v0].unk_00, 2); - sub_0200D6E8(param0->unk_0C.unk_0C[v0].unk_00, v9[v0], v9[v0]); + CellActorData_SetAffineOverwriteMode(param0->unk_0C.unk_0C[v0].unk_00, 2); + CellActorData_SetAffineScaleXYFx32(param0->unk_0C.unk_0C[v0].unk_00, v9[v0], v9[v0]); CellActorData_SetExplicitPaletteOffset(param0->unk_0C.unk_0C[v0].unk_00, v0); CellActorData_SetPositionXY(param0->unk_0C.unk_0C[v0].unk_00, v7[v0], v8[v0]); diff --git a/src/overlay100/ov100_021D1C44.c b/src/overlay100/ov100_021D1C44.c index 926dd0a32b..4a35b530a5 100644 --- a/src/overlay100/ov100_021D1C44.c +++ b/src/overlay100/ov100_021D1C44.c @@ -224,8 +224,8 @@ static void ov100_021D2250(UnkStruct_ov100_021D1C98 *param0) param0->unk_08.unk_0C[v0].unk_00 = CellActor_LoadResources(v3, v4, &v6); CellActorData_UpdateObject(param0->unk_08.unk_0C[v0].unk_00); - sub_0200D6A4(param0->unk_08.unk_0C[v0].unk_00, 2); - sub_0200D6E8(param0->unk_08.unk_0C[v0].unk_00, 0.5f, 0.5f); + CellActorData_SetAffineOverwriteMode(param0->unk_08.unk_0C[v0].unk_00, 2); + CellActorData_SetAffineScaleXYFx32(param0->unk_08.unk_0C[v0].unk_00, 0.5f, 0.5f); CellActorData_SetExplicitPaletteOffset(param0->unk_08.unk_0C[v0].unk_00, v0); CellActorData_SetPositionXY(param0->unk_08.unk_0C[v0].unk_00, 16 + (v0 * 64), 64); diff --git a/src/overlay100/ov100_021D400C.c b/src/overlay100/ov100_021D400C.c index 3856f22af2..3d1aac6c29 100644 --- a/src/overlay100/ov100_021D400C.c +++ b/src/overlay100/ov100_021D400C.c @@ -75,7 +75,7 @@ static BOOL ov100_021D4104(UnkStruct_ov100_021D4104 *param0, s16 param1, s16 par BOOL v6; fx32 v7, v8; - sub_0200D67C(param0->unk_00, &v2, &v3, FX32_CONST(192)); + CellActorData_GetPositionFx32WithOffset(param0->unk_00, &v2, &v3, FX32_CONST(192)); v0 = FX_FX32_TO_F32(v2); v1 = FX_FX32_TO_F32(v3); @@ -92,7 +92,7 @@ static BOOL ov100_021D4104(UnkStruct_ov100_021D4104 *param0, s16 param1, s16 par v7 += (sub_0201D250(param0->unk_20) * 1); v8 += (sub_0201D264(param0->unk_20) * 1); - sub_0200D5E8(param0->unk_00, v7, v8); + CellActorData_AddPositionXYFx32(param0->unk_00, v7, v8); } return v6; @@ -113,7 +113,7 @@ static void ov100_021D4214(UnkStruct_ov100_021D4104 *param0) v0 = (128 << FX32_SHIFT) + (sub_0201D250(param0->unk_1C) * 64); v1 = (48 << FX32_SHIFT) + (sub_0201D264(param0->unk_1C) * 24); - sub_0200D650(param0->unk_00, v0, v1, FX32_CONST(192)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_00, v0, v1, FX32_CONST(192)); param0->unk_14 = v1 / FX32_ONE; } @@ -128,7 +128,7 @@ static void ov100_021D4264(UnkStruct_ov100_021D4104 *param0, int param1, int par v0 = (param1 << FX32_SHIFT) + (sub_0201D250(param0->unk_1C) * param3); v1 = (param2 << FX32_SHIFT) + (sub_0201D264(param0->unk_1C) * param4); - sub_0200D650(param0->unk_00, v0, v1, FX32_CONST(192)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_00, v0, v1, FX32_CONST(192)); } static void ov100_021D42B0(UnkStruct_ov100_021D4104 *param0) @@ -157,7 +157,7 @@ static void ov100_021D42B0(UnkStruct_ov100_021D4104 *param0) param0->unk_0C = 3; } - sub_0200D67C(param0->unk_00, &v0, &v1, FX32_CONST(192)); + CellActorData_GetPositionFx32WithOffset(param0->unk_00, &v0, &v1, FX32_CONST(192)); param0->unk_14 = (v1 / FX32_ONE); } @@ -177,12 +177,12 @@ static void ov100_021D4318(UnkStruct_ov100_021D4104 *param0) param0->unk_0C = 2; } - sub_0200D67C(param0->unk_00, &v0, &v1, FX32_CONST(192)); + CellActorData_GetPositionFx32WithOffset(param0->unk_00, &v0, &v1, FX32_CONST(192)); v0 += (sub_0201D250(param0->unk_20) * (3 * param0->unk_28[0])); v1 += (sub_0201D264(param0->unk_20) * (3 * param0->unk_28[1])); - sub_0200D650(param0->unk_00, v0, v1, FX32_CONST(192)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_00, v0, v1, FX32_CONST(192)); param0->unk_14 = v1 / FX32_ONE; } @@ -203,7 +203,7 @@ static void ov100_021D43BC(UnkStruct_ov100_021D4104 *param0) v0 = 0.6f; } - sub_0200D6E8(param0->unk_00, v0, v0); + CellActorData_SetAffineScaleXYFx32(param0->unk_00, v0, v0); CellActorData_SetPriority(param0->unk_00, param0->unk_14); } @@ -228,20 +228,20 @@ void ov100_021D4438(SysTask *param0, void *param1) BOOL v3; if (v0->unk_04 && v0->unk_3C) { - SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); + CellActorData_GetPositionXY(v0->unk_04, &v1, &v2); v3 = ov100_021D4104(v0, v1, v2, 3.0f, 1); { f32 v4, v5; - sub_0200D788(v0->unk_00, &v4, &v5); + CellActorData_GetAffineScaleF32(v0->unk_00, &v4, &v5); if (v4 > 0.10f) { v4 = v4 - 0.002f; } - sub_0200D6E8(v0->unk_00, v4, v4); + CellActorData_SetAffineScaleXYFx32(v0->unk_00, v4, v4); } } } diff --git a/src/overlay104/ov104_0222FBE4.c b/src/overlay104/ov104_0222FBE4.c index 9994ce7121..c6ddee2a08 100644 --- a/src/overlay104/ov104_0222FBE4.c +++ b/src/overlay104/ov104_0222FBE4.c @@ -1373,7 +1373,7 @@ static BOOL ov104_02230760(UnkStruct_ov104_0222E930 *param0) v3 = ov104_0223D370(v1, v2); GF_ASSERT(v3 != NULL); - sub_0200D7CC(v3->cellActor, 1); + thunk_CellActor_SetFlipMode(v3->cellActor, 1); return 0; } @@ -1390,9 +1390,9 @@ static BOOL ov104_02230790(UnkStruct_ov104_0222E930 *param0) GF_ASSERT(v0 != NULL); if (v4 == 0) { - sub_0200D808(v0->cellActor, GX_OAM_MODE_NORMAL); + thunk_CellActor_SetExplicitOAMMode(v0->cellActor, GX_OAM_MODE_NORMAL); } else { - sub_0200D808(v0->cellActor, GX_OAM_MODE_XLU); + thunk_CellActor_SetExplicitOAMMode(v0->cellActor, GX_OAM_MODE_XLU); } return 0; diff --git a/src/overlay104/ov104_0223C2D4.c b/src/overlay104/ov104_0223C2D4.c index cd532d9438..7d1529b6a5 100644 --- a/src/overlay104/ov104_0223C2D4.c +++ b/src/overlay104/ov104_0223C2D4.c @@ -648,7 +648,7 @@ static void ov104_0223CC74(UnkStruct_ov104_0223C4CC *param0, int param1, const T ov63_0222D19C(¶m0->unk_1C); - param0->unk_20 = ov63_0222CD2C(sub_0200D9B0(param0->unk_34.unk_04), param0->unk_04, 32, ov104_0222E5F0(param2), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 94); + param0->unk_20 = ov63_0222CD2C(SpriteGfxHandler_GetCellActorCollection(param0->unk_34.unk_04), param0->unk_04, 32, ov104_0222E5F0(param2), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 94); { UnkStruct_ov65_0223582C v0 = { @@ -1083,7 +1083,7 @@ static void ov104_0223D3B0(UnkStruct_ov104_0223C4CC *param0) v1->unk_10[v0].unk_06_13 = ov104_0223D3A4(param0, v0); v1->unk_10[v0].unk_06_14 = CellActorData_GetDrawFlag(v2->unk_00[v0]); v1->unk_10[v0].unk_04 = v2->unk_20[v0]; - SpriteActor_GetSpritePositionXY(v2->unk_00[v0], &v1->unk_10[v0].unk_00, &v1->unk_10[v0].unk_02); + CellActorData_GetPositionXY(v2->unk_00[v0], &v1->unk_10[v0].unk_00, &v1->unk_10[v0].unk_02); v1->unk_10[v0].unk_06_15 = 1; } } diff --git a/src/overlay104/ov104_0223DC7C.c b/src/overlay104/ov104_0223DC7C.c index 5d653c8e9e..fe03973746 100644 --- a/src/overlay104/ov104_0223DC7C.c +++ b/src/overlay104/ov104_0223DC7C.c @@ -461,7 +461,7 @@ static void ov104_0223E29C(UnkStruct_ov104_0223DD30 *param0, UnkStruct_ov104_022 v0.unk_00 = param0->unk_30; v0.unk_04 = &v1; - v0.unk_08 = sub_0200D9B0(v6); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(v6); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; @@ -747,7 +747,7 @@ static BOOL ov104_0223E804(UnkStruct_ov104_0223DD30 *param0, UnkStruct_ov104_022 switch (param2->unk_04) { case 0: - sub_0200D500(param1->unk_90, 256 + param0->unk_28, 80 + param0->unk_2A, (512 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(param1->unk_90, 256 + param0->unk_28, 80 + param0->unk_2A, (512 * FX32_ONE)); CellActorData_DrawSprite(param1->unk_90, 1); param2->unk_00 = 256 << 8; param2->unk_04++; @@ -760,7 +760,7 @@ static BOOL ov104_0223E804(UnkStruct_ov104_0223DD30 *param0, UnkStruct_ov104_022 param2->unk_04++; } - sub_0200D500(param1->unk_90, param2->unk_00 >> 8, 80 + param0->unk_2A, (512 * FX32_ONE)); + CellActorData_SetPositionWithOffsetXY(param1->unk_90, param2->unk_00 >> 8, 80 + param0->unk_2A, (512 * FX32_ONE)); break; default: return 1; diff --git a/src/overlay113/ov113_0225C700.c b/src/overlay113/ov113_0225C700.c index 025a9f3b18..f927c2a5dd 100644 --- a/src/overlay113/ov113_0225C700.c +++ b/src/overlay113/ov113_0225C700.c @@ -1060,7 +1060,7 @@ static void ov113_0225D6F8(UnkStruct_ov113_0225DBCC *param0) v1.resources[0] = 10010 + v0; param0->unk_970[v0] = CellActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); - sub_0200D500(param0->unk_970[v0], Unk_ov113_02260934[v0][0], Unk_ov113_02260934[v0][1], ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_970[v0], Unk_ov113_02260934[v0][0], Unk_ov113_02260934[v0][1], ((192 + 80) << FX32_SHIFT)); CellActor_UpdateObject(param0->unk_970[v0]->cellActor); CellActorData_DrawSprite(param0->unk_970[v0], 0); } @@ -1414,7 +1414,7 @@ static int ov113_0225DE98(UnkStruct_ov113_0225DBCC *param0) } if (v0.unk_04[v1] == param0->unk_168.unk_04) { - sub_0200D500(param0->unk_96C, Unk_ov113_02260914[v1][0], Unk_ov113_02260914[v1][1], ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_96C, Unk_ov113_02260914[v1][0], Unk_ov113_02260914[v1][1], ((192 + 80) << FX32_SHIFT)); CellActorData_DrawSprite(param0->unk_96C, 1); } } @@ -1534,7 +1534,7 @@ static void ov113_0225E15C(UnkStruct_ov113_0225DBCC *param0, UnkStruct_ov113_022 v0.unk_00 = param0->unk_10; v0.unk_04 = &v1; - v0.unk_08 = sub_0200D9B0(v6); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(v6); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(v6, param6); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; @@ -1600,7 +1600,7 @@ static void ov113_0225E294(UnkStruct_ov113_0225DBCC *param0) v0 = 32 - (param0->unk_19D8 >> 8); for (v1 = 0; v1 < 6; v1++) { - sub_0200D500(param0->unk_924[v1], 16 + 32 * v1, 176 + v0, ((192 + 80) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_924[v1], 16 + 32 * v1, 176 + v0, ((192 + 80) << FX32_SHIFT)); } } diff --git a/src/overlay116/ov116_022604C4.c b/src/overlay116/ov116_022604C4.c index c89b47fbd5..06e0124908 100644 --- a/src/overlay116/ov116_022604C4.c +++ b/src/overlay116/ov116_022604C4.c @@ -226,7 +226,7 @@ static void ov116_022604C4(UnkStruct_ov116_0226139C *param0) } } - param0->unk_7C = ov114_0225CAD4(sub_0200D9B0(param0->unk_48.unk_0C), 106); + param0->unk_7C = ov114_0225CAD4(SpriteGfxHandler_GetCellActorCollection(param0->unk_48.unk_0C), 106); PaletteData_LoadBufferFromHardware(param0->unk_48.unk_14, 2, 0 * 16, 16 * 0x20); if (param0->unk_80->unk_3C) { diff --git a/src/overlay116/ov116_02261870.c b/src/overlay116/ov116_02261870.c index 5a63aabd10..c492497485 100644 --- a/src/overlay116/ov116_02261870.c +++ b/src/overlay116/ov116_02261870.c @@ -758,7 +758,7 @@ void ov116_02262724(UnkStruct_ov116_02262A8C *param0) CellActorData_SetAnim(param0->unk_D0[v0], 0); CellActorData_UpdateObject(param0->unk_D0[v0]); CellActorData_SetExplicitPaletteOffset(param0->unk_D0[v0], 4); - SpriteActor_SetOAMMode(param0->unk_D0[v0], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_D0[v0], GX_OAM_MODE_XLU); CellActorData_DrawSprite(param0->unk_D0[v0], 0); ov116_02261CD8(&v2, 0, 0, 2, 0, 9000); @@ -770,7 +770,7 @@ void ov116_02262724(UnkStruct_ov116_02262A8C *param0) CellActorData_SetAnim(param0->unk_C8[v0], 6); CellActorData_UpdateObject(param0->unk_C8[v0]); CellActorData_SetExplicitPaletteOffset(param0->unk_C8[v0], 0); - SpriteActor_SetOAMMode(param0->unk_C8[v0], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_C8[v0], GX_OAM_MODE_XLU); CellActorData_DrawSprite(param0->unk_C8[v0], 0); } } diff --git a/src/overlay116/ov116_02262A8C.c b/src/overlay116/ov116_02262A8C.c index 950d0c358f..b3146da200 100644 --- a/src/overlay116/ov116_02262A8C.c +++ b/src/overlay116/ov116_02262A8C.c @@ -528,7 +528,7 @@ void ov116_02263158(SysTask *param0, void *param1) fx32 v4; v0->unk_08 = 0; - sub_0200D638(v0->unk_0C, &v2, &v3); + CellActorData_GetPositionFx32(v0->unk_0C, &v2, &v3); if (v0->unk_04 == 0) { ov116_02264764(&v0->unk_14, v3, v3 + FX32_CONST(32), 16); @@ -543,8 +543,8 @@ void ov116_02263158(SysTask *param0, void *param1) BOOL v7; v7 = ov116_02264774(&v0->unk_14); - sub_0200D638(v0->unk_0C, &v5, &v6); - sub_0200D614(v0->unk_0C, v5, v0->unk_14.unk_00); + CellActorData_GetPositionFx32(v0->unk_0C, &v5, &v6); + CellActorData_SetPositionFx32(v0->unk_0C, v5, v0->unk_14.unk_00); if (v7) { v0->unk_00++; @@ -583,8 +583,8 @@ static void ov116_0226323C(SysTask *param0, void *param1) CellActorData_SetAnim(v0->unk_0C, 7); CellActorData_SetPriority(v0->unk_0C, 0); - sub_0200D6A4(v0->unk_0C, 2); - sub_0200D788(v0->unk_0C, &v1, &v2); + CellActorData_SetAffineOverwriteMode(v0->unk_0C, 2); + CellActorData_GetAffineScaleF32(v0->unk_0C, &v1, &v2); ov116_02264764(&v0->unk_10, FX_F32_TO_FX32(v2), FX_F32_TO_FX32(2.0f), 2); { @@ -599,7 +599,7 @@ static void ov116_0226323C(SysTask *param0, void *param1) BOOL v6; v6 = ov116_02264774(&v0->unk_10); - sub_0200D6E8(v0->unk_0C, 1.0f, FX_FX32_TO_F32(v0->unk_10.unk_00)); + CellActorData_SetAffineScaleXYFx32(v0->unk_0C, 1.0f, FX_FX32_TO_F32(v0->unk_10.unk_00)); if (v6) { v0->unk_00++; @@ -613,7 +613,7 @@ static void ov116_0226323C(SysTask *param0, void *param1) BOOL v9; v9 = ov116_02264774(&v0->unk_10); - sub_0200D6E8(v0->unk_0C, 1.0f, FX_FX32_TO_F32(v0->unk_10.unk_00)); + CellActorData_SetAffineScaleXYFx32(v0->unk_0C, 1.0f, FX_FX32_TO_F32(v0->unk_10.unk_00)); if (v9) { v0->unk_00++; @@ -640,7 +640,7 @@ static void ov116_0226323C(SysTask *param0, void *param1) break; case 5: { BOOL v10 = ov116_02264774(&v0->unk_10); - sub_0200D6E8(v0->unk_0C, 1.0f, FX_FX32_TO_F32(v0->unk_10.unk_00)); + CellActorData_SetAffineScaleXYFx32(v0->unk_0C, 1.0f, FX_FX32_TO_F32(v0->unk_10.unk_00)); if (v10) { v0->unk_00 = 4; @@ -648,10 +648,10 @@ static void ov116_0226323C(SysTask *param0, void *param1) } } break; default: - sub_0200D6E8(v0->unk_0C, 1.0f, 1.0f); + CellActorData_SetAffineScaleXYFx32(v0->unk_0C, 1.0f, 1.0f); CellActorData_SetAnim(v0->unk_0C, 5); CellActorData_SetPriority(v0->unk_0C, 2); - sub_0200D6A4(v0->unk_0C, 0); + CellActorData_SetAffineOverwriteMode(v0->unk_0C, 0); v0->unk_30 = 0; diff --git a/src/overlay116/ov116_0226432C.c b/src/overlay116/ov116_0226432C.c index d2379f5861..1820475591 100644 --- a/src/overlay116/ov116_0226432C.c +++ b/src/overlay116/ov116_0226432C.c @@ -344,7 +344,7 @@ static void ov116_022647BC(SysTask *param0, void *param1) switch (v0->unk_04) { case 0: for (v1 = 0; v1 < 3; v1++) { - sub_0200D638(v0->unk_08[v1], &v2, &v3); + CellActorData_GetPositionFx32(v0->unk_08[v1], &v2, &v3); ov116_0226469C(&v0->unk_14[v1][0], v2, v2 + v6[v1], FX_F32_TO_FX32(0.3f), 8); ov116_0226469C(&v0->unk_14[v1][1], v3, v3 + v7[v1], FX_F32_TO_FX32(0.2f), 8); } @@ -356,7 +356,7 @@ static void ov116_022647BC(SysTask *param0, void *param1) v4[v1][0] = ov116_022646FC(&v0->unk_14[v1][0]); v4[v1][1] = ov116_022646FC(&v0->unk_14[v1][1]); - sub_0200D614(v0->unk_08[v1], v0->unk_14[v1][0].unk_00, v0->unk_14[v1][1].unk_00); + CellActorData_SetPositionFx32(v0->unk_08[v1], v0->unk_14[v1][0].unk_00, v0->unk_14[v1][1].unk_00); if ((v4[v1][0] == 0) || (v4[v1][1] == 0)) { v5 = 0; @@ -416,7 +416,7 @@ static inline void inline_ov116_022649E4_1(UnkStruct_ov116_02264FEC_sub1 *wk, fx wk->unk_04 += x; wk->unk_08 += y; - sub_0200D650(wk->unk_00, wk->unk_14 + wk->unk_0C + wk->unk_1C + wk->unk_04, wk->unk_18 + wk->unk_10 + wk->unk_20 + wk->unk_08, FX32_CONST(192 + 32)); + CellActorData_SetPositionWithOffsetFx32(wk->unk_00, wk->unk_14 + wk->unk_0C + wk->unk_1C + wk->unk_04, wk->unk_18 + wk->unk_10 + wk->unk_20 + wk->unk_08, FX32_CONST(192 + 32)); } static void ov116_022649E4(SysTask *param0, void *param1) @@ -690,7 +690,7 @@ static void ov116_0226510C(UnkStruct_ov116_02265470 *param0) continue; } - SpriteActor_GetSpritePositionXY(v5, &v1, &v2); + CellActorData_GetPositionXY(v5, &v1, &v2); if (v2 > v3[v0]) { v2 -= 6; CellActorData_SetPositionXY(v5, v1, v2); @@ -721,7 +721,7 @@ static void ov116_0226510C(UnkStruct_ov116_02265470 *param0) continue; } - SpriteActor_GetSpritePositionXY(v5, &v1, &v2); + CellActorData_GetPositionXY(v5, &v1, &v2); if (v2 < (192 + 32)) { v2 += 6; CellActorData_SetPositionXY(v5, v1, v2); @@ -914,9 +914,9 @@ void ov116_02265470(UnkStruct_ov116_02262A8C *param0) { s16 v2, v3; - SpriteActor_GetSpritePositionXY(param0->unk_B8[0], &v2, &v3); + CellActorData_GetPositionXY(param0->unk_B8[0], &v2, &v3); CellActorData_SetPositionXY(param0->unk_B8[0], v2, (192 + 32)); - SpriteActor_GetSpritePositionXY(param0->unk_B8[1], &v2, &v3); + CellActorData_GetPositionXY(param0->unk_B8[1], &v2, &v3); CellActorData_SetPositionXY(param0->unk_B8[1], v2, (192 + 32)); } break; @@ -935,9 +935,9 @@ void ov116_02265470(UnkStruct_ov116_02262A8C *param0) { s16 v5, v6; - SpriteActor_GetSpritePositionXY(param0->unk_B8[2], &v5, &v6); + CellActorData_GetPositionXY(param0->unk_B8[2], &v5, &v6); CellActorData_SetPositionXY(param0->unk_B8[2], v5, (192 + 32)); - SpriteActor_GetSpritePositionXY(param0->unk_B8[3], &v5, &v6); + CellActorData_GetPositionXY(param0->unk_B8[3], &v5, &v6); CellActorData_SetPositionXY(param0->unk_B8[3], v5, (192 + 32)); } break; @@ -1250,20 +1250,20 @@ static void ov116_02265AA4(SysTask *param0, void *param1) CellActorData_DrawSprite(v1->unk_A0[0].unk_00, 1); { - sub_0200D67C(v1->unk_00[0].unk_00, &v5, &v6, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v1->unk_00[0].unk_00, &v5, &v6, ((192 + 64) << FX32_SHIFT)); v3 = (v1->unk_00[0].unk_14 << FX32_SHIFT) + (sub_0201D250(v1->unk_00[0].unk_08) * v1->unk_00[0].unk_18); v4 = (v1->unk_00[0].unk_16 << FX32_SHIFT) + (sub_0201D264(v1->unk_00[0].unk_08) * v1->unk_00[0].unk_1C); - sub_0200D650(v1->unk_00[0].unk_00, v3, v4, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v1->unk_00[0].unk_00, v3, v4, ((192 + 64) << FX32_SHIFT)); ov116_02264764(&v1->unk_00[0].unk_20, v3, v3 + FX32_CONST(180), ov116_022658C8(v1->unk_148)); ov116_02264764(&v1->unk_00[0].unk_38, v4, v4 - FX32_CONST(24), ov116_022658C8(v1->unk_148)); - sub_0200D67C(v1->unk_A0[0].unk_00, &v5, &v6, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v1->unk_A0[0].unk_00, &v5, &v6, ((192 + 64) << FX32_SHIFT)); v3 = (v1->unk_A0[0].unk_14 << FX32_SHIFT) + (sub_0201D250(v1->unk_A0[0].unk_08) * v1->unk_A0[0].unk_18); v4 = (v1->unk_A0[0].unk_16 << FX32_SHIFT) - (sub_0201D264(v1->unk_A0[0].unk_08) * v1->unk_A0[0].unk_1C); - sub_0200D650(v1->unk_A0[0].unk_00, v3, v4, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v1->unk_A0[0].unk_00, v3, v4, ((192 + 64) << FX32_SHIFT)); ov116_02264764(&v1->unk_A0[0].unk_20, v3, v3 - FX32_CONST(180), ov116_022658C8(v1->unk_144)); ov116_02264764(&v1->unk_A0[0].unk_38, v4, v4 + FX32_CONST(24), ov116_022658C8(v1->unk_144)); } @@ -1330,7 +1330,7 @@ static BOOL ov116_02265D8C(UnkStruct_ov116_02265D84 *param0, int param1, int par switch (param0->unk_04) { case 0: - sub_0200D67C(param0->unk_00, &v1, &v2, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(param0->unk_00, &v1, &v2, ((192 + 64) << FX32_SHIFT)); if (param2 == 0) { ov116_02264764(¶m0->unk_20, v1, v1 - FX32_CONST(180), ov116_022658C8(param1)); } else { @@ -1347,7 +1347,7 @@ static BOOL ov116_02265D8C(UnkStruct_ov116_02265D84 *param0, int param1, int par case 1: v0[0] = ov116_02264774(¶m0->unk_20); ov116_02264774(¶m0->unk_38); - sub_0200D650(param0->unk_00, param0->unk_20.unk_00, param0->unk_38.unk_00, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_00, param0->unk_20.unk_00, param0->unk_38.unk_00, ((192 + 64) << FX32_SHIFT)); if (v0[0]) { return 1; @@ -1384,7 +1384,7 @@ static BOOL ov116_02265E64(UnkStruct_ov116_02265D84 *param0, int param1, int par case 1: v0[0] = ov116_02264774(¶m0->unk_20); ov116_02264774(¶m0->unk_38); - sub_0200D650(param0->unk_00, param0->unk_20.unk_00, param0->unk_38.unk_00, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_00, param0->unk_20.unk_00, param0->unk_38.unk_00, ((192 + 64) << FX32_SHIFT)); if (v0[0]) { return 1; @@ -1421,7 +1421,7 @@ static BOOL ov116_02265F1C(UnkStruct_ov116_02265D84 *param0, int param1, int par case 1: v0[0] = ov116_02264774(¶m0->unk_20); ov116_02264774(¶m0->unk_38); - sub_0200D650(param0->unk_00, param0->unk_20.unk_00, param0->unk_38.unk_00, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_00, param0->unk_20.unk_00, param0->unk_38.unk_00, ((192 + 64) << FX32_SHIFT)); if (v0[0]) { return 1; @@ -1452,7 +1452,7 @@ static BOOL ov116_02265FD4(UnkStruct_ov116_02265D84 *param0, int param1, int par param0->unk_08 = 0; } - sub_0200D67C(param0->unk_00, &v3, &v4, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(param0->unk_00, &v3, &v4, ((192 + 64) << FX32_SHIFT)); if (param2 == 0) { v1 = (param0->unk_14 << FX32_SHIFT) - (sub_0201D250(param0->unk_08) * param0->unk_18); @@ -1462,7 +1462,7 @@ static BOOL ov116_02265FD4(UnkStruct_ov116_02265D84 *param0, int param1, int par v2 = (param0->unk_16 << FX32_SHIFT) - (sub_0201D264(param0->unk_08) * param0->unk_1C); } - sub_0200D650(param0->unk_00, v1, v2, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(param0->unk_00, v1, v2, ((192 + 64) << FX32_SHIFT)); if (param0->unk_08 == 0) { param0->unk_10++; @@ -1515,15 +1515,15 @@ static void ov116_022660A8(SysTask *param0, void *param1) CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); - sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); v5 = (v2->unk_00[v0].unk_16 << FX32_SHIFT) + (sub_0201D264(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_1C); - sub_0200D650(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); - sub_0200D67C(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_A0[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_18); v5 = (v2->unk_A0[v0].unk_16 << FX32_SHIFT) - (sub_0201D264(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_1C); - sub_0200D650(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); } ov116_02265D84(&v2->unk_A0[0]); @@ -1642,15 +1642,15 @@ static void ov116_0226644C(SysTask *param0, void *param1) CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); - sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); v5 = (v2->unk_00[v0].unk_16 << FX32_SHIFT) + (sub_0201D264(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_1C); - sub_0200D650(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); - sub_0200D67C(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_A0[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_18); v5 = (v2->unk_A0[v0].unk_16 << FX32_SHIFT) - (sub_0201D264(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_1C); - sub_0200D650(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); } ov116_02265D84(&v2->unk_A0[0]); @@ -1760,15 +1760,15 @@ static void ov116_022667F4(SysTask *param0, void *param1) CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); - sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); v5 = (v2->unk_00[v0].unk_16 << FX32_SHIFT) + (sub_0201D264(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_1C); - sub_0200D650(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); - sub_0200D67C(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_A0[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_18); v5 = (v2->unk_A0[v0].unk_16 << FX32_SHIFT) - (sub_0201D264(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_1C); - sub_0200D650(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); } ov116_02265D84(&v2->unk_A0[0]); @@ -1906,15 +1906,15 @@ static void ov116_02266BF0(SysTask *param0, void *param1) CellActorData_DrawSprite(v2->unk_A0[v0].unk_00, 1); - sub_0200D67C(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_00[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_00[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_18); v5 = (v2->unk_00[v0].unk_16 << FX32_SHIFT) + (sub_0201D264(v2->unk_00[v0].unk_08) * v2->unk_00[v0].unk_1C); - sub_0200D650(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_00[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); - sub_0200D67C(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); + CellActorData_GetPositionFx32WithOffset(v2->unk_A0[v0].unk_00, &v6, &v7, ((192 + 64) << FX32_SHIFT)); v4 = (v2->unk_A0[v0].unk_14 << FX32_SHIFT) + (sub_0201D250(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_18); v5 = (v2->unk_A0[v0].unk_16 << FX32_SHIFT) - (sub_0201D264(v2->unk_A0[v0].unk_08) * v2->unk_A0[v0].unk_1C); - sub_0200D650(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetFx32(v2->unk_A0[v0].unk_00, v4, v5, ((192 + 64) << FX32_SHIFT)); } ov116_02265D84(&v2->unk_A0[0]); diff --git a/src/overlay117/ov117_02260668.c b/src/overlay117/ov117_02260668.c index b61029e30f..cfd231e6cc 100644 --- a/src/overlay117/ov117_02260668.c +++ b/src/overlay117/ov117_02260668.c @@ -274,7 +274,7 @@ int ov117_02260668(OverlayManager *param0, int *param1) RenderControlFlags_SetSpeedUpOnTouch(0); } - v0->unk_1C = ov114_0225CAD4(sub_0200D9B0(v0->unk_28), 110); + v0->unk_1C = ov114_0225CAD4(SpriteGfxHandler_GetCellActorCollection(v0->unk_28), 110); { int v2; diff --git a/src/overlay117/ov117_022626B0.c b/src/overlay117/ov117_022626B0.c index 4ec24e0bec..f69fd219cb 100644 --- a/src/overlay117/ov117_022626B0.c +++ b/src/overlay117/ov117_022626B0.c @@ -958,7 +958,7 @@ static void ov117_02263A6C(UnkStruct_ov117_022626B0 *param0, CellActorData *para v0 = ov117_022637AC(param0, 0) + 1; } - sub_0200D500(param1, param0->unk_21C, (param0->unk_230 >> FX32_SHIFT) + Unk_ov117_02266B05[param0->unk_270].unk_02, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1, param0->unk_21C, (param0->unk_230 >> FX32_SHIFT) + Unk_ov117_02266B05[param0->unk_270].unk_02, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param1, v0); CellActor_UpdateObject(param1->cellActor); } diff --git a/src/overlay117/ov117_02263AF0.c b/src/overlay117/ov117_02263AF0.c index 40ba779bc4..b560c06691 100644 --- a/src/overlay117/ov117_02263AF0.c +++ b/src/overlay117/ov117_02263AF0.c @@ -599,7 +599,7 @@ static int ov117_02263E1C(UnkStruct_ov117_02261280 *param0, const UnkStruct_ov11 s16 v3, v4; s32 v5 = 0; - sub_0200D5A0(param2->unk_10, &v3, &v4, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param2->unk_10, &v3, &v4, ((192 + 160) << FX32_SHIFT)); switch (v1->unk_07) { case 0: @@ -658,14 +658,14 @@ static BOOL ov117_02263F80(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 f32 v7; fx32 v8; - sub_0200D5A0(param1->unk_10, &v2, &v3, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param1->unk_10, &v2, &v3, ((192 + 160) << FX32_SHIFT)); switch (param1->unk_14->unk_07) { case 0: v6 = Unk_ov117_02266BB4[1].unk_02 - v3; - sub_0200D5E8(param1->unk_10, 0, (FX32_CONST(5.0))); - sub_0200D5A0(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_AddPositionXYFx32(param1->unk_10, 0, (FX32_CONST(5.0))); + CellActorData_GetPositionWithOffsetXY(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); v5 = Unk_ov117_02266BB4[1].unk_02 - v1; @@ -676,8 +676,8 @@ static BOOL ov117_02263F80(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 case 1: v6 = v2 - Unk_ov117_02266BB4[3].unk_00; - sub_0200D5E8(param1->unk_10, -(FX32_CONST(5.0)), 0); - sub_0200D5A0(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_AddPositionXYFx32(param1->unk_10, -(FX32_CONST(5.0)), 0); + CellActorData_GetPositionWithOffsetXY(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); v5 = v0 - Unk_ov117_02266BB4[3].unk_00; @@ -688,8 +688,8 @@ static BOOL ov117_02263F80(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 case 2: v6 = v3 - Unk_ov117_02266BB4[0].unk_02; - sub_0200D5E8(param1->unk_10, 0, -(FX32_CONST(5.0))); - sub_0200D5A0(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_AddPositionXYFx32(param1->unk_10, 0, -(FX32_CONST(5.0))); + CellActorData_GetPositionWithOffsetXY(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); v5 = v1 - Unk_ov117_02266BB4[0].unk_02; @@ -700,8 +700,8 @@ static BOOL ov117_02263F80(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 case 3: v6 = Unk_ov117_02266BB4[2].unk_00 - v2; - sub_0200D5E8(param1->unk_10, (FX32_CONST(5.0)), 0); - sub_0200D5A0(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_AddPositionXYFx32(param1->unk_10, (FX32_CONST(5.0)), 0); + CellActorData_GetPositionWithOffsetXY(param1->unk_10, &v0, &v1, ((192 + 160) << FX32_SHIFT)); v5 = Unk_ov117_02266BB4[2].unk_00 - v0; @@ -719,7 +719,7 @@ static BOOL ov117_02263F80(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 } v7 = FX_FX32_TO_F32(v8); - sub_0200D6E8(param1->unk_10, v7, v7); + CellActorData_SetAffineScaleXYFx32(param1->unk_10, v7, v7); } } else { if (v5 > -(24 / 2 + 2)) { @@ -730,7 +730,7 @@ static BOOL ov117_02263F80(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 } v7 = FX_FX32_TO_F32(v8); - sub_0200D6E8(param1->unk_10, v7, v7); + CellActorData_SetAffineScaleXYFx32(param1->unk_10, v7, v7); } } if ((param1->unk_04 == CommSys_CurNetId()) && (v6 >= 0) && (v5 <= 0)) { @@ -787,9 +787,9 @@ static CellActorData *ov117_0226417C(UnkStruct_ov117_02261280 *param0, const Unk v1.plttIdx = param1->unk_06; v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v1); - sub_0200D500(v0, param1->unk_00, param1->unk_02, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v0, param1->unk_00, param1->unk_02, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(v0, param1->unk_04); - sub_0200D6A4(v0, 2); + CellActorData_SetAffineOverwriteMode(v0, 2); CellActor_UpdateObject(v0->cellActor); return v0; @@ -834,7 +834,7 @@ static void ov117_02264214(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 break; } - sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(v1, v6); CellActor_UpdateObject(v1->cellActor); @@ -862,7 +862,7 @@ static void ov117_02264214(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 break; } - sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(v1, 28 + LCRNG_Next() % 3); CellActor_UpdateObject(v1->cellActor); @@ -887,7 +887,7 @@ static void ov117_02264214(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 break; } - sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(v1, 11); CellActor_UpdateObject(v1->cellActor); @@ -963,7 +963,7 @@ BOOL ov117_02264560(UnkStruct_ov117_02261280 *param0) v4 = 128 + (FX_Mul(sub_0201D2B8(v1->unk_0C), v1->unk_04)) / FX32_ONE; v5 = 96 + (-FX_Mul(sub_0201D2C4(v1->unk_0C), v1->unk_04)) / FX32_ONE; - sub_0200D500(v1->unk_00, v4, v5, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v1->unk_00, v4, v5, ((192 + 160) << FX32_SHIFT)); v1->unk_14--; v6++; @@ -990,7 +990,7 @@ BOOL ov117_02264560(UnkStruct_ov117_02261280 *param0) v4 = 128 + (FX_Mul(sub_0201D2B8(v2->unk_0C), v2->unk_04)) / FX32_ONE; v5 = 96 + (-FX_Mul(sub_0201D2C4(v2->unk_0C), v2->unk_04)) / FX32_ONE; - sub_0200D500(v2->unk_00, v4, v5, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v2->unk_00, v4, v5, ((192 + 160) << FX32_SHIFT)); v2->unk_14--; v6++; @@ -1017,7 +1017,7 @@ BOOL ov117_02264560(UnkStruct_ov117_02261280 *param0) v4 = 128 + (FX_Mul(sub_0201D2B8(v3->unk_0C), v3->unk_04)) / FX32_ONE; v5 = 96 + (-FX_Mul(sub_0201D2C4(v3->unk_0C), v3->unk_04)) / FX32_ONE; - sub_0200D500(v3->unk_00, v4, v5, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v3->unk_00, v4, v5, ((192 + 160) << FX32_SHIFT)); v3->unk_14--; v6++; @@ -1067,7 +1067,7 @@ static CellActorData *ov117_02264884(UnkStruct_ov117_02261280 *param0, int param v1 = Unk_ov117_02266D34; v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v1); - sub_0200D500(v0, (9 * 8) - param2 * 16, (4 * 8), ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v0, (9 * 8) - param2 * 16, (4 * 8), ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(v0, 0 + param1); CellActor_UpdateObject(v0->cellActor); CellActorData_SetAnimateFlag(v0, 1); @@ -1131,7 +1131,7 @@ static void ov117_0226498C(UnkStruct_ov117_02264930 *param0) v0 = (9 * 8) - param0->unk_06 * 16; - sub_0200D5A0(param0->unk_00, &v1, &v2, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param0->unk_00, &v1, &v2, ((192 + 160) << FX32_SHIFT)); if (v0 > v1) { v1 += 2; @@ -1139,7 +1139,7 @@ static void ov117_0226498C(UnkStruct_ov117_02264930 *param0) v1 = v0; } - sub_0200D500(param0->unk_00, v1, v2, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param0->unk_00, v1, v2, ((192 + 160) << FX32_SHIFT)); } } @@ -1160,7 +1160,7 @@ static void ov117_022649D8(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 param1->unk_05 = 1; CellActorData_SetAnim(param1->unk_00, 0 + param1->unk_04); - sub_0200D500(param1->unk_00, (9 * 8) - 5 * 16, (4 * 8), ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00, (9 * 8) - 5 * 16, (4 * 8), ((192 + 160) << FX32_SHIFT)); for (v1 = 0; v1 < 5; v1++) { v2 = ¶m0->unk_3D10[v1]; @@ -1456,7 +1456,7 @@ void ov117_02264FB0(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226504C * for (v2 = 0; v2 < 4; v2++) { param1->unk_00[v2] = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v1); - sub_0200D500(param1->unk_00[v2], Unk_ov117_02266BB4[v2].unk_00, Unk_ov117_02266BB4[v2].unk_02, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00[v2], Unk_ov117_02266BB4[v2].unk_00, Unk_ov117_02266BB4[v2].unk_02, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param1->unk_00[v2], 31 + v2 / 2); CellActor_UpdateObject(param1->unk_00[v2]->cellActor); } @@ -1494,22 +1494,22 @@ void ov117_02265064(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022653F4 * v4 = 196 / 2 + (-FX_Mul(sub_0201D2C4(param1->unk_E4 + param1->unk_00[v1].unk_0C), (64 + 4))); param1->unk_00[v1].unk_00 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v0); - sub_0200D500(param1->unk_00[v1].unk_00, v3, v4 + -24, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00[v1].unk_00, v3, v4 + -24, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param1->unk_00[v1].unk_00, Unk_ov117_02266B7A[v1 + 1]); CellActor_UpdateObject(param1->unk_00[v1].unk_00->cellActor); CellActorData_DrawSprite(param1->unk_00[v1].unk_00, 0); param1->unk_00[v1].unk_04 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); - sub_0200D500(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param1->unk_00[v1].unk_04, 33); CellActor_UpdateObject(param1->unk_00[v1].unk_04->cellActor); CellActorData_DrawSprite(param1->unk_00[v1].unk_04, 0); param1->unk_00[v1].unk_08 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E04); - sub_0200D500(param1->unk_00[v1].unk_08, v3, v4 + -24 + 24, ((192 + 160) << FX32_SHIFT)); - SpriteActor_SetOAMMode(param1->unk_00[v1].unk_08, GX_OAM_MODE_XLU); - sub_0200D6A4(param1->unk_00[v1].unk_08, 1); - sub_0200D6E8(param1->unk_00[v1].unk_08, 1.0f, 1.0f); + CellActorData_SetPositionWithOffsetXY(param1->unk_00[v1].unk_08, v3, v4 + -24 + 24, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetExplicitOAMMode(param1->unk_00[v1].unk_08, GX_OAM_MODE_XLU); + CellActorData_SetAffineOverwriteMode(param1->unk_00[v1].unk_08, 1); + CellActorData_SetAffineScaleXYFx32(param1->unk_00[v1].unk_08, 1.0f, 1.0f); CellActorData_SetAnim(param1->unk_00[v1].unk_08, 34 + v1); CellActor_UpdateObject(param1->unk_00[v1].unk_08->cellActor); CellActorData_DrawSprite(param1->unk_00[v1].unk_08, 0); @@ -1662,7 +1662,7 @@ static int ov117_02265454(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 case 0: CellActorData_DrawSprite(param2->unk_00, 1); CellActorData_DrawSprite(param2->unk_08, 1); - sub_0200D5A0(param2->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param2->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); param2->unk_1C = v0; param2->unk_1E = v1; param2->unk_11++; @@ -1694,8 +1694,8 @@ static int ov117_02265454(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 break; } if (param2->unk_12 >= 15) { - sub_0200D500(param2->unk_00, param2->unk_1C, param2->unk_1E, ((192 + 160) << FX32_SHIFT)); - sub_0200D500(param2->unk_08, param2->unk_1C, param2->unk_1E + 24, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_00, param2->unk_1C, param2->unk_1E, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_08, param2->unk_1C, param2->unk_1E + 24, ((192 + 160) << FX32_SHIFT)); ov117_02265428(param2, 2); ov117_0226639C(param0, param2, ¶m2->unk_30); @@ -1705,13 +1705,13 @@ static int ov117_02265454(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 v6 = ((180 * param2->unk_12) << FX32_SHIFT) / 15; v7 = -(FX_Mul(sub_0201D2B8(v6), (24 << FX32_SHIFT))) / FX32_ONE; - sub_0200D500(param2->unk_00, v0, v1 + v7, ((192 + 160) << FX32_SHIFT)); - sub_0200D500(param2->unk_08, v0, v1 + 24, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_00, v0, v1 + v7, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_08, v0, v1 + 24, ((192 + 160) << FX32_SHIFT)); v8 = FX32_ONE - (FX32_ONE * (-v7 / 3) / ((24 << FX32_SHIFT) >> FX32_SHIFT)); v9 = FX_FX32_TO_F32(v8); - sub_0200D6E8(param2->unk_08, v9, v9); + CellActorData_SetAffineScaleXYFx32(param2->unk_08, v9, v9); break; } @@ -1738,13 +1738,13 @@ static int ov117_02265644(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 v0 = 256 / 2 + FX_Mul(sub_0201D2B8(param1->unk_E4 + param2->unk_0C), 76); v1 = 196 / 2 + (-FX_Mul(sub_0201D2C4(param1->unk_E4 + param2->unk_0C), (64 + 4))); - sub_0200D500(param2->unk_00, v0, v1 + -24 + v3, ((192 + 160) << FX32_SHIFT)); - sub_0200D500(param2->unk_08, v0, v1 + -24 + 24, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_00, v0, v1 + -24 + v3, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_08, v0, v1 + -24 + 24, ((192 + 160) << FX32_SHIFT)); v4 = FX32_ONE - (FX32_ONE * (-v3 / 3) / ((12 << FX32_SHIFT) >> FX32_SHIFT)); v5 = FX_FX32_TO_F32(v4); - sub_0200D6E8(param2->unk_08, v5, v5); + CellActorData_SetAffineScaleXYFx32(param2->unk_08, v5, v5); if (param1->unk_F3 == Unk_ov117_02266BC4[param1->unk_F4].unk_00 - 1) { ov117_0226639C(param0, param2, ¶m2->unk_30); @@ -1770,8 +1770,8 @@ static int ov117_022657C4(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 switch (param2->unk_11) { case 0: Sound_PlayEffect(1403); - sub_0200D5A0(param2->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); - sub_0200D500(param2->unk_04, v0, v1 + -32, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param2->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_04, v0, v1 + -32, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param2->unk_04, 33); CellActorData_DrawSprite(param2->unk_04, 1); CellActorData_SetAnim(param2->unk_00, Unk_ov117_02266B7A[param2->unk_14] + 2); @@ -1824,7 +1824,7 @@ static int ov117_022657C4(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 v4 = 256 / 2 + FX_Mul(sub_0201D2B8((360 << FX32_SHIFT) / 12 * v3), 76); v5 = 196 / 2 + (-FX_Mul(sub_0201D2C4((360 << FX32_SHIFT) / 12 * v3), (64 + 4))); - sub_0200D5A0(param2->unk_00, &v6, &v7, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param2->unk_00, &v6, &v7, ((192 + 160) << FX32_SHIFT)); v7 -= -24; @@ -1843,9 +1843,9 @@ static int ov117_022657C4(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_0226 v8 = ((180 * param2->unk_12) << FX32_SHIFT) / param2->unk_18; v9 = -(FX_Mul(sub_0201D2B8(v8), (12 << FX32_SHIFT))) / FX32_ONE; - sub_0200D500(param2->unk_00, param2->unk_28 / FX32_ONE, param2->unk_2C / FX32_ONE + -24 + v9, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_00, param2->unk_28 / FX32_ONE, param2->unk_2C / FX32_ONE + -24 + v9, ((192 + 160) << FX32_SHIFT)); CellActorData_UpdateNFrames(param2->unk_00, ((8 + 8 + 12 + 8 + 8) << FX32_SHIFT) / param2->unk_18); - sub_0200D500(param2->unk_08, param2->unk_28 / FX32_ONE, param2->unk_2C / FX32_ONE + -24 + 24, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_08, param2->unk_28 / FX32_ONE, param2->unk_2C / FX32_ONE + -24 + 24, ((192 + 160) << FX32_SHIFT)); param2->unk_12--; @@ -1872,12 +1872,12 @@ void ov117_02265ABC(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02265C3C * for (v1 = 0; v1 < 3; v1++) { param1->unk_00[v1].unk_00 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &v0); - sub_0200D500(param1->unk_00[v1].unk_00, 0, 0, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00[v1].unk_00, 0, 0, ((192 + 160) << FX32_SHIFT)); CellActorData_DrawSprite(param1->unk_00[v1].unk_00, 0); param1->unk_00[v1].unk_04 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); - sub_0200D500(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param1->unk_00[v1].unk_04, 33); CellActor_UpdateObject(param1->unk_00[v1].unk_04->cellActor); CellActorData_DrawSprite(param1->unk_00[v1].unk_04, 0); @@ -1923,7 +1923,7 @@ void ov117_02265B58(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02265C3C * v3 = Unk_ov117_02266BD8[param0->unk_00->unk_30][v2]; v4->unk_10 = Unk_ov117_02266BB4[v3].unk_02 + -24; - sub_0200D500(v4->unk_00, Unk_ov117_02266BB4[v3].unk_00, v4->unk_10 + -96, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(v4->unk_00, Unk_ov117_02266BB4[v3].unk_00, v4->unk_10 + -96, ((192 + 160) << FX32_SHIFT)); CellActor_UpdateObject(v4->unk_00->cellActor); v4->unk_12 = param2; @@ -1951,7 +1951,7 @@ static BOOL ov117_02265C3C(UnkStruct_ov117_02265C3C *param0, UnkStruct_ov117_022 switch (param1->unk_13) { case 0: - sub_0200D5A0(param1->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param1->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); param1->unk_08 = v0 * FX32_ONE; param1->unk_0C = v1 * FX32_ONE; param1->unk_13++; @@ -1970,8 +1970,8 @@ static BOOL ov117_02265C3C(UnkStruct_ov117_02265C3C *param0, UnkStruct_ov117_022 } break; case 2: - sub_0200D5A0(param1->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); - sub_0200D500(param1->unk_04, v0, v1 + -32, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param1->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_04, v0, v1 + -32, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param1->unk_04, 33); CellActorData_DrawSprite(param1->unk_04, 1); Sound_PlayEffect(1403); @@ -2005,7 +2005,7 @@ static BOOL ov117_02265C3C(UnkStruct_ov117_02265C3C *param0, UnkStruct_ov117_022 break; } - sub_0200D500(param1->unk_00, param1->unk_08 / FX32_ONE, param1->unk_0C / FX32_ONE, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00, param1->unk_08 / FX32_ONE, param1->unk_0C / FX32_ONE, ((192 + 160) << FX32_SHIFT)); return 1; } @@ -2045,7 +2045,7 @@ void ov117_02265DB8(BgConfig *param0, SpriteGfxHandler *param1, UnkStruct_020127 v0.unk_00 = param2; v0.unk_04 = &v1; - v0.unk_08 = sub_0200D9B0(param1); + v0.unk_08 = SpriteGfxHandler_GetCellActorCollection(param1); v0.unk_0C = SpriteGfxHandler_GetPaletteProxy(param1, param8); v0.unk_10 = NULL; v0.unk_14 = v2.unk_04; @@ -2291,7 +2291,7 @@ BOOL ov117_02266274(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02266274 * switch (param1->unk_04) { case 0: case 5: - sub_0200D500(param1->unk_00, 128, 16, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param1->unk_00, 128, 16, ((192 + 160) << FX32_SHIFT)); CellActorData_DrawSprite(param1->unk_00, 1); param1->unk_04++; break; @@ -2314,7 +2314,7 @@ BOOL ov117_02266274(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_02266274 * param1->unk_18 = 0; param1->unk_10 += 6; - sub_0200D5DC(param1->unk_00, 0, 6); + CellActorData_AddPositionXY(param1->unk_00, 0, 6); if (param1->unk_10 > 192 - 96) { param1->unk_04++; @@ -2353,7 +2353,7 @@ static void ov117_02266344(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 v0 = CellActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E38); CellActorData_SetAnim(v0, 27); - SpriteActor_SetOAMMode(v0, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(v0, GX_OAM_MODE_XLU); CellActorData_DrawSprite(v0, 0); CellActor_UpdateObject(v0->cellActor); @@ -2375,12 +2375,12 @@ static void ov117_0226639C(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 s16 v0, v1; int v2; - sub_0200D5A0(param1->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); + CellActorData_GetPositionWithOffsetXY(param1->unk_00, &v0, &v1, ((192 + 160) << FX32_SHIFT)); for (v2 = 0; v2 < 2; v2++) { - sub_0200D500(param2->unk_00[v2], v0, v1 + 28, ((192 + 160) << FX32_SHIFT)); + CellActorData_SetPositionWithOffsetXY(param2->unk_00[v2], v0, v1 + 28, ((192 + 160) << FX32_SHIFT)); CellActorData_SetAnim(param2->unk_00[v2], 27); - SpriteActor_SetOAMMode(param2->unk_00[v2], GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param2->unk_00[v2], GX_OAM_MODE_XLU); CellActorData_DrawSprite(param2->unk_00[v2], 1); param2->unk_08[v2] = LCRNG_Next() % 0x1000 + 0x1000; @@ -2404,7 +2404,7 @@ static void ov117_02266440(UnkStruct_ov117_02261280 *param0, UnkStruct_ov117_022 break; case 1: for (v0 = 0; v0 < 2; v0++) { - sub_0200D5E8(param2->unk_00[v0], param2->unk_08[v0], -param2->unk_10[v0]); + CellActorData_AddPositionXYFx32(param2->unk_00[v0], param2->unk_08[v0], -param2->unk_10[v0]); CellActor_UpdateObject(param2->unk_00[v0]->cellActor); } diff --git a/src/overlay119/ov119_021D0D80.c b/src/overlay119/ov119_021D0D80.c index dc563fbb8a..0319129ac1 100644 --- a/src/overlay119/ov119_021D0D80.c +++ b/src/overlay119/ov119_021D0D80.c @@ -576,7 +576,7 @@ void ov119_021D161C(UnkStruct_ov119_021D0FD0 *param0) param0->unk_74 = CellActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); CellActorData_UpdateObject(param0->unk_74); - sub_0200D6A4(param0->unk_74, 2); + CellActorData_SetAffineOverwriteMode(param0->unk_74, 2); v0.x = 0; v0.y = 0 - (2 * 8); @@ -653,10 +653,10 @@ BOOL ov119_021D16C0(UnkStruct_ov119_021D0FD0 *param0, int param1) v5++; } - sub_0200D5DC(param0->unk_74, v1, v2); + CellActorData_AddPositionXY(param0->unk_74, v1, v2); if (v3 != 0.0f) { - sub_0200D6E8(param0->unk_74, v3, v4); + CellActorData_SetAffineScaleXYFx32(param0->unk_74, v3, v4); } else { v5++; } diff --git a/src/overlay119/ov119_021D191C.c b/src/overlay119/ov119_021D191C.c index 652f54fe0c..5f20b646e1 100644 --- a/src/overlay119/ov119_021D191C.c +++ b/src/overlay119/ov119_021D191C.c @@ -565,18 +565,18 @@ static BOOL ov119_021D1FAC(UnkStruct_ov119_021D0FD0 *param0) s16 v3, v4; int v5 = 0; - SpriteActor_GetSpritePositionXY(param0->unk_78, &v3, &v4); + CellActorData_GetPositionXY(param0->unk_78, &v3, &v4); if (v4 > -48) { - sub_0200D5DC(param0->unk_78, 0, -4); + CellActorData_AddPositionXY(param0->unk_78, 0, -4); } else { v5++; } - SpriteActor_GetSpritePositionXY(param0->unk_7C, &v3, &v4); + CellActorData_GetPositionXY(param0->unk_7C, &v3, &v4); if (v4 < 192) { - sub_0200D5DC(param0->unk_7C, 0, +4); + CellActorData_AddPositionXY(param0->unk_7C, 0, +4); } else { v5++; } @@ -671,18 +671,18 @@ static BOOL ov119_021D21BC(UnkStruct_ov119_021D0FD0 *param0) s16 v2, v3; int v4 = 0; - SpriteActor_GetSpritePositionXY(param0->unk_78, &v2, &v3); + CellActorData_GetPositionXY(param0->unk_78, &v2, &v3); if (v3 > -48) { - sub_0200D5DC(param0->unk_78, 0, -4); + CellActorData_AddPositionXY(param0->unk_78, 0, -4); } else { v4++; } - SpriteActor_GetSpritePositionXY(param0->unk_7C, &v2, &v3); + CellActorData_GetPositionXY(param0->unk_7C, &v2, &v3); if (v3 < 192) { - sub_0200D5DC(param0->unk_7C, 0, +4); + CellActorData_AddPositionXY(param0->unk_7C, 0, +4); } else { v4++; } diff --git a/src/sprite_renderer.c b/src/sprite_renderer.c index 990675b435..146d0dcb23 100644 --- a/src/sprite_renderer.c +++ b/src/sprite_renderer.c @@ -27,10 +27,10 @@ static BOOL SpriteRenderer_LoadResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, enum SpriteResourceType resourceType, int resourceID); static BOOL SpriteRenderer_LoadResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, enum SpriteResourceType resourceType, int resourceID); -static BOOL SpriteResourceList_Add(SpriteResourceList *param0, SpriteResource *param1); -static BOOL sub_0200D27C(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); -static BOOL sub_0200D2D0(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); -static BOOL SpriteResourceCollection_RemoveFromResourceList(SpriteResourceCollection *param0, SpriteResourceList *param1, int param2); +static BOOL SpriteResourceList_Add(SpriteResourceList *resourceList, SpriteResource *resource); +static BOOL sub_0200D27C(SpriteResourceCollection *resourceCollection, SpriteResourceList *resourceList, int resourceID); +static BOOL sub_0200D2D0(SpriteResourceCollection *resourceCollection, SpriteResourceList *resourceList, int resourceID); +static BOOL SpriteResourceCollection_RemoveFromResourceList(SpriteResourceCollection *resourceCollection, SpriteResourceList *resourceList, int resourceID); SpriteRenderer *SpriteRenderer_Create(int heapID) { @@ -111,7 +111,7 @@ BOOL SpriteRenderer_CreateCellActorList(SpriteRenderer *renderer, SpriteGfxHandl return FALSE; } - gfxHandler->cellActorList = sub_020095C4(numCells, &renderer->renderer, renderer->heapID); + gfxHandler->cellActorCollection = sub_020095C4(numCells, &renderer->renderer, renderer->heapID); return TRUE; } @@ -123,7 +123,7 @@ void thunk_CellActor_Delete(CellActor *cellActor) void SpriteGfxHandler_UpdateCellActorCollection(SpriteGfxHandler *gfxHandler) { GF_ASSERT(gfxHandler != NULL); - CellActorCollection_Update(gfxHandler->cellActorList); + CellActorCollection_Update(gfxHandler->cellActorCollection); } void OAMManager_ApplyAndResetBuffers(void) @@ -138,7 +138,7 @@ void sub_0200C808(void) void SpriteGfxHandler_DeleteCellActorCollection(SpriteGfxHandler *gfxHandler) { - CellActorCollection_Delete(gfxHandler->cellActorList); + CellActorCollection_Delete(gfxHandler->cellActorCollection); } void SpriteGfxHandler_DeleteCellActorData(SpriteGfxHandler *gfxHandler) @@ -267,7 +267,7 @@ CellActor *SpriteRenderer_CreateCellActor(SpriteRenderer *renderer, SpriteGfxHan { CellActorInitParamsEx cellActorParams; - cellActorParams.collection = gfxHandler->cellActorList; + cellActorParams.collection = gfxHandler->cellActorCollection; cellActorParams.resourceData = &gfxHandler->cellActorDataList->resourceDataList[resourceIndex]; cellActorParams.position.x = FX32_CONST(x); cellActorParams.position.y = FX32_CONST(y); @@ -513,7 +513,7 @@ CellActorData *CellActor_LoadResources(SpriteRenderer *renderer, SpriteGfxHandle gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE], gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM]); - cellActorParams.collection = gfxHandler->cellActorList; + cellActorParams.collection = gfxHandler->cellActorCollection; cellActorParams.resourceData = cellActorData->cellActorResource; cellActorParams.position.x = FX32_CONST(template->x); cellActorParams.position.y = FX32_CONST(template->y); @@ -928,352 +928,351 @@ void CellActor_SetPositionWithOffsetXY(CellActor *cellActor, s16 x, s16 y, fx32 CellActor_SetPosition(cellActor, &position); } -void sub_0200D500(CellActorData *param0, s16 param1, s16 param2, fx32 param3) +void CellActorData_SetPositionWithOffsetXY(CellActorData *cellActorData, s16 x, s16 y, fx32 offset) { - CellActor_SetPositionWithOffsetXY(param0->cellActor, param1, param2, param3); + CellActor_SetPositionWithOffsetXY(cellActorData->cellActor, x, y, offset); } -void sub_0200D50C(CellActor *param0, s16 *param1, s16 *param2) +void CellActor_GetPositionXY(CellActor *cellActor, s16 *x, s16 *y) { - const VecFx32 *v0; + const VecFx32 *position; - v0 = CellActor_GetPosition(param0); - *param1 = v0->x / FX32_ONE; + position = CellActor_GetPosition(cellActor); + *x = position->x / FX32_ONE; - if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { - *param2 = (v0->y - (192 << FX32_SHIFT)) / FX32_ONE; + if (CellActor_GetVRamType(cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + *y = (position->y - (192 << FX32_SHIFT)) / FX32_ONE; } else { - *param2 = v0->y / FX32_ONE; + *y = position->y / FX32_ONE; } } -void SpriteActor_GetSpritePositionXY(CellActorData *param0, s16 *param1, s16 *param2) +void CellActorData_GetPositionXY(CellActorData *cellActorData, s16 *x, s16 *y) { - sub_0200D50C(param0->cellActor, param1, param2); + CellActor_GetPositionXY(cellActorData->cellActor, x, y); } -void sub_0200D55C(CellActor *param0, s16 *param1, s16 *param2, fx32 param3) +void CellActor_GetPositionWithOffsetXY(CellActor *cellActor, s16 *x, s16 *y, fx32 offset) { - const VecFx32 *v0; + const VecFx32 *position; - v0 = CellActor_GetPosition(param0); - *param1 = v0->x / FX32_ONE; + position = CellActor_GetPosition(cellActor); + *x = position->x / FX32_ONE; - if (CellActor_GetVRamType(param0) == NNS_G2D_VRAM_TYPE_2DSUB) { - *param2 = (v0->y - param3) / FX32_ONE; + if (CellActor_GetVRamType(cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + *y = (position->y - offset) / FX32_ONE; } else { - *param2 = v0->y / FX32_ONE; + *y = position->y / FX32_ONE; } } -void sub_0200D5A0(CellActorData *param0, s16 *param1, s16 *param2, fx32 param3) +void CellActorData_GetPositionWithOffsetXY(CellActorData *cellActorData, s16 *x, s16 *y, fx32 offset) { - sub_0200D55C(param0->cellActor, param1, param2, param3); + CellActor_GetPositionWithOffsetXY(cellActorData->cellActor, x, y, offset); } -void sub_0200D5AC(CellActor *param0, s16 param1, s16 param2) +void CellActor_AddPositionXY(CellActor *cellActor, s16 x, s16 y) { - const VecFx32 *v0; - VecFx32 v1; + const VecFx32 *position; + VecFx32 newPosition; - v0 = CellActor_GetPosition(param0); + position = CellActor_GetPosition(cellActor); - v1.x = v0->x + (param1 * FX32_ONE); - v1.y = v0->y + (param2 * FX32_ONE); - v1.z = v0->z; + newPosition.x = position->x + (x * FX32_ONE); + newPosition.y = position->y + (y * FX32_ONE); + newPosition.z = position->z; - CellActor_SetPosition(param0, &v1); + CellActor_SetPosition(cellActor, &newPosition); } -void sub_0200D5DC(CellActorData *param0, s16 param1, s16 param2) +void CellActorData_AddPositionXY(CellActorData *cellActorData, s16 x, s16 y) { - sub_0200D5AC(param0->cellActor, param1, param2); + CellActor_AddPositionXY(cellActorData->cellActor, x, y); } -void sub_0200D5E8(CellActorData *param0, fx32 param1, fx32 param2) +void CellActorData_AddPositionXYFx32(CellActorData *cellActorData, fx32 x, fx32 y) { - const VecFx32 *v0; - VecFx32 v1; + const VecFx32 *position; + VecFx32 newPosition; - v0 = CellActor_GetPosition(param0->cellActor); + position = CellActor_GetPosition(cellActorData->cellActor); - v1.x = v0->x + param1; - v1.y = v0->y + param2; - v1.z = v0->z; + newPosition.x = position->x + x; + newPosition.y = position->y + y; + newPosition.z = position->z; - CellActor_SetPosition(param0->cellActor, &v1); + CellActor_SetPosition(cellActorData->cellActor, &newPosition); } -void sub_0200D614(CellActorData *param0, fx32 param1, fx32 param2) +void CellActorData_SetPositionFx32(CellActorData *cellActorData, fx32 x, fx32 y) { - const VecFx32 *v0; - VecFx32 v1; + const VecFx32 *position; + VecFx32 newPosition; - v0 = CellActor_GetPosition(param0->cellActor); + position = CellActor_GetPosition(cellActorData->cellActor); - v1.x = param1; - v1.y = param2; - v1.z = v0->z; + newPosition.x = x; + newPosition.y = y; + newPosition.z = position->z; - CellActor_SetPosition(param0->cellActor, &v1); + CellActor_SetPosition(cellActorData->cellActor, &newPosition); } -void sub_0200D638(CellActorData *param0, fx32 *param1, fx32 *param2) +void CellActorData_GetPositionFx32(CellActorData *cellActorData, fx32 *x, fx32 *y) { - const VecFx32 *v0; - VecFx32 v1; + const VecFx32 *position; - v0 = CellActor_GetPosition(param0->cellActor); + position = CellActor_GetPosition(cellActorData->cellActor); - *param1 = v0->x; - *param2 = v0->y; + *x = position->x; + *y = position->y; } -void sub_0200D650(CellActorData *param0, fx32 param1, fx32 param2, fx32 param3) +void CellActorData_SetPositionWithOffsetFx32(CellActorData *cellActorData, fx32 x, fx32 y, fx32 offset) { - if (CellActor_GetVRamType(param0->cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { - sub_0200D614(param0, param1, param2 + param3); + if (CellActor_GetVRamType(cellActorData->cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + CellActorData_SetPositionFx32(cellActorData, x, y + offset); } else { - sub_0200D614(param0, param1, param2); + CellActorData_SetPositionFx32(cellActorData, x, y); } } -void sub_0200D67C(CellActorData *param0, fx32 *param1, fx32 *param2, fx32 param3) +void CellActorData_GetPositionFx32WithOffset(CellActorData *cellActorData, fx32 *x, fx32 *y, fx32 offset) { - sub_0200D638(param0, param1, param2); + CellActorData_GetPositionFx32(cellActorData, x, y); - if (CellActor_GetVRamType(param0->cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { - *param2 = *param2 - param3; + if (CellActor_GetVRamType(cellActorData->cellActor) == NNS_G2D_VRAM_TYPE_2DSUB) { + *y = *y - offset; } } -void sub_0200D69C(CellActor *param0, int param1) +void thunk_CellActor_SetAffineOverwriteMode(CellActor *cellActor, enum AffineOverwriteMode mode) { - CellActor_SetAffineOverwriteMode(param0, param1); + CellActor_SetAffineOverwriteMode(cellActor, mode); } -void sub_0200D6A4(CellActorData *param0, int param1) +void CellActorData_SetAffineOverwriteMode(CellActorData *cellActorData, enum AffineOverwriteMode mode) { - sub_0200D69C(param0->cellActor, param1); + thunk_CellActor_SetAffineOverwriteMode(cellActorData->cellActor, mode); } -void sub_0200D6B0(CellActor *param0, f32 param1, f32 param2) +void CellActor_SetAffineScaleXYFx32(CellActor *cellActor, f32 x, f32 y) { - const VecFx32 *v0; - VecFx32 *v1; + const VecFx32 *scale; + VecFx32 *newScale; - v0 = CellActor_GetAffineScale(param0); - v1 = (VecFx32 *)v0; + scale = CellActor_GetAffineScale(cellActor); + newScale = (VecFx32 *)scale; - v1->x = (param1 * FX32_ONE); - v1->y = (param2 * FX32_ONE); + newScale->x = (x * FX32_ONE); + newScale->y = (y * FX32_ONE); - CellActor_SetAffineScale(param0, v1); + CellActor_SetAffineScale(cellActor, newScale); } -void sub_0200D6E8(CellActorData *param0, f32 param1, f32 param2) +void CellActorData_SetAffineScaleXYFx32(CellActorData *cellActorData, f32 x, f32 y) { - sub_0200D6B0(param0->cellActor, param1, param2); + CellActor_SetAffineScaleXYFx32(cellActorData->cellActor, x, y); } -void sub_0200D6F4(CellActor *param0, f32 param1, f32 param2) +void CellActor_AddAffineScaleFx32(CellActor *cellActor, f32 x, f32 y) { - const VecFx32 *v0; - VecFx32 *v1; + const VecFx32 *scale; + VecFx32 *newScale; - v0 = CellActor_GetAffineScale(param0); - v1 = (VecFx32 *)v0; + scale = CellActor_GetAffineScale(cellActor); + newScale = (VecFx32 *)scale; - v1->x = v0->x + (param1 * FX32_ONE); - v1->y = v0->y + (param2 * FX32_ONE); + newScale->x = scale->x + (x * FX32_ONE); + newScale->y = scale->y + (y * FX32_ONE); - CellActor_SetAffineScale(param0, v1); + CellActor_SetAffineScale(cellActor, newScale); } -void sub_0200D74C(CellActorData *param0, f32 param1, f32 param2) +void CellActorData_AddAffineScaleFx32(CellActorData *cellActorData, f32 x, f32 y) { - sub_0200D6F4(param0->cellActor, param1, param2); + CellActor_AddAffineScaleFx32(cellActorData->cellActor, x, y); } -void sub_0200D758(CellActor *param0, f32 *param1, f32 *param2) +void CellActor_GetAffineScaleF32(CellActor *cellActor, f32 *x, f32 *y) { - const VecFx32 *v0; + const VecFx32 *scale; VecFx32 *v1; - v0 = CellActor_GetAffineScale(param0); + scale = CellActor_GetAffineScale(cellActor); - *param1 = FX_FX32_TO_F32(v0->x); - *param2 = FX_FX32_TO_F32(v0->y); + *x = FX_FX32_TO_F32(scale->x); + *y = FX_FX32_TO_F32(scale->y); } -void sub_0200D788(CellActorData *param0, f32 *param1, f32 *param2) +void CellActorData_GetAffineScaleF32(CellActorData *cellActorData, f32 *x, f32 *y) { - sub_0200D758(param0->cellActor, param1, param2); + CellActor_GetAffineScaleF32(cellActorData->cellActor, x, y); } -void sub_0200D794(CellActor *param0, u16 param1) +void thunk_CellActor_SetAffineZRotation(CellActor *cellActor, u16 angle) { - CellActor_SetAffineZRotation(param0, param1); + CellActor_SetAffineZRotation(cellActor, angle); } -void sub_0200D79C(CellActorData *param0, u16 param1) +void CellActorData_SetAffineZRotation(CellActorData *cellActorData, u16 angle) { - sub_0200D794(param0->cellActor, param1); + thunk_CellActor_SetAffineZRotation(cellActorData->cellActor, angle); } -void sub_0200D7A8(CellActor *param0, s32 param1) +void CellActor_AddAffineZRotation(CellActor *cellActor, s32 angle) { - u16 v0; + u16 rotation; - v0 = CellActor_GetAffineZRotation(param0); - v0 += param1; + rotation = CellActor_GetAffineZRotation(cellActor); + rotation += angle; - CellActor_SetAffineZRotation(param0, v0); + CellActor_SetAffineZRotation(cellActor, rotation); } -void sub_0200D7C0(CellActorData *param0, s32 param1) +void CellActorData_AddAffineZRotation(CellActorData *cellActorData, s32 angle) { - sub_0200D7A8(param0->cellActor, param1); + CellActor_AddAffineZRotation(cellActorData->cellActor, angle); } -void sub_0200D7CC(CellActor *param0, int param1) +void thunk_CellActor_SetFlipMode(CellActor *cellActor, int mode) { - CellActor_SetFlipMode(param0, param1); + CellActor_SetFlipMode(cellActor, mode); } -void sub_0200D7D4(CellActorData *param0, int param1) +void CellActorData_SetFlipMode(CellActorData *cellActorData, int mode) { - sub_0200D7CC(param0->cellActor, param1); + thunk_CellActor_SetFlipMode(cellActorData->cellActor, mode); } -void sub_0200D7E0(CellActorData *param0, s16 param1, s16 param2) +void CellActorData_SetAffineTranslationXY(CellActorData *cellActorData, s16 x, s16 y) { - VecFx32 v0; + VecFx32 translation; - v0.x = param1 << FX32_SHIFT; - v0.y = param2 << FX32_SHIFT; - v0.z = 0; + translation.x = x << FX32_SHIFT; + translation.y = y << FX32_SHIFT; + translation.z = 0; - CellActor_SetAffineTranslation(param0->cellActor, &v0); + CellActor_SetAffineTranslation(cellActorData->cellActor, &translation); } -void sub_0200D7FC(CellActorData *param0, BOOL param1) +void CellActorData_SetPixelated(CellActorData *cellActorData, BOOL pixelated) { - CellActor_SetPixelated(param0->cellActor, param1); + CellActor_SetPixelated(cellActorData->cellActor, pixelated); } -void sub_0200D808(CellActor *param0, GXOamMode param1) +void thunk_CellActor_SetExplicitOAMMode(CellActor *cellActor, GXOamMode mode) { - CellActor_SetExplicitOAMMode(param0, param1); + CellActor_SetExplicitOAMMode(cellActor, mode); } -void SpriteActor_SetOAMMode(CellActorData *param0, GXOamMode param1) +void CellActorData_SetExplicitOAMMode(CellActorData *cellActorData, GXOamMode mode) { - sub_0200D808(param0->cellActor, param1); + thunk_CellActor_SetExplicitOAMMode(cellActorData->cellActor, mode); } -u32 sub_0200D81C(CellActorData *param0) +u32 CellActorData_GetUserAttrForCurrentAnimFrame(CellActorData *cellActorData) { - return CellActor_GetUserAttrForCurrentAnimFrame(param0->cellActor); + return CellActor_GetUserAttrForCurrentAnimFrame(cellActorData->cellActor); } -BOOL sub_0200D828(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6) +BOOL sub_0200D828(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int vramType, int resourceID) { - SpriteResource *v0; + SpriteResource *resource; - if (SpriteResourceCollection_IsIDUnused(param1->spriteResourceCollectionList[0], param6) == 0) { - return 0; + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], resourceID) == FALSE) { + return FALSE; } - v0 = SpriteResourceCollection_AddTiles(param1->spriteResourceCollectionList[0], param2, param3, param4, param6, param5, param0->heapID); + resource = SpriteResourceCollection_AddTiles(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], narcIndex, memberIndex, compressed, resourceID, vramType, renderer->heapID); - if (v0 != NULL) { - sub_0200A39C(v0); - SpriteResourceList_Add(param1->spriteResourceList[0], v0); + if (resource != NULL) { + sub_0200A39C(resource); + SpriteResourceList_Add(gfxHandler->spriteResourceList[SPRITE_RESOURCE_TILES], resource); - return 1; + return TRUE; } GF_ASSERT(0); - return (v0 == NULL) ? 0 : 1; + return (resource == NULL) ? FALSE : TRUE; } -BOOL sub_0200D888(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5, int param6) +BOOL sub_0200D888(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int vramType, int resourceID) { - SpriteResource *v0; + SpriteResource *resource; - if (SpriteResourceCollection_IsIDUnused(param1->spriteResourceCollectionList[0], param6) == 0) { - return 0; + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], resourceID) == FALSE) { + return FALSE; } - v0 = SpriteResourceCollection_AddTiles(param1->spriteResourceCollectionList[0], param2, param3, param4, param6, param5, param0->heapID); + resource = SpriteResourceCollection_AddTiles(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], narcIndex, memberIndex, compressed, resourceID, vramType, renderer->heapID); - if (v0 != NULL) { - sub_0200A450(v0); - SpriteResourceList_Add(param1->spriteResourceList[0], v0); + if (resource != NULL) { + sub_0200A450(resource); + SpriteResourceList_Add(gfxHandler->spriteResourceList[SPRITE_RESOURCE_TILES], resource); - return 1; + return TRUE; } GF_ASSERT(0); - return (v0 == NULL) ? 0 : 1; + return (resource == NULL) ? FALSE : TRUE; } -BOOL sub_0200D8E8(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5, int param6) +BOOL sub_0200D8E8(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int vramType, int resourceID) { - SpriteResource *v0; + SpriteResource *resource; - if (SpriteResourceCollection_IsIDUnused(param1->spriteResourceCollectionList[0], param6) == 0) { - return 0; + if (SpriteResourceCollection_IsIDUnused(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], resourceID) == FALSE) { + return FALSE; } - v0 = SpriteResourceCollection_AddTilesFrom(param1->spriteResourceCollectionList[0], param2, param3, param4, param6, param5, param0->heapID); + resource = SpriteResourceCollection_AddTilesFrom(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], narc, memberIndex, compressed, resourceID, vramType, renderer->heapID); - if (v0 != NULL) { - sub_0200A450(v0); - SpriteResourceList_Add(param1->spriteResourceList[0], v0); + if (resource != NULL) { + sub_0200A450(resource); + SpriteResourceList_Add(gfxHandler->spriteResourceList[SPRITE_RESOURCE_TILES], resource); - return 1; + return TRUE; } GF_ASSERT(0); - return (v0 == NULL) ? 0 : 1; + return (resource == NULL) ? FALSE : TRUE; } -void sub_0200D948(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5) +void SpriteRenderer_ModifyTiles(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID) { - SpriteResource *v0; + SpriteResource *resource; - v0 = SpriteResourceCollection_Find(param1->spriteResourceCollectionList[0], param5); + resource = SpriteResourceCollection_Find(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], resourceID); - SpriteResourceCollection_ModifyTiles(param1->spriteResourceCollectionList[0], v0, param2, param3, param4, param0->heapID); - sub_0200A4C0(v0); + SpriteResourceCollection_ModifyTiles(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], resource, narcIndex, memberIndex, compressed, renderer->heapID); + sub_0200A4C0(resource); } -void sub_0200D97C(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, int param3, BOOL param4, int param5) +void SpriteRenderer_ModifyPalette(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int resourceID) { - SpriteResource *v0; + SpriteResource *resource; - v0 = SpriteResourceCollection_Find(param1->spriteResourceCollectionList[1], param5); + resource = SpriteResourceCollection_Find(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], resourceID); - SpriteResourceCollection_ModifyPalette(param1->spriteResourceCollectionList[1], v0, param2, param3, param4, param0->heapID); - sub_0200A6B8(v0); + SpriteResourceCollection_ModifyPalette(gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_PALETTE], resource, narcIndex, memberIndex, compressed, renderer->heapID); + sub_0200A6B8(resource); } -CellActorCollection *sub_0200D9B0(SpriteGfxHandler *param0) +CellActorCollection *SpriteGfxHandler_GetCellActorCollection(SpriteGfxHandler *gfxHandler) { - return param0->cellActorList; + return gfxHandler->cellActorCollection; } -void sub_0200D9B4(SpriteRenderer *param0, SpriteGfxHandler *param1, NARC *param2, int param3, BOOL param4, int param5) +void SpriteRenderer_ModifyTilesFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int memberIndex, BOOL compressed, int resourceID) { - SpriteResource *v0; + SpriteResource *resource; - v0 = SpriteResourceCollection_Find(param1->spriteResourceCollectionList[0], param5); + resource = SpriteResourceCollection_Find(gfxHandler->spriteResourceCollectionList[0], resourceID); - SpriteResourceCollection_ModifyTilesFrom(param1->spriteResourceCollectionList[0], v0, param2, param3, param4, param0->heapID); - sub_0200A4C0(v0); + SpriteResourceCollection_ModifyTilesFrom(gfxHandler->spriteResourceCollectionList[0], resource, narc, memberIndex, compressed, renderer->heapID); + sub_0200A4C0(resource); } diff --git a/src/unk_0207E0B8.c b/src/unk_0207E0B8.c index 4325946d8d..bfa9412c83 100644 --- a/src/unk_0207E0B8.c +++ b/src/unk_0207E0B8.c @@ -1011,7 +1011,7 @@ static void sub_0207EE14(GameWindowLayout *param0) { s16 v1, v2; - sub_0200D50C(param0->unk_5B0[9], &v1, &v2); + CellActor_GetPositionXY(param0->unk_5B0[9], &v1, &v2); CellActor_SetPositionXY(param0->unk_5B0[9], v1, v2 - 8); } diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index 9485c2a06e..26a428c1a8 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -87,7 +87,7 @@ void sub_02082CEC(GameWindowLayout *param0, u8 param1, u16 param2, u16 param3, N param0->unk_704[param1].unk_16 = param2; param0->unk_704[param1].unk_18 = param3; - sub_0200D9B4(param0->unk_5A8, param0->unk_5AC, param4, Pokemon_IconSpriteIndex(v0), 0, 4 + param1); + SpriteRenderer_ModifyTilesFromOpenNarc(param0->unk_5A8, param0->unk_5AC, param4, Pokemon_IconSpriteIndex(v0), 0, 4 + param1); v2 = Pokemon_GetValue(v0, MON_DATA_IS_EGG, NULL); diff --git a/src/unk_02083370.c b/src/unk_02083370.c index 0cb0198048..5a9851c27b 100644 --- a/src/unk_02083370.c +++ b/src/unk_02083370.c @@ -440,7 +440,7 @@ static void sub_02083AD0(GameWindowLayout *param0, int *param1) param0->unk_B0F_0 = param0->unk_B11; thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); - sub_0200D50C(param0->unk_5B0[6], &v0, &v1); + CellActor_GetPositionXY(param0->unk_5B0[6], &v0, &v1); CellActor_SetPositionXY(param0->unk_5B0[7], v0, v1); CellActor_SetAnim(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); CellActor_SetDrawFlag(param0->unk_5B0[7], 1); @@ -599,7 +599,7 @@ static void sub_02083FDC(GameWindowLayout *param0, u8 param1, u8 param2) v0 = ¶m0->unk_7F8; - sub_0200D50C(param0->unk_5B0[0 + v0->unk_300[param1]], &v1, &v2); + CellActor_GetPositionXY(param0->unk_5B0[0 + v0->unk_300[param1]], &v1, &v2); if (param2 == 0) { param0->unk_704[v0->unk_300[param1]].unk_16 -= 8; @@ -1019,7 +1019,7 @@ static int sub_02084A18(GameWindowLayout *param0) param0->unk_B0F_0 = param0->unk_B11; thunk_CellActor_SetExplicitPalette(param0->unk_5B0[6], 0); - sub_0200D50C(param0->unk_5B0[6], &v0, &v1); + CellActor_GetPositionXY(param0->unk_5B0[6], &v0, &v1); CellActor_SetPositionXY(param0->unk_5B0[7], v0, v1); CellActor_SetAnim(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); CellActor_SetDrawFlag(param0->unk_5B0[7], 1); diff --git a/src/unk_02089604.c b/src/unk_02089604.c index f2daf67f09..9e87456fb6 100644 --- a/src/unk_02089604.c +++ b/src/unk_02089604.c @@ -189,16 +189,16 @@ BOOL sub_02089974(UnkStruct_02089688 *param0) continue; } - sub_0200D5DC(param0->unk_00[v0].unk_0C, param0->unk_00[v0].unk_14.unk_00, param0->unk_00[v0].unk_14.unk_02); + CellActorData_AddPositionXY(param0->unk_00[v0].unk_0C, param0->unk_00[v0].unk_14.unk_00, param0->unk_00[v0].unk_14.unk_02); param0->unk_00[v0].unk_14.unk_04--; if ((v0 >= param0->unk_2B0) && (v0 < param0->unk_2B4)) { - sub_0200D6E8(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; } if ((v0 >= param0->unk_2B8) && (v0 < param0->unk_2BC)) { - sub_0200D6E8(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; } } @@ -208,7 +208,7 @@ BOOL sub_02089974(UnkStruct_02089688 *param0) continue; } - sub_0200D5DC(param0->unk_1A0[v0].unk_0C, param0->unk_1A0[v0].unk_14.unk_00, param0->unk_1A0[v0].unk_14.unk_02); + CellActorData_AddPositionXY(param0->unk_1A0[v0].unk_0C, param0->unk_1A0[v0].unk_14.unk_00, param0->unk_1A0[v0].unk_14.unk_02); param0->unk_1A0[v0].unk_14.unk_04--; } @@ -235,7 +235,7 @@ BOOL sub_02089974(UnkStruct_02089688 *param0) continue; } - sub_0200D6E8(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v1[param0->unk_00[v0].unk_14.unk_05], v1[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; } @@ -244,7 +244,7 @@ BOOL sub_02089974(UnkStruct_02089688 *param0) continue; } - sub_0200D6E8(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); + CellActorData_SetAffineScaleXYFx32(param0->unk_00[v0].unk_0C, v2[param0->unk_00[v0].unk_14.unk_05], v2[param0->unk_00[v0].unk_14.unk_05]); param0->unk_00[v0].unk_14.unk_05++; } diff --git a/src/unk_0208A3F4.c b/src/unk_0208A3F4.c index afe35c2d5a..a1085dcb79 100644 --- a/src/unk_0208A3F4.c +++ b/src/unk_0208A3F4.c @@ -272,7 +272,7 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) bl CellActorData_SetAnim ldr r0, [r5, #0xc] mov r1, #2 - bl sub_0200D6A4 + bl CellActorData_SetAffineOverwriteMode ldr r0, [r5, #0xc] bl CellActorData_UpdateObject add r5, #0x1c @@ -337,7 +337,7 @@ void sub_0208A8A0 (UnkStruct_02089688 * param0) sub_0208AB2C(param0, 0); CellActorData_SetAnim(param0->unk_1F0[1].unk_0C, param0->unk_1F0[1].unk_00); CellActorData_UpdateObject(param0->unk_1F0[1].unk_0C); - SpriteActor_SetOAMMode(param0->unk_1F0[1].unk_0C, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_1F0[1].unk_0C, GX_OAM_MODE_XLU); param0->unk_1F0[2].unk_14.unk_00 = 0; param0->unk_1F0[2].unk_14.unk_02 = 0; @@ -346,7 +346,7 @@ void sub_0208A8A0 (UnkStruct_02089688 * param0) sub_0208AB2C(param0, 0); CellActorData_SetAnim(param0->unk_1F0[2].unk_0C, param0->unk_1F0[2].unk_00); CellActorData_UpdateObject(param0->unk_1F0[2].unk_0C); - SpriteActor_SetOAMMode(param0->unk_1F0[2].unk_0C, GX_OAM_MODE_XLU); + CellActorData_SetExplicitOAMMode(param0->unk_1F0[2].unk_0C, GX_OAM_MODE_XLU); sub_0208AAB4(param0, 1, 0); sub_0208AAB4(param0, 2, 0); } @@ -422,7 +422,7 @@ void sub_0208AAE4 (UnkStruct_02089688 * param0, int param1) v2 = param0->unk_00[param1].unk_0C; param0->unk_1F0[0].unk_00 = param1; - SpriteActor_GetSpritePositionXY(v2, &v0, &v1); + CellActorData_GetPositionXY(v2, &v0, &v1); CellActorData_SetPositionXY(param0->unk_1F0[0].unk_0C, v0, v1 + 16); } @@ -595,7 +595,7 @@ void sub_0208ADE4 (UnkStruct_02089688 * param0, int param1) } } - SpriteActor_GetSpritePositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); + CellActorData_GetPositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); if (param1 == 0) { CellActorData_SetPositionXY(param0->unk_00[v0].unk_0C, v2, v4); @@ -607,7 +607,7 @@ void sub_0208ADE4 (UnkStruct_02089688 * param0, int param1) } if ((v0 == param0->unk_1A0[v1].unk_00) && (v1 != param0->unk_3C0)) { - SpriteActor_GetSpritePositionXY(param0->unk_1A0[v1].unk_0C, &v3, &v4); + CellActorData_GetPositionXY(param0->unk_1A0[v1].unk_0C, &v3, &v4); if (param0->unk_2B0 == param0->unk_2B4) { v2 += 8; @@ -639,7 +639,7 @@ static inline void inline_0208AF44 (UnkStruct_02089688 * param0, int param1, s16 v2 = ¶m0->unk_00[param1]; - SpriteActor_GetSpritePositionXY(v2->unk_0C, &v0, &v1); + CellActorData_GetPositionXY(v2->unk_0C, &v0, &v1); v2->unk_10->rect.top = v1 - param3; v2->unk_10->rect.left = v0 - param2; @@ -725,7 +725,7 @@ void sub_0208B090 (UnkStruct_02089688 * param0, int param1, int param2, int para v2.unk_00 = param0->unk_2C0.unk_8C; v2.unk_04 = &v7; - v2.unk_08 = sub_0200D9B0(param0->unk_2C0.unk_08); + v2.unk_08 = SpriteGfxHandler_GetCellActorCollection(param0->unk_2C0.unk_08); v2.unk_0C = SpriteGfxHandler_GetPaletteProxy(param0->unk_2C0.unk_08, v4); v2.unk_10 = NULL; v2.unk_14 = param0->unk_2C0.unk_98[param1].unk_04; diff --git a/src/unk_0208B284.c b/src/unk_0208B284.c index 848a570a54..e52f8ed4f0 100644 --- a/src/unk_0208B284.c +++ b/src/unk_0208B284.c @@ -127,7 +127,7 @@ static void sub_0208B3D4(SysTask *param0, void *param1) v0->unk_24[v1].unk_06 = v0->unk_24[v1 - 1].unk_06; } - sub_0200D67C(v0->unk_24[v1].unk_00, &v5, &v6, v0->unk_10.unk_10); + CellActorData_GetPositionFx32WithOffset(v0->unk_24[v1].unk_00, &v5, &v6, v0->unk_10.unk_10); v3 = FX_FX32_TO_F32(v5); v4 = FX_FX32_TO_F32(v6); @@ -135,7 +135,7 @@ static void sub_0208B3D4(SysTask *param0, void *param1) v9 = sub_0208B2DC(v0->unk_24[v1].unk_04, v0->unk_24[v1].unk_06, v3, v4, &v7, &v8, (8.0f - ((v1 - v2) * 0.5f)) / 2, 16); if (v9 && (v0->unk_24[v1].unk_08 == 0)) { - sub_0200D5E8(v0->unk_24[v1].unk_00, FX_F32_TO_FX32(v7), FX_F32_TO_FX32(v8)); + CellActorData_AddPositionXYFx32(v0->unk_24[v1].unk_00, FX_F32_TO_FX32(v7), FX_F32_TO_FX32(v8)); } else { { int v10; @@ -145,7 +145,7 @@ static void sub_0208B3D4(SysTask *param0, void *param1) switch (v0->unk_24[v1].unk_08) { case 0: - sub_0200D5A0(v0->unk_24[v1].unk_00, &v12, &v13, v0->unk_10.unk_10); + CellActorData_GetPositionWithOffsetXY(v0->unk_24[v1].unk_00, &v12, &v13, v0->unk_10.unk_10); if (v0->unk_E8 == 0xFF) { v0->unk_E8 = v1; @@ -164,7 +164,7 @@ static void sub_0208B3D4(SysTask *param0, void *param1) v0->unk_24[v1].unk_0C %= 720; v14 = (v0->unk_24[0].unk_04 << FX32_SHIFT) + (sub_0201D250(v0->unk_24[v1].unk_0C) * v0->unk_FC); v15 = (v0->unk_24[0].unk_06 << FX32_SHIFT) + (sub_0201D264(v0->unk_24[v1].unk_0C) * v0->unk_100); - sub_0200D650(v0->unk_24[v1].unk_00, v14, v15, v0->unk_10.unk_10); + CellActorData_SetPositionWithOffsetFx32(v0->unk_24[v1].unk_00, v14, v15, v0->unk_10.unk_10); break; default: break; @@ -355,7 +355,7 @@ BOOL sub_0208B948(UnkStruct_0208B878 *param0, s16 param1, s16 param2) for (v0 = 0; v0 < param0->unk_10.unk_00; v0++) { param0->unk_24[v0].unk_04 = param1; param0->unk_24[v0].unk_06 = param2; - sub_0200D500(param0->unk_24[v0].unk_00, param1, param2, param0->unk_10.unk_10); + CellActorData_SetPositionWithOffsetXY(param0->unk_24[v0].unk_00, param1, param2, param0->unk_10.unk_10); } } From 476319cb65b50d6a9fbc8016fccf8ae3e6233b17 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Wed, 6 Nov 2024 10:24:00 -0600 Subject: [PATCH 08/11] document struct for cldat files --- include/sprite_resource.h | 11 ++ include/struct_defs/struct_02009508_1.h | 15 --- include/struct_defs/struct_0200D0F4.h | 4 +- include/unk_020093B4.h | 6 +- src/choose_starter/choose_starter_app.c | 2 +- src/overlay005/encounter_effect.c | 2 +- src/overlay005/ov5_021D2F14.c | 12 +- src/overlay005/ov5_021D5EB8.c | 2 +- src/overlay006/ov6_022426AC.c | 2 +- src/overlay006/ov6_02243258.c | 6 +- src/overlay007/ov7_0224BE9C.c | 2 +- src/overlay009/ov9_02249960.c | 2 +- src/overlay021/ov21_021D1FA4.c | 6 +- src/overlay021/ov21_021D5AEC.c | 4 +- src/overlay021/ov21_021D76B0.c | 2 +- src/overlay021/ov21_021D85B0.c | 2 +- src/overlay021/ov21_021D94BC.c | 6 +- src/overlay021/ov21_021DC9BC.c | 4 +- src/overlay021/ov21_021DDD2C.c | 2 +- src/overlay021/ov21_021DE668.c | 6 +- src/overlay021/ov21_021DF734.c | 2 +- src/overlay021/ov21_021E0C68.c | 2 +- src/overlay021/ov21_021E1924.c | 4 +- src/overlay021/ov21_021E29DC.c | 2 +- src/overlay021/ov21_021E3FFC.c | 2 +- src/overlay021/ov21_021E4CA4.c | 2 +- src/overlay021/ov21_021E6014.c | 2 +- src/overlay021/ov21_021E68F4.c | 2 +- src/overlay021/ov21_021E737C.c | 4 +- src/overlay021/ov21_021E8484.c | 2 +- src/overlay021/ov21_021E8D48.c | 2 +- src/overlay022/ov22_02255094.c | 2 +- src/overlay022/ov22_02259C58.c | 4 +- src/overlay022/ov22_0225A428.c | 2 +- src/overlay023/ov23_0223E140.c | 2 +- src/overlay023/ov23_0224340C.c | 10 +- src/overlay023/ov23_02248F1C.c | 2 +- src/overlay056/ov56_022561C0.c | 2 +- src/overlay058/ov58_021D0D80.c | 4 +- src/overlay059/ov59_021D0D80.c | 2 +- src/overlay063/ov63_0222AE60.c | 6 +- src/overlay064/ov64_0222DCE0.c | 2 +- src/overlay065/ov65_0222DCE0.c | 2 +- src/overlay065/ov65_02235060.c | 2 +- src/overlay068/ov68_0225C700.c | 2 +- src/overlay069/ov69_0225C700.c | 2 +- src/overlay070/ov70_0225D9A4.c | 8 +- src/overlay071/ov71_0223CF0C.c | 2 +- src/overlay072/ov72_0223D7A0.c | 4 +- src/overlay077/ov77_021D54B0.c | 2 +- src/overlay077/ov77_021D6670.c | 2 +- src/overlay083/ov83_0223D6A8.c | 4 +- src/overlay088/ov88_0223B140.c | 4 +- src/overlay094/ov94_0223BCB0.c | 4 +- src/overlay096/ov96_0223B6A0.c | 2 +- src/overlay097/ov97_0222D30C.c | 4 +- src/overlay097/ov97_02233B18.c | 2 +- src/overlay097/ov97_02237694.c | 2 +- src/overlay101/ov101_021D7E48.c | 2 +- src/overlay105/ov105_02245AAC.c | 2 +- src/overlay106/ov106_02243310.c | 2 +- src/overlay107/ov107_02249604.c | 2 +- src/overlay108/ov108_02243030.c | 2 +- src/overlay109/ov109_021D3D50.c | 2 +- src/overlay111/ov111_021D2F80.c | 2 +- src/overlay114/ov114_0225C700.c | 2 +- src/overlay115/ov115_02260CEC.c | 8 +- src/sprite_renderer.c | 26 ++-- src/unk_020093B4.c | 151 +++++++++++++----------- src/unk_0205CA94.c | 2 +- src/unk_0208694C.c | 4 +- src/unk_02098FFC.c | 10 +- 72 files changed, 214 insertions(+), 213 deletions(-) delete mode 100644 include/struct_defs/struct_02009508_1.h diff --git a/include/sprite_resource.h b/include/sprite_resource.h index b219760ce3..d85bec2769 100644 --- a/include/sprite_resource.h +++ b/include/sprite_resource.h @@ -48,6 +48,17 @@ typedef struct SpriteResourceTableEntryNARC { int paletteCount; } SpriteResourceTableEntryNARC; +typedef struct SpriteTemplateTableEntry { + int tileIndex; + int paletteIndex; + int cellsIndex; + int animIndex; + int multiCellsIndex; + int multiAnimIndex; + BOOL vramTransfer; + int priority; +} SpriteTemplateTableEntry; + typedef struct SpriteResourceTable { void *entries; int count; diff --git a/include/struct_defs/struct_02009508_1.h b/include/struct_defs/struct_02009508_1.h deleted file mode 100644 index 5895c898e1..0000000000 --- a/include/struct_defs/struct_02009508_1.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02009508_1_H -#define POKEPLATINUM_STRUCT_02009508_1_H - -typedef struct { - u32 unk_00; - u32 unk_04; - u32 unk_08; - u32 unk_0C; - u32 unk_10; - u32 unk_14; - u32 unk_18; - u32 unk_1C; -} UnkStruct_02009508_1; - -#endif // POKEPLATINUM_STRUCT_02009508_1_H diff --git a/include/struct_defs/struct_0200D0F4.h b/include/struct_defs/struct_0200D0F4.h index b063500eab..49d7005c46 100644 --- a/include/struct_defs/struct_0200D0F4.h +++ b/include/struct_defs/struct_0200D0F4.h @@ -6,8 +6,8 @@ typedef struct CellActorData { CellActor *cellActor; - CellActorResourceData *cellActorResource; - CellActorResourceDataList *cellActorResourceList; + CellActorResourceData *resourceListHead; + CellActorResourceDataList *resourceList; BOOL vramTransfer; } CellActorData; diff --git a/include/unk_020093B4.h b/include/unk_020093B4.h index 81d4b0e010..335f744666 100644 --- a/include/unk_020093B4.h +++ b/include/unk_020093B4.h @@ -3,15 +3,13 @@ #include -#include "struct_defs/struct_02009508_1.h" - #include "cell_actor.h" #include "sprite_renderer.h" #include "sprite_resource.h" -void sub_020093B4(CellActorResourceData *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, SpriteResourceCollection *param9, SpriteResourceCollection *param10, SpriteResourceCollection *param11, SpriteResourceCollection *param12, SpriteResourceCollection *param13, SpriteResourceCollection *param14); +void CellActorResourceData_Init(CellActorResourceData *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, SpriteResourceCollection *param9, SpriteResourceCollection *param10, SpriteResourceCollection *param11, SpriteResourceCollection *param12, SpriteResourceCollection *param13, SpriteResourceCollection *param14); void sub_020094F0(CellActorResourceData *param0); -CellActorResourceDataList *sub_02009508(const UnkStruct_02009508_1 *param0, int param1, SpriteResourceCollection *param2, SpriteResourceCollection *param3, SpriteResourceCollection *param4, SpriteResourceCollection *param5, SpriteResourceCollection *param6, SpriteResourceCollection *param7); +CellActorResourceDataList *CellActorResourceDataList_FromTemplate(const SpriteTemplateTableEntry *param0, int param1, SpriteResourceCollection *param2, SpriteResourceCollection *param3, SpriteResourceCollection *param4, SpriteResourceCollection *param5, SpriteResourceCollection *param6, SpriteResourceCollection *param7); void sub_020095A8(CellActorResourceDataList *param0); CellActorCollection *sub_020095C4(int param0, GF_G2dRenderer *param1, int param2); void sub_0200962C(GF_G2dRenderer *param0, fx32 param1, fx32 param2); diff --git a/src/choose_starter/choose_starter_app.c b/src/choose_starter/choose_starter_app.c index 360a1002e5..8a9dce105c 100644 --- a/src/choose_starter/choose_starter_app.c +++ b/src/choose_starter/choose_starter_app.c @@ -1455,7 +1455,7 @@ static void AttachCursorCellActor(ChooseStarterApp *param0, ChooseStarterCursor CellActorResourceData v0; CellActorInitParams v1; - sub_020093B4(&v0, 10, 11, 12, 13, 0xffffffff, 0xffffffff, 0, 1, param0->unk_24C[0], param0->unk_24C[1], param0->unk_24C[2], param0->unk_24C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 10, 11, 12, 13, 0xffffffff, 0xffffffff, 0, 1, param0->unk_24C[0], param0->unk_24C[1], param0->unk_24C[2], param0->unk_24C[3], NULL, NULL); v1.collection = param0->unk_248; v1.resourceData = &v0; diff --git a/src/overlay005/encounter_effect.c b/src/overlay005/encounter_effect.c index d4073e8d94..2359cb9d22 100644 --- a/src/overlay005/encounter_effect.c +++ b/src/overlay005/encounter_effect.c @@ -757,7 +757,7 @@ void ov5_021DE4CC(NARC *param0, UnkStruct_ov5_021DE47C *param1, UnkStruct_ov5_02 sub_0200A3DC(param2->unk_00[0]); SpriteResource_ReleaseData(param2->unk_00[0]); sub_0200A640(param2->unk_00[1]); - sub_020093B4(¶m2->unk_10, param8, param8, param8, param8, 0xffffffff, 0xffffffff, 0, 0, param1->unk_190[0], param1->unk_190[1], param1->unk_190[2], param1->unk_190[3], NULL, NULL); + CellActorResourceData_Init(¶m2->unk_10, param8, param8, param8, param8, 0xffffffff, 0xffffffff, 0, 0, param1->unk_190[0], param1->unk_190[1], param1->unk_190[2], param1->unk_190[3], NULL, NULL); } void ov5_021DE5A4(UnkStruct_ov5_021DE47C *param0, UnkStruct_ov5_021DE5A4 *param1) diff --git a/src/overlay005/ov5_021D2F14.c b/src/overlay005/ov5_021D2F14.c index 5f5b94d098..d8021f045d 100644 --- a/src/overlay005/ov5_021D2F14.c +++ b/src/overlay005/ov5_021D2F14.c @@ -73,7 +73,7 @@ void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const SpriteResourceDataPath * sub_0200A684(param0->unk_1AC[1]); v2 = ReadFileToHeap(param3, param1->paths.combinedResourceDataPath); - param0->unk_190 = sub_02009508(v2, param3, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); + param0->unk_190 = CellActorResourceDataList_FromTemplate(v2, param3, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); Heap_FreeToHeap(v2); } @@ -338,9 +338,9 @@ CellActorData *ov5_021D3584(UnkStruct_ov5_021D30A8 *param0, const SpriteTemplate v2 = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorData)); - v2->cellActorResourceList = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorResourceDataList)); - v2->cellActorResourceList->resourceDataList = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorResourceData)); - v2->cellActorResource = v2->cellActorResourceList->resourceDataList; + v2->resourceList = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorResourceDataList)); + v2->resourceList->resourceDataList = Heap_AllocFromHeap(param0->unk_1C6, sizeof(CellActorResourceData)); + v2->resourceListHead = v2->resourceList->resourceDataList; for (v0 = 0; v0 < 6; v0++) { v4[v0] = param1->resources[v0]; @@ -359,10 +359,10 @@ CellActorData *ov5_021D3584(UnkStruct_ov5_021D30A8 *param0, const SpriteTemplate } } - sub_020093B4(v2->cellActorResource, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param1->transferToVRAM, param1->bgPriority, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); + CellActorResourceData_Init(v2->resourceListHead, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param1->transferToVRAM, param1->bgPriority, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); v3.collection = param0->unk_00; - v3.resourceData = v2->cellActorResource; + v3.resourceData = v2->resourceListHead; v3.position.x = FX32_CONST(param1->x); v3.position.y = FX32_CONST(param1->y); v3.position.z = FX32_CONST(param1->z); diff --git a/src/overlay005/ov5_021D5EB8.c b/src/overlay005/ov5_021D5EB8.c index 3ead07b203..b41819c67c 100644 --- a/src/overlay005/ov5_021D5EB8.c +++ b/src/overlay005/ov5_021D5EB8.c @@ -1593,7 +1593,7 @@ static void ov5_021D6F4C(CellActorResourceData *param0, UnkStruct_ov5_021D6594 * v0[v1] = SpriteResource_GetID(param2->unk_00[v1]); } - sub_020093B4(param0, v0[0], v0[1], v0[2], v0[3], 0xffffffff, 0xffffffff, param3, param4, param1->unk_08.unk_00[0], param1->unk_08.unk_00[1], param1->unk_08.unk_00[2], param1->unk_08.unk_00[3], NULL, NULL); + CellActorResourceData_Init(param0, v0[0], v0[1], v0[2], v0[3], 0xffffffff, 0xffffffff, param3, param4, param1->unk_08.unk_00[0], param1->unk_08.unk_00[1], param1->unk_08.unk_00[2], param1->unk_08.unk_00[3], NULL, NULL); } static void ov5_021D6FA8(UnkStruct_ov5_021D6FA8 *param0) diff --git a/src/overlay006/ov6_022426AC.c b/src/overlay006/ov6_022426AC.c index 9d51058563..94a230ccd0 100644 --- a/src/overlay006/ov6_022426AC.c +++ b/src/overlay006/ov6_022426AC.c @@ -193,7 +193,7 @@ static void ov6_022428F8(UnkStruct_ov6_022426B8 *param0) int v0; CellActorResourceData v1; - sub_020093B4(&v1, 0, 1, 2, 3, 0xffffffff, 0xffffffff, 0, 0, param0->unk_00[0], param0->unk_00[1], param0->unk_00[2], param0->unk_00[3], NULL, NULL); + CellActorResourceData_Init(&v1, 0, 1, 2, 3, 0xffffffff, 0xffffffff, 0, 0, param0->unk_00[0], param0->unk_00[1], param0->unk_00[2], param0->unk_00[3], NULL, NULL); { CellActorInitParamsEx v2; diff --git a/src/overlay006/ov6_02243258.c b/src/overlay006/ov6_02243258.c index cdcf4ea0e8..d0af99feed 100644 --- a/src/overlay006/ov6_02243258.c +++ b/src/overlay006/ov6_02243258.c @@ -540,7 +540,7 @@ static CellActor *ov6_02243740(UnkStruct_ov6_02243258 *param0, const VecFx32 *pa param5 = 0xffffffff; } - sub_020093B4( + CellActorResourceData_Init( &v0, param2, param3, param4, param5, 0xffffffff, 0xffffffff, 0, param6, param0->unk_198, param0->unk_19C, param0->unk_1A0, param0->unk_1A4, NULL, NULL); v1.collection = param0->unk_08; @@ -1842,10 +1842,10 @@ static CellActor *ov6_02244C20(UnkStruct_ov6_02243FFC *param0, const VecFx32 *pa CellActor *v2; if (param5 == 4) { - sub_020093B4( + CellActorResourceData_Init( &v0, param2, param3, param4, 0xffffffff, 0xffffffff, 0xffffffff, 0, param6, param0->unk_200, param0->unk_204, param0->unk_208, NULL, NULL, NULL); } else { - sub_020093B4( + CellActorResourceData_Init( &v0, param2, param3, param4, param5, 0xffffffff, 0xffffffff, 0, param6, param0->unk_200, param0->unk_204, param0->unk_208, param0->unk_20C, NULL, NULL); } diff --git a/src/overlay007/ov7_0224BE9C.c b/src/overlay007/ov7_0224BE9C.c index 89c9ab12df..3bea0ac4e4 100644 --- a/src/overlay007/ov7_0224BE9C.c +++ b/src/overlay007/ov7_0224BE9C.c @@ -724,7 +724,7 @@ static void ov7_0224CA54(CellActorResourceData *param0, UnkStruct_ov7_0224C768 * NARC_dtor(v0); sub_0200A3DC(param1->unk_148[0]); sub_0200A640(param1->unk_148[1]); - sub_020093B4(param0, 5000, 5000, 5000, 5000, 0xffffffff, 0xffffffff, 0, 0, param1->unk_138[0], param1->unk_138[1], param1->unk_138[2], param1->unk_138[3], NULL, NULL); + CellActorResourceData_Init(param0, 5000, 5000, 5000, 5000, 0xffffffff, 0xffffffff, 0, 0, param1->unk_138[0], param1->unk_138[1], param1->unk_138[2], param1->unk_138[3], NULL, NULL); } static void ov7_0224CB40(UnkStruct_ov7_0224C768 *param0) diff --git a/src/overlay009/ov9_02249960.c b/src/overlay009/ov9_02249960.c index c373f1c5f3..30e297aeac 100644 --- a/src/overlay009/ov9_02249960.c +++ b/src/overlay009/ov9_02249960.c @@ -2745,7 +2745,7 @@ static CellActor *ov9_0224B130(UnkStruct_ov9_0224B064 *param0, const VecFx32 *pa CellActorInitParams v1; CellActor *v2; - sub_020093B4(&v0, ((param2) + 0xff), ((param3) + 0xff), ((param4) + 0xff), ((param5) + 0xff), 0xffffffff, 0xffffffff, 0, param6, param0->unk_190, param0->unk_194, param0->unk_198, param0->unk_19C, NULL, NULL); + CellActorResourceData_Init(&v0, ((param2) + 0xff), ((param3) + 0xff), ((param4) + 0xff), ((param5) + 0xff), 0xffffffff, 0xffffffff, 0, param6, param0->unk_190, param0->unk_194, param0->unk_198, param0->unk_19C, NULL, NULL); v1.collection = param0->unk_00; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021D1FA4.c b/src/overlay021/ov21_021D1FA4.c index a2868ab558..44c9b8d428 100644 --- a/src/overlay021/ov21_021D1FA4.c +++ b/src/overlay021/ov21_021D1FA4.c @@ -853,7 +853,7 @@ static void ov21_021D2C8C(UnkStruct_ov21_021D13FC *param0, int param1) CellActorResourceData v0; CellActorInitParams v1; - sub_020093B4(&v0, 3000, 3000, 3000, 3000, 0xffffffff, 0xffffffff, 0, 0, param0->unk_13C[0], param0->unk_13C[1], param0->unk_13C[2], param0->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 3000, 3000, 3000, 3000, 0xffffffff, 0xffffffff, 0, 0, param0->unk_13C[0], param0->unk_13C[1], param0->unk_13C[2], param0->unk_13C[3], NULL, NULL); v1.collection = param0->unk_138; v1.resourceData = &v0; @@ -900,7 +900,7 @@ void ov21_021D2D88(UnkStruct_ov21_021D22F8 *param0, CellActorCollection *param1, CellActorResourceData v0; CellActorInitParams v1; - sub_020093B4(&v0, 3000, 3000, 3000, 3000, 0xffffffff, 0xffffffff, 0, param4, param2[0], param2[1], param2[2], param2[3], NULL, NULL); + CellActorResourceData_Init(&v0, 3000, 3000, 3000, 3000, 0xffffffff, 0xffffffff, 0, param4, param2[0], param2[1], param2[2], param2[3], NULL, NULL); v1.collection = param1; v1.resourceData = &v0; @@ -996,7 +996,7 @@ static void ov21_021D2F5C(UnkStruct_ov21_021D13FC *param0, int param1) int v2; UnkStruct_ov21_021D2584 *v3 = ¶m0->unk_1E0; - sub_020093B4(&v0, 12000, 12000, 12000, 12000, 0xffffffff, 0xffffffff, 0, 0, param0->unk_13C[0], param0->unk_13C[1], param0->unk_13C[2], param0->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 12000, 12000, 12000, 12000, 0xffffffff, 0xffffffff, 0, 0, param0->unk_13C[0], param0->unk_13C[1], param0->unk_13C[2], param0->unk_13C[3], NULL, NULL); v1.collection = param0->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index ff34115289..490224b5ef 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -811,7 +811,7 @@ static void ov21_021D65DC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 SpriteResource_ReleaseData(v0); SpriteResourceCollection_AddFrom(param0->unk_80[2], v1, 79, 1, 79, 2, param2); SpriteResourceCollection_AddFrom(param0->unk_80[3], v1, 80, 1, 80, 3, param2); - sub_020093B4(¶m0->unk_90, 81, 3, 79, 80, 0xffffffff, 0xffffffff, 0, 2, param0->unk_80[0], param0->unk_80[1], param0->unk_80[2], param0->unk_80[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_90, 81, 3, 79, 80, 0xffffffff, 0xffffffff, 0, 2, param0->unk_80[0], param0->unk_80[1], param0->unk_80[2], param0->unk_80[3], NULL, NULL); v0 = SpriteResourceCollection_AddTilesFrom(param0->unk_80[0], v1, 111, 1, 111, NNS_G2D_VRAM_TYPE_2DMAIN, param2); @@ -819,7 +819,7 @@ static void ov21_021D65DC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 SpriteResource_ReleaseData(v0); SpriteResourceCollection_AddFrom(param0->unk_80[2], v1, 109, 1, 109, 2, param2); SpriteResourceCollection_AddFrom(param0->unk_80[3], v1, 110, 1, 110, 3, param2); - sub_020093B4(¶m0->unk_B4, 111, 3, 109, 110, 0xffffffff, 0xffffffff, 0, 2, param0->unk_80[0], param0->unk_80[1], param0->unk_80[2], param0->unk_80[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_B4, 111, 3, 109, 110, 0xffffffff, 0xffffffff, 0, 2, param0->unk_80[0], param0->unk_80[1], param0->unk_80[2], param0->unk_80[3], NULL, NULL); } static void ov21_021D6744(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, int param2) diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index 5802b6b2b0..9efa917d9b 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -592,7 +592,7 @@ static void ov21_021D7E80(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77 CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - sub_020093B4(&v0, 84 + 1000, 3 + 1000, 82 + 1000, 83 + 1000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 84 + 1000, 3 + 1000, 82 + 1000, 83 + 1000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 0c35798ae2..12ef821bf7 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -644,7 +644,7 @@ static void ov21_021D8D0C(UnkStruct_ov21_021D9320 *param0, UnkStruct_ov21_021D87 CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - sub_020093B4(&v0, 81 + 15000, 3 + 15000, 79 + 15000, 80 + 15000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 81 + 15000, 3 + 15000, 79 + 15000, 80 + 15000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index 5556eadd9b..098acd1652 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -2348,7 +2348,7 @@ static void ov21_021DB708(UnkStruct_ov21_021DC96C *param0, UnkStruct_ov21_021D95 UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3; - sub_020093B4(&v0, 125 + 16000, 3 + 16000, 126 + 16000, 124 + 16000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 125 + 16000, 3 + 16000, 126 + 16000, 124 + 16000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; @@ -2373,7 +2373,7 @@ static void ov21_021DB79C(UnkStruct_ov21_021DC96C *param0, UnkStruct_ov21_021D95 UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3; - sub_020093B4(&v0, 125 + 16000, 3 + 16000, 126 + 16000, 124 + 16000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 125 + 16000, 3 + 16000, 126 + 16000, 124 + 16000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; @@ -2598,7 +2598,7 @@ static void ov21_021DBBE4(UnkStruct_ov21_021DC96C *param0, UnkStruct_ov21_021D95 UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3, v4; - sub_020093B4(&v0, 128 + 16000, 3 + 16000, 129 + 16000, 127 + 16000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 128 + 16000, 3 + 16000, 129 + 16000, 127 + 16000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index c93744b9bb..67606a55eb 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -575,7 +575,7 @@ static void ov21_021DD1A8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3; - sub_020093B4(&v0, 93 + 6000, 14 + 6000, 91 + 6000, 92 + 6000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 93 + 6000, 14 + 6000, 91 + 6000, 92 + 6000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; @@ -588,7 +588,7 @@ static void ov21_021DD1A8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA param0->unk_C8 = CellActorCollection_Add(&v1); CellActor_SetAnim(param0->unk_C8, 2); - sub_020093B4(&v0, 108 + 6000, 14 + 6000, 106 + 6000, 107 + 6000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 108 + 6000, 14 + 6000, 106 + 6000, 107 + 6000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index c56859f08d..5b394837ad 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -432,7 +432,7 @@ static void ov21_021DE258(UnkStruct_ov21_021DDEC8 *param0, UnkStruct_ov21_021DDD CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - sub_020093B4(&v0, 105 + 6000, 11 + 2100, 103 + 6000, 104 + 6000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 105 + 6000, 11 + 2100, 103 + 6000, 104 + 6000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index 9a61250f3a..401f255ccc 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -541,7 +541,7 @@ static void ov21_021DEE80(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - sub_020093B4(&v0, 4000, 4000, 4000, 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 4000, 4000, 4000, 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; @@ -635,7 +635,7 @@ static void ov21_021DF098(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 v4 = ov21_021DF180(v4); v5 = ov21_021DF180(v5); - sub_020093B4(&v0, 90 + 4000, 13 + 4000, 88 + 4000, 89 + 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 90 + 4000, 13 + 4000, 88 + 4000, 89 + 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; @@ -742,7 +742,7 @@ static void ov21_021DF214(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; - sub_020093B4(&v0, 90 + 4000, 13 + 4000, 88 + 4000, 89 + 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 90 + 4000, 13 + 4000, 88 + 4000, 89 + 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index d28211d26b..41c44da693 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -555,7 +555,7 @@ static void ov21_021DFE0C(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF8 int v3, v4; int v5; - sub_020093B4(&v0, 122 + 14000, 22 + 14000, 123 + 14000, 121 + 14000, 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 122 + 14000, 22 + 14000, 123 + 14000, 121 + 14000, 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 3473d0635a..976d6c0192 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -524,7 +524,7 @@ static void ov21_021E136C(UnkStruct_ov21_021E14D4 *param0, UnkStruct_ov21_021E0D UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; - sub_020093B4(&v0, 90 + 4000, 13 + 4000, 88 + 4000, 89 + 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 90 + 4000, 13 + 4000, 88 + 4000, 89 + 4000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 72b6579539..2b33364682 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -705,7 +705,7 @@ static void ov21_021E22C8(UnkStruct_ov21_021E2588 *param0, UnkStruct_ov21_021E1A UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3; - sub_020093B4(&v0, 102 + 5000, 11 + 2100, 100 + 5000, 101 + 5000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 102 + 5000, 11 + 2100, 100 + 5000, 101 + 5000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; @@ -727,7 +727,7 @@ static void ov21_021E22C8(UnkStruct_ov21_021E2588 *param0, UnkStruct_ov21_021E1A param0->unk_00[1] = CellActorCollection_Add(&v1); CellActor_SetAnim(param0->unk_00[1], 0); - sub_020093B4(&v0, 99 + 5000, 11 + 2100, 97 + 5000, 98 + 5000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 99 + 5000, 11 + 2100, 97 + 5000, 98 + 5000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.resourceData = &v0; v1.position.y = 176 << FX32_SHIFT; diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 9e0b691590..8f6f0b5aac 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -1277,7 +1277,7 @@ static void ov21_021E3AF0(UnkStruct_ov21_021E3900 *param0, UnkStruct_ov21_021E34 UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3; - sub_020093B4(&v0, 96 + 2100, 11 + 2100, 94 + 2100, 95 + 2100, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 96 + 2100, 11 + 2100, 94 + 2100, 95 + 2100, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 0fc6d443e2..c6899a06b6 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -573,7 +573,7 @@ static void ov21_021E47CC(UnkStruct_ov21_021E4360 *param0, UnkStruct_ov21_021E41 UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3, v4; - sub_020093B4(&v0, 116 + 11000, 19 + 11000, 117 + 11000, 115 + 11000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 116 + 11000, 19 + 11000, 117 + 11000, 115 + 11000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 8862b3e4c9..e232c07526 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -843,7 +843,7 @@ static void ov21_021E5734(UnkStruct_ov21_021E5004 *param0, UnkStruct_ov21_021E4D int v3; int v4, v5; - sub_020093B4(&v0, 113 + 10000, 18 + 10000, 114 + 10000, 112 + 10000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 113 + 10000, 18 + 10000, 114 + 10000, 112 + 10000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index 6637ab30ef..a72b338fdf 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -410,7 +410,7 @@ static void ov21_021E6518(UnkStruct_ov21_021E6274 *param0, UnkStruct_ov21_021E61 short v5; int v6 = ov21_021D37BC(param2->unk_04); - sub_020093B4(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index 739a74be61..670c851d22 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -564,7 +564,7 @@ static void ov21_021E700C(UnkStruct_ov21_021E6C60 *param0, UnkStruct_ov21_021E6A UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3; - sub_020093B4(&v0, 102 + 9000, 11 + 2100, 100 + 9000, 101 + 9000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 102 + 9000, 11 + 2100, 100 + 9000, 101 + 9000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index 4cb51a0fe4..8d39702295 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -630,7 +630,7 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 int v6 = ov21_021D37BC(param2->unk_00); int v7 = ov21_021D33D4(param2->unk_00, v6); - sub_020093B4(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; @@ -668,7 +668,7 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 param0->unk_0C[1] = CellActorCollection_Add(&v1); CellActor_SetAnim(param0->unk_0C[1], 0); - sub_020093B4(&v0, SpriteResource_GetID(param0->unk_14[0]), SpriteResource_GetID(param0->unk_14[1]), SpriteResource_GetID(param0->unk_14[2]), SpriteResource_GetID(param0->unk_14[3]), 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, SpriteResource_GetID(param0->unk_14[0]), SpriteResource_GetID(param0->unk_14[1]), SpriteResource_GetID(param0->unk_14[2]), SpriteResource_GetID(param0->unk_14[3]), 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index da0ed3d7d6..02ce5677a3 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -536,7 +536,7 @@ static void ov21_021E8AA8(UnkStruct_ov21_021E8794 *param0, UnkStruct_ov21_021E85 UnkStruct_ov21_021D13FC *v2 = param1->unk_00; int v3; - sub_020093B4(&v0, 102 + 13000, 11 + 2100, 100 + 13000, 101 + 13000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); + CellActorResourceData_Init(&v0, 102 + 13000, 11 + 2100, 100 + 13000, 101 + 13000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; diff --git a/src/overlay021/ov21_021E8D48.c b/src/overlay021/ov21_021E8D48.c index c6eacf24eb..a2fda24fd2 100644 --- a/src/overlay021/ov21_021E8D48.c +++ b/src/overlay021/ov21_021E8D48.c @@ -477,7 +477,7 @@ static void ov21_021E93C4(SpriteResource **param0, SpriteResourceCollection **pa static void ov21_021E93F8(SpriteResource **param0, SpriteResourceCollection **param1, CellActorResourceData *param2, int param3) { - sub_020093B4(param2, SpriteResource_GetID(param0[0]), SpriteResource_GetID(param0[1]), SpriteResource_GetID(param0[2]), SpriteResource_GetID(param0[3]), 0xffffffff, 0xffffffff, 0, param3, param1[0], param1[1], param1[2], param1[3], NULL, NULL); + CellActorResourceData_Init(param2, SpriteResource_GetID(param0[0]), SpriteResource_GetID(param0[1]), SpriteResource_GetID(param0[2]), SpriteResource_GetID(param0[3]), 0xffffffff, 0xffffffff, 0, param3, param1[0], param1[1], param1[2], param1[3], NULL, NULL); } static void ov21_021E9458(UnkStruct_ov21_021E94F8 *param0, SpriteResourceCollection **param1, int param2, int param3) diff --git a/src/overlay022/ov22_02255094.c b/src/overlay022/ov22_02255094.c index 7958d03476..a433aa3752 100644 --- a/src/overlay022/ov22_02255094.c +++ b/src/overlay022/ov22_02255094.c @@ -153,7 +153,7 @@ CellActor *ov22_022551E4(UnkStruct_ov22_0225A0E4 *param0, int param1, int param2 CellActorResourceData v0; CellActorInitParams v1; - sub_020093B4(&v0, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_48[0], param0->unk_48[1], param0->unk_48[2], param0->unk_48[3], NULL, NULL); + CellActorResourceData_Init(&v0, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_48[0], param0->unk_48[1], param0->unk_48[2], param0->unk_48[3], NULL, NULL); v1.collection = param0->unk_44; v1.resourceData = &v0; diff --git a/src/overlay022/ov22_02259C58.c b/src/overlay022/ov22_02259C58.c index bdc59f2bf2..16f0db0536 100644 --- a/src/overlay022/ov22_02259C58.c +++ b/src/overlay022/ov22_02259C58.c @@ -300,7 +300,7 @@ static void ov22_0225A0E4(UnkStruct_ov22_02259C58 *param0, int param1, UnkStruct CellActorResourceData v1; CellActorInitParamsEx v2; - sub_020093B4(&v1, param1, 0, param1, param1, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0, param2->unk_48[0], param2->unk_48[1], param2->unk_48[2], param2->unk_48[3], NULL, NULL); + CellActorResourceData_Init(&v1, param1, 0, param1, param1, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0, param2->unk_48[0], param2->unk_48[1], param2->unk_48[2], param2->unk_48[3], NULL, NULL); v2.collection = param2->unk_44; v2.resourceData = &v1; @@ -326,7 +326,7 @@ static void ov22_0225A154(UnkStruct_ov22_0225A154 *param0, int param1, UnkStruct CellActorInitParamsEx v2; SpriteResource *v3; - sub_020093B4(&v1, param1, 0, param1, param1, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0, param2->unk_48[0], param2->unk_48[1], param2->unk_48[2], param2->unk_48[3], NULL, NULL); + CellActorResourceData_Init(&v1, param1, 0, param1, param1, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0, param2->unk_48[0], param2->unk_48[1], param2->unk_48[2], param2->unk_48[3], NULL, NULL); v2.collection = param2->unk_44; v2.resourceData = &v1; diff --git a/src/overlay022/ov22_0225A428.c b/src/overlay022/ov22_0225A428.c index b326d9aeb9..a7057392fd 100644 --- a/src/overlay022/ov22_0225A428.c +++ b/src/overlay022/ov22_0225A428.c @@ -373,7 +373,7 @@ static void ov22_0225AAC0(SpriteResource **param0, SpriteResourceCollection **pa static void ov22_0225AAF4(SpriteResource **param0, SpriteResourceCollection **param1, CellActorResourceData *param2, int param3) { - sub_020093B4(param2, SpriteResource_GetID(param0[0]), SpriteResource_GetID(param0[1]), SpriteResource_GetID(param0[2]), SpriteResource_GetID(param0[3]), 0xffffffff, 0xffffffff, 0, param3, param1[0], param1[1], param1[2], param1[3], NULL, NULL); + CellActorResourceData_Init(param2, SpriteResource_GetID(param0[0]), SpriteResource_GetID(param0[1]), SpriteResource_GetID(param0[2]), SpriteResource_GetID(param0[3]), 0xffffffff, 0xffffffff, 0, param3, param1[0], param1[1], param1[2], param1[3], NULL, NULL); } static void ov22_0225AB54(UnkStruct_ov22_0225AB54 *param0, CellActorCollection *param1, SpriteResourceCollection **param2, int param3, BgConfig *param4, UnkStruct_02095C60 *param5, NARC *param6) diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index 42d0ad6cdd..f344c41c34 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -2807,7 +2807,7 @@ static void ov23_0224108C(void) CellActorInitParamsEx v2; for (v0 = 0; v0 < 2; v0++) { - sub_020093B4(&Unk_ov23_02257740->unk_204[v0], v0, v0, v0, v0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257740->unk_1B0[0], Unk_ov23_02257740->unk_1B0[1], Unk_ov23_02257740->unk_1B0[2], Unk_ov23_02257740->unk_1B0[3], NULL, NULL); + CellActorResourceData_Init(&Unk_ov23_02257740->unk_204[v0], v0, v0, v0, v0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257740->unk_1B0[0], Unk_ov23_02257740->unk_1B0[1], Unk_ov23_02257740->unk_1B0[2], Unk_ov23_02257740->unk_1B0[3], NULL, NULL); v2.collection = Unk_ov23_02257740->unk_20; v2.resourceData = &Unk_ov23_02257740->unk_204[v0]; diff --git a/src/overlay023/ov23_0224340C.c b/src/overlay023/ov23_0224340C.c index 41d78512e6..b205e37fcc 100644 --- a/src/overlay023/ov23_0224340C.c +++ b/src/overlay023/ov23_0224340C.c @@ -3304,7 +3304,7 @@ static void ov23_02246370(int param0) static void ov23_0224644C(int param0) { - sub_020093B4(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); + CellActorResourceData_Init(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); { CellActorInitParamsEx v0; @@ -3654,7 +3654,7 @@ static void ov23_02246D44(UnkStruct_ov23_022468DC *param0) { sub_0200A450(Unk_ov23_02257764->unk_1F4[0][0]); sub_0200A640(Unk_ov23_02257764->unk_1F4[0][1]); - sub_020093B4(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); + CellActorResourceData_Init(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); { CellActorInitParamsEx v0; @@ -3832,7 +3832,7 @@ static void ov23_022471D8(UnkStruct_ov23_022471D8 *param0) { sub_0200A450(Unk_ov23_02257764->unk_1F4[0][0]); sub_0200A640(Unk_ov23_02257764->unk_1F4[0][1]); - sub_020093B4(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); + CellActorResourceData_Init(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); { CellActorInitParamsEx v0; @@ -4306,7 +4306,7 @@ static void ov23_02247E38(UnkStruct_ov23_02247E38 *param0) { sub_0200A450(Unk_ov23_02257764->unk_1F4[0][0]); sub_0200A640(Unk_ov23_02257764->unk_1F4[0][1]); - sub_020093B4(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); + CellActorResourceData_Init(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[0][0], Unk_ov23_02257764->unk_1D4[0][1], Unk_ov23_02257764->unk_1D4[0][2], Unk_ov23_02257764->unk_1D4[0][3], NULL, NULL); { CellActorInitParamsEx v0; @@ -4766,7 +4766,7 @@ static void ov23_02248748(UnkStruct_ov23_02248748 *param0) { sub_0200A450(Unk_ov23_02257764->unk_1F4[1][0]); sub_0200A640(Unk_ov23_02257764->unk_1F4[1][1]); - sub_020093B4(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[1][0], Unk_ov23_02257764->unk_1D4[1][1], Unk_ov23_02257764->unk_1D4[1][2], Unk_ov23_02257764->unk_1D4[1][3], NULL, NULL); + CellActorResourceData_Init(&Unk_ov23_02257764->unk_238, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, Unk_ov23_02257764->unk_1D4[1][0], Unk_ov23_02257764->unk_1D4[1][1], Unk_ov23_02257764->unk_1D4[1][2], Unk_ov23_02257764->unk_1D4[1][3], NULL, NULL); { CellActorInitParamsEx v0; diff --git a/src/overlay023/ov23_02248F1C.c b/src/overlay023/ov23_02248F1C.c index 7d810168b2..0333840292 100644 --- a/src/overlay023/ov23_02248F1C.c +++ b/src/overlay023/ov23_02248F1C.c @@ -97,7 +97,7 @@ static void ov23_02248F1C(SysTask *param0, void *param1) break; case 1: ov23_02249584(v0); - sub_020093B4(&v0->unk_36C, 1000, 1000, 1000, 1000, 0xffffffff, 0xffffffff, 0, 0, v0->unk_34C[0], v0->unk_34C[1], v0->unk_34C[2], v0->unk_34C[3], NULL, NULL); + CellActorResourceData_Init(&v0->unk_36C, 1000, 1000, 1000, 1000, 0xffffffff, 0xffffffff, 0, 0, v0->unk_34C[0], v0->unk_34C[1], v0->unk_34C[2], v0->unk_34C[3], NULL, NULL); { CellActorInitParamsEx v3; diff --git a/src/overlay056/ov56_022561C0.c b/src/overlay056/ov56_022561C0.c index 2c45fd179a..ef6388cafe 100644 --- a/src/overlay056/ov56_022561C0.c +++ b/src/overlay056/ov56_022561C0.c @@ -403,7 +403,7 @@ static void ov56_02256704(UnkStruct_ov56_02256468 *param0) { int v0; - sub_020093B4(¶m0->unk_1D8, 999, 999, 999, 999, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1B8[0], param0->unk_1B8[1], param0->unk_1B8[2], param0->unk_1B8[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_1D8, 999, 999, 999, 999, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1B8[0], param0->unk_1B8[1], param0->unk_1B8[2], param0->unk_1B8[3], NULL, NULL); { CellActorInitParamsEx v1; diff --git a/src/overlay058/ov58_021D0D80.c b/src/overlay058/ov58_021D0D80.c index fa3fa3a317..86ff4b00e6 100644 --- a/src/overlay058/ov58_021D0D80.c +++ b/src/overlay058/ov58_021D0D80.c @@ -662,8 +662,8 @@ static void ov58_021D16D8(UnkStruct_02095EAC *param0) { int v0; - sub_020093B4(¶m0->unk_1F4, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1C4[0], param0->unk_1C4[1], param0->unk_1C4[2], param0->unk_1C4[3], NULL, NULL); - sub_020093B4(¶m0->unk_218, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1C4[0], param0->unk_1C4[1], param0->unk_1C4[2], param0->unk_1C4[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_1F4, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1C4[0], param0->unk_1C4[1], param0->unk_1C4[2], param0->unk_1C4[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_218, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1C4[0], param0->unk_1C4[1], param0->unk_1C4[2], param0->unk_1C4[3], NULL, NULL); { CellActorInitParamsEx v1; diff --git a/src/overlay059/ov59_021D0D80.c b/src/overlay059/ov59_021D0D80.c index 8d0588e7f5..6f9111ee9f 100644 --- a/src/overlay059/ov59_021D0D80.c +++ b/src/overlay059/ov59_021D0D80.c @@ -634,7 +634,7 @@ static void ov59_021D1598(UnkStruct_020961E8 *param0) { int v0; - sub_020093B4(¶m0->unk_268, 2, 2, 2, 2, 0xffffffff, 0xffffffff, 0, 1, param0->unk_1E0[0], param0->unk_1E0[1], param0->unk_1E0[2], param0->unk_1E0[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_268, 2, 2, 2, 2, 0xffffffff, 0xffffffff, 0, 1, param0->unk_1E0[0], param0->unk_1E0[1], param0->unk_1E0[2], param0->unk_1E0[3], NULL, NULL); { CellActorInitParamsEx v1; diff --git a/src/overlay063/ov63_0222AE60.c b/src/overlay063/ov63_0222AE60.c index 10e9039907..3335b7da93 100644 --- a/src/overlay063/ov63_0222AE60.c +++ b/src/overlay063/ov63_0222AE60.c @@ -786,7 +786,7 @@ static void ov63_0222B510(UnkStruct_ov63_0222AE60 *param0, u32 param1, u32 param v3 = ov63_0222B49C(param3, 2, v2); v4 = ov63_0222B49C(param3, 3, v2); - sub_020093B4(¶m0->unk_10[param1].unk_14, 0x200 + param1, 0x200 + param1, v3, v4, 0xffffffff, 0xffffffff, 0, 0, param0->unk_2280[0], param0->unk_2280[1], param0->unk_2280[2], param0->unk_2280[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_10[param1].unk_14, 0x200 + param1, 0x200 + param1, v3, v4, 0xffffffff, 0xffffffff, 0, 0, param0->unk_2280[0], param0->unk_2280[1], param0->unk_2280[2], param0->unk_2280[3], NULL, NULL); } static void ov63_0222B664(UnkStruct_ov63_0222AE60 *param0, u32 param1, u32 param2, int param3, u32 param4) @@ -816,7 +816,7 @@ static void ov63_0222B664(UnkStruct_ov63_0222AE60 *param0, u32 param1, u32 param param0->unk_10[param1].unk_10 = param3; param0->unk_10[param1].unk_00 = 1; - sub_020093B4(¶m0->unk_10[param1].unk_14, 0x200 + param1, 0x402, 0x180 + v2, 0x180 + v2, 0xffffffff, 0xffffffff, 0, 0, param0->unk_2280[0], param0->unk_2280[1], param0->unk_2280[2], param0->unk_2280[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_10[param1].unk_14, 0x200 + param1, 0x402, 0x180 + v2, 0x180 + v2, 0xffffffff, 0xffffffff, 0, 0, param0->unk_2280[0], param0->unk_2280[1], param0->unk_2280[2], param0->unk_2280[3], NULL, NULL); } static void ov63_0222B738(UnkStruct_ov63_0222AE60 *param0, u32 param1) @@ -896,7 +896,7 @@ static void ov63_0222B7E8(UnkStruct_ov63_0222AE60 *param0, u32 param1, u32 param GF_ASSERT(v1); SpriteResource_ReleaseData(param0->unk_2248.unk_00[0]); - sub_020093B4(¶m0->unk_2248.unk_10, 0x120, 0x200 + v3, 0x120, 0x120, 0xffffffff, 0xffffffff, 0, 0, param0->unk_2280[0], param0->unk_2280[1], param0->unk_2280[2], param0->unk_2280[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_2248.unk_10, 0x120, 0x200 + v3, 0x120, 0x120, 0xffffffff, 0xffffffff, 0, 0, param0->unk_2280[0], param0->unk_2280[1], param0->unk_2280[2], param0->unk_2280[3], NULL, NULL); } static void ov63_0222B914(UnkStruct_ov63_0222AE60 *param0) diff --git a/src/overlay064/ov64_0222DCE0.c b/src/overlay064/ov64_0222DCE0.c index f6dc844c1b..70685fcc8c 100644 --- a/src/overlay064/ov64_0222DCE0.c +++ b/src/overlay064/ov64_0222DCE0.c @@ -1005,7 +1005,7 @@ static void ov64_0222E3D8 (UnkStruct_ov64_0222E21C * param0, u32 param1) SpriteResource_ReleaseData(param0->unk_260[0]); SpriteResource_ReleaseData(param0->unk_260[1]); - sub_020093B4(¶m0->unk_23C, 100, 100, 100, 100, 0xffffffff, 0xffffffff, 0, 0, param0->unk_204[0], param0->unk_204[1], param0->unk_204[2], param0->unk_204[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_23C, 100, 100, 100, 100, 0xffffffff, 0xffffffff, 0, 0, param0->unk_204[0], param0->unk_204[1], param0->unk_204[2], param0->unk_204[3], NULL, NULL); } static void ov64_0222E570 (UnkStruct_ov64_0222E21C * param0) diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index 76ee88bec3..85a1a72272 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -6691,7 +6691,7 @@ static void ov65_02234A68 (UnkStruct_ov65_0222EBE0 * param0, NARC * param1, u32 SpriteResource_ReleaseData(param0->unk_BE0.unk_20C[0]); SpriteResource_ReleaseData(param0->unk_BE0.unk_20C[1]); - sub_020093B4(&v2, 30, 30, 30, 30, 0xffffffff, 0xffffffff, 0, 0, param0->unk_31C[0], param0->unk_31C[1], param0->unk_31C[2], param0->unk_31C[3], NULL, NULL); + CellActorResourceData_Init(&v2, 30, 30, 30, 30, 0xffffffff, 0xffffffff, 0, 0, param0->unk_31C[0], param0->unk_31C[1], param0->unk_31C[2], param0->unk_31C[3], NULL, NULL); for (v1 = 0; v1 < 3; v1++) { v9[v1].collection = param0->unk_18C; diff --git a/src/overlay065/ov65_02235060.c b/src/overlay065/ov65_02235060.c index dddf74ec7c..a8d5a2b0fe 100644 --- a/src/overlay065/ov65_02235060.c +++ b/src/overlay065/ov65_02235060.c @@ -659,7 +659,7 @@ static void ov65_02235960(UnkStruct_ov65_022358CC *param0, u32 param1, NARC *par SpriteResource_ReleaseData(param0->unk_1A0.unk_00[0]); SpriteResource_ReleaseData(param0->unk_1A0.unk_00[1]); - sub_020093B4(¶m0->unk_1A0.unk_10, 50, 50, 50, 50, 0xffffffff, 0xffffffff, 0, 2, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_1A0.unk_10, 50, 50, 50, 50, 0xffffffff, 0xffffffff, 0, 2, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); } static void ov65_02235A60(UnkStruct_ov65_022358CC *param0) diff --git a/src/overlay068/ov68_0225C700.c b/src/overlay068/ov68_0225C700.c index 73e6e41483..64794654d6 100644 --- a/src/overlay068/ov68_0225C700.c +++ b/src/overlay068/ov68_0225C700.c @@ -690,7 +690,7 @@ static void ov68_0225CCD0(UnkStruct_ov68_0225D0F8 *param0, UnkStruct_ov68_0225CB CellActorResourceData v1; CellActorInitParams v2 = { 0 }; - sub_020093B4(&v1, 20, 20, 20, 20, 0xffffffff, 0xffffffff, 0, 0, param2->unk_194[0], param2->unk_194[1], param2->unk_194[2], param2->unk_194[3], NULL, NULL); + CellActorResourceData_Init(&v1, 20, 20, 20, 20, 0xffffffff, 0xffffffff, 0, 0, param2->unk_194[0], param2->unk_194[1], param2->unk_194[2], param2->unk_194[3], NULL, NULL); v2.collection = param2->unk_04; v2.resourceData = &v1; diff --git a/src/overlay069/ov69_0225C700.c b/src/overlay069/ov69_0225C700.c index 9e88731123..c74595d002 100644 --- a/src/overlay069/ov69_0225C700.c +++ b/src/overlay069/ov69_0225C700.c @@ -2650,7 +2650,7 @@ static void ov69_0225E960(UnkStruct_ov69_0225EB60 *param0, UnkStruct_ov69_0225D3 GF_ASSERT(v2); SpriteResource_ReleaseData(param0->unk_6C[v0][0]); - sub_020093B4(&v1, v0, 0, v0, v0, 0xffffffff, 0xffffffff, 0, 1, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); + CellActorResourceData_Init(&v1, v0, 0, v0, v0, 0xffffffff, 0xffffffff, 0, 1, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); param0->unk_3C[v0] = CellActorCollection_Add(&v3); diff --git a/src/overlay070/ov70_0225D9A4.c b/src/overlay070/ov70_0225D9A4.c index a26ea63623..4bdb95ae67 100644 --- a/src/overlay070/ov70_0225D9A4.c +++ b/src/overlay070/ov70_0225D9A4.c @@ -1658,7 +1658,7 @@ static void ov70_0225EC20(UnkStruct_ov70_0225EC20 *param0, UnkStruct_ov70_0225E4 NARC_dtor(v3); sub_0200A3DC(param0->unk_40[0]); sub_0200A640(param0->unk_40[1]); - sub_020093B4(&v0, 5000, 5000, 5000, 5000, 0xffffffff, 0xffffffff, 0, 0, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); + CellActorResourceData_Init(&v0, 5000, 5000, 5000, 5000, 0xffffffff, 0xffffffff, 0, 0, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); v1.collection = param1->unk_04; v1.resourceData = &v0; @@ -2708,7 +2708,7 @@ static void ov70_0225FEF0(UnkStruct_ov70_0225FA84 *param0, UnkStruct_ov70_0225E4 CellActorResourceData v3; CellActorInitParams v4 = { NULL }; - sub_020093B4(&v3, 100, 100, 100, 100, 0xffffffff, 0xffffffff, 0, 0, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); + CellActorResourceData_Init(&v3, 100, 100, 100, 100, 0xffffffff, 0xffffffff, 0, 0, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); v4.collection = param1->unk_04; v4.resourceData = &v3; @@ -2782,7 +2782,7 @@ static void ov70_02260080(UnkStruct_ov70_0225FA84 *param0, UnkStruct_ov70_0225E4 CellActorResourceData v6; CellActorInitParams v7 = { NULL }; - sub_020093B4(&v6, 101, 101, 101, 101, 0xffffffff, 0xffffffff, 1, 3, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); + CellActorResourceData_Init(&v6, 101, 101, 101, 101, 0xffffffff, 0xffffffff, 1, 3, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); v7.collection = param1->unk_04; v7.resourceData = &v6; @@ -2998,7 +2998,7 @@ static void ov70_022603CC(UnkStruct_ov70_0225FA84 *param0, UnkStruct_ov70_0225E4 GF_ASSERT(v3); SpriteResource_ReleaseData(param0->unk_BC[v0]); - sub_020093B4(&v9, 150 + v0, 150 + v10->unk_00, 150 + v10->unk_00, 150 + v10->unk_00, 0xffffffff, 0xffffffff, 0, 0, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); + CellActorResourceData_Init(&v9, 150 + v0, 150 + v10->unk_00, 150 + v10->unk_00, 150 + v10->unk_00, 0xffffffff, 0xffffffff, 0, 0, param1->unk_194[0], param1->unk_194[1], param1->unk_194[2], param1->unk_194[3], NULL, NULL); v8.collection = param1->unk_04; v8.resourceData = &v9; diff --git a/src/overlay071/ov71_0223CF0C.c b/src/overlay071/ov71_0223CF0C.c index 3a7a112f0d..a370312982 100644 --- a/src/overlay071/ov71_0223CF0C.c +++ b/src/overlay071/ov71_0223CF0C.c @@ -103,7 +103,7 @@ void ov71_0223D070(UnkStruct_ov71_0223D238 *param0, const u8 *param1) int v0; CellActorResourceData v1; - sub_020093B4(&v1, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 1, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(&v1, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 1, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); { u8 v2; diff --git a/src/overlay072/ov72_0223D7A0.c b/src/overlay072/ov72_0223D7A0.c index 371836104b..8f8dabffd3 100644 --- a/src/overlay072/ov72_0223D7A0.c +++ b/src/overlay072/ov72_0223D7A0.c @@ -508,8 +508,8 @@ static void ov72_0223DF58(UnkStruct_ov72_0223DB98 *param0) { int v0; - sub_020093B4(¶m0->unk_1FC, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1CC[0], param0->unk_1CC[1], param0->unk_1CC[2], param0->unk_1CC[3], NULL, NULL); - sub_020093B4(¶m0->unk_220, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1CC[0], param0->unk_1CC[1], param0->unk_1CC[2], param0->unk_1CC[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_1FC, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1CC[0], param0->unk_1CC[1], param0->unk_1CC[2], param0->unk_1CC[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_220, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1CC[0], param0->unk_1CC[1], param0->unk_1CC[2], param0->unk_1CC[3], NULL, NULL); { CellActorInitParamsEx v1; diff --git a/src/overlay077/ov77_021D54B0.c b/src/overlay077/ov77_021D54B0.c index 54070a3157..517d0e8eb5 100644 --- a/src/overlay077/ov77_021D54B0.c +++ b/src/overlay077/ov77_021D54B0.c @@ -108,7 +108,7 @@ static void ov77_021D54B0() static void ov77_021D54E8(const int param0, UnkStruct_ov77_021D5564 *param1, const int param2, CellActorInitParamsEx *param3, CellActorResourceData *param4, int param5, int param6) { - sub_020093B4(param4, param0, param0, param0, param0, 0xffffffff, 0xffffffff, param5, param2, param1->unk_190[0], param1->unk_190[1], param1->unk_190[2], param1->unk_190[3], NULL, NULL); + CellActorResourceData_Init(param4, param0, param0, param0, param0, 0xffffffff, 0xffffffff, param5, param2, param1->unk_190[0], param1->unk_190[1], param1->unk_190[2], param1->unk_190[3], NULL, NULL); { param3->collection = param1->unk_00; diff --git a/src/overlay077/ov77_021D6670.c b/src/overlay077/ov77_021D6670.c index 33d9e14e03..768b74b7ab 100644 --- a/src/overlay077/ov77_021D6670.c +++ b/src/overlay077/ov77_021D6670.c @@ -97,7 +97,7 @@ static void ov77_021D6670() static void ov77_021D66A0(UnkStruct_ov77_021D6800 *param0, CellActorInitParamsEx *param1, CellActorResourceData *param2) { - sub_020093B4(param2, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(param2, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); { param1->collection = param0->unk_00; diff --git a/src/overlay083/ov83_0223D6A8.c b/src/overlay083/ov83_0223D6A8.c index 8867d138b5..f6e5849d17 100644 --- a/src/overlay083/ov83_0223D6A8.c +++ b/src/overlay083/ov83_0223D6A8.c @@ -221,7 +221,7 @@ void ov83_0223D7A8(UnkStruct_ov83_0223D784 *param0, UnkStruct_ov83_0223D95C *par GF_ASSERT(v0); SpriteResource_ReleaseData(param1->unk_00[1]); - sub_020093B4(¶m1->unk_14, param8, param8, param8, param8, 0xffffffff, 0xffffffff, 0, 0, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(¶m1->unk_14, param8, param8, param8, param8, 0xffffffff, 0xffffffff, 0, 0, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); } void ov83_0223D894(UnkStruct_ov83_0223D784 *param0, UnkStruct_ov83_0223D95C *param1, NARC *param2, SpriteResource *param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8) @@ -242,7 +242,7 @@ void ov83_0223D894(UnkStruct_ov83_0223D784 *param0, UnkStruct_ov83_0223D95C *par GF_ASSERT(v0); SpriteResource_ReleaseData(param1->unk_00[0]); - sub_020093B4(¶m1->unk_14, param7, v1, param7, param7, 0xffffffff, 0xffffffff, 0, 0, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(¶m1->unk_14, param7, v1, param7, param7, 0xffffffff, 0xffffffff, 0, 0, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); } void ov83_0223D95C(UnkStruct_ov83_0223D784 *param0, UnkStruct_ov83_0223D95C *param1) diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index 96ff77fbeb..d46eaab0cc 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -1390,8 +1390,8 @@ static void ov88_0223CB34(Window *param0, int param1, UnkStruct_02095E80 *param2 static void ov88_0223CBA0(UnkStruct_02095E80 *param0) { - sub_020093B4(¶m0->unk_354, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 2, param0->unk_324[0], param0->unk_324[1], param0->unk_324[2], param0->unk_324[3], NULL, NULL); - sub_020093B4(¶m0->unk_378, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_324[0], param0->unk_324[1], param0->unk_324[2], param0->unk_324[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_354, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 2, param0->unk_324[0], param0->unk_324[1], param0->unk_324[2], param0->unk_324[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_378, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_324[0], param0->unk_324[1], param0->unk_324[2], param0->unk_324[3], NULL, NULL); { CellActorInitParamsEx v0; diff --git a/src/overlay094/ov94_0223BCB0.c b/src/overlay094/ov94_0223BCB0.c index e0033d429c..dc86560a55 100644 --- a/src/overlay094/ov94_0223BCB0.c +++ b/src/overlay094/ov94_0223BCB0.c @@ -390,8 +390,8 @@ static void ov94_0223C32C(UnkStruct_ov94_0223FD4C *param0) { int v0; - sub_020093B4(¶m0->unk_DB4, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_D74[0], param0->unk_D74[1], param0->unk_D74[2], param0->unk_D74[3], NULL, NULL); - sub_020093B4(¶m0->unk_DD8, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_D74[0], param0->unk_D74[1], param0->unk_D74[2], param0->unk_D74[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_DB4, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_D74[0], param0->unk_D74[1], param0->unk_D74[2], param0->unk_D74[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_DD8, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_D74[0], param0->unk_D74[1], param0->unk_D74[2], param0->unk_D74[3], NULL, NULL); GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); GXLayers_EngineBToggleLayers(GX_PLANEMASK_OBJ, 1); } diff --git a/src/overlay096/ov96_0223B6A0.c b/src/overlay096/ov96_0223B6A0.c index 2ce7fda9c5..2ca60b1e5f 100644 --- a/src/overlay096/ov96_0223B6A0.c +++ b/src/overlay096/ov96_0223B6A0.c @@ -299,7 +299,7 @@ static void ov96_0223BB0C(UnkStruct_ov96_0223BF40 *param0) { int v0; - sub_020093B4(¶m0->unk_DC4, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_D84[0], param0->unk_D84[1], param0->unk_D84[2], param0->unk_D84[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_DC4, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_D84[0], param0->unk_D84[1], param0->unk_D84[2], param0->unk_D84[3], NULL, NULL); { CellActorInitParamsEx v1; diff --git a/src/overlay097/ov97_0222D30C.c b/src/overlay097/ov97_0222D30C.c index 8490d6da2e..19124730f2 100644 --- a/src/overlay097/ov97_0222D30C.c +++ b/src/overlay097/ov97_0222D30C.c @@ -1152,12 +1152,12 @@ static void ov97_0222E398(UnkStruct_ov97_0222E398 *param0) v6 = NNS_G2D_VRAM_TYPE_2DMAIN; v7 = 20000 + v6; - sub_020093B4(¶m0->unk_10[v9 + 0], v7, v7, v7, v7, 0xffffffff, 0xffffffff, 0, 0, param0->unk_0C->unk_190[0], param0->unk_0C->unk_190[1], param0->unk_0C->unk_190[2], param0->unk_0C->unk_190[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_10[v9 + 0], v7, v7, v7, v7, 0xffffffff, 0xffffffff, 0, 0, param0->unk_0C->unk_190[0], param0->unk_0C->unk_190[1], param0->unk_0C->unk_190[2], param0->unk_0C->unk_190[3], NULL, NULL); v6 = NNS_G2D_VRAM_TYPE_2DSUB; v7 = 20000 + v6; - sub_020093B4(¶m0->unk_10[v9 + 1], v7, v7, v7, v7, 0xffffffff, 0xffffffff, 0, 0, param0->unk_0C->unk_190[0], param0->unk_0C->unk_190[1], param0->unk_0C->unk_190[2], param0->unk_0C->unk_190[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_10[v9 + 1], v7, v7, v7, v7, 0xffffffff, 0xffffffff, 0, 0, param0->unk_0C->unk_190[0], param0->unk_0C->unk_190[1], param0->unk_0C->unk_190[2], param0->unk_0C->unk_190[3], NULL, NULL); } static CellActor *ov97_0222E538(UnkStruct_ov97_0222E398 *param0, int param1) diff --git a/src/overlay097/ov97_02233B18.c b/src/overlay097/ov97_02233B18.c index c690ce629d..53f00fd027 100644 --- a/src/overlay097/ov97_02233B18.c +++ b/src/overlay097/ov97_02233B18.c @@ -532,7 +532,7 @@ static void ov97_02233FA4(UnkStruct_ov97_02234A2C *param0) static void ov97_022340B0(UnkStruct_ov97_02234A2C *param0) { - sub_020093B4(¶m0->unk_1E8, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1B8[0], param0->unk_1B8[1], param0->unk_1B8[2], param0->unk_1B8[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_1E8, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1B8[0], param0->unk_1B8[1], param0->unk_1B8[2], param0->unk_1B8[3], NULL, NULL); GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); } diff --git a/src/overlay097/ov97_02237694.c b/src/overlay097/ov97_02237694.c index 465977d530..d3d60e12c2 100644 --- a/src/overlay097/ov97_02237694.c +++ b/src/overlay097/ov97_02237694.c @@ -382,7 +382,7 @@ void ov97_02237B0C(int param0, int param1, int param2, int param3, int param4, i sub_0200A328(v0->unk_34.unk_1A8[param5][0]); sub_0200A640(v0->unk_34.unk_1A8[param5][1]); - sub_020093B4(&v0->unk_34.unk_1D8[param5], param5, param5, param5, param5, 0xffffffff, 0xffffffff, 0, 0, v0->unk_34.unk_190[0], v0->unk_34.unk_190[1], v0->unk_34.unk_190[2], v0->unk_34.unk_190[3], NULL, NULL); + CellActorResourceData_Init(&v0->unk_34.unk_1D8[param5], param5, param5, param5, param5, 0xffffffff, 0xffffffff, 0, 0, v0->unk_34.unk_190[0], v0->unk_34.unk_190[1], v0->unk_34.unk_190[2], v0->unk_34.unk_190[3], NULL, NULL); if (param5 == 0) { GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); diff --git a/src/overlay101/ov101_021D7E48.c b/src/overlay101/ov101_021D7E48.c index e1884dc4ff..3fd3276dcd 100644 --- a/src/overlay101/ov101_021D7E48.c +++ b/src/overlay101/ov101_021D7E48.c @@ -325,7 +325,7 @@ void ov101_021D84A4(UnkStruct_ov101_021D7E48 *param0, UnkStruct_ov101_021D8544 * param8 = 0xffffffff; } - sub_020093B4( + CellActorResourceData_Init( &v0, param5, param6, param7, param8, 0xffffffff, 0xffffffff, param4, param9, param0->unk_1A0, param0->unk_1A4, param0->unk_1A8, param0->unk_1AC, NULL, NULL); if (param4 == 1) { diff --git a/src/overlay105/ov105_02245AAC.c b/src/overlay105/ov105_02245AAC.c index 17deca1add..1d7b51ca41 100644 --- a/src/overlay105/ov105_02245AAC.c +++ b/src/overlay105/ov105_02245AAC.c @@ -63,7 +63,7 @@ CellActor *ov105_02245BA4(UnkStruct_ov105_02245AAC *param0, u32 param1, u32 para CellActorResourceData v1; CellActor *v2; - sub_020093B4(&v1, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, param4, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(&v1, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, param4, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); { CellActorInitParamsEx v3; diff --git a/src/overlay106/ov106_02243310.c b/src/overlay106/ov106_02243310.c index 7ae008836d..71910dd177 100644 --- a/src/overlay106/ov106_02243310.c +++ b/src/overlay106/ov106_02243310.c @@ -75,7 +75,7 @@ CellActor *ov106_022434BC(UnkStruct_ov106_02243310 *param0, u32 param1, u32 para CellActorResourceData v1; CellActor *v2; - sub_020093B4(&v1, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, 1, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(&v1, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, 1, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); { CellActorInitParamsEx v3; diff --git a/src/overlay107/ov107_02249604.c b/src/overlay107/ov107_02249604.c index e1d3140de3..bb88c303b6 100644 --- a/src/overlay107/ov107_02249604.c +++ b/src/overlay107/ov107_02249604.c @@ -114,7 +114,7 @@ CellActor *ov107_022498A4(UnkStruct_ov107_02249954 *param0, u32 param1, u32 para CellActorResourceData v1; CellActor *v2; - sub_020093B4(&v1, param1, param2, param3, param3, 0xffffffff, 0xffffffff, 0, param6, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(&v1, param1, param2, param3, param3, 0xffffffff, 0xffffffff, 0, param6, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); { CellActorInitParamsEx v3; diff --git a/src/overlay108/ov108_02243030.c b/src/overlay108/ov108_02243030.c index da8a52213a..3b4ac9af2e 100644 --- a/src/overlay108/ov108_02243030.c +++ b/src/overlay108/ov108_02243030.c @@ -80,7 +80,7 @@ CellActor *ov108_022430F0(UnkStruct_ov108_02243030 *param0, u32 param1, u32 para CellActorResourceData v1; CellActor *v2; - sub_020093B4(&v1, param1, param2, param3, param3, 0xffffffff, 0xffffffff, 0, param6, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(&v1, param1, param2, param3, param3, 0xffffffff, 0xffffffff, 0, param6, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); { CellActorInitParamsEx v3; diff --git a/src/overlay109/ov109_021D3D50.c b/src/overlay109/ov109_021D3D50.c index 2e55eefff8..adfd713c2c 100644 --- a/src/overlay109/ov109_021D3D50.c +++ b/src/overlay109/ov109_021D3D50.c @@ -631,7 +631,7 @@ static void ov109_021D4518(UnkStruct_ov109_021D5140 *param0) { int v0; - sub_020093B4(¶m0->unk_278, 2, 2, 2, 2, 0xffffffff, 0xffffffff, 0, 1, param0->unk_1F0[0], param0->unk_1F0[1], param0->unk_1F0[2], param0->unk_1F0[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_278, 2, 2, 2, 2, 0xffffffff, 0xffffffff, 0, 1, param0->unk_1F0[0], param0->unk_1F0[1], param0->unk_1F0[2], param0->unk_1F0[3], NULL, NULL); { CellActorInitParamsEx v1; diff --git a/src/overlay111/ov111_021D2F80.c b/src/overlay111/ov111_021D2F80.c index 01bb6c9167..366d224980 100644 --- a/src/overlay111/ov111_021D2F80.c +++ b/src/overlay111/ov111_021D2F80.c @@ -115,7 +115,7 @@ CellActor *ov111_021D3280(UnkStruct_ov111_021D2F80 *param0, u32 param1, u32 para CellActorResourceData v1; CellActor *v2; - sub_020093B4(&v1, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, param3, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); + CellActorResourceData_Init(&v1, param1, param1, param1, param1, 0xffffffff, 0xffffffff, 0, param3, param0->unk_190[0], param0->unk_190[1], param0->unk_190[2], param0->unk_190[3], NULL, NULL); { CellActorInitParamsEx v3; diff --git a/src/overlay114/ov114_0225C700.c b/src/overlay114/ov114_0225C700.c index d7adeb9a63..11ca6509c7 100644 --- a/src/overlay114/ov114_0225C700.c +++ b/src/overlay114/ov114_0225C700.c @@ -1305,7 +1305,7 @@ static void ov114_0225CDE0(UnkStruct_ov114_0225CCD0 *param0, UnkStruct_ov114_022 GF_ASSERT(v0); SpriteResource_ReleaseData(param1->unk_04[1]); - sub_020093B4(¶m1->unk_14, param8, param8, param8, param8, 0xffffffff, 0xffffffff, 0, 1, param0->unk_00[0], param0->unk_00[1], param0->unk_00[2], param0->unk_00[3], NULL, NULL); + CellActorResourceData_Init(¶m1->unk_14, param8, param8, param8, param8, 0xffffffff, 0xffffffff, 0, 1, param0->unk_00[0], param0->unk_00[1], param0->unk_00[2], param0->unk_00[3], NULL, NULL); } static void ov114_0225CEB8(UnkStruct_ov114_0225CCD0 *param0, UnkStruct_ov114_0225CDB4 *param1) diff --git a/src/overlay115/ov115_02260CEC.c b/src/overlay115/ov115_02260CEC.c index cfbadeeae1..04828c113c 100644 --- a/src/overlay115/ov115_02260CEC.c +++ b/src/overlay115/ov115_02260CEC.c @@ -2666,7 +2666,7 @@ static void ov115_02262FB4(UnkStruct_ov115_02263130 *param0, UnkStruct_ov115_022 SpriteResource_ReleaseData(param0->unk_00[0]); SpriteResource_ReleaseData(param0->unk_00[1]); - sub_020093B4(¶m0->unk_10, 120, 120, 120, 120, 0xffffffff, 0xffffffff, 0, 0, param1->unk_1AC[0], param1->unk_1AC[1], param1->unk_1AC[2], param1->unk_1AC[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_10, 120, 120, 120, 120, 0xffffffff, 0xffffffff, 0, 0, param1->unk_1AC[0], param1->unk_1AC[1], param1->unk_1AC[2], param1->unk_1AC[3], NULL, NULL); } { @@ -3224,7 +3224,7 @@ static void ov115_02263A74(UnkStruct_ov115_02261ADC *param0, NARC *param1, u32 p SpriteResource_ReleaseData(param0->unk_1E0[0]); SpriteResource_ReleaseData(param0->unk_1E0[1]); - sub_020093B4(¶m0->unk_1BC, 200, 200, 200, 200, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1AC[0], param0->unk_1AC[1], param0->unk_1AC[2], param0->unk_1AC[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_1BC, 200, 200, 200, 200, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1AC[0], param0->unk_1AC[1], param0->unk_1AC[2], param0->unk_1AC[3], NULL, NULL); } } @@ -3629,7 +3629,7 @@ static void ov115_022643EC(UnkStruct_ov115_02261ADC *param0, NARC *param1, u32 p SpriteResource_ReleaseData(param0->unk_760.unk_60[1]); } - sub_020093B4(¶m0->unk_760.unk_70, 100, 100, 100, 100, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1AC[0], param0->unk_1AC[1], param0->unk_1AC[2], param0->unk_1AC[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_760.unk_70, 100, 100, 100, 100, 0xffffffff, 0xffffffff, 0, 0, param0->unk_1AC[0], param0->unk_1AC[1], param0->unk_1AC[2], param0->unk_1AC[3], NULL, NULL); for (v1 = 0; v1 < 96; v1++) { ov115_022646BC(param0, ¶m0->unk_7F4[v1], param2); @@ -4403,7 +4403,7 @@ static void ov115_02265478(UnkStruct_ov115_02265788 *param0, UnkStruct_ov115_022 SpriteResource_ReleaseData(param0->unk_00[0]); SpriteResource_ReleaseData(param0->unk_00[1]); - sub_020093B4(¶m0->unk_10, 140, 140, 140, 140, 0xffffffff, 0xffffffff, 0, 0, param1->unk_1AC[0], param1->unk_1AC[1], param1->unk_1AC[2], param1->unk_1AC[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_10, 140, 140, 140, 140, 0xffffffff, 0xffffffff, 0, 0, param1->unk_1AC[0], param1->unk_1AC[1], param1->unk_1AC[2], param1->unk_1AC[3], NULL, NULL); } { diff --git a/src/sprite_renderer.c b/src/sprite_renderer.c index 146d0dcb23..8948d9e969 100644 --- a/src/sprite_renderer.c +++ b/src/sprite_renderer.c @@ -244,7 +244,7 @@ BOOL SpriteRenderer_LoadSpriteResourceData(SpriteRenderer *renderer, SpriteGfxHa sub_0200A60C(gfxHandler->spriteResourceList[SPRITE_RESOURCE_PALETTE]); void *resourceEntryData = ReadFileToHeap(renderer->heapID, resourcePaths->paths.combinedResourceDataPath); - gfxHandler->cellActorDataList = sub_02009508( + gfxHandler->cellActorDataList = CellActorResourceDataList_FromTemplate( resourceEntryData, renderer->heapID, gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_TILES], @@ -462,18 +462,18 @@ CellActorData *CellActor_LoadResources(SpriteRenderer *renderer, SpriteGfxHandle return NULL; } - cellActorData->cellActorResourceList = Heap_AllocFromHeap(renderer->heapID, sizeof(CellActorResourceDataList)); + cellActorData->resourceList = Heap_AllocFromHeap(renderer->heapID, sizeof(CellActorResourceDataList)); - if (cellActorData->cellActorResourceList == NULL) { + if (cellActorData->resourceList == NULL) { return NULL; } - cellActorData->cellActorResourceList->resourceDataList = Heap_AllocFromHeap(renderer->heapID, sizeof(CellActorResourceData)); - cellActorData->cellActorResource = cellActorData->cellActorResourceList->resourceDataList; + cellActorData->resourceList->resourceDataList = Heap_AllocFromHeap(renderer->heapID, sizeof(CellActorResourceData)); + cellActorData->resourceListHead = cellActorData->resourceList->resourceDataList; - if (cellActorData->cellActorResourceList->resourceDataList == NULL) { - if (cellActorData->cellActorResourceList) { - Heap_FreeToHeap(cellActorData->cellActorResourceList); + if (cellActorData->resourceList->resourceDataList == NULL) { + if (cellActorData->resourceList) { + Heap_FreeToHeap(cellActorData->resourceList); } return NULL; @@ -496,8 +496,8 @@ CellActorData *CellActor_LoadResources(SpriteRenderer *renderer, SpriteGfxHandle } } - sub_020093B4( - cellActorData->cellActorResource, + CellActorResourceData_Init( + cellActorData->resourceListHead, resourceIDList[SPRITE_RESOURCE_TILES], resourceIDList[SPRITE_RESOURCE_PALETTE], resourceIDList[SPRITE_RESOURCE_SPRITE], @@ -514,7 +514,7 @@ CellActorData *CellActor_LoadResources(SpriteRenderer *renderer, SpriteGfxHandle gfxHandler->spriteResourceCollectionList[SPRITE_RESOURCE_MULTI_SPRITE_ANIM]); cellActorParams.collection = gfxHandler->cellActorCollection; - cellActorParams.resourceData = cellActorData->cellActorResource; + cellActorParams.resourceData = cellActorData->resourceListHead; cellActorParams.position.x = FX32_CONST(template->x); cellActorParams.position.y = FX32_CONST(template->y); cellActorParams.position.z = FX32_CONST(template->z); @@ -592,11 +592,11 @@ void SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(SpriteRenderer *spriteRen void CellActorData_Delete(CellActorData *cellActorData) { if (cellActorData->vramTransfer) { - sub_0200A5B4(cellActorData->cellActorResource->imageProxy); + sub_0200A5B4(cellActorData->resourceListHead->imageProxy); } CellActor_Delete(cellActorData->cellActor); - sub_020095A8(cellActorData->cellActorResourceList); + sub_020095A8(cellActorData->resourceList); Heap_FreeToHeap(cellActorData); } diff --git a/src/unk_020093B4.c b/src/unk_020093B4.c index cd3461c514..7ebcf07ab0 100644 --- a/src/unk_020093B4.c +++ b/src/unk_020093B4.c @@ -3,8 +3,6 @@ #include #include -#include "struct_defs/struct_02009508_1.h" - #include "cell_actor.h" #include "heap.h" #include "sprite_renderer.h" @@ -15,79 +13,79 @@ #include "unk_0201F834.h" #include "unk_0202309C.h" -void sub_020093B4(CellActorResourceData *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, SpriteResourceCollection *param9, SpriteResourceCollection *param10, SpriteResourceCollection *param11, SpriteResourceCollection *param12, SpriteResourceCollection *param13, SpriteResourceCollection *param14) +void CellActorResourceData_Init(CellActorResourceData *resourceData, int tileIndex, int paletteIndex, int cellIndex, int animIndex, int multiCellIndex, int multiAnimIndex, BOOL vramTransfer, int priority, SpriteResourceCollection *tileCollection, SpriteResourceCollection *paletteCollection, SpriteResourceCollection *cellCollection, SpriteResourceCollection *animCollection, SpriteResourceCollection *multiCellCollection, SpriteResourceCollection *multiAnimCollection) { - SpriteResource *v0; - SpriteResource *v1; - SpriteResource *v2; - SpriteResource *v3 = NULL; - SpriteResource *v4 = NULL; - SpriteResource *v5 = NULL; - NNSG2dImageProxy *v6; - - GF_ASSERT(param9); - GF_ASSERT(param10); - GF_ASSERT(param12); - GF_ASSERT(param11); - GF_ASSERT(param0); - - v0 = SpriteResourceCollection_Find(param9, param1); - GF_ASSERT(v0); - - v1 = SpriteResourceCollection_Find(param10, param2); - GF_ASSERT(v1); - - v2 = SpriteResourceCollection_Find(param11, param3); - GF_ASSERT(v2); - - if (param12) { - if (param4 != 0xffffffff) { - v3 = SpriteResourceCollection_Find(param12, param4); - GF_ASSERT(v3); + SpriteResource *tileResource; + SpriteResource *paletteResource; + SpriteResource *cellResource; + SpriteResource *animResource = NULL; + SpriteResource *multiCellResource = NULL; + SpriteResource *multiAnimResource = NULL; + NNSG2dImageProxy *imageProxy; + + GF_ASSERT(tileCollection); + GF_ASSERT(paletteCollection); + GF_ASSERT(animCollection); + GF_ASSERT(cellCollection); + GF_ASSERT(resourceData); + + tileResource = SpriteResourceCollection_Find(tileCollection, tileIndex); + GF_ASSERT(tileResource); + + paletteResource = SpriteResourceCollection_Find(paletteCollection, paletteIndex); + GF_ASSERT(paletteResource); + + cellResource = SpriteResourceCollection_Find(cellCollection, cellIndex); + GF_ASSERT(cellResource); + + if (animCollection) { + if (animIndex != -1) { + animResource = SpriteResourceCollection_Find(animCollection, animIndex); + GF_ASSERT(animResource); } } - if (param13 != NULL) { - if (param5 != 0xffffffff) { - v4 = SpriteResourceCollection_Find(param13, param5); + if (multiCellCollection != NULL) { + if (multiCellIndex != -1) { + multiCellResource = SpriteResourceCollection_Find(multiCellCollection, multiCellIndex); } - if (param6 != 0xffffffff) { - v5 = SpriteResourceCollection_Find(param14, param6); + if (multiAnimIndex != -1) { + multiAnimResource = SpriteResourceCollection_Find(multiAnimCollection, multiAnimIndex); } } - if (param7) { - v6 = sub_0200A558(v0, v2); - GF_ASSERT(v6); + if (vramTransfer) { + imageProxy = sub_0200A558(tileResource, cellResource); + GF_ASSERT(imageProxy); - param0->charData = SpriteResource_GetTileData(v0); + resourceData->charData = SpriteResource_GetTileData(tileResource); } else { - v6 = sub_0200A534(v0); - GF_ASSERT(v6); - param0->charData = NULL; + imageProxy = sub_0200A534(tileResource); + GF_ASSERT(imageProxy); + resourceData->charData = NULL; } - param0->paletteProxy = sub_0200A72C(v1, v6); - param0->imageProxy = v6; - param0->cellBank = SpriteResource_GetSpriteData(v2); + resourceData->paletteProxy = sub_0200A72C(paletteResource, imageProxy); + resourceData->imageProxy = imageProxy; + resourceData->cellBank = SpriteResource_GetSpriteData(cellResource); - if (v3) { - param0->cellAnimBank = SpriteResource_GetSpriteAnimData(v3); + if (animResource) { + resourceData->cellAnimBank = SpriteResource_GetSpriteAnimData(animResource); } else { - param0->cellAnimBank = NULL; + resourceData->cellAnimBank = NULL; } - if (v4) { - param0->multiCellBank = SpriteResource_GetMultiSpriteData(v4); - param0->multiCellAnimBank = SpriteResource_GetMultiSpriteAnimData(v5); + if (multiCellResource) { + resourceData->multiCellBank = SpriteResource_GetMultiSpriteData(multiCellResource); + resourceData->multiCellAnimBank = SpriteResource_GetMultiSpriteAnimData(multiAnimResource); } else { - param0->multiCellBank = NULL; - param0->multiCellAnimBank = NULL; + resourceData->multiCellBank = NULL; + resourceData->multiCellAnimBank = NULL; } - param0->isVRamTransfer = param7; - param0->priority = param8; + resourceData->isVRamTransfer = vramTransfer; + resourceData->priority = priority; } void sub_020094F0(CellActorResourceData *param0) @@ -96,28 +94,37 @@ void sub_020094F0(CellActorResourceData *param0) memset(param0, 0, sizeof(CellActorResourceData)); } -CellActorResourceDataList *sub_02009508(const UnkStruct_02009508_1 *param0, int param1, SpriteResourceCollection *param2, SpriteResourceCollection *param3, SpriteResourceCollection *param4, SpriteResourceCollection *param5, SpriteResourceCollection *param6, SpriteResourceCollection *param7) +CellActorResourceDataList *CellActorResourceDataList_FromTemplate(const SpriteTemplateTableEntry *template, int heapId, SpriteResourceCollection *tilesCollection, SpriteResourceCollection *paletteCollection, SpriteResourceCollection *cellsCollection, SpriteResourceCollection *animCollection, SpriteResourceCollection *multiCellCollection, SpriteResourceCollection *multiAnimCollection) { - int v0; - int v1; - CellActorResourceDataList *v2; - int v3, v4; - - v1 = 0; - - while (param0[v1].unk_00 != 0xfffffffe) { - v1++; + int resourceCount = 0; + while (template[resourceCount].tileIndex != -2) { + resourceCount++; } - v2 = Heap_AllocFromHeap(param1, sizeof(CellActorResourceDataList)); - v2->resourceDataList = Heap_AllocFromHeap(param1, sizeof(CellActorResourceData) * v1); - v2->numEntries = v1; - - for (v0 = 0; v0 < v2->numEntries; v0++) { - sub_020093B4(v2->resourceDataList + v0, param0[v0].unk_00, param0[v0].unk_04, param0[v0].unk_08, param0[v0].unk_0C, param0[v0].unk_10, param0[v0].unk_14, param0[v0].unk_18, param0[v0].unk_1C, param2, param3, param4, param5, param6, param7); + CellActorResourceDataList *resources = Heap_AllocFromHeap(heapId, sizeof(CellActorResourceDataList)); + resources->resourceDataList = Heap_AllocFromHeap(heapId, sizeof(CellActorResourceData) * resourceCount); + resources->numEntries = resourceCount; + + for (int i = 0; i < resources->numEntries; i++) { + CellActorResourceData_Init( + resources->resourceDataList + i, + template[i].tileIndex, + template[i].paletteIndex, + template[i].cellsIndex, + template[i].animIndex, + template[i].multiCellsIndex, + template[i].multiAnimIndex, + template[i].vramTransfer, + template[i].priority, + tilesCollection, + paletteCollection, + cellsCollection, + animCollection, + multiCellCollection, + multiAnimCollection); } - return v2; + return resources; } void sub_020095A8(CellActorResourceDataList *param0) diff --git a/src/unk_0205CA94.c b/src/unk_0205CA94.c index 12db03b95d..a49ffcc904 100644 --- a/src/unk_0205CA94.c +++ b/src/unk_0205CA94.c @@ -455,7 +455,7 @@ static void sub_0205D0D8(UnkStruct_0205D094 *param0, int param1, u32 param2) sub_0200A684(param0->unk_18[1]); v1 = LoadMemberFromNARC(177, 4, 0, 4, 0); - param0->unk_04 = sub_02009508(v1, 4, param0->unk_08[0], param0->unk_08[1], param0->unk_08[2], param0->unk_08[3], NULL, NULL); + param0->unk_04 = CellActorResourceDataList_FromTemplate(v1, 4, param0->unk_08[0], param0->unk_08[1], param0->unk_08[2], param0->unk_08[3], NULL, NULL); Heap_FreeToHeap(v1); } diff --git a/src/unk_0208694C.c b/src/unk_0208694C.c index 0f717cb321..23b9e732d7 100644 --- a/src/unk_0208694C.c +++ b/src/unk_0208694C.c @@ -1590,8 +1590,8 @@ static void sub_02087A10(UnkStruct_02087A10 *param0) { int v0; - sub_020093B4(¶m0->unk_348, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 1, param0->unk_318[0], param0->unk_318[1], param0->unk_318[2], param0->unk_318[3], NULL, NULL); - sub_020093B4(¶m0->unk_36C, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_318[0], param0->unk_318[1], param0->unk_318[2], param0->unk_318[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_348, 0, 0, 0, 0, 0xffffffff, 0xffffffff, 0, 1, param0->unk_318[0], param0->unk_318[1], param0->unk_318[2], param0->unk_318[3], NULL, NULL); + CellActorResourceData_Init(¶m0->unk_36C, 1, 1, 1, 1, 0xffffffff, 0xffffffff, 0, 0, param0->unk_318[0], param0->unk_318[1], param0->unk_318[2], param0->unk_318[3], NULL, NULL); { CellActorInitParamsEx v1; diff --git a/src/unk_02098FFC.c b/src/unk_02098FFC.c index 6c1e517823..1c760f49bb 100644 --- a/src/unk_02098FFC.c +++ b/src/unk_02098FFC.c @@ -129,14 +129,14 @@ UnkStruct_0209916C *sub_0209916C(UnkStruct_0209903C *param0, int param1, u16 par v4 = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorData)); - v4->cellActorResourceList = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceDataList)); - v4->cellActorResourceList->resourceDataList = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceData)); - v4->cellActorResource = v4->cellActorResourceList->resourceDataList; + v4->resourceList = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceDataList)); + v4->resourceList->resourceDataList = Heap_AllocFromHeap(param0->unk_00, sizeof(CellActorResourceData)); + v4->resourceListHead = v4->resourceList->resourceDataList; - sub_020093B4(v4->cellActorResource, 0xe000, 0xe000 + v1, 0xe000, 0xe000, 0xffffffff, 0xffffffff, 0, param5, param0->unk_1A4[0], param0->unk_1A4[1], param0->unk_1A4[2], param0->unk_1A4[3], NULL, NULL); + CellActorResourceData_Init(v4->resourceListHead, 0xe000, 0xe000 + v1, 0xe000, 0xe000, 0xffffffff, 0xffffffff, 0, param5, param0->unk_1A4[0], param0->unk_1A4[1], param0->unk_1A4[2], param0->unk_1A4[3], NULL, NULL); v5.collection = param0->unk_10; - v5.resourceData = v4->cellActorResource; + v5.resourceData = v4->resourceListHead; v5.position.x = FX32_CONST(param2); v5.position.y = FX32_CONST(param3); v5.position.z = FX32_CONST(param4); From ba2359a9d07a710f181de9292259b4ba9f32a47e Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Wed, 6 Nov 2024 11:09:53 -0600 Subject: [PATCH 09/11] fix missed changes after rebasing --- include/overlay094/struct_ov94_0223FD4C.h | 1 - include/struct_defs/struct_02095E80_t.h | 3 +- .../pokemon_summary_screen/main.c | 32 +++++++++---------- .../pokemon_summary_screen/sprite.c | 1 - src/overlay013/ov13_02224500.c | 1 - src/overlay023/ov23_0224340C.c | 1 - 6 files changed, 17 insertions(+), 22 deletions(-) diff --git a/include/overlay094/struct_ov94_0223FD4C.h b/include/overlay094/struct_ov94_0223FD4C.h index 07ba727735..36b5c8aae7 100644 --- a/include/overlay094/struct_ov94_0223FD4C.h +++ b/include/overlay094/struct_ov94_0223FD4C.h @@ -6,7 +6,6 @@ #include "struct_decls/struct_0202B370_decl.h" #include "struct_decls/struct_0207AE68_decl.h" -#include "struct_defs/pokemon_summary.h" #include "struct_defs/struct_0203E0FC.h" #include "applications/pokemon_summary_screen/main.h" diff --git a/include/struct_defs/struct_02095E80_t.h b/include/struct_defs/struct_02095E80_t.h index bc97026ad4..f31b9720ad 100644 --- a/include/struct_defs/struct_02095E80_t.h +++ b/include/struct_defs/struct_02095E80_t.h @@ -10,7 +10,6 @@ #include "struct_decls/struct_party_decl.h" #include "struct_defs/archived_sprite.h" #include "struct_defs/chatot_cry.h" -#include "struct_defs/pokemon_summary.h" #include "struct_defs/struct_02027F8C.h" #include "struct_defs/struct_02095E80_sub1.h" @@ -26,8 +25,8 @@ #include "message.h" #include "overlay_manager.h" #include "savedata.h" -#include "sprite_renderer.h" #include "sprite_resource.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" diff --git a/src/applications/pokemon_summary_screen/main.c b/src/applications/pokemon_summary_screen/main.c index bec27a2fd9..30df92335c 100644 --- a/src/applications/pokemon_summary_screen/main.c +++ b/src/applications/pokemon_summary_screen/main.c @@ -48,7 +48,7 @@ #include "unk_02006224.h" #include "unk_0200762C.h" #include "unk_0200C440.h" -#include "unk_0200C6E4.h" +#include "sprite_renderer.h" #include "unk_0200F174.h" #include "unk_02015F84.h" #include "unk_02017728.h" @@ -272,7 +272,7 @@ static int PokemonSummaryScreen_Main(OverlayManager *ovyManager, int *state) sub_0208EB14(summaryScreen); PokemonSummaryScreen_DrawSheenSprites(summaryScreen); sub_0208FB30(summaryScreen); - sub_0200C7EC(summaryScreen->gfxHandler); + SpriteGfxHandler_UpdateCellActorCollection(summaryScreen->gfxHandler); PokemonSummaryScreen_Update3DGfx(summaryScreen); return FALSE; @@ -759,7 +759,7 @@ static int HandleInput_LearnMove(PokemonSummaryScreen *summaryScreen) if (summaryScreen->cursor != LEARNED_MOVES_MAX) { if (Item_IsHMMove(summaryScreen->monData.moves[summaryScreen->cursor]) == TRUE && summaryScreen->data->move != MOVE_NONE) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); + CellActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); DrawEmptyHearts(summaryScreen); PokemonSummaryScreen_PrintHMMovesCantBeForgotten(summaryScreen); return PSS_STATE_WAIT_HM_MSG_INPUT; @@ -1610,11 +1610,11 @@ static u8 SetupBattleMoveInfo(PokemonSummaryScreen *summaryScreen) } UpdateMoveInfo(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); PokemonSummaryScreen_ShowMonIcon(summaryScreen); if (summaryScreen->monData.type1 != summaryScreen->monData.type2) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); } CellActor_SetDrawFlag(summaryScreen->unk_41C[9], TRUE); @@ -1628,10 +1628,10 @@ static u8 HideBattleMoveInfo(PokemonSummaryScreen *summaryScreen) { switch (summaryScreen->subscreen) { case 0: - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], FALSE); - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], FALSE); - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); - SpriteActor_DrawSprite(summaryScreen->unk_41C[19], FALSE); + CellActor_DrawSprite(summaryScreen->unk_41C[11], FALSE); + CellActor_DrawSprite(summaryScreen->unk_41C[12], FALSE); + CellActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); + CellActor_DrawSprite(summaryScreen->unk_41C[19], FALSE); CellActor_SetDrawFlag(summaryScreen->unk_41C[9], FALSE); Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); @@ -1719,11 +1719,11 @@ static void UpdateBattleMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move) { if (move == PSS_MOVE_NONE) { PokemonSummaryScreen_ClearBattleInfoWindows(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); + CellActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); } else { PokemonSummaryScreen_PrintBattleMoveInfo(summaryScreen, move); PokemonSummaryScreen_UpdateMoveCategoryIcon(summaryScreen, move); - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[18], TRUE); } } @@ -1772,11 +1772,11 @@ static void SetupMoveInfoNoTransition(PokemonSummaryScreen *summaryScreen) ShowMoveInfoOrCancel(summaryScreen); UpdateMoveInfo(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); PokemonSummaryScreen_ShowMonIcon(summaryScreen); if (summaryScreen->monData.type1 != summaryScreen->monData.type2) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); } CellActor_SetDrawFlag(summaryScreen->unk_41C[9], TRUE); @@ -1832,7 +1832,7 @@ static u8 HideContestMoveInfo(PokemonSummaryScreen *summaryScreen) switch (summaryScreen->subscreen) { case 0: PokemonSummaryScreen_HideContestStatDots(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[19], FALSE); + CellActor_DrawSprite(summaryScreen->unk_41C[19], FALSE); UpdateAppealHearts(summaryScreen, PSS_MOVE_NONE); CellActor_SetDrawFlag(summaryScreen->unk_41C[9], FALSE); Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); @@ -1920,10 +1920,10 @@ static void SetupMoveInfoFromSubscreenButton(PokemonSummaryScreen *summaryScreen if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { PokemonSummaryScreen_HideContestStatDots(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); if (summaryScreen->monData.type1 != summaryScreen->monData.type2) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); + CellActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); } Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, 3, 0); diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index 05cf8e5b5b..3dd98b9100 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -19,7 +19,6 @@ #include "pokemon.h" #include "pokemon_icon.h" #include "ribbon.h" -#include "pokemon_summary_app.h" #include "sprite_renderer.h" #include "sprite_resource.h" #include "unk_0201DBEC.h" diff --git a/src/overlay013/ov13_02224500.c b/src/overlay013/ov13_02224500.c index 16e9a0032f..6e381e916f 100644 --- a/src/overlay013/ov13_02224500.c +++ b/src/overlay013/ov13_02224500.c @@ -23,7 +23,6 @@ #include "narc.h" #include "party.h" #include "pokemon_icon.h" -#include "pokemon_summary_app.h" #include "sprite_renderer.h" #include "unk_0207C908.h" #include "unk_0207E0B8.h" diff --git a/src/overlay023/ov23_0224340C.c b/src/overlay023/ov23_0224340C.c index b205e37fcc..85f93fc5f0 100644 --- a/src/overlay023/ov23_0224340C.c +++ b/src/overlay023/ov23_0224340C.c @@ -7,7 +7,6 @@ #include "struct_decls/struct_0202855C_decl.h" #include "struct_decls/struct_020298B0_decl.h" -#include "struct_defs/struct_0200C738.h" #include "field/field_system.h" #include "overlay005/ov5_021EAFA4.h" From d429b1c9588393762a79d5e3bf97b5de63aad352 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Wed, 6 Nov 2024 11:50:05 -0600 Subject: [PATCH 10/11] document CellActorPropsTemplate struct --- include/overlay005/ov5_021D2F14.h | 3 +- include/overlay007/struct_ov7_0224F358.h | 19 -------- include/sprite_renderer.h | 18 +++++++- .../pokemon_summary_screen/sprite.c | 3 +- src/overlay005/ov5_021D2F14.c | 19 ++++---- src/overlay007/ov7_0224CD28.c | 3 +- src/overlay079/ov79_021D0D80.c | 3 +- src/overlay080/ov80_021D1458.c | 11 +++-- src/overlay080/ov80_021D2AF4.c | 3 +- src/overlay090/ov90_021D0D80.c | 3 +- src/sprite_renderer.c | 5 +-- src/unk_020093B4.c | 20 ++++----- src/unk_02082C2C.c | 45 +++++++++---------- 13 files changed, 70 insertions(+), 85 deletions(-) delete mode 100644 include/overlay007/struct_ov7_0224F358.h diff --git a/include/overlay005/ov5_021D2F14.h b/include/overlay005/ov5_021D2F14.h index 0093f10ebc..039c793382 100644 --- a/include/overlay005/ov5_021D2F14.h +++ b/include/overlay005/ov5_021D2F14.h @@ -5,7 +5,6 @@ #include "struct_defs/sprite_template.h" #include "overlay005/struct_ov5_021D30A8.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_02241308.h" #include "cell_actor.h" @@ -14,7 +13,7 @@ void ov5_021D2F14(UnkStruct_ov5_021D30A8 *param0, const SpriteResourceDataPath *param1, u32 param2, u32 param3); void ov5_021D30A8(UnkStruct_ov5_021D30A8 *param0); -CellActor *ov5_021D3104(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224F358 *param1); +CellActor *ov5_021D3104(UnkStruct_ov5_021D30A8 *param0, const CellActorPropsTemplate *param1); void ov5_021D3190(UnkStruct_ov5_021D30A8 *param0, UnkStruct_ov104_02241308 *param1, u32 param2, u32 param3); void ov5_021D3270(UnkStruct_ov5_021D30A8 *param0, int param1, int param2, int param3, int param4, int param5, int param6); void ov5_021D32E8(UnkStruct_ov5_021D30A8 *param0, NARC *param1, int param2, int param3, int param4, int param5, int param6); diff --git a/include/overlay007/struct_ov7_0224F358.h b/include/overlay007/struct_ov7_0224F358.h deleted file mode 100644 index 468fa730dd..0000000000 --- a/include/overlay007/struct_ov7_0224F358.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV7_0224F358_H -#define POKEPLATINUM_STRUCT_OV7_0224F358_H - -typedef struct { - int unk_00; - s16 unk_04; - s16 unk_06; - s16 unk_08; - u16 unk_0A; - int unk_0C; - int unk_10; - int unk_14; - int unk_18; - int unk_1C; - int unk_20; - int unk_24; -} UnkStruct_ov7_0224F358; - -#endif // POKEPLATINUM_STRUCT_OV7_0224F358_H diff --git a/include/sprite_renderer.h b/include/sprite_renderer.h index 16fca1944f..4782e46084 100644 --- a/include/sprite_renderer.h +++ b/include/sprite_renderer.h @@ -9,7 +9,6 @@ #include "struct_decls/struct_0200C704_decl.h" #include "struct_defs/sprite_template.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -47,6 +46,21 @@ typedef struct AnimationResourceCollection_t { int numSpriteResourceTypes; } SpriteGfxHandler; +typedef struct CellActorPropsTemplate { + int resourceIndex; + s16 x; + s16 y; + s16 z; + u16 anim; + int priority; + int palette; + int vramType; + int unk_18; + int unk_1C; + int unk_20; + int unk_24; +} CellActorPropsTemplate; + SpriteRenderer *SpriteRenderer_Create(int heapID); SpriteGfxHandler *SpriteRenderer_CreateGfxHandler(SpriteRenderer *renderer); GF_G2dRenderer *SpriteRenderer_GetG2dRenderer(SpriteRenderer *renderer); @@ -64,7 +78,7 @@ void SpriteRenderer_RemoveGfxHandler(SpriteRenderer *renderer, SpriteGfxHandler void SpriteRenderer_DeleteGfxHandler(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler); void SpriteRenderer_Free(SpriteRenderer *renderer); BOOL SpriteRenderer_LoadSpriteResourceData(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const SpriteResourceDataPath *resourcePaths); -CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkStruct_ov7_0224F358 *template); +CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const CellActorPropsTemplate *template); CellActor *SpriteRenderer_CreateCellActor(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int resourceIndex, s16 x, s16 y, s16 z, u16 anim, int priority, int palette, int vramType, int param10, int param11, int param12, int param13); BOOL SpriteRenderer_InitGfxResourceList(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkStruct_ov104_02241308 *param2); BOOL SpriteRenderer_LoadCharResObj(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int narcIndex, int memberIndex, BOOL compressed, int vramType, int resourceID); diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index 3dd98b9100..1fab031ff7 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -8,7 +8,6 @@ #include "applications/pokemon_summary_screen/main.h" #include "applications/pokemon_summary_screen/subscreen.h" #include "data/pst_pal.naix" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" @@ -28,7 +27,7 @@ static void sub_0208F194(PokemonSummaryScreen *param0, u8 param1, u8 param2, u8 static void sub_0208EF0C(PokemonSummaryScreen *param0); static void sub_0208FC30(CellActor *param0, u32 param1, u32 param2, const s16 *param3); -static const UnkStruct_ov7_0224F358 Unk_020F41A8[] = { +static const CellActorPropsTemplate Unk_020F41A8[] = { { 0x1, 0x80, 0x18, 0x0, 0x0, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 0x1, 0x90, 0x18, 0x0, 0x1, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 0x1, 0xA0, 0x18, 0x0, 0x2, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, diff --git a/src/overlay005/ov5_021D2F14.c b/src/overlay005/ov5_021D2F14.c index d8021f045d..cfd9ed43ef 100644 --- a/src/overlay005/ov5_021D2F14.c +++ b/src/overlay005/ov5_021D2F14.c @@ -7,7 +7,6 @@ #include "struct_defs/struct_0200D0F4.h" #include "overlay005/struct_ov5_021D30A8.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_02241308.h" #include "cell_actor.h" @@ -93,31 +92,31 @@ void ov5_021D30A8(UnkStruct_ov5_021D30A8 *param0) } } -CellActor *ov5_021D3104(UnkStruct_ov5_021D30A8 *param0, const UnkStruct_ov7_0224F358 *param1) +CellActor *ov5_021D3104(UnkStruct_ov5_021D30A8 *param0, const CellActorPropsTemplate *param1) { CellActorInitParamsEx v0; CellActor *v1; VecFx32 v2 = { FX32_ONE, FX32_ONE, FX32_ONE }; VecFx32 v3; - v3.x = param1->unk_04 * FX32_ONE; - v3.y = param1->unk_06 * FX32_ONE; - v3.z = param1->unk_08 * FX32_ONE; + v3.x = param1->x * FX32_ONE; + v3.y = param1->y * FX32_ONE; + v3.z = param1->z * FX32_ONE; v0.collection = param0->unk_00; - v0.resourceData = ¶m0->unk_190->resourceDataList[param1->unk_00]; + v0.resourceData = ¶m0->unk_190->resourceDataList[param1->resourceIndex]; v0.position = v3; v0.affineScale = v2; v0.affineZRotation = 0; - v0.priority = param1->unk_0C; - v0.vramType = param1->unk_14; + v0.priority = param1->priority; + v0.vramType = param1->vramType; v0.heapID = param0->unk_1C6; v1 = CellActorCollection_AddEx(&v0); GF_ASSERT(v1); - CellActor_SetAnim(v1, param1->unk_0A); - CellActor_SetExplicitPaletteWithOffset(v1, param1->unk_10); + CellActor_SetAnim(v1, param1->anim); + CellActor_SetExplicitPaletteWithOffset(v1, param1->palette); return v1; } diff --git a/src/overlay007/ov7_0224CD28.c b/src/overlay007/ov7_0224CD28.c index 3d13909f37..2fbba68d9a 100644 --- a/src/overlay007/ov7_0224CD28.c +++ b/src/overlay007/ov7_0224CD28.c @@ -9,7 +9,6 @@ #include "overlay005/fieldmap.h" #include "overlay005/ov5_021D2F14.h" #include "overlay007/struct_ov7_0224D008.h" -#include "overlay007/struct_ov7_0224F358.h" #include "bag.h" #include "bg_window.h" @@ -1447,7 +1446,7 @@ static const SpriteResourceDataPath Unk_ov7_0224F2EC = { "data/shop_h.cldat" }; -static const UnkStruct_ov7_0224F358 Unk_ov7_0224F358[] = { +static const CellActorPropsTemplate Unk_ov7_0224F358[] = { { 0, 0xB1, 0x8, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 0, 0xB1, 0x84, 0x0, 0x1, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 1, 0xAC, 0x18, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, diff --git a/src/overlay079/ov79_021D0D80.c b/src/overlay079/ov79_021D0D80.c index 32a2a92bb3..b0bafa30ad 100644 --- a/src/overlay079/ov79_021D0D80.c +++ b/src/overlay079/ov79_021D0D80.c @@ -6,7 +6,6 @@ #include "struct_defs/struct_0203D9B8.h" #include "struct_defs/struct_02099F80.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay079/ov79_021D183C.h" #include "overlay079/ov79_021D20F4.h" #include "overlay079/struct_ov79_021D0E1C.h" @@ -739,7 +738,7 @@ static void ov79_021D1618(UnkStruct_ov79_021D0E1C *param0) static void ov79_021D167C(UnkStruct_ov79_021D0E1C *param0) { int v0; - static const UnkStruct_ov7_0224F358 v1[] = { + static const CellActorPropsTemplate v1[] = { { 0x0, 0x69, 0x28, 0x0, 0x0, 0x1, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 0x0, 0x50, 0x12, 0x0, 0x1, 0x2, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 0x0, 0x50, 0x8C, 0x0, 0x2, 0x2, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, diff --git a/src/overlay080/ov80_021D1458.c b/src/overlay080/ov80_021D1458.c index bcd873474a..3a9a9b591a 100644 --- a/src/overlay080/ov80_021D1458.c +++ b/src/overlay080/ov80_021D1458.c @@ -3,7 +3,6 @@ #include "struct_decls/struct_02039EBC_decl.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay080/ov80_021D2AF4.h" #include "overlay080/struct_ov80_021D1478_sub1.h" #include "overlay080/struct_ov80_021D259C.h" @@ -860,7 +859,7 @@ static void ov80_021D225C(UnkStruct_ov80_021D2A08 *param0) Bg_ScheduleTilemapTransfer(param0->unk_28, 7); } -static const UnkStruct_ov7_0224F358 Unk_ov80_021D30E8[] = { +static const CellActorPropsTemplate Unk_ov80_021D30E8[] = { { 0, 0, @@ -908,7 +907,7 @@ static const UnkStruct_ov7_0224F358 Unk_ov80_021D30E8[] = { static void ov80_021D2398(UnkStruct_ov80_021D2A08 *param0) { UnkStruct_ov80_021D1478 *v0 = param0->unk_34; - UnkStruct_ov7_0224F358 v1 = Unk_ov80_021D30E8[2]; + CellActorPropsTemplate v1 = Unk_ov80_021D30E8[2]; v0->unk_100 = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_D8, param0->unk_DC, &Unk_ov80_021D30E8[0]); @@ -924,9 +923,9 @@ static void ov80_021D2398(UnkStruct_ov80_021D2A08 *param0) CellActor_SetPositionXY(v0->unk_104, v0->unk_18 * 7 + (48 - 23), v0->unk_1C * 7 + (6 - 40)); if (param0->unk_2C->unk_0C == 0) { - v1.unk_10 = 1; + v1.palette = 1; } else { - v1.unk_10 = 0; + v1.palette = 0; } v0->unk_108 = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_D8, param0->unk_DC, &v1); @@ -981,7 +980,7 @@ static void ov80_021D259C(UnkStruct_ov80_021D2A08 *param0) UnkStruct_ov80_021D1744 *v2; int v3 = 0, v4, v5; static const u16 v6[4] = { 0, 2, 3, 1 }; - static const UnkStruct_ov7_0224F358 Unk_ov80_021D30E8 = { + static const CellActorPropsTemplate Unk_ov80_021D30E8 = { 3, 0, 0, 0, 0, 2, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0 }; diff --git a/src/overlay080/ov80_021D2AF4.c b/src/overlay080/ov80_021D2AF4.c index e998c378ce..f8c7748920 100644 --- a/src/overlay080/ov80_021D2AF4.c +++ b/src/overlay080/ov80_021D2AF4.c @@ -6,7 +6,6 @@ #include "struct_decls/struct_0200C6E4_decl.h" #include "struct_decls/struct_0200C704_decl.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay080/struct_ov80_021D2AF4.h" #include "overlay080/struct_ov80_021D2C1C.h" #include "overlay080/struct_ov80_021D2C5C.h" @@ -46,7 +45,7 @@ UnkStruct_ov80_021D2C1C *ov80_021D2AF4(SpriteRenderer *param0, SpriteGfxHandler UnkStruct_ov80_021D2C5C *v1; const UnkStruct_ov80_021D2C5C_sub1 *v2; short v3; - static const UnkStruct_ov7_0224F358 v4 = { + static const CellActorPropsTemplate v4 = { 4, 0, 0, 0, 0, 10, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0 }; diff --git a/src/overlay090/ov90_021D0D80.c b/src/overlay090/ov90_021D0D80.c index 7eaca16cc9..4d61b98d3a 100644 --- a/src/overlay090/ov90_021D0D80.c +++ b/src/overlay090/ov90_021D0D80.c @@ -12,7 +12,6 @@ #include "struct_defs/struct_02049A68.h" #include "struct_defs/struct_02099F80.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay090/struct_ov90_021D0D80.h" #include "overlay090/struct_ov90_021D1750.h" #include "overlay104/struct_ov104_022412F4.h" @@ -925,7 +924,7 @@ static void ov90_021D1BA4(void) static void ov90_021D1BAC(UnkStruct_ov90_021D0ECC *param0) { int v0; - static const UnkStruct_ov7_0224F358 v1[] = { + static const CellActorPropsTemplate v1[] = { { 0, 54, 68, 0, 0, 1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0 }, { 0, 204, 114, 0, 1, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0 }, { 0, 128, 52, 0, 2, 3, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0 }, diff --git a/src/sprite_renderer.c b/src/sprite_renderer.c index 8948d9e969..c6efdd4f25 100644 --- a/src/sprite_renderer.c +++ b/src/sprite_renderer.c @@ -6,7 +6,6 @@ #include "struct_defs/sprite_template.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay022/struct_ov22_022559F8.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" @@ -258,9 +257,9 @@ BOOL SpriteRenderer_LoadSpriteResourceData(SpriteRenderer *renderer, SpriteGfxHa return 1; } -CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkStruct_ov7_0224F358 *template) +CellActor *SpriteRenderer_CreateCellActorFromTemplate(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const CellActorPropsTemplate *template) { - return SpriteRenderer_CreateCellActor(renderer, gfxHandler, template->unk_00, template->unk_04, template->unk_06, template->unk_04, template->unk_0A, template->unk_0C, template->unk_10, template->unk_14, template->unk_18, template->unk_1C, template->unk_20, template->unk_24); + return SpriteRenderer_CreateCellActor(renderer, gfxHandler, template->resourceIndex, template->x, template->y, template->x, template->anim, template->priority, template->palette, template->vramType, template->unk_18, template->unk_1C, template->unk_20, template->unk_24); } CellActor *SpriteRenderer_CreateCellActor(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int resourceIndex, s16 x, s16 y, s16 z, u16 anim, int priority, int palette, int vramType, int param10, int param11, int param12, int param13) diff --git a/src/unk_020093B4.c b/src/unk_020093B4.c index 7ebcf07ab0..78cf9ac3bf 100644 --- a/src/unk_020093B4.c +++ b/src/unk_020093B4.c @@ -94,10 +94,10 @@ void sub_020094F0(CellActorResourceData *param0) memset(param0, 0, sizeof(CellActorResourceData)); } -CellActorResourceDataList *CellActorResourceDataList_FromTemplate(const SpriteTemplateTableEntry *template, int heapId, SpriteResourceCollection *tilesCollection, SpriteResourceCollection *paletteCollection, SpriteResourceCollection *cellsCollection, SpriteResourceCollection *animCollection, SpriteResourceCollection *multiCellCollection, SpriteResourceCollection *multiAnimCollection) +CellActorResourceDataList *CellActorResourceDataList_FromTemplate(const SpriteTemplateTableEntry *templateList, int heapId, SpriteResourceCollection *tilesCollection, SpriteResourceCollection *paletteCollection, SpriteResourceCollection *cellsCollection, SpriteResourceCollection *animCollection, SpriteResourceCollection *multiCellCollection, SpriteResourceCollection *multiAnimCollection) { int resourceCount = 0; - while (template[resourceCount].tileIndex != -2) { + while (templateList[resourceCount].tileIndex != -2) { resourceCount++; } @@ -108,14 +108,14 @@ CellActorResourceDataList *CellActorResourceDataList_FromTemplate(const SpriteTe for (int i = 0; i < resources->numEntries; i++) { CellActorResourceData_Init( resources->resourceDataList + i, - template[i].tileIndex, - template[i].paletteIndex, - template[i].cellsIndex, - template[i].animIndex, - template[i].multiCellsIndex, - template[i].multiAnimIndex, - template[i].vramTransfer, - template[i].priority, + templateList[i].tileIndex, + templateList[i].paletteIndex, + templateList[i].cellsIndex, + templateList[i].animIndex, + templateList[i].multiCellsIndex, + templateList[i].multiAnimIndex, + templateList[i].vramTransfer, + templateList[i].priority, tilesCollection, paletteCollection, cellsCollection, diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index 26a428c1a8..1720f0d31a 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -7,7 +7,6 @@ #include "struct_defs/struct_020831B4.h" #include "data/plist_pal.naix" -#include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_0224133C.h" @@ -79,7 +78,7 @@ void sub_02082C2C(GameWindowLayout *param0) void sub_02082CEC(GameWindowLayout *param0, u8 param1, u16 param2, u16 param3, NARC *param4) { Pokemon *v0; - UnkStruct_ov7_0224F358 v1; + CellActorPropsTemplate v1; u32 v2; v0 = Party_GetPokemonBySlotIndex(param0->unk_5A4->unk_00, param1); @@ -91,14 +90,14 @@ void sub_02082CEC(GameWindowLayout *param0, u8 param1, u16 param2, u16 param3, N v2 = Pokemon_GetValue(v0, MON_DATA_IS_EGG, NULL); - v1.unk_00 = 4 + param1; - v1.unk_04 = param2; - v1.unk_06 = param3; - v1.unk_08 = 0; - v1.unk_0A = 0; - v1.unk_0C = 0; - v1.unk_10 = PokeIconPaletteIndex(param0->unk_704[param1].unk_04, param0->unk_704[param1].unk_11, v2) + RESDAT_PLIST_PAL_NARC_19_MEMBER_0_2_OFFSET; - v1.unk_14 = NNS_G2D_VRAM_TYPE_2DMAIN; + v1.resourceIndex = 4 + param1; + v1.x = param2; + v1.y = param3; + v1.z = 0; + v1.anim = 0; + v1.priority = 0; + v1.palette = PokeIconPaletteIndex(param0->unk_704[param1].unk_04, param0->unk_704[param1].unk_11, v2) + RESDAT_PLIST_PAL_NARC_19_MEMBER_0_2_OFFSET; + v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; v1.unk_18 = 0; v1.unk_1C = 0; v1.unk_20 = 0; @@ -135,7 +134,7 @@ void sub_02082DA8(GameWindowLayout *param0, u8 param1) NARC_dtor(v1); } -static const UnkStruct_ov7_0224F358 Unk_020F20C0[] = { +static const CellActorPropsTemplate Unk_020F20C0[] = { { 0x1, 0x40, 0x18, 0x0, 0x1, 0x3, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 0x1, 0x40, 0x48, 0x0, 0x2, 0x2, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, { 0x2, 0xE8, 0xA8, 0x0, 0x2, 0x1, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, @@ -173,8 +172,8 @@ void sub_02082E58(GameWindowLayout *param0) for (v0 = 0; v0 < 6; v0++) { param0->unk_5B0[10 + v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[4 + v0]); - param0->unk_704[v0].unk_1A = Unk_020F20C0[4 + v0].unk_04; - param0->unk_704[v0].unk_1C = Unk_020F20C0[4 + v0].unk_06; + param0->unk_704[v0].unk_1A = Unk_020F20C0[4 + v0].x; + param0->unk_704[v0].unk_1C = Unk_020F20C0[4 + v0].y; CellActor_SetDrawFlag(param0->unk_5B0[10 + v0], 0); param0->unk_5B0[16 + v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[10 + v0]); param0->unk_5B0[22 + v0] = SpriteRenderer_CreateCellActorFromTemplate(param0->unk_5A8, param0->unk_5AC, &Unk_020F20C0[16 + v0]); @@ -186,16 +185,16 @@ void sub_02082E58(GameWindowLayout *param0) void sub_02082FAC(GameWindowLayout *param0, u8 param1, u16 param2, u16 param3) { - UnkStruct_ov7_0224F358 v0; - - v0.unk_00 = 0; - v0.unk_04 = param2; - v0.unk_06 = param3; - v0.unk_08 = 0; - v0.unk_0A = 0; - v0.unk_0C = 1; - v0.unk_10 = 0; - v0.unk_14 = NNS_G2D_VRAM_TYPE_2DMAIN; + CellActorPropsTemplate v0; + + v0.resourceIndex = 0; + v0.x = param2; + v0.y = param3; + v0.z = 0; + v0.anim = 0; + v0.priority = 1; + v0.palette = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; v0.unk_18 = 0; v0.unk_1C = 0; v0.unk_20 = 0; From a3b51725200389b398a2046887ed980baa32f971 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Wed, 6 Nov 2024 12:01:57 -0600 Subject: [PATCH 11/11] formatting --- include/struct_defs/struct_02095E80_t.h | 2 +- .../pokemon_summary_screen/main.c | 2 +- src/unk_020093B4.c | 28 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/struct_defs/struct_02095E80_t.h b/include/struct_defs/struct_02095E80_t.h index f31b9720ad..1fd2cd3b25 100644 --- a/include/struct_defs/struct_02095E80_t.h +++ b/include/struct_defs/struct_02095E80_t.h @@ -25,8 +25,8 @@ #include "message.h" #include "overlay_manager.h" #include "savedata.h" -#include "sprite_resource.h" #include "sprite_renderer.h" +#include "sprite_resource.h" #include "strbuf.h" #include "string_list.h" #include "string_template.h" diff --git a/src/applications/pokemon_summary_screen/main.c b/src/applications/pokemon_summary_screen/main.c index 30df92335c..ea0db2508e 100644 --- a/src/applications/pokemon_summary_screen/main.c +++ b/src/applications/pokemon_summary_screen/main.c @@ -39,6 +39,7 @@ #include "render_window.h" #include "ribbon.h" #include "savedata.h" +#include "sprite_renderer.h" #include "strbuf.h" #include "string_template.h" #include "system_flags.h" @@ -48,7 +49,6 @@ #include "unk_02006224.h" #include "unk_0200762C.h" #include "unk_0200C440.h" -#include "sprite_renderer.h" #include "unk_0200F174.h" #include "unk_02015F84.h" #include "unk_02017728.h" diff --git a/src/unk_020093B4.c b/src/unk_020093B4.c index 78cf9ac3bf..a3400b86c9 100644 --- a/src/unk_020093B4.c +++ b/src/unk_020093B4.c @@ -107,20 +107,20 @@ CellActorResourceDataList *CellActorResourceDataList_FromTemplate(const SpriteTe for (int i = 0; i < resources->numEntries; i++) { CellActorResourceData_Init( - resources->resourceDataList + i, - templateList[i].tileIndex, - templateList[i].paletteIndex, - templateList[i].cellsIndex, - templateList[i].animIndex, - templateList[i].multiCellsIndex, - templateList[i].multiAnimIndex, - templateList[i].vramTransfer, - templateList[i].priority, - tilesCollection, - paletteCollection, - cellsCollection, - animCollection, - multiCellCollection, + resources->resourceDataList + i, + templateList[i].tileIndex, + templateList[i].paletteIndex, + templateList[i].cellsIndex, + templateList[i].animIndex, + templateList[i].multiCellsIndex, + templateList[i].multiAnimIndex, + templateList[i].vramTransfer, + templateList[i].priority, + tilesCollection, + paletteCollection, + cellsCollection, + animCollection, + multiCellCollection, multiAnimCollection); }