2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
void CutsceneFlags_UnsetAll(PlayState* play) {
|
2020-05-01 02:00:39 +00:00
|
|
|
u8 i;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
for (i = 0; i < ARRAY_COUNT(play->cutsceneFlags); i++) {
|
|
|
|
play->cutsceneFlags[i] = 0;
|
2020-05-01 02:00:39 +00:00
|
|
|
}
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
void CutsceneFlags_Set(PlayState* play, s16 flag) {
|
2020-05-01 02:00:39 +00:00
|
|
|
s16 index = flag / 16;
|
|
|
|
s16 bit = flag % 16;
|
|
|
|
s16 mask = 1 << bit;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
play->cutsceneFlags[index] |= mask;
|
2020-05-01 02:00:39 +00:00
|
|
|
}
|
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
void CutsceneFlags_Unset(PlayState* play, s16 flag) {
|
2020-05-01 02:00:39 +00:00
|
|
|
s16 index = flag / 16;
|
|
|
|
s16 bit = flag % 16;
|
|
|
|
s16 mask = (1 << bit) ^ 0xFFFF;
|
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
play->cutsceneFlags[index] &= mask;
|
2020-05-01 02:00:39 +00:00
|
|
|
}
|
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
s32 CutsceneFlags_Get(PlayState* play, s16 flag) {
|
2020-05-01 02:00:39 +00:00
|
|
|
s16 index = flag / 16;
|
|
|
|
s16 bit = flag % 16;
|
|
|
|
s16 mask = 1 << bit;
|
|
|
|
|
2022-12-24 18:55:17 +00:00
|
|
|
return play->cutsceneFlags[index] & mask;
|
2020-05-01 02:00:39 +00:00
|
|
|
}
|