EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
991 stars 185 forks source link

Add ExecuteCommand(com); #3106

Closed jetrotal closed 1 year ago

jetrotal commented 1 year ago

Minor Change. It's a variation of ExecuteCommand(); that accepts com as a parameter.

Ghabry commented that this would make the code faster. But, this also open possibilities to create a scripting language, since we can create com parameters from strings.


This implementation could also be used to attach code from dynRPG patches to new com stuff. Having both @comments and com commands share the same code.

Ghabry commented 1 year ago

Ghabry commented that this would make the code faster.

For context: When the event is in Game_Interpreter this will avoid fetching the command a second time via

auto& frame = GetFrame();
const auto& com = frame.commands[frame.current_command];

You can likely not measure the speedup but this code can be executed 10000s of times per second so every nanosecond counts :D.