-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add SFall arrays and patry_member_list opcodes #269
Conversation
Hey, I've updated some of your code. Please review and if you're ok with this, let's move on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, ok, looks good for me!
PS: I prefer to throw if something unexpected happens, for example unexpected enum value inside switch statement. It is better to identify error earlier that later. On the other hand a smart compiler should warn if switch statement did not check all enum values, is not it?
ProgramValue GetArrayKey(ArrayId arrayId, int index, Program* program) | ||
{ | ||
auto arr = get_array_by_id(arrayId); | ||
if (arr == nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know build-in pointer-to-bool conversion works exactly this way. Just a matter of style
} | ||
} | ||
|
||
std::vector<KeyValuePair> pairs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL no map
for assoc arrays. I think it is fine if we know that arrays are usually small (for example less than 100 or 1000 items). Anyway I do not see any problem here
Adds many functions towards #200 |
I don't think the original Olympus uses any of advanced sfall features (you probably tested on of those "fixed" versions)? Anyway, great to see we are one step closer to sfall compatibility. Next step: global scripts. |
This PR adds support for SFall arrays. Opcodes:
Tested using this script https://gist.github.com/phobos2077/6bf357c49caaf515371a13f9a2d74a41 (except loading and saving which are not implemented in this PR)
Need review regarding C++ related stuff
Related to #29