From f293947ac3ae1b06442c0af5f8e29a7490a161fb Mon Sep 17 00:00:00 2001 From: Louis <35883445+louist103@users.noreply.github.com> Date: Thu, 21 Jan 2021 20:52:24 -0500 Subject: [PATCH 1/3] first push --- src/gz/gz_debug.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gz/gz_debug.c b/src/gz/gz_debug.c index e631d5f1..7b991cef 100644 --- a/src/gz/gz_debug.c +++ b/src/gz/gz_debug.c @@ -454,6 +454,19 @@ static void goto_actor_proc(struct menu_item *item, void *data) } } +static void bring_to_link(struct menu_item* item, void * data) +{ + struct actor_debug_info *adi = data; + if (adi->index < z64_game.actor_list[adi->type].length) { + z64_actor_t *actor = z64_game.actor_list[adi->type].first; + for (int i = 0; i < adi->index; ++i) + actor = actor->next; + actor->pos_2 = z64_link.common.pos_1; + } + +} + + static void toggle_cullzone_proc(struct menu_item *item, void *data) { if (gz.cull_view_state != CULLVIEW_INACTIVE && @@ -607,6 +620,7 @@ struct menu *gz_debug_menu(void) adi.edit_item = item; menu_add_button(&actors, 0, 5, "kill", &kill_actor_proc, &adi); menu_add_button(&actors, 10, 5, "go to", &goto_actor_proc, &adi); + menu_add_button(&actors, 11, 11, "bring to link", &bring_to_link, &adi); menu_add_button(&actors, 17, 5, "cull zone", &toggle_cullzone_proc, &adi); /* actor spawn controls */ static struct actor_spawn_info asi; From 5ff68d3838ad46ee262ff4a24b99792f558fa627 Mon Sep 17 00:00:00 2001 From: Louis <35883445+louist103@users.noreply.github.com> Date: Thu, 21 Jan 2021 21:04:50 -0500 Subject: [PATCH 2/3] Format fix --- src/gz/gz_debug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gz/gz_debug.c b/src/gz/gz_debug.c index 7b991cef..e5596ee3 100644 --- a/src/gz/gz_debug.c +++ b/src/gz/gz_debug.c @@ -463,10 +463,8 @@ static void bring_to_link(struct menu_item* item, void * data) actor = actor->next; actor->pos_2 = z64_link.common.pos_1; } - } - static void toggle_cullzone_proc(struct menu_item *item, void *data) { if (gz.cull_view_state != CULLVIEW_INACTIVE && From 3d8ddcc231db0317c49ebf30bf36dd790d6c11ab Mon Sep 17 00:00:00 2001 From: Louis <35883445+louist103@users.noreply.github.com> Date: Thu, 21 Jan 2021 21:25:01 -0500 Subject: [PATCH 3/3] Move the location of a button and remove an unneeded stuct copy in goto --- src/gz/gz_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gz/gz_debug.c b/src/gz/gz_debug.c index e5596ee3..e5f016b9 100644 --- a/src/gz/gz_debug.c +++ b/src/gz/gz_debug.c @@ -449,7 +449,7 @@ static void goto_actor_proc(struct menu_item *item, void *data) z64_actor_t *actor = z64_game.actor_list[adi->type].first; for (int i = 0; i < adi->index; ++i) actor = actor->next; - z64_link.common.pos_1 = actor->pos_2; + //z64_link.common.pos_1 = actor->pos_2; z64_link.common.pos_2 = actor->pos_2; } } @@ -461,7 +461,7 @@ static void bring_to_link(struct menu_item* item, void * data) z64_actor_t *actor = z64_game.actor_list[adi->type].first; for (int i = 0; i < adi->index; ++i) actor = actor->next; - actor->pos_2 = z64_link.common.pos_1; + actor->pos_2 = z64_link.common.pos_2; } } @@ -618,7 +618,7 @@ struct menu *gz_debug_menu(void) adi.edit_item = item; menu_add_button(&actors, 0, 5, "kill", &kill_actor_proc, &adi); menu_add_button(&actors, 10, 5, "go to", &goto_actor_proc, &adi); - menu_add_button(&actors, 11, 11, "bring to link", &bring_to_link, &adi); + menu_add_button(&actors, 10, 12, "bring to link", &bring_to_link, &adi); menu_add_button(&actors, 17, 5, "cull zone", &toggle_cullzone_proc, &adi); /* actor spawn controls */ static struct actor_spawn_info asi;