Convert oBehParams to be unsigned, and fix GLOBAL_STAR_IDS to support more than 128 stars (#503)

This commit is contained in:
Gregory Heskett
2022-10-04 23:56:10 -04:00
committed by GitHub
parent 68f09d34ea
commit 6291c77a18
4 changed files with 9 additions and 5 deletions

View File

@@ -153,7 +153,7 @@
#define /*0x17C*/ oOpacity OBJECT_FIELD_S32(0x3D)
#define /*0x180*/ oDamageOrCoinValue OBJECT_FIELD_S32(0x3E)
#define /*0x184*/ oHealth OBJECT_FIELD_S32(0x3F)
#define /*0x188*/ oBehParams OBJECT_FIELD_S32(0x40)
#define /*0x188*/ oBehParams OBJECT_FIELD_U32(0x40)
#define /*0x18C*/ oPrevAction OBJECT_FIELD_S32(0x41)
#define /*0x190*/ oInteractionSubtype OBJECT_FIELD_U32(0x42)
#define /*0x194*/ oCollisionDistance OBJECT_FIELD_F32(0x43)
@@ -606,7 +606,7 @@
#define /*0x110*/ oIsFloomba OBJECT_FIELD_S32(0x22)
#ifdef INTRO_FLOOMBAS
#define /*0x1AC*/ oZoomCounter OBJECT_FIELD_S32(0x49)
#define /*0x1AC*/ oZoomCounter OBJECT_FIELD_U32(0x49)
#define /*0x1B0*/ oZoomPosZ OBJECT_FIELD_F32(0x4A)
#endif
#endif

View File

@@ -155,7 +155,7 @@ void bhv_snowmans_bottom_loop(void) {
void bhv_snowmans_head_init(void) {
u8 starFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum));
s8 behParams = GET_BPARAM1(o->oBehParams);
u8 behParams = GET_BPARAM1(o->oBehParams);
cur_obj_scale(0.7f);

View File

@@ -16,8 +16,12 @@ void bhv_spawned_star_init(void) {
if (!(o->oInteractionSubtype & INT_SUBTYPE_NO_EXIT)) {
o->oBehParams = o->parentObj->oBehParams;
}
s32 param = GET_BPARAM1(o->oBehParams);
u8 param = GET_BPARAM1(o->oBehParams);
#ifdef GLOBAL_STAR_IDS
if ((1 << (param % 7)) & save_file_get_star_flags((gCurrSaveFileNum - 1), COURSE_NUM_TO_INDEX(param / 7))) {
#else
if ((1 << param) & save_file_get_star_flags((gCurrSaveFileNum - 1), COURSE_NUM_TO_INDEX(gCurrCourseNum))) {
#endif
cur_obj_set_model(MODEL_TRANSPARENT_STAR);
}

View File

@@ -13,7 +13,7 @@ static struct ObjectHitbox sCollectStarHitbox = {
};
void bhv_collect_star_init(void) {
s8 starId = GET_BPARAM1(o->oBehParams);
u8 starId = GET_BPARAM1(o->oBehParams);
#ifdef GLOBAL_STAR_IDS
u8 currentLevelStarFlags = save_file_get_star_flags((gCurrSaveFileNum - 1), COURSE_NUM_TO_INDEX(starId / 7));
if (currentLevelStarFlags & (1 << (starId % 7))) {