Skip to content

Add room_goto_next and room_goto_previous #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/interpreter/library/fn_room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ void ogm::interpreter::fn::room_goto(VO out, V rm)
frame.m_data.m_room_goto_queued = room_index;
}

void ogm::interpreter::fn::room_goto_next(VO out)
{
frame.m_data.m_room_goto_queued = frame.m_data.m_room_index + 1;
}

void ogm::interpreter::fn::room_goto_previous(VO out)
{
frame.m_data.m_room_goto_queued = frame.m_data.m_room_index - 1;
}

void ogm::interpreter::fn::getv::room_first(VO out)
{
asset_index_t asset_index = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/interpreter/library/fn_room.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FNDEF1(room_goto, rm)
FNDEF0(room_goto_next)
FNDEF0(room_goto_previous)
GETVAR(room_first)
GETVAR(room_last)
VAR(room)
Expand Down
4 changes: 1 addition & 3 deletions src/interpreter/library/todo/resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ IGNORE_WARN(room_assign)
IGNORE_WARN(room_get_camera)
IGNORE_WARN(room_get_name)
IGNORE_WARN(room_get_viewport)
IGNORE_WARN(room_goto_next)
IGNORE_WARN(room_goto_previous)
IGNORE_WARN(room_last)
IGNORE_WARN(room_next)
IGNORE_WARN(room_persistent)
Expand Down Expand Up @@ -145,4 +143,4 @@ IGNORE_WARN(background_vtiled)
IGNORE_WARN(background_xscale)
IGNORE_WARN(background_yscale)
IGNORE_WARN(background_blend)
IGNORE_WARN(background_assign)
IGNORE_WARN(background_assign)