Rename function parameters and use ROTATION_COUNT enum (#39)

This commit is contained in:
Jan Šimek 2022-06-10 08:23:43 +02:00 committed by GitHub
parent e35594040d
commit f510545bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 16 deletions

View File

@ -1454,7 +1454,7 @@ int _pick_fall(Object* obj, int anim)
}
}
} else if (anim == ANIM_FALL_BACK) {
rotation = (obj->rotation + 3) % 6u;
rotation = (obj->rotation + 3) % ROTATION_COUNT;
for (i = 1; i < 3; i++) {
tile_num = tileGetTileInDirection(obj->tile, rotation, i);
if (_obj_blocking_at(obj, tile_num, obj->elevation) != NULL) {

View File

@ -1870,12 +1870,12 @@ int animateMoveObjectToObject(Object* from, Object* to, int a3, int anim, int an
int v13;
STRUCT_530014* ptr;
int hidden = (to->flags & OBJECT_HIDDEN);
bool hidden = (to->flags & OBJECT_HIDDEN);
to->flags |= OBJECT_HIDDEN;
v10 = _anim_move(from, to->tile, to->elevation, -1, anim, 0, animationSequenceIndex);
if (hidden == 0) {
if (!hidden) {
to->flags &= ~OBJECT_HIDDEN;
}

View File

@ -257,15 +257,15 @@ int _idist(int a1, int a2, int a3, int a4);
int _tile_idistance(int tile1, int tile2);
int _make_straight_path(Object* a1, int from, int to, STRUCT_530014_28* pathNodes, Object** a5, int a6);
int _make_straight_path_func(Object* a1, int from, int to, STRUCT_530014_28* a4, Object** a5, int a6, Object* (*a7)(Object*, int, int));
int animateMoveObjectToObject(Object* from, Object* to, int a3, int a4, int a5);
int animateMoveObjectToTile(Object* obj, int tile_num, int elev, int a4, int a5, int a6);
int _anim_move(Object* obj, int tile, int elev, int a3, int a4, int a5, int animationSequenceIndex);
int _anim_move_straight_to_tile(Object* obj, int a2, int a3, int fid, int a5, int a6);
int _anim_move_on_stairs(Object* obj, int a2, int a3, int fid, int a5);
int _check_for_falling(Object* obj, int a2, int a3);
int animateMoveObjectToObject(Object* from, Object* to, int a3, int anim, int animationSequenceIndex);
int animateMoveObjectToTile(Object* obj, int tile_num, int elev, int a4, int anim, int animationSequenceIndex);
int _anim_move(Object* obj, int tile, int elev, int a3, int anim, int a5, int animationSequenceIndex);
int _anim_move_straight_to_tile(Object* obj, int tile, int elevation, int anim, int animationSequenceIndex, int flags);
int _anim_move_on_stairs(Object* obj, int tile, int elevation, int anim, int animationSequenceIndex);
int _check_for_falling(Object* obj, int anim, int a3);
void _object_move(int index);
void _object_straight_move(int a1);
int _anim_animate(Object* obj, int a2, int a3, int a4);
void _object_straight_move(int index);
int _anim_animate(Object* obj, int anim, int animationSequenceIndex, int flags);
void _object_animate();
void _object_anim_compact();
int _check_move(int* a1);
@ -274,8 +274,8 @@ int _dude_run(int a1);
void _dude_fidget();
void _dude_stand(Object* obj, int rotation, int fid);
void _dude_standup(Object* a1);
int actionRotate(Object* obj, int a2, int a3);
int _anim_change_fid(Object* obj, int a2, int fid);
int actionRotate(Object* obj, int delta, int animationSequenceIndex);
int _anim_change_fid(Object* obj, int animationSequenceIndex, int fid);
void _anim_stop();
int _check_gravity(int tile, int elevation);
unsigned int _compute_tpf(Object* object, int fid);

View File

@ -3438,11 +3438,11 @@ void _obj_light_table_init()
{
for (int s = 0; s < 2; s++) {
int v4 = gCenterTile + s;
for (int i = 0; i < 6; i++) {
for (int i = 0; i < ROTATION_COUNT; i++) {
int v15 = 8;
int* p = _light_offsets[v4 & 1][i];
for (int j = 0; j < 8; j++) {
int tile = tileGetTileInDirection(v4, (i + 1) % 6, j);
int tile = tileGetTileInDirection(v4, (i + 1) % ROTATION_COUNT, j);
for (int m = 0; m < v15; m++) {
*p++ = tileGetTileInDirection(tile, i, m + 1) - v4;

View File

@ -2198,7 +2198,7 @@ int _objPMAttemptPlacement(Object* obj, int tile, int elevation)
for (int v4 = 1; v4 <= 100; v4++) {
// TODO: Check.
v7++;
v9 = tileGetTileInDirection(v9, v7 % 6, 1);
v9 = tileGetTileInDirection(v9, v7 % ROTATION_COUNT, 1);
if (_wmEvalTileNumForPlacement(v9) != 0) {
break;
}