Rename object flags according to Sfall (#37)

This commit is contained in:
Jan Šimek 2022-06-08 19:38:46 +02:00 committed by GitHub
parent 9cad93c764
commit e27f72f52b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 104 additions and 104 deletions

View File

@ -1725,7 +1725,7 @@ int _compute_explosion_damage(int min, int max, Object* a3, int* a4)
}
if (a4 != NULL) {
if ((a3->flags & OBJECT_FLAG_0x800) == 0) {
if ((a3->flags & OBJECT_MULTIHEX) == 0) {
*a4 = v7 / 10;
}
}
@ -1892,7 +1892,7 @@ int _compute_dmg_damage(int min, int max, Object* obj, int* a4, int damageType)
}
if (a4 != NULL) {
if ((obj->flags & OBJECT_FLAG_0x800) == 0 && damageType != DAMAGE_TYPE_ELECTRICAL) {
if ((obj->flags & OBJECT_MULTIHEX) == 0 && damageType != DAMAGE_TYPE_ELECTRICAL) {
*a4 = v10 / 10;
}
}

View File

@ -1682,7 +1682,7 @@ int _make_straight_path_func(Object* a1, int from, int to, STRUCT_530014_28* a4,
if (a5 != NULL) {
Object* v11 = a7(a1, from, a1->elevation);
if (v11 != NULL) {
if (v11 != *a5 && (a6 != 32 || (v11->flags & OBJECT_FLAG_0x80000000) == 0)) {
if (v11 != *a5 && (a6 != 32 || (v11->flags & OBJECT_SHOOT_THRU) == 0)) {
*a5 = v11;
return 0;
}
@ -1774,7 +1774,7 @@ int _make_straight_path_func(Object* a1, int from, int to, STRUCT_530014_28* a4,
if (a5 != NULL) {
Object* obj = a7(a1, tile, a1->elevation);
if (obj != NULL) {
if (obj != *a5 && (a6 != 32 || (obj->flags & OBJECT_FLAG_0x80000000) == 0)) {
if (obj != *a5 && (a6 != 32 || (obj->flags & OBJECT_SHOOT_THRU) == 0)) {
*a5 = obj;
break;
}
@ -1827,7 +1827,7 @@ int _make_straight_path_func(Object* a1, int from, int to, STRUCT_530014_28* a4,
if (a5 != NULL) {
Object* obj = a7(a1, tile, a1->elevation);
if (obj != NULL) {
if (obj != *a5 && (a6 != 32 || (obj->flags & OBJECT_FLAG_0x80000000) == 0)) {
if (obj != *a5 && (a6 != 32 || (obj->flags & OBJECT_SHOOT_THRU) == 0)) {
*a5 = obj;
break;
}
@ -1864,19 +1864,19 @@ int _make_straight_path_func(Object* a1, int from, int to, STRUCT_530014_28* a4,
}
// 0x4167F8
int animateMoveObjectToObject(Object* a1, Object* a2, int a3, int anim, int animationSequenceIndex)
int animateMoveObjectToObject(Object* from, Object* to, int a3, int anim, int animationSequenceIndex)
{
int v10;
int v13;
STRUCT_530014* ptr;
int hidden = (a2->flags & OBJECT_HIDDEN);
a2->flags |= OBJECT_HIDDEN;
int hidden = (to->flags & OBJECT_HIDDEN);
to->flags |= OBJECT_HIDDEN;
v10 = _anim_move(a1, a2->tile, a2->elevation, -1, anim, 0, animationSequenceIndex);
v10 = _anim_move(from, to->tile, to->elevation, -1, anim, 0, animationSequenceIndex);
if (hidden == 0) {
a2->flags &= ~OBJECT_HIDDEN;
to->flags &= ~OBJECT_HIDDEN;
}
if (v10 == -1) {
@ -1884,7 +1884,7 @@ int animateMoveObjectToObject(Object* a1, Object* a2, int a3, int anim, int anim
}
ptr = &(_sad[v10]);
v13 = (((a1->flags & OBJECT_FLAG_0x800) != 0) + 1); // TODO: What the hell is this?
v13 = (((from->flags & OBJECT_MULTIHEX) != 0) + 1); // TODO: What the hell is this?
ptr->field_1C -= v13;
if (ptr->field_1C <= 0) {
ptr->field_20 = -1000;
@ -1892,7 +1892,7 @@ int animateMoveObjectToObject(Object* a1, Object* a2, int a3, int anim, int anim
}
if (v13) {
ptr->field_24 = tileGetTileInDirection(a2->tile, ptr->field_24 + v13 + ptr->field_1C + 3, 1);
ptr->field_24 = tileGetTileInDirection(to->tile, ptr->field_24 + v13 + ptr->field_1C + 3, 1);
}
if (v13 == 2) {

View File

@ -257,7 +257,7 @@ 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* a1, Object* a2, int a3, int a4, int a5);
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);

View File

@ -458,7 +458,7 @@ void automapRenderInMapWindow(int window, int elevation, unsigned char* backgrou
&& (object->data.critter.combat.results & DAM_DEAD) == 0) {
objectColor = _colorTable[31744];
} else {
if ((object->flags & OBJECT_FLAG_0x40000000) == 0) {
if ((object->flags & OBJECT_SEEN) == 0) {
continue;
}
@ -1011,7 +1011,7 @@ void _decode_map_data(int elevation)
Object* object = objectFindFirstAtElevation(elevation);
while (object != NULL) {
if (object->tile != -1 && (object->flags & OBJECT_FLAG_0x40000000) != 0) {
if (object->tile != -1 && (object->flags & OBJECT_SEEN) != 0) {
int contentType;
int objectType = (object->fid & 0xF000000) >> 24;

View File

@ -2542,7 +2542,7 @@ void _combat_update_critter_outline_for_los(Object* critter, bool a2)
} else {
int v7 = objectGetDistanceBetween(gDude, critter);
int v8 = critterGetStat(gDude, STAT_PERCEPTION) * 5;
if ((critter->flags & OBJECT_FLAG_0x20000) != 0) {
if ((critter->flags & OBJECT_TRANS_GLASS) != 0) {
v8 /= 2;
}
@ -3382,7 +3382,7 @@ bool _check_ranged_miss(Attack* attack)
while (curr != to) {
_make_straight_path_func(attack->attacker, curr, to, NULL, &critter, 32, _obj_shoot_blocking_at);
if (critter != NULL) {
if ((critter->flags & OBJECT_FLAG_0x80000000) == 0) {
if ((critter->flags & OBJECT_SHOOT_THRU) == 0) {
if ((critter->fid & 0xF000000) >> 24 != OBJ_TYPE_CRITTER) {
roll = ROLL_SUCCESS;
break;
@ -3412,7 +3412,7 @@ bool _check_ranged_miss(Attack* attack)
attack->defenderHitLocation = HIT_LOCATION_TORSO;
if (roll < ROLL_SUCCESS || critter == NULL || (critter->flags & OBJECT_FLAG_0x80000000) == 0) {
if (roll < ROLL_SUCCESS || critter == NULL || (critter->flags & OBJECT_SHOOT_THRU) == 0) {
return false;
}
@ -3747,7 +3747,7 @@ int attackCompute(Attack* attack)
v25 = _obj_blocking_at(NULL, attack->tile, attack->defender->elevation);
}
if (v25 != NULL && (v25->flags & OBJECT_FLAG_0x80000000) == 0) {
if (v25 != NULL && (v25->flags & OBJECT_SHOOT_THRU) == 0) {
attack->attackerFlags |= DAM_HIT;
attack->defender = v25;
attackComputeDamage(attack, 1, 2);
@ -3834,7 +3834,7 @@ void _compute_explosion_on_extras(Attack* attack, int a2, int a3, int a4)
if (v11 != NULL
&& (v11->fid & 0xF000000) >> 24 == OBJ_TYPE_CRITTER
&& (v11->data.critter.combat.results & DAM_DEAD) == 0
&& (v11->flags & OBJECT_FLAG_0x80000000) == 0
&& (v11->flags & OBJECT_SHOOT_THRU) == 0
&& !_combat_is_shot_blocked(v11, v11->tile, tile, NULL, NULL)) {
if (v11 == attack->attacker) {
attack->attackerFlags &= ~DAM_HIT;
@ -4224,7 +4224,7 @@ int attackDetermineToHit(Object* attacker, int tile, Object* defender, int hitLo
accuracy += _hit_location_penalty[hitLocation] / 2;
}
if (defender != NULL && (defender->flags & OBJECT_FLAG_0x800) != 0) {
if (defender != NULL && (defender->flags & OBJECT_MULTIHEX) != 0) {
accuracy += 15;
}
@ -4406,7 +4406,7 @@ void attackComputeDamage(Attack* attack, int ammoQuantity, int a3)
}
if (knockbackDistancePtr != NULL
&& (critter->flags & OBJECT_FLAG_0x800) == 0
&& (critter->flags & OBJECT_MULTIHEX) == 0
&& (damageType == DAMAGE_TYPE_EXPLOSION || attack->weapon == NULL || weaponGetAttackTypeForHitMode(attack->weapon, attack->hitMode) == ATTACK_TYPE_MELEE)
&& (critter->pid >> 24) == OBJ_TYPE_CRITTER
&& _critter_flag_check(critter->pid, 0x4000) == 0) {
@ -5686,7 +5686,7 @@ bool _combat_is_shot_blocked(Object* a1, int from, int to, Object* a4, int* a5)
if ((obstacle->data.critter.combat.results & (DAM_DEAD | DAM_KNOCKED_DOWN | DAM_KNOCKED_OUT)) == 0) {
*a5 += 1;
if ((obstacle->flags & OBJECT_FLAG_0x800) != 0) {
if ((obstacle->flags & OBJECT_MULTIHEX) != 0) {
*a5 += 1;
}
}
@ -5694,7 +5694,7 @@ bool _combat_is_shot_blocked(Object* a1, int from, int to, Object* a4, int* a5)
}
}
if ((obstacle->flags & OBJECT_FLAG_0x800) != 0) {
if ((obstacle->flags & OBJECT_MULTIHEX) != 0) {
int rotation = tileGetRotationTo(current, to);
current = tileGetTileInDirection(current, rotation, 1);
} else {

View File

@ -2143,13 +2143,13 @@ int _ai_move_steps_closer(Object* a1, Object* a2, int actionPoints, int a4)
}
if (actionPoints >= critterGetStat(a1, STAT_MAXIMUM_ACTION_POINTS) / 2 && artCritterFidShouldRun(a1->fid)) {
if ((a2->flags & OBJECT_FLAG_0x800) != 0) {
if ((a2->flags & OBJECT_MULTIHEX) != 0) {
reg_anim_obj_run_to_obj(a1, a2, actionPoints, 0);
} else {
reg_anim_obj_run_to_tile(a1, tile, a1->elevation, actionPoints, 0);
}
} else {
if ((a2->flags & OBJECT_FLAG_0x800) != 0) {
if ((a2->flags & OBJECT_MULTIHEX) != 0) {
reg_anim_obj_move_to_obj(a1, a2, actionPoints, 0);
} else {
reg_anim_obj_move_to_tile(a1, tile, a1->elevation, actionPoints, 0);
@ -3198,7 +3198,7 @@ bool objectCanHearObject(Object* a1, Object* a2)
int sneak = skillGetValue(a2, SKILL_SNEAK);
if (_can_see(a1, a2)) {
int v8 = perception * 5;
if ((a2->flags & OBJECT_FLAG_0x20000) != 0) {
if ((a2->flags & OBJECT_TRANS_GLASS) != 0) {
v8 /= 2;
}

View File

@ -1927,16 +1927,16 @@ int gameMouseObjectsInit()
return -1;
}
gGameMouseBouncingCursor->flags |= OBJECT_FLAG_0x20000000;
gGameMouseBouncingCursor->flags |= OBJECT_LIGHT_THRU;
gGameMouseBouncingCursor->flags |= OBJECT_TEMPORARY;
gGameMouseBouncingCursor->flags |= OBJECT_FLAG_0x400;
gGameMouseBouncingCursor->flags |= OBJECT_FLAG_0x80000000;
gGameMouseBouncingCursor->flags |= OBJECT_SHOOT_THRU;
gGameMouseBouncingCursor->flags |= OBJECT_NO_BLOCK;
gGameMouseHexCursor->flags |= OBJECT_FLAG_0x400;
gGameMouseHexCursor->flags |= OBJECT_TEMPORARY;
gGameMouseHexCursor->flags |= OBJECT_FLAG_0x20000000;
gGameMouseHexCursor->flags |= OBJECT_FLAG_0x80000000;
gGameMouseHexCursor->flags |= OBJECT_LIGHT_THRU;
gGameMouseHexCursor->flags |= OBJECT_SHOOT_THRU;
gGameMouseHexCursor->flags |= OBJECT_NO_BLOCK;
_obj_toggle_flat(gGameMouseHexCursor, NULL);

View File

@ -576,11 +576,11 @@ bool _item_identical(Object* a1, Object* a2)
return false;
}
if ((a1->flags & (OBJECT_EQUIPPED | OBJECT_FLAG_0x2000)) != 0) {
if ((a1->flags & (OBJECT_EQUIPPED | OBJECT_USED)) != 0) {
return false;
}
if ((a2->flags & (OBJECT_EQUIPPED | OBJECT_FLAG_0x2000)) != 0) {
if ((a2->flags & (OBJECT_EQUIPPED | OBJECT_USED)) != 0) {
return false;
}
@ -989,14 +989,14 @@ int _item_queued(Object* obj)
return false;
}
if ((obj->flags & OBJECT_FLAG_0x2000) != 0) {
if ((obj->flags & OBJECT_USED) != 0) {
return true;
}
Inventory* inventory = &(obj->data.inventory);
for (int index = 0; index < inventory->length; index++) {
InventoryItem* inventoryItem = &(inventory->items[index]);
if ((inventoryItem->item->flags & OBJECT_FLAG_0x2000) != 0) {
if ((inventoryItem->item->flags & OBJECT_USED) != 0) {
return true;
}
@ -2402,11 +2402,11 @@ int _item_m_turn_off_from_queue(Object* obj, void* data)
// 0x479960
int stealthBoyTurnOn(Object* object)
{
if ((object->flags & OBJECT_FLAG_0x20000) != 0) {
if ((object->flags & OBJECT_TRANS_GLASS) != 0) {
return -1;
}
object->flags |= OBJECT_FLAG_0x20000;
object->flags |= OBJECT_TRANS_GLASS;
Rect rect;
objectGetRect(object, &rect);
@ -2428,11 +2428,11 @@ int stealthBoyTurnOff(Object* critter, Object* item)
return -1;
}
if ((critter->flags & OBJECT_FLAG_0x20000) == 0) {
if ((critter->flags & OBJECT_TRANS_GLASS) == 0) {
return -1;
}
critter->flags &= ~OBJECT_FLAG_0x20000;
critter->flags &= ~OBJECT_TRANS_GLASS;
Rect rect;
objectGetRect(critter, &rect);

View File

@ -199,7 +199,7 @@ int falloutMain(int argc, char** argv)
mainMenuWindowHide(true);
mainMenuWindowFree();
_game_user_wants_to_quit = 0;
gDude->flags &= ~OBJECT_FLAG_0x08;
gDude->flags &= ~OBJECT_FLAT;
_main_show_death_scene = 0;
objectShow(gDude, NULL);
mouseHideCursor();
@ -301,7 +301,7 @@ int _main_load_new(char* mapFileName)
{
_game_user_wants_to_quit = 0;
_main_show_death_scene = 0;
gDude->flags &= ~OBJECT_FLAG_0x08;
gDude->flags &= ~OBJECT_FLAT;
objectShow(gDude, NULL);
mouseHideCursor();

View File

@ -903,7 +903,7 @@ int mapLoad(File* stream)
Object* object;
int fid = buildFid(5, 12, 0, 0, 0);
objectCreateWithFidPid(&object, fid, -1);
object->flags |= (OBJECT_FLAG_0x20000000 | OBJECT_TEMPORARY | OBJECT_HIDDEN);
object->flags |= (OBJECT_LIGHT_THRU | OBJECT_TEMPORARY | OBJECT_HIDDEN);
objectSetLocation(object, 1, 0, NULL);
object->sid = gMapSid;
scriptSetFixedParam(gMapSid, (gMapHeader.flags & 1) == 0);

View File

@ -39,31 +39,31 @@ typedef enum OutlineType {
typedef enum ObjectFlags {
OBJECT_HIDDEN = 0x01,
OBJECT_TEMPORARY = 0x04,
OBJECT_FLAG_0x08 = 0x08,
OBJECT_FLAT = 0x08,
OBJECT_NO_BLOCK = 0x10,
OBJECT_LIGHTING = 0x20,
OBJECT_FLAG_0x400 = 0x400,
OBJECT_FLAG_0x800 = 0x800,
OBJECT_FLAG_0x1000 = 0x1000,
OBJECT_FLAG_0x2000 = 0x2000,
OBJECT_FLAG_0x4000 = 0x4000,
OBJECT_FLAG_0x8000 = 0x8000,
OBJECT_FLAG_0x10000 = 0x10000,
OBJECT_FLAG_0x20000 = 0x20000,
OBJECT_FLAG_0x40000 = 0x40000,
OBJECT_FLAG_0x80000 = 0x80000,
OBJECT_FLAG_0x400 = 0x400, // ???
OBJECT_MULTIHEX = 0x800,
OBJECT_NO_HIGHLIGHT = 0x1000,
OBJECT_USED = 0x2000, // set if there was/is any event for the object
OBJECT_TRANS_RED = 0x4000,
OBJECT_TRANS_NONE = 0x8000,
OBJECT_TRANS_WALL = 0x10000,
OBJECT_TRANS_GLASS = 0x20000,
OBJECT_TRANS_STEAM = 0x40000,
OBJECT_TRANS_ENERGY = 0x80000,
OBJECT_IN_LEFT_HAND = 0x1000000,
OBJECT_IN_RIGHT_HAND = 0x2000000,
OBJECT_WORN = 0x4000000,
OBJECT_FLAG_0x10000000 = 0x10000000,
OBJECT_FLAG_0x20000000 = 0x20000000,
OBJECT_FLAG_0x40000000 = 0x40000000,
OBJECT_FLAG_0x80000000 = 0x80000000,
OBJECT_WALL_TRANS_END = 0x10000000,
OBJECT_LIGHT_THRU = 0x20000000,
OBJECT_SEEN = 0x40000000,
OBJECT_SHOOT_THRU = 0x80000000,
OBJECT_IN_ANY_HAND = OBJECT_IN_LEFT_HAND | OBJECT_IN_RIGHT_HAND,
OBJECT_EQUIPPED = OBJECT_IN_ANY_HAND | OBJECT_WORN,
OBJECT_FLAG_0xFC000 = OBJECT_FLAG_0x80000 | OBJECT_FLAG_0x40000 | OBJECT_FLAG_0x20000 | OBJECT_FLAG_0x10000 | OBJECT_FLAG_0x8000 | OBJECT_FLAG_0x4000,
OBJECT_OPEN_DOOR = OBJECT_FLAG_0x80000000 | OBJECT_FLAG_0x20000000 | OBJECT_NO_BLOCK,
OBJECT_FLAG_0xFC000 = OBJECT_TRANS_ENERGY | OBJECT_TRANS_STEAM | OBJECT_TRANS_GLASS | OBJECT_TRANS_WALL | OBJECT_TRANS_NONE | OBJECT_TRANS_RED,
OBJECT_OPEN_DOOR = OBJECT_SHOOT_THRU | OBJECT_LIGHT_THRU | OBJECT_NO_BLOCK,
} ObjectFlags;
#define OUTLINE_TYPE_MASK 0xFFFFFF

View File

@ -317,7 +317,7 @@ int objectsInit(unsigned char* buf, int width, int height, int pitch)
gDude->flags |= OBJECT_FLAG_0x400;
gDude->flags |= OBJECT_TEMPORARY;
gDude->flags |= OBJECT_HIDDEN;
gDude->flags |= OBJECT_FLAG_0x20000000;
gDude->flags |= OBJECT_LIGHT_THRU;
objectSetLight(gDude, 4, 0x10000, NULL);
if (partyMemberAdd(gDude) == -1) {
@ -330,7 +330,7 @@ int objectsInit(unsigned char* buf, int width, int height, int pitch)
gEgg->flags |= OBJECT_FLAG_0x400;
gEgg->flags |= OBJECT_TEMPORARY;
gEgg->flags |= OBJECT_HIDDEN;
gEgg->flags |= OBJECT_FLAG_0x20000000;
gEgg->flags |= OBJECT_LIGHT_THRU;
gObjectsInitialized = true;
@ -805,7 +805,7 @@ void _obj_render_pre_roof(Rect* rect, int elevation)
}
if (elevation == objectListNode->obj->elevation) {
if ((objectListNode->obj->flags & OBJECT_FLAG_0x08) == 0) {
if ((objectListNode->obj->flags & OBJECT_FLAT) == 0) {
break;
}
@ -943,39 +943,39 @@ int objectCreateWithFidPid(Object** objectPtr, int fid, int pid)
}
if ((proto->flags & 0x800) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x800;
objectListNode->obj->flags |= OBJECT_MULTIHEX;
}
if ((proto->flags & 0x8000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x8000;
objectListNode->obj->flags |= OBJECT_TRANS_NONE;
} else {
if ((proto->flags & 0x10000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x10000;
objectListNode->obj->flags |= OBJECT_TRANS_WALL;
} else if ((proto->flags & 0x20000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x20000;
objectListNode->obj->flags |= OBJECT_TRANS_GLASS;
} else if ((proto->flags & 0x40000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x40000;
objectListNode->obj->flags |= OBJECT_TRANS_STEAM;
} else if ((proto->flags & 0x80000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x80000;
objectListNode->obj->flags |= OBJECT_TRANS_ENERGY;
} else if ((proto->flags & 0x4000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x4000;
objectListNode->obj->flags |= OBJECT_TRANS_RED;
}
}
if ((proto->flags & 0x20000000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x20000000;
objectListNode->obj->flags |= OBJECT_LIGHT_THRU;
}
if ((proto->flags & 0x80000000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x80000000;
objectListNode->obj->flags |= OBJECT_SHOOT_THRU;
}
if ((proto->flags & 0x10000000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x10000000;
objectListNode->obj->flags |= OBJECT_WALL_TRANS_END;
}
if ((proto->flags & 0x1000) != 0) {
objectListNode->obj->flags |= OBJECT_FLAG_0x1000;
objectListNode->obj->flags |= OBJECT_NO_HIGHLIGHT;
}
_obj_new_sid(objectListNode->obj, &(objectListNode->obj->sid));
@ -1041,7 +1041,7 @@ int _obj_copy(Object** a1, Object* a2)
return -1;
}
objectListNode->obj->flags &= ~OBJECT_FLAG_0x2000;
objectListNode->obj->flags &= ~OBJECT_USED;
Inventory* newInventory = &(objectListNode->obj->data.inventory);
newInventory->length = 0;
@ -1948,7 +1948,7 @@ int _obj_toggle_flat(Object* object, Rect* rect)
}
}
object->flags ^= OBJECT_FLAG_0x08;
object->flags ^= OBJECT_FLAT;
_obj_insert(node);
objectGetRect(object, &v1);
@ -1965,7 +1965,7 @@ int _obj_toggle_flat(Object* object, Rect* rect)
}
}
object->flags ^= OBJECT_FLAG_0x08;
object->flags ^= OBJECT_FLAT;
_obj_insert(node);
}
@ -2419,7 +2419,7 @@ Object* _obj_blocking_at(Object* a1, int tile, int elev)
objectListNode = gObjectListHeadByTile[neighboor];
while (objectListNode != NULL) {
v7 = objectListNode->obj;
if ((v7->flags & OBJECT_FLAG_0x800) != 0) {
if ((v7->flags & OBJECT_MULTIHEX) != 0) {
if (v7->elevation == elev) {
if ((v7->flags & OBJECT_HIDDEN) == 0 && (v7->flags & OBJECT_NO_BLOCK) == 0 && v7 != a1) {
type = (v7->fid & 0xF000000) >> 24;
@ -2451,7 +2451,7 @@ Object* _obj_shoot_blocking_at(Object* obj, int tile, int elev)
Object* candidate = objectListItem->obj;
if (candidate->elevation == elev) {
unsigned int flags = candidate->flags;
if ((flags & OBJECT_HIDDEN) == 0 && ((flags & OBJECT_NO_BLOCK) == 0 || (flags & OBJECT_FLAG_0x80000000) == 0) && candidate != obj) {
if ((flags & OBJECT_HIDDEN) == 0 && ((flags & OBJECT_NO_BLOCK) == 0 || (flags & OBJECT_SHOOT_THRU) == 0) && candidate != obj) {
int type = (candidate->fid & 0xF000000) >> 24;
// SFALL: Fix to prevent corpses from blocking line of fire.
if ((type == OBJ_TYPE_CRITTER && !critterIsDead(candidate))
@ -2474,7 +2474,7 @@ Object* _obj_shoot_blocking_at(Object* obj, int tile, int elev)
while (objectListItem != NULL) {
Object* candidate = objectListItem->obj;
unsigned int flags = candidate->flags;
if ((flags & OBJECT_FLAG_0x800) != 0) {
if ((flags & OBJECT_MULTIHEX) != 0) {
if (candidate->elevation == elev) {
if ((flags & OBJECT_HIDDEN) == 0 && (flags & OBJECT_NO_BLOCK) == 0 && candidate != obj) {
int type = (candidate->fid & 0xF000000) >> 24;
@ -2533,7 +2533,7 @@ Object* _obj_ai_blocking_at(Object* a1, int tile, int elevation)
objectListNode = gObjectListHeadByTile[candidate];
while (objectListNode != NULL) {
Object* object = objectListNode->obj;
if ((object->flags & OBJECT_FLAG_0x800) != 0) {
if ((object->flags & OBJECT_MULTIHEX) != 0) {
if (object->elevation == elevation) {
if ((object->flags & OBJECT_HIDDEN) == 0
&& (object->flags & OBJECT_NO_BLOCK) == 0
@ -2590,7 +2590,7 @@ Object* _obj_sight_blocking_at(Object* a1, int tile, int elevation)
Object* object = objectListNode->obj;
if (object->elevation == elevation
&& (object->flags & OBJECT_HIDDEN) == 0
&& (object->flags & OBJECT_FLAG_0x20000000) == 0
&& (object->flags & OBJECT_LIGHT_THRU) == 0
&& object != a1) {
int objectType = (object->fid & 0xF000000) >> 24;
if (objectType == OBJ_TYPE_SCENERY || objectType == OBJ_TYPE_WALL) {
@ -2612,11 +2612,11 @@ int objectGetDistanceBetween(Object* object1, Object* object2)
int distance = tileDistanceBetween(object1->tile, object2->tile);
if ((object1->flags & OBJECT_FLAG_0x800) != 0) {
if ((object1->flags & OBJECT_MULTIHEX) != 0) {
distance -= 1;
}
if ((object2->flags & OBJECT_FLAG_0x800) != 0) {
if ((object2->flags & OBJECT_MULTIHEX) != 0) {
distance -= 1;
}
@ -2636,11 +2636,11 @@ int objectGetDistanceBetweenTiles(Object* object1, int tile1, Object* object2, i
int distance = tileDistanceBetween(tile1, tile2);
if ((object1->flags & OBJECT_FLAG_0x800) != 0) {
if ((object1->flags & OBJECT_MULTIHEX) != 0) {
distance -= 1;
}
if ((object2->flags & OBJECT_FLAG_0x800) != 0) {
if ((object2->flags & OBJECT_MULTIHEX) != 0) {
distance -= 1;
}
@ -2869,7 +2869,7 @@ int objectSetOutline(Object* obj, int outlineType, Rect* rect)
return -1;
}
if ((obj->flags & OBJECT_FLAG_0x1000) != 0) {
if ((obj->flags & OBJECT_NO_HIGHLIGHT) != 0) {
return -1;
}
@ -2951,7 +2951,7 @@ int _obj_intersects_with(Object* object, int x, int y)
flags |= 0x01;
if ((object->flags & OBJECT_FLAG_0xFC000) != 0) {
if ((object->flags & OBJECT_FLAG_0x8000) == 0) {
if ((object->flags & OBJECT_TRANS_NONE) == 0) {
flags &= ~0x03;
flags |= 0x02;
}
@ -3100,7 +3100,7 @@ void _obj_process_seen()
if (v5 < 40000) {
for (obj_entry = gObjectListHeadByTile[v5]; obj_entry != NULL; obj_entry = obj_entry->next) {
if (obj_entry->obj->elevation == gDude->elevation) {
obj_entry->obj->flags |= OBJECT_FLAG_0x40000000;
obj_entry->obj->flags |= OBJECT_SEEN;
}
}
}
@ -3856,11 +3856,11 @@ void _obj_insert(ObjectListNode* objectListNode)
}
if (obj->elevation == objectListNode->obj->elevation) {
if ((obj->flags & OBJECT_FLAG_0x08) == 0 && (objectListNode->obj->flags & OBJECT_FLAG_0x08) != 0) {
if ((obj->flags & OBJECT_FLAT) == 0 && (objectListNode->obj->flags & OBJECT_FLAT) != 0) {
break;
}
if ((obj->flags & OBJECT_FLAG_0x08) == (objectListNode->obj->flags & OBJECT_FLAG_0x08)) {
if ((obj->flags & OBJECT_FLAT) == (objectListNode->obj->flags & OBJECT_FLAT)) {
bool v11 = false;
CacheEntry* a2;
Art* v12 = artLock(obj->fid, &a2);
@ -4553,10 +4553,10 @@ int _obj_adjust_light(Object* obj, int a2, Rect* rect)
objectGetRect(objectListNode->obj, &v29);
rectUnion(&objectRect, &v29, &objectRect);
v14 = (objectListNode->obj->flags & OBJECT_FLAG_0x20000000) == 0;
v14 = (objectListNode->obj->flags & OBJECT_LIGHT_THRU) == 0;
if ((objectListNode->obj->fid & 0xF000000) >> 24 == OBJ_TYPE_WALL) {
if ((objectListNode->obj->flags & OBJECT_FLAG_0x08) == 0) {
if ((objectListNode->obj->flags & OBJECT_FLAT) == 0) {
Proto* proto;
protoGetProto(objectListNode->obj->pid, &proto);
if ((proto->wall.extendedFlags & 0x8000000) != 0 || (proto->wall.extendedFlags & 0x40000000) != 0) {
@ -4964,7 +4964,7 @@ void _obj_render_object(Object* object, Rect* rect, int light)
v17 = tileIsInFrontOf(object->tile, gDude->tile);
if (!v17
|| !tileIsToRightOf(object->tile, gDude->tile)
|| (object->flags & OBJECT_FLAG_0x10000000) == 0) {
|| (object->flags & OBJECT_WALL_TRANS_END) == 0) {
// nothing
} else {
v17 = false;
@ -4980,7 +4980,7 @@ void _obj_render_object(Object* object, Rect* rect, int light)
v17 = tileIsToRightOf(gDude->tile, object->tile);
if (v17
&& tileIsInFrontOf(gDude->tile, object->tile)
&& (object->flags & OBJECT_FLAG_0x10000000) != 0) {
&& (object->flags & OBJECT_WALL_TRANS_END) != 0) {
v17 = 0;
}
}
@ -5071,19 +5071,19 @@ void _obj_render_object(Object* object, Rect* rect, int light)
}
switch (object->flags & OBJECT_FLAG_0xFC000) {
case OBJECT_FLAG_0x4000:
case OBJECT_TRANS_RED:
_dark_translucent_trans_buf_to_buf(src, objectWidth, objectHeight, frameWidth, gObjectsWindowBuffer, objectRect.left, objectRect.top, gObjectsWindowPitch, light, _redBlendTable, _commonGrayTable);
break;
case OBJECT_FLAG_0x10000:
case OBJECT_TRANS_WALL:
_dark_translucent_trans_buf_to_buf(src, objectWidth, objectHeight, frameWidth, gObjectsWindowBuffer, objectRect.left, objectRect.top, gObjectsWindowPitch, 0x10000, _wallBlendTable, _commonGrayTable);
break;
case OBJECT_FLAG_0x20000:
case OBJECT_TRANS_GLASS:
_dark_translucent_trans_buf_to_buf(src, objectWidth, objectHeight, frameWidth, gObjectsWindowBuffer, objectRect.left, objectRect.top, gObjectsWindowPitch, light, _glassBlendTable, _glassGrayTable);
break;
case OBJECT_FLAG_0x40000:
case OBJECT_TRANS_STEAM:
_dark_translucent_trans_buf_to_buf(src, objectWidth, objectHeight, frameWidth, gObjectsWindowBuffer, objectRect.left, objectRect.top, gObjectsWindowPitch, light, _steamBlendTable, _commonGrayTable);
break;
case OBJECT_FLAG_0x80000:
case OBJECT_TRANS_ENERGY:
_dark_translucent_trans_buf_to_buf(src, objectWidth, objectHeight, frameWidth, gObjectsWindowBuffer, objectRect.left, objectRect.top, gObjectsWindowPitch, light, _energyBlendTable, _commonGrayTable);
break;
default:

View File

@ -777,7 +777,7 @@ int _proto_dude_init(const char* path)
_proto_dude_update_gender();
_inven_reset_dude();
if ((gDude->flags & OBJECT_FLAG_0x08) != 0) {
if ((gDude->flags & OBJECT_FLAT) != 0) {
_obj_toggle_flat(gDude, NULL);
}

View File

@ -796,7 +796,7 @@ int _obj_use_flare(Object* critter_obj, Object* flare)
return -1;
}
if ((flare->flags & OBJECT_FLAG_0x2000) != 0) {
if ((flare->flags & OBJECT_USED) != 0) {
if (critter_obj == gDude) {
// The flare is already lit.
messageListItem.num = 588;
@ -854,7 +854,7 @@ int _obj_use_explosive(Object* explosive)
return -1;
}
if ((explosive->flags & OBJECT_FLAG_0x2000) != 0) {
if ((explosive->flags & OBJECT_USED) != 0) {
// The timer is already ticking.
messageListItem.num = 590;
if (messageListGetItem(&gProtoMessageList, &messageListItem)) {

View File

@ -232,7 +232,7 @@ int queueAddEvent(int delay, Object* obj, void* data, int eventType)
newQueueListNode->data = data;
if (obj != NULL) {
obj->flags |= OBJECT_FLAG_0x2000;
obj->flags |= OBJECT_USED;
}
QueueListNode** v3 = &gQueueListHead;

View File

@ -2425,7 +2425,7 @@ bool scriptsExecSpatialProc(Object* object, int tile, int elevation)
return false;
}
if ((object->flags & OBJECT_HIDDEN) != 0 || (object->flags & OBJECT_FLAG_0x08) != 0) {
if ((object->flags & OBJECT_HIDDEN) != 0 || (object->flags & OBJECT_FLAT) != 0) {
return false;
}