Skip to content

Commit

Permalink
Merge pull request #281 from lhearachel/render-window
Browse files Browse the repository at this point in the history
Document render_window.c
  • Loading branch information
lhearachel authored Oct 27, 2024
2 parents b087349 + 5b1085d commit 9cf012b
Show file tree
Hide file tree
Showing 241 changed files with 3,224 additions and 1,771 deletions.
49 changes: 49 additions & 0 deletions include/render_window.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#ifndef POKEPLATINUM_RENDER_WINDOW_H
#define POKEPLATINUM_RENDER_WINDOW_H

#include "constants/heap.h"

#include "bg_window.h"
#include "pokemon.h"

#define TEXT_WINDOW_SIZE 30

enum StandardWindowType {
STANDARD_WINDOW_SYSTEM = 0,
STANDARD_WINDOW_FIELD,
STANDARD_WINDOW_UNDERGROUND,
};

enum SignpostType {
SIGNPOST_CITY_MAP = 0,
SIGNPOST_ROUTE_MAP,
SIGNPOST_BUILDING_INFO,
SIGNPOST_FIELD_INFO,
};

void LoadStandardWindowTiles(BgConfig *bgConfig, u8 bgLayer, u16 offset, u8 standardWindowType, u32 heapID);
u32 GetStandardWindowPaletteNARCMember(void);
void LoadStandardWindowGraphics(BgConfig *bgConfig, u8 bgLayer, u16 tileOffset, u8 palOffset, u8 standardWindowType, u32 heapID);
void Window_DrawStandardFrame(Window *window, u8 skipTransfer, u16 tile, u8 palette);
void Window_EraseStandardFrame(Window *window, u8 skipTransfer);

u32 GetMessageBoxTilesNARCMember(u32 messageBoxFrame);
u32 GetMessageBoxPaletteNARCMember(u32 messageBoxFrame);
void LoadMessageBoxGraphics(BgConfig *bgConfig, u8 bgLayer, u16 tileOffset, u8 palOffset, u8 messageBoxFrame, u32 heapID);
void Window_DrawMessageBox(Window *window, u32 tile, u32 palette);
void Window_DrawMessageBoxWithScrollCursor(Window *window, u8 skipTransfer, u16 tile, u8 palette);
void Window_EraseMessageBox(Window *window, u8 skipTransfer);
void ReplaceTransparentTiles(BgConfig *bgConfig, u8 bgLayer, u16 bgBaseTile, u8 withTile, u8 messageBoxFrame, u32 heapID);

void LoadSignpostContentGraphics(BgConfig *bgConfig, u8 bgLayer, u16 baseTile, u8 palette, u8 signpostType, u16 signpostNARCMemberIdx, u32 heapID);
void Window_DrawSignpost(Window *window, u8 skipTransfer, u16 baseTile, u8 palette, u8 signpostType);
void Window_EraseSignpost(Window *window, u8 signpostType, u8 skipTransfer);

void *Window_AddWaitDial(Window *window, u32 baseTile);
void DestroyWaitDial(void *taskData);
void DestroyWaitDialTaskOnly(void *taskData);

u8 *DrawPokemonPreview(BgConfig *bgConfig, u8 bgLayer, u8 x, u8 y, u8 palette, u16 baseTile, u16 species, u8 gender, enum HeapId heapID);
u8 *DrawPokemonPreviewFromStruct(BgConfig *bgConfig, u8 bgLayer, u8 x, u8 y, u8 palette, u16 baseTile, Pokemon *mon, enum HeapId heapID);

#endif // POKEPLATINUM_RENDER_WINDOW_H
30 changes: 0 additions & 30 deletions include/unk_0200DA60.h

This file was deleted.

4 changes: 2 additions & 2 deletions platinum.us/filesys.sha1
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ d5a8953a61b8589539ce7b139ab956a802adaa33 *res/prebuilt/graphic/dendou_pc.narc
2d1a354e31cdd1861bdd7aade661fb9e4dc0ae31 *res/prebuilt/graphic/ending.narc
d91ceca1e3ef5e57061dabc690c0f1a1556dc624 *res/prebuilt/graphic/ev_pokeselect.narc
5c673be62fe6bddfa911e3be26762b7e47d60b41 *res/prebuilt/graphic/f_note_gra.narc
4941a639804c2b009836d1ab9b86a2ab0bb0c436 *res/prebuilt/graphic/field_board.narc
4941a639804c2b009836d1ab9b86a2ab0bb0c436 *res/graphics/signposts/field_board.narc
3a71f8eca65f2524f96c4bb8463800ae19a70a90 *res/prebuilt/graphic/field_encounteffect.narc
e4ad5fcd9010114089a5ded83a077a75860d633a *res/prebuilt/graphic/fld_comact.narc
1122e901209b1047fbbacb1a47311c8bd529a647 *res/prebuilt/graphic/font.narc
Expand All @@ -220,7 +220,7 @@ dd0663e46347230d1d1b9eb8b583cee9acc10f31 *res/prebuilt/graphic/pl_bag_gra.narc
d397dbd087737151aa8bea242016c626afb55fa5 *res/prebuilt/graphic/pl_plist_gra.narc
883e6afb310f0ab02c26f2026cba1c76210bb3ac *res/prebuilt/graphic/pl_pst_gra.narc
c16faeeeee494830c720d1f795a141cacfe49121 *res/prebuilt/graphic/pl_wifinote.narc
298fd1d0ab31efd35cb00b977f69eacbfb8a8da8 *res/prebuilt/graphic/pl_winframe.narc
298fd1d0ab31efd35cb00b977f69eacbfb8a8da8 *res/graphics/windows/pl_winframe.narc
b9f77b38cc07a6754fc00a7c1830d86c88d45aa6 *res/prebuilt/graphic/plist_gra.narc
e6a7fe0328d168e1b4d92919fe047d2fa12daf56 *res/prebuilt/graphic/pmsi.narc
7c6a50d69659697636849cedebb0143ed0cf146a *res/prebuilt/graphic/poketch.narc
Expand Down
2 changes: 1 addition & 1 deletion platinum.us/main.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Static main
Object main.nef.p/src_unk_0200C440.c.o
Object main.nef.p/src_unk_0200C6E4.c.o
Object main.nef.p/src_sys_task.c.o
Object main.nef.p/src_unk_0200DA60.c.o
Object main.nef.p/src_render_window.c.o
Object main.nef.p/src_unk_0200F174.c.o
Object main.nef.p/src_unk_0200F85C.c.o
Object main.nef.p/src_unk_02012480.c.o
Expand Down
16 changes: 14 additions & 2 deletions platinum.us/rom.rsf
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,13 @@ RomSpec
File graphic/ending.narc
File graphic/ev_pokeselect.narc
File graphic/f_note_gra.narc
File graphic/field_board.narc

Root /graphic
HostRoot res/graphics/signposts
File field_board.narc

Root /
HostRoot res/prebuilt
File graphic/field_encounteffect.narc
File graphic/fld_comact.narc
File graphic/font.narc
Expand Down Expand Up @@ -319,7 +325,13 @@ RomSpec
File graphic/pl_plist_gra.narc
File graphic/pl_pst_gra.narc
File graphic/pl_wifinote.narc
File graphic/pl_winframe.narc

Root /graphic
HostRoot res/graphics/windows
File pl_winframe.narc

Root /
HostRoot res/prebuilt
File graphic/plist_gra.narc
File graphic/pmsi.narc
File graphic/poketch.narc
Expand Down
2 changes: 2 additions & 0 deletions res/graphics/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
subdir('signposts')
subdir('windows')
Binary file added res/graphics/signposts/city_map_canalave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_celestic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_eterna.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_fight_area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_floaroma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_hearthome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_jubilife.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_oreburgh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_pastoria.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_pokemon_league.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_resort_area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_sandgem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_snowpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_solaceon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_sunyshore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_survival_area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_twinleaf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/city_map_veilstone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions res/graphics/signposts/field_board.order
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
signpost_frame.NCGR
signpost.NCLR
route_map_00.NCGR
route_map_01.NCGR
route_map_02.NCGR
route_map_03.NCGR
route_map_04.NCGR
route_map_05.NCGR
route_map_06.NCGR
route_map_07.NCGR
route_map_08.NCGR
route_map_09.NCGR
route_map_10.NCGR
route_map_11.NCGR
route_map_12.NCGR
route_map_13.NCGR
route_map_14.NCGR
route_map_15.NCGR
route_map_16.NCGR
route_map_17.NCGR
route_map_18.NCGR
route_map_19.NCGR
route_map_20.NCGR
route_map_21.NCGR
route_map_22.NCGR
route_map_23.NCGR
route_map_24.NCGR
route_map_25.NCGR
route_map_26.NCGR
route_map_27.NCGR
route_map_28.NCGR
route_map_29.NCGR
route_map_30.NCGR
city_map_empty.NCGR
city_map_twinleaf.NCGR
city_map_sandgem.NCGR
city_map_floaroma.NCGR
city_map_solaceon.NCGR
city_map_celestic.NCGR
city_map_survival_area.NCGR
city_map_resort_area.NCGR
city_map_jubilife.NCGR
city_map_canalave.NCGR
city_map_oreburgh.NCGR
city_map_eterna.NCGR
city_map_hearthome.NCGR
city_map_pastoria.NCGR
city_map_veilstone.NCGR
city_map_sunyshore.NCGR
city_map_snowpoint.NCGR
city_map_pokemon_league.NCGR
city_map_fight_area.NCGR
92 changes: 92 additions & 0 deletions res/graphics/signposts/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
field_board_pngs = files(
'signpost_frame.png',
'route_map_00.png',
'route_map_01.png',
'route_map_02.png',
'route_map_03.png',
'route_map_04.png',
'route_map_05.png',
'route_map_06.png',
'route_map_07.png',
'route_map_08.png',
'route_map_09.png',
'route_map_10.png',
'route_map_11.png',
'route_map_12.png',
'route_map_13.png',
'route_map_14.png',
'route_map_15.png',
'route_map_16.png',
'route_map_17.png',
'route_map_18.png',
'route_map_19.png',
'route_map_20.png',
'route_map_21.png',
'route_map_22.png',
'route_map_23.png',
'route_map_24.png',
'route_map_25.png',
'route_map_26.png',
'route_map_27.png',
'route_map_28.png',
'route_map_29.png',
'route_map_30.png',
'city_map_empty.png',
'city_map_twinleaf.png',
'city_map_sandgem.png',
'city_map_floaroma.png',
'city_map_solaceon.png',
'city_map_celestic.png',
'city_map_survival_area.png',
'city_map_resort_area.png',
'city_map_jubilife.png',
'city_map_canalave.png',
'city_map_oreburgh.png',
'city_map_eterna.png',
'city_map_hearthome.png',
'city_map_pastoria.png',
'city_map_veilstone.png',
'city_map_sunyshore.png',
'city_map_snowpoint.png',
'city_map_pokemon_league.png',
'city_map_fight_area.png',
)

field_board_pals = files('signpost.pal')

field_board_ncgrs = ncgr_gen.process(field_board_pngs,
extra_args: [
'-sopc',
'-version101',
]
)

field_board_nclrs = nclr_gen.process(field_board_pals,
extra_args: [
'-bitdepth', '4',
]
)

field_board_order = files('field_board.order')

field_board_narc = custom_target('field_board.narc',
output: [
'field_board.narc',
'field_board.naix',
],
input: [
field_board_ncgrs,
field_board_nclrs,
field_board_order,
],
command: [
knarc_exe,
'-d', '@PRIVATE_DIR@',
'-p', '@OUTPUT0@',
'--order', field_board_order,
'--naix',
]
)

nitrofs_files += field_board_narc[0]
naix_headers += field_board_narc[1]
Binary file added res/graphics/signposts/route_map_00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/route_map_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/route_map_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/route_map_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/route_map_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/route_map_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/signposts/route_map_06.png
Binary file added res/graphics/signposts/route_map_07.png
Binary file added res/graphics/signposts/route_map_08.png
Binary file added res/graphics/signposts/route_map_09.png
Binary file added res/graphics/signposts/route_map_10.png
Binary file added res/graphics/signposts/route_map_11.png
Binary file added res/graphics/signposts/route_map_12.png
Binary file added res/graphics/signposts/route_map_13.png
Binary file added res/graphics/signposts/route_map_14.png
Binary file added res/graphics/signposts/route_map_15.png
Binary file added res/graphics/signposts/route_map_16.png
Binary file added res/graphics/signposts/route_map_17.png
Binary file added res/graphics/signposts/route_map_18.png
Binary file added res/graphics/signposts/route_map_19.png
Binary file added res/graphics/signposts/route_map_20.png
Binary file added res/graphics/signposts/route_map_21.png
Binary file added res/graphics/signposts/route_map_22.png
Binary file added res/graphics/signposts/route_map_23.png
Binary file added res/graphics/signposts/route_map_24.png
Binary file added res/graphics/signposts/route_map_25.png
Binary file added res/graphics/signposts/route_map_26.png
Binary file added res/graphics/signposts/route_map_27.png
Binary file added res/graphics/signposts/route_map_28.png
Binary file added res/graphics/signposts/route_map_29.png
Binary file added res/graphics/signposts/route_map_30.png
Loading

0 comments on commit 9cf012b

Please sign in to comment.