Rename window fields

This commit is contained in:
jeffman 2019-01-28 22:48:07 -05:00
parent 570bc7ab93
commit e4f11c207b
3 changed files with 19 additions and 14 deletions

View File

@ -41,7 +41,7 @@ int goods_outer_process(WINDOW* window)
PAD_STATE state = *pad_state;
MOVED moved = DIRECTION_NONE;
if (!window->flags_unknown2)
if (!window->hold)
{
if (state.right)
{
@ -101,7 +101,7 @@ int goods_outer_process(WINDOW* window)
{
current_items = (*pc_stats)[current_pc].goods;
window->unknown7 = 0;
window->cursor_x = window->page;
window->cursor_x = window->cursor_x_base;
window->cursor_y = 0;
window->unknown6 = 0;
window->unknown6a = 0;
@ -134,11 +134,11 @@ int goods_outer_process(WINDOW* window)
}
}
window->flags_unknown2 = true;
window->hold = true;
}
else
{
window->flags_unknown2 = false;
window->hold = false;
}
// Check if we're exiting

View File

@ -438,7 +438,7 @@ int print_menu_string(WINDOW* window)
// If we're calling SET the second time, update the
// window cursor delta to be the difference between
// the two set values
window->cursor_delta = (set_value - first_set_value) >> 3;
window->cursor_x_delta = (set_value - first_set_value) >> 3;
}
break;
@ -545,7 +545,7 @@ void print_number_menu(WINDOW* window, int style)
x += 8;
// Print the zeroes (0x60)
for (int i = 0; i < window->cursor_delta; i++)
for (int i = 0; i < window->cursor_x_delta; i++)
{
print_character(decode_character(0x60), x, y);
x += 8;
@ -562,7 +562,7 @@ void print_number_menu(WINDOW* window, int style)
void print_number_menu_current(byte digit, WINDOW* window)
{
// Skip the 4 blank tiles
int x = (window->window_x + (window->cursor_delta - window->cursor_x) + 4) << 3;
int x = (window->window_x + (window->cursor_x_delta - window->cursor_x) + 4) << 3;
// Skip the first two text rows
int y = (window->window_y + 4) << 3;

View File

@ -2,11 +2,16 @@
typedef struct WINDOW {
// 0x00
bool enable : 1; // 0x0001
unsigned int flags_unknown1 : 3; // 0x000E
bool flags_unknown2 : 1; // 0x0010
bool redraw : 1; // 0x0020
unsigned int flags_unknown3 : 10; // 0xFFC0
bool enable : 1; // 0x0001 Indicates that the window is enabled.
unsigned int flags_unknown1 : 3; // 0x000E
bool hold : 1; // 0x0010 Indicates that a button is still being held from a previous frame.
bool redraw : 1; // 0x0020 Indicates that the window border should be redrawn.
unsigned int flags_unknown3a : 5; // 0x07C0
bool first : 1; // 0x0800 Set immediately after the window is initialized and drawn.
// Typically checked and cleared on the first frame of the window loop.
// Might not be used for all windows.
// Definitely used for the goods *inner* window loop, but not the outer loop.
unsigned int flags_unknown3b : 4; // 0xF000
byte pixel_x;
bool vwf_skip : 1;
unsigned int vwf_unused : 7;
@ -41,8 +46,8 @@ typedef struct WINDOW {
unsigned short unknown7a;
// 0x40
unsigned short page;
unsigned short cursor_delta;
unsigned short cursor_x_base;
unsigned short cursor_x_delta;
int unknown9;
int unknown10;
int unknown11;