mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-14 11:54:39 +00:00
assert
macro OK (#755)
* create assert macro and replace a bunch of __assert Signed-off-by: angie <angheloalf95@gmail.com> * Another bunch of assert Signed-off-by: angie <angheloalf95@gmail.com> * more assert Signed-off-by: angie <angheloalf95@gmail.com> * assert(false) Signed-off-by: angie <angheloalf95@gmail.com> * last assert used in matching code Signed-off-by: angie <angheloalf95@gmail.com> * the non-matchings Signed-off-by: angie <angheloalf95@gmail.com> * typo Signed-off-by: angie <angheloalf95@gmail.com> * format Signed-off-by: angie <angheloalf95@gmail.com> * change macro to uppercase Signed-off-by: angie <angheloalf95@gmail.com> * Apply suggestions from code review Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Change ASSERT(false) to ASSERT(0) Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
parent
0b8252cfe9
commit
98aef8988a
44 changed files with 148 additions and 301 deletions
|
@ -121,9 +121,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
|||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start);
|
||||
spA4 = spB8;
|
||||
|
||||
if (polygon2->num > SHAPE_SORT_MAX) {
|
||||
__assert("polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
|
||||
}
|
||||
ASSERT(polygon2->num <= SHAPE_SORT_MAX, "polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
|
||||
sp78 = polygonDlist;
|
||||
|
||||
for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) {
|
||||
|
@ -565,9 +563,7 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
|
|||
roomCtx->curRoom.segment = NULL;
|
||||
roomCtx->status = 1;
|
||||
|
||||
if (roomNum >= globalCtx->nbRooms) {
|
||||
__assert("read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
|
||||
}
|
||||
ASSERT(roomNum < globalCtx->nbRooms, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
|
||||
|
||||
size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart;
|
||||
roomCtx->unk_34 = (void*)ALIGN16((s32)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
|
||||
|
@ -608,9 +604,8 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
|||
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
if (room->segment != NULL) {
|
||||
gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
|
||||
if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers)) {
|
||||
__assert("this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
|
||||
}
|
||||
ASSERT(room->mesh->polygon.type < ARRAY_COUNTU(sRoomDrawHandlers),
|
||||
"this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
|
||||
sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue