Mercurial > touhou
diff src/th06/ecl.rs @ 696:7ae576a418ff
ecl_vm: implement Call, Return, and the call stack thingy.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 23 Aug 2019 02:31:08 +0200 |
parents | aefe5b5f481e |
children | 81232dac8136 |
line wrap: on
line diff
--- a/src/th06/ecl.rs +++ b/src/th06/ecl.rs @@ -58,6 +58,18 @@ pub struct CallSub { pub instr: SubInstruction, } +impl CallSub { + /// Create a new instruction call. + pub fn new(time: i32, rank_mask: Rank, instr: SubInstruction) -> CallSub { + CallSub { + time, + rank_mask, + param_mask: 0, + instr, + } + } +} + /// Script driving an animation. #[derive(Debug, Clone)] pub struct Sub {